{
  "resourceType": "StructureDefinition",
  "id": "dk-core-cpr-identifier",
  "url": "http://hl7.dk/fhir/core/StructureDefinition/dk-core-cpr-identifier",
  "version": "latest",
  "name": "DkCoreCprIdentifier",
  "title": "Danish Core Central Person Register Extension",
  "status": "draft",
  "date": "2019-11-02",
  "publisher": "ehealth.sundhed.dk",
  "description": "This structure holds the danish *Central Person Register* (CPR) identifier",
  "fhirVersion": "4.0.1",
  "kind": "complex-type",
  "abstract": false,
  "type": "Identifier",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Identifier",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Identifier.use",
        "path": "Identifier.use",
        "fixedCode": "official"
      },
      {
        "id": "Identifier.type.coding.system",
        "path": "Identifier.type.coding.system",
        "fixedUri": "http://terminology.hl7.org/CodeSystem/v2-0203"
      },
      {
        "id": "Identifier.type.coding.code",
        "path": "Identifier.type.coding.code",
        "fixedCode": "NNDNK"
      },
      {
        "id": "Identifier.system",
        "path": "Identifier.system",
        "min": 1,
        "binding": {
          "strength": "required",
          "valueSet": "http://hl7.dk/fhir/core/ValueSet/dk-core-cpr-identifier-system"
        }
      },
      {
        "id": "Identifier.value",
        "path": "Identifier.value",
        "min": 1,
        "maxLength": 10,
        "constraint": [
          {
            "key": "cpr",
            "requirements": "Requirement of danish civil registration numbers",
            "severity": "error",
            "human": "Requirement of danish civil registration numbers",
            "expression": "matches('^(?:(?:31(?:0[13578]|1[02])|(?:30|29)(?:0[13-9]|1[0-2])|(?:0[1-9]|1[0-9]|2[0-8])(?:0[1-9]|1[0-2]))[0-9]{2}[0-9]|290200[4-9]|2902(?:(?!00)[02468][048]|[13579][26])[0-3])[0-9]{3}$')",
            "source": "https://cpr.dk/cpr-systemet/opbygning-af-cpr-nummeret/#:~:text=5%20%2D%206%20position%20angiver%20personens,i%20personnummeret%20angiver%20personens%20k%C3%B8n."
          }
        ],
        "mustSupport": false
      }
    ]
  }
}