Unit Test Results.

Designed for use with JUnit and Ant.

Class org.openhealthtools.mdht.uml.cda.hitsp.tests.MedicationOrderInformationTest

NameTestsErrorsFailuresTime(s)Time StampHost
MedicationOrderInformationTest15000.2372013-01-31T13:34:33JKMSoftware-desktop

Tests

NameStatusResultTime(s)
testConstructor

Constraint

OCL

SuccessInvalid XML

Valid XML

0.001
testValidateMedicationOrderInformationOrderNumber

Constraint

HITSP Medication Order Information The order number, i.e., the identifier from the perspective of the ordering provider, SHOULD be recorded in the id element within the supply element with moodcode = 'INT' (C83-[DE-8.26-CDA-1])

OCL

self.moodCode = vocab::x_DocumentSubstanceMood::INT implies self.id->size() > 0

SuccessInvalid XML


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

Valid XML


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

0.017
testValidateMedicationOrderInformationOrderExpiration

Constraint

HITSP Medication Order Information SHOULD satisfy: The effectiveTime/high element is present to record the order expiration date and time when supply/@moodcode = INT

OCL

self.moodCode = vocab::x_DocumentSubstanceMood::INT implies not self.effectiveTime->select(et | et.value.oclIsUndefined())->isEmpty()

SuccessInvalid XML


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

Valid XML


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

0.017
testValidateMedicationOrderInformationQuantityOrdered

Constraint

HITSP Medication Order Information The quantity ordered SHALL be recorded in the value attribute of quantity element inside a supply element used to record order information (C83-[DE-8.26-CDA-1])

OCL

not self.quantity.value.oclIsUndefined()

SuccessInvalid XML


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

Valid XML


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

0.009
testValidateMedicationOrderInformationQuantityUnit

Constraint

HITSP Medication Order Information SHALL satisfy: the @unit attribute of quantity element is present (C83-[DE-8.26-CDA-2])

OCL

not self.quantity.unit.oclIsUndefined()

SuccessInvalid XML


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

Valid XML


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

0.009
testValidateMedicationOrderInformationPrescriptionNumber

Constraint

HITSP Medication Order Information The prescription number SHALL be recorded in the extension attribute of the <id> element within a supply element having a moodCode attribute of EVN (C83-[DE-8.34-CDA-1])

OCL

self.moodCode = vocab::x_DocumentSubstanceMood::EVN implies not self.id->isEmpty()

SuccessInvalid XML


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

Valid XML


<supply xmlns="urn:hl7-org:v3" moodCode="EVN">
<templateId root="2.16.840.1.113883.3.88.11.83.8.3"/>
<templateId root="2.16.840.1.113883.10.20.1.34"/>
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.7.3"/>
<id extension="1"/>
</supply>

0.013
testValidateMedicationOrderInformationAssigningAuthority

Constraint

HITSP Medication Order Information The root attribute of the id element SHOULD be the OID of the assigning authority for the identifier. (C83-[DE-8.34-CDA-2])

OCL

self.id.root->size() > 0

SuccessInvalid XML


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

Valid XML


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

0.011
testValidateMedicationOrderInformationDispenseDate

Constraint

HITSP Medication Order Information SHALL satisfy: The dispense date is recorded in effectiveTime element within a supply element with a moodCode attribute set to EVN

OCL

self.moodCode = vocab::x_DocumentSubstanceMood::EVN implies self.effectiveTime->size() > 0

SuccessInvalid XML


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

Valid XML


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

0.015
testValidateMedicationOrderInformationDispensingPharmacyLocation

Constraint

HITSP Medication Order Information MAY satisfy: The dispensing pharmacy's location is present in the addr element in performer/assignEntity element inside a supply element with a moodCode attribute set to EVN

OCL

self.moodCode = vocab::x_DocumentSubstanceMood::EVN implies self.performer->select(p | p.assignedEntity.addr->isEmpty())->isEmpty()

SuccessInvalid XML


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

Valid XML


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

0.016
testValidateMedicationOrderInformationQuantityDispensed

Constraint

HITSP Medication Order Information The quantity dispensed SHALL be recorded in the value attribute of quantity element inside a supply element with a moodCode attribute set to EVN

OCL

self.moodCode = vocab::x_DocumentSubstanceMood::EVN implies not self.quantity.value.oclIsUndefined()

SuccessInvalid XML


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

Valid XML


<supply xmlns="urn:hl7-org:v3" moodCode="EVN">
<templateId root="2.16.840.1.113883.3.88.11.83.8.3"/>
<templateId root="2.16.840.1.113883.10.20.1.34"/>
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.7.3"/>
<quantity value="0"/>
</supply>

0.014
testValidateMedicationOrderInformationHasFillNumber

Constraint

HITSP Medication Order Information The fill number SHOULD be recorded in the sequenceNumber attribute of a entryRelationship element with a typeCode attribute set to COMP (C83-[DE-8.39-CDA-1])

OCL

self.entryRelationship->select(er | er.typeCode = vocab::x_ActRelationshipEntryRelationship::COMP and er.sequenceNumber.oclIsUndefined())->isEmpty()

SuccessInvalid XML


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

Valid XML


<supply xmlns="urn:hl7-org:v3">
<templateId root="2.16.840.1.113883.3.88.11.83.8.3"/>
<templateId root="2.16.840.1.113883.10.20.1.34"/>
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.7.3"/>
<entryRelationship typeCode="COMP">
<sequenceNumber/>
</entryRelationship>
</supply>

0.013
testValidateMedicationOrderInformationTemplateId

Constraint

SHALL contain exactly one [1..1] templateId ( C83-[DE-8-CDA-6] ) such that it SHALL contain exactly one [1..1] @root="2.16.840.1.113883.3.88.11.83.8.3"

OCL

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

SuccessInvalid XML


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

Valid XML


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

0.006
testValidateMedicationOrderInformationRepeatNumber

Constraint

HITSP Medication Order Information MAY 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"/>

Valid XML


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

0.021
testValidateMedicationOrderInformationStatusCodeP

Constraint

HITSP Medication Order Information MAY contain exactly one [1..1] statusCode (CONF-319), where the @code SHALL be selected from ValueSet Medication Fill Status 2.16.840.1.113883.3.88.12.80.64 STATIC 1

OCL

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

SuccessInvalid XML


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

Valid XML


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

0.022
testValidateMedicationOrderInformationStatusCode

Constraint

HITSP Medication Order Information MAY contain exactly one [1..1] statusCode (CONF-319), where the @code SHALL be selected from ValueSet Medication Fill Status 2.16.840.1.113883.3.88.12.80.64 STATIC 1

OCL

(self.statusCode.oclIsUndefined() or self.statusCode.isNullFlavorUndefined()) implies (not self.statusCode.oclIsUndefined() and self.statusCode.oclIsKindOf(datatypes::CS) and let value : datatypes::CS = self.statusCode.oclAsType(datatypes::CS) in value.code = 'aborted' or value.code = 'completed')

SuccessInvalid XML


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

Valid XML


<supply xmlns="urn:hl7-org:v3">
<templateId root="2.16.840.1.113883.3.88.11.83.8.3"/>
<templateId root="2.16.840.1.113883.10.20.1.34"/>
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.7.3"/>
<statusCode code="completed" codeSystem="2.16.840.1.113883.3.88.12.80.64"/>
</supply>

0.047
Properties »