Skip to content

Commit 5b933c4

Browse files
Cleanup
1 parent bd6a69d commit 5b933c4

File tree

1 file changed

+21
-79
lines changed

1 file changed

+21
-79
lines changed

src/MP9-3-0-0-beta/_internalTools/xslt/ada_2_nts-medicationdata-pull.xsl

Lines changed: 21 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -218,12 +218,16 @@
218218
<xsl:variable name="theScenarioParamsMedMij" select="concat('?', $theParamParts, $theAdditionalParamParts)"/>
219219

220220
<xsl:variable name="returnCount" select="count($adaInstance/medicamenteuze_behandeling/*[not(self::identificatie)])"/>
221-
<xsl:variable name="returnMedicationCount" select="count($adaInstance/bouwstenen/farmaceutisch_product)"/>
222-
<xsl:variable name="returnEntryCount" select="$returnCount + $returnMedicationCount"/>
221+
<!-- Select ADA Medication entries -->
222+
<xsl:variable name="medicationValues" as="xs:string*"
223+
select="$adaInstance/medicamenteuze_behandeling//farmaceutisch_product/@value"/>
224+
<xsl:variable name="medicationValuesDistinct" as="xs:string*" select="distinct-values($medicationValues)"/>
225+
<xsl:variable name="expectedMedCount" select="count($medicationValuesDistinct)"/>
226+
<xsl:variable name="returnEntryCount" select="$returnCount + $expectedMedCount"/>
223227
<xsl:variable name="returnEntryBreakdown">
224228
<xsl:choose>
225229
<xsl:when test="$returnEntryCount gt 0">
226-
<xsl:value-of select="concat('(Consists of ', $returnCount, ' ', $matchResource, ' and ', $returnMedicationCount, ' Medication resources.)')"/>
230+
<xsl:value-of select="concat('(Consists of ', $returnCount, ' ', $matchResource, ' and ', $expectedMedCount, ' Medication resources.)')"/>
227231
</xsl:when>
228232
<xsl:otherwise>
229233
<xsl:text>(Consists of no resources.)</xsl:text>
@@ -269,23 +273,8 @@
269273
<name value="Scenario {$scenarioset}.{$scenario}"/>
270274
<description value="{$description}"/>
271275
<xsl:choose>
272-
<xsl:when test="$transactionTypeNormalized = 'retrieve'">
273-
<!-- Select ADA primary building-block entries -->
274-
<xsl:variable name="adaBouwstenen"
275-
select="$adaInstance/medicamenteuze_behandeling/*[not(self::identificatie)]"/>
276-
277-
<!-- Select ADA Medication entries -->
278-
<xsl:variable name="medicationValues" as="xs:string*"
279-
select="$adaInstance/medicamenteuze_behandeling//farmaceutisch_product/@value"/>
280-
<xsl:variable name="medicationValuesDistinct" as="xs:string*"
281-
select="distinct-values($medicationValues)"/>
282-
283-
<!-- Aantal unieke medicamenten -->
284-
<xsl:variable name="expectedMedCount" select="count($medicationValuesDistinct)"/>
285-
286-
<!-- Build filtered identifier sets and expected counts -->
287-
<xsl:variable name="identifiers" as="xs:string*" select="$adaBouwstenen/identificatie/@value"/>
288-
<xsl:variable name="expectedCount" select="count($identifiers)"/>
276+
<xsl:when test="$transactionTypeNormalized = 'retrieve'">
277+
<!-- Build filtered identifier sets and expected counts -->
289278
<nts:include value="test.client.search" scope="common" nts:in-targets="#default">
290279
<nts:with-parameter name="description" value="Test client to retrieve {$matchResource} resource(s) representing MP9 building block {$buildingBlockLong}"/>
291280
<nts:with-parameter name="resource" value="{$matchResource}"/>
@@ -299,32 +288,15 @@
299288
<nts:include value="canary-assert.response.successfulSearch" scope="common"/>
300289
<nts:include value="assert-returnCount" scope="project">
301290
<nts:with-parameter name="resource" value="{$matchResource}"/>
302-
<nts:with-parameter name="count" value="{$expectedCount}"/>
291+
<nts:with-parameter name="count" value="{$returnCount}"/>
303292
</nts:include>
304293
<!-- Assert Medication count -->
305294
<nts:include value="assert-returnCount" scope="project">
306295
<nts:with-parameter name="resource" value="Medication"/>
307296
<nts:with-parameter name="count" value="{$expectedMedCount}"/>
308297
</nts:include>
309298
</xsl:when>
310-
<xsl:when test="$transactionTypeNormalized = 'serve'">
311-
<!-- Select ADA primary building-block entries -->
312-
<xsl:variable name="adaBouwstenen"
313-
select="$adaInstance/medicamenteuze_behandeling/*[not(self::identificatie)]"/>
314-
315-
<!-- Select ADA Medication entries -->
316-
<xsl:variable name="medicationValues" as="xs:string*"
317-
select="$adaInstance/medicamenteuze_behandeling//farmaceutisch_product/@value"/>
318-
<xsl:variable name="medicationValuesDistinct" as="xs:string*"
319-
select="distinct-values($medicationValues)"/>
320-
321-
<!-- Aantal unieke medicamenten -->
322-
<xsl:variable name="expectedMedCount" select="count($medicationValuesDistinct)"/>
323-
324-
325-
<!-- Build filtered identifier sets and expected counts -->
326-
<xsl:variable name="identifiers" as="xs:string*" select="$adaBouwstenen/identificatie/@value"/>
327-
<xsl:variable name="expectedCount" select="count($identifiers)"/>
299+
<xsl:when test="$transactionTypeNormalized = 'serve'">
328300
<!--NICTIZ-29763 removed CheckContent from target so no content asserts scripts will be generated
329301
<nts:include value="test.server.search" scope="common" nts:in-targets="#default CheckContent">-->
330302
<nts:include value="test.server.search" scope="common" nts:in-targets="#default">
@@ -341,7 +313,7 @@
341313
<nts:include value="assert-responseBundleContent-noMM"/>
342314
<nts:include value="assert-returnCountAtLeast" scope="project">
343315
<nts:with-parameter name="resource" value="{$matchResource}"/>
344-
<nts:with-parameter name="count" value="{$expectedCount}"/>
316+
<nts:with-parameter name="count" value="{$returnCount}"/>
345317
</nts:include>
346318
<!-- Assert Medication count -->
347319
<nts:include value="assert-returnCount" scope="project">
@@ -473,12 +445,16 @@
473445

474446
<xsl:variable name="description" as="xs:string?" select="$adaInstance/@desc"/>
475447
<xsl:variable name="returnCount" select="count($adaInstance/medicamenteuze_behandeling/*[not(self::identificatie)])"/>
476-
<!-- We add the medication products, since those are in an include in the query -->
477-
<xsl:variable name="returnEntryCount" select="$returnCount + count($adaInstance/bouwstenen/farmaceutisch_product)"/>
448+
<!-- Select ADA Medication entries -->
449+
<xsl:variable name="medicationValues" as="xs:string*"
450+
select="$adaInstance/medicamenteuze_behandeling//farmaceutisch_product/@value"/>
451+
<xsl:variable name="medicationValuesDistinct" as="xs:string*" select="distinct-values($medicationValues)"/>
452+
<xsl:variable name="expectedMedCount" select="count($medicationValuesDistinct)"/>
453+
<xsl:variable name="returnEntryCount" select="$returnCount + $expectedMedCount"/>
478454
<xsl:variable name="returnEntryBreakdown">
479455
<xsl:choose>
480456
<xsl:when test="$returnEntryCount gt 0">
481-
<xsl:value-of select="concat('(Consists of ', $returnCount, ' ', $matchResource, ' and ', count($adaInstance/bouwstenen/farmaceutisch_product), ' Medication resources.)')"/>
457+
<xsl:value-of select="concat('(Consists of ', $returnCount, ' ', $matchResource, ' and ', $expectedMedCount, ' Medication resources.)')"/>
482458
</xsl:when>
483459
<xsl:otherwise>
484460
<xsl:text>(Consists of no resources.)</xsl:text>
@@ -521,23 +497,7 @@
521497
<name value="Scenario {$theScenario}"/>
522498
<description value="{$description}"/>
523499
<xsl:choose>
524-
<xsl:when test="$transactionTypeNormalized = 'retrieve'">
525-
<!-- Select ADA primary building-block entries -->
526-
<xsl:variable name="adaBouwstenen"
527-
select="$adaInstance/medicamenteuze_behandeling/*[not(self::identificatie)]"/>
528-
529-
<!-- Select ADA Medication entries -->
530-
<xsl:variable name="medicationValues" as="xs:string*"
531-
select="$adaInstance/medicamenteuze_behandeling//farmaceutisch_product/@value"/>
532-
<xsl:variable name="medicationValuesDistinct" as="xs:string*"
533-
select="distinct-values($medicationValues)"/>
534-
535-
<!-- Aantal unieke medicamenten -->
536-
<xsl:variable name="expectedMedCount" select="count($medicationValuesDistinct)"/>
537-
538-
<!-- Build filtered identifier sets and expected counts -->
539-
<xsl:variable name="identifiers" as="xs:string*" select="$adaBouwstenen/identificatie/@value"/>
540-
<xsl:variable name="expectedCount" select="count($identifiers)"/>
500+
<xsl:when test="$transactionTypeNormalized = 'retrieve'">
541501
<nts:include value="test.client.search" scope="common" nts:in-targets="#default">
542502
<nts:with-parameter name="description" value="Test client to retrieve {$matchResource} resource(s) representing MP9 building block {$buildingBlockLong}"/>
543503
<nts:with-parameter name="resource" value="{$matchResource}"/>
@@ -560,25 +520,7 @@
560520
<nts:with-parameter name="count" value="{$expectedMedCount}"/>
561521
</nts:include>
562522
</xsl:when>
563-
<xsl:when test="$transactionTypeNormalized = 'serve'">
564-
<!-- Select ADA primary building-block entries -->
565-
<xsl:variable name="adaBouwstenen"
566-
select="$adaInstance/medicamenteuze_behandeling/*[not(self::identificatie)]"/>
567-
568-
<!-- Select ADA Medication entries -->
569-
<xsl:variable name="medicationValues" as="xs:string*"
570-
select="$adaInstance/medicamenteuze_behandeling//farmaceutisch_product/@value"/>
571-
<xsl:variable name="medicationValuesDistinct" as="xs:string*"
572-
select="distinct-values($medicationValues)"/>
573-
574-
<!-- Aantal unieke medicamenten -->
575-
<xsl:variable name="expectedMedCount" select="count($medicationValuesDistinct)"/>
576-
577-
578-
<!-- Build filtered identifier sets and expected counts -->
579-
<xsl:variable name="identifiers" as="xs:string*" select="$adaBouwstenen/identificatie/@value"/>
580-
<xsl:variable name="expectedCount" select="count($identifiers)"/>
581-
523+
<xsl:when test="$transactionTypeNormalized = 'serve'">
582524
<!--NICTIZ-29763 removed CheckContent from target so no content asserts scripts will be generated
583525
<nts:include value="test.server.search" scope="common" nts:in-targets="#default CheckContent">-->
584526
<nts:include value="test.server.search" scope="common" nts:in-targets="#default">

0 commit comments

Comments
 (0)