Unit Test Results.

Designed for use with JUnit and Ant.

Class org.openhealthtools.mdht.uml.cda.ihe.tests.SupplyEntryTest

NameTestsErrorsFailuresTime(s)Time StampHost
SupplyEntryTest17000.3392013-01-31T13:34:28JKMSoftware-desktop

Tests

NameStatusResultTime(s)
testConstructor

Constraint

OCL

SuccessInvalid XML

Valid XML

0.000
testValidateSupplyEntryHasIntentAuthor

Constraint

IHE Supply Entry MAY satisfy: A supply entry that describes an intent (<supply classCode='SPLY' moodCode='INT'>) may include an <author> element to identify the prescribing provider.

OCL

(self.classCode=vocab::ActClassSupply::SPLY and self.moodCode=vocab::x_DocumentSubstanceMood::INT) implies self.author->size() > 0

SuccessInvalid XML


<supply xmlns="urn:hl7-org:v3" classCode="SPLY" moodCode="INT">
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.7.3"/>
<templateId root="2.16.840.1.113883.10.20.1.34"/>
</supply>

Valid XML


<supply xmlns="urn:hl7-org:v3" classCode="SPLY" moodCode="INT">
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.7.3"/>
<templateId root="2.16.840.1.113883.10.20.1.34"/>
<author/>
</supply>

0.018
testValidateSupplyEntryHasAuthorTime

Constraint

IHE Supply Entry SHALL satisfy: The <time> element must be present to indicate when the author created the prescription. If this information is unknown, it shall be recorded by setting the nullFlavor attribute to UNK.

OCL

not self.author->isEmpty() implies self.author->forAll(author| author.time->size() = 1)

SuccessInvalid XML


<supply xmlns="urn:hl7-org:v3">
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.7.3"/>
<templateId root="2.16.840.1.113883.10.20.1.34"/>
<author/>
</supply>

Valid XML


<supply xmlns="urn:hl7-org:v3">
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.7.3"/>
<templateId root="2.16.840.1.113883.10.20.1.34"/>
<author>
<time/>
</author>
</supply>

0.016
testValidateSupplyEntryHasAssignedAuthor

Constraint

IHE Supply Entry SHALL satisfy: The <assignedAuthor> element shall be present in author, and identifies the author.

OCL

not self.author->isEmpty() implies self.author->forAll(author| author.assignedAuthor->size() = 1)

SuccessInvalid XML


<supply xmlns="urn:hl7-org:v3">
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.7.3"/>
<templateId root="2.16.840.1.113883.10.20.1.34"/>
<author/>
</supply>

Valid XML


<supply xmlns="urn:hl7-org:v3">
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.7.3"/>
<templateId root="2.16.840.1.113883.10.20.1.34"/>
<author>
<assignedAuthor/>
</author>
</supply>

0.017
testValidateSupplyEntryHasAssignedAuthorID

Constraint

IHE Supply Entry SHOULD satisfy: One or more <id> elements should be present in assignedAuthor

OCL

not self.author.assignedAuthor->isEmpty() implies self.author.assignedAuthor->forAll ( assignedAuthor | assignedAuthor.id->size() > 0)

SuccessInvalid XML


<supply xmlns="urn:hl7-org:v3">
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.7.3"/>
<templateId root="2.16.840.1.113883.10.20.1.34"/>
<author>
<assignedAuthor/>
</author>
</supply>

Valid XML


<supply xmlns="urn:hl7-org:v3">
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.7.3"/>
<templateId root="2.16.840.1.113883.10.20.1.34"/>
<author>
<assignedAuthor>
<id/>
</assignedAuthor>
</author>
</supply>

0.019
testValidateSupplyEntryHasAssignedAuthorPersonOrOrg

Constraint

IHE Supply Entry SHALL satisfy: An <assignedPerson> and/or <representedOriganization> element shall be present in assignedAuthor. This element shall contain a <name> element to identify the prescriber or their organization.

OCL

not self.author.assignedAuthor->isEmpty() implies (self.author.assignedAuthor.assignedPerson->size() > 0 and self.author.assignedAuthor.assignedPerson.name->size() > 0) or (self.author.assignedAuthor.representedOrganization->size() > 0 and self.author.assignedAuthor.representedOrganization.name->size() > 0)

SuccessInvalid XML


<supply xmlns="urn:hl7-org:v3">
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.7.3"/>
<templateId root="2.16.840.1.113883.10.20.1.34"/>
<author>
<assignedAuthor>
<assignedPerson/>
<representedOrganization/>
</assignedAuthor>
</author>
</supply>

Valid XML


<supply xmlns="urn:hl7-org:v3">
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.7.3"/>
<templateId root="2.16.840.1.113883.10.20.1.34"/>
<author>
<assignedAuthor>
<assignedPerson/>
<representedOrganization/>
</assignedAuthor>
</author>
<author>
<assignedAuthor>
<assignedPerson>
<name/>
</assignedPerson>
<representedOrganization/>
</assignedAuthor>
</author>
</supply>

0.050
testValidateSupplyEntryHasPerformerTimeEvent

Constraint

IHE Supply Entry SHALL satisfy: The <time> element shall be present in performer to indicate when the prescription was filled (moodCode='EVN'). If this information is unknown, it shall be recorded by setting the nullFlavor attribute to UNK.

OCL

(not self.performer->isEmpty()) and self.moodCode = vocab::x_DocumentSubstanceMood::EVN implies self.performer->forAll(time->size() = 1)

SuccessInvalid XML


<supply xmlns="urn:hl7-org:v3" moodCode="EVN">
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.7.3"/>
<templateId root="2.16.840.1.113883.10.20.1.34"/>
<performer/>
</supply>

Valid XML


<supply xmlns="urn:hl7-org:v3" moodCode="EVN">
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.7.3"/>
<templateId root="2.16.840.1.113883.10.20.1.34"/>
<performer>
<time/>
</performer>
</supply>

0.022
testValidateSupplyEntryHasPerformerTimeIntent

Constraint

IHE Supply Entry SHOULD satisfy: The <time> element should be present to indicate when the prescription is intended to be filled (moodCode='INT').

OCL

(not self.performer->isEmpty()) and self.moodCode = vocab::x_DocumentSubstanceMood::INT implies self.performer->forAll(time->size() = 1)

SuccessInvalid XML


<supply xmlns="urn:hl7-org:v3" moodCode="INT">
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.7.3"/>
<templateId root="2.16.840.1.113883.10.20.1.34"/>
<performer/>
</supply>

Valid XML


<supply xmlns="urn:hl7-org:v3" moodCode="INT">
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.7.3"/>
<templateId root="2.16.840.1.113883.10.20.1.34"/>
<performer>
<time/>
</performer>
</supply>

0.025
testValidateSupplyEntryHasPerformerAssignedEntity

Constraint

IHE Supply Entry SHALL satisfy: The performer/assignedEntity element shall be present, and identifies the filler of the prescription.

OCL

(not self.performer->isEmpty()) implies self.performer->forAll(performer| not performer.assignedEntity.oclIsUndefined())

SuccessInvalid XML


<supply xmlns="urn:hl7-org:v3" moodCode="INT">
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.7.3"/>
<templateId root="2.16.840.1.113883.10.20.1.34"/>
<performer/>
</supply>

Valid XML


<supply xmlns="urn:hl7-org:v3" moodCode="INT">
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.7.3"/>
<templateId root="2.16.840.1.113883.10.20.1.34"/>
<performer>
<assignedEntity/>
</performer>
</supply>

0.015
testValidateSupplyEntryHasPerformerAssignedEntityID

Constraint

IHE Supply Entry SHOULD satisfy: One or more <id> elements should be present. These identify the performer.

OCL

(not self.performer.assignedEntity->isEmpty()) implies self.performer.assignedEntity->forAll(id->size() > 0)

SuccessInvalid XML


<supply xmlns="urn:hl7-org:v3" moodCode="INT">
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.7.3"/>
<templateId root="2.16.840.1.113883.10.20.1.34"/>
<performer>
<assignedEntity/>
</performer>
</supply>

Valid XML


<supply xmlns="urn:hl7-org:v3" moodCode="INT">
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.7.3"/>
<templateId root="2.16.840.1.113883.10.20.1.34"/>
<performer>
<assignedEntity>
<id/>
</assignedEntity>
</performer>
</supply>

0.020
testValidateSupplyEntryHasPerformerEntityPersonOrOrg

Constraint

IHE Supply Entry SHALL satisfy: An <assignedPerson> and/or <representedOriganization> element shall be present. This element shall contain a <name> element to identify the filler or their organization.

OCL

(not self.performer.assignedEntity->isEmpty()) implies self.performer.assignedEntity->forAll(assignedEntity | (not assignedEntity.assignedPerson->isEmpty() and assignedEntity.assignedPerson->forAll( assignedPerson | not assignedPerson.name->isEmpty() ) ) or (not assignedEntity.representedOrganization->isEmpty() and assignedEntity.representedOrganization->forAll(representedOrganization | not representedOrganization.name->isEmpty() ) ) )

SuccessInvalid XML


<supply xmlns="urn:hl7-org:v3">
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.7.3"/>
<templateId root="2.16.840.1.113883.10.20.1.34"/>
<performer>
<assignedEntity/>
</performer>
</supply>

<supply xmlns="urn:hl7-org:v3">
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.7.3"/>
<templateId root="2.16.840.1.113883.10.20.1.34"/>
<performer>
<assignedEntity>
<assignedPerson/>
</assignedEntity>
</performer>
</supply>

<supply xmlns="urn:hl7-org:v3">
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.7.3"/>
<templateId root="2.16.840.1.113883.10.20.1.34"/>
<performer>
<assignedEntity>
<representedOrganization/>
</assignedEntity>
</performer>
</supply>

Valid XML


<supply xmlns="urn:hl7-org:v3">
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.7.3"/>
<templateId root="2.16.840.1.113883.10.20.1.34"/>
<performer>
<assignedEntity>
<assignedPerson>
<name/>
</assignedPerson>
</assignedEntity>
</performer>
</supply>

<supply xmlns="urn:hl7-org:v3">
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.7.3"/>
<templateId root="2.16.840.1.113883.10.20.1.34"/>
<performer>
<assignedEntity>
<representedOrganization>
<name/>
</representedOrganization>
</assignedEntity>
</performer>
</supply>

0.046
testValidateSupplyEntryQuantityHasValue

Constraint

IHE Supply Entry SHALL satisfy: The supply entry should indicate the quantity supplied. The value attribute shall be present and indicates the quantity of medication supplied. If the medication is supplied in dosing units (tablets or capsules), then the unit attribute need not be present (and should be set to 1 if present). Otherwise, the unit element shall be present to indicate the quantity (e.g., volume or mass) of medication supplied.

OCL

not self.quantity->isEmpty() implies self.quantity.isDefined('value')

SuccessInvalid XML


<supply xmlns="urn:hl7-org:v3">
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.7.3"/>
<templateId root="2.16.840.1.113883.10.20.1.34"/>
<quantity/>
</supply>

Valid XML


<supply xmlns="urn:hl7-org:v3">
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.7.3"/>
<templateId root="2.16.840.1.113883.10.20.1.34"/>
<quantity value="1234"/>
</supply>

0.012
testValidateSupplyEntryTemplateId

Constraint

SHALL contain exactly one [1..1] templateId ( ) such that it SHALL contain exactly one [1..1] @root="1.3.6.1.4.1.19376.1.5.3.1.4.7.3"

OCL

self.templateId->exists(id : datatypes::II | id.root = '1.3.6.1.4.1.19376.1.5.3.1.4.7.3')

SuccessInvalid XML


<supply xmlns="urn:hl7-org:v3"/>

Valid XML


<supply xmlns="urn:hl7-org:v3">
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.7.3"/>
<templateId root="2.16.840.1.113883.10.20.1.34"/>
</supply>

0.006
testValidateSupplyEntryQuantity

Constraint

IHE Supply Entry SHOULD contain exactly one [1..1] quantity (CONF-322)

OCL

(self.quantity.oclIsUndefined() or self.quantity.isNullFlavorUndefined()) implies (not self.quantity.oclIsUndefined())

SuccessInvalid XML


<supply xmlns="urn:hl7-org:v3">
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.7.3"/>
<templateId root="2.16.840.1.113883.10.20.1.34"/>
</supply>

Valid XML


<supply xmlns="urn:hl7-org:v3">
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.7.3"/>
<templateId root="2.16.840.1.113883.10.20.1.34"/>
<quantity/>
</supply>

0.016
testValidateSupplyEntryRepeatNumber

Constraint

IHE Supply Entry SHOULD contain exactly one [1..1] repeatNumber (CONF-321)

OCL

(self.repeatNumber.oclIsUndefined() or self.repeatNumber.isNullFlavorUndefined()) implies (not self.repeatNumber.oclIsUndefined())

SuccessInvalid XML


<supply xmlns="urn:hl7-org:v3">
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.7.3"/>
<templateId root="2.16.840.1.113883.10.20.1.34"/>
</supply>

Valid XML


<supply xmlns="urn:hl7-org:v3">
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.7.3"/>
<templateId root="2.16.840.1.113883.10.20.1.34"/>
<repeatNumber/>
</supply>

0.018
testValidateSupplyEntryMedicationFullfillmentInstructions

Constraint

An entry relationship may be present to provide the fulfillment instructions. When present, this entry relationship shall contain a Medication Fulfillment Instructions entry.

OCL

self.entryRelationship->one(entryRelationship : cda::EntryRelationship | not entryRelationship.act.oclIsUndefined() and entryRelationship.act.oclIsKindOf(ihe::MedicationFullfillmentInstructions) and entryRelationship.typeCode = vocab::x_ActRelationshipEntryRelationship::SUBJ)

SuccessInvalid XML


<supply xmlns="urn:hl7-org:v3">
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.7.3"/>
<templateId root="2.16.840.1.113883.10.20.1.34"/>
</supply>

Valid XML


<supply xmlns="urn:hl7-org:v3">
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.7.3"/>
<templateId root="2.16.840.1.113883.10.20.1.34"/>
<entryRelationship typeCode="SUBJ">
<act moodCode="INT">
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.3.1"/>
<templateId root="2.16.840.1.113883.10.20.1.43"/>
<code code="FINSTRUCT" codeSystem="1.3.6.1.4.1.19376.1.5.3.2" codeSystemName="IHEActCode"/>
</act>
</entryRelationship>
</supply>

0.019
testGetMedicationFullfillmentInstructions

Constraint

OCL

SuccessInvalid XML

Valid XML

0.016
Properties »