Unit Test Results.

Designed for use with JUnit and Ant.

Class org.openhealthtools.mdht.uml.cda.consol.tests.MedicationSupplyOrderTest

NameTestsErrorsFailuresTime(s)Time StampHost
MedicationSupplyOrderTest15000.4202013-01-31T13:35:32JKMSoftware-desktop

Tests

NameStatusResultTime(s)
testConstructor

Constraint

OCL

SuccessInvalid XML

Valid XML

0.001
testGetInstructions

Constraint

OCL

SuccessInvalid XML

Valid XML

0.037
testValidateMedicationSupplyOrderInstructionInversionInd

Constraint

Consol Medication Supply Order entryRelationship with target entry Instructions if present, SHALL contain exactly one [1..1] @inversionInd="true" True (CONF:7445)

OCL

self.entryRelationship->select(er : cda::EntryRelationship | er.act.oclIsTypeOf(consol::Instructions))->forAll(ent : cda::EntryRelationship | ent.inversionInd=true)

SuccessInvalid XML


<supply xmlns="urn:hl7-org:v3" classCode="SPLY" moodCode="INT">
<templateId root="2.16.840.1.113883.10.20.22.4.17"/>
<entryRelationship>
<act/>
</entryRelationship>
</supply>

Valid XML


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

0.020
testValidateMedicationSupplyOrderEffectiveTimeHigh

Constraint

Consol Medication Supply Order effectiveTime SHALL contain exactly one [1..1] high (CONF:15144)

OCL

self.effectiveTime->size() = 1 implies self.effectiveTime.oclAsType(datatypes::IVL_TS)->forAll(high->size() = 1)

SuccessInvalid XML


<supply xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" classCode="SPLY" moodCode="INT">
<templateId root="2.16.840.1.113883.10.20.22.4.17"/>
<effectiveTime xsi:type="IVL_TS"/>
</supply>

Valid XML


<supply xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" classCode="SPLY" moodCode="INT">
<templateId root="2.16.840.1.113883.10.20.22.4.17"/>
<effectiveTime xsi:type="IVL_TS">
<high/>
</effectiveTime>
</supply>

0.050
testValidateMedicationSupplyOrderContainsMedicationOrImmunization

Constraint

Consol Medication Supply Order supply act SHALL contain one product/Medication Information or one product/Immunization Medication Information template (CONF:16093, CONF:16094, CONF:16870)

OCL

self.product.manufacturedProduct.oclIsTypeOf(consol::MedicationInformation) xor self.product.manufacturedProduct.oclIsTypeOf(consol::ImmunizationMedicationInformation)

SuccessInvalid XML


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

Valid XML


<supply xmlns="urn:hl7-org:v3" classCode="SPLY" moodCode="INT">
<templateId root="2.16.840.1.113883.10.20.22.4.17"/>
<product>
<manufacturedProduct/>
</product>
</supply>

0.025
testValidateMedicationSupplyOrderTemplateId

Constraint

SHALL contain exactly one [1..1] templateId ( CONF:7429, CONF:10507 ) such that it SHALL contain exactly one [1..1] @root="2.16.840.1.113883.10.20.22.4.17"

OCL

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

SuccessInvalid XML


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

Valid XML


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

0.013
testValidateMedicationSupplyOrderClassCode

Constraint

Consol Medication Supply Order SHALL contain exactly one [1..1] @classCode="SPLY" (CodeSystem: 2.16.840.1.113883.5.6 HL7ActClass) (CONF:7427)

OCL

self.classCode=vocab::ActClassSupply::SPLY

SuccessInvalid XML


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

Valid XML


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

0.007
testValidateMedicationSupplyOrderEffectiveTime

Constraint

Consol Medication Supply Order SHOULD contain zero or one [0..1] effectiveTime (CONF:15143)

OCL

(self.effectiveTime->isEmpty() or self.effectiveTime->exists(element | element.isNullFlavorUndefined())) implies (not self.effectiveTime->isEmpty())

SuccessInvalid XML


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

Valid XML


<supply xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" classCode="SPLY" moodCode="INT">
<templateId root="2.16.840.1.113883.10.20.22.4.17"/>
<effectiveTime xsi:type="IVL_TS"/>
</supply>

0.039
testValidateMedicationSupplyOrderMoodCode

Constraint

Consol Medication Supply Order SHALL contain exactly one [1..1] @moodCode="INT" (CodeSystem: 2.16.840.1.113883.5.1001 HL7ActMood) (CONF:7428)

OCL

self.moodCode=vocab::x_DocumentSubstanceMood::INT

SuccessInvalid XML


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

Valid XML


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

0.007
testValidateMedicationSupplyOrderQuantity

Constraint

Consol Medication Supply Order SHOULD contain zero or one [0..1] quantity (CONF:7436)

OCL

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

SuccessInvalid XML


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

Valid XML


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

0.036
testValidateMedicationSupplyOrderRepeatNumber

Constraint

Consol Medication Supply Order SHOULD contain zero or one [0..1] repeatNumber (CONF:7434)

OCL

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

SuccessInvalid XML


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

Valid XML


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

0.041
testValidateMedicationSupplyOrderStatusCode

Constraint

Consol Medication Supply Order SHALL contain exactly one [1..1] statusCode (CONF:7432)

OCL

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

SuccessInvalid XML


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

Valid XML


<supply xmlns="urn:hl7-org:v3" classCode="SPLY" moodCode="INT">
<templateId root="2.16.840.1.113883.10.20.22.4.17"/>
<statusCode code="completed"/>
</supply>

0.041
testValidateMedicationSupplyOrderId

Constraint

Consol Medication Supply Order SHALL contain at least one [1..*] id (CONF:7430)

OCL

(self.id->isEmpty() or self.id->exists(element | element.isNullFlavorUndefined())) implies (not self.id->isEmpty())

SuccessInvalid XML


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

Valid XML


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

0.037
testValidateMedicationSupplyOrderAuthor

Constraint

Consol Medication Supply Order MAY contain zero or one [0..1] author (CONF:7438) Contains exactly one [1..1] CDA Author

OCL

self.author->one(author : cda::Author | not author.oclIsUndefined() and author.oclIsKindOf(rim::Participation))

SuccessInvalid XML


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

Valid XML


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

0.023
testValidateMedicationSupplyOrderInstructions

Constraint

Consol Medication Supply Order MAY contain zero or one [0..1] entryRelationship (CONF:7442, CONF:7444, CONF:16095) Contains @typeCode="SUBJ" SUBJ, and Contains exactly one [1..1] Instructions (templateId: 2.16.840.1.113883.10.20.22.4.20)

OCL

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

SuccessInvalid XML


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

Valid XML


<supply xmlns="urn:hl7-org:v3" classCode="SPLY" moodCode="INT">
<templateId root="2.16.840.1.113883.10.20.22.4.17"/>
<entryRelationship typeCode="SUBJ">
<act classCode="ACT" moodCode="INT">
<templateId root="2.16.840.1.113883.10.20.22.4.20"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
</act>
</entryRelationship>
</supply>

0.038
Properties »