{
  "resourceType": "StructureDefinition",
  "url": "https://vvis.gov.lv/fhir/StructureDefinition/Schedule-v1",
  "version": "0.1",
  "name": "Schedule",
  "title": "Kalendārs",
  "status": "draft",
  "date": "2025-04",
  "publisher": "LDVC",
  "description": "Satur iestādes vai konkrētas filiāles pieejamību.",
  "fhirVersion": "5.0.0",
  "kind": "resource",
  "abstract": false,
  "type": "Schedule",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Schedule",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Schedule.id",
        "path": "Schedule.id",
        "definition": "The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes.\r\n\r\n//Iekšējais e-pieraksta ID. Tiek sagaidīts tikai UPDATE pieprasījumos."
      },
      {
        "id": "Schedule.identifier",
        "path": "Schedule.identifier",
        "definition": "External Ids for this item.\r\n\r\n//Izmantot, lai meklētu pēc ID. Netiek definēta iestāde, ID var sakritst starp dažādām iestādēm.",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Schedule.identifier.use",
        "path": "Schedule.identifier.use",
        "max": "0"
      },
      {
        "id": "Schedule.identifier.type",
        "path": "Schedule.identifier.type",
        "max": "0"
      },
      {
        "id": "Schedule.identifier.system",
        "path": "Schedule.identifier.system",
        "max": "0"
      },
      {
        "id": "Schedule.identifier.value",
        "path": "Schedule.identifier.value",
        "definition": "The portion of the identifier typically relevant to the user and which is unique within the context of the system.\r\n\r\n//Ierobežojums uz 20 simboliem.",
        "min": 1,
        "maxLength": 20
      },
      {
        "id": "Schedule.identifier.period",
        "path": "Schedule.identifier.period",
        "max": "0"
      },
      {
        "id": "Schedule.identifier.assigner",
        "path": "Schedule.identifier.assigner",
        "max": "0"
      },
      {
        "id": "Schedule.identifier.assigner.reference",
        "path": "Schedule.identifier.assigner.reference",
        "definition": "A reference to a location at which the other resource is found. The reference may be a relative reference, in which case it is relative to the service base URL, or an absolute URL that resolves to the location where the resource is found. The reference may be version specific or not. If the reference is not to a FHIR RESTful server, then it should be assumed to be version specific. Internal fragment references (start with '#') refer to contained resources.\r\n\r\n//Lai references tips atbilst",
        "max": "0"
      },
      {
        "id": "Schedule.identifier.assigner.type",
        "path": "Schedule.identifier.assigner.type",
        "definition": "The expected type of the target of the reference. If both Reference.type and Reference.reference are populated and Reference.reference is a FHIR URL, both SHALL be consistent.\n\nThe type is the Canonical URL of Resource Definition that is the type this reference refers to. References are URLs that are relative to http://hl7.org/fhir/StructureDefinition/ e.g. \"Patient\" is a reference to http://hl7.org/fhir/StructureDefinition/Patient. Absolute URLs are only allowed for logical models (and can only be used in references in logical models, not resources).\r\n\r\n//ID piešķīrējs ir no savas organizācijas, lai varētu pateikt, ka viņu iesūtītais ID ir unikāls.",
        "min": 1,
        "fixedUri": "Organization",
        "binding": {
          "strength": "required"
        }
      },
      {
        "id": "Schedule.active",
        "path": "Schedule.active",
        "definition": "Whether this schedule record is in active use or should not be used (such as was entered in error).\r\n\r\n//Norāda vai kalendārs ir - aktīvs vai neaktīvs.",
        "min": 1
      },
      {
        "id": "Schedule.serviceCategory",
        "path": "Schedule.serviceCategory",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "coding.system"
            }
          ],
          "rules": "closed"
        },
        "definition": "A broad categorization of the service that is to be performed during this appointment.\r\n\r\n//Ir izveidotas 2 kategorijas, kas apzīmē pakalpojumu saraksta hierarhiju. 1 - pakalpojumu grupa, 2 - pakalpojumu veids.",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Schedule.serviceCategory:majorCategory",
        "path": "Schedule.serviceCategory",
        "sliceName": "majorCategory",
        "definition": "A broad categorization of the service that is to be performed during this appointment.\r\n\r\n//Major kategorija nosaka pakalpojumu grupu. Piemēram: ambulatorie pakalpojumi, stacionārie pakalpojumi, dienas stacionāra pakalpojumi, laboratorijas pakalpojumi u.c.",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Schedule.serviceCategory:majorCategory.coding",
        "path": "Schedule.serviceCategory.coding",
        "definition": "A reference to a code defined by a terminology system.\r\n\r\n//Pasaka, ka te jāsūta vērtība no klasifikatora",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Schedule.serviceCategory:majorCategory.coding.system",
        "path": "Schedule.serviceCategory.coding.system",
        "definition": "The identification of the code system that defines the meaning of the symbol in the code.\r\n\r\n//Pasaka, ka vērtības jāņem no 1.3.6.1.4.1.38760.2.914",
        "min": 1,
        "fixedUri": "uri:1.3.6.1.4.1.38760.2.914"
      },
      {
        "id": "Schedule.serviceCategory:majorCategory.coding.version",
        "path": "Schedule.serviceCategory.coding.version",
        "max": "0"
      },
      {
        "id": "Schedule.serviceCategory:majorCategory.coding.code",
        "path": "Schedule.serviceCategory.coding.code",
        "definition": "A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination).\r\n\r\n//Klasifikatora vērtības kods.",
        "min": 1
      },
      {
        "id": "Schedule.serviceCategory:majorCategory.coding.display",
        "path": "Schedule.serviceCategory.coding.display",
        "definition": "A representation of the meaning of the code in the system, following the rules of the system.\r\n\r\n//Klasifikatora vērtības display name.",
        "min": 1
      },
      {
        "id": "Schedule.serviceCategory:majorCategory.coding.userSelected",
        "path": "Schedule.serviceCategory.coding.userSelected",
        "max": "0"
      },
      {
        "id": "Schedule.serviceCategory:majorCategory.text",
        "path": "Schedule.serviceCategory.text",
        "max": "0"
      },
      {
        "id": "Schedule.serviceCategory:minorCategory",
        "path": "Schedule.serviceCategory",
        "sliceName": "minorCategory",
        "definition": "A broad categorization of the service that is to be performed during this appointment.\r\n\r\n//Minor kategorija nosaka pakalpojumu veidu. Piemēram: Konsultācijas, Izmeklējumi, Funkcionālie izmeklējumi, Specializēti kabineti u.c.",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Schedule.serviceCategory:minorCategory.coding",
        "path": "Schedule.serviceCategory.coding",
        "definition": "A reference to a code defined by a terminology system.\r\n\r\n//",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Schedule.serviceCategory:minorCategory.coding.system",
        "path": "Schedule.serviceCategory.coding.system",
        "definition": "The identification of the code system that defines the meaning of the symbol in the code.\r\n\r\n//Šim jāizveido klasifikators. (Piemēram: 1.3.6.1.4.1.38760.2.nnn)",
        "min": 1,
        "fixedUri": "uri:1.3.6.1.4.1.38760.2.nnn"
      },
      {
        "id": "Schedule.serviceCategory:minorCategory.coding.version",
        "path": "Schedule.serviceCategory.coding.version",
        "max": "0"
      },
      {
        "id": "Schedule.serviceCategory:minorCategory.coding.code",
        "path": "Schedule.serviceCategory.coding.code",
        "definition": "A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination).\r\n\r\n//Klasifikatora vērtības kods.",
        "min": 1
      },
      {
        "id": "Schedule.serviceCategory:minorCategory.coding.display",
        "path": "Schedule.serviceCategory.coding.display",
        "definition": "A representation of the meaning of the code in the system, following the rules of the system.\r\n\r\n//Klasifikatora vērtības display name.",
        "min": 1
      },
      {
        "id": "Schedule.serviceCategory:minorCategory.coding.userSelected",
        "path": "Schedule.serviceCategory.coding.userSelected",
        "max": "0"
      },
      {
        "id": "Schedule.serviceCategory:minorCategory.text",
        "path": "Schedule.serviceCategory.text",
        "max": "0"
      },
      {
        "id": "Schedule.serviceType",
        "path": "Schedule.serviceType",
        "definition": "The specific service that is to be performed during this appointment.\r\n\r\n//Pakalpojumu klasifikators, MVP kārtā satur tikai konsultācijas, piemēram: Alergologa konsultācija, Ķirurga konsultācija, Neirologa konsultācija u.c.",
        "min": 1,
        "max": "5"
      },
      {
        "id": "Schedule.serviceType.concept",
        "path": "Schedule.serviceType.concept",
        "min": 1
      },
      {
        "id": "Schedule.serviceType.concept.coding",
        "path": "Schedule.serviceType.concept.coding",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Schedule.serviceType.concept.coding.system",
        "path": "Schedule.serviceType.concept.coding.system",
        "definition": "The identification of the code system that defines the meaning of the symbol in the code.\r\n\r\n//Jaunais pakalpojumu klasifikators - ķirurga, neirologa, ginekologa konsultācija u.c.",
        "min": 1,
        "fixedUri": "uri:1.3.6.1.4.1.38760.2.nnn"
      },
      {
        "id": "Schedule.serviceType.concept.coding.version",
        "path": "Schedule.serviceType.concept.coding.version",
        "max": "0"
      },
      {
        "id": "Schedule.serviceType.concept.coding.code",
        "path": "Schedule.serviceType.concept.coding.code",
        "min": 1
      },
      {
        "id": "Schedule.serviceType.concept.coding.display",
        "path": "Schedule.serviceType.concept.coding.display",
        "min": 1
      },
      {
        "id": "Schedule.serviceType.concept.coding.userSelected",
        "path": "Schedule.serviceType.concept.coding.userSelected",
        "max": "0"
      },
      {
        "id": "Schedule.serviceType.concept.text",
        "path": "Schedule.serviceType.concept.text",
        "max": "0"
      },
      {
        "id": "Schedule.serviceType.reference",
        "path": "Schedule.serviceType.reference",
        "min": 1
      },
      {
        "id": "Schedule.serviceType.reference.reference",
        "path": "Schedule.serviceType.reference.reference",
        "min": 1
      },
      {
        "id": "Schedule.serviceType.reference.type",
        "path": "Schedule.serviceType.reference.type",
        "min": 1,
        "fixedUri": "HealthcareService"
      },
      {
        "id": "Schedule.serviceType.reference.identifier",
        "path": "Schedule.serviceType.reference.identifier",
        "max": "0"
      },
      {
        "id": "Schedule.serviceType.reference.display",
        "path": "Schedule.serviceType.reference.display",
        "max": "0"
      },
      {
        "id": "Schedule.specialty",
        "path": "Schedule.specialty",
        "definition": "The specialty of a practitioner that would be required to perform the service requested in this appointment.\r\n\r\n//Definē kurai ārsta specialitātei šis kalendārs pieder.",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Schedule.specialty.coding",
        "path": "Schedule.specialty.coding",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Schedule.specialty.coding.system",
        "path": "Schedule.specialty.coding.system",
        "definition": "The identification of the code system that defines the meaning of the symbol in the code.\r\n\r\n//Izmantots klasifikators: 1.3.6.1.4.1.38760.2.38",
        "min": 1,
        "fixedUri": "uri:1.3.6.1.4.1.38760.2.38"
      },
      {
        "id": "Schedule.specialty.coding.version",
        "path": "Schedule.specialty.coding.version",
        "max": "0"
      },
      {
        "id": "Schedule.specialty.coding.code",
        "path": "Schedule.specialty.coding.code",
        "definition": "A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination).\r\n\r\n//Klasifikatora vērtības kods.",
        "min": 1
      },
      {
        "id": "Schedule.specialty.coding.display",
        "path": "Schedule.specialty.coding.display",
        "definition": "A representation of the meaning of the code in the system, following the rules of the system.\r\n\r\n//Klasifikatora vērtības nosaukums.",
        "min": 1
      },
      {
        "id": "Schedule.specialty.coding.userSelected",
        "path": "Schedule.specialty.coding.userSelected",
        "max": "0"
      },
      {
        "id": "Schedule.specialty.text",
        "path": "Schedule.specialty.text",
        "max": "0"
      },
      {
        "id": "Schedule.name",
        "path": "Schedule.name",
        "definition": "Further description of the schedule as it would be presented to a consumer while searching.",
        "max": "0"
      },
      {
        "id": "Schedule.actor",
        "path": "Schedule.actor",
        "definition": "Slots that reference this schedule resource provide the availability details to these referenced resource(s).\r\n\r\n//Ārsta līgumattiecība. Ārsts, kurš sniegs pakalpojumu.",
        "max": "1",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://hl7.org/fhir/StructureDefinition/PractitionerRole"
            ]
          }
        ]
      },
      {
        "id": "Schedule.actor.extension",
        "path": "Schedule.actor.extension",
        "definition": "May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.\r\n\r\n//Pievienots extensions valodām"
      },
      {
        "id": "Schedule.actor.reference",
        "path": "Schedule.actor.reference",
        "min": 1
      },
      {
        "id": "Schedule.actor.type",
        "path": "Schedule.actor.type",
        "min": 1,
        "fixedUri": "PractitionerRole"
      },
      {
        "id": "Schedule.actor.identifier",
        "path": "Schedule.actor.identifier",
        "max": "0"
      },
      {
        "id": "Schedule.actor.display",
        "path": "Schedule.actor.display",
        "max": "0"
      },
      {
        "id": "Schedule.planningHorizon",
        "path": "Schedule.planningHorizon",
        "min": 1
      },
      {
        "id": "Schedule.planningHorizon.start",
        "path": "Schedule.planningHorizon.start",
        "definition": "The start of the period. The boundary is inclusive.\r\n\r\n//Sagaidām datumu un laiku",
        "min": 1
      },
      {
        "id": "Schedule.planningHorizon.end",
        "path": "Schedule.planningHorizon.end",
        "definition": "The end of the period. If the end of the period is missing, it means no end was known or planned at the time the instance was created. The start may be in the past, and the end date in the future, which means that period is expected/planned to end at that time.\r\n\r\n//Sagaidām datumu un laiku",
        "min": 1
      },
      {
        "id": "Schedule.comment",
        "path": "Schedule.comment",
        "definition": "Comments on the availability to describe any extended information. Such as custom constraints on the slots that may be associated.\r\n\r\n//Tiek sagaidīti vecuma ierobežojumi - kādās vecuma robežās ārsts pieņems pacientus. Piemēram 1-7; 1-18; 18+; u.c."
      }
    ]
  }
}