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].paramater --> 'name' search[0].type_ --> 'string' # act like dict with parameter as key (list if non-unique parameter) search['name'] --> FHIRSearch(...) # can iterate over the paramater/value pairs for x in search: print(x) --> FHIRSearch(...) # unrecognized parameter, ignore and log it search = Search('Patient', 'random=test') search.error --> [...] # chains, does not verify target types yet search = Search('Observation', 'subject.name=peter') search[0].parameter --> 'subject' search[0].value --> 'peter' search[0].chain --> ['name']
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.0.tar.gz
(2.6 kB
view hashes)
Built Distribution
Close
Hashes for fhir_parse_qs-0.2.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bc07a2b4cc31cd904754f715468a6e2e6f1e928f9e25e7fb8a809dedfd02e055 |
|
MD5 | bee9c7caf8ffd490a43f55ca76dbe0d2 |
|
BLAKE2b-256 | c8bfb1aa248d481e7a9cc5367baa51c4dd3a6d8a6d46e9a9e5156efe92ccaed8 |