eRezept-Examples icon indicating copy to clipboard operation
eRezept-Examples copied to clipboard

usage of urn:uuid causes validation issues

Open joergreichert opened this issue 2 years ago • 7 comments

usage of urn:uuid causes validation issue, that id would be missing (which is actually is not the case)

When using http://pvs.praxis.local/fhir/<entityName>/<id> in full URL and <entityName>/<id> in references (as done in all other examples), validation passes.

So not sure how the urn:uuid approach is expected to work.

joergreichert avatar Aug 08 '23 09:08 joergreichert

FHIR has a description of how references resolve within a bundle: https://www.hl7.org/fhir/bundle.html#references TL;DR: you can either use absolute (urn:uuid) or relative (Patient/) references. But it should be consistent within a bundle.

I testet the file that you fixed with the gematik and abda validators and it passed both of them. Which one did you use?

florianschoffke avatar Aug 08 '23 11:08 florianschoffke

Thanks for the link, validation output for me is this one (ABDA Validator 1.0.3): 1-0-3.txt

joergreichert avatar Aug 08 '23 12:08 joergreichert

Very interesting. My output from a newly downloaded abda jar looks completely different: 1-0-3_flow.txt

I can see in your output that your lines start with ' d. abda.fhir.validator.core.Validator'. Have you built your own version?

florianschoffke avatar Aug 08 '23 13:08 florianschoffke

The "d.abda..." is just done by the logging framework message formatter, I use the official validator via Maven dependencies:

        <abda-fhir-validator.version>1.0.3</abda-fhir-validator.version>
        ...

        <dependency>
            <groupId>ca.uhn.hapi.fhir</groupId>
            <artifactId>hapi-fhir-structures-r4</artifactId>
        </dependency>
        <dependency>
            <groupId>ca.uhn.hapi.fhir</groupId>
            <artifactId>hapi-fhir-validation</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>xpp3</groupId>
                    <artifactId>xpp3</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>ca.uhn.hapi.fhir</groupId>
            <artifactId>hapi-fhir-validation-resources-r4</artifactId>
        </dependency>
        <!-- ABDA FHIR validator -->
        <dependency>
            <groupId>de.abda</groupId>
            <artifactId>fhir-validator-core</artifactId>
        </dependency>
        <dependency>
            <groupId>de.abda</groupId>
            <artifactId>fhir-validator-packages</artifactId>
        </dependency>
	<dependency>
	    <groupId>de.abda</groupId>
            <artifactId>fhir-validator-bom</artifactId>
            <version>${abda-fhir-validator.version}</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>

And call it (in the test) via:

        val validator = de.abda.fhir.validator.core.ReferenceValidator(FhirContext.forR4())
        validator.validateString(content, true, listOf("https://fhir.kbv.de/StructureDefinition/KBV_PR_ERP_Bundle"))

joergreichert avatar Aug 08 '23 13:08 joergreichert

From your logs I can see, you are using FHIR version [R5], I'm using FHIR version [R4].

joergreichert avatar Aug 08 '23 13:08 joergreichert

What Version of HAPI are you loading, and what Version of Java are you using? In the future the gematik TI-Validator will be used as a standardised validator: https://github.com/gematik/app-referencevalidator/releases/tag/0.7.2 What happens if you use this for validation?

florianschoffke avatar Aug 09 '23 13:08 florianschoffke

Java: OpenJDK 64-Bit Server VM Corretto-17.0.5.8.1 (build 17.0.5+8-LTS, mixed mode, sharing)

TI validator fails for me, but might be classpath issue having both validators (Abda and Gematik) listed in the dependencies:

15:16:41.162 [main]  INFO  ca.uhn.fhir.util.VersionUtil #84 - HAPI FHIR version 5.7.9 - Rev 1fa074f0c3
15:16:41.177 [main]  INFO  ca.uhn.fhir.context.FhirContext #208 - Creating new FHIR context for FHIR version [R4]
15:16:41.654 [main]  INFO  ca.uhn.fhir.context.FhirContext #208 - Creating new FHIR context for FHIR version [R4]
15:16:41.705 [main]  INFO  ca.uhn.fhir.context.FhirContext #208 - Creating new FHIR context for FHIR version [R4]
15:16:42.460 [main]  INFO  ca.uhn.fhir.util.XmlUtil #75 - FHIR XML procesing will use StAX implementation 'Woodstox' version '6.5.1'
15:16:42.896 [main]  INFO  d.g.r.c.validation.GenericValidator #95 - Validating against https://fhir.kbv.de/StructureDefinition/KBV_PR_ERP_Bundle|1.1.0...
15:16:42.992 [main]  INFO  c.u.f.c.s.DefaultProfileValidationSupport #327 - Loading structure definitions from classpath: /org/hl7/fhir/r4/model/profile/profiles-resources.xml
15:16:44.203 [main]  INFO  c.u.f.c.s.DefaultProfileValidationSupport #327 - Loading structure definitions from classpath: /org/hl7/fhir/r4/model/profile/profiles-types.xml
15:16:44.269 [main]  INFO  c.u.f.c.s.DefaultProfileValidationSupport #327 - Loading structure definitions from classpath: /org/hl7/fhir/r4/model/profile/profiles-others.xml
15:16:44.483 [main]  INFO  c.u.f.c.s.DefaultProfileValidationSupport #327 - Loading structure definitions from classpath: /org/hl7/fhir/r4/model/extension/extension-definitions.xml
15:16:44.786 [main]  INFO  d.g.r.c.validation.PackageCache #45 - Loading package kbv.ita.erp-1.1.1.tgz...
15:16:45.187 [main]  INFO  d.g.r.c.validation.PackageCache #45 - Loading package gematik.kbv.sfhir.cs.vs-1.2.0.tgz...
15:16:45.204 [main]  INFO  d.g.r.c.validation.PackageCache #45 - Loading package de.basisprofil.r4-1.3.2.tgz...
15:16:45.366 [main]  INFO  d.g.r.c.validation.PackageCache #45 - Loading package kbv.ita.for-1.1.0.tgz...
15:16:45.420 [main]  INFO  d.g.r.c.validation.PackageCache #45 - Loading package kbv.basis-1.3.0.tgz...
15:16:45.505 [main]  INFO  ca.uhn.fhir.context.FhirContext #208 - Creating new FHIR context for FHIR version [R5]
15:16:46.172 [main]  INFO  o.h.f.c.h.v.v.VersionSpecificWorkerContextWrapper #103 - Generating snapshot for StructureDefinition: https://fhir.kbv.de/StructureDefinition/KBV_PR_ERP_Bundle

java.lang.IllegalArgumentException: StructureDefinition https://fhir.kbv.de/StructureDefinition/KBV_PR_ERP_Bundle|1.1.0 has no snapshot, and no snapshot generator is configured

	at org.apache.commons.lang3.Validate.isTrue(Validate.java:158)
	at org.hl7.fhir.common.hapi.validation.validator.VersionSpecificWorkerContextWrapper.lambda$new$0(VersionSpecificWorkerContextWrapper.java:105)

joergreichert avatar Aug 09 '23 15:08 joergreichert