Unit Test Results.

Designed for use with JUnit and Ant.

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

NameTestsErrorsFailuresTime(s)Time StampHost
CommentActivityTest24000.8652013-01-31T13:34:44JKMSoftware-desktop

Tests

NameStatusResultTime(s)
testConstructor

Constraint

OCL

SuccessInvalid XML

Valid XML

0.001
testValidateCommentActivityTextReference

Constraint

Consol Comment Activity text SHALL contain exactly one [1..1] reference (CONF:15967)

OCL

not self.text.oclIsUndefined() implies self.text->forAll(reference->size() = 1)

SuccessInvalid XML


<act xmlns="urn:hl7-org:v3" classCode="ACT" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.64"/>
<code code="48767-8" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Annotation comment"/>
<text/>
</act>

Valid XML


<act xmlns="urn:hl7-org:v3" classCode="ACT" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.64"/>
<code code="48767-8" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Annotation comment"/>
<text><reference value="test"/></text>
</act>

0.026
testValidateCommentActivityTextReferenceValue

Constraint

Consol Comment Activity reference SHALL contain exactly one [1..1] @value (CONF:15968)

OCL

self.text->forAll(reference->size() = 1) implies self.text->forAll(reference->one(value->size() = 1))

SuccessInvalid XML


<act xmlns="urn:hl7-org:v3" classCode="ACT" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.64"/>
<code code="48767-8" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Annotation comment"/>
<text><reference/></text>
</act>

Valid XML


<act xmlns="urn:hl7-org:v3" classCode="ACT" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.64"/>
<code code="48767-8" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Annotation comment"/>
<text><reference value="test"/></text>
</act>

0.033
testValidateCommentActivityReferenceValue

Constraint

Consol Comment Activity reference/@value SHALL begin with a '#' and SHALL point to its corresponding narrative (using the approach defined in CDA Release 2, section 4.3.5.1) (CONF:15969)

OCL

not self.text.reference.value.oclIsUndefined() implies not self.getSection().text.getText(self.text.reference.value.substring(2, self.text.reference.value.size())).oclIsUndefined()

SuccessInvalid XML


<section xmlns="urn:hl7-org:v3">
<templateId root="2.16.840.1.113883.10.20.2.5"/>
<code code="10210-3" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="GENERAL STATUS"/>
<text><content ID="">
No particular health status observed.
</content></text>
<entry>
<act classCode="ACT" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.64"/>
<code code="48767-8" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Annotation comment"/>
<text>Some sample text<reference value="#1.2.3.4"/></text>
</act>
</entry>
</section>

Valid XML


<section xmlns="urn:hl7-org:v3">
<templateId root="2.16.840.1.113883.10.20.2.5"/>
<code code="10210-3" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="GENERAL STATUS"/>
<text><content ID="1.2.3.4">
No particular health status observed.
</content></text>
<entry>
<act classCode="ACT" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.64"/>
<code code="48767-8" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Annotation comment"/>
<text>Some sample text<reference value="#1.2.3.4"/></text>
</act>
</entry>
</section>

0.044
testValidateCommentActivityTemplateId

Constraint

SHALL contain exactly one [1..1] templateId ( CONF:9427, CONF:10491 ) such that it SHALL contain exactly one [1..1] @root="2.16.840.1.113883.10.20.22.4.64"

OCL

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

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.22.4.64"/>
<code code="48767-8" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Annotation comment"/>
</act>

0.008
testValidateCommentActivityClassCode

Constraint

Consol Comment Activity SHALL contain exactly one [1..1] @classCode="ACT" Act (CodeSystem: 2.16.840.1.113883.5.6 HL7ActClass) (CONF:9425)

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.22.4.64"/>
<code code="48767-8" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Annotation comment"/>
</act>

0.005
testValidateCommentActivityMoodCode

Constraint

Consol Comment Activity SHALL contain exactly one [1..1] @moodCode="EVN" Event (CodeSystem: 2.16.840.1.113883.5.1001 HL7ActMood) (CONF:9426)

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.22.4.64"/>
<code code="48767-8" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Annotation comment"/>
</act>

0.006
testValidateCommentActivityCode

Constraint

Consol Comment Activity SHALL contain exactly one [1..1] code/@code="48767-8" Annotation comment (CodeSystem: 2.16.840.1.113883.6.1 LOINC) (CONF:9428)

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 = '48767-8' and value.codeSystem = '2.16.840.1.113883.6.1')

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.22.4.64"/>
<code code="48767-8" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Annotation comment"/>
</act>

0.047
testValidateCommentActivityText

Constraint

Consol Comment Activity SHALL contain exactly one [1..1] text (CONF:9430)

OCL

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

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.22.4.64"/>
<code code="48767-8" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Annotation comment"/>
<text/>
</act>

0.023
testValidateCommentActivityAuthor

Constraint

Consol Comment Activity MAY contain zero or one [0..1] author (CONF:9433)

OCL

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

SuccessInvalid XML


<act xmlns="urn:hl7-org:v3" classCode="ACT" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.64"/>
<code code="48767-8" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Annotation comment"/>
</act>

Valid XML


<act xmlns="urn:hl7-org:v3" classCode="ACT" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.64"/>
<code code="48767-8" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Annotation comment"/>
<author/>
</act>

0.017
testValidateCommentActivityAuthorAssignedAuthorUSRealmAddressStreet

Constraint

Consol Comment Activity MAY contain zero or one [0..1] author (CONF:9433) each SHALL contain exactly one [1..1] assignedAuthor, where (CONF:9435) each SHALL contain exactly one [1..1] addr with data type USRealmAddress (CONF:9437) addr SHALL contain at least one and not more than 4 streetAddressLine (CONF:7291)

OCL

self.author->excluding(null).assignedAuthor->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject(isNullFlavorUndefined() implies ( streetAddressLine->size() >=1 and streetAddressLine->size() <=4))

SuccessInvalid XML


<act xmlns="urn:hl7-org:v3" classCode="ACT" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.64"/>
<code code="48767-8" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Annotation comment"/>
<author>
<assignedAuthor>
<addr><streetAddressLine>123</streetAddressLine><streetAddressLine>123</streetAddressLine><streetAddressLine>123</streetAddressLine><streetAddressLine>123</streetAddressLine><streetAddressLine>123</streetAddressLine></addr>
</assignedAuthor>
</author>
</act>

<act xmlns="urn:hl7-org:v3" classCode="ACT" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.64"/>
<code code="48767-8" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Annotation comment"/>
<author>
<assignedAuthor>
<addr/>
</assignedAuthor>
</author>
</act>

Valid XML


<act xmlns="urn:hl7-org:v3">
<author>
<assignedAuthor>
<addr use="HP"><streetAddressLine>123 Main Street</streetAddressLine><city>Boston</city><state>MA</state><country>US</country><postalCode>01001</postalCode></addr>
</assignedAuthor>
</author>
</act>

0.054
testValidateCommentActivityAuthorAssignedAuthorUSRealmAddressCity

Constraint

Consol Comment Activity MAY contain zero or one [0..1] author (CONF:9433) each SHALL contain exactly one [1..1] assignedAuthor, where (CONF:9435) each SHALL contain exactly one [1..1] addr with data type USRealmAddress (CONF:9437) addr SHALL contain exactly one [1..1] city (CONF:7292)

OCL

self.author->excluding(null).assignedAuthor->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies ((city->isEmpty() or city->exists(element | element.isNullFlavorUndefined())) implies (city->size() = 1) )))

SuccessInvalid XML


<act xmlns="urn:hl7-org:v3" classCode="ACT" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.64"/>
<code code="48767-8" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Annotation comment"/>
<author>
<time/>
<assignedAuthor>
<addr/>
</assignedAuthor>
</author>
</act>

Valid XML


<act xmlns="urn:hl7-org:v3" classCode="ACT" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.64"/>
<code code="48767-8" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Annotation comment"/>
<author>
<time/>
<assignedAuthor>
<addr use="HP"><streetAddressLine>123 Main Street</streetAddressLine><city>Boston</city><state>MA</state><country>US</country><postalCode>01001</postalCode></addr>
</assignedAuthor>
</author>
</act>

0.054
testValidateCommentActivityAuthorAssignedAuthorUSRealmAddressCountry

Constraint

Consol Comment Activity MAY contain zero or one [0..1] author (CONF:9433) each SHALL contain exactly one [1..1] assignedAuthor, where (CONF:9435) each SHALL contain exactly one [1..1] addr with data type USRealmAddress (CONF:9437) addr SHOULD contain zero or one [0..1] country (CONF:7295)

OCL

self.author->excluding(null).assignedAuthor->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies ((country->isEmpty() or country->exists(element | element.isNullFlavorUndefined())) implies (not country->isEmpty()) )))

SuccessInvalid XML


<act xmlns="urn:hl7-org:v3" classCode="ACT" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.64"/>
<code code="48767-8" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Annotation comment"/>
<author>
<time/>
<assignedAuthor>
<addr/>
</assignedAuthor>
</author>
</act>

Valid XML


<act xmlns="urn:hl7-org:v3" classCode="ACT" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.64"/>
<code code="48767-8" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Annotation comment"/>
<author>
<time/>
<assignedAuthor>
<addr use="HP"><streetAddressLine>123 Main Street</streetAddressLine><city>Boston</city><state>MA</state><country>US</country><postalCode>01001</postalCode></addr>
</assignedAuthor>
</author>
</act>

0.053
testValidateCommentActivityAuthorAssignedAuthorUSRealmAddressPostalCode

Constraint

Consol Comment Activity MAY contain zero or one [0..1] author (CONF:9433) each SHALL contain exactly one [1..1] assignedAuthor, where (CONF:9435) each SHALL contain exactly one [1..1] addr with data type USRealmAddress (CONF:9437) addr SHOULD contain zero or one [0..1] postalCode (CONF:7294)

OCL

self.author->excluding(null).assignedAuthor->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies ((postalCode->isEmpty() or postalCode->exists(element | element.isNullFlavorUndefined())) implies (not postalCode->isEmpty()) )))

SuccessInvalid XML


<act xmlns="urn:hl7-org:v3" classCode="ACT" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.64"/>
<code code="48767-8" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Annotation comment"/>
<author>
<time/>
<assignedAuthor>
<addr/>
</assignedAuthor>
</author>
</act>

Valid XML


<act xmlns="urn:hl7-org:v3" classCode="ACT" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.64"/>
<code code="48767-8" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Annotation comment"/>
<author>
<time/>
<assignedAuthor>
<addr use="HP"><streetAddressLine>123 Main Street</streetAddressLine><city>Boston</city><state>MA</state><country>US</country><postalCode>01001</postalCode></addr>
</assignedAuthor>
</author>
</act>

0.052
testValidateCommentActivityAuthorAssignedAuthorUSRealmAddressState

Constraint

Consol Comment Activity MAY contain zero or one [0..1] author (CONF:9433) each SHALL contain exactly one [1..1] assignedAuthor, where (CONF:9435) each SHALL contain exactly one [1..1] addr with data type USRealmAddress (CONF:9437) addr SHOULD contain zero or one [0..1] state (CONF:7293)

OCL

self.author->excluding(null).assignedAuthor->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies ((state->isEmpty() or state->exists(element | element.isNullFlavorUndefined())) implies (not state->isEmpty()) )))

SuccessInvalid XML


<act xmlns="urn:hl7-org:v3" classCode="ACT" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.64"/>
<code code="48767-8" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Annotation comment"/>
<author>
<time/>
<assignedAuthor>
<addr/>
</assignedAuthor>
</author>
</act>

Valid XML


<act xmlns="urn:hl7-org:v3" classCode="ACT" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.64"/>
<code code="48767-8" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Annotation comment"/>
<author>
<time/>
<assignedAuthor>
<addr use="HP"><streetAddressLine>123 Main Street</streetAddressLine><city>Boston</city><state>MA</state><country>US</country><postalCode>01001</postalCode></addr>
</assignedAuthor>
</author>
</act>

0.052
testValidateCommentActivityAuthorAssignedAuthorUSRealmAddressStreetAddressLine

Constraint

Consol Comment Activity MAY contain zero or one [0..1] author (CONF:9433) each SHALL contain exactly one [1..1] assignedAuthor, where (CONF:9435) each SHALL contain exactly one [1..1] addr with data type USRealmAddress (CONF:9437) addr SHALL contain at least one [1..*] streetAddressLine (CONF:7291)

OCL

self.author->excluding(null).assignedAuthor->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies ((streetAddressLine->isEmpty() or streetAddressLine->exists(element | element.isNullFlavorUndefined())) implies (not streetAddressLine->isEmpty()) )))

SuccessInvalid XML


<act xmlns="urn:hl7-org:v3" classCode="ACT" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.64"/>
<code code="48767-8" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Annotation comment"/>
<author>
<time/>
<assignedAuthor>
<addr/>
</assignedAuthor>
</author>
</act>

Valid XML


<act xmlns="urn:hl7-org:v3" classCode="ACT" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.64"/>
<code code="48767-8" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Annotation comment"/>
<author>
<time/>
<assignedAuthor>
<addr use="HP"><streetAddressLine>123 Main Street</streetAddressLine><city>Boston</city><state>MA</state><country>US</country><postalCode>01001</postalCode></addr>
</assignedAuthor>
</author>
</act>

0.052
testValidateCommentActivityAuthorAssignedAuthorUSRealmAddressUseP

Constraint

Consol Comment Activity MAY contain zero or one [0..1] author (CONF:9433) each SHALL contain exactly one [1..1] assignedAuthor, where (CONF:9435) each SHALL contain exactly one [1..1] addr with data type USRealmAddress (CONF:9437) addr SHOULD contain zero or one [0..1] @use (CONF:7290), where the @code SHALL be selected from ValueSet PostalAddressUse 2.16.840.1.113883.1.11.10637 STATIC

OCL

self.author->excluding(null).assignedAuthor->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies (not use->isEmpty() )))

SuccessInvalid XML


<act xmlns="urn:hl7-org:v3" classCode="ACT" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.64"/>
<code code="48767-8" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Annotation comment"/>
<author>
<time/>
<assignedAuthor>
<addr/>
</assignedAuthor>
</author>
</act>

Valid XML


<act xmlns="urn:hl7-org:v3" classCode="ACT" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.64"/>
<code code="48767-8" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Annotation comment"/>
<author>
<time/>
<assignedAuthor>
<addr use="HP"><streetAddressLine>123 Main Street</streetAddressLine><city>Boston</city><state>MA</state><country>US</country><postalCode>01001</postalCode></addr>
</assignedAuthor>
</author>
</act>

0.033
testValidateCommentActivityAuthorAssignedAuthorUSRealmAddressUse

Constraint

Consol Comment Activity MAY contain zero or one [0..1] author (CONF:9433) each SHALL contain exactly one [1..1] assignedAuthor, where (CONF:9435) each SHALL contain exactly one [1..1] addr with data type USRealmAddress (CONF:9437) addr SHOULD contain zero or one [0..1] @use (CONF:7290), where the @code SHALL be selected from ValueSet PostalAddressUse 2.16.840.1.113883.1.11.10637 STATIC

OCL

self.author->excluding(null).assignedAuthor->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies (use->forAll(element | not element.oclIsUndefined() and element.oclIsKindOf(vocab::PostalAddressUse) and let value : vocab::PostalAddressUse = element.oclAsType(vocab::PostalAddressUse) in value = vocab::PostalAddressUse::BAD or value = vocab::PostalAddressUse::DIR or value = vocab::PostalAddressUse::H or value = vocab::PostalAddressUse::HP or value = vocab::PostalAddressUse::HV or value = vocab::PostalAddressUse::PHYS or value = vocab::PostalAddressUse::PST or value = vocab::PostalAddressUse::PUB or value = vocab::PostalAddressUse::TMP or value = vocab::PostalAddressUse::WP) )))

SuccessInvalid XML


<act xmlns="urn:hl7-org:v3" classCode="ACT" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.64"/>
<code code="48767-8" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Annotation comment"/>
<author>
<time/>
<assignedAuthor>
<addr use=""/>
</assignedAuthor>
</author>
</act>

Valid XML


<act xmlns="urn:hl7-org:v3" classCode="ACT" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.64"/>
<code code="48767-8" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Annotation comment"/>
<author>
<time/>
<assignedAuthor>
<addr use="HP"><streetAddressLine>123 Main Street</streetAddressLine><city>Boston</city><state>MA</state><country>US</country><postalCode>01001</postalCode></addr>
</assignedAuthor>
</author>
</act>

0.091
testValidateCommentActivityAuthorAssignedAuthorHasPersonOrOrganization

Constraint

Consol Comment Activity MAY contain zero or one [0..1] author (CONF:9433) each SHALL contain exactly one [1..1] assignedAuthor, where (CONF:9435) assignedAuthor SHALL satisfy: include assignedPerson/name or representedOrganization/name (CONF:9438)

OCL

self.author->excluding(null).assignedAuthor->excluding(null)->reject(assignedPerson->one(element | not element.oclIsUndefined() and element.name->size() = 1) xor representedOrganization->one(element | not element.oclIsUndefined() and element.name->size() = 1))

SuccessInvalid XML


<act xmlns="urn:hl7-org:v3" classCode="ACT" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.64"/>
<code code="48767-8" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Annotation comment"/>
<author>
<assignedAuthor/>
</author>
</act>

Valid XML


<act xmlns="urn:hl7-org:v3" classCode="ACT" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.64"/>
<code code="48767-8" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Annotation comment"/>
<author>
<time/>
<assignedAuthor>
<assignedPerson>
<name/>
</assignedPerson>
</assignedAuthor>
</author>
</act>

0.055
testValidateCommentActivityAuthorAssignedAuthorAssignPersonName

Constraint

OCL

self.author->excluding(null).assignedAuthor->excluding(null)->reject(assignedPerson.name->forAll(name | name.oclIsTypeOf(datatypes::PN)))

SuccessInvalid XML


Skip Fail Test

Valid XML


<act xmlns="urn:hl7-org:v3" classCode="ACT" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.64"/>
<code code="48767-8" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Annotation comment"/>
<author>
<time/>
<assignedAuthor>
<assignedPerson>
<name/>
</assignedPerson>
</assignedAuthor>
</author>
</act>

0.019
testValidateCommentActivityAuthorAssignedAuthorAddr

Constraint

Consol Comment Activity MAY contain zero or one [0..1] author (CONF:9433) each SHALL contain exactly one [1..1] assignedAuthor, where (CONF:9435) assignedAuthor SHALL contain exactly one [1..1] addr with data type USRealmAddress (CONF:9437)

OCL

self.author->excluding(null).assignedAuthor->excluding(null)->reject((addr->isEmpty() or addr->exists(element | element.isNullFlavorUndefined())) implies (addr->size() = 1))

SuccessInvalid XML


<act xmlns="urn:hl7-org:v3" classCode="ACT" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.64"/>
<code code="48767-8" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Annotation comment"/>
<author>
<time/>
<assignedAuthor>
<id/>
</assignedAuthor>
</author>
</act>

Valid XML


<act xmlns="urn:hl7-org:v3" classCode="ACT" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.64"/>
<code code="48767-8" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Annotation comment"/>
<author>
<time/>
<assignedAuthor>
<addr/>
</assignedAuthor>
</author>
</act>

0.039
testValidateCommentActivityAuthorAssignedAuthorId

Constraint

Consol Comment Activity MAY contain zero or one [0..1] author (CONF:9433) each SHALL contain exactly one [1..1] assignedAuthor, where (CONF:9435) assignedAuthor SHALL contain at least one [1..*] id (CONF:9196)

OCL

self.author->excluding(null).assignedAuthor->excluding(null)->reject((id->isEmpty() or id->exists(element | element.isNullFlavorUndefined())) implies (id->size() = 1))

SuccessInvalid XML


<act xmlns="urn:hl7-org:v3" classCode="ACT" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.64"/>
<code code="48767-8" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Annotation comment"/>
<author>
<time/>
<assignedAuthor/>
</author>
</act>

Valid XML


<act xmlns="urn:hl7-org:v3" classCode="ACT" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.64"/>
<code code="48767-8" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Annotation comment"/>
<author>
<time/>
<assignedAuthor>
<id/>
</assignedAuthor>
</author>
</act>

0.039
testValidateCommentActivityAuthorTime

Constraint

Consol Comment Activity MAY contain zero or one [0..1] author (CONF:9433) author SHALL contain exactly one [1..1] time (CONF:9434)

OCL

self.author->excluding(null)->reject((time.oclIsUndefined() or time.isNullFlavorUndefined()) implies (not time.oclIsUndefined()))

SuccessInvalid XML


<act xmlns="urn:hl7-org:v3" classCode="ACT" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.64"/>
<code code="48767-8" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Annotation comment"/>
<author/>
</act>

Valid XML


<act xmlns="urn:hl7-org:v3" classCode="ACT" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.64"/>
<code code="48767-8" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Annotation comment"/>
<author>
<time/>
</author>
</act>

0.032
testValidateCommentActivityAuthorAssignedAuthor

Constraint

Consol Comment Activity MAY contain zero or one [0..1] author (CONF:9433) author SHALL contain exactly one [1..1] assignedAuthor, where its type is Assigned Author (CONF:9435)

OCL

self.author->excluding(null)->reject(assignedAuthor->one(assignedAuthor : cda::AssignedAuthor | not assignedAuthor.oclIsUndefined() and assignedAuthor.oclIsKindOf(cda::AssignedAuthor)))

SuccessInvalid XML


<act xmlns="urn:hl7-org:v3" classCode="ACT" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.64"/>
<code code="48767-8" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Annotation comment"/>
<author>
<time/>
</author>
</act>

Valid XML


<act xmlns="urn:hl7-org:v3" classCode="ACT" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.64"/>
<code code="48767-8" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Annotation comment"/>
<author>
<time/>
<assignedAuthor/>
</author>
</act>

0.022
Properties »