Metadata-Version: 2.1
Name: fhir_cda
Version: 1.0.4
Summary: Clinic Description Annotator for FHIR and SPARC
Keywords: fhir,SPARC,Clinic Description Annotator
Author-email: Linkun Gao <gaolinkun123@gmail.com>
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Dist: pydicom==2.4.4
Requires-Dist: pytest>=6.2.4 ; extra == "test"
Project-URL: Documentation, https://github.com/Copper3D-brids/clinic-description-annotator#readme
Project-URL: Homepage, https://github.com/Copper3D-brids/clinic-description-annotator
Project-URL: Source, https://github.com/Copper3D-brids/clinic-description-annotator.git
Provides-Extra: test

# Clinic Description Annotator

## Usage

## Annotator measurements for SPARC SDS dataset

- Add measurement for one patient
```py
from fhir_cda import Annotator
from fhir_cda.ehr import Measurement, ObservationValue, Quantity

annotator = Annotator("./dataset/dataset-sparc")

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
```py
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
```py
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

```py
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` and `code system` are:
```python
unit_system = "http://unitsofmeasure.org"
code_system = "http://loinc.org"
```
