Unit Test Results.

Designed for use with JUnit and Ant.

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

NameTestsErrorsFailuresTime(s)Time StampHost
AdvanceDirectiveObservationTest29000.7612013-01-31T13:34:37JKMSoftware-desktop

Tests

NameStatusResultTime(s)
testConstructor

Constraint

OCL

SuccessInvalid XML

Valid XML

0.001
testValidateAdvanceDirectiveObservationTemplateId

Constraint

SHALL contain exactly one [1..1] templateId ( CONF:8655, CONF:10485 ) such that it SHALL contain exactly one [1..1] @root="2.16.840.1.113883.10.20.22.4.48"

OCL

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

SuccessInvalid XML


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

Valid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.48"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
</observation>

0.008
testValidateAdvanceDirectiveObservationClassCode

Constraint

Consol Advance Directive Observation SHALL contain exactly one [1..1] @classCode="OBS" Observation (CodeSystem: 2.16.840.1.113883.5.6 HL7ActClass) (CONF:8648)

OCL

self.classCode=vocab::ActClassObservation::OBS

SuccessInvalid XML


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

Valid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.48"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
</observation>

0.005
testValidateAdvanceDirectiveObservationMoodCode

Constraint

Consol Advance Directive Observation SHALL contain exactly one [1..1] @moodCode="EVN" Event (CodeSystem: 2.16.840.1.113883.5.1001 HL7ActMood) (CONF:8649)

OCL

self.moodCode=vocab::x_ActMoodDocumentObservation::EVN

SuccessInvalid XML


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

Valid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.48"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
</observation>

0.005
testValidateAdvanceDirectiveObservationId

Constraint

Consol Advance Directive Observation SHALL contain at least one [1..*] id (CONF:8654)

OCL

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

SuccessInvalid XML


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

Valid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.48"/>
<id/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
</observation>

0.020
testValidateAdvanceDirectiveObservationStatusCode

Constraint

Consol Advance Directive Observation SHALL contain exactly one [1..1] statusCode/@code="completed" (CodeSystem: 2.16.840.1.113883.5.14 ActStatus) (CONF:8652)

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


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

Valid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.48"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
</observation>

0.041
testValidateAdvanceDirectiveObservationEffectiveTime

Constraint

Consol Advance Directive Observation SHALL contain exactly one [1..1] effectiveTime (CONF:8656)

OCL

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

SuccessInvalid XML


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

Valid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.48"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
<effectiveTime/>
</observation>

0.022
testValidateAdvanceDirectiveObservationCode

Constraint

Consol Advance Directive Observation SHALL contain exactly one [1..1] code, where the @code SHALL be selected from ValueSet Advance Directive Type Code 2.16.840.1.113883.1.11.20.2 STATIC 1 (CONF:8651)

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.codeSystem = '2.16.840.1.113883.6.96' and (value.code = '281789004' or value.code = '89666000' or value.code = '225204009' or value.code = '52765003' or value.code = '78823007' or value.code = '304251008' or value.code = '61420007' or value.code = '71388002'))

SuccessInvalid XML


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

Valid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.48"/>
<code code="304251008" codeSystem="2.16.840.1.113883.6.96" codeSystemName="" displayName=""/>
<statusCode code="completed"/>
</observation>

0.086
testValidateAdvanceDirectiveObservationHasStartingTime

Constraint

Consol Advance Directive Observation This effectiveTime SHALL contain exactly one [1..1] low i. If the starting time is unknown, the <low> element SHALL have the nullFlavor attribute set to UNK (CONF:8657, CONF:8658)

OCL

self.effectiveTime.low.hasContent() or self.effectiveTime.low.isNullFlavorDefined()

SuccessInvalid XML


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

Valid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.48"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
<effectiveTime>
<low value="low"/>
<high value="high"/>
</effectiveTime>
</observation>

0.017
testValidateAdvanceDirectiveObservationHasEndingTime

Constraint

Consol Advance Directive Observation This effectiveTime SHALL contain exactly one [1..1] high. i. If the ending time is unknown, the <high> element SHALL have the nullFlavor attribute set to UNK. ii. If the Advance Directive does not have a specified ending time, the <high> element SHALL have the nullFlavor attribute set to NA. (CONF:8659, CONF:8660)

OCL

self.effectiveTime.high.hasContent() or self.effectiveTime.high.isNullFlavorDefined()

SuccessInvalid XML


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

Valid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.48"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
<effectiveTime>
<low value="low"/>
<high value="high"/>
</effectiveTime>
</observation>

0.015
testValidateAdvanceDirectiveObservationVerifier

Constraint

Consol Advance Directive Observation SHOULD contain at least one [1..*] participant (CONF:8662)

OCL

self.participant->select(participant : cda::Participant2 | not participant.oclIsUndefined() and participant.oclIsKindOf(cda::Participant2))->select(typeCode=vocab::ParticipationType::VRF)->notEmpty()

SuccessInvalid XML


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

Valid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.48"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
<participant typeCode="VRF"/>
</observation>

0.021
testValidateAdvanceDirectiveObservationCustodian

Constraint

Consol Advance Directive Observation SHOULD contain exactly one [1..1] participant (CONF:8667)

OCL

self.participant->select(participant : cda::Participant2 | not participant.oclIsUndefined() and participant.oclIsKindOf(cda::Participant2))->select(typeCode=vocab::ParticipationType::CST)->size() = 1

SuccessInvalid XML


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

Valid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.48"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
<participant typeCode="CST"/>
</observation>

0.024
testValidateAdvanceDirectiveObservationReference

Constraint

Consol Advance Directive Observation SHOULD contain at least one [1..*] reference (CONF:8692)

OCL

self.reference->exists(reference : cda::Reference | not reference.oclIsUndefined() and reference.oclIsKindOf(cda::Reference))

SuccessInvalid XML


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

Valid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.48"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
<reference>
<externalDocument/>
</reference>
</observation>

0.013
testValidateAdvanceDirectiveObservationVerifierTime

Constraint

Consol Advance Directive Observation SHOULD contain at least one [1..*] participant (CONF:8662) verifier SHALL contain exactly one [1..1] time (CONF:8665)

OCL

self.participant->excluding(null)->select(typeCode=vocab::ParticipationType::VRF)->select(typeCode=vocab::ParticipationType::VRF)->reject((time.oclIsUndefined() or time.isNullFlavorUndefined()) implies (not time.oclIsUndefined()))

SuccessInvalid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.48"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
<participant typeCode="VRF"/>
</observation>

Valid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.48"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
<participant typeCode="VRF">
<time/>
</participant>
</observation>

0.039
testValidateAdvanceDirectiveObservationVerifierTypeCode

Constraint

OCL

self.participant->excluding(null)->select(typeCode=vocab::ParticipationType::VRF)->select(typeCode=vocab::ParticipationType::VRF)->reject(isDefined('typeCode'))

SuccessInvalid XML


Skip Fail Test

Valid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.48"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
<participant typeCode="VRF"/>
</observation>

0.017
testValidateAdvanceDirectiveObservationVerifierParticipantRole

Constraint

Consol Advance Directive Observation SHOULD contain at least one [1..*] participant (CONF:8662) verifier SHALL contain exactly one [1..1] participantRole, where its type is CDA Participant Role (CONF:8666)

OCL

self.participant->excluding(null)->select(typeCode=vocab::ParticipationType::VRF)->select(typeCode=vocab::ParticipationType::VRF)->reject(participantRole->one(participantRole : cda::ParticipantRole | not participantRole.oclIsUndefined() and participantRole.oclIsKindOf(rim::Role)))

SuccessInvalid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.48"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
<participant typeCode="VRF"/>
</observation>

Valid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.48"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
<participant typeCode="VRF">
<participantRole>
<telecom/>
<playingEntity/>
</participantRole>
</participant>
</observation>

0.028
testValidateAdvanceDirectiveObservationCustodianCustodianRoleCustodianEntityName

Constraint

Consol Advance Directive Observation SHOULD contain exactly one [1..1] participant (CONF:8667) each SHALL contain exactly one [1..1] participantRole, where (CONF:8669) each SHALL contain exactly one [1..1] playingEntity, where (ii., CONF:8824) playingEntity SHALL contain at least one [1..*] name (CONF:8673)

OCL

self.participant->excluding(null)->select(typeCode=vocab::ParticipationType::CST).participantRole->excluding(null).playingEntity->excluding(null)->reject((name->isEmpty() or name->exists(element | element.isNullFlavorUndefined())) implies (not name->isEmpty()))

SuccessInvalid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.48"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
<participant typeCode="CST">
<participantRole classCode="ROL">
<addr/>
<playingEntity/>
</participantRole>
</participant>
</observation>

Valid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.48"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
<participant typeCode="CST">
<participantRole classCode="ROL">
<addr/>
<playingEntity>
<name/>
</playingEntity>
</participantRole>
</participant>
</observation>

0.041
testValidateAdvanceDirectiveObservationCustodianCustodianRoleAddr

Constraint

Consol Advance Directive Observation SHOULD contain exactly one [1..1] participant (CONF:8667) each SHALL contain exactly one [1..1] participantRole, where (CONF:8669) advanceDirectiveObservationCustodianRole SHOULD contain exactly one [1..1] addr (CONF:8671)

OCL

self.participant->excluding(null)->select(typeCode=vocab::ParticipationType::CST).participantRole->excluding(null)->reject((addr->isEmpty() or addr->exists(element | element.isNullFlavorUndefined())) implies (addr->size() = 1))

SuccessInvalid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.48"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
<participant typeCode="CST">
<participantRole classCode="ROL">
<playingEntity/>
</participantRole>
</participant>
</observation>

Valid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.48"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
<participant typeCode="CST">
<participantRole classCode="ROL">
<addr/>
<playingEntity/>
</participantRole>
</participant>
</observation>

0.039
testValidateAdvanceDirectiveObservationCustodianCustodianRoleClassCode

Constraint

Consol Advance Directive Observation SHOULD contain exactly one [1..1] participant (CONF:8667) each SHALL contain exactly one [1..1] participantRole, where (CONF:8669) advanceDirectiveObservationCustodianRole SHALL contain exactly one [1..1] @classCode="AGNT" (CONF:8670)

OCL

self.participant->excluding(null)->select(typeCode=vocab::ParticipationType::CST).participantRole->excluding(null)->reject(isDefined('classCode') and classCode=vocab::RoleClassRoot::AGNT)

SuccessInvalid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.48"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
<participant typeCode="CST">
<participantRole>
<playingEntity/>
</participantRole>
</participant>
</observation>

Valid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.48"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
<participant typeCode="CST">
<participantRole classCode="AGNT">
<playingEntity/>
</participantRole>
</participant>
</observation>

0.024
testValidateAdvanceDirectiveObservationCustodianCustodianRoleTelecom

Constraint

Consol Advance Directive Observation SHOULD contain exactly one [1..1] participant (CONF:8667) each SHALL contain exactly one [1..1] participantRole, where (CONF:8669) advanceDirectiveObservationCustodianRole SHOULD contain exactly one [1..1] telecom (CONF:8672)

OCL

self.participant->excluding(null)->select(typeCode=vocab::ParticipationType::CST).participantRole->excluding(null)->reject((telecom->isEmpty() or telecom->exists(element | element.isNullFlavorUndefined())) implies (telecom->size() = 1))

SuccessInvalid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.48"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
<participant typeCode="CST">
<participantRole classCode="ROL">
<addr/>
<playingEntity/>
</participantRole>
</participant>
</observation>

Valid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.48"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
<participant typeCode="CST">
<participantRole>
<telecom/>
<playingEntity/>
</participantRole>
</participant>
</observation>

0.038
testValidateAdvanceDirectiveObservationCustodianCustodianRolePlayingEntity

Constraint

Consol Advance Directive Observation SHOULD contain exactly one [1..1] participant (CONF:8667) each SHALL contain exactly one [1..1] participantRole, where (CONF:8669) advanceDirectiveObservationCustodianRole SHALL contain exactly one [1..1] playingEntity, where its type is Custodian Entity (ii., CONF:8824)

OCL

self.participant->excluding(null)->select(typeCode=vocab::ParticipationType::CST).participantRole->excluding(null)->reject(playingEntity->one(playingEntity : cda::PlayingEntity | not playingEntity.oclIsUndefined() and playingEntity.oclIsKindOf(cda::PlayingEntity)))

SuccessInvalid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.48"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
<participant typeCode="CST">
<participantRole/>
</participant>
</observation>

Valid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.48"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
<participant typeCode="CST">
<participantRole>
<playingEntity/>
</participantRole>
</participant>
</observation>

0.027
testValidateAdvanceDirectiveObservationCustodianTypeCode

Constraint

OCL

self.participant->excluding(null)->select(typeCode=vocab::ParticipationType::CST)->select(typeCode=vocab::ParticipationType::CST)->reject(typeCode=vocab::ParticipationType::CST)

SuccessInvalid XML


Skip Fail Test

Valid XML


<observation xmlns="urn:hl7-org:v3">
<participant typeCode="CST"/>
</observation>

0.017
testValidateAdvanceDirectiveObservationCustodianAdvanceDirectiveObservationCustodianRole

Constraint

Consol Advance Directive Observation SHOULD contain exactly one [1..1] participant (CONF:8667) custodian SHALL contain exactly one [1..1] participantRole, where its type is Custodian Role (CONF:8669)

OCL

self.participant->excluding(null)->select(typeCode=vocab::ParticipationType::CST)->select(typeCode=vocab::ParticipationType::CST)->reject(participantRole->one(participantRole : cda::ParticipantRole | not participantRole.oclIsUndefined() and participantRole.oclIsKindOf(cda::ParticipantRole)))

SuccessInvalid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.48"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
<participant typeCode="CST"/>
</observation>

Valid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.48"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
<participant typeCode="CST">
<participantRole/>
</participant>
</observation>

0.041
testValidateAdvanceDirectiveObservationReferenceExternalDocumentTextMediaType

Constraint

Consol Advance Directive Observation SHOULD contain at least one [1..*] reference (CONF:8692) each SHALL contain exactly one [1..1] externalDocument, where (CONF:8693) externalDocument The text, if present, MAY contain zero or one [0..1] @mediaType (CONF:8703)

OCL

self.reference->excluding(null).externalDocument->excluding(null)->reject(not text.mediaType.oclIsUndefined())

SuccessInvalid XML


<observation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.48"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
<reference>
<externalDocument>
<text><mediaType xsi:nil="true"/></text>
</externalDocument>
</reference>
</observation>

Valid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.48"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
<reference>
<externalDocument>
<text mediaType="JPEG"/>
</externalDocument>
</reference>
</observation>

0.019
testValidateAdvanceDirectiveObservationReferenceExternalDocumentTextReference

Constraint

Consol Advance Directive Observation SHOULD contain at least one [1..*] reference (CONF:8692) each SHALL contain exactly one [1..1] externalDocument, where (CONF:8693) externalDocument The text, if present, MAY contain zero or one [0..1] reference. a. The URL of a referenced advance directive document MAY be present, and SHALL be represented in Observation/reference/ExternalDocument/text/reference. b. If a URL is referenced, then it SHOULD have a corresponding linkHTML element in narrative block. (CONF:8697, CONF:8698, CONF:8699)

OCL

self.reference->excluding(null).externalDocument->excluding(null)->reject(not text.oclIsUndefined() implies not text.reference.oclIsUndefined())

SuccessInvalid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.48"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
<reference>
<externalDocument>
<text/>
</externalDocument>
</reference>
</observation>

Valid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.48"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
<reference>
<externalDocument>
<text><reference/></text>
</externalDocument>
</reference>
</observation>

0.028
testValidateAdvanceDirectiveObservationReferenceExternalDocumentId

Constraint

Consol Advance Directive Observation SHOULD contain at least one [1..*] reference (CONF:8692) each SHALL contain exactly one [1..1] externalDocument, where (CONF:8693) externalDocument SHALL contain at least one [1..*] id (CONF:8695)

OCL

self.reference->excluding(null).externalDocument->excluding(null)->reject((id->isEmpty() or id->exists(element | element.isNullFlavorUndefined())) implies (not id->isEmpty()))

SuccessInvalid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.48"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
<reference>
<externalDocument/>
</reference>
</observation>

Valid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.48"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
<reference>
<externalDocument>
<id/>
</externalDocument>
</reference>
</observation>

0.033
testValidateAdvanceDirectiveObservationReferenceExternalDocumentText

Constraint

Consol Advance Directive Observation SHOULD contain at least one [1..*] reference (CONF:8692) each SHALL contain exactly one [1..1] externalDocument, where (CONF:8693) externalDocument MAY contain zero or one [0..1] text (CONF:8696)

OCL

self.reference->excluding(null).externalDocument->excluding(null)->reject((text.oclIsUndefined() or text.isNullFlavorUndefined()) implies (not text.oclIsUndefined()))

SuccessInvalid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.48"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
<reference>
<externalDocument/>
</reference>
</observation>

Valid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.48"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
<reference>
<externalDocument>
<text/>
</externalDocument>
</reference>
</observation>

0.032
testValidateAdvanceDirectiveObservationReferenceTypeCode

Constraint

Consol Advance Directive Observation SHOULD contain at least one [1..*] reference (CONF:8692) reference SHALL contain exactly one [1..1] @typeCode/@code="REFR" (CodeSystem: 2.16.840.1.113883.5.1002 HL7ActRelationshipType) (CONF:8694)

OCL

self.reference->excluding(null)->reject(not typeCode.oclIsUndefined() and typeCode.oclIsKindOf(vocab::x_ActRelationshipExternalReference) and let value : vocab::x_ActRelationshipExternalReference = typeCode.oclAsType(vocab::x_ActRelationshipExternalReference) in value = vocab::x_ActRelationshipExternalReference::REFR)

SuccessInvalid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.48"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
<reference>
<externalDocument/>
</reference>
</observation>

Valid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.48"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
<reference typeCode="REFR">
<externalDocument/>
</reference>
</observation>

0.029
testValidateAdvanceDirectiveObservationReferenceExternalDocument

Constraint

Consol Advance Directive Observation SHOULD contain at least one [1..*] reference (CONF:8692) reference SHALL contain exactly one [1..1] externalDocument, where its type is External Document (CONF:8693)

OCL

self.reference->excluding(null)->reject(externalDocument->one(externalDocument : cda::ExternalDocument | not externalDocument.oclIsUndefined() and externalDocument.oclIsKindOf(cda::ExternalDocument)))

SuccessInvalid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.48"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
<reference/>
</observation>

Valid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.48"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
<reference>
<externalDocument/>
</reference>
</observation>

0.019
Properties »