diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 00000000..31e0b9f5 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,97 @@ +name: Validate Examples + +# Controls when the action will run. +on: + # Triggers the workflow on push or pull request events but only for the master branch + push: + branches: [ main ] + pull_request: + branches: [ main ] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +env: + REFERENZVALIDATOR_VERSION: 2.0.2 + PATH_TO_EXAMPLES: './temp_folder/' + FHIR_VERSION: "4.0" + INPUT_JAVA_VALIDATION_OPTIONS: "-tx http://tx.fhir.org -debug -allow-example-urls true" + IG_DEPENDENCIES: "-ig de.basisprofil.r4#1.4.0 -ig hl7.fhir.r4.core#4.0.1 -ig kbv.ita.for#1.1.0 -ig kbv.ita.erp#1.1.x -ig de.gematik.erezept-workflow.r4" + +jobs: + CI_EXAMPLES_VALIDATION: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - uses: actions/checkout@v4 + - uses: actions/setup-node@v3 + with: + node-version: '20' + + # Identify and Copy Changed .json and .xml Files + - name: Identify and Copy Changed .json and .xml Files + run: | + mkdir -p $PATH_TO_EXAMPLES # Create a temp folder + git fetch origin main:main + git diff --name-only main | grep -E '\.(json|xml)$' | xargs -I {} cp {} $PATH_TO_EXAMPLES/ + echo "Number of changed files to validate: " && ls -1 $PATH_TO_EXAMPLES | wc -l + + # Install Java runtime (only needed if you want to run the offical HL7 Java validator) + - name: Setup Java JDK + uses: actions/setup-java@v3 + with: + distribution: 'microsoft' + java-version: '17' + + + # --------------------------------------------------------------------------------------------------- # + # JAVA Validator # + # --------------------------------------------------------------------------------------------------- # + + - name: Check if Java is installed + run: | + if ! command -v java &> /dev/null + then + echo "java could not be found. Please see actions/setup-java to set it up before running this action." + exit 1 + fi + shell: bash + + - name: Download Java Validator + run: | + CHECK_JAVA_VERSION=$(java -version 2>&1 | head -1 | cut -d'"' -f2) + echo "JAVA_VERSION: $CHECK_JAVA_VERSION" + wget -q https://github.com/gematik/app-referencevalidator/releases/download/$REFERENZVALIDATOR_VERSION/referencevalidator-cli-$REFERENZVALIDATOR_VERSION.jar + echo "REFERENZVALIDATOR_VERSION: $REFERENZVALIDATOR_VERSION" + shell: bash + + - name: Install jq + run: | + sudo apt-get update > /dev/null + sudo apt-get install --no-install-recommends -y jq findutils curl ca-certificates > /dev/null + shell: bash + + - name: Validate all example resources in scope of the repository + run: | + for p in $PATH_TO_EXAMPLES; + do + + # Ensure directory ends with "/" + if [[ ! "$p" =~ .*/$ ]]; then + p="$p/" + fi + + for f in $p*; + do + java -jar referencevalidator-cli-$REFERENZVALIDATOR_VERSION.jar erp $f --accepted-encodings xml --accepted-encodings json --no-profile-validity-period-check + done + done + + - name: Cleanup + if: always() + run: rm -rf temp_folder \ No newline at end of file diff --git a/008_Request_Communication_test.json b/008_Request_Communication_test.json new file mode 100644 index 00000000..0fdb22e4 --- /dev/null +++ b/008_Request_Communication_test.json @@ -0,0 +1,31 @@ +{ + "resourceType" : "Communication", + "id" : "39004dfc-6e44-471a-942d-86c73293eb94", + "meta" : { + "profile" : [ "https://gematik.de/fhir/erp/StructureDefinition/GEM_ERP_PR_Communication_Representative|1.2" ] + }, + "basedOn" : [ { + "reference" : "Task/160.000.226.119.771.59/$accept?ac=2c8be8db04cad4eb3a7fb5f74950cfe82b057d1f83ef87e6c4bbf7347099b7e2" + } ], + "status" : "unknown", + "recipient" : [ { + "identifier" : { + "system" : "http://fhir.de/sid/gkv/kvid-10", + "value" : "X110465770" + } + } ], + "payload" : [ { + "extension" : [ { + "url" : "https://gematik.de/fhir/erp/StructureDefinition/GEM_ERP_EX_SubstitutionAllowedType", + "valueBoolean" : true + }, { + "url" : "https://gematik.de/fhir/erp/StructureDefinition/GEM_ERP_EX_PrescriptionType", + "valueCoding" : { + "system" : "https://gematik.de/fhir/erp/CodeSystem/GEM_ERP_CS_FlowType", + "code" : "160", + "display" : "Muster 16 (Apothekenpflichtige Arzneimittel)" + } + } ], + "contentString" : "Wenn Chuck Norris Wäsche wäscht, werden sogar schwarze Hemden strahlend weiß." + } ] +} \ No newline at end of file diff --git a/Beispiel_1_test_FAIL.xml b/Beispiel_1_test_FAIL.xml new file mode 100644 index 00000000..9d150ba8 --- /dev/null +++ b/Beispiel_1_test_FAIL.xml @@ -0,0 +1,385 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <custodian> + <reference value="Organization/5d3f4ac0-2b44-4d48-b363-e63efa72973b" /> + </custodian> + <section> + <code> + <coding> + <system value="https://fhir.kbv.de/CodeSystem/KBV_CS_ERP_Section_Type" /> + <code value="Prescription" /> + </coding> + </code> + <entry> + <!-- Referenz auf Verordnung (MedicationRequest) --> + <reference value="MedicationRequest/000abe24-f690-481e-9a9f-1cd0eb434e2f" /> + </entry> + </section> + <section> + <code> + <coding> + <system value="https://fhir.kbv.de/CodeSystem/KBV_CS_ERP_Section_Type" /> + <code value="Coverage" /> + </coding> + </code> + <entry> + <!-- Referenz auf Krankenkasse/Kostenträger --> + <reference value="Coverage/1b89236c-ab14-4e92-937e-5af0b59d0cd4" /> + </entry> + </section> + </Composition> + </resource> + </entry> + <entry> + <fullUrl value="http://pvs.praxis.local/fhir/MedicationRequest/000abe24-f690-481e-9a9f-1cd0eb434e2f" /> + <resource> + <MedicationRequest xmlns="http://hl7.org/fhir"> + <!--Beispiel MedicationRequest für eine PZN-Verordnung --> + <id value="000abe24-f690-481e-9a9f-1cd0eb434e2f"/> + <meta> + <profile value="https://fhir.kbv.de/StructureDefinition/KBV_PR_ERP_Prescription|1.1.0"/> + </meta> + <extension url="https://fhir.kbv.de/StructureDefinition/KBV_EX_FOR_StatusCoPayment"> + <valueCoding> + <system value="https://fhir.kbv.de/CodeSystem/KBV_CS_FOR_StatusCoPayment"/> + <code value="0"/> + </valueCoding> + </extension> + <extension url="https://fhir.kbv.de/StructureDefinition/KBV_EX_ERP_EmergencyServicesFee"> + <valueBoolean value="false"/> + </extension> + <extension url="https://fhir.kbv.de/StructureDefinition/KBV_EX_ERP_BVG"> + <valueBoolean value="false"/> + </extension> + <extension url="https://fhir.kbv.de/StructureDefinition/KBV_EX_ERP_Multiple_Prescription"> + <extension url="Kennzeichen"> + <valueBoolean value="false"/> + </extension> + </extension> + <status value="active"/> + <intent value="order"/> + <medicationReference> + <reference value="Medication/47076fb4-dc5c-4f75-85f6-b200033b3280"/> + </medicationReference> + <subject> + <reference value="Patient/93866fdc-3e50-4902-a7e9-891b54737b5e"/> + </subject> + <authoredOn value="2022-05-20" /> + <requester> + <reference value="Practitioner/bc329f24-3d65-4286-bf06-b54dd6cad655"/> + </requester> + <insurance> + <reference value="Coverage/1b89236c-ab14-4e92-937e-5af0b59d0cd4"/> + </insurance> + <dosageInstruction> + <extension url="https://fhir.kbv.de/StructureDefinition/KBV_EX_ERP_DosageFlag"> + <valueBoolean value="false"/> + </extension> + </dosageInstruction> + <dispenseRequest> + <quantity> + <value value="1"/> + <system value="http://unitsofmeasure.org"/> + <code value="{Package}"/> + </quantity> + </dispenseRequest> + <substitution> + <allowedBoolean value="true"/> + </substitution> + </MedicationRequest> + </resource> + </entry> + <entry> + <fullUrl value="http://pvs.praxis.local/fhir/Medication/47076fb4-dc5c-4f75-85f6-b200033b3280" /> + <resource> + <Medication xmlns="http://hl7.org/fhir"> + <id value="47076fb4-dc5c-4f75-85f6-b200033b3280"/> + <meta> + <profile value="https://fhir.kbv.de/StructureDefinition/KBV_PR_ERP_Medication_PZN|1.1.0"/> + </meta> + <extension url="https://fhir.kbv.de/StructureDefinition/KBV_EX_Base_Medication_Type"> + <valueCodeableConcept> + <coding> + <system value="http://snomed.info/sct"/> + <version value="http://snomed.info/sct/900000000000207008/version/20220331" /> + <code value="763158003" /> + <display value="Medicinal product (product)" /> + </coding> + </valueCodeableConcept> + </extension> + <extension url="https://fhir.kbv.de/StructureDefinition/KBV_EX_ERP_Medication_Category"> + <valueCoding> + <system value="https://fhir.kbv.de/CodeSystem/KBV_CS_ERP_Medication_Category"/> + <code value="00" /> + </valueCoding> + </extension> + <extension url="https://fhir.kbv.de/StructureDefinition/KBV_EX_ERP_Medication_Vaccine"> + <valueBoolean value="false"/> + </extension> + <extension url="http://fhir.de/StructureDefinition/normgroesse"> + <valueCode value="N1"/> + </extension> + <code> + <coding> + <system value="http://fhir.de/CodeSystem/ifa/pzn"/> + <code value="00814665"/> + </coding> + <text value="Januvia® 50 mg 28 Filmtabletten N1Januvia® 50 mg 28 Filmtabletten N1Januvia® 50 mg 28 Filmtabletten N1Januvia® 50 mg 28 Filmtabletten N1Januvia® 50 mg 28 Filmtabletten N1"/> + </code> + <form> + <coding> + <system value="https://fhir.kbv.de/CodeSystem/KBV_CS_SFHIR_KBV_DARREICHUNGSFORM"/> + <code value="FTA"/> + </coding> + </form> + </Medication> + </resource> + </entry> + <entry> + <fullUrl value="http://pvs.praxis.local/fhir/Patient/93866fdc-3e50-4902-a7e9-891b54737b5e" /> + <resource> + <Patient xmlns="http://hl7.org/fhir"> + <id value="93866fdc-3e50-4902-a7e9-891b54737b5e" /> + <meta> + <profile value="https://fhir.kbv.de/StructureDefinition/KBV_PR_FOR_Patient|1.1.0" /> + </meta> + <identifier> + <type> + <coding> + <system value="http://fhir.de/CodeSystem/identifier-type-de-basis" /> + <code value="GKV" /> + </coding> + </type> + <system value="http://fhir.de/sid/gkv/kvid-10" /> + <value value="K220635158" /> + </identifier> + <name> + <use value="official" /> + <family value="Königsstein"> + <extension url="http://hl7.org/fhir/StructureDefinition/humanname-own-name"> + <valueString value="Königsstein" /> + </extension> + </family> + <given value="Ludger" /> + </name> + <birthDate value="1935-06-22" /> + <address> + <type value="both" /> + <line value="Blumenweg"> + <extension url="http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-streetName"> + <valueString value="Blumenweg" /> + </extension> + </line> + <city value="Esens" /> + <postalCode value="26427" /> + <country value="D" /> + </address> + </Patient> + </resource> + </entry> + <entry> + <fullUrl value="http://pvs.praxis.local/fhir/Practitioner/bc329f24-3d65-4286-bf06-b54dd6cad655" /> + <resource> + <Practitioner xmlns="http://hl7.org/fhir"> + <id value="bc329f24-3d65-4286-bf06-b54dd6cad655" /> + <meta> + <profile value="https://fhir.kbv.de/StructureDefinition/KBV_PR_FOR_Practitioner|1.1.0" /> + </meta> + <identifier> + <type> + <coding> + <system value="http://terminology.hl7.org/CodeSystem/v2-0203" /> + <code value="LANR" /> + </coding> + </type> + <system value="https://fhir.kbv.de/NamingSystem/KBV_NS_Base_ANR" /> + <value value="123456628" /> + </identifier> + <name> + <use value="official" /> + <family value="Freiherr von Müller"> + <extension url="http://hl7.org/fhir/StructureDefinition/humanname-own-prefix"> + <valueString value="von" /> + </extension> + <extension url="http://fhir.de/StructureDefinition/humanname-namenszusatz"> + <valueString value="Freiherr" /> + </extension> + <extension url="http://hl7.org/fhir/StructureDefinition/humanname-own-name"> + <valueString value="Müller" /> + </extension> + </family> + <given value="Paul" /> + <prefix value="Dr. med."> + <extension url="http://hl7.org/fhir/StructureDefinition/iso21090-EN-qualifier"> + <valueCode value="AC" /> + </extension> + </prefix> + </name> + <qualification> + <code> + <coding> + <system value="https://fhir.kbv.de/CodeSystem/KBV_CS_FOR_Qualification_Type" /> + <code value="00" /> + </coding> + </code> + </qualification> + <qualification> + <code> + <coding> + <system value="https://fhir.kbv.de/CodeSystem/KBV_CS_FOR_Berufsbezeichnung" /> + <code value="Berufsbezeichnung" /> + </coding> + <text value="Facharzt für Innere Medizin: Kardiologie" /> + </code> + </qualification> + </Practitioner> + </resource> + </entry> + <entry> + <fullUrl value="http://pvs.praxis.local/fhir/Organization/5d3f4ac0-2b44-4d48-b363-e63efa72973b" /> + <resource> + <Organization xmlns="http://hl7.org/fhir"> + <id value="5d3f4ac0-2b44-4d48-b363-e63efa72973b" /> + <meta> + <profile value="https://fhir.kbv.de/StructureDefinition/KBV_PR_FOR_Organization|1.1.0" /> + </meta> + <identifier> + <type> + <coding> + <system value="http://terminology.hl7.org/CodeSystem/v2-0203" /> + <code value="BSNR" /> + </coding> + </type> + <system value="https://fhir.kbv.de/NamingSystem/KBV_NS_Base_BSNR" /> + <value value="721111100" /> + </identifier> + <name value="MVZ" /> + <telecom> + <system value="phone" /> + <value value="0301234567" /> + </telecom> + <telecom> + <system value="fax" /> + <value value="030123456789" /> + </telecom> + <telecom> + <system value="email" /> + <value value="mvz@e-mail.de" /> + </telecom> + <address> + <type value="both" /> + <line value="Herbert-Lewin-Platz 2"> + <extension url="http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-houseNumber"> + <valueString value="2" /> + </extension> + <extension url="http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-streetName"> + <valueString value="Herbert-Lewin-Platz" /> + </extension> + </line> + <city value="Berlin" /> + <postalCode value="10623" /> + <country value="D" /> + </address> + </Organization> + </resource> + </entry> + <entry> + <fullUrl value="http://pvs.praxis.local/fhir/Coverage/1b89236c-ab14-4e92-937e-5af0b59d0cd4" /> + <resource> + <Coverage xmlns="http://hl7.org/fhir"> + <id value="1b89236c-ab14-4e92-937e-5af0b59d0cd4" /> + <meta> + <profile value="https://fhir.kbv.de/StructureDefinition/KBV_PR_FOR_Coverage|1.1.0" /> + </meta> + <extension url="http://fhir.de/StructureDefinition/gkv/besondere-personengruppe"> + <valueCoding> + <system value="https://fhir.kbv.de/CodeSystem/KBV_CS_SFHIR_KBV_PERSONENGRUPPE" /> + <code value="00" /> + </valueCoding> + </extension> + <extension url="http://fhir.de/StructureDefinition/gkv/dmp-kennzeichen"> + <valueCoding> + <system value="https://fhir.kbv.de/CodeSystem/KBV_CS_SFHIR_KBV_DMP" /> + <code value="05" /> + </valueCoding> + </extension> + <extension url="http://fhir.de/StructureDefinition/gkv/wop"> + <valueCoding> + <system value="https://fhir.kbv.de/CodeSystem/KBV_CS_SFHIR_ITA_WOP" /> + <code value="17" /> + </valueCoding> + </extension> + <extension url="http://fhir.de/StructureDefinition/gkv/versichertenart"> + <valueCoding> + <system value="https://fhir.kbv.de/CodeSystem/KBV_CS_SFHIR_KBV_VERSICHERTENSTATUS" /> + <code value="5" /> + </valueCoding> + </extension> + <status value="active" /> + <type> + <coding> + <system value="http://fhir.de/CodeSystem/versicherungsart-de-basis" /> + <code value="GKV" /> + </coding> + </type> + <beneficiary> + <reference value="Patient/93866fdc-3e50-4902-a7e9-891b54737b5e" /> + </beneficiary> + <payor> + <identifier> + <system value="http://fhir.de/sid/arge-ik/iknr" /> + <value value="109719018" /> + </identifier> + <display value="AOK Nordost" /> + </payor> + </Coverage> + </resource> + </entry> +</Bundle>