PackagesCanonicalsLogsProblems
    Packages
    hl7.fhir.dk.core@3.2.0
    http://hl7.dk/fhir/core/StructureDefinition/dk-core-gln-identifier
description: Identifier holding a 13 digit GLN
package_name: hl7.fhir.dk.core
derivation: constraint
name: GLNIdentifier
type: Identifier
elements:
  use:
    pattern: {type: Code, value: official}
    index: 0
  system:
    pattern: {type: Uri, value: 'https://www.gs1.org/gln'}
    index: 1
  value:
    constraint:
      gln-length: {human: GLN must be exactly 13 characters long, source: 'http://hl7.dk/fhir/core/StructureDefinition/dk-core-gln-identifier', severity: error, expression: '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
        source: http://hl7.dk/fhir/core/StructureDefinition/dk-core-gln-identifier
        severity: error
        expression: |-
          ((
          (10-((substring(0,1).toInteger()*1)+
          (substring(1,1).toInteger()*3)+
          (substring(2,1).toInteger()*1)+
          (substring(3,1).toInteger()*3)+
          (substring(4,1).toInteger()*1)
          +(substring(5,1).toInteger()*3)
          +(substring(6,1).toInteger()*1)
          +(substring(7,1).toInteger()*3)
          +(substring(8,1).toInteger()*1)
          +(substring(9,1).toInteger()*3)
          +(substring(10,1).toInteger()*1)
          +(substring(11,1).toInteger()*3))mod(10))mod(10))=substring(12,1).toInteger())
    index: 2
package_version: 3.2.0
class: complex-type
kind: complex-type
url: http://hl7.dk/fhir/core/StructureDefinition/dk-core-gln-identifier
base: http://hl7.org/fhir/StructureDefinition/Identifier
version: 3.2.0
required: [value, system]