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

Constraint : constraint_pharmdis_DispenseItemEntry_entryRelationship_substanceAdministration_entryRelationship_act_code

Constraint Name
constraint_pharmdis_DispenseItemEntry_entryRelationship_substanceAdministration_entryRelationship_act_code (type: ERROR, kind: )
Constraint Class
DispenseItemEntry
Package
ihedis
Description
The value for “Act/code/@NullFlavor” of an internal reference (templateId 1.3.6.1.4.1.19376.1.5.3.1.4.4.1) of prescription item entry content module in the dispense item entry SHALL be “MSK” or “NA”. (IHE DIS, 6.3.4.5.3.9)
OCL
self.entryRelationship->select(enresh : POCDMT000040EntryRelationship | 
	(not enresh.substanceAdministration.oclIsUndefined()) and 
	enresh.substanceAdministration.templateId->exists(ii : II | not ii.root.oclIsUndefined() and 
		ii.root='1.3.6.1.4.1.19376.1.9.1.3.2'
	)
)->forAll(enresh : POCDMT000040EntryRelationship | 
	enresh.substanceAdministration.entryRelationship->select(enrel : POCDMT000040EntryRelationship | 
	 	not enrel.act.oclIsUndefined() and 
	 	enrel.act.templateId->exists(ii : II | not ii.root.oclIsUndefined() and
		 	ii.root='1.3.6.1.4.1.19376.1.5.3.1.4.4.1'
		 )
	)->forAll(enrel : POCDMT000040EntryRelationship |  
	 	 enrel.act.code.oclIsUndefined() or 
	 	 enrel.act.code.nullFlavor.oclIsUndefined() or  
	 	enrel.act.code.nullFlavor=NullFlavor::MSK or
	 	enrel.act.code.nullFlavor=NullFlavor::NA
	)
)