Skip to content

Commit

Permalink
add check for ZSR number if first letter is valid or not #131
Browse files Browse the repository at this point in the history
  • Loading branch information
oliveregger committed Dec 12, 2024
1 parent 261ad22 commit de8e22d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion input/fsh/examples/1-NeisseriaGonorrhoeae/1-KsAbc.fsh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 10 additions & 0 deletions input/fsh/invariants.fsh
Original file line number Diff line number Diff line change
Expand Up @@ -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()"
1 change: 1 addition & 0 deletions input/fsh/profiles/Practitioner.fsh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions input/pagecontent/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit de8e22d

Please sign in to comment.