Unit Test Results.

Designed for use with JUnit and Ant.

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

NameTestsErrorsFailuresTime(s)Time StampHost
EncountersActivityTest14000.1192013-01-31T13:34:13JKMSoftware-desktop

Tests

NameStatusResultTime(s)
testConstructor

Constraint

OCL

SuccessInvalid XML

Valid XML

0.000
testValidateEncountersActivityHasIndications

Constraint

CCD Encounters Activity MAY contain one or more [1..*] entryRelationship with @typecode='RSON' where target represents the indication for the activity

OCL

self.entryRelationship->exists(er : cda::EntryRelationship | er.typeCode = vocab::x_ActRelationshipEntryRelationship::RSON)

SuccessInvalid XML


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

Valid XML


<encounter xmlns="urn:hl7-org:v3" classCode="ENC" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.21"/>
<entryRelationship typeCode="RSON"/>
</encounter>

0.015
testValidateEncountersActivityHasPractitioners

Constraint

OCL

self.performer->size() >= 0

SuccessInvalid XML


Skip Fail Test

Valid XML


<encounter xmlns="urn:hl7-org:v3" classCode="ENC" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.21"/>
</encounter>

0.005
testValidateEncountersActivityPractitionerRole

Constraint

CCD Encounters Activity MAY contain one [0..1] performer / assignedEntity / code, to define the role of the practioner

OCL

self.performer.assignedEntity.code->size() = 1

SuccessInvalid XML


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

Valid XML


<encounter xmlns="urn:hl7-org:v3" classCode="ENC" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.21"/>
<performer>
<assignedEntity>
<code/>
</assignedEntity>
</performer>
</encounter>

0.006
testValidateEncountersActivityTemplateId

Constraint

The 'EncountersActivityTemplateId' invariant is violated on 'org.openhealthtools.mdht.uml.cda.ihe.impl.EncounterActivityImpl@251ebd4f{#//}'

OCL

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

SuccessInvalid XML


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

Valid XML


<encounter xmlns="urn:hl7-org:v3" classCode="ENC" moodCode="EVN">
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.14"/>
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.14"/>
<templateId root="2.16.840.1.113883.10.20.1.21"/>
<code codeSystem="2.16.840.1.113883.5.4" codeSystemName="ActEncounterCode"/>
</encounter>

0.004
testValidateEncountersActivityClassCode

Constraint

CCD Encounters Activity SHALL contain exactly one [1..1] @classCode="ENC" (CodeSystem: 2.16.840.1.113883.5.6 HL7ActClass) (CONF-459)

OCL

self.classCode=vocab::ActClass::ENC

SuccessInvalid XML


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

Valid XML


<encounter xmlns="urn:hl7-org:v3" classCode="ENC" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.21"/>
</encounter>

0.003
testValidateEncountersActivityMoodCode

Constraint

CCD Encounters Activity SHALL contain exactly one [1..1] @moodCode="EVN" Event (CodeSystem: 2.16.840.1.113883.5.1001 HL7ActMood) (CONF-460)

OCL

self.moodCode=vocab::x_DocumentEncounterMood::EVN

SuccessInvalid XML


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

Valid XML


<encounter xmlns="urn:hl7-org:v3" classCode="ENC" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.21"/>
</encounter>

0.003
testValidateEncountersActivityId

Constraint

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

OCL

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

SuccessInvalid XML


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

Valid XML


<encounter xmlns="urn:hl7-org:v3" classCode="ENC" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.21"/>
<id/>
</encounter>

0.007
testValidateEncountersActivityEffectiveTime

Constraint

CCD Encounters Activity MAY contain zero or one [0..1] effectiveTime (CONF-464)

OCL

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

SuccessInvalid XML


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

Valid XML


<encounter xmlns="urn:hl7-org:v3" classCode="ENC" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.21"/>
<effectiveTime/>
</encounter>

0.008
testValidateEncountersActivityPatientInstruction

Constraint

CCD Encounters Activity MAY contain zero or more [0..*] entryRelationship Contains exactly one [1..1] Patient Instruction (templateId: 2.16.840.1.113883.10.20.1.49)

OCL

self.entryRelationship->exists(entryRelationship : cda::EntryRelationship | not entryRelationship.act.oclIsUndefined() and entryRelationship.act.oclIsKindOf(ccd::PatientInstruction))

SuccessInvalid XML


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

Valid XML


<encounter xmlns="urn:hl7-org:v3" classCode="ENC" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.21"/>
<entryRelationship>
<act/>
</entryRelationship>
</encounter>

0.008
testValidateEncountersActivityAgeObservation

Constraint

CCD Encounters Activity MAY contain zero or one [0..1] entryRelationship Contains @typeCode="SUBJ" SUBJ, and Contains exactly one [1..1] Age Observation (templateId: 2.16.840.1.113883.10.20.1.38)

OCL

self.entryRelationship->one(entryRelationship : cda::EntryRelationship | not entryRelationship.observation.oclIsUndefined() and entryRelationship.observation.oclIsKindOf(ccd::AgeObservation) and entryRelationship.typeCode = vocab::x_ActRelationshipEntryRelationship::SUBJ)

SuccessInvalid XML


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

Valid XML


<encounter xmlns="urn:hl7-org:v3" classCode="ENC" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.21"/>
<entryRelationship typeCode="SUBJ">
<observation/>
</entryRelationship>
</encounter>

0.010
testValidateEncountersActivityEncounterLocation

Constraint

CCD Encounters Activity MAY contain zero or more [0..*] participant (CONF-471) Contains exactly one [1..1] Encounter Location (templateId: 2.16.840.1.113883.10.20.1.45)

OCL

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

SuccessInvalid XML


<encounter xmlns="urn:hl7-org:v3" classCode="ENC" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.21"/>
</encounter>

Valid XML


<encounter xmlns="urn:hl7-org:v3" classCode="ENC" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.21"/>
<participant typeCode="LOC">
<templateId root="2.16.840.1.113883.10.20.1.45"/>
</participant>
</encounter>

0.007
testGetPatientInstructions

Constraint

OCL

SuccessInvalid XML

Valid XML

0.007
testGetAgeObservation

Constraint

OCL

SuccessInvalid XML

Valid XML

0.007
Properties »