Constraint Descriptor : rmim024 (type: ERROR, kind: )

Constraint : rmim024

Constraint Name
rmim024 (type: ERROR, kind: )
Constraint Class
RegionOfInterestSpec
Package
cdabasic
Description
A RegionOfInterest SHALL have an entryRelationship[typeCode="SUBJ"]/observationMedia, or it SHALL be included into an observationMedia/entryRelationship[@typeCode="SUBJ" and @inversionInd="true"], or it SHALL include an external Observation into reference[typeCode="SUBJ"]/ExternalObservation (RMIM-024)
OCL
self.entryRelationship->select(entr : POCDMT000040EntryRelationship| 
	(not entr.typeCode.oclIsUndefined()) and 
	entr.typeCode=XActRelationshipEntryRelationship::SUBJ and 
	(not entr.observationMedia.oclIsUndefined())
)->size()>0 or 
self.reference->select(ref : POCDMT000040Reference | 
	(not ref.externalObservation.oclIsUndefined())
)->size()>0 or 
(
	(not self.__parent.oclIsUndefined()) and 
	self.__parent.oclIsKindOf(POCDMT000040EntryRelationship) and 
	(not self.__parent.oclAsType(POCDMT000040EntryRelationship).typeCode.oclIsUndefined()) and 
	self.__parent.oclAsType(POCDMT000040EntryRelationship).typeCode=XActRelationshipEntryRelationship::SUBJ and 
	(not self.__parent.oclAsType(POCDMT000040EntryRelationship).inversionInd.oclIsUndefined()) and 
	self.__parent.oclAsType(POCDMT000040EntryRelationship).inversionInd=true and 
	(not self.__parent.oclAsType(POCDMT000040EntryRelationship).__parent.oclIsUndefined()) and 
	self.__parent.oclAsType(POCDMT000040EntryRelationship).__parent.oclIsKindOf(POCDMT000040ObservationMedia)
)