Unit Test Results.

Designed for use with JUnit and Ant.

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

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

Tests

NameStatusResultTime(s)
testConstructor

Constraint

OCL

SuccessInvalid XML

Valid XML

0.000
testValidateMedicationInformationTemplateId

Constraint

SHALL contain exactly one [1..1] templateId ( CONF:7409, CONF:10506 ) such that it SHALL contain exactly one [1..1] @root="2.16.840.1.113883.10.20.22.4.23"

OCL

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

SuccessInvalid XML


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

Valid XML


<manufacturedproduct xmlns="urn:hl7-org:v3" classCode="MANU">
<templateId root="2.16.840.1.113883.10.20.22.4.23"/>
</manufacturedproduct>

0.002
testValidateMedicationInformationId

Constraint

Consol Medication Information MAY contain zero or more [0..*] id (CONF:7410)

OCL

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

SuccessInvalid XML


<manufacturedproduct xmlns="urn:hl7-org:v3" classCode="MANU">
<templateId root="2.16.840.1.113883.10.20.22.4.23"/>
</manufacturedproduct>

Valid XML


<manufacturedproduct xmlns="urn:hl7-org:v3" classCode="MANU">
<templateId root="2.16.840.1.113883.10.20.22.4.23"/>
<id/>
</manufacturedproduct>

0.003
testValidateMedicationInformationClassCode

Constraint

Consol Medication Information SHALL contain exactly one [1..1] @classCode="MANU" (CONF:7408)

OCL

isDefined('classCode') and self.classCode=vocab::RoleClassManufacturedProduct::MANU

SuccessInvalid XML


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

Valid XML


<manufacturedproduct xmlns="urn:hl7-org:v3" classCode="MANU">
<templateId root="2.16.840.1.113883.10.20.22.4.23"/>
</manufacturedproduct>

0.002
testValidateMedicationInformationManufacturedMaterial

Constraint

Consol Medication Information SHALL contain exactly one [1..1] manufacturedMaterial (CONF:7411)

OCL

self.manufacturedMaterial->one(manufacturedMaterial : cda::Material | not manufacturedMaterial.oclIsUndefined() and manufacturedMaterial.oclIsKindOf(cda::Material))

SuccessInvalid XML


<manufacturedproduct xmlns="urn:hl7-org:v3" classCode="MANU">
<templateId root="2.16.840.1.113883.10.20.22.4.23"/>
</manufacturedproduct>

Valid XML


<manufacturedproduct xmlns="urn:hl7-org:v3" classCode="MANU">
<templateId root="2.16.840.1.113883.10.20.22.4.23"/>
<manufacturedMaterial/>
</manufacturedproduct>

0.003
testValidateMedicationInformationMedicationInformationManufacturedMaterialCodeOriginalText

Constraint

Consol Medication Information SHALL contain exactly one [1..1] manufacturedMaterial (CONF:7411) manufacturedMaterial code SHOULD contain zero or one [0..1] originalText

OCL

self.manufacturedMaterial->excluding(null)->reject(code.originalText->size() = 1)

SuccessInvalid XML


<manufacturedproduct xmlns="urn:hl7-org:v3" classCode="MANU">
<templateId root="2.16.840.1.113883.10.20.22.4.23"/>
<manufacturedMaterial>
<code/>
</manufacturedMaterial>
</manufacturedproduct>

Valid XML


<manufacturedproduct xmlns="urn:hl7-org:v3" classCode="MANU">
<templateId root="2.16.840.1.113883.10.20.22.4.23"/>
<templateId root="2.16.840.1.113883.10.20.22.4.23"/>
<manufacturedMaterial>
<code>
<originalText/>
</code>
</manufacturedMaterial>
</manufacturedproduct>

0.003
testValidateMedicationInformationMedicationInformationManufacturedMaterialReference

Constraint

Consol Medication Information SHALL contain exactly one [1..1] manufacturedMaterial (CONF:7411) manufacturedMaterial originalText, if present, SHOULD contain zero or one [0..1] reference

OCL

self.manufacturedMaterial->excluding(null)->reject(code.originalText->size() = 1 implies code.originalText->one(reference->size() = 1))

SuccessInvalid XML


<manufacturedproduct xmlns="urn:hl7-org:v3" classCode="MANU">
<templateId root="2.16.840.1.113883.10.20.22.4.23"/>
<manufacturedMaterial>
<code>
<originalText/>
</code>
</manufacturedMaterial>
</manufacturedproduct>

Valid XML


<manufacturedproduct xmlns="urn:hl7-org:v3" classCode="MANU">
<templateId root="2.16.840.1.113883.10.20.22.4.23"/>
<templateId root="2.16.840.1.113883.10.20.22.4.23"/>
<manufacturedMaterial>
<code>
<originalText><reference value="aaaaaaaaaaaaaaaaaaaaa"/></originalText>
</code>
</manufacturedMaterial>
</manufacturedproduct>

0.004
testValidateMedicationInformationMedicationInformationManufacturedMaterialOriginalTextReferenceValue

Constraint

Consol Medication Information SHALL contain exactly one [1..1] manufacturedMaterial (CONF:7411) manufacturedMaterial reference, if present, SHOULD contain zero or one [0..1] @value (CONF:15987)

OCL

self.manufacturedMaterial->excluding(null)->reject(code.originalText.reference->size() = 1 implies code.originalText.reference.value->size() = 1)

SuccessInvalid XML


<manufacturedproduct xmlns="urn:hl7-org:v3" classCode="MANU">
<templateId root="2.16.840.1.113883.10.20.22.4.23"/>
<manufacturedMaterial>
<code>
<originalText><reference/></originalText>
</code>
</manufacturedMaterial>
</manufacturedproduct>

Valid XML


<manufacturedproduct xmlns="urn:hl7-org:v3" classCode="MANU">
<templateId root="2.16.840.1.113883.10.20.22.4.23"/>
<templateId root="2.16.840.1.113883.10.20.22.4.23"/>
<manufacturedMaterial>
<code>
<originalText><reference value="aaaaaaaaaaaaaaaaaaaaa"/></originalText>
</code>
</manufacturedMaterial>
</manufacturedproduct>

0.004
testValidateMedicationInformationMedicationInformationManufacturedMaterialCodeTranslation

Constraint

Consol Medication Information SHALL contain exactly one [1..1] manufacturedMaterial (CONF:7411) manufacturedMaterial code MAY contain zero or more [0..*] translation

OCL

self.manufacturedMaterial->excluding(null)->reject(code->size() = 1 implies code.translation->size() > 0)

SuccessInvalid XML


<manufacturedproduct xmlns="urn:hl7-org:v3" classCode="MANU">
<templateId root="2.16.840.1.113883.10.20.22.4.23"/>
<manufacturedMaterial>
<code/>
</manufacturedMaterial>
</manufacturedproduct>

Valid XML


<manufacturedproduct xmlns="urn:hl7-org:v3" classCode="MANU">
<templateId root="2.16.840.1.113883.10.20.22.4.23"/>
<templateId root="2.16.840.1.113883.10.20.22.4.23"/>
<manufacturedMaterial>
<code>
<translation/>
</code>
</manufacturedMaterial>
</manufacturedproduct>

0.004
testValidateMedicationInformationMedicationInformationManufacturedMaterialCode

Constraint

Consol Medication Information SHALL contain exactly one [1..1] manufacturedMaterial (CONF:7411) manufacturedMaterial SHALL contain exactly one [1..1] code, where the @code SHALL be selected from ValueSet Medication Clinical Drug 2.16.840.1.113883.3.88.12.80.17 DYNAMIC (CONF:7412)

OCL

self.manufacturedMaterial->excluding(null)->reject((code.oclIsUndefined() or code.isNullFlavorUndefined()) implies (not code.oclIsUndefined() and code.oclIsKindOf(datatypes::CE) and let value : datatypes::CE = code.oclAsType(datatypes::CE) in value.codeSystem = '2.16.840.1.113883.6.88' and not value.code.oclIsUndefined()))

SuccessInvalid XML


<manufacturedproduct xmlns="urn:hl7-org:v3" classCode="MANU">
<templateId root="2.16.840.1.113883.10.20.22.4.23"/>
<manufacturedMaterial>
<code/>
</manufacturedMaterial>
</manufacturedproduct>

Valid XML


<manufacturedproduct xmlns="urn:hl7-org:v3" classCode="MANU">
<templateId root="2.16.840.1.113883.10.20.22.4.23"/>
<manufacturedMaterial>
<code code="16552" codeSystem="2.16.840.1.113883.6.88"/>
</manufacturedMaterial>
</manufacturedproduct>

0.005
testValidateMedicationInformationManufacturerOrganization

Constraint

Consol Medication Information MAY contain zero or one [0..1] manufacturerOrganization (CONF:7416) Contains exactly one [1..1] CDA Organization

OCL

self.manufacturerOrganization->one(manufacturerOrganization : cda::Organization | not manufacturerOrganization.oclIsUndefined() and manufacturerOrganization.oclIsKindOf(rim::Entity))

SuccessInvalid XML


<manufacturedproduct xmlns="urn:hl7-org:v3" classCode="MANU">
<templateId root="2.16.840.1.113883.10.20.22.4.23"/>
</manufacturedproduct>

Valid XML


<manufacturedproduct xmlns="urn:hl7-org:v3" classCode="MANU">
<templateId root="2.16.840.1.113883.10.20.22.4.23"/>
<manufacturerOrganization/>
</manufacturedproduct>

0.003
Properties »