Unit Test Results.

Designed for use with JUnit and Ant.

Class org.openhealthtools.mdht.uml.cda.ihe.tests.ExternalReferenceTest

NameTestsErrorsFailuresTime(s)Time StampHost
ExternalReferenceTest11000.0982013-01-31T13:34:23JKMSoftware-desktop

Tests

NameStatusResultTime(s)
testConstructor

Constraint

OCL

SuccessInvalid XML

Valid XML

0.001
testValidateExternalReferenceHasNoCode

Constraint

IHE External Reference SHALL satisfy: the code/@nullFlavor attribute value is 'NA'

OCL

not self.code.oclIsUndefined() implies self.code.nullFlavor = vocab::NullFlavor::NA

SuccessInvalid XML


<act xmlns="urn:hl7-org:v3" classCode="ACT" moodCode="EVN">
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.4"/>
<code/>
</act>

Valid XML


<act xmlns="urn:hl7-org:v3" classCode="ACT" moodCode="EVN">
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.4"/>
<code nullFlavor="NA"/>
</act>

0.010
testValidateExternalReferenceHasReference

Constraint

IHE External Reference SHALL satisfy: reference/@typeCode attribute value is either 'SPRT' (supporting documentation) or 'REFR' (reference material)

OCL

self.reference->select(r| r.typeCode <> vocab::x_ActRelationshipExternalReference::REFR and r.typeCode <> vocab::x_ActRelationshipExternalReference::SPRT)->size() = 0

SuccessInvalid XML


<act xmlns="urn:hl7-org:v3" classCode="ACT" moodCode="EVN">
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.4"/>
<reference/>
<reference/>
</act>

Valid XML


<act xmlns="urn:hl7-org:v3" classCode="ACT" moodCode="EVN">
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.4"/>
<reference typeCode="SPRT"/>
<reference typeCode="REFR"/>
</act>

0.012
testValidateExternalReferenceHasReferenceExternalDocument

Constraint

IHE External Reference SHALL satisfy: the reference element contains an externalDocument element with @classCode = 'DOC' and @moodCode = 'EVN'.

OCL

self.reference.externalDocument->select(ed | ed.classCode = vocab::ActClassDocument::DOC and ed.moodCode = vocab::ActMood::EVN )->size() = 1

SuccessInvalid XML


<act xmlns="urn:hl7-org:v3" classCode="ACT" moodCode="EVN">
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.4"/>
<reference>
<externalDocument classCode="CDALVLONE"/>
</reference>
</act>

Valid XML


<act xmlns="urn:hl7-org:v3" classCode="ACT" moodCode="EVN">
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.4"/>
<reference typeCode="SPRT">
<externalDocument classCode="DOC" moodCode="EVN"/>
</reference>
</act>

0.013
testValidateExternalReferenceHasReferenceExternalDocumentID

Constraint

IHE External Reference SHALL satisfy: the reference/externalDocument/id is present

OCL

self.reference->select( r | r.externalDocument.id->isEmpty() )->size() = 0

SuccessInvalid XML


<act xmlns="urn:hl7-org:v3" classCode="ACT" moodCode="EVN">
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.4"/>
<reference typeCode="SPRT">
<externalDocument classCode="DOC">
<text>string</text>
</externalDocument>
</reference>
</act>

Valid XML


<act xmlns="urn:hl7-org:v3" classCode="ACT" moodCode="EVN">
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.4"/>
<reference typeCode="SPRT">
<externalDocument classCode="DOC">
<id/>
<text>string</text>
</externalDocument>
</reference>
</act>

0.010
testValidateExternalReferenceHasReferenceExternalDocumentText

Constraint

IHE External Reference SHALL satisfy: the reference/externalDocument/text is present to provide a link to the original document

OCL

self.reference->select( r | r.externalDocument.text.oclIsUndefined() )->size() = 0

SuccessInvalid XML


<act xmlns="urn:hl7-org:v3" classCode="ACT" moodCode="EVN">
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.4"/>
<reference typeCode="SPRT">
<externalDocument classCode="DOC"/>
</reference>
</act>

Valid XML


<act xmlns="urn:hl7-org:v3" classCode="ACT" moodCode="EVN">
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.4"/>
<reference typeCode="SPRT">
<externalDocument classCode="DOC">
<text>string</text>
</externalDocument>
</reference>
</act>

0.010
testValidateExternalReferenceTemplateId

Constraint

SHALL contain exactly one [1..1] templateId ( ) such that it SHALL contain exactly one [1..1] @root="1.3.6.1.4.1.19376.1.5.3.1.4.4"

OCL

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

SuccessInvalid XML


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

Valid XML


<act xmlns="urn:hl7-org:v3" classCode="ACT" moodCode="EVN">
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.4"/>
</act>

0.006
testValidateExternalReferenceClassCode

Constraint

IHE External Reference SHALL contain exactly one [1..1] @classCode="ACT" Act (CodeSystem: 2.16.840.1.113883.5.6 HL7ActClass)

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="1.3.6.1.4.1.19376.1.5.3.1.4.4"/>
</act>

0.004
testValidateExternalReferenceMoodCode

Constraint

IHE External Reference SHALL contain exactly one [1..1] @moodCode="EVN" Event (CodeSystem: 2.16.840.1.113883.5.1001 HL7ActMood)

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="1.3.6.1.4.1.19376.1.5.3.1.4.4"/>
</act>

0.004
testValidateExternalReferenceId

Constraint

IHE External Reference SHALL contain zero or more [0..*] id

OCL

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

SuccessInvalid XML


<act xmlns="urn:hl7-org:v3" classCode="ACT" moodCode="EVN">
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.4"/>
</act>

Valid XML


<act xmlns="urn:hl7-org:v3" classCode="ACT" moodCode="EVN">
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.4"/>
<id root="root"/>
</act>

0.013
testValidateExternalReferenceText

Constraint

IHE External Reference SHALL contain zero or one [0..1] text

OCL

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

SuccessInvalid XML


<act xmlns="urn:hl7-org:v3" classCode="ACT" moodCode="EVN">
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.4"/>
</act>

Valid XML


<act xmlns="urn:hl7-org:v3" classCode="ACT" moodCode="EVN">
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.4"/>
<text>TextValueHere</text>
</act>

0.013
Properties »