0.1.0 - ci-build
ConditionListtestscripts, published by MedCom. This guide is not an authorized publication; it is the continuous build for version 0.1.0 built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/medcomdk/dk-medcom-ConditionList-test-scripts/ and changes regularly. See the Directory of published versions
Active as of 2025-04-01 |
<TestScript xmlns="http://hl7.org/fhir">
<id value="maximum-example"/>
<meta>
<profile
value="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript"/>
</meta>
<text>
<status value="generated"/>
<div xmlns="http://www.w3.org/1999/xhtml"><p class="res-header-id"><b>Generated Narrative: TestScript maximum-example</b></p><a name="maximum-example"> </a><a name="hcmaximum-example"> </a><div style="display: inline-block; background-color: #d9e0e7; padding: 6px; margin: 4px; border: 1px solid #8da1b4; border-radius: 5px; line-height: 60%"><p style="margin-bottom: 0px"/><p style="margin-bottom: 0px">Profile: <code>http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript</code></p></div><p><b>url</b>: <a href="TestScript-maximum-example.html">TestScript Send: ConditionList_Testscript_Send-max-example</a></p><p><b>version</b>: 0.1.0</p><p><b>name</b>: ConditionListTestScript</p><p><b>title</b>: Send: ConditionList_Testscript_Send-max-example</p><p><b>status</b>: Active</p><p><b>date</b>: 2025-04-01</p><p><b>publisher</b>: MedCom</p><p><b>contact</b>: MedCom: <a href="www.medcom.dk">www.medcom.dk</a></p><p><b>description</b>: </p><div><p>Validate that a ConditionList contains a condition with all content, including optional, present and that these elements specifically contains: category:status = 723506003 (resolved), category:type = encounter-diagnosis, clinicalStatus = resolved. No note (DA: Tillægstekst) must be present.</p>
</div><p><b>copyright</b>: </p><div><p>MedCom 2025</p>
</div><h3>Origins</h3><table class="grid"><tr><td style="display: none">-</td><td><b>Index</b></td><td><b>Profile</b></td></tr><tr><td style="display: none">*</td><td>1</td><td><a href="http://terminology.hl7.org/6.5.0/CodeSystem-testscript-profile-origin-types.html#testscript-profile-origin-types-FHIR-Client">Test script profile origin type FHIR-Client</a>: FHIR Client</td></tr></table><h3>Destinations</h3><table class="grid"><tr><td style="display: none">-</td><td><b>Index</b></td><td><b>Profile</b></td></tr><tr><td style="display: none">*</td><td>1</td><td><a href="http://terminology.hl7.org/6.5.0/CodeSystem-testscript-profile-destination-types.html#testscript-profile-destination-types-FHIR-Server">Test script profile destination type FHIR-Server</a>: FHIR Server</td></tr></table><blockquote><p><b>fixture</b></p><blockquote><p><b>id</b></p>create-CList-01</blockquote><p><b>autocreate</b>: false</p><p><b>autodelete</b>: false</p><p><b>resource</b>: <code>./fixtures/fixtures.json</code></p></blockquote><p><b>profile</b>: <a href="http://medcomfhir.dk/ig/conditionlist/StructureDefinition/medcom-conditionlist-bundle">http://medcomfhir.dk/ig/conditionlist/StructureDefinition/medcom-conditionlist-bundle</a></p><blockquote><p><b>test</b></p><blockquote><p><b>id</b></p>ConditionList-create-CList-01</blockquote><p><b>name</b>: Create a ConditionList CList Message 01</p><p><b>description</b>: Post ConditionList to the server.</p><blockquote><p><b>action</b></p><h3>Operations</h3><table class="grid"><tr><td style="display: none">-</td><td><b>Type</b></td><td><b>Resource</b></td><td><b>Description</b></td><td><b>Destination</b></td><td><b>EncodeRequestUrl</b></td><td><b>Origin</b></td><td><b>ResponseId</b></td><td><b>SourceId</b></td></tr><tr><td style="display: none">*</td><td><a href="http://terminology.hl7.org/6.5.0/CodeSystem-testscript-operation-codes.html#testscript-operation-codes-create">Test script operation code create</a>: Create</td><td>Bundle</td><td>Post a ConditionList</td><td>1</td><td>true</td><td>1</td><td>create-message-CList</td><td>create-CList-01</td></tr></table></blockquote><blockquote><p><b>action</b></p><h3>Asserts</h3><table class="grid"><tr><td style="display: none">-</td><td><b>Description</b></td><td><b>Direction</b></td><td><b>Resource</b></td><td><b>WarningOnly</b></td></tr><tr><td style="display: none">*</td><td>Confirm that the client request payload contains a Bundle resource type.</td><td>request</td><td>Bundle</td><td>false</td></tr></table></blockquote><blockquote><p><b>action</b></p><h3>Asserts</h3><table class="grid"><tr><td style="display: none">-</td><td><b>Description</b></td><td><b>Direction</b></td><td><b>Operator</b></td><td><b>ResponseCode</b></td><td><b>WarningOnly</b></td></tr><tr><td style="display: none">*</td><td>Confirm that the returned HTTP status is okay or created.</td><td>response</td><td>in</td><td>200,201</td><td>false</td></tr></table></blockquote><blockquote><p><b>action</b></p><h3>Asserts</h3><table class="grid"><tr><td style="display: none">-</td><td><b>Description</b></td><td><b>Direction</b></td><td><b>ValidateProfileId</b></td><td><b>WarningOnly</b></td></tr><tr><td style="display: none">*</td><td>Validate the bundle against medcomConditionList profile</td><td>request</td><td>MedComConditionListBundle</td><td>false</td></tr></table></blockquote><blockquote><p><b>action</b></p><h3>Asserts</h3><table class="grid"><tr><td style="display: none">-</td><td><b>Description</b></td><td><b>Direction</b></td><td><b>Expression</b></td><td><b>WarningOnly</b></td></tr><tr><td style="display: none">*</td><td>ConfValidate that the SKS-D codes, including code, system, and if available, display value.</td><td>request</td><td>Bundle.entry.resource.ofType(Condition).code.coding.where(select(system = 'urn:oid:1.2.208.176.2.4.12' and code.exists() )).count() = Bundle.entry.resource.ofType(Condition).count()</td><td>false</td></tr></table></blockquote><blockquote><p><b>action</b></p><h3>Asserts</h3><table class="grid"><tr><td style="display: none">-</td><td><b>Description</b></td><td><b>Direction</b></td><td><b>Expression</b></td><td><b>WarningOnly</b></td></tr><tr><td style="display: none">*</td><td>Validate that there is a display value attached to all SKS codes</td><td>request</td><td>Bundle.entry.resource.ofType(Condition).code.coding.where(system = 'urn:oid:1.2.208.176.2.4.12').display.count() = Bundle.entry.resource.ofType(Condition).code.coding.where(system = 'urn:oid:1.2.208.176.2.4.12').count()</td><td>true</td></tr></table></blockquote><blockquote><p><b>action</b></p><h3>Asserts</h3><table class="grid"><tr><td style="display: none">-</td><td><b>Description</b></td><td><b>Direction</b></td><td><b>Expression</b></td><td><b>WarningOnly</b></td></tr><tr><td style="display: none">*</td><td>Validate existance of ICPC-2 codes, including code, system, and if available, display value.</td><td>request</td><td>Bundle.entry.resource.ofType(Condition).code.coding.where(system = 'urn:oid:1.2.208.176.2.31').select(code | system | display).count() > 1</td><td>false</td></tr></table></blockquote><blockquote><p><b>action</b></p><h3>Asserts</h3><table class="grid"><tr><td style="display: none">-</td><td><b>Description</b></td><td><b>Direction</b></td><td><b>Expression</b></td><td><b>WarningOnly</b></td></tr><tr><td style="display: none">*</td><td>Validate that there is a display value attached to all ICPC2 codes</td><td>request</td><td>Bundle.entry.resource.ofType(Condition).code.coding.where(system = 'urn:oid:1.2.208.176.2.31').display.count() = Bundle.entry.resource.ofType(Condition).code.coding.where(system = 'urn:oid:1.2.208.176.2.31').count()</td><td>true</td></tr></table></blockquote><blockquote><p><b>action</b></p><h3>Asserts</h3><table class="grid"><tr><td style="display: none">-</td><td><b>Description</b></td><td><b>Direction</b></td><td><b>Expression</b></td><td><b>WarningOnly</b></td></tr><tr><td style="display: none">*</td><td>Validate that a code.text (DA: diagnosetekst) exists</td><td>request</td><td>Bundle.entry.resource.ofType(Condition).code.text.exists()</td><td>false</td></tr></table></blockquote><blockquote><p><b>action</b></p><h3>Asserts</h3><table class="grid"><tr><td style="display: none">-</td><td><b>Description</b></td><td><b>Direction</b></td><td><b>Expression</b></td><td><b>WarningOnly</b></td></tr><tr><td style="display: none">*</td><td>Validate the existance of category:status system = http://snomed.info/sct and code = 723506003</td><td>request</td><td>Bundle.entry.resource.ofType(Condition).category.coding.where(system = 'http://snomed.info/sct' and code = '723506003').exists()</td><td>false</td></tr></table></blockquote><blockquote><p><b>action</b></p><h3>Asserts</h3><table class="grid"><tr><td style="display: none">-</td><td><b>Description</b></td><td><b>Direction</b></td><td><b>Expression</b></td><td><b>WarningOnly</b></td></tr><tr><td style="display: none">*</td><td>Validate existance of category:type and that system = http://terminology.hl7.org/CodeSystem/condition-category and code = problem-list-item</td><td>request</td><td>Bundle.entry.resource.ofType(Condition).category.coding.where(system = 'http://terminology.hl7.org/CodeSystem/condition-category' and code = 'problem-list-item' ).exists()</td><td>false</td></tr></table></blockquote><blockquote><p><b>action</b></p><h3>Asserts</h3><table class="grid"><tr><td style="display: none">-</td><td><b>Description</b></td><td><b>Direction</b></td><td><b>Expression</b></td><td><b>WarningOnly</b></td></tr><tr><td style="display: none">*</td><td>Validate existance of onsetDateTime</td><td>request</td><td>Bundle.entry.resource.ofType(Condition).onset.exists()</td><td>false</td></tr></table></blockquote><blockquote><p><b>action</b></p><h3>Asserts</h3><table class="grid"><tr><td style="display: none">-</td><td><b>Description</b></td><td><b>Direction</b></td><td><b>Expression</b></td><td><b>WarningOnly</b></td></tr><tr><td style="display: none">*</td><td>Validate existance of abatementDateTime</td><td>request</td><td>Bundle.entry.resource.ofType(Condition).abatement.exists()</td><td>false</td></tr></table></blockquote><blockquote><p><b>action</b></p><h3>Asserts</h3><table class="grid"><tr><td style="display: none">-</td><td><b>Description</b></td><td><b>Direction</b></td><td><b>Expression</b></td><td><b>WarningOnly</b></td></tr><tr><td style="display: none">*</td><td>Validate existance of recordedDate</td><td>request</td><td>Bundle.entry.resource.ofType(Condition).recordedDate.exists()</td><td>false</td></tr></table></blockquote><blockquote><p><b>action</b></p><h3>Asserts</h3><table class="grid"><tr><td style="display: none">-</td><td><b>Description</b></td><td><b>Direction</b></td><td><b>Expression</b></td><td><b>WarningOnly</b></td></tr><tr><td style="display: none">*</td><td>Validate existance of clinicalStatus coding code exists</td><td>request</td><td>Bundle.entry.resource.ofType(Condition).clinicalStatus.coding.code.exists()</td><td>true</td></tr></table></blockquote><blockquote><p><b>action</b></p><h3>Asserts</h3><table class="grid"><tr><td style="display: none">-</td><td><b>Description</b></td><td><b>Direction</b></td><td><b>Expression</b></td><td><b>WarningOnly</b></td></tr><tr><td style="display: none">*</td><td>Validate existance of clinicalStatus coding system exists</td><td>request</td><td>Bundle.entry.resource.ofType(Condition).clinicalStatus.coding.system.exists()</td><td>true</td></tr></table></blockquote><blockquote><p><b>action</b></p><h3>Asserts</h3><table class="grid"><tr><td style="display: none">-</td><td><b>Description</b></td><td><b>Direction</b></td><td><b>Expression</b></td><td><b>WarningOnly</b></td></tr><tr><td style="display: none">*</td><td>It is not allowed to share a Condition.note.text (Danish: Tillægstekst). Validate that a document is made without any conditions containing a Condition.note.text.</td><td>request</td><td>Bundle.entry.resource.ofType(Condition).note.text.exists().not()</td><td>false</td></tr></table></blockquote></blockquote></div>
</text>
<url
value="http://medcomfhir.dk/ig/conditionlisttestscript/maximum-example"/>
<version value="0.1.0"/>
<name value="ConditionListTestScript"/>
<title value="Send: ConditionList_Testscript_Send-max-example"/>
<status value="active"/>
<date value="2025-04-01"/>
<publisher value="MedCom"/>
<contact>
<name value="MedCom"/>
<telecom>
<system value="url"/>
<value value="www.medcom.dk"/>
</telecom>
</contact>
<description
value="Validate that a ConditionList contains a condition with all content, including optional, present and that these elements specifically contains: category:status = 723506003 (resolved), category:type = encounter-diagnosis, clinicalStatus = resolved. No note (DA: Tillægstekst) must be present."/>
<copyright value="MedCom 2025"/>
<origin>
<index value="1"/>
<profile>
<system
value="http://terminology.hl7.org/CodeSystem/testscript-profile-origin-types"/>
<code value="FHIR-Client"/>
</profile>
</origin>
<destination>
<index value="1"/>
<profile>
<system
value="http://terminology.hl7.org/CodeSystem/testscript-profile-destination-types"/>
<code value="FHIR-Server"/>
</profile>
</destination>
<fixture id="create-CList-01">
<autocreate value="false"/>
<autodelete value="false"/>
<resource>
<reference value="./fixtures/fixtures.json"/>
</resource>
</fixture>
<profile id="MedComConditionListBundle">
<reference
value="http://medcomfhir.dk/ig/conditionlist/StructureDefinition/medcom-conditionlist-bundle"/>
</profile>
<test id="ConditionList-create-CList-01">
<name value="Create a ConditionList CList Message 01"/>
<description value="Post ConditionList to the server."/>
<action>
<operation>
<type>
<system
value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>
<code value="create"/>
</type>
<resource value="Bundle"/>
<description value="Post a ConditionList"/>
<destination value="1"/>
<encodeRequestUrl value="true"/>
<origin value="1"/>
<responseId value="create-message-CList"/>
<sourceId value="create-CList-01"/>
</operation>
</action>
<action>
<assert>
<description
value="Confirm that the client request payload contains a Bundle resource type."/>
<direction value="request"/>
<resource value="Bundle"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description
value="Confirm that the returned HTTP status is okay or created."/>
<direction value="response"/>
<operator value="in"/>
<responseCode value="200,201"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description
value="Validate the bundle against medcomConditionList profile"/>
<direction value="request"/>
<validateProfileId value="MedComConditionListBundle"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description
value="ConfValidate that the SKS-D codes, including code, system, and if available, display value."/>
<direction value="request"/>
<expression
value="Bundle.entry.resource.ofType(Condition).code.coding.where(select(system = 'urn:oid:1.2.208.176.2.4.12' and code.exists() )).count() = Bundle.entry.resource.ofType(Condition).count()"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description
value="Validate that there is a display value attached to all SKS codes"/>
<direction value="request"/>
<expression
value="Bundle.entry.resource.ofType(Condition).code.coding.where(system = 'urn:oid:1.2.208.176.2.4.12').display.count() = Bundle.entry.resource.ofType(Condition).code.coding.where(system = 'urn:oid:1.2.208.176.2.4.12').count()"/>
<warningOnly value="true"/>
</assert>
</action>
<action>
<assert>
<description
value="Validate existance of ICPC-2 codes, including code, system, and if available, display value."/>
<direction value="request"/>
<expression
value="Bundle.entry.resource.ofType(Condition).code.coding.where(system = 'urn:oid:1.2.208.176.2.31').select(code | system | display).count() > 1"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description
value="Validate that there is a display value attached to all ICPC2 codes"/>
<direction value="request"/>
<expression
value="Bundle.entry.resource.ofType(Condition).code.coding.where(system = 'urn:oid:1.2.208.176.2.31').display.count() = Bundle.entry.resource.ofType(Condition).code.coding.where(system = 'urn:oid:1.2.208.176.2.31').count()"/>
<warningOnly value="true"/>
</assert>
</action>
<action>
<assert>
<description
value="Validate that a code.text (DA: diagnosetekst) exists"/>
<direction value="request"/>
<expression
value="Bundle.entry.resource.ofType(Condition).code.text.exists()"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description
value="Validate the existance of category:status system = http://snomed.info/sct and code = 723506003"/>
<direction value="request"/>
<expression
value="Bundle.entry.resource.ofType(Condition).category.coding.where(system = 'http://snomed.info/sct' and code = '723506003').exists()"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description
value="Validate existance of category:type and that system = http://terminology.hl7.org/CodeSystem/condition-category and code = problem-list-item"/>
<direction value="request"/>
<expression
value="Bundle.entry.resource.ofType(Condition).category.coding.where(system = 'http://terminology.hl7.org/CodeSystem/condition-category' and code = 'problem-list-item' ).exists()"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description value="Validate existance of onsetDateTime"/>
<direction value="request"/>
<expression
value="Bundle.entry.resource.ofType(Condition).onset.exists()"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description value="Validate existance of abatementDateTime"/>
<direction value="request"/>
<expression
value="Bundle.entry.resource.ofType(Condition).abatement.exists()"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description value="Validate existance of recordedDate"/>
<direction value="request"/>
<expression
value="Bundle.entry.resource.ofType(Condition).recordedDate.exists()"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description
value="Validate existance of clinicalStatus coding code exists"/>
<direction value="request"/>
<expression
value="Bundle.entry.resource.ofType(Condition).clinicalStatus.coding.code.exists()"/>
<warningOnly value="true"/>
</assert>
</action>
<action>
<assert>
<description
value="Validate existance of clinicalStatus coding system exists"/>
<direction value="request"/>
<expression
value="Bundle.entry.resource.ofType(Condition).clinicalStatus.coding.system.exists()"/>
<warningOnly value="true"/>
</assert>
</action>
<action>
<assert>
<description
value="It is not allowed to share a Condition.note.text (Danish: Tillægstekst). Validate that a document is made without any conditions containing a Condition.note.text."/>
<direction value="request"/>
<expression
value="Bundle.entry.resource.ofType(Condition).note.text.exists().not()"/>
<warningOnly value="false"/>
</assert>
</action>
</test>
</TestScript>