Clinic Description Annotator for FHIR and SPARC
Project description
Clinic Description Annotator
Usage
Annotator measurements for SPARC SDS dataset
- Add measurement for one patient
from fhir_cda import Annotator
from fhir_cda.ehr import Measurement, ObservationValue, Quantity
annotator = Annotator("./dataset/dataset-sparc").measurements()
m = Measurement(
value=ObservationValue(
value_quantity=Quantity(
value=30,
unit="year",
code="a")),
code="30525-0")
annotator.add_measurements("sub-001", m).save()
- Add measurements for one patient
m1 = Measurement(
value=ObservationValue(
value_quantity=Quantity(
value=0.15,
unit="cm",
code="cm")),
code="21889-1")
m2 = Measurement(
value=ObservationValue(
value_quantity=Quantity(
value=0.15,
unit="cm",
code="cm",
system="http://unitsofmeasure.org")),
code="21889-1",
code_system="http://loinc.org",
display="Size Tumor")
annotator.add_measurements("sub-001", [m1, m2]).save()
- Add measurement for multiple patients
m = Measurement(
value=ObservationValue(value_string="Female"),
code="99502-7",
display="Recorded sex or gender",
code_system="http://loinc.org")
annotator.add_measurements(["sub-001", "sub-002"], m).save()
- A measurements for multiple patients
m1 = Measurement(
value=ObservationValue(value_string="Female"),
code="99502-7",
display="Recorded sex or gender",
code_system="http://loinc.org")
m2 = Measurement(
value=ObservationValue(
value_quantity=Quantity(
value=0.15,
unit="cm",
code="cm",
system="http://unitsofmeasure.org")),
code="21889-1",
code_system="http://loinc.org",
display="Size Tumor")
annotator.add_measurements(["sub-001", "sub-002"], [m1, m2])
annotator.save()
- Notice: The default value for
unit system
andcode system
are:
unit_system = "http://unitsofmeasure.org"
code_system = "http://loinc.org"
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
fhir_cda-1.0.5.tar.gz
(10.8 kB
view hashes)
Built Distribution
fhir_cda-1.0.5-py3-none-any.whl
(12.9 kB
view hashes)