Unit Test Results.

Designed for use with JUnit and Ant.

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

NameTestsErrorsFailuresTime(s)Time StampHost
MedicationTest20000.3102013-01-31T13:34:25JKMSoftware-desktop

Tests

NameStatusResultTime(s)
testConstructor

Constraint

OCL

SuccessInvalid XML

Valid XML

0.001
testValidateMedicationHasDosing

Constraint

The 'MedicationHasDosing' invariant is violated on 'org.openhealthtools.mdht.uml.cda.ihe.impl.NormalDoseImpl@164f868d{#//}'

OCL

self.templateId->exists(id : datatypes::II | id.root = '1.3.6.1.4.1.19376.1.5.3.1.4.7.1') xor self.templateId->exists(id : datatypes::II | id.root = '1.3.6.1.4.1.19376.1.5.3.1.4.8') xor self.templateId->exists(id : datatypes::II | id.root = '1.3.6.1.4.1.19376.1.5.3.1.4.9') xor self.templateId->exists(id : datatypes::II | id.root = '1.3.6.1.4.1.19376.1.5.3.1.4.10') xor self.templateId->exists(id : datatypes::II | id.root = '1.3.6.1.4.1.19376.1.5.3.1.4.11')

SuccessInvalid XML


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

Valid XML


<substanceadministration xmlns="urn:hl7-org:v3">
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.7.1"/>
<templateId root="2.16.840.1.113883.10.20.1.24"/>
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.7"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<routeCode codeSystem="2.16.840.1.113883.5.112" codeSystemName="HL7 RouteOfAdministration"/>
</substanceadministration>

0.026
testValidateMedicationDosingRelationship

Constraint

The 'MedicationDosingRelationship' invariant is violated on 'org.openhealthtools.mdht.uml.cda.ihe.impl.CombinationMedicationImpl@203bc5c6{#//}'

OCL

self.templateId->exists(id : datatypes::II | id.root = '1.3.6.1.4.1.19376.1.5.3.1.4.8') xor self.templateId->exists(id : datatypes::II | id.root = '1.3.6.1.4.1.19376.1.5.3.1.4.9') xor self.templateId->exists(id : datatypes::II | id.root = '1.3.6.1.4.1.19376.1.5.3.1.4.10') xor self.templateId->exists(id : datatypes::II | id.root = '1.3.6.1.4.1.19376.1.5.3.1.4.11') implies self.entryRelationship->exists(er | er.typeCode=vocab::x_ActRelationshipEntryRelationship::COMP)

SuccessInvalid XML


<substanceadministration xmlns="urn:hl7-org:v3">
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.11"/>
<templateId root="2.16.840.1.113883.10.20.1.24"/>
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.7"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<routeCode codeSystem="2.16.840.1.113883.5.112" codeSystemName="HL7 RouteOfAdministration"/>
</substanceadministration>

Valid XML


<substanceadministration xmlns="urn:hl7-org:v3">
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.11"/>
<templateId root="2.16.840.1.113883.10.20.1.24"/>
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.7"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<routeCode codeSystem="2.16.840.1.113883.5.112" codeSystemName="HL7 RouteOfAdministration"/>
<entryRelationship typeCode="COMP"/>
</substanceadministration>

0.026
testValidateMedicationHasProductEntry

Constraint

IHE Medication SHALL satisfy: The <consumable> element shall be present, and shall contain a Product Entry template

OCL

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

SuccessInvalid XML


<substanceadministration xmlns="urn:hl7-org:v3">
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.7.1"/>
<templateId root="2.16.840.1.113883.10.20.1.24"/>
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.7"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<routeCode codeSystem="2.16.840.1.113883.5.112" codeSystemName="HL7 RouteOfAdministration"/>
<consumable>
<manufacturedProduct/>
</consumable>
</substanceadministration>

Valid XML


<substanceadministration xmlns="urn:hl7-org:v3">
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.7.1"/>
<templateId root="2.16.840.1.113883.10.20.1.24"/>
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.7"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<routeCode codeSystem="2.16.840.1.113883.5.112" codeSystemName="HL7 RouteOfAdministration"/>
<consumable>
<manufacturedProduct>
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.7.2"/>
<templateId root="2.16.840.1.113883.10.20.1.53"/>
</manufacturedProduct>
</consumable>
</substanceadministration>

0.009
testValidateMedicationHasIntructionsInversion

Constraint

IHE Medication SHALL satisfy: The entryRelationship/@inversionInd attribute is 'true' for Patient Medical Instructions relationship

OCL

self.entryRelationship->forAll( er : cda::EntryRelationship | (not er.act.oclIsKindOf(ihe::PatientMedicalInstructions)) or ( er.inversionInd = true and er.act.oclIsKindOf(ihe::PatientMedicalInstructions)) )

SuccessInvalid XML


<substanceadministration xmlns="urn:hl7-org:v3">
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.7.1"/>
<templateId root="2.16.840.1.113883.10.20.1.24"/>
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.7"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<routeCode codeSystem="2.16.840.1.113883.5.112" codeSystemName="HL7 RouteOfAdministration"/>
<entryRelationship>
<act classCode="ACT" moodCode="INT">
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.3"/>
<templateId root="2.16.840.1.113883.10.20.1.49"/>
<code code="PINSTRUCT" codeSystem="1.3.6.1.4.1.19376.1.5.3.2" codeSystemName="IHEActCode"/>
</act>
</entryRelationship>
</substanceadministration>

Valid XML


<substanceadministration xmlns="urn:hl7-org:v3">
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.7.1"/>
<templateId root="2.16.840.1.113883.10.20.1.24"/>
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.7"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<routeCode codeSystem="2.16.840.1.113883.5.112" codeSystemName="HL7 RouteOfAdministration"/>
<entryRelationship inversionInd="true">
<act classCode="ACT" moodCode="INT">
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.3"/>
<templateId root="2.16.840.1.113883.10.20.1.49"/>
<code code="PINSTRUCT" codeSystem="1.3.6.1.4.1.19376.1.5.3.2" codeSystemName="IHEActCode"/>
</act>
</entryRelationship>
</substanceadministration>

0.018
testValidateMedicationProductStrength

Constraint

IHE Medication SHOULD satisfy: The name and strength of the medication is recorded in consumable/manufacturedProduct/manufacturedMaterial/code/originalText

OCL

not self.consumable.manufacturedProduct.manufacturedMaterial.code.oclIsUndefined() implies not self.consumable.manufacturedProduct.manufacturedMaterial.code.originalText.oclIsUndefined()

SuccessInvalid XML


<substanceadministration xmlns="urn:hl7-org:v3">
<consumable>
<manufacturedProduct>
<manufacturedMaterial>
<code code="123456" codeSystem="7890"/>
</manufacturedMaterial>
</manufacturedProduct>
</consumable>
</substanceadministration>

Valid XML


<substanceadministration xmlns="urn:hl7-org:v3">
<consumable>
<manufacturedProduct>
<manufacturedMaterial>
<code code="123456" codeSystem="7890">
<originalText>Name of Material Here</originalText>
</code>
</manufacturedMaterial>
</manufacturedProduct>
</consumable>
</substanceadministration>

0.018
testValidateMedicationProductName

Constraint

IHE Medication SHALL satisfy: Name of the substance or product is recorded in consumable/manufacturedProduct/manufacturedMaterial/name

OCL

not self.consumable.manufacturedProduct.manufacturedMaterial.name.oclIsUndefined()

SuccessInvalid XML


<substanceadministration xmlns="urn:hl7-org:v3">
<consumable>
<manufacturedProduct>
<manufacturedMaterial/>
</manufacturedProduct>
</consumable>
</substanceadministration>

Valid XML


<substanceadministration xmlns="urn:hl7-org:v3">
<consumable>
<manufacturedProduct>
<manufacturedMaterial>
<name/>
</manufacturedMaterial>
</manufacturedProduct>
</consumable>
</substanceadministration>

0.011
testValidateMedicationPreconditionReference

Constraint

IHE Medication MAY satisfy: the preconditions for use of the medication are recorded in the <precondition> element. element. The value attribute of the <reference> element is a URL that points to the CDA narrative describing those preconditions.

OCL

not self.precondition.criterion.text->exists (t | t.reference.oclIsUndefined())

SuccessInvalid XML


<substanceadministration xmlns="urn:hl7-org:v3">
<precondition>
<criterion>
<text>Reference String</text>
</criterion>
</precondition>
</substanceadministration>

Valid XML


<substanceadministration xmlns="urn:hl7-org:v3">
<precondition>
<criterion>
<text>Reference String<reference/></text>
</criterion>
</precondition>
</substanceadministration>

0.011
testValidateMedicationHasSupplyEntryInversion

Constraint

IHE Medication SHALL satisfy: The entryRelationship/@inversionInd attribute is 'false' for Supply Entry relationship

OCL

not self.entryRelationship->exists(er : cda::EntryRelationship | (not er.supply->isEmpty()) and er.inversionInd<>false )

SuccessInvalid XML


<substanceadministration xmlns="urn:hl7-org:v3">
<entryRelationship inversionInd="true">
<supply/>
</entryRelationship>
</substanceadministration>

Valid XML


<substanceadministration xmlns="urn:hl7-org:v3">
<entryRelationship inversionInd="false">
<supply/>
</entryRelationship>
</substanceadministration>

0.014
testValidateMedicationHasFillNumber

Constraint

IHE Medication SHOULD satisfy: entryRelationship/sequenceNumber element should be present when the embedded 'supply' element has a moodCode attribute of EVN.

OCL

not self.entryRelationship->exists(er| (not er.supply->isEmpty()) and er.sequenceNumber.value.oclIsUndefined() )

SuccessInvalid XML


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

Valid XML


<substanceadministration xmlns="urn:hl7-org:v3">
<entryRelationship>
<sequenceNumber value="12345"/>
<supply>
<templateId root="2.16.840.1.113883.10.20.1.34"/>
</supply>
</entryRelationship>
</substanceadministration>

0.021
testValidateMedicationTemplateId

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"

OCL

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

SuccessInvalid XML


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

Valid XML


<substanceadministration xmlns="urn:hl7-org:v3">
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.7.1"/>
<templateId root="2.16.840.1.113883.10.20.1.24"/>
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.7"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<routeCode codeSystem="2.16.840.1.113883.5.112" codeSystemName="HL7 RouteOfAdministration"/>
</substanceadministration>

0.007
testValidateMedicationApproachSiteCode

Constraint

IHE Medication MAY contain zero or more [0..*] approachSiteCode

OCL

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

SuccessInvalid XML


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

Valid XML


<substanceadministration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3">
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.7.1"/>
<templateId root="2.16.840.1.113883.10.20.1.24"/>
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.7"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<routeCode codeSystem="2.16.840.1.113883.5.112" codeSystemName="HL7 RouteOfAdministration"/>
<approachSiteCode xsi:type="CE"/>
</substanceadministration>

0.016
testValidateMedicationDoseQuantity

Constraint

IHE Medication SHOULD contain zero or one [0..1] doseQuantity

OCL

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

SuccessInvalid XML


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

Valid XML


<substanceadministration xmlns="urn:hl7-org:v3">
<doseQuantity value="1"/>
</substanceadministration>

0.016
testValidateMedicationRateQuantity

Constraint

IHE Medication SHOULD contain zero or one [0..1] rateQuantity

OCL

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

SuccessInvalid XML


<substanceadministration xmlns="urn:hl7-org:v3">
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.7.1"/>
<templateId root="2.16.840.1.113883.10.20.1.24"/>
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.7"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<routeCode codeSystem="2.16.840.1.113883.5.112" codeSystemName="HL7 RouteOfAdministration"/>
</substanceadministration>

Valid XML


<substanceadministration xmlns="urn:hl7-org:v3">
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.7.1"/>
<templateId root="2.16.840.1.113883.10.20.1.24"/>
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.7"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<routeCode codeSystem="2.16.840.1.113883.5.112" codeSystemName="HL7 RouteOfAdministration"/>
<rateQuantity/>
</substanceadministration>

0.016
testValidateMedicationCode

Constraint

IHE Medication SHALL contain exactly one [1..1] code, where the @code SHALL be selected from (CodeSystem: 2.16.840.1.113883.6.96 SNOMEDCT)

OCL

(self.code.oclIsUndefined() or self.code.isNullFlavorUndefined()) implies (not self.code.oclIsUndefined() and self.code.oclIsKindOf(datatypes::CD) and let value : datatypes::CD = self.code.oclAsType(datatypes::CD) in value.codeSystem = '2.16.840.1.113883.6.96')

SuccessInvalid XML


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

Valid XML


<substanceadministration xmlns="urn:hl7-org:v3">
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.7.1"/>
<templateId root="2.16.840.1.113883.10.20.1.24"/>
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.7"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<routeCode codeSystem="2.16.840.1.113883.5.112" codeSystemName="HL7 RouteOfAdministration"/>
</substanceadministration>

0.024
testValidateMedicationStatusCode

Constraint

IHE Medication SHALL contain exactly one [1..1] statusCode (CONF-307)

OCL

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

SuccessInvalid XML


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

Valid XML


<substanceadministration xmlns="urn:hl7-org:v3">
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.7.1"/>
<templateId root="2.16.840.1.113883.10.20.1.24"/>
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.7"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
<routeCode codeSystem="2.16.840.1.113883.5.112" codeSystemName="HL7 RouteOfAdministration"/>
</substanceadministration>

0.016
testValidateMedicationEffectiveTime

Constraint

IHE Medication SHALL contain [0..2] effectiveTime (CONF-308)

OCL

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

SuccessInvalid XML


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

Valid XML


<substanceadministration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3">
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.7.1"/>
<templateId root="2.16.840.1.113883.10.20.1.24"/>
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.7"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<effectiveTime xsi:type="IVL_TS"/>
<routeCode codeSystem="2.16.840.1.113883.5.112" codeSystemName="HL7 RouteOfAdministration"/>
</substanceadministration>

0.016
testGetInternalReferences

Constraint

OCL

SuccessInvalid XML

Valid XML

0.012
testGetPatientMedicalInstructionss

Constraint

OCL

SuccessInvalid XML

Valid XML

0.012
testGetSupplyEntry

Constraint

OCL

SuccessInvalid XML

Valid XML

0.013
Properties »