awslabs / fhir-works-on-aws-deployment

A serverless implementation of the FHIR standard that enables users to focus more on their business needs/uniqueness rather than the FHIR specification
Apache License 2.0
298 stars 162 forks source link

Units "L/min" is not a valid unit of measure for valueQuantity. #741

Closed floofydoug closed 1 year ago

floofydoug commented 2 years ago

Describe the bug using US CORE 3.1.1. Attempting to store the standard us-core-pulse-oximetry example file.


POST request {{API_URL}}/tenant/sitetenant/Observation with body: 
{
    "resourceType": "Observation",
    "id": "satO2-fiO2",
    "meta": {
        "profile": ["http://hl7.org/fhir/us/core/StructureDefinition/us-core-pulse-oximetry"]
    },
    "text": {
        "status": "generated",
        "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p><b>Generated Narrative</b></p><p><b>id</b>: satO2-fiO2</p><p><b>meta</b>: </p><p><b>identifier</b>: id: o1223435-10</p><p></p><p><b>category</b>: <span title=\"Codes: {http://terminology.hl7.org/CodeSystem/observation-category vital-signs}\">Vital Signs</span></p><p><b>code</b>: <span title=\"Codes: {http://loinc.org 2708-6}, {http://loinc.org 59408-5}, {urn:iso:std:iso:11073:10101 150456}\">Oxygen saturation in Arterial blood</span></p><p><b>subject</b>: <a href=\"Patient-example.html\">Generated Summary: id: example; Medical Record Number: 1032702 (USUAL); active; Amy V. Shaw , Amy V. Baxter ; ph: 555-555-5555(HOME), amy.shaw@example.com; gender: female; birthDate: 1987-02-20</a></p><p><b>effective</b>: 05/12/2014 7:30:10 PM</p><p><b>value</b>: 95 %</p><p><b>interpretation</b>: <span title=\"Codes: {http://terminology.hl7.org/CodeSystem/v3-ObservationInterpretation N}\">Normal (applies to non-numeric results)</span></p><p><b>device</b>: <span>Acme Pulse Oximeter 2000</span></p><h3>ReferenceRanges</h3><table class=\"grid\"><tr><td>-</td><td><b>Low</b></td><td><b>High</b></td></tr><tr><td>*</td><td>90 %</td><td>99 %</td></tr></table><h3>Components</h3><table class=\"grid\"><tr><td>-</td><td><b>Code</b></td><td><b>Value[x]</b></td></tr><tr><td>*</td><td><span title=\"Codes: {http://loinc.org 3151-8}\">Inhaled oxygen flow rate</span></td><td>6 liters/min</td></tr></table></div>"
    },
    "identifier": [{
        "system": "http://goodcare.org/observation/id",
        "value": "o1223435-10"
    }],
    "status": "final",
    "category": [{
        "coding": [{
            "system": "http://terminology.hl7.org/CodeSystem/observation-category",
            "code": "vital-signs",
            "display": "Vital Signs"
        }],
        "text": "Vital Signs"
    }],
    "code": {
        "coding": [{
            "system": "http://loinc.org",
            "code": "2708-6",
            "display": "Oxygen saturation in Arterial blood"
        }, {
            "system": "http://loinc.org",
            "code": "59408-5",
            "display": "Oxygen saturation in Arterial blood by Pulse oximetry"
        }, {
            "system": "urn:iso:std:iso:11073:10101",
            "code": "150456",
            "display": "MDC_PULS_OXIM_SAT_O2"
        }]
    },
    "subject": {
        "reference": "Patient/example"
    },
    "effectiveDateTime": "2014-12-05T09:30:10+01:00",
    "valueQuantity": {
        "value": 95,
        "unit": "%",
        "system": "http://unitsofmeasure.org",
        "code": "%"
    },
    "interpretation": [{
        "coding": [{
            "system": "http://terminology.hl7.org/CodeSystem/v3-ObservationInterpretation",
            "code": "N",
            "display": "Normal"
        }],
        "text": "Normal (applies to non-numeric results)"
    }],
    "device": {
        "display": "Acme Pulse Oximeter 2000"
    },
    "referenceRange": [{
        "low": {
            "value": 90,
            "unit": "%",
            "system": "http://unitsofmeasure.org",
            "code": "%"
        },
        "high": {
            "value": 99,
            "unit": "%",
            "system": "http://unitsofmeasure.org",
            "code": "%"
        }
    }],
    "component": [{
        "code": {
            "coding": [{
                "system": "http://loinc.org",
                "code": "3151-8",
                "display": "Inhaled oxygen flow rate"
            }],
            "text": "Inhaled oxygen flow rate"
        },
        "valueQuantity": {
            "value": 6,
            "unit": "liters/min",
            "system": "http://unitsofmeasure.org",
            "code": "L/min"
        }
    }]
}

Error from validator:

{
    "resourceType": "OperationOutcome",
    "text": {
        "status": "generated",
        "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><h1>Operation Outcome</h1><table border=\"0\"><tr><td style=\"font-weight: bold;\">error</td><td>[]</td><td><pre>Observation.component[0].value.ofType(Quantity) - The code provided (http://unitsofmeasure.org#L/min) is not in the value set http://hl7.org/fhir/ValueSet/ucum-vitals-common|4.0.1(which actually refers to http://hl7.org/fhir/ValueSet/ucum-vitals-common), and a code from this value set is required: Unknown code 'http://unitsofmeasure.org#L/min'</pre></td></tr></table></div>"
    },
    "issue": [
        {
            "severity": "error",
            "code": "invalid",
            "diagnostics": "Observation.component[0].value.ofType(Quantity) - The code provided (http://unitsofmeasure.org#L/min) is not in the value set http://hl7.org/fhir/ValueSet/ucum-vitals-common|4.0.1(which actually refers to http://hl7.org/fhir/ValueSet/ucum-vitals-common), and a code from this value set is required: Unknown code 'http://unitsofmeasure.org#L/min'"
        }
    ]

To Reproduce Steps to reproduce the behavior:

  1. Attempt to store the standard us-core-pulse-oximetry observation

Expected behavior L/min should be a valid unit of measure. It is the only expected unit for pulse oximetry. See US Core spec: http://hl7.org/fhir/us/core/STU3.1.1/StructureDefinition-us-core-pulse-oximetry.html

aws-tyler commented 2 years ago

Thanks for reporting @floofydoug! We've been able to reproduce; adding it to our backlog.

sevu1 commented 1 year ago

@floofydoug , based on detailed investigation: this issue is discussed and requires correction; as a workaround we suggest updating StructureDefinition-us-core-pulse-oximetry.json replacing http://hl7.org/fhir/ValueSet/ucum-vitals-common|4.0.1 (there are 3 places in the file to be updated) with http://hl7.org/fhir/ValueSet/ucum-common|4.0.1, recompile IG and redeploy FHIR. image

Hope this will help and let us know if you need more details

github-actions[bot] commented 1 year ago

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.