Parse FHIR query string
Project description
A library to parse FHIR query strings.
Validates type and returns correct object
Built-in search parameters from FHIR standard
Parses modifiers and prefixes
Generally only have included relevant Resources with maturity greater than 2. Some exceptions.
Usage
from fhir_parse_qs import Search search = Search('Patient', 'name=bob') # Search(<endpoint>, <query_string>) # endpoint search.endpoint --> 'Patient' # all the namedtuples search.parsed --> [FHIRSearch(...)] # index as key; each parameter/value pair gets parsed into a namedtuple search[0] --> FHIRSearch(...) search[0].modifier --> None search[0].prefix --> None search[0].value --> 'bob' search[0].parameter --> 'name' search[0].type_ --> 'string' search[0].chain --> None # act like dict with parameter as key (list if non-unique parameter) search['name'] --> FHIRSearch(...) # can iterate over the parameter/value pairs for x in search: print(x) --> FHIRSearch(...) # unrecognized parameter, ignore and log it search = Search('Patient', 'random=test') search.error --> [...] # chains - namedtuple with endpoint target_parameter, target_type search = Search('Observation', 'patient.name=peter') search[0].parameter --> 'patient' search[0].value --> 'peter' search[0].chain --> [FHIRChain(...)] search[0].chain[0].endpoint = 'Patient' search[0].chain[0].target = 'name' search[0].chain[0].ttype = 'string'
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
fhir_parse_qs-0.2.1.tar.gz
(2.7 kB
view details)
Built Distribution
File details
Details for the file fhir_parse_qs-0.2.1.tar.gz
.
File metadata
- Download URL: fhir_parse_qs-0.2.1.tar.gz
- Upload date:
- Size: 2.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.7.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 773ebf9a8a51fb49cbc42e42d4e2147d0e565dc3fcc2b684f52f6293f0d2eb24 |
|
MD5 | 4f52e5f1842c619a40cfa876eb70f433 |
|
BLAKE2b-256 | d2aee7b44ec7d66625d80b038564ed490635fe718264b437b681f30c999ad565 |
Provenance
File details
Details for the file fhir_parse_qs-0.2.1-py2.py3-none-any.whl
.
File metadata
- Download URL: fhir_parse_qs-0.2.1-py2.py3-none-any.whl
- Upload date:
- Size: 2.4 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.7.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 379c0a5ce5964383af09a7a85a41b3eb3be00579a786856eae60ceb22e75f4e3 |
|
MD5 | 47c7522246a49f7e9dba17a231028aca |
|
BLAKE2b-256 | ca7381905f4c3391af8019ee54dc9d677d2872172efd8135f02cf3390a0c82fa |