Assistance with FHIR Bundle Validation Issues (Java 21 & HAPI-FHIR Validator 7.4.0)

122 views
Skip to first unread message

Vinod Aravind

unread,
Oct 30, 2024, 4:30:27 AM10/30/24
to HAPI FHIR

Hello Team,

We are using Java 21 and HAPI-FHIR validator 7.4.0.

We are validating using packages as described in section 14.2.5 of the HAPI-FHIR documentation (https://hapifhir.io/hapi-fhir/docs/validation/instance_validator.html#packages).

We use FHIR Bundle 4.0.1. When we validate the FHIR Bundle, it throws a few errors related to SNOMED and LOINC.

Here are some errors and the corresponding FHIR input sections that cause the errors:

Error 1:
`
"diagnostics": "None of the codings provided are in the value set 'US Core Condition Codes' (http://hl7.org/fhir/us/core/ValueSet/us-core-condition-code|7.0.0), and a coding from this value set is required) (codes = http://snomed.info/sct#733423003, http://hl7.org/fhir/sid/icd-10-cm#Z59.4)",
                "location": [
                  "Bundle.entry[5].resource/*Condition/ConditionFoodInsecurityExample*/.code",
                  "Line[1] Col[18464]"
                ]
`
FHIR input section:
`
"category" : [{
        "coding" : [{
          "system" : "http://hl7.org/fhir/us/core/CodeSystem/condition-category",
          "code" : "health-concern",
          "display" : "Health Concern"
        }]
      },
      {
        "coding" : [{
          "system" : "http://hl7.org/fhir/us/sdoh-clinicalcare/CodeSystem/SDOHCC-CodeSystemTemporaryCodes",
          "code" : "food-insecurity",
          "display" : "Food Insecurity"
        }]
      }],
      "code" : {
        "coding" : [{
          "system" : "http://snomed.info/sct",
          "code" : "733423003",
          "display" : "Food insecurity"
        },
        {
          "system" : "http://hl7.org/fhir/sid/icd-10-cm",
          "code" : "Z59.4",
          "display" : "Lack of adequate food"
        }]
      }

`

Error 2:
`
{
            "location": {
              "line": 1,
              "column": 22845,
              "diagnostics": "Bundle.entry[6].resource/*Observation/AssessmentResponseQuestionGrouper1*/.code"
            },
            "message": "None of the codings provided are in the value set 'LOINC Codes' (http://hl7.org/fhir/ValueSet/observation-codes|4.0.1), and a coding from this value set is required) (codes = http://loinc.org#96777-8)",
            "severity": "ERROR"
          }

`
FHIR input section:
`
 "category" : [{
        "coding" : [{
          "system" : "http://hl7.org/fhir/us/sdoh-clinicalcare/CodeSystem/SDOHCC-CodeSystemTemporaryCodes",
          "code" : "housing-instability",
          "display" : "Housing Instability"
        },
        {
          "system" : "http://hl7.org/fhir/us/sdoh-clinicalcare/CodeSystem/SDOHCC-CodeSystemTemporaryCodes",
          "code" : "inadequate-housing",
          "display" : "Inadequate Housing"
        },
        {
          "system" : "http://hl7.org/fhir/us/sdoh-clinicalcare/CodeSystem/SDOHCC-CodeSystemTemporaryCodes",
          "code" : "food-insecurity",
          "display" : "Food Insecurity"
        }]
      },
      {
        "coding" : [{
          "system" : "http://terminology.hl7.org/CodeSystem/observation-category",
          "code" : "social-history"
        }]
      },
      {
        "coding" : [{
          "system" : "http://terminology.hl7.org/CodeSystem/observation-category",
          "code" : "survey"
        }]
      }],
      "code" : {
        "coding" : [{
          "system" : "http://loinc.org",
          "code" : "96777-8",
          "display" : "Accountable health communities (AHC) health-related social needs screening (HRSN) tool"
        }]
      }
   `  
     
We would appreciate any guidance on addressing these validation issues.

Thanks,
Vinod

James Agnew

unread,
Oct 30, 2024, 8:17:34 AM10/30/24
to Vinod Aravind, HAPI FHIR
These errors show failures to validate codes from the ICD-10-CM and LOINC codesystems. Do you have these codesystems loaded in your system? They are not included with HAPI FHIR, you need to load them manually (or if you're not using the JPA server, provide an IValidationSupport module in your chain which can handle these systems).

Cheers,
James

--
You received this message because you are subscribed to the Google Groups "HAPI FHIR" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hapi-fhir+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/hapi-fhir/2bf8b82a-b964-41eb-930c-c1e1708074c3n%40googlegroups.com.

Vinod Aravind

unread,
Oct 30, 2024, 8:31:36 AM10/30/24
to HAPI FHIR
Thanks you for the feedback .  I am using plain server. I just tried with the code

supportChain.addValidationSupport(new RemoteTerminologyServiceValidationSupport(fhirContext,"https://tx.fhir.org/r4"));

and now all SNOMED and ICD-10-CM related errors disappeared. but still it shows LOINC  related errors 
Any more options to give in the support chain ?

Thanks,
Vinod A

James Agnew

unread,
Oct 30, 2024, 8:43:19 AM10/30/24
to Vinod Aravind, HAPI FHIR
The tx.fhir.org server should be able to handle LOINC validation. FWIW I'd recommend as a next step to put a breakpoint in the RemoteTerminologyServiceValidationSupport and see what response you're getting from the remote server when validating your LOINC code.

Cheers,
James


Vinod Aravind

unread,
Oct 30, 2024, 9:30:15 AM10/30/24
to HAPI FHIR
Okay James, I shall try it.

One more item, it shows error 504 error sometimes.

HAPI-1361: Failed to parse response from server when performing GET to URL https://tx.fhir.org/r4/CodeSystem - org.apache.http.conn.ConnectTimeoutException: Connect to tx.fhir.org:443 [tx.fhir.org/104.196.166.17] failed: Read timed out

Is it better to load the packages for the terminology locally ? 
Thanks,
Vinod 

James Agnew

unread,
Oct 30, 2024, 9:33:31 AM10/30/24
to Vinod Aravind, HAPI FHIR
That depends entirely on what you are trying to achieve. Can you elaborate on your use case? (ie. what kind of system are you trying to build, what is your architecture, who would be using it, is it production, etc)

For example, if you're building a production, mission critical system you would never want to rely on a third party API like tx.fhir.org that you have no control over and no agreement with. If this is just for experimentation, it probably doesn't matter.

Cheers,
James

Vinod Aravind

unread,
Oct 30, 2024, 10:01:44 AM10/30/24
to HAPI FHIR
yes, Now it is in experiment mode,  But later it will implement in the original code. Not sure about the use cases that need to use. Given this task as an R&D.
Thanks
Reply all
Reply to author
Forward
0 new messages