globaldothealth / fhirflat

ISARIC 3.0 Pipeline - FHIRFlat
https://fhirflat.readthedocs.io
MIT License
0 stars 0 forks source link

Add a timingPhaseDetail extension #67

Closed pipliggins closed 1 month ago

pipliggins commented 1 month ago

As per the description in https://github.com/globaldothealth/isaric3/blob/main/1_workstreams/1.01_ISARIC3/Timing_Variables.md

timingPhaseDetail is a complex (i.e. nested) extension which in FHIR format appears as

{
            "url": "timingPhaseDetail",
            "extension": [
                {
                    "url": "timingDetail",
                    "valueRange": {
                        "low": {"value": -7, "unit": "days"},
                        "high": {"value": 0, "unit": "days"},
                    },
                },
                {
                    "url": "timingPhase",
                    "valueCodeableConcept": {
                        "coding": [
                            {
                                "system": "http://snomed.info/sct",
                                "code": "281379000",
                                "display": "pre-admission",
                            }
                        ]
                    },
                },
            ],
        },

where the timingDetail portion can take either a valueCodeableConcept, valueRange, or valueString.

Also edits the flow of the flat2fhir conversion to allow for this structure and cleans up the code a bit.

codecov-commenter commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 97.93%. Comparing base (a484c4d) to head (7724350). Report is 1 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #67 +/- ## ========================================== + Coverage 97.71% 97.93% +0.22% ========================================== Files 42 44 +2 Lines 2010 2184 +174 ========================================== + Hits 1964 2139 +175 + Misses 46 45 -1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.