<StructureDefinition xmlns="http://hl7.org/fhir">
  <url value="https://unicas-fhir.sanidad.gob.es/StructureDefinition/UNICASBundleDiagnosticos" />
  <name value="UNICASBundleDiagnosticos" />
  <title value="Bundle Diagnósticos ÚNICAS" />
  <status value="draft" />
  <description value="Este profile define las restricciones del recurso Bundle para representar el mensaje de registro de estudios diagnósticos en el contexto del caso de uso de ÚNICAS." />
  <fhirVersion value="5.0.0" />
  <kind value="resource" />
  <abstract value="false" />
  <type value="Bundle" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Bundle" />
  <derivation value="constraint" />
  <differential>
    <element id="Bundle.identifier">
      <path value="Bundle.identifier" />
      <short value="Identificador único" />
      <definition value="Persistent identifier for the bundle. A persistent identifier for the bundle that won't change as a bundle is copied from server to server." />
      <min value="1" />
    </element>
    <element id="Bundle.identifier.type">
      <path value="Bundle.identifier.type" />
      <short value="Tipo de informe/información Ú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 informes para ÚNICAS" />
        <valueSet value="https://unicas-fhir.sanidad.gob.es/ValueSet/TiposInformesUNICAS" />
      </binding>
    </element>
    <element id="Bundle.identifier.type.coding">
      <path value="Bundle.identifier.type.coding" />
      <patternCoding>
        <system value="http://snomed.info/sct/900000001000122104" />
        <code value="721981007" />
        <display value="informe de estudios diagnósticos" />
      </patternCoding>
    </element>
    <element id="Bundle.identifier.type.coding.system">
      <path value="Bundle.identifier.type.coding.system" />
      <short value="URL del refset Documentos del CMDIC | URL del SNOMED CT. Extensión para España del SNS" />
      <definition value="Identity of the terminology system. The identification of the code system that defines the meaning of the symbol in the code." />
    </element>
    <element id="Bundle.identifier.type.coding.code">
      <path value="Bundle.identifier.type.coding.code" />
      <short value="Código del tipo de informe/información ÚNICAS" />
    </element>
    <element id="Bundle.identifier.type.coding.display">
      <path value="Bundle.identifier.type.coding.display" />
      <short value="Descripción del tipo de informe/información ÚNICAS" />
      <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="Bundle.identifier.system">
      <path value="Bundle.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." />
      <min value="1" />
    </element>
    <element id="Bundle.identifier.value">
      <path value="Bundle.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." />
      <min value="1" />
    </element>
    <element id="Bundle.type">
      <path value="Bundle.type" />
      <patternCode value="transaction" />
    </element>
    <element id="Bundle.timestamp">
      <path value="Bundle.timestamp" />
      <short value="Fecha y hora de envío del mensaje en el Nodo Autonómico (Effective Time)" />
      <definition value="When the bundle was assembled. The date/time that the bundle was assembled - i.e. when the resources were placed in the bundle." />
      <min value="1" />
    </element>
    <element id="Bundle.entry">
      <path value="Bundle.entry" />
      <slicing>
        <discriminator>
          <type value="profile" />
          <path value="resource" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <min value="1" />
    </element>
    <element id="Bundle.entry:EncounterInteraccionClinica">
      <path value="Bundle.entry" />
      <sliceName value="EncounterInteraccionClinica" />
      <short value="Registro de la interacción clínica" />
      <min value="1" />
    </element>
    <element id="Bundle.entry:EncounterInteraccionClinica.fullUrl">
      <path value="Bundle.entry.fullUrl" />
      <min value="1" />
    </element>
    <element id="Bundle.entry:EncounterInteraccionClinica.resource">
      <path value="Bundle.entry.resource" />
      <short value="Referencia al registro de la interacción clínica" />
      <min value="1" />
      <type>
        <code value="Encounter" />
        <profile value="https://unicas-fhir.sanidad.gob.es/StructureDefinition/UNICASEncounter" />
      </type>
    </element>
    <element id="Bundle.entry:EncounterInteraccionClinica.resource.subject.identifier.type">
      <path value="Bundle.entry.resource.subject.identifier.type" />
      <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="Bundle.entry:EncounterInteraccionClinica.resource.participant.actor.identifier.type">
      <path value="Bundle.entry.resource.participant.actor.identifier.type" />
      <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="Bundle.entry:EncounterInteraccionClinica.request">
      <path value="Bundle.entry.request" />
      <short value="Información de ejecución" />
      <definition value="Additional execution information (transaction/batch/history). Additional information about how this entry should be processed as part of a transaction or batch. For history, it shows how the entry was processed to create the version contained in the entry." />
      <min value="1" />
    </element>
    <element id="Bundle.entry:EncounterInteraccionClinica.request.method">
      <path value="Bundle.entry.request.method" />
      <short value="Método de interacción" />
      <definition value="In a transaction or batch, this is the HTTP action to be executed for this entry. In a history bundle, this indicates the HTTP action that occurred (GET | HEAD | POST | PUT | DELETE | PATCH)." />
    </element>
    <element id="Bundle.entry:EncounterInteraccionClinica.request.url">
      <path value="Bundle.entry.request.url" />
      <short value="URL de este entry, relativa a la raíz" />
      <definition value="Formato de publicación condicional: [base]/Encounter?identifier=urn:regcess:[CódigoREGCESS]|[Id interno del sistema para la interacción clínica]" />
    </element>
    <element id="Bundle.entry:ConditionDiagnosticos">
      <path value="Bundle.entry" />
      <sliceName value="ConditionDiagnosticos" />
      <short value="Registro de estudios diagnósticos" />
      <definition value="Entry in the bundle - will have a resource or information. An entry in a bundle resource - will either contain a resource or information about a resource (transactions and history only)." />
      <min value="1" />
    </element>
    <element id="Bundle.entry:ConditionDiagnosticos.fullUrl">
      <path value="Bundle.entry.fullUrl" />
      <min value="1" />
    </element>
    <element id="Bundle.entry:ConditionDiagnosticos.resource">
      <path value="Bundle.entry.resource" />
      <short value="Referencia al registro de estudio diagnóstico" />
      <definition value="A Diagnostic report - a combination of request information, atomic results, images, interpretation, as well as formatted reports. The findings and interpretation of diagnostic tests performed on patients, groups of patients, products, substances, devices, and locations, and/or specimens derived from these. The report includes clinical context such as requesting provider information, and some mix of atomic results, images, textual and coded interpretations, and formatted representation of diagnostic reports. The report also includes non-clinical context such as batch analysis and stability reporting of products and substances." />
      <min value="1" />
      <type>
        <code value="Condition" />
        <profile value="https://unicas-fhir.sanidad.gob.es/StructureDefinition/UNICASConditionDiagnostico" />
      </type>
    </element>
    <element id="Bundle.entry:ConditionDiagnosticos.resource.subject.identifier.type">
      <path value="Bundle.entry.resource.subject.identifier.type" />
      <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="Bundle.entry:ConditionDiagnosticos.resource.participant.actor.identifier.type">
      <path value="Bundle.entry.resource.participant.actor.identifier.type" />
      <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="Bundle.entry:ConditionDiagnosticos.request">
      <path value="Bundle.entry.request" />
      <short value="Información de ejecución" />
      <definition value="Additional execution information (transaction/batch/history). Additional information about how this entry should be processed as part of a transaction or batch. For history, it shows how the entry was processed to create the version contained in the entry." />
      <min value="1" />
    </element>
    <element id="Bundle.entry:ConditionDiagnosticos.request.method">
      <path value="Bundle.entry.request.method" />
      <short value="Método de interacción" />
      <definition value="In a transaction or batch, this is the HTTP action to be executed for this entry. In a history bundle, this indicates the HTTP action that occurred (GET | HEAD | POST | PUT | DELETE | PATCH)." />
    </element>
    <element id="Bundle.entry:ConditionDiagnosticos.request.url">
      <path value="Bundle.entry.request.url" />
      <short value="URL de este entry, relativa a la raíz" />
      <definition value="Formato de publicación condicional: [base]/Condition?identifier=urn:regcess:[CódigoREGCESS]|[Id interno del sistema para el diagnóstico]" />
    </element>
  </differential>
</StructureDefinition>