Unit Test Results.

Designed for use with JUnit and Ant.

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

NameTestsErrorsFailuresTime(s)Time StampHost
CommentTest9000.1352013-01-31T13:34:22JKMSoftware-desktop

Tests

NameStatusResultTime(s)
testConstructor

Constraint

OCL

SuccessInvalid XML

Valid XML

0.001
testValidateCommentTemplateId

Constraint

The 'CommentTemplateId' invariant is violated on 'org.openhealthtools.mdht.uml.cda.ihe.impl.CommentImpl@6dad0d6e{#//}'

OCL

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

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.2"/>
<templateId root="2.16.840.1.113883.10.20.1.40"/>
<code code="48767-8" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Annotation comment"/>
<statusCode code="completed"/>
</act>

0.005
testValidateIHECommentHasTextReference

Constraint

IHE Comment SHALL satisfy: The 'text' element contains a 'reference' element pointing to the narrative text section of the CDA, rather than duplicate text to avoid ambiguity. (CONF-6.3.4.6.7)

OCL

not self.text.reference.oclIsUndefined()

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.2"/>
<templateId root="2.16.840.1.113883.10.20.1.40"/>
<code code="48767-8" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Annotation comment"/>
<text><reference/></text>
<statusCode code="completed"/>
</act>

0.008
testValidateIHECommentEffectiveTimeWhenAuthorPresent

Constraint

IHE Comment SHALL satisfy: The time of the comment creation is recorded in the 'time' element when the 'author' element is present. (CONF-6.3.4.6.10)

OCL

not self.author->isEmpty() implies not self.effectiveTime.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.2"/>
<templateId root="2.16.840.1.113883.10.20.1.40"/>
<code code="48767-8" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Annotation comment"/>
<statusCode code="completed"/>
<author/>
</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.2"/>
<templateId root="2.16.840.1.113883.10.20.1.40"/>
<code code="48767-8" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Annotation comment"/>
<statusCode code="completed"/>
<effectiveTime value="time"/>
<author/>
</act>

0.013
testValidateIHECommentHasAuthorId

Constraint

IHE Comment SHALL satisfy: The identifier of the author, and their address and telephone number must be present inside the 'id', 'addr' and 'telecom' elements when the 'author' element is present. (CONF-6.3.4.6.11)

OCL

not self.author->isEmpty() implies ( self.author.assignedAuthor.id ->size() > 0 and self.author.assignedAuthor.addr ->size() > 0 and self.author.assignedAuthor.telecom ->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.2"/>
<templateId root="2.16.840.1.113883.10.20.1.40"/>
<code code="48767-8" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Annotation comment"/>
<statusCode code="completed"/>
<author>
<assignedAuthor/>
</author>
</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.2"/>
<templateId root="2.16.840.1.113883.10.20.1.40"/>
<code code="48767-8" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Annotation comment"/>
<statusCode code="completed"/>
<author>
<assignedAuthor>
<id root="IDHERE"/>
<addr/>
<telecom value="telephonehere"/>
</assignedAuthor>
</author>
</act>

0.029
testValidateIHECommentHasAuthorOrganization

Constraint

IHE Comment SHALL satisfy: The author's and/or the organization's name must be present when the 'author' element is present. (CONF-6.3.4.6.12)

OCL

not self.author->isEmpty() implies ( self.author->exists( a : cda::Author | ( (not a.assignedAuthor.assignedPerson.oclIsUndefined()) and not a.assignedAuthor.assignedPerson.name->isEmpty()) or (not a.assignedAuthor.representedOrganization.name->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.2"/>
<templateId root="2.16.840.1.113883.10.20.1.40"/>
<code code="48767-8" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Annotation comment"/>
<statusCode code="completed"/>
<author>
<assignedAuthor>
<representedOrganization/>
</assignedAuthor>
</author>
</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.2"/>
<templateId root="2.16.840.1.113883.10.20.1.40"/>
<code code="48767-8" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Annotation comment"/>
<statusCode code="completed"/>
<author>
<assignedAuthor>
<representedOrganization>
<name>NAMEOFORANIZATION</name>
</representedOrganization>
</assignedAuthor>
</author>
</act>

0.025
testValidateIHECommentStatusCode

Constraint

IHE Comment SHALL contain exactly one [1..1] statusCode/@code="completed" (CodeSystem: 2.16.840.1.113883.5.14 ActStatus) (CONF-6.3.4.6.8)

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="1.3.6.1.4.1.19376.1.5.3.1.4.2"/>
<templateId root="2.16.840.1.113883.10.20.1.40"/>
<code code="48767-8" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Annotation comment"/>
<statusCode code="completed"/>
</act>

0.025
testValidateIHECommentText

Constraint

IHE Comment SHALL contain exactly one [1..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.2"/>
<templateId root="2.16.840.1.113883.10.20.1.40"/>
<code code="48767-8" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Annotation comment"/>
<statusCode code="completed"/>
</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.2"/>
<templateId root="2.16.840.1.113883.10.20.1.40"/>
<code code="48767-8" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Annotation comment"/>
<text>Comment Text</text>
<statusCode code="completed"/>
</act>

0.013
testValidateIHECommentAuthor

Constraint

IHE Comment MAY contain zero or one [0..1] author Contains exactly one [1..1] CDA Author

OCL

self.author->one(author : cda::Author | not author.oclIsUndefined() and author.oclIsKindOf(rim::Participation))

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.2"/>
<templateId root="2.16.840.1.113883.10.20.1.40"/>
<code code="48767-8" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Annotation comment"/>
<statusCode code="completed"/>
</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.2"/>
<templateId root="2.16.840.1.113883.10.20.1.40"/>
<code code="48767-8" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Annotation comment"/>
<statusCode code="completed"/>
<author/>
</act>

0.010
Properties »