PackagesCanonicalsLogsProblems
    Packages
    ch.fhir.ig.ch-core@3.0.0
    http://fhir.ch/ig/ch-core/StructureDefinition/ch-core-gln-identifier
description: Identifier holding a 13 digit GLN
package_name: ch.fhir.ig.ch-core
derivation: constraint
name: GLNIdentifier
type: Identifier
elements:
  system:
    pattern: {type: Uri, value: 'urn:oid:2.51.1.3'}
    index: 0
  value:
    constraint:
      gln-length: {human: GLN must be exactly 13 characters long, severity: error, expression: 'value.matches(''^[0-9]{13}$'')'}
      gln-modulus-10: {human: 'GLN must pass the modulus 10 check - https://www.gs1.org/services/how-calculate-check-digit-manually', severity: error, expression: '(((10-((value.substring(0,1).toInteger()*1)+(value.substring(1,1).toInteger()*3)+(value.substring(2,1).toInteger()*1)+(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())'}
      gln-startswith7601: {human: GLN must start with 7601 for swiss hcp, severity: error, expression: value.startsWith('7601')}
    index: 1
package_version: 3.0.0
class: complex-type
kind: complex-type
url: http://fhir.ch/ig/ch-core/StructureDefinition/ch-core-gln-identifier
base: http://hl7.org/fhir/StructureDefinition/Identifier
version: 3.0.0
required: [value, system]