Unit Test Results.

Designed for use with JUnit and Ant.

Class org.openhealthtools.mdht.uml.cda.consol.tests.ResultOrganizerTest

NameTestsErrorsFailuresTime(s)Time StampHost
ResultOrganizerTest12000.5632013-01-31T13:36:19JKMSoftware-desktop

Tests

NameStatusResultTime(s)
testConstructor

Constraint

OCL

SuccessInvalid XML

Valid XML

0.001
testValidateResultOrganizerCodeValue

Constraint

Consol Result Organizer The value for 'code' in a result organizer SHOULD be selected from LOINC (codeSystem 2.16.840.1.113883.6.1) or SNOMED CT (codeSystem 2.16.840.1.113883.6.96) and MAY be selected from CPT-4 (codeSystem 2.16.840.1.113883.6.12). Laboratory results SHOULD be from LOINC (CodeSystem: 2.16.840.1.113883.6.1) or other constrained terminology named by the US Department of Health and Human Services Office of National Coordinator or other federal agency. Local and/or regional codes for laboratory results SHOULD also be allowed. (CONF:7164)

OCL

self.code.isNullFlavorDefined() or self.code.codeSystem = '2.16.840.1.113883.6.1' or self.code.codeSystem = '2.16.840.1.113883.6.96' or self.code.codeSystem = '2.16.840.1.113883.6.12'

SuccessInvalid XML


<organizer xmlns="urn:hl7-org:v3">
<code codeSystem=""/>
</organizer>

Valid XML


<organizer xmlns="urn:hl7-org:v3" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.1"/>
<code codeSystem="2.16.840.1.113883.6.12"/>
</organizer>

0.063
testValidateResultOrganizerTemplateId

Constraint

The 'ResultOrganizerTemplateId' invariant is violated on 'org.openhealthtools.mdht.uml.cda.mu2consol.impl.ResultOrganizerImpl@258b0bc{#//}'

OCL

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

SuccessInvalid XML


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

Valid XML


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

0.014
testValidateResultOrganizerMoodCode

Constraint

Consol Result Organizer SHALL contain exactly one [1..1] @moodCode="EVN" Event (CodeSystem: 2.16.840.1.113883.5.1001 HL7ActMood) (CONF:7122)

OCL

self.moodCode=vocab::ActMood::EVN

SuccessInvalid XML


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

Valid XML


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

0.009
testValidateResultOrganizerId

Constraint

Consol Result Organizer SHALL contain at least one [1..*] id (CONF:7127)

OCL

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

SuccessInvalid XML


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

Valid XML


<organizer xmlns="urn:hl7-org:v3" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.1"/>
<id/>
</organizer>

0.049
testValidateResultOrganizerCode

Constraint

Consol Result Organizer SHALL contain exactly one [1..1] code (CONF:7128)

OCL

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

SuccessInvalid XML


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

Valid XML


<organizer xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.1"/>
<code xsi:type="CE"/>
</organizer>

0.043
testValidateResultOrganizerStatusCode

Constraint

Consol Result Organizer SHALL contain exactly one [1..1] statusCode (CONF:7123), where the @code SHALL be selected from ValueSet Result Status 2.16.840.1.113883.11.20.9.39 STATIC 2012-04-27 (CONF:14848)

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

SuccessInvalid XML


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

Valid XML


<organizer xmlns="urn:hl7-org:v3" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.1"/>
<statusCode code="completed"/>
</organizer>

0.199
testValidateResultOrganizerResultObservation

Constraint

Consol Result Organizer SHALL contain at least one [1..*] component (CONF:7124, CONF:14850) Contains exactly one [1..1] Result Observation (templateId: 2.16.840.1.113883.10.20.22.4.2)

OCL

self.component->exists(component : cda::Component4 | not component.observation.oclIsUndefined() and component.observation.oclIsKindOf(consol::ResultObservation))

SuccessInvalid XML


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

Valid XML


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

0.037
testGetResultObservations

Constraint

OCL

SuccessInvalid XML

Valid XML

0.042
testValidateResultOrganizerClassCodeValue

Constraint

Consol Result Organizer SHOULD contain zero or one [0..1] @classCode="CLUSTER" Cluster (CodeSystem: 2.16.840.1.113883.5.6 HL7ActClass) OR SHOULD contain zero or one [0..1] @classCode="BATTERY" Battery (CodeSystem: 2.16.840.1.113883.5.6 HL7ActClass) (CONF:7165)

OCL

self.isClassCodeDefined() and (self.classCode = vocab::x_ActClassDocumentEntryOrganizer::CLUSTER or self.classCode = vocab::x_ActClassDocumentEntryOrganizer::BATTERY)

SuccessInvalid XML


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

Valid XML


<organizer xmlns="urn:hl7-org:v3" classCode="CLUSTER" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.1"/>
</organizer>

0.039
testValidateResultOrganizerClassCode

Constraint

Consol Result Organizer SHALL contain exactly one [1..1] @classCode (CONF:7121)

OCL

isDefined('classCode')

SuccessInvalid XML


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

Valid XML


<organizer xmlns="urn:hl7-org:v3" classCode="BATTERY" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.1"/>
</organizer>

0.013
testValidateResultOrganizerStatusCodeP

Constraint

Consol Result Organizer SHALL contain exactly one [1..1] statusCode (CONF:7123), where the @code SHALL be selected from ValueSet Result Status 2.16.840.1.113883.11.20.9.39 STATIC 2012-04-27 (CONF:14848)

OCL

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

SuccessInvalid XML


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

Valid XML


<organizer xmlns="urn:hl7-org:v3" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.1"/>
<statusCode/>
</organizer>

0.052
Properties »