{
  "resourceType": "StructureDefinition",
  "url": "https://unicas-fhir.sanidad.gob.es/StructureDefinition/UNICASAppointment",
  "name": "UNICASAppointment",
  "title": "Appointment Cita Agenda ÚNICAS",
  "status": "draft",
  "description": "Este perfil define las restricciones del recurso Appointment para representar el registro de una cita programada en el contexto del caso de uso de ÚNICAS.",
  "fhirVersion": "5.0.0",
  "kind": "resource",
  "abstract": false,
  "type": "Appointment",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Appointment",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Appointment.identifier",
        "path": "Appointment.identifier",
        "short": "Identificador único",
        "definition": "External Ids for this item. This 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
      },
      {
        "id": "Appointment.identifier.system",
        "path": "Appointment.identifier.system",
        "short": "Sistema para identificar el origen",
        "definition": "Formato: urn:regcess:[CódigoREGCESS] Debe incluir el código REGCESS después de urn:regcess:",
        "min": 1,
        "constraint": [
          {
            "key": "regcess-system",
            "severity": "warning",
            "human": "system debe comenzar por urn:regcess: seguido del identificador del sistema.",
            "expression": "matches('^urn:regcess:[A-Za-z0-9]+$')"
          }
        ]
      },
      {
        "id": "Appointment.identifier.value",
        "path": "Appointment.identifier.value",
        "short": "Identificador interno del sistema para la cita programada",
        "definition": "Debe indicar el ID interno del sistema de origen utilizado para la cita programada.",
        "min": 1
      },
      {
        "id": "Appointment.serviceCategory",
        "path": "Appointment.serviceCategory",
        "short": "Categorización de la cita",
        "binding": {
          "strength": "required",
          "description": "Value set de Tipos de servicios asistenciales para ÚNICAS",
          "valueSet": "https://unicas-fhir.sanidad.gob.es/ValueSet/TiposServicios"
        }
      },
      {
        "id": "Appointment.serviceCategory.coding.system",
        "path": "Appointment.serviceCategory.coding.system",
        "short": "OID del catálogo de clasificación de Servicios",
        "definition": "Posible OID de catálogo utilizado para indicar la clasificación de servicio y su descripción correspondiente:\r\n\r\n- Catálogo de clasificación de Servicios: urn:oid:2.16.724.4.21.5.9"
      },
      {
        "id": "Appointment.serviceCategory.coding.code",
        "path": "Appointment.serviceCategory.coding.code",
        "short": "Código del servicio asistencial para ÚNICAS"
      },
      {
        "id": "Appointment.serviceCategory.coding.display",
        "path": "Appointment.serviceCategory.coding.display",
        "short": "Descripción del servicio asistencial para ÚNICAS",
        "definition": "Representation defined by the system. A representation of the meaning of the code in the system, following the rules of the system."
      },
      {
        "id": "Appointment.serviceType",
        "path": "Appointment.serviceType",
        "short": "Canal de cita",
        "binding": {
          "strength": "extensible",
          "description": "Value set de Canales de cita",
          "valueSet": "https://unicas-fhir.sanidad.gob.es/ValueSet/CanalesCita"
        }
      },
      {
        "id": "Appointment.serviceType.concept",
        "path": "Appointment.serviceType.concept",
        "short": "Canal de cita"
      },
      {
        "id": "Appointment.serviceType.concept.coding.system",
        "path": "Appointment.serviceType.concept.coding.system",
        "short": "URL del SNOMED CT. Extensión para España del SNS",
        "definition": "Posible URL de terminología utilizada para indicar el canal de cita y su descripción correspondiente:\r\n\r\n- SNOMED CT. Extensión para España del SNS: http://snomed.info/sct/900000001000122104"
      },
      {
        "id": "Appointment.serviceType.concept.coding.code",
        "path": "Appointment.serviceType.concept.coding.code",
        "short": "Código del canal de cita"
      },
      {
        "id": "Appointment.serviceType.concept.coding.display",
        "path": "Appointment.serviceType.concept.coding.display",
        "short": "Descripción del canal de cita",
        "definition": "Representation defined by the system. A representation of the meaning of the code in the system, following the rules of the system."
      },
      {
        "id": "Appointment.reason",
        "path": "Appointment.reason",
        "short": "Motivo de cita",
        "definition": "Reason this appointment is scheduled. The reason that this appointment is being scheduled. This is more clinical than administrative. This can be coded, or as specified using information from another resource. When the patient arrives and the encounter begins it may be used as the admission diagnosis. The indication will typically be a Condition (with other resources referenced in the evidence.detail), or a Procedure.",
        "min": 1,
        "binding": {
          "strength": "extensible",
          "description": "Value set de Motivos de la cita",
          "valueSet": "https://unicas-fhir.sanidad.gob.es/ValueSet/MotivosCita"
        }
      },
      {
        "id": "Appointment.reason.concept",
        "path": "Appointment.reason.concept",
        "short": "Motivo de cita",
        "definition": "Reference to a concept (by class). A reference to a concept - e.g. the information is identified by its general class to the degree of precision found in the terminology."
      },
      {
        "id": "Appointment.reason.concept.coding.system",
        "path": "Appointment.reason.concept.coding.system",
        "short": "URL del SNOMED CT. Extensión para España del SNS | OID del CIE-10-ES. Diagnósticos | OID del ORPHA",
        "definition": "Posibles URLs y/o OIDs de terminologías utilizadas para indicar el motivo de la cita y su descripción correspondiente:\r\n\n- SNOMED CT. Extensión para España del SNS con filtro eje hallazgo: http://snomed.info/sct/900000001000122104\n- CIE-10-ES. Diagnósticos: urn:oid:2.16.724.4.21.5.29\n- ORPHA: urn:oid:2.16.724.4.21.5.22",
        "min": 1
      },
      {
        "id": "Appointment.reason.concept.coding.code",
        "path": "Appointment.reason.concept.coding.code",
        "short": "Código del motivo de la cita",
        "min": 1
      },
      {
        "id": "Appointment.reason.concept.coding.display",
        "path": "Appointment.reason.concept.coding.display",
        "short": "Descripción del motivo de la cita",
        "definition": "Representation defined by the system. A representation of the meaning of the code in the system, following the rules of the system.",
        "min": 1
      },
      {
        "id": "Appointment.start",
        "path": "Appointment.start",
        "short": "Fecha y hora de inicio de la cita programada",
        "definition": "When appointment is to take place. Date/Time that the appointment is to take place.",
        "min": 1
      },
      {
        "id": "Appointment.end",
        "path": "Appointment.end",
        "short": "Fecha y hora de fin de la cita programada",
        "definition": "When appointment is to conclude. Date/Time that the appointment is to conclude."
      },
      {
        "id": "Appointment.minutesDuration",
        "path": "Appointment.minutesDuration",
        "short": "Duración de la cita programada",
        "definition": "Can be less than start/end (e.g. estimate). Number of minutes that the appointment is to take. This can be less than the duration between the start and end times.  For example, where the actual time of appointment is only an estimate or if a 30 minute appointment is being requested, but any time would work.  Also, if there is, for example, a planned 15 minute break in the middle of a long appointment, the duration may be 15 minutes less than the difference between the start and end."
      },
      {
        "id": "Appointment.created",
        "path": "Appointment.created",
        "short": "Fecha y hora de creación de la cita"
      },
      {
        "id": "Appointment.cancellationDate",
        "path": "Appointment.cancellationDate",
        "short": "Fecha y hora de cancelación de la cita",
        "definition": "When the appointment was cancelled. The date/time describing when the appointment was cancelled."
      },
      {
        "id": "Appointment.note",
        "path": "Appointment.note",
        "short": "Comentario"
      },
      {
        "id": "Appointment.note.text",
        "path": "Appointment.note.text",
        "short": "Comentario",
        "definition": "The annotation  - text content (as markdown). The text of the annotation in markdown format."
      },
      {
        "id": "Appointment.subject",
        "path": "Appointment.subject",
        "short": "Referencia al paciente",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://unicas-fhir.sanidad.gob.es/StructureDefinition/UNICASPatient"
            ]
          }
        ]
      },
      {
        "id": "Appointment.subject.reference",
        "path": "Appointment.subject.reference",
        "short": "Referencia recurso FHIR. Identificador de la referencia del recurso FHIR asociado cuando exista/creamos un recurso en el mismo servidor FHIR",
        "definition": "Formato: [base]/Patient?identifier=[OID registro de número de CIP-SNS]|[Número CIP-SNS]"
      },
      {
        "id": "Appointment.subject.type",
        "path": "Appointment.subject.type",
        "short": "Tipo de recurso FHIR",
        "definition": "Type the reference refers to (e.g. \"Patient\") - must be a resource in resources. 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).",
        "min": 1
      },
      {
        "id": "Appointment.subject.identifier",
        "path": "Appointment.subject.identifier",
        "short": "Identificador de paciente CIP-SNS. Cuando no tengamos recurso Patient, se debera informar el identificador de paciente mediante CIP-SNS",
        "definition": "Logical reference, when literal reference is not known. An identifier for the target resource. This is used when there is no way to reference the other resource directly, either because the entity it represents is not available through a FHIR server, or because there is no way for the author of the resource to convert a known identifier to an actual location. There is no requirement that a Reference.identifier point to something that is actually exposed as a FHIR instance, but it SHALL point to a business concept that would be expected to be exposed as a FHIR instance, and that instance would need to be of a FHIR resource type allowed by the reference.",
        "min": 1
      },
      {
        "id": "Appointment.subject.identifier.type",
        "path": "Appointment.subject.identifier.type",
        "short": "Tipos de documentos de identificación para persona ÚNICAS",
        "definition": "Description of identifier. A coded type for the identifier that can be used to determine which identifier to use for a specific purpose.",
        "binding": {
          "strength": "extensible",
          "description": "Value set de Tipos de documentos de identificación para persona ÚNICAS",
          "valueSet": "https://unicas-fhir.sanidad.gob.es/ValueSet/TiposDocumentosIdentificacionPersona"
        }
      },
      {
        "id": "Appointment.subject.identifier.type.coding.system",
        "path": "Appointment.subject.identifier.type.coding.system",
        "short": "URL del SNOMED CT. Extensión para España del SNS",
        "definition": "Posible URL de terminología utilizada para indicar el tipo de documentos de identificación y su descripción correspondiente:\r\n\r\n- SNOMED CT. Extensión para España del SNS: http://snomed.info/sct/900000001000122104"
      },
      {
        "id": "Appointment.subject.identifier.type.coding.code",
        "path": "Appointment.subject.identifier.type.coding.code",
        "short": "Código del identificador"
      },
      {
        "id": "Appointment.subject.identifier.type.coding.display",
        "path": "Appointment.subject.identifier.type.coding.display",
        "short": "Decripción del identificador",
        "definition": "Representation defined by the system. A representation of the meaning of the code in the system, following the rules of the system."
      },
      {
        "id": "Appointment.subject.identifier.system",
        "path": "Appointment.subject.identifier.system",
        "short": "OID registro de número de CIP-SNS",
        "definition": "The namespace for the identifier value. Establishes the namespace for the value - that is, an absolute URL that describes a set values that are unique."
      },
      {
        "id": "Appointment.subject.identifier.value",
        "path": "Appointment.subject.identifier.value",
        "short": "Número CIP-SNS",
        "definition": "The value that is unique. The portion of the identifier typically relevant to the user and which is unique within the context of the system."
      },
      {
        "id": "Appointment.subject.display",
        "path": "Appointment.subject.display",
        "short": "Nombre completo del paciente",
        "definition": "Text alternative for the resource. Plain text narrative that identifies the resource in addition to the resource reference."
      },
      {
        "id": "Appointment.participant",
        "path": "Appointment.participant",
        "slicing": {
          "discriminator": [
            {
              "type": "profile",
              "path": "resource"
            }
          ],
          "rules": "open"
        }
      },
      {
        "id": "Appointment.participant:ProfesionalSanitarioParticipante",
        "path": "Appointment.participant",
        "sliceName": "ProfesionalSanitarioParticipante",
        "short": "Profesional sanitario participante",
        "definition": "Participants involved in appointment. List of participants involved in the appointment.",
        "min": 1
      },
      {
        "id": "Appointment.participant:ProfesionalSanitarioParticipante.actor",
        "path": "Appointment.participant.actor",
        "short": "Referencia al profesional sanitario",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://unicas-fhir.sanidad.gob.es/StructureDefinition/UNICASPractitionerRole",
              "https://unicas-fhir.sanidad.gob.es/StructureDefinition/UNICASPractitioner"
            ]
          }
        ]
      },
      {
        "id": "Appointment.participant:ProfesionalSanitarioParticipante.actor.reference",
        "path": "Appointment.participant.actor.reference",
        "short": "Referencia recurso FHIR. Identificador de la referencia del recurso FHIR asociado cuando exista/creamos un recurso en el mismo servidor FHIR",
        "definition": "Formato: [base]/Practitioner?identifier=[OID registro de DNI]|[Número DNI]"
      },
      {
        "id": "Appointment.participant:ProfesionalSanitarioParticipante.actor.type",
        "path": "Appointment.participant.actor.type",
        "short": "Tipo de recurso FHIR",
        "definition": "Type the reference refers to (e.g. \"Patient\") - must be a resource in resources. 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).",
        "min": 1
      },
      {
        "id": "Appointment.participant:ProfesionalSanitarioParticipante.actor.identifier",
        "path": "Appointment.participant.actor.identifier",
        "short": "Identificadores del profesional sanitario. Cuando no tengamos recurso Practitioner, se debera informar el identificador del profesional sanitario mediante DNI como dato mínimo. Adicionalmente, se puede informar el número colegiado del profesional sanitario como dato recomendado",
        "definition": "Logical reference, when literal reference is not known. An identifier for the target resource. This is used when there is no way to reference the other resource directly, either because the entity it represents is not available through a FHIR server, or because there is no way for the author of the resource to convert a known identifier to an actual location. There is no requirement that a Reference.identifier point to something that is actually exposed as a FHIR instance, but it SHALL point to a business concept that would be expected to be exposed as a FHIR instance, and that instance would need to be of a FHIR resource type allowed by the reference.",
        "min": 1
      },
      {
        "id": "Appointment.participant:ProfesionalSanitarioParticipante.actor.identifier.extension:numeroColegiadoProfesionalSanitario",
        "path": "Appointment.participant.actor.identifier.extension",
        "sliceName": "numeroColegiadoProfesionalSanitario",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "https://unicas-fhir.sanidad.gob.es/StructureDefinition/NumeroColegiadoProfesionalSanitario"
            ]
          }
        ],
        "isModifier": false
      },
      {
        "id": "Appointment.participant:ProfesionalSanitarioParticipante.actor.identifier.type",
        "path": "Appointment.participant.actor.identifier.type",
        "short": "Tipos de documentos de identificación para persona ÚNICAS",
        "definition": "Description of identifier. A coded type for the identifier that can be used to determine which identifier to use for a specific purpose.",
        "binding": {
          "strength": "extensible",
          "description": "Value set de Tipos de documentos de identificación para persona ÚNICAS",
          "valueSet": "https://unicas-fhir.sanidad.gob.es/ValueSet/TiposDocumentosIdentificacionPersona"
        }
      },
      {
        "id": "Appointment.participant:ProfesionalSanitarioParticipante.actor.identifier.type.coding.system",
        "path": "Appointment.participant.actor.identifier.type.coding.system",
        "short": "URL del refset Tipos de documento para identificación personal de SNOMED CT. Extensión para España del SNS",
        "definition": "Posible URL de terminología utilizada para indicar el tipo de documentos de identificación y su descripción correspondiente:\r\n\r\n- Refset Tipos de documento para identificación personal del SNOMED CT. Extensión para España del SNS: http://snomed.info/sct/900000001000122104?fhir_vs-refset/900000251000122107"
      },
      {
        "id": "Appointment.participant:ProfesionalSanitarioParticipante.actor.identifier.type.coding.code",
        "path": "Appointment.participant.actor.identifier.type.coding.code",
        "short": "Código del identificador"
      },
      {
        "id": "Appointment.participant:ProfesionalSanitarioParticipante.actor.identifier.type.coding.display",
        "path": "Appointment.participant.actor.identifier.type.coding.display",
        "short": "Decripción del identificador",
        "definition": "Representation defined by the system. A representation of the meaning of the code in the system, following the rules of the system."
      },
      {
        "id": "Appointment.participant:ProfesionalSanitarioParticipante.actor.identifier.system",
        "path": "Appointment.participant.actor.identifier.system",
        "short": "OID registro de DNI",
        "definition": "The namespace for the identifier value. Establishes the namespace for the value - that is, an absolute URL that describes a set values that are unique."
      },
      {
        "id": "Appointment.participant:ProfesionalSanitarioParticipante.actor.identifier.value",
        "path": "Appointment.participant.actor.identifier.value",
        "short": "Número del DNI",
        "definition": "The value that is unique. The portion of the identifier typically relevant to the user and which is unique within the context of the system."
      },
      {
        "id": "Appointment.participant:ProfesionalSanitarioParticipante.actor.display",
        "path": "Appointment.participant.actor.display",
        "short": "Nombre completo del profesional sanitario",
        "definition": "Text alternative for the resource. Plain text narrative that identifies the resource in addition to the resource reference."
      },
      {
        "id": "Appointment.participant:ServicioAsistencialParticipante",
        "path": "Appointment.participant",
        "sliceName": "ServicioAsistencialParticipante",
        "short": "Servicio asistencial (Localización) participante",
        "definition": "Participants involved in appointment. List of participants involved in the appointment.",
        "min": 1
      },
      {
        "id": "Appointment.participant:ServicioAsistencialParticipante.actor",
        "path": "Appointment.participant.actor",
        "short": "Referencia a la localización y servicio asistencial",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://unicas-fhir.sanidad.gob.es/StructureDefinition/UNICASLocation"
            ]
          }
        ]
      },
      {
        "id": "Appointment.participant:ServicioAsistencialParticipante.actor.reference",
        "path": "Appointment.participant.actor.reference",
        "short": "Referencia recurso FHIR",
        "definition": "Formato: [base]/Location?identifier=urn:regcess:[CódigoREGCESS]|[Id interno del sistema para la localización]"
      },
      {
        "id": "Appointment.participant:ServicioAsistencialParticipante.actor.type",
        "path": "Appointment.participant.actor.type",
        "short": "Tipo de recurso FHIR",
        "definition": "Type the reference refers to (e.g. \"Patient\") - must be a resource in resources. 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)."
      },
      {
        "id": "Appointment.participant:ServicioAsistencialParticipante.actor.identifier",
        "path": "Appointment.participant.actor.identifier",
        "short": "Identificador del recurso FHIR",
        "definition": "Logical reference, when literal reference is not known. An identifier for the target resource. This is used when there is no way to reference the other resource directly, either because the entity it represents is not available through a FHIR server, or because there is no way for the author of the resource to convert a known identifier to an actual location. There is no requirement that a Reference.identifier point to something that is actually exposed as a FHIR instance, but it SHALL point to a business concept that would be expected to be exposed as a FHIR instance, and that instance would need to be of a FHIR resource type allowed by the reference."
      },
      {
        "id": "Appointment.participant:ServicioAsistencialParticipante.actor.identifier.system",
        "path": "Appointment.participant.actor.identifier.system",
        "short": "Sistema para identificar el origen",
        "definition": "Formato: urn:regcess:[CódigoREGCESS] Debe incluir el código REGCESS después de urn:regcess:"
      },
      {
        "id": "Appointment.participant:ServicioAsistencialParticipante.actor.identifier.value",
        "path": "Appointment.participant.actor.identifier.value",
        "short": "Identificador interno del sistema para la localización",
        "definition": "Debe indicar el ID interno del sistema de origen utilizado para la localización."
      }
    ]
  }
}