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

Constraint : ch_hpd_014_Metadata_attributes

Constraint Name
ch_hpd_014_Metadata_attributes (type: ERROR, kind: )
Package
chhpdAddRequest
Description
Value of attributes HCProfessional.HcProfession and HCProfessional.HcSpecialisation must be provided in the following format : BAG:<CodeSystem>:<Code>[:<DisplayName>]
OCL
self.attr->select(at: DsmlAttr | at.name.toLowerCase() = 'hcprofession').value->forAll(hcprofession : String | 
  				self.matches(hcprofession, '^BAG:[^:]*:[^:]*(:[^:]*)?') and
  				let hcprofession2 : String = hcprofession.substring(5, hcprofession.size()) in
  				let hcprofession3 : String = hcprofession2.substring(hcprofession2.indexOf(':') + 1,hcprofession2.size()) in
  				( 
  					self.matches(hcprofession, '^BAG:[^:]*:[^:]*') implies
  					CommonOperationsStatic::matchesValueSet('2.16.756.5.30.1.127.3.10.8.1', hcprofession3, hcprofession2.substring(1, hcprofession2.indexOf(':') - 1).toLowerCase(), null, null)
  				) and
  				( 
  					self.matches(hcprofession, '^BAG:[^:]*:[^:]*:[^:]*') implies
  					CommonOperationsStatic::matchesValueSet('2.16.756.5.30.1.127.3.10.8.1', hcprofession3.substring(1, hcprofession3.indexOf(':')  - 1), hcprofession2.substring(1, hcprofession2.indexOf(':') - 1).toLowerCase(), null, null)
  				)
  			)
  			
  			and
  			
  			self.attr->select(at: DsmlAttr | at.name.toLowerCase() = 'hcspecialisation').value->forAll(hcprofession : String | 
  				self.matches(hcprofession, '^BAG:[^:]*:[^:]*(:[^:]*)?') and
  				let hcprofession2 : String = hcprofession.substring(5, hcprofession.size()) in
  				let hcprofession3 : String = hcprofession2.substring(hcprofession2.indexOf(':') + 1,hcprofession2.size()) in
  				( 
  					self.matches(hcprofession, '^BAG:[^:]*:[^:]*') implies
  					CommonOperationsStatic::matchesValueSet('2.16.756.5.30.1.127.3.10.8.2', hcprofession3, hcprofession2.substring(1, hcprofession2.indexOf(':') - 1).toLowerCase(), null, null)
  				) and
  				( 
  					self.matches(hcprofession, '^BAG:[^:]*:[^:]*:[^:]*') implies
  					CommonOperationsStatic::matchesValueSet('2.16.756.5.30.1.127.3.10.8.2', hcprofession3.substring(1, hcprofession3.indexOf(':')  - 1), hcprofession2.substring(1, hcprofession2.indexOf(':') - 1).toLowerCase(), null, null)
  				)
  			)