usnistgov / iheos-toolkit2

XDS Toolkit
https://ihexds.nist.gov
45 stars 25 forks source link

Fix Initiating Gateway (IG) Conformance Test 12300 FindDocuments for LeafClass #595

Closed skbhaskarla closed 5 months ago

skbhaskarla commented 11 months ago

1) The Test description says, "The specific Patient ID is listed as Single document in Community 1" 2) Testplan.xml uses an incorrect Test 12318 as its log result reference for patient Id 3) The assertions are actually for "Two documents in Community 1"

Fix testplan.xml using this approach: Installation testplan.xml location: webapps\xdstools\toolkitx\testkit\tests\12300\finddocs\testplan.xml

<?xml version="1.0" encoding="UTF-8"?>
<TestPlan>
    <Test>12300/finddocs</Test>
    <SUTInitiates/>   <!-- the SUT actually does this stuff -->
    <TestStep id="finddocs">
        <ExpectedStatus>Success</ExpectedStatus>
        <Rule>
            <Transaction>XGQ</Transaction>
            <SQ>Test FindDocuments XGC</SQ>
            <Assertion>LeafClass return</Assertion>
        </Rule>
        <XCQTransaction>

            <MetadataFile>query.xml</MetadataFile>

<!-- 
12:55 PM 9/20/2023
skb comment out because 12318 is not part of IG orchestration.
            <UseId testdir="../../12318/init" id="SubmissionSet01" step="init"
            section="AssignedPatientId" symbol="$patient_id$"/>
-->

<!-- 15825 is Two documents in Community 1 -->
<!--
<UseReport reportName="$patientid$" test="15825" section="pif" step="step" useAs="$patient_id$"/>
-->

<!-- 15824 is Single documents in Community 1 -->
<UseReport reportName="$patientid$" test="15824" section="pif" step="step" useAs="$patient_id$"/>

            <Report name="$home$" section="Result">
                //*[local-name()='ExtrinsicObject']/@home
            </Report>
            <Report name="$doc_uid_1$" section="Result">
                //*[local-name()='ExtrinsicObject'][1]/*[local-name()='ExternalIdentifier'][@identificationScheme='urn:uuid:2e82c1f6-a085-4c72-9da3-8640a32e42ab']/@value
            </Report>
<!--
            <Report name="$doc_uid_2$" section="Result">
                //*[local-name()='ExtrinsicObject'][2]/*[local-name()='ExternalIdentifier'][@identificationScheme='urn:uuid:2e82c1f6-a085-4c72-9da3-8640a32e42ab']/@value
            </Report>
-->
            <Report name="$repositoryUniqueId$" section="Result">
                //*[local-name()='ExtrinsicObject'][1]/*[local-name()='Slot'][@name='repositoryUniqueId']/*[local-name()='ValueList']/*[local-name()='Value']
            </Report>
            <Assertions>
               <DataRef file="THIS" as="output"/>
               <Assert id="ExtrinsicObjectCount"> 
count(//XCQTransaction[@step="finddocs"]/Result/*[local-name(.)='AdhocQueryResponse']/*[local-name(.)='RegistryObjectList']/*[local-name(.)='ExtrinsicObject']) = 1
               </Assert>
            </Assertions>
        </XCQTransaction>
    </TestStep>
</TestPlan>

FindDocuments tool was used to query the IG test simulator.

Test passed after testplan.xml fix image