Unit Test Results.

Designed for use with JUnit and Ant.

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

NameTestsErrorsFailuresTime(s)Time StampHost
AlertObservationTest17000.2452013-01-31T13:34:11JKMSoftware-desktop

Tests

NameStatusResultTime(s)
testConstructor

Constraint

OCL

SuccessInvalid XML

Valid XML

0.001
testValidateAlertObservationInformationSource

Constraint

CCD Alert Observation SHALL satisfy: An alert observation contains one or more sources of information. (CONF-269)

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)or (self.entryRelationship->exists(rel : cda::EntryRelationship | rel.typeCode = vocab::x_ActRelationshipEntryRelationship::REFR and rel.observation.code.code = '48766-0'))

SuccessInvalid XML


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

Valid XML


<observation xmlns="urn:hl7-org:v3" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.18"/>
<statusCode code="completed"/>
<informant/>
</observation>

0.078
testValidateAlertObservationAgentRepresentation

Constraint

CCD Alert Observation An alert observation SHOULD contain at least one Observation / participant, representing the agent that is the cause of the allergy or adverse reaction. (CONF-273)

OCL

self.participant->exists(participant : cda::Participant2 | participant.typeCode = vocab::ParticipationType::CSM )

SuccessInvalid XML


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

Valid XML


<observation xmlns="urn:hl7-org:v3" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.18"/>
<statusCode code="completed"/>
<participant typeCode="CSM"/>
</observation>

0.005
testValidateAlertObservationPlayingEntityRequired

Constraint

CCD Alert Observation SHALL satisfy: Contains exactly one participant / participantRole / playingEntity. (CONF-274)

OCL

self.participant.participantRole.playingEntity->size() > 0

SuccessInvalid XML


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

Valid XML


<observation xmlns="urn:hl7-org:v3" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.18"/>
<statusCode code="completed"/>
<participant>
<participantRole>
<playingEntity/>
</participantRole>
</participant>
</observation>

0.031
testValidateAlertObservationAgentRepresentationVocab

Constraint

CCD Alert Observation The value for participant / @typeCode in an agent participation SHALL be "CSM" "Consumable" 2.16.840.1.113883.5.90 ParticipationType STATIC. (CONF-275)

OCL

self.participant->one(entity : cda::Participant2 | entity.typeCode = vocab::ParticipationType::CSM)

SuccessInvalid XML


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

Valid XML


<observation xmlns="urn:hl7-org:v3" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.18"/>
<statusCode code="completed"/>
<participant typeCode="CSM"/>
</observation>

0.004
testValidateAlertObservationParticipantRoleClassCode

Constraint

CCD Alert Observation The value for Observation / participant / participantRole / @classCode in an agent participation SHALL be "MANU" "Manufactured" 2.16.840.1.113883.5.110 RoleClass STATIC. (CONF-276)

OCL

self.participant.participantRole->one(entity : cda::ParticipantRole | entity.classCode = vocab::RoleClassRoot::MANU)

SuccessInvalid XML


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

Valid XML


<observation xmlns="urn:hl7-org:v3" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.18"/>
<statusCode code="completed"/>
<participant>
<participantRole classCode="MANU"/>
</participant>
</observation>

0.004
testValidateAlertObservationPlayingEntityClassCode

Constraint

CCD Alert Observation The value for participant / participantRole / playingEntity / @classCode in an agent participation SHALL be "MMAT" "Manufactured material" 2.16.840.1.113883.5.41 EntityClass STATIC. (CONF-277)

OCL

self.participant.participantRole.playingEntity->one(entity : cda::PlayingEntity | entity.classCode = vocab::EntityClassRoot::MMAT and not entity.code.oclIsUndefined())

SuccessInvalid XML


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

Valid XML


<observation xmlns="urn:hl7-org:v3" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.18"/>
<statusCode code="completed"/>
<participant>
<participantRole>
<playingEntity classCode="MMAT">
<code code="test"/>
</playingEntity>
</participantRole>
</participant>
</observation>

0.007
testValidateAlertObservationPlayingEntityCode

Constraint

CCD Alert Observation SHALL satisfy: Contains exactly one participant / participantRole / playingEntity / code. (CONF-278)

OCL

self.participant.participantRole.playingEntity->one(entity : cda::PlayingEntity | not entity.code.oclIsUndefined())

SuccessInvalid XML


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

Valid XML


<observation xmlns="urn:hl7-org:v3" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.18"/>
<statusCode code="completed"/>
<participant>
<participantRole>
<playingEntity>
<code code="test"/>
</playingEntity>
</participantRole>
</participant>
</observation>

0.005
testValidateAlertObservationPlayingEntityCodeVocab

Constraint

CCD Alert Observation The value for participant / participantRole / playingEntity / code in an agent participation SHOULD be selected from the RxNorm (2.16.840.1.113883.6.88) code system for medications, and from the CDC Vaccine Code (2.16.840.1.113883.6.59) code system for immunizations. (CONF-279)

OCL

self.participant.participantRole.playingEntity->one(entity : cda::PlayingEntity | not entity.code.oclIsUndefined() and (entity.code.codeSystem='2.16.840.1.113883.6.88' xor entity.code.codeSystem='2.16.840.1.113883.6.59'))

SuccessInvalid XML


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

Valid XML


<observation xmlns="urn:hl7-org:v3" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.18"/>
<statusCode code="completed"/>
<participant>
<participantRole>
<playingEntity>
<code code="test" codeSystem="2.16.840.1.113883.6.88"/>
</playingEntity>
</participantRole>
</participant>
</observation>

0.008
testValidateAlertObservationTemplateId

Constraint

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

OCL

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

SuccessInvalid XML


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

Valid XML


<observation xmlns="urn:hl7-org:v3" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.18"/>
<statusCode code="completed"/>
</observation>

0.004
testValidateAlertObservationMoodCode

Constraint

CCD Alert Observation SHALL contain exactly one [1..1] @moodCode="EVN" Event (CodeSystem: 2.16.840.1.113883.5.1001 HL7ActMood) (CONF-263)

OCL

self.moodCode=vocab::x_ActMoodDocumentObservation::EVN

SuccessInvalid XML


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

Valid XML


<observation xmlns="urn:hl7-org:v3" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.18"/>
<statusCode code="completed"/>
</observation>

0.004
testValidateAlertObservationStatusCode

Constraint

CCD Alert Observation SHALL contain exactly one [1..1] statusCode/@code="completed" (CodeSystem: 2.16.840.1.113883.5.14 ActStatus) (CONF-264, CONF-265)

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" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.18"/>
<statusCode code="completed"/>
</observation>

0.012
testValidateAlertObservationEffectiveTime

Constraint

CCD Alert Observation MAY contain zero or one [0..1] effectiveTime (CONF-266)

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" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.18"/>
<statusCode code="completed"/>
<effectiveTime/>
</observation>

0.007
testValidateAlertObservationAlertStatusObservation

Constraint

CCD Alert Observation MAY contain zero or one [0..1] entryRelationship (CONF-270, CONF-271) Contains exactly one [1..1] Alert Status Observation (templateId: 2.16.840.1.113883.10.20.1.39)

OCL

self.entryRelationship->one(entryRelationship : cda::EntryRelationship | not entryRelationship.observation.oclIsUndefined() and entryRelationship.observation.oclIsKindOf(ccd::AlertStatusObservation))

SuccessInvalid XML


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

Valid XML


<observation xmlns="urn:hl7-org:v3" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.18"/>
<statusCode code="completed"/>
<entryRelationship>
<observation/>
</entryRelationship>
</observation>

0.007
testValidateAlertObservationReactionObservation

Constraint

CCD Alert Observation MAY contain at least one [1..*] entryRelationship (CONF-281) Contains @typeCode="MFST" MFST, and Contains exactly one [1..1] Reaction Observation (templateId: 2.16.840.1.113883.10.20.1.54)

OCL

self.entryRelationship->exists(entryRelationship : cda::EntryRelationship | not entryRelationship.observation.oclIsUndefined() and entryRelationship.observation.oclIsKindOf(ccd::ReactionObservation) and entryRelationship.typeCode = vocab::x_ActRelationshipEntryRelationship::MFST)

SuccessInvalid XML


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

Valid XML


<observation xmlns="urn:hl7-org:v3" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.18"/>
<statusCode code="completed"/>
<entryRelationship typeCode="MFST">
<observation/>
</entryRelationship>
</observation>

0.008
testGetAlertStatusObservation

Constraint

OCL

SuccessInvalid XML

Valid XML

0.005
testGetReactionObservations

Constraint

OCL

SuccessInvalid XML

Valid XML

0.004
Properties »