All Projects → nazrulworld → fhirpath

nazrulworld / fhirpath

Licence: Apache-2.0 License
FHIRPath implementation in Python.

Programming Languages

python
139335 projects - #7 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to fhirpath

hl7v2-fhir-converter
Converts HL7 v2 Messages to FHIR Resources
Stars: ✭ 40 (+60%)
Mutual labels:  healthcare, fhir, hl7
CyFHIR
A Neo4j Plugin for Handling HL7 FHIR Data
Stars: ✭ 39 (+56%)
Mutual labels:  healthcare, fhir, hl7
fhir-works-on-aws-persistence-ddb
A DynamoDB implementation of the FHIR Works on AWS framework, enabling users to complete CRUD operations on FHIR resources
Stars: ✭ 24 (-4%)
Mutual labels:  healthcare, fhir, hl7
cql
Clincal Quality Language Specification
Stars: ✭ 16 (-36%)
Mutual labels:  fhir, hl7, fhirpath
Openemr
The most popular open source electronic health records and medical practice management solution.
Stars: ✭ 1,762 (+6948%)
Mutual labels:  healthcare, fhir
php-fhir
Tools for consuming data from a FHIR server with PHP
Stars: ✭ 87 (+248%)
Mutual labels:  fhir, hl7
loinc2hpo
Java library to map LOINC-encoded test results to Human Phenotype Ontology
Stars: ✭ 19 (-24%)
Mutual labels:  healthcare, fhir
hedis-ig
HEDIS FHIR-based Quality Reporting
Stars: ✭ 24 (-4%)
Mutual labels:  fhir, fhir-profiles
monai-deploy
MONAI Deploy aims to become the de-facto standard for developing, packaging, testing, deploying and running medical AI applications in clinical production.
Stars: ✭ 56 (+124%)
Mutual labels:  healthcare, fhir
sundly
💛 Encrypted & decentralized personal health records. Built on Blockstack and powered by Blockchain.
Stars: ✭ 24 (-4%)
Mutual labels:  healthcare, fhir
basisprofil-de-r4
No description or website provided.
Stars: ✭ 15 (-40%)
Mutual labels:  fhir, fhir-profiles
firely-net-common
The official Firely .NET SDK for HL7 FHIR - Contains common code for all FHIR versions
Stars: ✭ 31 (+24%)
Mutual labels:  fhir, hl7
golang-fhir-models
FHIR Models for Go
Stars: ✭ 27 (+8%)
Mutual labels:  fhir
aarogya seva
A beautiful 😍 covid-19 app with self - assessment and more.
Stars: ✭ 118 (+372%)
Mutual labels:  healthcare
cusumcharter
Easier CUSUM control charts. Returns simple CUSUM statistics, CUSUMs with control limit calculations, and function to generate faceted CUSUM Control Charts
Stars: ✭ 17 (-32%)
Mutual labels:  healthcare
medical-transcription-analysis
Medical Transcription Analysis (MTA) demonstrates how the integration of Amazon Comprehend Medical and Amazon Transcribe Medical can be used to transcribe audio data, extract key medical components and tag the data to their corresponding entities. Automating the medical transcription and comprehension process makes it easier for health care prof…
Stars: ✭ 54 (+116%)
Mutual labels:  healthcare
BioBalanceDetector
Bio Balance Detector's products aim to show the weak electromagnetic fields around every living being (including plants, animals and humans) and display it in a heat-map like hyper-spectral image.
Stars: ✭ 18 (-28%)
Mutual labels:  healthcare
fhir-fuel.github.io
Place to prepare proposal to FHIR about JSON, JSON-Schema, Swagger/OpenAPI, JSON native databases and other JSON-frendly formats (yaml, edn, avro, protobuf etc) and technologies
Stars: ✭ 20 (-20%)
Mutual labels:  fhir
DocProduct
Medical Q&A with Deep Language Models
Stars: ✭ 527 (+2008%)
Mutual labels:  healthcare
healthcare
Open Source Healthcare ERP / Management System
Stars: ✭ 68 (+172%)
Mutual labels:  healthcare

Introduction

Documentation Status Test Coverage Python Versions Language grade: Python License Downloads HL7® FHIR®

FHIRPath Normative Release (v2.0.0) implementation in Python, along side it provides support for FHIR Search API and Query (we called it fql(FHIR Query Language)) API to fetch FHIR resources from any data-source(database). This library is built in ORM like approach. Our goal is to make 100% (as much as possible) FHIRPath Normative Release (v2.0.0) specification compliance product.

Usages

This library is kind of abstract type, where all specifications from FHIRPath Normative Release (v2.0.0) are implemented rather than completed solution (ready to go). The main reason behind this design pattern, to support multiple database systems as well as well as any framework, there is no dependency.

fhirpath never taking care of creating indexes, mappings (elasticsearch) and storing data, if you want to use this library, you have to go through any of existing providers (see list bellow) or make your own provider (should not too hard work).

Simple example

Assumption:

  1. Elasticsearch server 7.x.x Installed.
  2. Mappings and indexes are handled manually.
  3. Data (document) also are stored manually.

Create Connection and Engine:

>>> from fhirpath.connectors import create_connection
>>> from fhirpath.engine.es import ElasticsearchEngine
>>> from fhirpath.engine import dialect_factory
>>> from fhirpath.enums import FHIR_VERSION

>>> host, port = "127.0.0.1", 9200
>>> conn_str = "es://@{0}:{1}/".format(host, port)
>>> connection = create_connection(conn_str, "elasticsearch.Elasticsearch")
>>> connection.raw_connection.ping()
True
>>> engine = ElasticsearchEngine(FHIR_VERSION.R4, lambda x: connection, dialect_factory)

Basic Search:

>>> from fhirpath.search import Search
>>> from fhirpath.search import SearchContext

>>> search_context = SearchContext(engine, "Organization")
>>> 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"),
....    ("address", "Den Burg"),
.... )
>>> fhir_search = Search(search_context, params=params)
>>> bundle = fhir_search()
>>> len(bundle.entry) == 0
True

Basic Query:

>>> from fhirpath.enums import SortOrderType
>>> from fhirpath.query import Q_
>>> from fhirpath.fql import T_
>>> from fhirpath.fql import V_
>>> from fhirpath.fql import exists_
>>> 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))
.... )
>>> query_result = query_builder(async_result=False)
>>> for resource in query_result:
....    assert resource.__class__.__name__ == "OrganizationModel"
>>> # test fetch all
>>> result = query_result.fetchall()
>>> result.__class__.__name__ == "EngineResult"
True

>>> query_builder = Q_(resource="ChargeItem", engine=engine)
>>> query_builder = query_builder.where(exists_("ChargeItem.enteredDate"))
>>> result = query_builder(async_result=False).single()
>>> result is not None
True
>>> isinstance(result, builder._from[0][1])
True

>>> query_builder = Q_(resource="ChargeItem", engine=engine)
>>> query_builder = query_builder.where(exists_("ChargeItem.enteredDate"))
>>> result = query_builder(async_result=False).first()
>>> result is not None
True
>>> isinstance(result, builder._from[0][1])
True

Available Provider (known)

Currently very few numbers of providers available, however more will coming soon.

fhirpath-guillotina

A guillotina framework powered provider, battery included, ready to go! Please follow associated documentation.

  1. Engine: Elasticsearch
  2. PyPi: https://pypi.org/project/fhirpath-guillotina/
  3. Source: https://github.com/nazrulworld/fhirpath_guillotina

collective.fhirpath

A Plone powered provider, like fhirpath-guillotina every thing is included. ready to go, although has a dependency on plone.app.fhirfield.

  1. Engine: Elasticsearch
  2. PyPi: https://pypi.org/project/collective.fhirpath/
  3. Source: https://github.com/nazrulworld/collective.fhirpath

unlisted

Why are you waiting for? You are welcome to list your provider here! Developing provider should not be so hard, as fhirpath is giving you convenient APIs.

Elasticsearch Custom Analyzer

To get some special search features for reference type field, you will need to setup custom analyzer for your elasticsearch index.

Example Custom Analyzer:

settings = {
    "analysis": {
        "normalizer": {
            "fhir_token_normalizer": {"filter": ["lowercase", "asciifolding"]}
        },
        "analyzer": {
            "fhir_reference_analyzer": {
                "tokenizer": "keyword",
                "filter": ["fhir_reference_filter"],
            },
        },
        "filter": {
            "fhir_reference_filter": {
                "type": "pattern_capture",
                "preserve_original": True,
                "patterns": [r"(?:\w+\/)?(https?\:\/\/.*|[a-zA-Z0-9_-]+)"],
            },
        },
        "char_filter": {},
        "tokenizer": {},
    }

Example Mapping (Reference Field):

"properties": {
  "reference": {
    "type": "text",
    "index": true,
    "store": false,
    "analyzer": "fhir_reference_analyzer"
}

ToDo

  1. fhirbase engine aka provider implementation.
  2. All methods/functions are defined in FHIRPath specification, would be completed.
  3. Implement https://github.com/ijl/orjson
  4. https://developers.redhat.com/blog/2017/11/16/speed-python-using-rust/

Credits

This package skeleton was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

© Copyright HL7® logo, FHIR® logo and the flaming fire are registered trademarks owned by Health Level Seven International

"FHIR® is the registered trademark of HL7 and is used with the permission of HL7. Use of the FHIR trademark does not constitute endorsement of this product by HL7" https://github.com/beda-software/fhirpath-py

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].