Skip to content

Commit

Permalink
Technical FHIRPath correction value. and Observation.
Browse files Browse the repository at this point in the history
  • Loading branch information
tmsMedcom committed Nov 21, 2023
1 parent f9e7948 commit 9c8bd09
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions input/fsh/CVRIdentifier.fsh
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ Description: "Identifier holding a danish [CVR](https://datacvr.virk.dk/data/) n
Invariant: CVR-length
Description: "CVR must be exactly 8 numeric characters long"
Severity: #error
Expression: "value.matches('^[0-9]{8}$')"
Expression: "matches('^[0-9]{8}$')"

Invariant: CVR-modulus-11
Description: "CVR must pass the modulus 11 check"
Severity: #error
Expression: "((\n (value.substring(0,1).toInteger()*2)+\n (value.substring(1,1).toInteger()*7)+\n (value.substring(2,1).toInteger()*6)+\n (value.substring(3,1).toInteger()*5)+\n (value.substring(4,1).toInteger()*4)+\n (value.substring(5,1).toInteger()*3)+\n (value.substring(6,1).toInteger()*2)+\n (value.substring(7,1).toInteger()*1)) mod(11)=0)"
Expression: "((\n (substring(0,1).toInteger()*2)+\n (substring(1,1).toInteger()*7)+\n (substring(2,1).toInteger()*6)+\n (substring(3,1).toInteger()*5)+\n (substring(4,1).toInteger()*4)+\n (substring(5,1).toInteger()*3)+\n (substring(6,1).toInteger()*2)+\n (substring(7,1).toInteger()*1)) mod(11)=0)"
2 changes: 1 addition & 1 deletion input/fsh/DkCoreCprIdentifier.fsh
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ Description: "This structure holds the danish [CPR](https://cpr.dk/) identifier"
Invariant: cpr
Description: "Requirement of danish civil registration numbers. See https://cpr.dk/cpr-systemet/opbygning-af-cpr-nummeret/#:~:text=5%20%2D%206%20position%20angiver%20personens,i%20personnummeret%20angiver%20personens%20k%C3%B8n."
Severity: #error
Expression: "value.matches('^((((0[1-9]|1[0-9]|2[0-9]|3[0-1])(01|03|05|07|08|10|12))|((0[1-9]|1[0-9]|2[0-9]|30)(04|06|09|11))|((0[1-9]|1[0-9]|2[0-9])(02)))[0-9]{6})$')"
Expression: "matches('^((((0[1-9]|1[0-9]|2[0-9]|3[0-1])(01|03|05|07|08|10|12))|((0[1-9]|1[0-9]|2[0-9]|30)(04|06|09|11))|((0[1-9]|1[0-9]|2[0-9])(02)))[0-9]{6})$')"
* requirements = "Requirement of danish civil registration numbers"
2 changes: 1 addition & 1 deletion input/fsh/DkCoreObservation.fsh
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ Description: "HL7 Denmark core profile for observations"
Invariant: dk-core-observation-mandatory-units
Description: "If value is specified then unit and/or code must be specified"
Severity: #error
Expression: "Observation.value.ofType(Quantity).value.exists() implies Observation.value.ofType(Quantity).unit.exists() or Observation.value.ofType(Quantity).code.exists()"
Expression: "value.ofType(Quantity).value.exists() implies value.ofType(Quantity).unit.exists() or value.ofType(Quantity).code.exists()"



Expand Down
4 changes: 2 additions & 2 deletions input/fsh/GLNIdentifier.fsh
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ Description: "Identifier holding a 13 digit GLN"
Invariant: gln-length
Description: "GLN must be exactly 13 characters long"
Severity: #error
Expression: "value.matches('^[0-9]{13}$')"
Expression: "matches('^[0-9]{13}$')"

Invariant: gln-modulus-10
Description: "GLN must pass the modulus 10 check - https://www.gs1.org/services/how-calculate-check-digit-manually"
Severity: #error
Expression: "((\n(10-((value.substring(0,1).toInteger()*1)+\n(value.substring(1,1).toInteger()*3)+\n(value.substring(2,1).toInteger()*1)+\n(value.substring(3,1).toInteger()*3)+\n(value.substring(4,1).toInteger()*1)\n+(value.substring(5,1).toInteger()*3)\n+(value.substring(6,1).toInteger()*1)\n+(value.substring(7,1).toInteger()*3)\n+(value.substring(8,1).toInteger()*1)\n+(value.substring(9,1).toInteger()*3)\n+(value.substring(10,1).toInteger()*1)\n+(value.substring(11,1).toInteger()*3))mod(10))mod(10))=value.substring(12,1).toInteger())"
Expression: "((\n(10-((substring(0,1).toInteger()*1)+\n(substring(1,1).toInteger()*3)+\n(substring(2,1).toInteger()*1)+\n(substring(3,1).toInteger()*3)+\n(substring(4,1).toInteger()*1)\n+(substring(5,1).toInteger()*3)\n+(substring(6,1).toInteger()*1)\n+(substring(7,1).toInteger()*3)\n+(substring(8,1).toInteger()*1)\n+(substring(9,1).toInteger()*3)\n+(substring(10,1).toInteger()*1)\n+(substring(11,1).toInteger()*3))mod(10))mod(10))=substring(12,1).toInteger())"
2 changes: 1 addition & 1 deletion input/fsh/KombitOrgIdentifier.fsh
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ Description: "Identifier holding the organization code issued by KOMBIT"
Invariant: uuid
Description: "General UUID expression"
Severity: #error
Expression: "value.matches('urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}')"
Expression: "matches('urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}')"
2 changes: 1 addition & 1 deletion input/fsh/Lpr3Identifier.fsh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Description: "Identifier holding a LPR3 identifier for an organization"
Invariant: uuidv5
Description: "LPR3 episode of care identifiers must conform to a UUIDv5"
Severity: #error
Expression: "value.matches('urn:uuid:[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[5][a-fA-F0-9]{3}-[89aAbB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}')"
Expression: "matches('urn:uuid:[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[5][a-fA-F0-9]{3}-[89aAbB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}')"
* requirements = "LPR3 episode of care identifiers must conform to a UUIDv5"
* source = "https://scandihealth.github.io/lpr3-docs/"
*/

0 comments on commit 9c8bd09

Please sign in to comment.