Unit Test Results.

Designed for use with JUnit and Ant.

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

NameTestsErrorsFailuresTime(s)Time StampHost
ResultOrganizerTest12000.1102013-01-31T13:34: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.015
testValidateResultOrganizerComponentElement

Constraint

CCD Result Organizer SHALL satisfy: Contains one or more component (CONF-402)

OCL

not self.component->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.1.32"/>
<component/>
</organizer>

0.005
testValidateResultOrganizerInformationSource

Constraint

CCD Result Organizer SHALL satisfy: Contains one or more sources of information. (CONF-406)

OCL

not self.informant->isEmpty() or not self.getSection().informant->isEmpty()or not self.getClinicalDocument().informant->isEmpty()or self.reference->exists(ref : cda::Reference | ref.typeCode = vocab::x_ActRelationshipExternalReference::XCRPT)

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.1.32"/>
<informant/>
</organizer>

0.018
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.004
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.004
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.011
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.010
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.011
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.010
testValidateResultOrganizerSpecimen

Constraint

CCD Result Organizer SHOULD contain at least one [1..*] specimen (CONF-399) Contains exactly one [1..1] CDA Specimen

OCL

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

SuccessInvalid XML


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

Valid XML


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

0.008
testGetResultObservations

Constraint

OCL

SuccessInvalid XML

Valid XML

0.009
Properties »