{
  "resourceType": "StructureDefinition",
  "id": "e9a39f01-c3de-400f-87cb-15819a13adee",
  "meta": {
    "lastUpdated": "2018-12-20T11:19:12.969+00:00"
  },
  "url": "http://ehalsomyndigheten.se/fhir/Patient/nll",
  "name": "swe-patient-nll-alt1",
  "status": "draft",
  "date": "2018-12-20T11:19:12.7967121+00:00",
  "description": "v1:",
  "fhirVersion": "3.0.1",
  "mapping": [
    {
      "identity": "nll-info-model",
      "name": "NLL Information model"
    },
    {
      "identity": "or-service",
      "name": "Corresponding concept in OR"
    }
  ],
  "kind": "resource",
  "abstract": false,
  "type": "Patient",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Patient",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Patient.extension",
        "path": "Patient.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "rules": "open"
        }
      },
      {
        "id": "Patient.extension:managingDoseDispensePharmacy",
        "path": "Patient.extension",
        "sliceName": "managingDoseDispensePharmacy",
        "type": [
          {
            "code": "Extension",
            "profile": "http://example.org/fhir/StructureDefinition/orgRef"
          }
        ]
      },
      {
        "id": "Patient.identifier",
        "path": "Patient.identifier",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "system"
            }
          ],
          "rules": "open"
        },
        "definition": "An identifier for this patient. Should be personnummer (personal identity number) or samordningsnummer (co-ordination number). Note that two identifier can't be active during the same period. \r\n\r\nWhen a patient doesn't have any of the defined identifiers, it is still possible to create e.g. a MedicationRequest for the patient by creating a patient inline (contained) in the MedicationRequest resource.",
        "mustSupport": true
      },
      {
        "id": "Patient.identifier:PNR",
        "path": "Patient.identifier",
        "sliceName": "PNR",
        "short": "Personnummer (personal identifier number) for the patient",
        "definition": "Personnummer (personal identifier number) for the patient. Personnummer is one of the possible identifiers of a patient. This identifier should primarily be used and only if there is a clear reason that a personnumer doesn't exist for the patient the alternate identifiers can be used",
        "mapping": [
          {
            "identity": "nll-info-model",
            "map": "Patient.Person-id"
          },
          {
            "identity": "or-service",
            "map": "Patient.personnummer"
          }
        ]
      },
      {
        "id": "Patient.identifier:PNR.system",
        "path": "Patient.identifier.system",
        "min": 1,
        "fixedUri": "urn:oid:1.2.752.129.2.1.3.1",
        "mapping": [
          {
            "identity": "nll-info-model",
            "map": "Person-id typ"
          }
        ]
      },
      {
        "id": "Patient.identifier:PNR.value",
        "path": "Patient.identifier.value",
        "min": 1,
        "constraint": [
          {
            "key": "swe-id-rule",
            "severity": "error",
            "human": "Personal id must have 12 digits",
            "expression": "$this.matches('^\\\\d{12}$')"
          }
        ]
      },
      {
        "id": "Patient.identifier:SNR",
        "path": "Patient.identifier",
        "sliceName": "SNR",
        "short": "Samordningsnummer (co-ordination number) identifier for the patient",
        "definition": "Samordningsnummer (co-ordination number)  for the patient. Samordningsnummer is one of the possible identifiers of a patient. This identifier is used when the person hasn't yet received a personnummer but can be kept as a historical identifier once patient has received a personnummer.",
        "max": "1"
      },
      {
        "id": "Patient.identifier:SNR.system",
        "path": "Patient.identifier.system",
        "definition": "Establishes the namespace for the value - that is, a URL that describes a set values that are unique.\r\nOID",
        "min": 1,
        "fixedUri": "urn:oid:1.2.752.129.2.1.3.3"
      },
      {
        "id": "Patient.identifier:SNR.value",
        "path": "Patient.identifier.value",
        "min": 1,
        "constraint": [
          {
            "key": "swe-id-rule",
            "severity": "error",
            "human": "Identifier must have 12 digits",
            "expression": "$this.matches('^\\\\d{12}$')"
          }
        ]
      },
      {
        "id": "Patient.name.family",
        "path": "Patient.name.family",
        "mustSupport": true,
        "mapping": [
          {
            "identity": "nll-info-model",
            "map": "Patient.Efternamn"
          },
          {
            "identity": "or-service",
            "map": "Patient.efternamn"
          }
        ]
      },
      {
        "id": "Patient.name.given",
        "path": "Patient.name.given",
        "mustSupport": true,
        "mapping": [
          {
            "identity": "nll-info-model",
            "map": "Patient.Förnamn"
          },
          {
            "identity": "or-service",
            "map": "Patient.fornamn"
          }
        ]
      }
    ]
  }
}