Unit Test Results.

Designed for use with JUnit and Ant.

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

NameTestsErrorsFailuresTime(s)Time StampHost
PurposeActivityTest8000.0842013-01-31T13:34:19JKMSoftware-desktop

Tests

NameStatusResultTime(s)
testConstructor

Constraint

OCL

SuccessInvalid XML

Valid XML

0.001
testValidatePurposeActivityHasReason

Constraint

CCD Purpose Activity SHALL satisfy: Contains exactly one entryRelationship / @typeCode, with a value of 'RSON' 'Has reason' 2.16.840.1.113883.5.1002 ActRelationshipType STATIC, to indicate the reason or purpose for creating the CCD. (CONF-26)

OCL

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

SuccessInvalid XML


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

Valid XML


<act xmlns="urn:hl7-org:v3" classCode="ACT" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.30"/>
<code code="23745001" codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT" displayName="Documentation procedure"/>
<statusCode code="completed"/>
<entryRelationship typeCode="SUBJ"/>
<entryRelationship typeCode="RSON"/>
</act>

0.006
testValidatePurposeActivityReasonType

Constraint

CCD Purpose Activity The target of entryRelationship SHALL be an Act, Encounter, Observation, Procedure, SubstanceAdministration, or Supply. (CONF-27)

OCL

self.entryRelationship->forAll(entryRelationship : cda::EntryRelationship | entryRelationship.typeCode = vocab::x_ActRelationshipEntryRelationship::RSON implies( not (entryRelationship.act.oclIsUndefined() and entryRelationship.encounter.oclIsUndefined() and entryRelationship.observation.oclIsUndefined() and entryRelationship.procedure.oclIsUndefined() and entryRelationship.substanceAdministration.oclIsUndefined() and entryRelationship.supply.oclIsUndefined())))

SuccessInvalid XML


<act xmlns="urn:hl7-org:v3">
<entryRelationship typeCode="RSON">
<organizer/>
</entryRelationship>
</act>

Valid XML


<act xmlns="urn:hl7-org:v3" classCode="ACT" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.30"/>
<code code="23745001" codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT" displayName="Documentation procedure"/>
<statusCode code="completed"/>
<entryRelationship typeCode="RSON">
<observation/>
</entryRelationship>
</act>

0.022
testValidatePurposeActivityTemplateId

Constraint

SHALL contain exactly one [1..1] templateId ( CONF-20 ) such that it SHALL contain exactly one [1..1] @root="2.16.840.1.113883.10.20.1.30"

OCL

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

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.30"/>
<code code="23745001" codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT" displayName="Documentation procedure"/>
<statusCode code="completed"/>
</act>

0.005
testValidatePurposeActivityClassCode

Constraint

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

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.30"/>
<code code="23745001" codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT" displayName="Documentation procedure"/>
<statusCode code="completed"/>
</act>

0.004
testValidatePurposeActivityMoodCode

Constraint

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

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.30"/>
<code code="23745001" codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT" displayName="Documentation procedure"/>
<statusCode code="completed"/>
</act>

0.003
testValidatePurposeActivityCode

Constraint

CCD Purpose Activity SHALL contain exactly one [1..1] code/@code="23745001" Documentation procedure (CodeSystem: 2.16.840.1.113883.6.96 SNOMEDCT) (CONF-25)

OCL

(self.code.oclIsUndefined() or self.code.isNullFlavorUndefined()) implies (not self.code.oclIsUndefined() and self.code.oclIsKindOf(datatypes::CD) and let value : datatypes::CD = self.code.oclAsType(datatypes::CD) in value.code = '23745001' and value.codeSystem = '2.16.840.1.113883.6.96')

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.30"/>
<code code="23745001" codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT" displayName="Documentation procedure"/>
<statusCode code="completed"/>
</act>

0.019
testValidatePurposeActivityStatusCode

Constraint

CCD Purpose Activity SHALL contain exactly one [1..1] statusCode/@code="completed" (CodeSystem: 2.16.840.1.113883.5.14 ActStatus) (CONF-23, CONF-24)

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')

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.30"/>
<code code="23745001" codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT" displayName="Documentation procedure"/>
<statusCode code="completed"/>
</act>

0.019
Properties »