fhirpathpy-0.1.2
توضیحات
FHIRPath implementation in Python
| ویژگی | مقدار |
|---|---|
| سیستم عامل | OS Independent |
| نام فایل | fhirpathpy-0.1.2 |
| نام | fhirpathpy |
| نسخه کتابخانه | 0.1.2 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | - |
| ایمیل نویسنده | "beda.software" <fhirpath@beda.software> |
| آدرس صفحه اصلی | - |
| آدرس اینترنتی | https://pypi.org/project/fhirpathpy/ |
| مجوز | - |
fhirpath.py
===========
[](https://github.com/beda-software/fhirpath-py/actions)
[](https://codecov.io/gh/beda-software/fhirpath-py)
[](https://pypi.org/project/fhirpathpy/)
[](https://www.python.org/downloads/release/python-380/)
[FHIRPath](https://www.hl7.org/fhir/fhirpath.html) implementation in Python
Parser was generated with [antlr4](https://github.com/antlr/antlr4)
# Getting started
## Install
`pip install fhirpathpy`
## Usage
```Python
from fhirpathpy import evaluate
patient = {
"resourceType": "Patient",
"id": "example",
"name": [
{
"use": "official",
"given": [
"Peter",
"James"
],
"family": "Chalmers"
},
{
"use": "usual",
"given": [
"Jim"
]
},
{
"use": "maiden",
"given": [
"Peter",
"James"
],
"family": "Windsor",
"period": {
"end": "2002"
}
}
]
}
# Evaluating FHIRPath
result = evaluate(patient, "Patient.name.where(use='usual').given.first()", [])
# result: `['Jim']`
```
## evaluate
> Evaluates the "path" FHIRPath expression on the given resource, using data
from "context" for variables mentioned in the "path" expression.
Parameters:
resource (dict|list): FHIR resource, bundle as js object or array of resources This resource will be modified by this function to add type information.
path (string): fhirpath expression, sample 'Patient.name.given'
context (dict): a hash of variable name/value pairs.
model (dict): The "model" data object specific to a domain, e.g. R4.
Returns:
int: Description of return value
## compile
> Returns a function that takes a resource and an optional context hash (see
"evaluate"), and returns the result of evaluating the given FHIRPath
expression on that resource. The advantage of this function over "evaluate"
is that if you have multiple resources, the given FHIRPath expression will
only be parsed once.
Parameters:
path (string) - the FHIRPath expression to be parsed.
model (dict) - The "model" data object specific to a domain, e.g. R4.
نیازمندی
| مقدار | نام |
|---|---|
| - | antlr4-python3-runtime==4.8 |
| - | pytest==7.1.1 |
| - | freezegun==1.2.2 |
| - | pyyaml==5.4 |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.8 | Python |
نحوه نصب
نصب پکیج whl fhirpathpy-0.1.2:
pip install fhirpathpy-0.1.2.whl
نصب پکیج tar.gz fhirpathpy-0.1.2:
pip install fhirpathpy-0.1.2.tar.gz