FHIR Chat · Validation · german/mi-initiative

Stream: german/mi-initiative

Topic: Validation


view this post on Zulip Georg Fette (Mar 03 2021 at 09:21):

Welche Werkzeuge benutzt ihr zur Validierung ? Irgendwas in eurem FHIR-Server integriertes, einen eigenen Service, Code-Komponente im ETL ?

view this post on Zulip Marvin Kampf (Mar 03 2021 at 09:54):

Die HAPI Lib bietet zB einen Validator, den wir bisher gerne in unseren Unit- und CI-Tests nutzen: https://hapifhir.io/hapi-fhir/docs/validation/introduction.html

view this post on Zulip Andreas Dürschmid (Mar 04 2021 at 14:12):

Im Simplifier von firely kann man ebenfalls Validieren.

Dazu gleich noch eine Frage:
Ich habe beim Validieren eine QuestionaireResponse-json gegen ein entsprechenden Profil validiert und den folgenden Fehler bekommen:
Invariant : Instance failed constraint qrs-1 "Nested item can't be beneath both item and answer"
Rule: (answer.exists() and item.exists()).not()
QuestionnaireResponse.item[1].item[1]

Kann mir da jemand einen Tipp geben, wie dies zu deuten ist. Offensichtlich geht es um die erlaubte Struktur aus Items und Answers. Beide habe ich eigentlich nicht auf einer Ebene platziert, falls es das ist, worauf der Fehler hinweist...

view this post on Zulip Simone Heckmann (Mar 04 2021 at 14:28):

Kannst du die Ressource mal teilen? (z.B. hier https://simplifier.net/snippet)

view this post on Zulip Andreas Dürschmid (Mar 04 2021 at 14:45):

Funktioniert das so?
https://simplifier.net/snippet/andreasdrschmid/1

view this post on Zulip Patrick Werner (Mar 10 2021 at 09:32):

Die Regel besagt, dass ein item entweder ein nested item haben kann oder eine answer. Beides gleichzeitig wie in deinem Beispiel geht nicht.

view this post on Zulip Patrick Werner (Mar 10 2021 at 09:48):

item[1].item[1].answer (L:47)
und: item[1].item[1].item[0].answer[0].item (L:59) widersprechen dieser Regel

view this post on Zulip Andreas Dürschmid (Mar 11 2021 at 11:19):

So habe ich das auch verstanden, ging aber davon aus, die Ressource entsprechend angepasst zu haben.
Jetzt habe ich aber den einen Punkt doch noch gefunden, den ich bisher immer übersehen hatte:

"linkId": "2.2",
"text": "Infektion des kardiovaskulären Systems",
"answer": [
{
"valueBoolean": "true"
}
],
"item": [
{
"linkId": "2.2.1",
"text": "falls Infektion des kardiovaskulären Systems",
"answer": [

view this post on Zulip Andreas Dürschmid (Mar 11 2021 at 11:25):

Das wäre dann Zeile 47 bzw. 52 wie oben geschrieben, danke dafür. L:59 ist mir noch nicht ganz klar, wenn es dort ein Problem gibt. Dieses Konstrukt kommt dann ja auch später noch vor.

view this post on Zulip Christian Gulden (Mar 15 2021 at 16:04):

Hatte schonmal jemand erfolg damit gegen die MII-Profile via HAPI-FHIR-Server zu validieren? Ein naives setzen der Umgebungsvariablen für Version 5.3.0 wie folgt:

     # https://github.com/hapifhir/hapi-fhir-jpaserver-starter/blob/master/src/main/resources/application.yaml#L46
      HAPI_FHIR_IMPLEMENTATIONGUIDES_MIILABOR_URL: "https://packages.simplifier.net/de.medizininformatikinitiative.kerndatensatz.laborbefund/1.0.2"
      HAPI_FHIR_IMPLEMENTATIONGUIDES_MIILABOR_NAME: "de.medizininformatikinitiative.kerndatensatz.laborbefund"
      HAPI_FHIR_IMPLEMENTATIONGUIDES_MIILABOR_VERSION: "1.0.2"

schlug mit

ca.uhn.fhir.jpa.packages.ImplementationGuideInstallationException: Error installing IG de.medizininformatikinitiative.kerndatensatz.laborbefund#1.0.2: ca.uhn.fhir.jpa.packages.ImplementationGuideInstallationException: Failure when generating snapshot of StructureDefinition: null

fehl. Auch wenn ich unter <https://packages.simplifier.net/de.medizininformatikinitiative.kerndatensatz.laborbefund/1.0.2> den IG direkt als tgz herunterladen konnte - zumindest via browser.

view this post on Zulip Christian Gulden (Mar 16 2021 at 10:44):

... noch etwas weiter runtergescrollt im stacktrace und dann den konkreten Fehler:

org.hl7.fhir.exceptions.FHIRException: Illegal path 'Laborbefund' in differential in https://www.medizininformatik-initiative.de/fhir/core/modul-labor/StructureDefinition/LogicalModel/Laborbefund: must start with https://www.medizininformatik-initiative.de/fhir/core/StructureDefinition/Laborbefund. (or be 'https://www.medizininformatik-initiative.de/fhir/core/StructureDefinition/Laborbefund')

view this post on Zulip Noemi Deppenwiese (Mar 16 2021 at 11:01):

@Alexander Zautke Da müsste das LogicalModel angepasst werden? Oder ist der Validator da zu streng?

view this post on Zulip Julian Sass (Mar 17 2021 at 11:07):

Ich meine, wir müssen die LogicalModels anpassen, damit die HAPI package imports wieder funktionieren. Der type muss das erste Element im Differential matchen.

view this post on Zulip Alexander Zautke (Mar 17 2021 at 11:50):

Der Validator ist hier nicht zu streng sondern falsch

view this post on Zulip Alexander Zautke (Mar 17 2021 at 11:52):

SDF-8 sagt ganz klar, dass für Logical Models der Path im Differential immer nur den gleichen Prefix haben muss jedoch nicht äquivalent zum Typ sein muss: http://hl7.org/fhir/structuredefinition.html#invs

view this post on Zulip Alexander Zautke (Mar 17 2021 at 11:53):

Gerne kann das jemand mal in den Implementers werfen oder im entsprechenden Repo einen Bug Report aufmachen.

view this post on Zulip Noemi Deppenwiese (Mar 18 2021 at 12:02):

Alles klar!

view this post on Zulip Marcus Wurlitzer (Mar 22 2021 at 10:49):

https://chat.fhir.org/#narrow/stream/179307-german.2Fmi-initiative/topic/.5BPerson.5D.20usw.2E.20Meldungen.20im.20validator.2Ejar
Sorry, das wollte ich längst gemacht haben :| ... hat inzwischen schon jemand das Problem berichtet?

view this post on Zulip Alexander Zautke (Mar 22 2021 at 17:15):

Nicht das ich mitbekommen hätte

view this post on Zulip Marcus Wurlitzer (Mar 23 2021 at 13:56):

Ist jetzt als Issue eingetragen: https://github.com/hapifhir/org.hl7.fhir.core/issues/466

view this post on Zulip Marcus Wurlitzer (May 06 2021 at 07:55):

Moin, es gibt eine Rückmeldung hierzu von Graham: Resolved. But note that there's a problem with that logical model which becomes evident once that issue is resolved, which is that the first element in the differential has a type and it should not have

view this post on Zulip Alexander Zautke (May 07 2021 at 20:15):

Sehe ich ein wenig anders: sdf-15a "If the first element in a differential has no "." in the path and it's not a logical model, it has no type". https://www.hl7.org/fhir/structuredefinition.html#invs

view this post on Zulip Florian Seidel (Aug 02 2021 at 12:12):

Marvin Kampf said:

Die HAPI Lib bietet zB einen Validator, den wir bisher gerne in unseren Unit- und CI-Tests nutzen: https://hapifhir.io/hapi-fhir/docs/validation/introduction.html

Ich scheitere aktuell daran, der Library de.gecco in Version 1.0.3 unterzuschieben. Seid ihr da auch erfolgreich gewesen?

view this post on Zulip Patrick Werner (Aug 10 2021 at 09:55):

was ist der Fehler?

view this post on Zulip Florian Seidel (Aug 11 2021 at 07:55):

Ich stoße auf vergleichsweise viele falsch negative Ergebnisse:
Beispielsweise validiert das Chronic LungDiseases Example nicht mit folgenden Fehlern:
ERROR at Condition.verificationStatus - Unknown code 'http://snomed.info/sct#410605003'
WARNING at Condition.category[0] - Keiner der angegebenen Codes ist im Valueset http://hl7.org/fhir/ValueSet/condition-category (http://hl7.org/fhir/ValueSet/condition-category, und ein Code sollte aus diesem Valueset stammen, es sei denn, er enthält keinen geeigneten Code) (Codes = http://snomed.info/sct#418112009)

Die ValidationSupportChain bau ich wie folgt:

    ValidationSupportChain supportChain = new ValidationSupportChain();
    supportChain.addValidationSupport(new DefaultProfileValidationSupport(ctx));
    PrePopulatedValidationSupport prePopulatedSupport = new PrePopulatedValidationSupport(ctx);
    // Alle StructureDefinitions, CodeSysteme und ValueSets aus dem de.gecco#1.0.3 package und den zugehörigen Dependencies
    factory.codeSystems.forEach(prePopulatedSupport::addCodeSystem);
    factory.valueSets.forEach(prePopulatedSupport::addValueSet);
    factory.structureDefinitions.forEach(prePopulatedSupport::addStructureDefinition);
    supportChain.addValidationSupport(prePopulatedSupport);
    supportChain.addValidationSupport(new CommonCodeSystemsTerminologyService(ctx));
    // Implementierung des RemoteTerminologyServiceWithAuthSupport welcher ein Client Certificate mitgeben kann
    RemoteTerminologyServiceWithAuthValidationSupport tx = new RemoteTerminologyServiceWithAuthValidationSupport(ctx);
    tx.getFhirContext().setRestfulClientFactory(new ApacheRestfulClientWithClientCertFactory(ctx, keystorepath, keyStorePassword, keyPassword));
    tx.setBaseUrl(terminologyServerBaseUrl);
    supportChain.addValidationSupport(tx);
    supportChain.addValidationSupport(new InMemoryTerminologyServerValidationSupport(ctx));
    supportChain.addValidationSupport(new SnapshotGeneratingValidationSupport(ctx));
    CachingValidationSupport cache = new CachingValidationSupport(supportChain);
    FhirInstanceValidator validatorModule = new FhirInstanceValidator(cache);

view this post on Zulip Patrick Werner (Aug 11 2021 at 08:02):

Ah, die errors on unknown CS bekommt man weg indem man als letztes einen UnknownCodeSystemWarningValidationSupportin die ValidationChain hängt.

view this post on Zulip Patrick Werner (Aug 11 2021 at 08:02):

(btw: den SnapShotValidationSupport sollte man als erstes Element in die Chain hängen)

view this post on Zulip Florian Seidel (Aug 11 2021 at 08:45):

Ändert leider nichts :/

    UnknownCodeSystemWarningValidationSupport ucswvs = new UnknownCodeSystemWarningValidationSupport(ctx);
    ucswvs.setAllowNonExistentCodeSystem(true);
    supportChain.addValidationSupport(ucswvs);

Last updated: Apr 12 2022 at 19:14 UTC