Skip to content

Commit 39e8ac1

Browse files
author
Jorn Duwel
committed
R4 Immunization XIS Test update
1 parent 9af179b commit 39e8ac1

File tree

17 files changed

+6780
-573
lines changed

17 files changed

+6780
-573
lines changed

dev/FHIR4-0-1-MedMij-Test/Immunization-1-0/XIS-Server-GetMedication/imm-serve-test-1-1-json.xml

Lines changed: 86 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,12 @@
6161
<expression value="iif(Bundle.entry.where(resource.is(Immunization)).resource[0].extension.where(url = 'http://nictiz.nl/fhir/StructureDefinition/ext-Vaccination.PharmaceuticalProduct').value.reference.startsWith('Medication/'), Bundle.link.where(relation='self').url.replaceMatches('Immunization[/?].*$','') + Bundle.entry.where(resource.is(Immunization)).resource[0].extension.where(url = 'http://nictiz.nl/fhir/StructureDefinition/ext-Vaccination.PharmaceuticalProduct').value.reference, Bundle.entry.where(resource.is(Immunization)).resource[0].extension.where(url = 'http://nictiz.nl/fhir/StructureDefinition/ext-Vaccination.PharmaceuticalProduct').value.reference)"/>
6262
<sourceId value="immunization-search-response"/>
6363
</variable>
64+
<variable>
65+
<name value="imm-PharmaceuticalProduct-02-id"/>
66+
<description value="Resource.id for Medication 1"/>
67+
<expression value="Medication.id"/>
68+
<sourceId value="d1e20"/>
69+
</variable>
6470
<test>
6571
<name value="Test scenario 1.1 - Serve vaccinations"/>
6672
<description value="Serve Immunization resource including the patient and performer"/>
@@ -323,62 +329,6 @@
323329
<warningOnly value="false"/>
324330
</assert>
325331
</action>
326-
<!-- Immunization -->
327-
<action>
328-
<assert>
329-
<extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail">
330-
<valueBoolean value="false"/>
331-
</extension>
332-
<description value="Confirm that the Immunization resource contains an identifier."/>
333-
<direction value="response"/>
334-
<expression value="Bundle.entry.resource.as(Immunization).identifier.count() = 1"/>
335-
<warningOnly value="false"/>
336-
</assert>
337-
</action>
338-
<action>
339-
<assert>
340-
<extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail">
341-
<valueBoolean value="false"/>
342-
</extension>
343-
<description value="Confirm that the Immunization resource contains a value in the identifier."/>
344-
<direction value="response"/>
345-
<expression value="Bundle.entry.resource.as(Immunization).identifier.value.count() = 1"/>
346-
<warningOnly value="false"/>
347-
</assert>
348-
</action>
349-
<action>
350-
<assert>
351-
<extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail">
352-
<valueBoolean value="false"/>
353-
</extension>
354-
<description value="Confirm that the Immunization resource contains a system in the identifier."/>
355-
<direction value="response"/>
356-
<expression value="Bundle.entry.resource.as(Immunization).identifier.system.count() = 1"/>
357-
<warningOnly value="false"/>
358-
</assert>
359-
</action>
360-
<action>
361-
<assert>
362-
<extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail">
363-
<valueBoolean value="false"/>
364-
</extension>
365-
<description value="Test if the pharmaceutical extension 'http://nictiz.nl/fhir/StructureDefinition/ext-Vaccination.PharmaceuticalProduct' occurs 1 times."/>
366-
<direction value="response"/>
367-
<expression value="Bundle.entry.resource.as(Immunization).extension.where(url = 'http://nictiz.nl/fhir/StructureDefinition/ext-Vaccination.PharmaceuticalProduct').count() = 1"/>
368-
<warningOnly value="false"/>
369-
</assert>
370-
</action>
371-
<action>
372-
<assert>
373-
<extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail">
374-
<valueBoolean value="false"/>
375-
</extension>
376-
<description value="Test if the reference of type 'Medication' occurs 1 times."/>
377-
<direction value="response"/>
378-
<expression value="Bundle.entry.resource.as(Immunization).extension.value.where(type = 'Medication').reference.count() = 1"/>
379-
<warningOnly value="false"/>
380-
</assert>
381-
</action>
382332
<!-- Patient -->
383333
<action>
384334
<assert>
@@ -579,7 +529,7 @@
579529
<valueBoolean value="false"/>
580530
</extension>
581531
<label value="1-12"/>
582-
<description value="Contains .performer with .function with .coding with .system 'http://terminology.hl7.org/CodeSystem/v2-0443' and .code 'AP' and .display and .actor with either .reference or .identifier and .display. This assert checks if all children exist (if applicable with their specific values) and if they are present within one element. Following asserts check if individual children exist to help you debug if this assert fails"/>
532+
<description value="Contains .performer with .function with .coding with .system 'http://terminology.hl7.org/CodeSystem/v2-0443' and .code 'AP' and .display, and .actor with either .reference or .identifier and .display. This assert checks if all children exist (if applicable with their specific values) and if they are present within one element. Following asserts check if individual children exist to help you debug if this assert fails"/>
583533
<direction value="response"/>
584534
<expression value="Bundle.entry.resource.ofType(Immunization).where(id = '${imm-Immunization-02-id}').performer.where(function.coding.where(system = 'http://terminology.hl7.org/CodeSystem/v2-0443' and code = 'AP' and display) and actor.where((reference or identifier) and display)).exists()"/>
585535
<warningOnly value="false"/>
@@ -627,9 +577,9 @@
627577
<valueBoolean value="false"/>
628578
</extension>
629579
<label value="1-14"/>
630-
<description value="Contains .protocolApplied with .targetDisease with .coding with .system 'http://snomed.info/sct' and .code '840539006' and .display and .doseNumberString 'n/a'. This assert checks if all children exist (if applicable with their specific values) and if they are present within one element. Following asserts check if individual children exist to help you debug if this assert fails"/>
580+
<description value="Contains .protocolApplied with .targetDisease with .coding with .system 'http://snomed.info/sct' and .code '840539006' and .display, and .doseNumberString. This assert checks if all children exist (if applicable with their specific values) and if they are present within one element. Following asserts check if individual children exist to help you debug if this assert fails"/>
631581
<direction value="response"/>
632-
<expression value="Bundle.entry.resource.ofType(Immunization).where(id = '${imm-Immunization-02-id}').protocolApplied.where(targetDisease.where(coding.where(system = 'http://snomed.info/sct' and code = '840539006' and display)) and doseNumber.ofType(string).replaceMatches('[ .,_-]+', ' ') ~ 'n/a').exists()"/>
582+
<expression value="Bundle.entry.resource.ofType(Immunization).where(id = '${imm-Immunization-02-id}').protocolApplied.where(targetDisease.where(coding.where(system = 'http://snomed.info/sct' and code = '840539006' and display)) and doseNumber.ofType(string)).exists()"/>
633583
<warningOnly value="false"/>
634584
</assert>
635585
</action>
@@ -651,9 +601,9 @@
651601
<valueBoolean value="false"/>
652602
</extension>
653603
<label value="1-14-2"/>
654-
<description value="Contains .protocolApplied.doseNumberString 'n/a'. This assert checks only one child. Assert 1-14 checks if all children are present in the same parent. This assert is set to warning because string comparisons can have many possible caveats"/>
604+
<description value="Contains .protocolApplied.doseNumberString. This assert checks only one child. Assert 1-14 checks if all children are present in the same parent. This assert is set to warning because string comparisons can have many possible caveats"/>
655605
<direction value="response"/>
656-
<expression value="Bundle.entry.resource.ofType(Immunization).where(id = '${imm-Immunization-02-id}').protocolApplied.where(doseNumber.ofType(string).replaceMatches('[ .,_-]+', ' ') ~ 'n/a').exists()"/>
606+
<expression value="Bundle.entry.resource.ofType(Immunization).where(id = '${imm-Immunization-02-id}').protocolApplied.where(doseNumber.ofType(string).exists()).exists()"/>
657607
<warningOnly value="true"/>
658608
</assert>
659609
</action>
@@ -681,6 +631,7 @@
681631
<field value="MedMij-Request-ID"/>
682632
<value value="${UUID}"/>
683633
</requestHeader>
634+
<responseId value="d1e20"/>
684635
<url value="${pharmaceuticalProduct-url}"/>
685636
</operation>
686637
</action>
@@ -751,4 +702,78 @@
751702
</assert>
752703
</action>
753704
</test>
705+
<test>
706+
<name value="Scenario 1.1 - Read Medication resource - Check Medication"/>
707+
<description value="Check if the previous operation results in a FHIR Medication that contains the values that are expected following Nictiz' materials (fixture .id: imm-PharmaceuticalProduct-02)"/>
708+
<action>
709+
<assert>
710+
<extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail">
711+
<valueBoolean value="true"/>
712+
</extension>
713+
<description value="Response contains exactly 1 Medication"/>
714+
<direction value="response"/>
715+
<expression value="Medication.count() = 1"/>
716+
<warningOnly value="false"/>
717+
</assert>
718+
</action>
719+
<action>
720+
<assert>
721+
<extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail">
722+
<valueBoolean value="true"/>
723+
</extension>
724+
<description value="Medication resource evaluated in the previous assert contains an .id"/>
725+
<direction value="response"/>
726+
<expression value="Medication.id.exists()"/>
727+
<warningOnly value="false"/>
728+
</assert>
729+
</action>
730+
<action>
731+
<assert>
732+
<extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail">
733+
<valueBoolean value="false"/>
734+
</extension>
735+
<label value="1-1"/>
736+
<description value="Contains .meta with .profile 'http://nictiz.nl/fhir/StructureDefinition/nl-core-PharmaceuticalProduct'"/>
737+
<direction value="response"/>
738+
<expression value="Medication.where(id = '${imm-PharmaceuticalProduct-02-id}').meta.profile.where($this = 'http://nictiz.nl/fhir/StructureDefinition/nl-core-PharmaceuticalProduct').exists()"/>
739+
<warningOnly value="false"/>
740+
</assert>
741+
</action>
742+
<action>
743+
<assert>
744+
<extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail">
745+
<valueBoolean value="false"/>
746+
</extension>
747+
<label value="1-2"/>
748+
<description value="Contains .code with .coding with .system 'urn:oid:2.16.840.1.113883.2.4.4.7' and .code '2978636' and .display"/>
749+
<direction value="response"/>
750+
<expression value="Medication.where(id = '${imm-PharmaceuticalProduct-02-id}').code.coding.where(system = 'urn:oid:2.16.840.1.113883.2.4.4.7' and code = '2978636' and display).exists()"/>
751+
<warningOnly value="false"/>
752+
</assert>
753+
</action>
754+
<action>
755+
<assert>
756+
<extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail">
757+
<valueBoolean value="false"/>
758+
</extension>
759+
<label value="1-3"/>
760+
<description value="Contains .form with .coding with .system 'urn:oid:2.16.840.1.113883.2.4.4.11' and .code '76' and .display"/>
761+
<direction value="response"/>
762+
<expression value="Medication.where(id = '${imm-PharmaceuticalProduct-02-id}').form.coding.where(system = 'urn:oid:2.16.840.1.113883.2.4.4.11' and code = '76' and display).exists()"/>
763+
<warningOnly value="false"/>
764+
</assert>
765+
</action>
766+
<action>
767+
<assert>
768+
<extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail">
769+
<valueBoolean value="false"/>
770+
</extension>
771+
<label value="1-4"/>
772+
<description value="Contains .batch with .lotNumber"/>
773+
<direction value="response"/>
774+
<expression value="Medication.where(id = '${imm-PharmaceuticalProduct-02-id}').batch.lotNumber.exists()"/>
775+
<warningOnly value="false"/>
776+
</assert>
777+
</action>
778+
</test>
754779
</TestScript>

0 commit comments

Comments
 (0)