Unit Test Results.

Designed for use with JUnit and Ant.

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

NameTestsErrorsFailuresTime(s)Time StampHost
ProcedureActivityObservationTest19000.1762013-01-31T13:34:18JKMSoftware-desktop

Tests

NameStatusResultTime(s)
testConstructor

Constraint

OCL

SuccessInvalid XML

Valid XML

0.001
testGetPatientInstructions

Constraint

OCL

SuccessInvalid XML

Valid XML

0.008
testGetAgeObservation

Constraint

OCL

SuccessInvalid XML

Valid XML

0.009
testGetMedicationActivities

Constraint

OCL

SuccessInvalid XML

Valid XML

0.008
testGetProblemAct

Constraint

OCL

SuccessInvalid XML

Valid XML

0.009
testGetProblemObservation

Constraint

OCL

SuccessInvalid XML

Valid XML

0.009
testValidateProcedureActivityObservationTemplateId

Constraint

SHALL contain exactly one [1..1] templateId ( CONF:10520 ) such that it SHALL contain exactly one [1..1] @root="2.16.840.1.113883.10.20.22.4.13"

OCL

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

SuccessInvalid XML


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

Valid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS">
<templateId root="2.16.840.1.113883.10.20.22.4.13"/>
<priorityCode codeSystem="2.16.840.1.113883.5.7" codeSystemName="ActPriority"/>
<targetSiteCode codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
</observation>

0.005
testValidateProcedureActivityObservationMoodCode

Constraint

Consol Procedure Activity Observation 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:8237)

OCL

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

SuccessInvalid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS">
<templateId root="2.16.840.1.113883.10.20.22.4.13"/>
<priorityCode codeSystem="2.16.840.1.113883.5.7" codeSystemName="ActPriority"/>
<targetSiteCode codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
</observation>

Valid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.13"/>
<priorityCode codeSystem="2.16.840.1.113883.5.7" codeSystemName="ActPriority"/>
<targetSiteCode codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
</observation>

0.004
testValidateProcedureActivityObservationCode

Constraint

Consol Procedure Activity Observation SHALL contain exactly one [1..1] code (CONF:8240)

OCL

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

SuccessInvalid XML


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

Valid XML


<observation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" classCode="OBS">
<templateId root="2.16.840.1.113883.10.20.22.4.13"/>
<code xsi:type="CE"/>
<priorityCode codeSystem="2.16.840.1.113883.5.7" codeSystemName="ActPriority"/>
<targetSiteCode codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
</observation>

0.009
testValidateProcedureActivityObservationEffectiveTime

Constraint

Consol Procedure Activity Observation SHOULD contain zero or one [0..1] effectiveTime (CONF:8246)

OCL

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

SuccessInvalid XML


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

Valid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS">
<templateId root="2.16.840.1.113883.10.20.22.4.13"/>
<effectiveTime/>
<priorityCode codeSystem="2.16.840.1.113883.5.7" codeSystemName="ActPriority"/>
<targetSiteCode codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
</observation>

0.011
testValidateProcedureActivityObservationId

Constraint

Consol Procedure Activity Observation SHALL contain at least one [1..*] id (CONF:8239)

OCL

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

SuccessInvalid XML


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

Valid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS">
<templateId root="2.16.840.1.113883.10.20.22.4.13"/>
<id/>
<priorityCode codeSystem="2.16.840.1.113883.5.7" codeSystemName="ActPriority"/>
<targetSiteCode codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
</observation>

0.014
testValidateProcedureActivityObservationStatusCode

Constraint

Consol Procedure Activity Observation SHALL contain exactly one [1..1] statusCode, where the @code SHALL be selected from ValueSet ProcedureActStatusCode 2.16.840.1.113883.11.20.9.22 DYNAMIC (CONF:8245)

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 = 'completed' or value.code = 'active' or value.code = 'aborted' or value.code = 'cancelled')

SuccessInvalid XML


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

Valid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS">
<templateId root="2.16.840.1.113883.10.20.22.4.13"/>
<statusCode code="completed" codeSystem="2.16.840.1.113883.5.14"/>
<priorityCode codeSystem="2.16.840.1.113883.5.7" codeSystemName="ActPriority"/>
<targetSiteCode codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
</observation>

0.011
testValidateProcedureActivityObservationEncounterLocation

Constraint

CCD Procedure Activity Observation MAY contain at least one [1..*] participant 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


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

Valid XML


<observation xmlns="urn:hl7-org:v3" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.29"/>
<participant typeCode="LOC">
<templateId root="2.16.840.1.113883.10.20.1.45"/>
</participant>
</observation>

0.008
testValidateProcedureActivityObservationPerformer2

Constraint

CCD Procedure Activity Observation MAY contain at least one [1..*] performer Contains exactly one [1..1] CDA Performer2

OCL

self.performer->exists(performer : cda::Performer2 | not performer.oclIsUndefined() and performer.oclIsKindOf(rim::Participation))

SuccessInvalid XML


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

Valid XML


<observation xmlns="urn:hl7-org:v3" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.29"/>
<performer/>
</observation>

0.007
testValidateProcedureActivityObservationProblemObservation

Constraint

CCD Procedure Activity Observation MAY contain zero or one [0..1] entryRelationship Contains @typeCode="RSON" RSON, and Contains exactly one [1..1] Problem Observation (templateId: 2.16.840.1.113883.10.20.1.28)

OCL

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

SuccessInvalid XML


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

Valid XML


<observation xmlns="urn:hl7-org:v3" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.29"/>
<entryRelationship typeCode="RSON">
<observation classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.28"/>
<statusCode code="completed"/>
</observation>
</entryRelationship>
</observation>

0.012
testValidateProcedureActivityObservationAgeObservation

Constraint

CCD Procedure Activity Observation 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


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

Valid XML


<observation xmlns="urn:hl7-org:v3" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.29"/>
<entryRelationship typeCode="SUBJ">
<observation classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.38"/>
<code code="397659008" codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT" displayName="Age"/>
<statusCode code="completed"/>
</observation>
</entryRelationship>
</observation>

0.011
testValidateProcedureActivityObservationMedicationActivity

Constraint

Consol Procedure Activity Observation MAY contain zero or one [0..1] entryRelationship (CONF:8279, CONF:8280, CONF:15907) Contains @typeCode="COMP" COMP, and Contains exactly one [1..1] Medication Activity (templateId: 2.16.840.1.113883.10.20.22.4.16)

OCL

self.entryRelationship->one(entryRelationship : cda::EntryRelationship | not entryRelationship.substanceAdministration.oclIsUndefined() and entryRelationship.substanceAdministration.oclIsKindOf(consol::MedicationActivity) and entryRelationship.typeCode = vocab::x_ActRelationshipEntryRelationship::COMP)

SuccessInvalid XML


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

Valid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS">
<templateId root="2.16.840.1.113883.10.20.22.4.13"/>
<priorityCode codeSystem="2.16.840.1.113883.5.7" codeSystemName="ActPriority"/>
<targetSiteCode codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<entryRelationship typeCode="COMP">
<substanceAdministration/>
</entryRelationship>
</observation>

0.012
testValidateProcedureActivityObservationPatientInstruction

Constraint

CCD Procedure Activity Observation MAY contain at least one [1..*] 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


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

Valid XML


<observation xmlns="urn:hl7-org:v3" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.29"/>
<entryRelationship>
<act moodCode="INT">
<templateId root="2.16.840.1.113883.10.20.1.49"/>
</act>
</entryRelationship>
</observation>

0.009
testValidateProcedureActivityObservationProblemAct

Constraint

CCD Procedure Activity Observation MAY contain zero or one [0..1] entryRelationship Contains @typeCode="RSON" RSON, and Contains exactly one [1..1] Problem Act (templateId: 2.16.840.1.113883.10.20.1.27)

OCL

self.entryRelationship->one(entryRelationship : cda::EntryRelationship | not entryRelationship.act.oclIsUndefined() and entryRelationship.act.oclIsKindOf(ccd::ProblemAct) and entryRelationship.typeCode = vocab::x_ActRelationshipEntryRelationship::RSON)

SuccessInvalid XML


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

Valid XML


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

0.012
Properties »