inferno-framework / uds-plus-test-kit

Apache License 2.0
2 stars 2 forks source link

UDS+ Lab Observation inherits US Core BMI constraints #24

Open anthonygalba opened 2 months ago

anthonygalba commented 2 months ago

Inferno is applying the BMI constraints from US Core onto the UDS+ Lab Observation resource when using the specific BMI LOINC code: image

None of these constraints are listed in the UDS+ IG, so they should not be a part of this Inferno test (or they should be added to the UDS+ IG if they are, in fact, supposed to be there).

dehall commented 2 months ago

These constraints are from base FHIR, not from US Core, but given the error messages I'm a little confused too.

There are certain "magic" codes which require that a certain profile be conformed to, one of which is BMI: http://hl7.org/fhir/R4/observation.html#core

If implementations use this Resource when expressing the profile-specific concepts as structured data, they SHALL conform to the following profiles:

Then the Vital Signs link below that brings you to the full set of magic Observation profiles, including height, weight, blood pressure, etc.

If the observation in question here has the LOINC code 39156-5 then the core BMI profile applies: http://hl7.org/fhir/R4/bmi.html

What's confusing to me though is the 5th error message in your image though, it seems to be saying that code is required but not found. Does this Observation have that code?

anthonygalba commented 2 months ago

This specific test case used LOINC 59574-4, which is BMI percentile.

I'll also call out that the 6th issue from that image also conflicts with the UDS+ IG, as the UDS+ IG requires a precision of year.

Here's the exact JSON I pasted into the test kit:

{ "category": [ { "coding": [ { "code": "laboratory", "system": "http://terminology.hl7.org/CodeSystem/observation-category" } ] } ], "code": { "coding": [ { "code": "59574-4", "system": "http://loinc.org" } ] }, "effectiveDateTime": "2024", "encounter": { "reference": "Encounter/.EnOjlM8xz8qXKvWe7KNIm1.NFqAxrC.qOE8hLDdv0Q" }, "id": ".pJN7QgAnqJnNjftcIMjD6wdQDvJidtYhzbs-PstaNc", "issued": "2024-04-04T17:54:56Z", "meta": { "profile": [ "http://fhir.org/guides/hrsa/uds-plus/StructureDefinition/uds-plus-lab-observation" ] }, "performer": [ { "reference": "Practitioner/eHRprVirvy4WAGyBeAFdS6w3" } ], "resourceType": "Observation", "status": "final", "subject": { "reference": "Patient/drhDdFRZmc-RgYtuxa-qutruINh5F788w8p8HakKaso" }, "valueString": "22" }

dehall commented 2 months ago

Thanks for sharing the actual resource, makes it a lot easier to confirm and debug!

So there are a few pieces to this. First it's important to note that the test kit is just using the HL7 validator which we consider to be authoritative, you will see the same messages for this resource at https://validator.fhir.org/ . So until this rises to the level of "confirmed bug" in either the validator or the IG we can't do anything about those error messages.

I posed a question about what codes trigger the core profiles like BMI at the FHIR Zulip: https://chat.fhir.org/#narrow/stream/291844-FHIR-Validator/topic/Magic.20Observation.20codes.20list Grahame responded that it's the concept that drives the profile not specifically the codes, meaning, if your Observation is representing BMI by any code then it must conform to that BMI profile. (I do recognize the challenge in that for an implementer) Feel free to chime in further on that thread.

But then regarding the apparent incompatibility between the UDS+ profile and the core profile, this is something that will need to be worked out with the UDS+ IG maintainers. I've gone ahead and reported the issue there as well: https://github.com/drajer-health/uds-plus/issues/62

@arscan @ljtucker FYI