Unit Test Results.

Designed for use with JUnit and Ant.

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

NameTestsErrorsFailuresTime(s)Time StampHost
NonMedicinalSupplyActivityTest12000.3642013-01-31T13:35:34JKMSoftware-desktop

Tests

NameStatusResultTime(s)
testConstructor

Constraint

OCL

SuccessInvalid XML

Valid XML

0.000
testValidateNonMedicinalSupplyActivityEffectiveTimeHigh

Constraint

Consol Non Medicinal Supply Activity SHOULD contain zero or one [0..1] effectiveTime/high (CONF:16867)

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">
<templateId root="2.16.840.1.113883.10.20.22.4.50"/>
<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">
<templateId root="2.16.840.1.113883.10.20.22.4.50"/>
<effectiveTime xsi:type="IVL_TS">
<low value="1"/>
<high value="2"/>
</effectiveTime>
</supply>

0.051
testValidateNonMedicinalSupplyActivityProductInstanceTypeCode

Constraint

Consol Non Medicinal Supply Activity participant with target entry Product Instance SHALL contain exactly one [1..1] @typeCode="PRD" Product (CodeSystem: HL7ParticipationType 2.16.840.1.113883.5.90) (CONF:8754)

OCL

self.participant->select(par : cda::Participant2 | par.participantRole.oclIsKindOf(consol::ProductInstance))->forAll(p : cda::Participant2 | p.typeCode=vocab::ParticipationType::PRD)

SuccessInvalid XML


<supply xmlns="urn:hl7-org:v3" classCode="SPLY">
<templateId root="2.16.840.1.113883.10.20.22.4.50"/>
<participant>
<participantRole/>
</participant>
</supply>

Valid XML


<supply xmlns="urn:hl7-org:v3" classCode="SPLY">
<templateId root="2.16.840.1.113883.10.20.22.4.50"/>
<participant typeCode="PRD">
<participantRole/>
</participant>
</supply>

0.017
testValidateNonMedicinalSupplyActivityTemplateId

Constraint

SHALL contain exactly one [1..1] templateId ( CONF:8747, CONF:10509 ) such that it SHALL contain exactly one [1..1] @root="2.16.840.1.113883.10.20.22.4.50"

OCL

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

SuccessInvalid XML


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

Valid XML


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

0.011
testValidateNonMedicinalSupplyActivityClassCode

Constraint

Consol Non Medicinal Supply Activity SHALL contain exactly one [1..1] @classCode="SPLY" (CodeSystem: 2.16.840.1.113883.5.6 HL7ActClass) (CONF:8745)

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

0.007
testValidateNonMedicinalSupplyActivityMoodCode

Constraint

Consol Non Medicinal Supply Activity SHALL contain exactly one [1..1] @moodCode, where the @code SHALL be selected from ValueSet MoodCodeEvnInt 2.16.840.1.113883.11.20.9.18 STATIC 2011-04-03 (CONF:8746)

OCL

not self.moodCode.oclIsUndefined() and self.moodCode.oclIsKindOf(vocab::x_DocumentSubstanceMood) and let value : vocab::x_DocumentSubstanceMood = self.moodCode.oclAsType(vocab::x_DocumentSubstanceMood) in value = vocab::x_DocumentSubstanceMood::EVN or value = vocab::x_DocumentSubstanceMood::INT

SuccessInvalid XML


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

Valid XML


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

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

0.048
testValidateNonMedicinalSupplyActivityId

Constraint

Consol Non Medicinal Supply Activity SHALL contain at least one [1..*] id (CONF:8748)

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

0.038
testValidateNonMedicinalSupplyActivityStatusCode

Constraint

Consol Non Medicinal Supply Activity SHALL contain exactly one [1..1] statusCode (CONF:8749)

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">
<templateId root="2.16.840.1.113883.10.20.22.4.50"/>
<statusCode code="completed"/>
</supply>

0.042
testValidateNonMedicinalSupplyActivityEffectiveTime

Constraint

Consol Non Medicinal Supply Activity SHOULD contain zero or one [0..1] effectiveTime (CONF:15498)

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">
<templateId root="2.16.840.1.113883.10.20.22.4.50"/>
<effectiveTime/>
</supply>

0.040
testValidateNonMedicinalSupplyActivityQuantity

Constraint

Consol Non Medicinal Supply Activity SHOULD contain exactly one [1..1] quantity (CONF:8751)

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

0.037
testValidateNonMedicinalSupplyActivityProductInstance

Constraint

Consol Non Medicinal Supply Activity SHALL contain zero or one [0..1] participant (CONF:8752, CONF:15900) Contains exactly one [1..1] Product Instance (templateId: 2.16.840.1.113883.10.20.22.4.37)

OCL

self.participant->one(participant : cda::Participant2 | not participant.participantRole.oclIsUndefined() and participant.participantRole.oclIsKindOf(consol::ProductInstance))

SuccessInvalid XML


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

Valid XML


<supply xmlns="urn:hl7-org:v3" classCode="SPLY">
<templateId root="2.16.840.1.113883.10.20.22.4.50"/>
<participant typeCode="PRD">
<participantRole/>
</participant>
</supply>

0.028
testGetProductInstance

Constraint

OCL

SuccessInvalid XML

Valid XML

0.039
Properties »