Plone powered provider for fhirpath
Project description
fhirpath implementation in Plone, battery included, ready to use.
Usages
- FHIR Search::
>>> from fhirpath.enums import FHIR_VERSION >>> from fhirpath.interfaces import IElasticsearchEngineFactory >>> from fhirpath.interfaces import IFhirSearch >>> from fhirpath.interfaces import ISearchContextFactory >>> from plone import api >>> from collective.elasticsearch.es import ElasticSearchCatalog >>> from zope.component import queryMultiAdapter
>>> es_catalog = ElasticSearchCatalog(api.portal.get_tool("portal_catalog")) >>> factory = queryMultiAdapter( .... (es_catalog,), IElasticsearchEngineFactory .... ) >>> engine = factory(fhir_version=FHIR_VERSION.STU3) >>> search_context = queryMultiAdapter((engine,), ISearchContextFactory)( .... resource_type, unrestricted=False) >>> search_factory = queryMultiAdapter((search_context,), IFhirSearch)
>>> params = ( .... ("_profile", "http://hl7.org/fhir/Organization"), .... ("identifier", "urn:oid:2.16.528.1|91654"), .... ("type", "http://hl7.org/fhir/organization-type|prov"), .... ("address-postalcode", "9100 AA"), .... ("address", "Den Burg"), .... ) >>> bundle = search_factory(params) >>> len(bundle.entry) 2
FHIR Query:
>>> from fhirpath.enums import FHIR_VERSION >>> from fhirpath.interfaces import IElasticsearchEngineFactory >>> from fhirpath.interfaces import IFhirSearch >>> from fhirpath.interfaces import ISearchContextFactory >>> from plone import api >>> from collective.elasticsearch.es import ElasticSearchCatalog >>> from zope.component import queryMultiAdapter >>> from fhirpath.query import Q_ >>> from fhirpath.fql import T_ >>> from fhirpath.fql import sort_ >>> from fhirpath.enums import SortOrderType >>> es_catalog = ElasticSearchCatalog(api.portal.get_tool("portal_catalog")) >>> factory = queryMultiAdapter( .... (es_catalog,), IElasticsearchEngineFactory .... ) >>> engine = factory(fhir_version=FHIR_VERSION.STU3) >>> query_builder = Q_(resource="Organization", engine=engine) .... query_builder = query_builder.where( .... T_("Organization.meta.profile", "http://hl7.org/fhir/Organization") .... ).sort(sort_("Organization.meta.lastUpdated", SortOrderType.DESC)) >>> result = query_builder(async_result=False, unrestricted=True).fetchall() >>> result.header.total 2 >>> query_result = query_builder(async_result=False, unrestricted=True) >>> for resource in query_result: .... count += 1 .... assert resource.__class__.__name__ == "OrganizationModel" >>> query_builder = Q_(resource="Organization", engine=engine) >>> query_builder = query_builder.where(T_("Organization.id", "f001")) >>> result_query = query_builder(async_result=False, unrestricted=True) >>> resource = result_query.single() >>> resource is not None True >>> query_builder = Q_(resource="Organization", engine=engine) >>> query_builder = query_builder.where( .... T_("Organization.meta.profile", "http://hl7.org/fhir/Organization") .... ) >>> result_query = builder(async_result=False, unrestricted=True) >>> result = result_query.first() >>> isinstance(result, result_query._query.get_from()[0][1]) True
Documentation
Full documentation for end users can be found in the “docs” folder, and is also available online at https://collective-fhirpath.readthedocs.io/
Installation
Install collective.fhirpath by adding it to your buildout:
[buildout] ... eggs = collective.fhirpath
and then running bin/buildout
Contribute
Issue Tracker: https://github.com/collective/collective.fhirpath/issues
Source Code: https://github.com/collective/collective.fhirpath
Documentation: https://docs.plone.org/foo/bar
Support
If you are having issues, please let us know. We have a mailing list located at: project@example.com
License
The project is licensed under the GPLv2.
Contributors
Md Nazrul Islam, email2nazru@gmail.com
Changelog
0.2.0 (2019-09-16)
first working versions, with lots of improvements.
0.1.0 (2019-09-06)
Initial release. [nazrulworld]
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for collective.fhirpath-0.2.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0aab12a7b067d670d35b9129129238e19cce8134903dc239a0248bf518f45d9b |
|
MD5 | d6922f327592b3c4439a3cee193a82c3 |
|
BLAKE2b-256 | 23398e667c3f89fcfacf40dd14b55a53274a918c630972516870b2f68ac44d2a |
Hashes for collective.fhirpath-0.2.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ec63e18ee468bb611ae3bbbd93f4903cb6dbb342af6970db9083135b8101aea9 |
|
MD5 | 68dacb2f18bd0adf189ea6402a3565a3 |
|
BLAKE2b-256 | e54729cc0714f1e799dad8455651fee51d20c508dd335307c5717945dc46460c |