{
  "resourceType": "StructureDefinition",
  "url": "http://electronichealth.se/fhir/StructureDefinition/NLLPrescriberLocation",
  "name": "NLLPrescriberLocation",
  "status": "draft",
  "fhirVersion": "4.0.0",
  "mapping": [
    {
      "identity": "EHM",
      "name": "E-hälsomyndigheten interna model"
    }
  ],
  "kind": "resource",
  "abstract": false,
  "type": "Location",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Location",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Location.identifier",
        "path": "Location.identifier",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "system"
            }
          ],
          "rules": "open"
        },
        "mustSupport": true
      },
      {
        "id": "Location.identifier:organizationNumber",
        "path": "Location.identifier",
        "sliceName": "organizationNumber",
        "short": "Unique identity of the workplace",
        "definition": "The unique identity of the workplace in the form of an organization number.",
        "max": "1",
        "mustSupport": true,
        "mapping": [
          {
            "identity": "EHM",
            "map": "Arbetsplats.Arbetsplatsid"
          }
        ]
      },
      {
        "id": "Location.identifier:organizationNumber.system",
        "path": "Location.identifier.system",
        "short": "Swedish organization number",
        "definition": "Swedish “organisationsnummer” according to SKV 709.",
        "min": 1,
        "fixedUri": "urn:oid:2.5.4.97",
        "mustSupport": true
      },
      {
        "id": "Location.identifier:organizationNumber.value",
        "path": "Location.identifier.value",
        "short": "Organization number",
        "definition": "The organization number of the workplace where where the prescription is made. Swedish “organisationsnummer” according to SKV 709. 10 digits.",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Location.name",
        "path": "Location.name",
        "short": "Name of the workplace",
        "definition": "The name of the workplace",
        "mustSupport": true,
        "mapping": [
          {
            "identity": "EHM",
            "map": "Arbetsplats.Namn"
          }
        ]
      },
      {
        "id": "Location.telecom",
        "path": "Location.telecom",
        "short": "Telephone number to the prescriber",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Location.telecom.extension",
        "path": "Location.telecom.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "rules": "open"
        }
      },
      {
        "id": "Location.telecom.extension:nllAvailableToPatient",
        "path": "Location.telecom.extension",
        "sliceName": "nllAvailableToPatient",
        "short": "Availble to the patient",
        "definition": "Indicates if this contact information should be available to the patient.",
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://electronichealth.se/fhir/StructureDefinition/NLLAvailableToPatient"
            ]
          }
        ],
        "mustSupport": true,
        "mapping": [
          {
            "identity": "EHM",
            "map": "Kontaktuppgift.Tillgänglig för patient"
          }
        ]
      },
      {
        "id": "Location.telecom.system",
        "path": "Location.telecom.system",
        "short": "phone",
        "fixedCode": "phone"
      },
      {
        "id": "Location.telecom.value",
        "path": "Location.telecom.value",
        "short": "Telephone number",
        "definition": "A telephone number to the prescriber,",
        "min": 1,
        "mustSupport": true,
        "mapping": [
          {
            "identity": "EHM",
            "map": "Kontaktuppgift.Kontaktväg.Telefon.Telefonnummer"
          }
        ]
      },
      {
        "id": "Location.telecom.rank",
        "path": "Location.telecom.rank",
        "short": "Order of use",
        "mustSupport": true,
        "mapping": [
          {
            "identity": "EHM",
            "map": "Kontaktuppgift.Kontaktväg.Rangordning"
          }
        ]
      },
      {
        "id": "Location.address",
        "path": "Location.address",
        "short": "Address to the prescriber",
        "mustSupport": true
      },
      {
        "id": "Location.address.extension",
        "path": "Location.address.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "rules": "open"
        }
      },
      {
        "id": "Location.address.extension:nllAvailableToPatient",
        "path": "Location.address.extension",
        "sliceName": "nllAvailableToPatient",
        "short": "Available to the patient",
        "definition": "Indicates if this contact information should be available to the patient.",
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://electronichealth.se/fhir/StructureDefinition/NLLAvailableToPatient"
            ]
          }
        ],
        "mustSupport": true,
        "mapping": [
          {
            "identity": "EHM",
            "map": "Kontaktuppgift.Tillgänglig för patient"
          }
        ]
      },
      {
        "id": "Location.address.type",
        "path": "Location.address.type",
        "definition": "Distinguishes between physical addresses (those you can visit) and mailing addresses (e.g. PO Boxes and care-of addresses). Most addresses are both. In swedish: Postadress or Besöksadress.",
        "mustSupport": true,
        "mapping": [
          {
            "identity": "EHM",
            "map": "Adress.Adresstyp"
          }
        ]
      },
      {
        "id": "Location.address.line",
        "path": "Location.address.line",
        "short": "Street address",
        "definition": "This component contains the house number, apartment number, street name, street direction,  P.O. Box number. In swedish: Adress",
        "mustSupport": true,
        "mapping": [
          {
            "identity": "EHM",
            "map": "Adress.Adress"
          }
        ]
      },
      {
        "id": "Location.address.city",
        "path": "Location.address.city",
        "short": "Name of postal area",
        "definition": "The name of the city, town, suburb, village or other community or delivery center. In swedish: Postort",
        "mustSupport": true,
        "mapping": [
          {
            "identity": "EHM",
            "map": "Adress.Postort"
          }
        ]
      },
      {
        "id": "Location.address.postalCode",
        "path": "Location.address.postalCode",
        "short": "Postal code",
        "definition": "A postal code designating a region defined by the postal service. Swedish: Postnummer. 5 digits.",
        "mustSupport": true,
        "mapping": [
          {
            "identity": "EHM",
            "map": "Adress.Postnummer"
          }
        ]
      }
    ]
  }
}