diff --git a/input/fsh/examples/1-NeisseriaGonorrhoeae/1-KsAbc.fsh b/input/fsh/examples/1-NeisseriaGonorrhoeae/1-KsAbc.fsh index e4cfc48..f7a75de 100644 --- a/input/fsh/examples/1-NeisseriaGonorrhoeae/1-KsAbc.fsh +++ b/input/fsh/examples/1-NeisseriaGonorrhoeae/1-KsAbc.fsh @@ -14,7 +14,7 @@ Description: "Example for a CH ELM Practitioner: Orderer" * identifier[GLN].system = "urn:oid:2.51.1.3" * identifier[GLN].value = "7601000234438" * identifier[ZSR].system = "urn:oid:2.16.756.5.30.1.123.100.2.1.1" -* identifier[ZSR].value = "A123262" +* identifier[ZSR].value = "Y604801" * name.family = "Giacometti" * name.given = "Monika" * telecom[email].system = #email diff --git a/input/fsh/invariants.fsh b/input/fsh/invariants.fsh index 2e376e0..0384847 100644 --- a/input/fsh/invariants.fsh +++ b/input/fsh/invariants.fsh @@ -92,3 +92,13 @@ Invariant: name-initials Description: "a name with initials" Severity: #error Expression: "given.exists() and given.first().exists() and (''+given.first()).length() = 1 and family.exists() and (''+family).length() = 1" + +Invariant: ch-elm-practioner-zsr-check-length +Description: "invalid ZSR number, cannot be processed, must be exactly one letter and 6 digits long" +Severity: #warning +Expression: "identifier.where(system='urn:oid:2.16.756.5.30.1.123.100.2.1.1').exists() implies identifier.where(system='urn:oid:2.16.756.5.30.1.123.100.2.1.1').value.matches('^[A-Z][0-9]{6}$').allTrue()" + +Invariant: ch-elm-practioner-zsr-check-digit +Description: "invalid ZSR number, cannot be processed, must pass the modulus 26 check - https://confluence.sasis.ch/display/PublicZSR/ZSR+Webservice+FAQ" +Severity: #warning +Expression: "identifier.where(system='urn:oid:2.16.756.5.30.1.123.100.2.1.1').exists() implies identifier.where(system='urn:oid:2.16.756.5.30.1.123.100.2.1.1').value.select(((substring(1,1).toInteger()*6)+(substring(2,1).toInteger()*5)+(substring(3,1).toInteger()*4)+(substring(4,1).toInteger()*3)+(substring(5,1).toInteger()*2)+(substring(6,1).toInteger()))mod(26)=iif(substring(0,1)='A',1,iif(substring(0,1)='B',2,iif(substring(0,1)='C',3,iif(substring(0,1)='D',4,iif(substring(0,1)='E',5,iif(substring(0,1)='F',6,iif(substring(0,1)='G',7,iif(substring(0,1)='H',8,iif(substring(0,1)='I',9,iif(substring(0,1)='J',10,iif(substring(0,1)='K',11,iif(substring(0,1)='L',12,iif(substring(0,1)='M',13,iif(substring(0,1)='N',14,iif(substring(0,1)='O',15,iif(substring(0,1)='P',16,iif(substring(0,1)='Q',17,iif(substring(0,1)='R',18,iif(substring(0,1)='S',19,iif(substring(0,1)='T',20,iif(substring(0,1)='U',21,iif(substring(0,1)='V',22,iif(substring(0,1)='W',23,iif(substring(0,1)='X',24,iif(substring(0,1)='Y',25,iif(substring(0,1)='Z',26,-1))))))))))))))))))))))))))).allTrue()" \ No newline at end of file diff --git a/input/fsh/profiles/Practitioner.fsh b/input/fsh/profiles/Practitioner.fsh index 8d30f95..b65f777 100644 --- a/input/fsh/profiles/Practitioner.fsh +++ b/input/fsh/profiles/Practitioner.fsh @@ -3,6 +3,7 @@ Parent: ChLabPractitioner Id: ch-elm-practitioner-orderer Title: "CH ELM Practitioner: Orderer" Description: "This CH ELM base profile constrains the Practitioner resource for the orderer." +* obeys ch-elm-practioner-zsr-check-length and ch-elm-practioner-zsr-check-digit * . ^short = "CH ELM Practitioner: Orderer" * identifier ..2 MS * identifier[GLN] ..1 MS diff --git a/input/pagecontent/changelog.md b/input/pagecontent/changelog.md index d23f651..357f631 100644 --- a/input/pagecontent/changelog.md +++ b/input/pagecontent/changelog.md @@ -3,6 +3,8 @@ All significant changes to this FHIR implementation guide will be documented on ### 1.8.0 unreleased * additional publication examples +* [#131](https://github.com/ahdis/ch-elm/issues/131) add check for ZSR number is valid + ### 1.7.0 2024/11/28