{
  "resourceType": "StructureDefinition",
  "id": "FinnishSchedulingAppointment",
  "url": "http://hl7.fi/fhir/StructureDefinition/FinnishSchedulingAppointment",
  "name": "FinnishSchedulingAppointment",
  "status": "draft",
  "description": "Profile for appointment (ajanvaraus) in Finnish Scheduling environment. The contents is based on the scheduling appointment spefication.",
  "fhirVersion": "4.0.0",
  "kind": "resource",
  "abstract": false,
  "type": "Appointment",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Appointment",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Appointment.extension",
        "path": "Appointment.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "rules": "open"
        }
      },
      {
        "id": "Appointment.extension:ServiceEvent",
        "path": "Appointment.extension",
        "sliceName": "ServiceEvent",
        "requirements": "22 Palvelutapahtuman tunniste",
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://hl7.fi/fhir/StructureDefinition/ServiceEventExt"
            ]
          }
        ]
      },
      {
        "id": "Appointment.extension:TopicId",
        "path": "Appointment.extension",
        "sliceName": "TopicId",
        "requirements": "23 Asian tunniste",
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://hl7.fi/fhir/StructureDefinition/TopicIdExt"
            ]
          }
        ]
      },
      {
        "id": "Appointment.extension:QueueNo",
        "path": "Appointment.extension",
        "sliceName": "QueueNo",
        "requirements": "82 Jonotusnumero",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://hl7.fi/fhir/StructureDefinition/QueueNoExt"
            ]
          }
        ]
      },
      {
        "id": "Appointment.extension:TicketNo",
        "path": "Appointment.extension",
        "sliceName": "TicketNo",
        "requirements": "101 Tikettinumero",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://hl7.fi/fhir/StructureDefinition/TicketNoExt"
            ]
          }
        ]
      },
      {
        "id": "Appointment.extension:VisibleToCustodian",
        "path": "Appointment.extension",
        "sliceName": "VisibleToCustodian",
        "requirements": "59 Ajanvarauksen tietojen näyttäminen huoltajalle",
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://hl7.fi/fhir/StructureDefinition/VisibleToCustodian"
            ]
          }
        ]
      },
      {
        "id": "Appointment.extension:CustomerJourney",
        "path": "Appointment.extension",
        "sliceName": "CustomerJourney",
        "requirements": "20 Asiakaspolun tunniste\r\n20.1 Asiakaspolun nimi",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://hl7.fi/fhir/StructureDefinition/CustomerJourneyExtension"
            ]
          }
        ]
      },
      {
        "id": "Appointment.extension:ParentAppointment",
        "path": "Appointment.extension",
        "sliceName": "ParentAppointment",
        "requirements": "12 Pääajanvaraus",
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://hl7.fi/fhir/StructureDefinition/ParentAppointment"
            ]
          }
        ]
      },
      {
        "id": "Appointment.extension:SelfServiceExtension",
        "path": "Appointment.extension",
        "sliceName": "SelfServiceExtension",
        "requirements": "84 AsiointiURL\r\n84.1 Järjestelmä tukee alaikäisen puolesta asiointia\r\n84.2 Järjestelmä tukee puolesta-asiointia valtakirjalla täysi-ikäisen puolesta\r\n84.3 Järjestelmä tukee rekisteripohjaista puolesta-asiointia täysi-ikäisen puolesta",
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://hl7.fi/fhir/StructureDefinition/SelfServiceExtension"
            ]
          }
        ]
      },
      {
        "id": "Appointment.extension:ResourceCalendar",
        "path": "Appointment.extension",
        "sliceName": "ResourceCalendar",
        "requirements": "74 Resurssin kalenteritunniste\r\n75 Resurssin nimi",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://hl7.fi/fhir/StructureDefinition/ResourceCalendarIdExtension"
            ]
          }
        ]
      },
      {
        "id": "Appointment.extension:ResourceCalendar.extension:ResourceCalendarName",
        "path": "Appointment.extension.extension",
        "sliceName": "ResourceCalendarName",
        "max": "1"
      },
      {
        "id": "Appointment.extension:ReferralId",
        "path": "Appointment.extension",
        "sliceName": "ReferralId",
        "requirements": "24 Ajanvaraukseen liittyvän lähetteen tai pyynnön tunniste",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://hl7.fi/fhir/StructureDefinition/ReferralIdExtension"
            ]
          }
        ]
      },
      {
        "id": "Appointment.extension:RequestedService",
        "path": "Appointment.extension",
        "sliceName": "RequestedService",
        "requirements": "73 Varaustuote\r\n73.1 Varaustuotteen nimi",
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://hl7.fi/fhir/StructureDefinition/RequestedServiceExtension"
            ]
          }
        ]
      },
      {
        "id": "Appointment.extension:MiscAppointmentData",
        "path": "Appointment.extension",
        "sliceName": "MiscAppointmentData",
        "requirements": "91 Muu sisältö",
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://hl7.fi/fhir/StructureDefinition/MiscAppointmentDataExtension"
            ]
          }
        ]
      },
      {
        "id": "Appointment.extension:PractitionerGender",
        "path": "Appointment.extension",
        "sliceName": "PractitionerGender",
        "requirements": "93 Palvelun toteuttajan sukupuoli",
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://hl7.fi/fhir/StructureDefinition/PractitionerGenderExtension"
            ]
          }
        ]
      },
      {
        "id": "Appointment.extension:NotificationMedium",
        "path": "Appointment.extension",
        "sliceName": "NotificationMedium",
        "requirements": "94 Muistutuksen tapa",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://hl7.fi/fhir/StructureDefinition/NotificationMediumExtension"
            ]
          }
        ]
      },
      {
        "id": "Appointment.extension:CareGuarantee",
        "path": "Appointment.extension",
        "sliceName": "CareGuarantee",
        "requirements": "97 Hoitotakuu",
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://hl7.fi/fhir/StructureDefinition/CareGuaranteeExtension"
            ]
          }
        ]
      },
      {
        "id": "Appointment.extension:AdditionalInformationURL",
        "path": "Appointment.extension",
        "sliceName": "AdditionalInformationURL",
        "requirements": "98 Lisätietojen osoite",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://hl7.fi/fhir/StructureDefinition/AdditionalInformationURLExtension"
            ]
          }
        ]
      },
      {
        "id": "Appointment.extension:CarePlan",
        "path": "Appointment.extension",
        "sliceName": "CarePlan",
        "requirements": "17 Ajanvaraukseen liittyvän suunnitelman tunniste",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://hl7.fi/fhir/StructureDefinition/CareplanIdentifierExtension"
            ]
          }
        ]
      },
      {
        "id": "Appointment.extension:AppointmentMutability",
        "path": "Appointment.extension",
        "sliceName": "AppointmentMutability",
        "requirements": "95 Peruttavissa\r\n96 Siirrettävissä\r\n96.1 Peruutuksen tai siirron aikaraja",
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://hl7.fi/fhir/StructureDefinition/AppointmentMutabilityExtension"
            ]
          }
        ]
      },
      {
        "id": "Appointment.identifier",
        "path": "Appointment.identifier",
        "definition": "hl7fi: 18 Ajanvarauksen tunniste - mandatory, not recurring\r\n\r\nThis records identifiers associated with this appointment concern that are defined by business processes and/or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Appointment.identifier.use",
        "path": "Appointment.identifier.use",
        "max": "0"
      },
      {
        "id": "Appointment.identifier.type",
        "path": "Appointment.identifier.type",
        "max": "0"
      },
      {
        "id": "Appointment.identifier.value",
        "path": "Appointment.identifier.value",
        "min": 1
      },
      {
        "id": "Appointment.identifier.period",
        "path": "Appointment.identifier.period",
        "max": "0"
      },
      {
        "id": "Appointment.identifier.assigner",
        "path": "Appointment.identifier.assigner",
        "max": "0"
      },
      {
        "id": "Appointment.status",
        "path": "Appointment.status",
        "comment": "hl7fi: Requires mapping to Ajanvarauksen tila -koodistoon (1.2.246.537.6.881.201501). Other mappings ok apart from \"siirretty\" (entered-in-error?) ja \"suunniteltu\". \r\n\r\nIf the Appointment's status is \"cancelled\" then all participants are expected to have their calendars released for the appointment period, and as such any Slots that were marked as BUSY can be re-set to FREE.\n\nThis element is labeled as a modifier because the status contains the code entered-in-error that mark the Appointment as not currently valid.",
        "requirements": "19 Ajanvarauksen tila",
        "mapping": [
          {
            "identity": "finnishcodeset",
            "map": "urn:oid:1.2.246.537.6.881.201501",
            "comment": "not a direct mapping for \"siirretty\" and \"suunniteltu\""
          }
        ]
      },
      {
        "id": "Appointment.cancelationReason",
        "path": "Appointment.cancelationReason",
        "requirements": "19.1 Ajanvarauksen perumisen tai siirtämisen syy\r\n\r\nMandatory, if cancellation status is equivalent to \"Siirretty\" or \"Peruttu\""
      },
      {
        "id": "Appointment.cancelationReason.coding.system",
        "path": "Appointment.cancelationReason.coding.system",
        "short": "THL - Palvelutapahtuman peruuntumisen tai siirtymisen syy",
        "fixedUri": "urn:oid:1.2.246.537.6.126.2008"
      },
      {
        "id": "Appointment.serviceCategory",
        "path": "Appointment.serviceCategory",
        "requirements": "71.1 Palvelun luokka",
        "max": "1"
      },
      {
        "id": "Appointment.serviceCategory.coding.system",
        "path": "Appointment.serviceCategory.coding.system",
        "short": "AR/YDIN - Palvelutapahtumaluokitus",
        "definition": "hl7fi: koodilla ilmaistu tieto palveluluokasta, johon ajanvaraus kohdistuu Huom. Palveluluokka ilmaistaan THL - Sosiaali- ja terveyspalvelujen luokituksen avulla.",
        "fixedUri": "urn:oid:1.2.246.537.6.88.2008"
      },
      {
        "id": "Appointment.serviceType",
        "path": "Appointment.serviceType",
        "requirements": "71 Palvelun nimi",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Appointment.serviceType.coding.system",
        "path": "Appointment.serviceType.coding.system",
        "short": "THL - Sosiaali- ja terveysalan palvelunimikkeistö",
        "comment": "hl7fi: koodilla ilmaistu tieto palvelusta, johon ajanvaraus kohdistuu Huom. Palvelun nimi ilmaistaan THL - Sosiaali- ja terveysalan palvelunimikkeistön avulla.\r\n\r\nThe URI may be an OID (urn:oid:...) or a UUID (urn:uuid:...).  OIDs and UUIDs SHALL be references to the HL7 OID registry. Otherwise, the URI should come from HL7's list of FHIR defined special URIs or it should reference to some definition that establishes the system clearly and unambiguously.",
        "requirements": "71 Palvelun nimi",
        "fixedUri": "urn:oid:1.2.246.537.6.49.201501"
      },
      {
        "id": "Appointment.specialty",
        "path": "Appointment.specialty",
        "max": "0"
      },
      {
        "id": "Appointment.appointmentType",
        "path": "Appointment.appointmentType",
        "requirements": "72 Asiointitapa"
      },
      {
        "id": "Appointment.appointmentType.coding.system",
        "path": "Appointment.appointmentType.coding.system",
        "short": "hl7fi: asiointitapa",
        "definition": "hl7fi: koodilla ilmaistu tieto ammattihenkilön ja asiakkaan välisen asioinnin tavasta",
        "fixedUri": "1.2.246.537.6.884.2015"
      },
      {
        "id": "Appointment.reasonCode",
        "path": "Appointment.reasonCode",
        "slicing": {
          "discriminator": [
            {
              "type": "exists",
              "path": "coding"
            }
          ],
          "rules": "open"
        }
      },
      {
        "id": "Appointment.reasonCode:sliceSisaltotarkenne",
        "path": "Appointment.reasonCode",
        "sliceName": "sliceSisaltotarkenne",
        "definition": "hl7fi: 85 Varauksen sisältötarkenne, koodilla ilmaistu tarkentava tieto palvelun sisällöstä Huom. Tarkenteeksi voi valita useamman kuin yhden koodin, ja koodit voivat kuvata esimerkiksi sitä, mitä kuvantamis- tai laboratoriotutkimuksia tai toimenpiteitä suoritetaan.",
        "requirements": "85 Varauksen sisältötarkenne"
      },
      {
        "id": "Appointment.reasonCode:sliceSisaltotarkenne.coding",
        "path": "Appointment.reasonCode.coding",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Appointment.reasonCode:sliceSisaltotarkenne.coding.version",
        "path": "Appointment.reasonCode.coding.version",
        "max": "0"
      },
      {
        "id": "Appointment.reasonCode:sliceSisaltotarkenne.coding.userSelected",
        "path": "Appointment.reasonCode.coding.userSelected",
        "max": "0"
      },
      {
        "id": "Appointment.reasonCode:sliceSisaltotarkenne.text",
        "path": "Appointment.reasonCode.text",
        "max": "0"
      },
      {
        "id": "Appointment.reasonCode:slicePalvelutarve",
        "path": "Appointment.reasonCode",
        "sliceName": "slicePalvelutarve",
        "definition": "hl7fi: 76 Palvelutarve vapaamuotoisena tekstinä ilmaistu tieto asiakkaan palvelutarpeesta Huom. Palvelutarve kuvataan tasolla, jolla henkilön palveluiden tarve voidaan kuvata yhteisellä termillä, esim. raskausajan seuranta ja tuki.",
        "requirements": "76 Palvelutarve",
        "max": "1"
      },
      {
        "id": "Appointment.reasonCode:slicePalvelutarve.coding",
        "path": "Appointment.reasonCode.coding",
        "max": "0"
      },
      {
        "id": "Appointment.reasonCode:slicePalvelutarve.text",
        "path": "Appointment.reasonCode.text",
        "min": 1
      },
      {
        "id": "Appointment.reasonReference",
        "path": "Appointment.reasonReference",
        "requirements": "56 kuvaus oireista/vaivasta ja \r\n57 riskitiedot (Condition/Note)",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://hl7.org/fhir/StructureDefinition/Condition"
            ],
            "aggregation": [
              "contained"
            ]
          }
        ]
      },
      {
        "id": "Appointment.reasonReference.type",
        "path": "Appointment.reasonReference.type",
        "fixedUri": "Condition"
      },
      {
        "id": "Appointment.reasonReference.identifier",
        "path": "Appointment.reasonReference.identifier",
        "max": "0"
      },
      {
        "id": "Appointment.reasonReference.display",
        "path": "Appointment.reasonReference.display",
        "max": "0"
      },
      {
        "id": "Appointment.priority",
        "path": "Appointment.priority",
        "max": "0"
      },
      {
        "id": "Appointment.description",
        "path": "Appointment.description",
        "max": "0"
      },
      {
        "id": "Appointment.supportingInformation",
        "path": "Appointment.supportingInformation",
        "max": "0"
      },
      {
        "id": "Appointment.start",
        "path": "Appointment.start",
        "requirements": "86 Aikaväli"
      },
      {
        "id": "Appointment.end",
        "path": "Appointment.end",
        "requirements": "86 Aikaväli"
      },
      {
        "id": "Appointment.minutesDuration",
        "path": "Appointment.minutesDuration",
        "max": "0"
      },
      {
        "id": "Appointment.created",
        "path": "Appointment.created",
        "requirements": "38 Merkinnän kirjausaika"
      },
      {
        "id": "Appointment.comment",
        "path": "Appointment.comment",
        "short": "hl7fi: asiakkaalle tai ajanvarauksen katselijalle tarkoitettu vapaamuotoinen lisätieto",
        "definition": "hl7fi: asiakkaalle tai ajanvarauksen katselijalle tarkoitettu vapaamuotoinen lisätieto",
        "requirements": "99 Huomautukset"
      },
      {
        "id": "Appointment.patientInstruction",
        "path": "Appointment.patientInstruction",
        "short": "hl7fi: vapaamuotoisena tekstinä ilmaistu potilasohje",
        "definition": "hl7fi: vapaamuotoisena tekstinä ilmaistu potilasohje, joka tarjoaa asiakkaalle tietoa esimerkiksi sairaudesta, tutkimuksista, hoidoista, toimenpiteisiin valmistautumisesta, jälkihoidosta, itsehoidosta, toipumisesta, sairauden kulusta ja sairauden ennusteesta Huom. Potilasohje voi olla esim. Käypä hoito -suositus tai yleinen sairaalan antama ohje, joka voi olla myös yksikkökohtainen.",
        "requirements": "100 Potilasohje"
      },
      {
        "id": "Appointment.patientInstruction.extension",
        "path": "Appointment.patientInstruction.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "rules": "open"
        }
      },
      {
        "id": "Appointment.patientInstruction.extension:PatientInstructionURL",
        "path": "Appointment.patientInstruction.extension",
        "sliceName": "PatientInstructionURL",
        "requirements": "100.1 Linkki potilasohjeeseen",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://hl7.fi/fhir/StructureDefinition/PatientInstructionURLExtension"
            ]
          }
        ]
      },
      {
        "id": "Appointment.basedOn",
        "path": "Appointment.basedOn",
        "max": "0"
      },
      {
        "id": "Appointment.requestedPeriod",
        "path": "Appointment.requestedPeriod",
        "requirements": "35 Ajankohta, jolloin ajanvaraus ohjeistettu tehtäväksi",
        "max": "1"
      }
    ]
  }
}