Unit Test Results.

Designed for use with JUnit and Ant.

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

NameTestsErrorsFailuresTime(s)Time StampHost
MedicationDispenseTest23001.1842013-01-31T13:35:31JKMSoftware-desktop

Tests

NameStatusResultTime(s)
testConstructor

Constraint

OCL

SuccessInvalid XML

Valid XML

0.000
testGetMedicationSupplyOrder

Constraint

OCL

SuccessInvalid XML

Valid XML

0.038
testValidateMedicationDispenseContainsMedicationOrImmunization

Constraint

Consol Medication Dispense supply act SHALL contain one product/Medication Information or one product/Immunization Medication Information template (CONF:15607, CONF:15608, CONF:9333)

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="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.18"/>
<product/>
</supply>

Valid XML


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

0.025
testValidateMedicationDispenseTemplateId

Constraint

SHALL contain exactly one [1..1] templateId ( CONF:7453, CONF:10505 ) such that it SHALL contain exactly one [1..1] @root="2.16.840.1.113883.10.20.22.4.18"

OCL

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

SuccessInvalid XML


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

Valid XML


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

0.011
testValidateMedicationDispenseClassCode

Constraint

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

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="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.18"/>
</supply>

0.007
testValidateMedicationDispenseEffectiveTime

Constraint

Consol Medication Dispense SHOULD contain zero or one [0..1] effectiveTime (CONF:7456)

OCL

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

SuccessInvalid XML


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

Valid XML


<supply xmlns="urn:hl7-org:v3" classCode="SPLY" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.18"/>
<effectiveTime/>
</supply>

0.039
testValidateMedicationDispenseId

Constraint

Consol Medication Dispense SHALL contain at least one [1..*] id (CONF:7454)

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="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.18"/>
<id/>
</supply>

0.036
testValidateMedicationDispenseMoodCode

Constraint

Consol Medication Dispense SHALL contain exactly one [1..1] @moodCode="EVN" Event (CodeSystem: 2.16.840.1.113883.5.1001 HL7ActMood) (CONF:7452)

OCL

self.moodCode=vocab::x_DocumentSubstanceMood::EVN

SuccessInvalid XML


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

Valid XML


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

0.008
testValidateMedicationDispenseRepeatNumber

Constraint

Consol Medication Dispense SHOULD contain zero or one [0..1] repeatNumber (CONF:7457)

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="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.18"/>
<repeatNumber/>
</supply>

0.041
testValidateMedicationDispenseStatusCode

Constraint

Consol Medication Dispense SHALL contain exactly one [1..1] statusCode, where the @code SHALL be selected from ValueSet Medication Fill Status 2.16.840.1.113883.3.88.12.80.64 STATIC 1 (CONF:7455)

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" classCode="SPLY" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.18"/>
<statusCode code="completed"/>
</supply>

0.091
testValidateMedicationDispenseQuantity

Constraint

Consol Medication Dispense SHOULD contain zero or one [0..1] quantity (CONF:7458)

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="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.18"/>
<quantity/>
</supply>

0.035
testValidateMedicationDispensePerformer

Constraint

Consol Medication Dispense MAY contain zero or one [0..1] performer (CONF:7461)

OCL

self.performer->one(performer : cda::Performer2 | not performer.oclIsUndefined() and performer.oclIsKindOf(cda::Performer2))

SuccessInvalid XML


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

Valid XML


<supply xmlns="urn:hl7-org:v3" classCode="SPLY" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.18"/>
<performer/>
</supply>

0.024
testValidateMedicationDispensePerformerMedicationDispenseAssignedEntityUSRealmAddressStreet

Constraint

Consol Medication Dispense MAY contain zero or one [0..1] performer (CONF:7461) each SHALL contain exactly one [1..1] assignedEntity, where (CONF:7467) each SHOULD contain zero or one [0..1] addr with data type USRealmAddress (CONF:7468) addr SHALL contain at least one and not more than 4 streetAddressLine (CONF:7291)

OCL

self.performer->excluding(null).assignedEntity->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject(isNullFlavorUndefined() implies ( streetAddressLine->size() >=1 and streetAddressLine->size() <=4))

SuccessInvalid XML


<supply xmlns="urn:hl7-org:v3" classCode="SPLY" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.18"/>
<performer>
<assignedEntity>
<addr><streetAddressLine>123</streetAddressLine><streetAddressLine>123</streetAddressLine><streetAddressLine>123</streetAddressLine><streetAddressLine>123</streetAddressLine><streetAddressLine>123</streetAddressLine></addr>
</assignedEntity>
</performer>
</supply>

<supply xmlns="urn:hl7-org:v3" classCode="SPLY" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.18"/>
<performer>
<assignedEntity>
<addr/>
</assignedEntity>
</performer>
</supply>

Valid XML


<supply xmlns="urn:hl7-org:v3">
<performer>
<assignedEntity>
<addr use="HP"><streetAddressLine>123 Main Street</streetAddressLine><city>Boston</city><state>MA</state><country>US</country><postalCode>01001</postalCode></addr>
</assignedEntity>
</performer>
</supply>

0.081
testValidateMedicationDispensePerformerMedicationDispenseAssignedEntityUSRealmAddressCity

Constraint

Consol Medication Dispense MAY contain zero or one [0..1] performer (CONF:7461) each SHALL contain exactly one [1..1] assignedEntity, where (CONF:7467) each SHOULD contain zero or one [0..1] addr with data type USRealmAddress (CONF:7468) addr SHALL contain exactly one [1..1] city (CONF:7292)

OCL

self.performer->excluding(null).assignedEntity->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies ((city->isEmpty() or city->exists(element | element.isNullFlavorUndefined())) implies (city->size() = 1) )))

SuccessInvalid XML


<supply xmlns="urn:hl7-org:v3" classCode="SPLY" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.18"/>
<performer>
<assignedEntity>
<addr/>
</assignedEntity>
</performer>
</supply>

Valid XML


<supply xmlns="urn:hl7-org:v3" classCode="SPLY" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.18"/>
<performer>
<assignedEntity>
<addr use="HP"><streetAddressLine>123 Main Street</streetAddressLine><city>Boston</city><state>MA</state><country>US</country><postalCode>01001</postalCode></addr>
</assignedEntity>
</performer>
</supply>

0.085
testValidateMedicationDispensePerformerMedicationDispenseAssignedEntityUSRealmAddressCountry

Constraint

Consol Medication Dispense MAY contain zero or one [0..1] performer (CONF:7461) each SHALL contain exactly one [1..1] assignedEntity, where (CONF:7467) each SHOULD contain zero or one [0..1] addr with data type USRealmAddress (CONF:7468) addr SHOULD contain zero or one [0..1] country (CONF:7295)

OCL

self.performer->excluding(null).assignedEntity->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies ((country->isEmpty() or country->exists(element | element.isNullFlavorUndefined())) implies (not country->isEmpty()) )))

SuccessInvalid XML


<supply xmlns="urn:hl7-org:v3" classCode="SPLY" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.18"/>
<performer>
<assignedEntity>
<addr/>
</assignedEntity>
</performer>
</supply>

Valid XML


<supply xmlns="urn:hl7-org:v3" classCode="SPLY" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.18"/>
<performer>
<assignedEntity>
<addr use="HP"><streetAddressLine>123 Main Street</streetAddressLine><city>Boston</city><state>MA</state><country>US</country><postalCode>01001</postalCode></addr>
</assignedEntity>
</performer>
</supply>

0.083
testValidateMedicationDispensePerformerMedicationDispenseAssignedEntityUSRealmAddressPostalCode

Constraint

Consol Medication Dispense MAY contain zero or one [0..1] performer (CONF:7461) each SHALL contain exactly one [1..1] assignedEntity, where (CONF:7467) each SHOULD contain zero or one [0..1] addr with data type USRealmAddress (CONF:7468) addr SHOULD contain zero or one [0..1] postalCode (CONF:7294)

OCL

self.performer->excluding(null).assignedEntity->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies ((postalCode->isEmpty() or postalCode->exists(element | element.isNullFlavorUndefined())) implies (not postalCode->isEmpty()) )))

SuccessInvalid XML


<supply xmlns="urn:hl7-org:v3" classCode="SPLY" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.18"/>
<performer>
<assignedEntity>
<addr/>
</assignedEntity>
</performer>
</supply>

Valid XML


<supply xmlns="urn:hl7-org:v3" classCode="SPLY" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.18"/>
<performer>
<assignedEntity>
<addr use="HP"><streetAddressLine>123 Main Street</streetAddressLine><city>Boston</city><state>MA</state><country>US</country><postalCode>01001</postalCode></addr>
</assignedEntity>
</performer>
</supply>

0.083
testValidateMedicationDispensePerformerMedicationDispenseAssignedEntityUSRealmAddressState

Constraint

Consol Medication Dispense MAY contain zero or one [0..1] performer (CONF:7461) each SHALL contain exactly one [1..1] assignedEntity, where (CONF:7467) each SHOULD contain zero or one [0..1] addr with data type USRealmAddress (CONF:7468) addr SHOULD contain zero or one [0..1] state (CONF:7293)

OCL

self.performer->excluding(null).assignedEntity->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies ((state->isEmpty() or state->exists(element | element.isNullFlavorUndefined())) implies (not state->isEmpty()) )))

SuccessInvalid XML


<supply xmlns="urn:hl7-org:v3" classCode="SPLY" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.18"/>
<performer>
<assignedEntity>
<addr/>
</assignedEntity>
</performer>
</supply>

Valid XML


<supply xmlns="urn:hl7-org:v3" classCode="SPLY" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.18"/>
<performer>
<assignedEntity>
<addr use="HP"><streetAddressLine>123 Main Street</streetAddressLine><city>Boston</city><state>MA</state><country>US</country><postalCode>01001</postalCode></addr>
</assignedEntity>
</performer>
</supply>

0.083
testValidateMedicationDispensePerformerMedicationDispenseAssignedEntityUSRealmAddressStreetAddressLine

Constraint

Consol Medication Dispense MAY contain zero or one [0..1] performer (CONF:7461) each SHALL contain exactly one [1..1] assignedEntity, where (CONF:7467) each SHOULD contain zero or one [0..1] addr with data type USRealmAddress (CONF:7468) addr SHALL contain at least one [1..*] streetAddressLine (CONF:7291)

OCL

self.performer->excluding(null).assignedEntity->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies ((streetAddressLine->isEmpty() or streetAddressLine->exists(element | element.isNullFlavorUndefined())) implies (not streetAddressLine->isEmpty()) )))

SuccessInvalid XML


<supply xmlns="urn:hl7-org:v3" classCode="SPLY" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.18"/>
<performer>
<assignedEntity>
<addr/>
</assignedEntity>
</performer>
</supply>

Valid XML


<supply xmlns="urn:hl7-org:v3" classCode="SPLY" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.18"/>
<performer>
<assignedEntity>
<addr use="HP"><streetAddressLine>123 Main Street</streetAddressLine><city>Boston</city><state>MA</state><country>US</country><postalCode>01001</postalCode></addr>
</assignedEntity>
</performer>
</supply>

0.082
testValidateMedicationDispensePerformerMedicationDispenseAssignedEntityUSRealmAddressUseP

Constraint

Consol Medication Dispense MAY contain zero or one [0..1] performer (CONF:7461) each SHALL contain exactly one [1..1] assignedEntity, where (CONF:7467) each SHOULD contain zero or one [0..1] addr with data type USRealmAddress (CONF:7468) addr SHOULD contain zero or one [0..1] @use (CONF:7290), where the @code SHALL be selected from ValueSet PostalAddressUse 2.16.840.1.113883.1.11.10637 STATIC

OCL

self.performer->excluding(null).assignedEntity->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies (not use->isEmpty() )))

SuccessInvalid XML


<supply xmlns="urn:hl7-org:v3" classCode="SPLY" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.18"/>
<performer>
<assignedEntity>
<addr/>
</assignedEntity>
</performer>
</supply>

Valid XML


<supply xmlns="urn:hl7-org:v3" classCode="SPLY" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.18"/>
<performer>
<assignedEntity>
<addr use="HP"><streetAddressLine>123 Main Street</streetAddressLine><city>Boston</city><state>MA</state><country>US</country><postalCode>01001</postalCode></addr>
</assignedEntity>
</performer>
</supply>

0.051
testValidateMedicationDispensePerformerMedicationDispenseAssignedEntityUSRealmAddressUse

Constraint

Consol Medication Dispense MAY contain zero or one [0..1] performer (CONF:7461) each SHALL contain exactly one [1..1] assignedEntity, where (CONF:7467) each SHOULD contain zero or one [0..1] addr with data type USRealmAddress (CONF:7468) addr SHOULD contain zero or one [0..1] @use (CONF:7290), where the @code SHALL be selected from ValueSet PostalAddressUse 2.16.840.1.113883.1.11.10637 STATIC

OCL

self.performer->excluding(null).assignedEntity->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies (use->forAll(element | not element.oclIsUndefined() and element.oclIsKindOf(vocab::PostalAddressUse) and let value : vocab::PostalAddressUse = element.oclAsType(vocab::PostalAddressUse) in value = vocab::PostalAddressUse::BAD or value = vocab::PostalAddressUse::DIR or value = vocab::PostalAddressUse::H or value = vocab::PostalAddressUse::HP or value = vocab::PostalAddressUse::HV or value = vocab::PostalAddressUse::PHYS or value = vocab::PostalAddressUse::PST or value = vocab::PostalAddressUse::PUB or value = vocab::PostalAddressUse::TMP or value = vocab::PostalAddressUse::WP) )))

SuccessInvalid XML


<supply xmlns="urn:hl7-org:v3" classCode="SPLY" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.18"/>
<performer>
<assignedEntity>
<addr use=""/>
</assignedEntity>
</performer>
</supply>

Valid XML


<supply xmlns="urn:hl7-org:v3" classCode="SPLY" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.18"/>
<performer>
<assignedEntity>
<addr use="HP"><streetAddressLine>123 Main Street</streetAddressLine><city>Boston</city><state>MA</state><country>US</country><postalCode>01001</postalCode></addr>
</assignedEntity>
</performer>
</supply>

0.145
testValidateMedicationDispensePerformerMedicationDispenseAssignedEntityAddr

Constraint

Consol Medication Dispense MAY contain zero or one [0..1] performer (CONF:7461) each SHALL contain exactly one [1..1] assignedEntity, where (CONF:7467) medicationDispenseAssignedEntity SHOULD contain zero or one [0..1] addr with data type USRealmAddress (CONF:7468)

OCL

self.performer->excluding(null).assignedEntity->excluding(null)->reject((addr->isEmpty() or addr->exists(element | element.isNullFlavorUndefined())) implies (not addr->isEmpty()))

SuccessInvalid XML


<supply xmlns="urn:hl7-org:v3" classCode="SPLY" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.18"/>
<performer>
<assignedEntity/>
</performer>
</supply>

Valid XML


<supply xmlns="urn:hl7-org:v3" classCode="SPLY" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.18"/>
<performer>
<assignedEntity>
<addr/>
</assignedEntity>
</performer>
</supply>

0.059
testValidateMedicationDispensePerformerMedicationDispenseAssignedEntity

Constraint

Consol Medication Dispense MAY contain zero or one [0..1] performer (CONF:7461) performer SHALL contain exactly one [1..1] assignedEntity, where its type is Medication Dispense Assigned Entity (CONF:7467)

OCL

self.performer->excluding(null)->reject(assignedEntity->one(assignedEntity : cda::AssignedEntity | not assignedEntity.oclIsUndefined() and assignedEntity.oclIsKindOf(cda::AssignedEntity)))

SuccessInvalid XML


<supply xmlns="urn:hl7-org:v3" classCode="SPLY" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.18"/>
<performer/>
</supply>

Valid XML


<supply xmlns="urn:hl7-org:v3" classCode="SPLY" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.18"/>
<performer>
<assignedEntity/>
</performer>
</supply>

0.034
testValidateMedicationDispenseMedicationSupplyOrder

Constraint

Consol Medication Dispense MAY contain zero or one [0..1] entryRelationship (CONF:7473, CONF:7474, CONF:15606) Contains @typeCode="REFR" REFR, and Contains exactly one [1..1] Medication Supply Order (templateId: 2.16.840.1.113883.10.20.22.4.17)

OCL

self.entryRelationship->one(entryRelationship : cda::EntryRelationship | not entryRelationship.supply.oclIsUndefined() and entryRelationship.supply.oclIsKindOf(consol::MedicationSupplyOrder) and entryRelationship.typeCode = vocab::x_ActRelationshipEntryRelationship::REFR)

SuccessInvalid XML


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

Valid XML


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

0.038
Properties »