{"id":19618872,"url":"https://github.com/nazrulworld/collective.fhirpath","last_synced_at":"2025-02-26T18:24:31.749Z","repository":{"id":62563565,"uuid":"204455077","full_name":"nazrulworld/collective.fhirpath","owner":"nazrulworld","description":"Plone powered provider for fhirptah","archived":false,"fork":false,"pushed_at":"2022-06-13T12:55:41.000Z","size":404,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-09T15:38:06.713Z","etag":null,"topics":["fhir","fhirpath","healthcare","healthtech","hl7","plone"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nazrulworld.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGES.rst","contributing":null,"funding":null,"license":"LICENSE.GPL","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-08-26T10:48:27.000Z","updated_at":"2022-06-13T12:40:51.000Z","dependencies_parsed_at":"2022-11-03T16:00:21.922Z","dependency_job_id":null,"html_url":"https://github.com/nazrulworld/collective.fhirpath","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nazrulworld%2Fcollective.fhirpath","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nazrulworld%2Fcollective.fhirpath/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nazrulworld%2Fcollective.fhirpath/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nazrulworld%2Fcollective.fhirpath/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nazrulworld","download_url":"https://codeload.github.com/nazrulworld/collective.fhirpath/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240909694,"owners_count":19877014,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fhir","fhirpath","healthcare","healthtech","hl7","plone"],"created_at":"2024-11-11T11:11:08.672Z","updated_at":"2025-02-26T18:24:31.722Z","avatar_url":"https://github.com/nazrulworld.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":".. image:: https://img.shields.io/pypi/status/collective.fhirpath.svg\n    :target: https://pypi.org/project/collective.fhirpath/\n    :alt: Egg Status\n\n.. image:: https://img.shields.io/travis/nazrulworld/collective.fhirpath/master.svg\n    :target: https://app.travis-ci.com/github/nazrulworld/collective.fhirpath\n    :alt: Travis Build Status\n\n.. image:: https://coveralls.io/repos/github/nazrulworld/collective.fhirpath/badge.svg?branch=master\n    :target: https://coveralls.io/github/nazrulworld/collective.fhirpath?branch=master\n    :alt: Test Coverage\n\n.. image:: https://img.shields.io/pypi/pyversions/collective.fhirpath.svg\n    :target: https://pypi.python.org/pypi/collective.fhirpath/\n    :alt: Python Versions\n\n.. image:: https://img.shields.io/pypi/v/collective.fhirpath.svg\n    :target: https://pypi.python.org/pypi/collective.fhirpath/\n    :alt: Latest Version\n\n.. image:: https://img.shields.io/pypi/l/collective.fhirpath.svg\n    :target: https://pypi.python.org/pypi/collective.fhirpath/\n    :alt: License\n\n.. image:: https://img.shields.io/badge/code%20style-black-000000.svg\n    :target: https://github.com/ambv/black\n\n\nBackground (collective.fhirpath)\n================================\n\n`fhirpath`_ implementation in Plone, essential battery included, ready to use.\n\n\nInstallation\n------------\n\nInstall collective.fhirpath by adding it to your buildout::\n\n    [buildout]\n    ...\n    eggs +=\n        collective.fhirpath\n\n\nand then running ``bin/buildout``\n\nFrom Plone controlpanel in the addon settings, install ``collective.fhirpath``.\n\nHow It Works\n------------\n\n**``FhirResource`` the fhirfield**\n\nMake sure this specialized field is used properly according to `plone.app.fhirfield`_ documentation.\n\n**Make field indexable**\n\nA specilized Catalog PluginIndexes is named ``FhirFieldIndex`` is available, you will use it as like other catalog indexes.\n\nExample::\n\n    \u003c?xml version=\"1.0\"?\u003e\n    \u003cobject name=\"portal_catalog\" meta_type=\"Plone Catalog Tool\"\u003e\n        \u003cindex name=\"organization_resource\" meta_type=\"FhirFieldIndex\"\u003e\n            \u003cindexed_attr value=\"organization_resource\"/\u003e\n        \u003c/index\u003e\n    \u003c/object\u003e\n\n**Elasticsearch settings**\n\nMake sure elasticsearch has been configured accourding to `collective.elasticsearch`_ docs.\n\n\nUsages\n~~~~~~\n\nFHIR Search::\n    \u003e\u003e\u003e from fhirpath.interfaces import IElasticsearchEngineFactory\n    \u003e\u003e\u003e from fhirpath.interfaces import IFhirSearch\n    \u003e\u003e\u003e from fhirpath.interfaces import ISearchContextFactory\n    \u003e\u003e\u003e from plone import api\n    \u003e\u003e\u003e from collective.elasticsearch.es import ElasticSearchCatalog\n    \u003e\u003e\u003e from zope.component import queryMultiAdapter\n\n    \u003e\u003e\u003e es_catalog = ElasticSearchCatalog(api.portal.get_tool(\"portal_catalog\"))\n    \u003e\u003e\u003e factory = queryMultiAdapter(\n    ....        (es_catalog,), IElasticsearchEngineFactory\n    .... )\n    \u003e\u003e\u003e engine = factory(fhir_release=\"STU3\")\n    \u003e\u003e\u003e search_context = queryMultiAdapter((engine,), ISearchContextFactory)(\n    .... resource_type, unrestricted=False)\n    \u003e\u003e\u003e search_factory = queryMultiAdapter((search_context,), IFhirSearch)\n\n    \u003e\u003e\u003e params = (\n    ....        (\"_profile\", \"http://hl7.org/fhir/Organization\"),\n    ....        (\"identifier\", \"urn:oid:2.16.528.1|91654\"),\n    ....        (\"type\", \"http://hl7.org/fhir/organization-type|prov\"),\n    ....        (\"address-postalcode\", \"9100 AA\"),\n    ....        (\"address\", \"Den Burg\"),\n    ....    )\n    \u003e\u003e\u003e bundle = search_factory(params)\n    \u003e\u003e\u003e len(bundle.entry)\n    2\n    \u003e\u003e\u003e # with query string.\n    \u003e\u003e\u003e # query_string = self.request[\"QUERY_STRING]\n    \u003e\u003e\u003e query_string = \"_profile=http://hl7.org/fhir/Organization\u0026identifier=urn:oid:2.16.528.1|91654\u0026type=http://hl7.org/fhir/organization-type|prov\u0026address-postalcode=9100+AA\"\n    \u003e\u003e\u003e bundle = search_factory(query_string=query_string)\n    \u003e\u003e\u003e len(bundle.entry)\n    2\n\nZCatlog FHIR Search::\n    \u003e\u003e\u003e from collective.fhirpath.interfaces import IZCatalogFhirSearch\n    \u003e\u003e\u003e zcatalog_factory = queryMultiAdapter((search_context,), IZCatalogFhirSearch)\n\n    \u003e\u003e\u003e # with query string.\n    \u003e\u003e\u003e # query_string = self.request[\"QUERY_STRING]\n    \u003e\u003e\u003e query_string = \"_profile=http://hl7.org/fhir/Organization\u0026identifier=urn:oid:2.16.528.1|91654\u0026type=http://hl7.org/fhir/organization-type|prov\u0026address-postalcode=9100+AA\"\n    \u003e\u003e\u003e brains = zcatalog_factory(query_string=query_string)\n    \u003e\u003e\u003e len(brains)\n    2\n\nFHIR Query::\n    \u003e\u003e\u003e from fhirpath.interfaces import IElasticsearchEngineFactory\n    \u003e\u003e\u003e from fhirpath.interfaces import IFhirSearch\n    \u003e\u003e\u003e from fhirpath.interfaces import ISearchContextFactory\n    \u003e\u003e\u003e from plone import api\n    \u003e\u003e\u003e from collective.elasticsearch.es import ElasticSearchCatalog\n    \u003e\u003e\u003e from zope.component import queryMultiAdapter\n    \u003e\u003e\u003e from fhirpath.query import Q_\n    \u003e\u003e\u003e from fhirpath.fql import T_\n    \u003e\u003e\u003e from fhirpath.fql import sort_\n    \u003e\u003e\u003e from fhirpath.enums import SortOrderType\n\n    \u003e\u003e\u003e es_catalog = ElasticSearchCatalog(api.portal.get_tool(\"portal_catalog\"))\n    \u003e\u003e\u003e factory = queryMultiAdapter(\n    ....        (es_catalog,), IElasticsearchEngineFactory\n    .... )\n    \u003e\u003e\u003e engine = factory(fhir_release=\"STU3\")\n    \u003e\u003e\u003e query_builder = Q_(resource=\"Organization\", engine=engine)\n    ....    query_builder = query_builder.where(\n    ....        T_(\"Organization.meta.profile\", \"http://hl7.org/fhir/Organization\")\n    ....    ).sort(sort_(\"Organization.meta.lastUpdated\", SortOrderType.DESC))\n\n    \u003e\u003e\u003e result = query_builder(async_result=False, unrestricted=True).fetchall()\n    \u003e\u003e\u003e result.header.total\n    2\n    \u003e\u003e\u003e query_result = query_builder(async_result=False, unrestricted=True)\n    \u003e\u003e\u003e for resource in query_result:\n    ....        count += 1\n    ....        assert resource.__class__.__name__ == \"Organization\"\n\n    \u003e\u003e\u003e query_builder = Q_(resource=\"Organization\", engine=engine)\n    \u003e\u003e\u003e query_builder = query_builder.where(T_(\"Organization.id\", \"f001\"))\n    \u003e\u003e\u003e result_query = query_builder(async_result=False, unrestricted=True)\n    \u003e\u003e\u003e resource = result_query.single()\n    \u003e\u003e\u003e resource is not None\n    True\n\n    \u003e\u003e\u003e query_builder = Q_(resource=\"Organization\", engine=engine)\n    \u003e\u003e\u003e query_builder = query_builder.where(\n    ....        T_(\"Organization.meta.profile\", \"http://hl7.org/fhir/Organization\")\n    ....    )\n    \u003e\u003e\u003e result_query = builder(async_result=False, unrestricted=True)\n    \u003e\u003e\u003e result = result_query.first()\n    \u003e\u003e\u003e isinstance(result, result_query._query.get_from()[0][1])\n    True\n\n\n\nUse ``FHIRModelServiceMixin``\n-----------------------------\n\nFor better performance optimization, you should use ``FHIRModelServiceMixin`` to response ``FHIRModel``, ``FhirFieldValue`` object efficiently.\n\nExample 1::\n\n    \u003e\u003e\u003e from plone.restapi.services import Service\n    \u003e\u003e\u003e from collective.fhirpath.utils import FHIRModelServiceMixin\n    \u003e\u003e\u003e class MyFHIRGetService(FHIRModelServiceMixin, Service):\n    ....     \"\"\" \"\"\"\n    ....     def reply(self):\n    ....        # do return bellow's types of data\n    ....        # could be ``dict`` type data\n    ....        # could be instance of ``FHIRAbstractModel`` derrived class.\n    ....        # could be instance of ``plone.app.fhirfield.FhirResourceValue`` derrived class.\n    ....        # or self.reply_no_content()\n\n\n\nconfiguration\n-------------\n\nThis product provides three plone registry based records ``fhirpath.es.index.mapping.nested_fields.limit``, ``fhirpath.es.index.mapping.depth.limit``, ``fhirpath.es.index.mapping.total_fields.limit``. Those are related to ElasticSearch index mapping setup, if you aware about it, then you have option to modify from plone control panel (Registry).\n\n\nDocumentation\n-------------\n\nFull documentation for end users can be found in the \"docs\" folder,\nand is also available online at https://collective-fhirpath.readthedocs.io/\n\n\n\nContribute\n----------\n\n- Issue Tracker: https://github.com/nazrulworld/collective.fhirpath/issues\n- Source Code: https://github.com/nazrulworld/collective.fhirpath\n- Documentation: https://collective-fhirpath.readthedocs.io/\n\n\nSupport\n-------\n\nIf you are having issues, please let us know at: Md Nazrul Islam\u003cemail2nazrul@gmail.com\u003e\n\n\nLicense\n-------\n\nThe project is licensed under the GPLv2.\n\n.. _`elasticsearch`: https://www.elastic.co/products/elasticsearch\n.. _`fhirpath`: https://pypi.org/project/fhirpath/\n.. _`PostgreSQL`: https://www.postgresql.org/\n.. _`plone.app.fhirfield`: https://pypi.org/project/plone.app.fhirfield/\n.. _`collective.elasticsearch`: https://pypi.org/project/collective.elasticsearch/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnazrulworld%2Fcollective.fhirpath","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnazrulworld%2Fcollective.fhirpath","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnazrulworld%2Fcollective.fhirpath/lists"}