Unit Test Results.

Designed for use with JUnit and Ant.

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

NameTestsErrorsFailuresTime(s)Time StampHost
ProblemActTest14000.1112013-01-31T13:34:17JKMSoftware-desktop

Tests

NameStatusResultTime(s)
testConstructor

Constraint

OCL

SuccessInvalid XML

Valid XML

0.001
testValidateProblemActEntryRelationshipRequired

Constraint

CCD Problem Act SHALL contain one or more entryRelationship (CONF-151)

OCL

not self.entryRelationship->isEmpty()

SuccessInvalid XML


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

Valid XML


<act xmlns="urn:hl7-org:v3" classCode="ACT" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.27"/>
<code nullFlavor="NA"/>
<entryRelationship/>
</act>

0.006
testValidateProblemActSubjectOfTarget

Constraint

CCD Problem Act The target of a problem act with Act / entryRelationship / @typeCode="SUBJ" SHOULD be a problem observation (in the Problem section) or alert observation (in the Alert section), but MAY be some other clinical statement. (CONF-153)

OCL

self.getEntryRelationshipTargets(vocab::x_ActRelationshipEntryRelationship::SUBJ, cda::ClinicalStatement)->forAll(target : cda::ClinicalStatement | not target.oclIsUndefined() and (target.oclIsKindOf(ccd::ProblemObservation) or target.oclIsKindOf(ccd::AlertObservation)))

SuccessInvalid XML


<act xmlns="urn:hl7-org:v3">
<entryRelationship typeCode="SUBJ">
<observation/>
</entryRelationship>
</act>

Valid XML


<act xmlns="urn:hl7-org:v3" classCode="ACT" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.27"/>
<code nullFlavor="NA"/>
<entryRelationship typeCode="SUBJ">
<observation/>
</entryRelationship>
</act>

0.010
testValidateProblemActContainsProblemObservation

Constraint

CCD Problem Act In Problem Section, a Problem Act SHOULD contain one or more Problem Observations. (CONF-140)

OCL

self.getSection().oclIsKindOf(ccd::ProblemSection) implies self.getObservations() ->exists(obs : cda::Observation | obs.oclIsKindOf(ccd::ProblemObservation))

SuccessInvalid XML


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

Valid XML


<act xmlns="urn:hl7-org:v3" classCode="ACT" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.27"/>
<code nullFlavor="NA"/>
<entryRelationship typeCode="SUBJ">
<observation/>
</entryRelationship>
</act>

0.008
testValidateProblemActContainsAlertObservation

Constraint

CCD Problem Act In Alert Section, a ProblemAct SHOULD contain one or more Alert Observations. (CONF-256)

OCL

self.getSection().oclIsKindOf(ccd::AlertsSection) implies self.getObservations() ->exists(obs : cda::Observation | obs.oclIsKindOf(ccd::AlertObservation))

SuccessInvalid XML


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

Valid XML


<act xmlns="urn:hl7-org:v3" classCode="ACT" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.27"/>
<code nullFlavor="NA"/>
<entryRelationship typeCode="SUBJ">
<observation/>
</entryRelationship>
</act>

0.008
testValidateProblemActContainsPatientAwareness

Constraint

CCD Problem Act MAY contain exactly one Patient Awareness (CONF-179)

OCL

self.participant->one(partic : cda::Participant2 | partic.oclIsKindOf(ccd::PatientAwareness))

SuccessInvalid XML


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

Valid XML


<act xmlns="urn:hl7-org:v3" classCode="ACT" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.27"/>
<code nullFlavor="NA"/>
<participant/>
</act>

0.004
testValidateProblemActTemplateId

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.27"

OCL

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

SuccessInvalid XML


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

Valid XML


<act xmlns="urn:hl7-org:v3" classCode="ACT" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.27"/>
<code nullFlavor="NA"/>
</act>

0.005
testValidateProblemActClassCode

Constraint

CCD Problem Act SHALL contain exactly one [1..1] @classCode="ACT" Act (CodeSystem: 2.16.840.1.113883.5.6 HL7ActClass) (CONF-146)

OCL

self.classCode=vocab::x_ActClassDocumentEntryAct::ACT

SuccessInvalid XML


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

Valid XML


<act xmlns="urn:hl7-org:v3" classCode="ACT" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.27"/>
<code nullFlavor="NA"/>
</act>

0.015
testValidateProblemActMoodCode

Constraint

CCD Problem Act SHALL contain exactly one [1..1] @moodCode="EVN" Event (CodeSystem: 2.16.840.1.113883.5.1001 HL7ActMood) (CONF-147)

OCL

self.moodCode=vocab::x_DocumentActMood::EVN

SuccessInvalid XML


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

Valid XML


<act xmlns="urn:hl7-org:v3" classCode="ACT" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.27"/>
<code nullFlavor="NA"/>
</act>

0.003
testValidateProblemActId

Constraint

CCD Problem Act SHALL contain at least one [1..*] id (CONF-148)

OCL

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

SuccessInvalid XML


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

Valid XML


<act xmlns="urn:hl7-org:v3" classCode="ACT" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.27"/>
<id/>
<code nullFlavor="NA"/>
</act>

0.011
testValidateProblemActCodeNullFlavor

Constraint

CCD Problem Act SHALL contain exactly one [1..1] code/@nullFlavor = "NA" NA (not applicable) (CONF-149)

OCL

(self.code.oclIsUndefined() or self.code.isNullFlavorUndefined()) implies (self.code.nullFlavor = vocab::NullFlavor::NA)

SuccessInvalid XML


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

Valid XML


<act xmlns="urn:hl7-org:v3" classCode="ACT" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.27"/>
<code nullFlavor="NA"/>
</act>

0.008
testValidateProblemActEffectiveTime

Constraint

CCD Problem Act MAY contain zero or one [0..1] effectiveTime (CONF-150)

OCL

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

SuccessInvalid XML


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

Valid XML


<act xmlns="urn:hl7-org:v3" classCode="ACT" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.27"/>
<code nullFlavor="NA"/>
<effectiveTime/>
</act>

0.010
testValidateProblemActEpisodeObservation

Constraint

CCD Problem Act MAY contain exactly one [1..1] entryRelationship (CONF-168) Contains exactly one [1..1] Episode Observation (templateId: 2.16.840.1.113883.10.20.1.41)

OCL

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

SuccessInvalid XML


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

Valid XML


<act xmlns="urn:hl7-org:v3" classCode="ACT" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.27"/>
<code nullFlavor="NA"/>
<entryRelationship>
<observation/>
</entryRelationship>
</act>

0.009
testGetEpisodeObservation

Constraint

OCL

SuccessInvalid XML

Valid XML

0.008
Properties »