Unit Test Results.

Designed for use with JUnit and Ant.

Class org.openhealthtools.mdht.uml.cda.ccd.tests.SupplyActivityTest

NameTestsErrorsFailuresTime(s)Time StampHost
SupplyActivityTest19000.1922013-01-31T13:34:20JKMSoftware-desktop

Tests

NameStatusResultTime(s)
testConstructor

Constraint

OCL

SuccessInvalid XML

Valid XML

0.001
testGetMedicationStatusObservation

Constraint

OCL

SuccessInvalid XML

Valid XML

0.010
testGetProductInstances

Constraint

OCL

SuccessInvalid XML

Valid XML

0.009
testValidateSupplyActivityMoodCode

Constraint

CCD Supply Activity SHALL satisfy: Value for moodCode is 'EVN' or 'INT' 2.16.840.1.113883.5.1001 ActMood STATIC (CONF-317)

OCL

self.moodCode=vocab::x_DocumentSubstanceMood::EVN or self.moodCode=vocab::x_DocumentSubstanceMood::INT

SuccessInvalid XML


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

Valid XML


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

0.006
testValidateSupplyActivityHasAuthor

Constraint

CCD Supply Activity MAY satisfy: Contains one or more author. (CONF-323)

OCL

not self.author->isEmpty()

SuccessInvalid XML


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

Valid XML


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

0.006
testValidateSupplyActivityHasPerformer

Constraint

CCD Supply Activity MAY satisfy: Contains one or more performer. (CONF-324)

OCL

not self.performer->isEmpty()

SuccessInvalid XML


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

Valid XML


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

0.006
testValidateSupplyActivityHasParticipantLocation

Constraint

CCD Supply Activity MAY satisfy: Contains exactly one participant / @typeCode = "LOC". (CONF-325)

OCL

self.participant->one(part : cda::Participant2 | part.typeCode = vocab::ParticipationType::LOC)

SuccessInvalid XML


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

Valid XML


<supply xmlns="urn:hl7-org:v3">
<templateId root="2.16.840.1.113883.10.20.1.34"/>
<participant typeCode="LOC"/>
</supply>

0.004
testValidateSupplyActivityInformationSource

Constraint

CCD Supply Activity SHALL satisfy: Contains one or more sources of information. (CONF-326)

OCL

not self.informant->isEmpty() or not self.getSection().informant->isEmpty()or not self.getClinicalDocument().informant->isEmpty()or self.reference->exists(ref : cda::Reference | ref.typeCode = vocab::x_ActRelationshipExternalReference::XCRPT)or (self.entryRelationship->exists(rel : cda::EntryRelationship | rel.typeCode = vocab::x_ActRelationshipEntryRelationship::REFR and rel.observation.code.code = '48766-0'))

SuccessInvalid XML


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

Valid XML


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

0.027
testValidateSupplyActivityHasProduct

Constraint

CCD Supply Activity MAY satisfy: Contains exactly one product, the target of which is a Product template. (CONF-355)

OCL

not self.product.oclIsUndefined() and self.product.oclIsKindOf(cda::Product)

SuccessInvalid XML


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

Valid XML


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

0.010
testValidateSupplyActivityTemplateId

Constraint

SHALL contain exactly one [1..1] templateId ( ) such that it SHALL contain exactly one [1..1] @root="2.16.840.1.113883.10.20.1.34"

OCL

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

SuccessInvalid XML


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

Valid XML


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

0.005
testValidateSupplyActivityId

Constraint

CCD Supply Activity SHALL contain at least one [1..*] id (CONF-318)

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

0.012
testValidateSupplyActivityStatusCode

Constraint

CCD Supply Activity SHOULD contain exactly one [1..1] statusCode (CONF-319)

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

0.012
testValidateSupplyActivityEffectiveTime

Constraint

CCD Supply Activity SHOULD contain exactly one [1..1] effectiveTime (CONF-320)

OCL

(self.effectiveTime->isEmpty() or self.effectiveTime->exists(element | element.isNullFlavorUndefined())) implies (self.effectiveTime->size() = 1)

SuccessInvalid XML


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

Valid XML


<supply xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3">
<templateId root="2.16.840.1.113883.10.20.1.34"/>
<effectiveTime xsi:type="IVL_TS"/>
</supply>

0.013
testValidateSupplyActivityQuantity

Constraint

CCD Supply Activity MAY contain exactly one [1..1] quantity (CONF-322)

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

0.011
testValidateSupplyActivityRepeatNumber

Constraint

CCD Supply Activity 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.10.20.1.34"/>
<repeatNumber/>
</supply>

0.014
testValidateSupplyActivityMedicationStatusObservation

Constraint

CCD Supply Activity MAY contain exactly one [1..1] entryRelationship (CONF-351) Contains exactly one [1..1] Medication Status Observation (templateId: 2.16.840.1.113883.10.20.1.47)

OCL

self.entryRelationship->one(entryRelationship : cda::EntryRelationship | not entryRelationship.observation.oclIsUndefined() and entryRelationship.observation.oclIsKindOf(ccd::MedicationStatusObservation))

SuccessInvalid XML


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

Valid XML


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

0.010
testValidateSupplyActivityFulfillmentInstruction

Constraint

CCD Supply Activity MAY contain at least one [1..*] entryRelationship (CONF-334, CONF-337) Contains @typeCode="SUBJ" SUBJ, and Contains exactly one [1..1] Fulfillment Instruction (templateId: 2.16.840.1.113883.10.20.1.43)

OCL

self.entryRelationship->exists(entryRelationship : cda::EntryRelationship | not entryRelationship.act.oclIsUndefined() and entryRelationship.act.oclIsKindOf(ccd::FulfillmentInstruction) and entryRelationship.typeCode = vocab::x_ActRelationshipEntryRelationship::SUBJ)

SuccessInvalid XML


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

Valid XML


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

0.013
testValidateSupplyActivityProductInstance

Constraint

CCD Supply Activity MAY contain at least one [1..*] participant (CONF-369) Contains exactly one [1..1] Product Instance (templateId: 2.16.840.1.113883.10.20.1.52)

OCL

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

SuccessInvalid XML


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

Valid XML


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

0.009
testGetFulfillmentInstructions

Constraint

OCL

SuccessInvalid XML

Valid XML

0.009
Properties »