<StructureDefinition xmlns="http://hl7.org/fhir">
  <url value="https://unicas-fhir.sanidad.gob.es/StructureDefinition/UNICASTask" />
  <name value="UNICASTask" />
  <title value="Task Tarea ÚNICAS" />
  <status value="draft" />
  <description value="Este profile define las restricciones del recurso Task para representar el registro de tarea en el proceso de ÚNICAS." />
  <fhirVersion value="5.0.0" />
  <kind value="resource" />
  <abstract value="false" />
  <type value="Task" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Task" />
  <derivation value="constraint" />
  <differential>
    <element id="Task.contained">
      <path value="Task.contained" />
      <type>
        <code value="Resource" />
        <profile value="https://unicas-fhir.sanidad.gob.es/StructureDefinition/UNICASPractitionerRole" />
      </type>
    </element>
    <element id="Task.identifier">
      <path value="Task.identifier" />
      <short value="Identificador único" />
      <definition value="Task Instance Identifier. The business identifier for this task." />
    </element>
    <element id="Task.identifier.system">
      <path value="Task.identifier.system" />
      <short value="Sistema de identificador" />
      <definition value="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." />
    </element>
    <element id="Task.identifier.value">
      <path value="Task.identifier.value" />
      <short value="Valor de identificador" />
      <definition value="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." />
    </element>
    <element id="Task.status">
      <path value="Task.status" />
      <short value="draft | requested | received | accepted | rejected | ready | cancelled | in-progress | on-hold | failed | complete | entered-in-error" />
    </element>
    <element id="Task.code">
      <path value="Task.code" />
      <short value="Tipo de evento ÚNICAS" />
      <definition value="Task Type. A name or code (or both) briefly describing what the task involves." />
    </element>
    <element id="Task.for">
      <path value="Task.for" />
      <short value="Referencia al paciente" />
      <definition value="Beneficiary of the Task. The entity who benefits from the performance of the service specified in the task (e.g., the patient)." />
      <min value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://unicas-fhir.sanidad.gob.es/StructureDefinition/UNICASPatient" />
      </type>
    </element>
    <element id="Task.for.reference">
      <path value="Task.for.reference" />
      <short value="Referencia recurso FHIR. Identificador de la referencia del recurso FHIR asociado cuando exista/creamos un recurso en el mismo servidor FHIR" />
      <definition value="Formato: [base]/Patient?identifier=[OID registro de número de CIP-SNS]|[Número CIP-SNS]" />
    </element>
    <element id="Task.for.type">
      <path value="Task.for.type" />
      <short value="Tipo de recurso FHIR" />
      <definition value="Type the reference refers to (e.g. &quot;Patient&quot;) - 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.&#xD;&#xA;&#xD;&#xA;The 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. &quot;Patient&quot; 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)." />
    </element>
    <element id="Task.for.identifier">
      <path value="Task.for.identifier" />
      <short value="Identificador de paciente CIP-SNS. Cuando no tengamos recurso Patient, se debera informar el identificador de paciente mediante CIP-SNS" />
      <definition value="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." />
    </element>
    <element id="Task.for.identifier.type">
      <path value="Task.for.identifier.type" />
      <short value="Tipos de documentos de identificación para persona ÚNICAS" />
      <definition value="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 value="extensible" />
        <description value="Value set de Tipos de documentos de identificación para persona ÚNICAS" />
        <valueSet value="https://unicas-fhir.sanidad.gob.es/ValueSet/TiposDocumentosIdentificacionPersona" />
      </binding>
    </element>
    <element id="Task.for.identifier.type.coding.system">
      <path value="Task.for.identifier.type.coding.system" />
      <short value="URL del SNOMED CT. Extensión para España del SNS" />
      <definition value="Posible URL de terminología utilizada para indicar el tipo de documentos de identificación y su descripción correspondiente:&#xD;&#xA;&#xD;&#xA;- SNOMED CT. Extensión para España del SNS: http://snomed.info/sct/900000001000122104" />
    </element>
    <element id="Task.for.identifier.type.coding.code">
      <path value="Task.for.identifier.type.coding.code" />
      <short value="Código del identificador" />
    </element>
    <element id="Task.for.identifier.type.coding.display">
      <path value="Task.for.identifier.type.coding.display" />
      <short value="Decripción del identificador" />
      <definition value="Representation defined by the system. A representation of the meaning of the code in the system, following the rules of the system." />
    </element>
    <element id="Task.for.identifier.system">
      <path value="Task.for.identifier.system" />
      <short value="OID registro de número de CIP-SNS" />
      <definition value="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." />
    </element>
    <element id="Task.for.identifier.value">
      <path value="Task.for.identifier.value" />
      <short value="Número CIP-SNS" />
      <definition value="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." />
    </element>
    <element id="Task.for.display">
      <path value="Task.for.display" />
      <short value="Nombre completo del paciente" />
      <definition value="Text alternative for the resource. Plain text narrative that identifies the resource in addition to the resource reference." />
    </element>
    <element id="Task.encounter">
      <path value="Task.encounter" />
      <short value="Referencia a la interacción clínica" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://unicas-fhir.sanidad.gob.es/StructureDefinition/UNICASEncounter" />
      </type>
    </element>
    <element id="Task.encounter.reference">
      <path value="Task.encounter.reference" />
      <short value="Referencia recurso FHIR" />
      <definition value="Formato: [base]/Encounter?identifier=urn:regcess:[CódigoREGCESS]|[Id interno del sistema para la interacción clínica]" />
    </element>
    <element id="Task.encounter.type">
      <path value="Task.encounter.type" />
      <short value="Tipo de recurso FHIR" />
      <definition value="Type the reference refers to (e.g. &quot;Patient&quot;) - 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.&#xD;&#xA;&#xD;&#xA;The 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. &quot;Patient&quot; 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)." />
    </element>
    <element id="Task.encounter.identifier">
      <path value="Task.encounter.identifier" />
      <short value="Identificador del recurso FHIR" />
      <definition value="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." />
    </element>
    <element id="Task.encounter.identifier.system">
      <path value="Task.encounter.identifier.system" />
      <short value="Sistema para identificar el origen" />
      <definition value="Formato: urn:regcess:[CódigoREGCESS]&#xD;&#xA;Debe incluir el código REGCESS después de urn:regcess:" />
    </element>
    <element id="Task.encounter.identifier.value">
      <path value="Task.encounter.identifier.value" />
      <short value="Identificador interno del sistema para la interacción clínica" />
      <definition value="Debe indicar el ID interno del sistema de origen utilizado para la interacción clínica." />
    </element>
    <element id="Task.requester">
      <path value="Task.requester" />
      <short value="Referencia al autor o Institución que solicita la ejecución de la tarea" />
      <definition value="Who is asking for task to be done. The creator of the task." />
      <type>
        <code value="Reference" />
        <targetProfile value="https://unicas-fhir.sanidad.gob.es/StructureDefinition/UNICASOrganization" />
        <targetProfile value="https://unicas-fhir.sanidad.gob.es/StructureDefinition/UNICASPractitionerRole" />
        <targetProfile value="https://unicas-fhir.sanidad.gob.es/StructureDefinition/UNICASPractitioner" />
        <targetProfile value="https://unicas-fhir.sanidad.gob.es/StructureDefinition/UNICASPatient" />
      </type>
    </element>
    <element id="Task.requester.reference">
      <path value="Task.requester.reference" />
      <short value="Referencia recurso FHIR" />
      <definition value="Literal reference, Relative, internal or absolute URL. 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." />
    </element>
    <element id="Task.requester.type">
      <path value="Task.requester.type" />
      <short value="Tipo de recurso FHIR" />
      <definition value="Type the reference refers to (e.g. &quot;Patient&quot;) - 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.&#xD;&#xA;&#xD;&#xA;The 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. &quot;Patient&quot; 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)." />
    </element>
    <element id="Task.requester.identifier">
      <path value="Task.requester.identifier" />
      <short value="Identificador del autor o Institución que solicita la ejecución de la tarea" />
      <definition value="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." />
    </element>
    <element id="Task.requester.display">
      <path value="Task.requester.display" />
      <short value="Nombre del autor o Institución que solicita la ejecución de la tarea" />
      <definition value="Text alternative for the resource. Plain text narrative that identifies the resource in addition to the resource reference." />
    </element>
    <element id="Task.requestedPerformer">
      <path value="Task.requestedPerformer" />
      <short value="Autor o Institución específico que debe realizar la tarea" />
      <definition value="Who should perform Task. The kind of participant or specific participant that should perform the task." />
      <type>
        <code value="CodeableReference" />
        <targetProfile value="https://unicas-fhir.sanidad.gob.es/StructureDefinition/UNICASOrganization" />
        <targetProfile value="https://unicas-fhir.sanidad.gob.es/StructureDefinition/UNICASPractitionerRole" />
        <targetProfile value="https://unicas-fhir.sanidad.gob.es/StructureDefinition/UNICASPractitioner" />
        <targetProfile value="https://unicas-fhir.sanidad.gob.es/StructureDefinition/UNICASPatient" />
      </type>
    </element>
    <element id="Task.requestedPerformer.reference">
      <path value="Task.requestedPerformer.reference" />
      <short value="Referencia al autor o Institución específico que debe realizar la tarea" />
      <definition value="Reference to a resource (by instance). A reference to a resource the provides exact details about the information being referenced." />
    </element>
    <element id="Task.requestedPerformer.reference.reference">
      <path value="Task.requestedPerformer.reference.reference" />
      <short value="Referencia recurso FHIR" />
      <definition value="Literal reference, Relative, internal or absolute URL. 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." />
    </element>
    <element id="Task.requestedPerformer.reference.type">
      <path value="Task.requestedPerformer.reference.type" />
      <short value="Tipo de recurso FHIR" />
      <definition value="Type the reference refers to (e.g. &quot;Patient&quot;) - 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.&#xD;&#xA;&#xD;&#xA;The 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. &quot;Patient&quot; 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)." />
    </element>
    <element id="Task.requestedPerformer.reference.identifier">
      <path value="Task.requestedPerformer.reference.identifier" />
      <short value="Identificador del autor o Institución específico que debe realizar la tarea" />
      <definition value="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." />
    </element>
    <element id="Task.requestedPerformer.reference.display">
      <path value="Task.requestedPerformer.reference.display" />
      <short value="Nombre del autor o Institución específico que debe realizar la tarea" />
      <definition value="Text alternative for the resource. Plain text narrative that identifies the resource in addition to the resource reference." />
    </element>
    <element id="Task.input">
      <path value="Task.input" />
      <short value="Entrada para realizar la tarea" />
      <definition value="Information used to perform task. Additional information that may be needed in the execution of the task." />
    </element>
    <element id="Task.input.type">
      <path value="Task.input.type" />
      <short value="Tipo de actividad ÚNICAS" />
      <definition value="Label for the input. A code or description indicating how the input is intended to be used as part of the task execution." />
      <binding>
        <strength value="example" />
        <description value="Value set de Actividades ÚNICAS" />
        <valueSet value="https://unicas-fhir.sanidad.gob.es/ValueSet/ActividadesUNICAS" />
      </binding>
    </element>
    <element id="Task.input.value[x]">
      <path value="Task.input.value[x]" />
      <short value="Tipo de informe/información ÚNICAS" />
      <definition value="Content to use in performing the task. The value of the input parameter as a basic type." />
      <binding>
        <strength value="example" />
        <description value="Value set de Tipos de informes para ÚNICAS" />
        <valueSet value="https://unicas-fhir.sanidad.gob.es/ValueSet/TiposInformesUNICAS" />
      </binding>
    </element>
    <element id="Task.output">
      <path value="Task.output" />
      <short value="Resultado generado como parte de la tarea" />
      <definition value="Information produced as part of task. Outputs produced by the Task." />
    </element>
    <element id="Task.output.type">
      <path value="Task.output.type" />
      <binding>
        <strength value="example" />
        <description value="Value set de Actividades ÚNICAS" />
        <valueSet value="https://unicas-fhir.sanidad.gob.es/ValueSet/ActividadesUNICAS" />
      </binding>
    </element>
  </differential>
</StructureDefinition>