<?xml version="1.0" encoding="UTF-8"?>

<TestScript xmlns="http://hl7.org/fhir">
  <id value="ie-core-testscript-patient-read"/>
  <text>
    <status value="generated"/><div xmlns="http://www.w3.org/1999/xhtml"><p class="res-header-id"><b>Generated Narrative: TestScript ie-core-testscript-patient-read</b></p><a name="ie-core-testscript-patient-read"> </a><a name="hcie-core-testscript-patient-read"> </a><p><b>url</b>: <a href="TestScript-ie-core-testscript-patient-read.html">TestScript IE Core TestScript: Patient Read</a></p><p><b>version</b>: 0.3.0</p><p><b>name</b>: IECoreTestScriptPatientRead</p><p><b>title</b>: IE Core TestScript: Patient Read</p><p><b>status</b>: Draft</p><p><b>date</b>: 2025-01-01</p><p><b>publisher</b>: Nithin Mohan T K (Proof of Concept)</p><p><b>contact</b>: Nithin Mohan T K (Proof of Concept): <a href="https://github.com/hl7-ie">https://github.com/hl7-ie</a>,<a href="mailto:nithinmohantk1@gmail.com">nithinmohantk1@gmail.com</a></p><p><b>description</b>: </p><div><p>Verifies that a FHIR server can return a Patient resource conforming to the IE Core Patient profile.</p>
</div><p><b>jurisdiction</b>: <span title="Codes:{urn:iso:std:iso:3166 IE}">Ireland</span></p><blockquote><p><b>fixture</b></p><blockquote><p><b>id</b></p>patient-fixture</blockquote><p><b>autocreate</b>: false</p><p><b>autodelete</b>: false</p><p><b>resource</b>: <a href="Patient-ie-core-patient-example.html">John Patrick Murphy (official) Male, DoB: 1978-05-15 ( National unique individual identifier: IECoreNamingSystemIHI#210000000012345678)</a></p></blockquote><blockquote><p><b>test</b></p><p><b>name</b>: Patient Read Test</p><p><b>description</b>: Read a Patient and verify it conforms to the IE Core Patient profile.</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>Accept</b></td><td><b>EncodeRequestUrl</b></td><td><b>Params</b></td></tr><tr><td style="display: none">*</td><td><a href="http://terminology.hl7.org/7.4.0/CodeSystem-testscript-operation-codes.html#testscript-operation-codes-read">Test script operation code: read</a> (Read)</td><td>Patient</td><td>Read the Patient resource</td><td>json</td><td>true</td><td>/ie-core-patient-example</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>Response</b></td><td><b>WarningOnly</b></td></tr><tr><td style="display: none">*</td><td>Confirm the response is HTTP 200 OK</td><td>okay</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>Resource</b></td><td><b>WarningOnly</b></td></tr><tr><td style="display: none">*</td><td>Confirm the returned resource is a Patient</td><td>Patient</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>Expression</b></td><td><b>WarningOnly</b></td></tr><tr><td style="display: none">*</td><td>Confirm Patient has the IE Core Patient profile</td><td>meta.profile.where($this = 'https://hl7-ie.github.io/ie-core/fhir/ie/core/StructureDefinition/ie-core-patient').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>Expression</b></td><td><b>WarningOnly</b></td></tr><tr><td style="display: none">*</td><td>Confirm Patient has at least one name</td><td>name.count() &gt;= 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>Expression</b></td><td><b>WarningOnly</b></td></tr><tr><td style="display: none">*</td><td>Confirm Patient has a gender</td><td>gender.exists()</td><td>false</td></tr></table></blockquote></blockquote></div>
  </text>
  <url value="https://hl7-ie.github.io/ie-core/fhir/ie/core/TestScript/ie-core-testscript-patient-read"/>
  <version value="0.3.0"/>
  <name value="IECoreTestScriptPatientRead"/>
  <title value="IE Core TestScript: Patient Read"/>
  <status value="draft"/>
  <date value="2025-01-01"/>
  <publisher value="Nithin Mohan T K (Proof of Concept)"/>
  <contact>
    <name value="Nithin Mohan T K (Proof of Concept)"/>
    <telecom>
      <system value="url"/>
      <value value="https://github.com/hl7-ie"/>
    </telecom>
    <telecom>
      <system value="email"/>
      <value value="nithinmohantk1@gmail.com"/>
    </telecom>
  </contact>
  <description value="Verifies that a FHIR server can return a Patient resource conforming to the IE Core Patient profile."/>
  <jurisdiction>
    <coding>
      <system value="urn:iso:std:iso:3166"/>
      <code value="IE"/>
      <display value="Ireland"/>
    </coding>
  </jurisdiction>
  <fixture id="patient-fixture">
    <autocreate value="false"/>
    <autodelete value="false"/>
    <resource>
      <reference value="Patient/ie-core-patient-example"/>
    </resource>
  </fixture>
  <test>
    <name value="Patient Read Test"/>
    <description value="Read a Patient and verify it conforms to the IE Core Patient profile."/>
    <action>
      <operation>
        <type>
          <system value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>
          <code value="read"/>
        </type>
        <resource value="Patient"/>
        <description value="Read the Patient resource"/>
        <accept value="json"/>
        <encodeRequestUrl value="true"/>
        <params value="/ie-core-patient-example"/>
      </operation>
    </action>
    <action>
      <assert>
        <description value="Confirm the response is HTTP 200 OK"/>
        <response value="okay"/>
        <warningOnly value="false"/>
      </assert>
    </action>
    <action>
      <assert>
        <description value="Confirm the returned resource is a Patient"/>
        <resource value="Patient"/>
        <warningOnly value="false"/>
      </assert>
    </action>
    <action>
      <assert>
        <description value="Confirm Patient has the IE Core Patient profile"/>
        <expression value="meta.profile.where($this = 'https://hl7-ie.github.io/ie-core/fhir/ie/core/StructureDefinition/ie-core-patient').exists()"/>
        <warningOnly value="false"/>
      </assert>
    </action>
    <action>
      <assert>
        <description value="Confirm Patient has at least one name"/>
        <expression value="name.count() &gt;= 1"/>
        <warningOnly value="false"/>
      </assert>
    </action>
    <action>
      <assert>
        <description value="Confirm Patient has a gender"/>
        <expression value="gender.exists()"/>
        <warningOnly value="false"/>
      </assert>
    </action>
  </test>
</TestScript>