onc-healthit / onc-certification-g10-test-kit

ONC Certification (g)(10) Standardized API Tests
Apache License 2.0
34 stars 11 forks source link

4.32 Missing Data Tests - Guidance #355

Closed SavannahDearing closed 1 year ago

SavannahDearing commented 1 year ago

Hi,

For ONC Certification (g)(10) Standardized API V.3.3.1 on inferno.healthit.gov

I seem to be having trouble with these tests.. this is my current understanding:

Looking at other issues reported, and the descriptions of the tests, there seems to be two items we're looking at: 1) Required Fields [Cardinality 1+ for FHIR endpoint specifications] 2) Must Support fields [Cardinality 1+ for FHIR endpoints under U.S. Core]

Then for Missing Data: 1) If the missing data is a CodeableConcept, and has no 'unk' / 'unknown' value in the code system, use the data-absent-reason codeset: https://www.hl7.org/FHIR/valueset-data-absent-reason.html 2) If the missing data is NOT a CodeableConcept, use the extension: https://hl7.org/FHIR/extension-data-absent-reason.html

Then these are the specific tests:

4.32.01 Server represents missing data with the DataAbsentReason Extension For non-coded data elements, servers SHALL use the DataAbsentReason Extension to represent missing data in a required field

So, is this test looking SPECIFICALLY for fields that are REQUIRED per FHIR, but NOT Must Support per US Core?

4.32.02 Server represents missing data with the DataAbsentReason CodeSystem For coded data elements with example, preferred, or extensible binding strengths to ValueSets which do not include an appropriate "unknown" code, servers SHALL use the "unknown" code from the DataAbsentReason CodeSystem.

So, is this test looking at ANY for fields that are represented by code systems that dont have unknown values? Maybe Loinc as an example?

I seem to be having trouble being able to pass this test, but also pass all other Must Support and Required Fields tests for each endpoint. Maybe an example for each test would help me understand.

yunwwang commented 1 year ago

For test 4.32.01, Inferno looks the DAR extension in any non-coded data elements. For test 4.32.02, Inferno looks the DAR code unknown in any coded data elements.

The exception here is Observation.value since Observation has a dedicated Observation.dataAbsentReason element.

These two tests are independent from validation tests and MS tests.

Inferno demo server has Condition resource having DAR extension in Condition.category for US Core v3.1.1 and US Core v4.0.0.

As an example, you can use DAR extension on CareTeam.participant

SavannahDearing commented 1 year ago

so, if I just have an extension for CareTeam.participant, we will fail the CareTeam tests: CareTeam/30560df3-fa14-4bc2-9834-7d1c360c34f0: CareTeam.participant[0]: CareTeam.participant.member: minimum required = 1, but only found 0 (from http://hl7.org/fhir/us/core/StructureDefinition/us-core-careteam)

BUT we pass the Data Absent test: 4.32.01 Server represents missing data with the DataAbsentReason Extension

So essentially to pass both tests, we MUST include multiple patients? One which has data, and one which does not.
I'm not sure if its more appropriate to "skip" a test using the extension than failing, but now that I know what to do, its easier to understand.

SavannahDearing commented 1 year ago

This led me to a follow-up question.. how to use Additional Patient IDs for the Single Patient API Test?

This seems to use the same token as the patient you logged in as during Standalone Patient App.. you cant give a second token? You must have one token that allows inferno to pull info for multiple patients? Currently we don't allow for this... there might be a use case here for primary / dependent accounts, but we don't have that feature yet.

yunwwang commented 1 year ago

May be CareTeam.participant.member. (I have not tested this by myself.)

As mentioned, Inferno does consider DAR extension on optional non-coded element as long as it follows US Core guidance. The reason is that if a system can provide all the required elements, it should not be punished by the DAR extension requirement.

You can have multiple CareTeam for a patient or a CareTeam with multiple participants and one of which has a DAR extension on participant.member.

The Test 3 is EHR practitioner login. A practitioner may have access to multiple patients. If you run the tests in sequence, the token in Test 3 is used in the following Single Patient (Test 4) tests.

SavannahDearing commented 1 year ago

OK this seems to work and allow us to pass the tests for CareTeam.participant.member

{
"member" : 
{
    "extension" : 
    [
        {
            "url" : "http://hl7.org/fhir/StructureDefinition/data-absent-reason",
            "valueCode" : "unknown"
        }
    ]
}
}

I thought this would pass the Code test, using Encounter.hospitalization.dischargeDisposition [we are primarily an ambulatory system]

"hospitalization" : {
      "dischargeDisposition" : {
         "coding" : [
            {
               "code" : "unknown",
               "system" : "http://hl7.org/fhir/StructureDefinition/data-absent-reason"
            }
         ]
      }
   },

But we are still failing the Code test: 4.32.02 Server represents missing data with the DataAbsentReason CodeSystem No resources using the DataAbsentReason CodeSystem have been found

I also tried CareTeam.participant.role, which passed the care team tests, but still failed 4.32.02 --- but I suspect that might be because snomed has unknown codes that could be used.

yunwwang commented 1 year ago

The system value is wrong. it should be http://terminology.hl7.org/CodeSystem/data-absent-reason

SavannahDearing commented 1 year ago

I was JUST looking that up after I re-read!! Testing :)

SavannahDearing commented 1 year ago

It all works, thank you!