Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

usage of urn:uuid causes validation issues #24

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

joergreichert
Copy link

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.

@florianschoffke
Copy link
Contributor

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?

@joergreichert
Copy link
Author

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

@florianschoffke
Copy link
Contributor

florianschoffke commented Aug 8, 2023

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?

@joergreichert
Copy link
Author

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
Copy link
Author

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

@florianschoffke
Copy link
Contributor

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?

@joergreichert
Copy link
Author

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)

Copy link
Contributor

@florianschoffke florianschoffke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@joergreichert, does the error still occurr?
Do we need to apply this PR or can we close it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants