Introduction
A guillotina framework powered fhirpath provider. Full battery included to use fhirpath more efficiently.
If you don’t know about FHIR® and HL7®, Please have a look here.
Quickstart
Make sure fhirpath_guillotina is added as addon in your guillotina configure file.
Make sure elasticsearch server configured properly.
Make sure you have FHIR resource contenttypes registered (see example bellow).
Make sure you have FHIR resources mapping (correct version) for elasticsearch.
Example: Add Contents:
>>> from fhirpath_guillotina.field import FhirField
class IOrganization(IFhirContent, IContentIndex):
index_field(
"organization_resource",
type="object",
field_mapping=fhir_resource_mapping("Organization"),
fhirpath_enabled=True,
resource_type="Organization",
fhir_release=FHIR_VERSION.R4,
)
index_field("org_type", type="keyword")
org_type = TextLine(title="Organization Type", required=False)
organization_resource = FhirField(
title="Organization Resource", resource_type="Organization", fhir_release="R4"
)
@configure.contenttype(type_name="Organization", schema=IOrganization)
class Organization(Folder):
""" """
index(schemas=[IOrganization], settings={})
resource_type = "Organization"
Example Search:
>>> from guillotina.component import query_utility
>>> from fhirpath.interfaces import ISearchContextFactory
>>> from fhirpath.interfaces import IFhirSearch
>>> search_context = query_utility(ISearchContextFactory).get(
... resource_type="Organization"
... )
>>> search_tool = query_utility(IFhirSearch)
>>> params = (
... ("active", "true"),
... ("_lastUpdated", "2010-05-28T05:35:56+00:00"),
... ("_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")
... )
>>> fhir_bundle = await search_tool(params, context=search_context)
>>> fhir_bundle.total == len(fhir_bundle.entry)
Example FhirPath Query:
>>> from fhirpath.interfaces import IElasticsearchEngineFactory
>>> from guillotina.component import query_utility
>>> from fhirpath.enums import SortOrderType
>>> from fhirpath.fql import Q_
>>> from fhirpath.fql import T_
>>> from fhirpath.fql import V_
>>> from fhirpath.fql import sort_
>>> engine = query_utility(IElasticsearchEngineFactory).get()
>>> query_builder = Q_(resource="Organization", engine=engine)
>>> query_builder = (
... query_builder.where(T_("Organization.active") == V_("true"))
... .where(T_("Organization.meta.lastUpdated", "2010-05-28T05:35:56+00:00"))
... .sort(sort_("Organization.meta.lastUpdated", SortOrderType.DESC))
... .limit(20)
... )
>>> query_result = query_builder(async_result=True)
>>> result = query_result.fetchall()
>>> result.header.total == 100
True
>>> len(result.body) == 20
True
>>> async for resource in query_result:
... assert resource.resource_type == "Organization"
Free software: GNU General Public License v3
Documentation: https://fhirpath-guillotina.readthedocs.io.
Credits
This package skeleton was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.
History
0.4.0 (2020-05-16)
Improvements
supports fhirpath 0.6.1 or later version.
supports guillotina 5.3.x but not 6.x.x
0.3.0 (2019-11-13)
Improvements
supports https://pypi.org/project/fhirpath/ 0.4.0 or later version.
0.2.0 (2019-10-10)
Full (almost) featured FHIR Search R4 supports.
0.1.0 (2019-08-24)
First release on PyPI. [nazrulworld]
Metadata
Release files for fhirpath-guillotina 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| fhirpath_guillotina-0.4.0.tar.gz | 16.9 kB | Without provenance | Details for fhirpath_guillotina-0.4.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| fhirpath_guillotina-0.4.0-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details for fhirpath_guillotina-0.4.0-py2.py3-none-any.whl |
Total release size: 32.3 kB
Release files / fhirpath_guillotina-0.4.0.tar.gz
| Download URL | fhirpath_guillotina-0.4.0.tar.gz |
|---|---|
| Size | 16.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
74d806152de7abc7ecb69ae1d31c39ba1535511b776f5ccfecbd14740cff4f5e
|
|
BLAKE2b-256 checksum How to use checksums |
b1c309c9873a6748f51517ce0f8082e2b0caf9be7899f1968f0c2980ea2744e5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.5
|
Release files / fhirpath_guillotina-0.4.0-py2.py3-none-any.whl
| Download URL | fhirpath_guillotina-0.4.0-py2.py3-none-any.whl |
|---|---|
| Size | 15.4 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
82087deb648fac5cc75987f4cfc6a126e2dbc07e7f7d4fcf0904db0d95e24a2a
|
|
BLAKE2b-256 checksum How to use checksums |
b271ba7788dd43cba82ecd6af92b8ee03d62f8ecacc756f38ea0cef27a828008
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.5
|
Security for fhirpath-guillotina 0.4.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.