description: Identifier holding a 13 digit social security number. The number shall have exactly 13 digits and shall not contain point characters for separation. package_name: ch.fhir.ig.ch derivation: constraint name: AHVN13Identifier type: Identifier elements: system: pattern: {type: Uri, value: 'urn:oid:2.16.756.5.32'} index: 0 value: constraint: ahvn13-length: {human: AHVN13 / NAVS13 must be exactly 13 characters long, severity: error, expression: 'value.matches(''^[0-9]{13}$'')'} ahvn13-startswith756: {human: AHVN13 / NAVS13 must start with 756, severity: error, expression: value.startsWith('756')} ahvn13-digit-check: {human: 'AHVN13 / NAVS13 must pass digit check - https://www.gs1.org/services/how-calculate-check-digit-manually', severity: error, expression: '(((10-(28+(value.substring(3,1).toInteger()*3)+(value.substring(4,1).toInteger()*1)+(value.substring(5,1).toInteger()*3)+(value.substring(6,1).toInteger()*1)+(value.substring(7,1).toInteger()*3)+(value.substring(8,1).toInteger()*1)+(value.substring(9,1).toInteger()*3)+(value.substring(10,1).toInteger()*1)+(value.substring(11,1).toInteger()*3))mod(10))mod(10))=value.substring(12,1).toInteger())'} index: 1 package_version: core-3.0.0 class: complex-type kind: complex-type url: http://fhir.ch/ig/ch-core/StructureDefinition/ch-core-ahvn13-identifier base: http://hl7.org/fhir/StructureDefinition/Identifier version: 3.0.0 required: [value, system]