<StructureDefinition xmlns="http://hl7.org/fhir">
  <url value="https://unicas-fhir.sanidad.gob.es/StructureDefinition/UNICASPatient" />
  <name value="UNICASPatient" />
  <title value="Patient Paciente ÚNICAS" />
  <status value="draft" />
  <description value="Este profile define las restricciones del recurso Patient para representar el paciente en el contexto del caso de uso de ÚNICAS.&#xD;&#xA;&#xD;&#xA;En el contexto de ÚNICAS, el identificador que debe utilizarse para referenciar y buscar al paciente debe de ser el CIPSNS. Además, el paciente puede albergar de forma opcional otros identificadores que formarán parte de su información core, como por ejemplo el CIP autonómico o el DNI.&#xD;&#xA;&#xD;&#xA;Se muestran a continuación los valores que tomarían los atributos de `Patient.identifier` para estos casos:&#xD;&#xA;&#xD;&#xA;---&#xD;&#xA;&#xD;&#xA;**Para el CIPSNS:**&#xD;&#xA;&#xD;&#xA;- **Type**: corresponde con el tipo de código de identificación personal en el Sistema Nacional de Salud (System: `http://snomed.info/sct/900000001000122104` y Code: `1551000122105`)&#xD;&#xA;- **Value**: corresponde con el identificador CIPSNS de paciente&#xD;&#xA;- **System**: corresponde con el valor `urn:oid:2.16.724.4.40`&#xD;&#xA;&#xD;&#xA;---&#xD;&#xA;&#xD;&#xA;**Para el CIP-AUT:**&#xD;&#xA;&#xD;&#xA;- **Type**: corresponde con el tipo de código de identificación del paciente en la comunidad autónoma (System: `http://snomed.info/sct/900000001000122104` y Code: `1571000122102`)&#xD;&#xA;- **Value**: corresponde con el identificador CIP-AUT de paciente&#xD;&#xA;- **System**: corresponde con un valor de la siguiente tabla, según sea la Comunidad Autónoma del CIP-AUT:&#xD;&#xA;  - ANDALUCIA: urn:cite:80724000049&#xD;&#xA;  - ARAGON: urn:cite:80724000106&#xD;&#xA;  - ASTURIAS: urn:cite:80724000056&#xD;&#xA;  - ILLES BALEARS: urn:cite:80724000148&#xD;&#xA;  - CANARIAS: urn:cite:80724000122&#xD;&#xA;  - CANTABRIA: urn:cite:80724000064&#xD;&#xA;  - CASTILLA Y LEON: urn:cite:80724000171&#xD;&#xA;  - CASTILLA LA MANCHA: urn:cite:80724000114&#xD;&#xA;  - CATALUÑA: urn:cite:80724000015&#xD;&#xA;  - COMUNITAT VALENCIANA: urn:cite:80724000098&#xD;&#xA;  - EXTREMADURA: urn:cite:80724000130&#xD;&#xA;  - GALICIA: urn:cite:80724000031&#xD;&#xA;  - MADRID: urn:cite:80724000163&#xD;&#xA;  - MURCIA: urn:cite:80724000080&#xD;&#xA;  - NAVARRA: urn:cite:80724000155&#xD;&#xA;  - PAIS VASCO: urn:cite:80724000023&#xD;&#xA;  - LA RIOJA: urn:cite:80724000072&#xD;&#xA;  - CEUTA: urn:cite:80724000189&#xD;&#xA;  - MELILLA: urn:cite:80724000197&#xD;&#xA;&#xD;&#xA;---&#xD;&#xA;&#xD;&#xA;**Para el DNI:**&#xD;&#xA;&#xD;&#xA;- **Type**: corresponde con el tipo del documento nacional de identidad (System: `http://snomed.info/sct/900000001000122104?fhir_vs-refset/900000251000122107` y Code: `22851000122109`)&#xD;&#xA;- **Value**: corresponde con el valor del DNI&#xD;&#xA;- **System**: corresponde con el valor `urn:oid:1.3.6.1.4.1.19126.3`" />
  <fhirVersion value="5.0.0" />
  <kind value="resource" />
  <abstract value="false" />
  <type value="Patient" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Patient" />
  <derivation value="constraint" />
  <differential>
    <element id="Patient.extension:edadPaciente">
      <path value="Patient.extension" />
      <sliceName value="edadPaciente" />
      <type>
        <code value="Extension" />
        <profile value="https://unicas-fhir.sanidad.gob.es/StructureDefinition/EdadPaciente" />
      </type>
    </element>
    <element id="Patient.extension:estadoEnrolamientoPaciente">
      <path value="Patient.extension" />
      <sliceName value="estadoEnrolamientoPaciente" />
      <type>
        <code value="Extension" />
        <profile value="https://unicas-fhir.sanidad.gob.es/StructureDefinition/EstadoEnrolamientoPaciente" />
      </type>
    </element>
    <element id="Patient.extension:momento-unicas">
      <path value="Patient.extension" />
      <sliceName value="momentoUNICASPaciente" />
      <definition value="Momento ÚNICAS en el que se encuentra el paciente. Este dato nunca debe generarse como parte de la instancia por parte de los sistemas de información, pero sí será devuelto y gestionado por el NA cuando se realice la consulta de datos de un paciente." />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="https://unicas-fhir.sanidad.gob.es/StructureDefinition/MomentosUnicas" />
      </type>
    </element>
    <element id="Patient.extension:nodoAltaUnicas">
      <path value="Patient.extension" />
      <sliceName value="nodoAltaUnicas" />
      <definition value="Nodo autonómico que realiza el enrolamiento del paciente. Este dato nunca debe generarse como parte de la instancia por parte de los sistemas de información, pero sí será devuelto y gestionado por el NA cuando se realice la consulta de datos de un paciente." />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="https://unicas-fhir.sanidad.gob.es/StructureDefinition/NodoCCAA" />
      </type>
    </element>
    <element id="Patient.extension:nodoInscripcionUnicas">
      <path value="Patient.extension" />
      <sliceName value="nodoInscripcionUnicas" />
      <definition value="Nodos autonómicos donde el paciente está inscrito. Este dato nunca debe generarse como parte de la instancia por parte de los sistemas de información, pero sí será devuelto y gestionado por el NA cuando se realice la consulta de datos de un paciente." />
      <type>
        <code value="Extension" />
        <profile value="https://unicas-fhir.sanidad.gob.es/StructureDefinition/NodoCCAA" />
      </type>
    </element>
    <element id="Patient.identifier">
      <path value="Patient.identifier" />
      <short value="Identificadores del paciente (Pueden ser documento nacional de identidad, pasaporte, tarjeta de identidad de extranjero, número de historia clínica, número de afiliación a la Seguridad Social, código de identificación del paciente en la comunidad autónoma, código de identificación personal en el Sistema Nacional de Salud, código de identificación personal europeo)" />
      <min value="1" />
    </element>
    <element id="Patient.identifier.type">
      <path value="Patient.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="Patient.identifier.type.coding.system">
      <path value="Patient.identifier.type.coding.system" />
      <short value="URL del refset Tipos de documento para identificación personal de SNOMED CT. Extensión para España del SNS | 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="Patient.identifier.type.coding.code">
      <path value="Patient.identifier.type.coding.code" />
      <short value="Código del identificador" />
    </element>
    <element id="Patient.identifier.type.coding.display">
      <path value="Patient.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="Patient.identifier.system">
      <path value="Patient.identifier.system" />
      <short value="OID registro según el tipo de documento de identificación" />
      <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="Patient.identifier.value">
      <path value="Patient.identifier.value" />
      <short value="Código según el tipo de documento de identificación" />
      <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="Patient.name">
      <path value="Patient.name" />
      <min value="1" />
    </element>
    <element id="Patient.name.text">
      <path value="Patient.name.text" />
      <short value="Nombre completo del paciente" />
      <definition value="Text representation of the full name. Specifies the entire name as it should be displayed e.g. on an application UI. This may be provided instead of or as well as the specific parts." />
    </element>
    <element id="Patient.name.family">
      <path value="Patient.name.family" />
      <short value="Apellidos del paciente" />
      <definition value="Family name (often called 'Surname'). The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father." />
      <min value="1" />
    </element>
    <element id="Patient.name.family.extension">
      <path value="Patient.name.family.extension" />
      <min value="1" />
    </element>
    <element id="Patient.name.family.extension:primerApellido">
      <path value="Patient.name.family.extension" />
      <sliceName value="primerApellido" />
      <short value="Primer apellido del paciente" />
      <definition value="Portion of family name derived from father. The portion of the family name that is derived from the person's father." />
      <min value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://hl7.org/fhir/StructureDefinition/humanname-fathers-family" />
      </type>
      <isModifier value="false" />
    </element>
    <element id="Patient.name.family.extension:segundoApellido">
      <path value="Patient.name.family.extension" />
      <sliceName value="segundoApellido" />
      <short value="Segundo apellido del paciente" />
      <definition value="Portion of family name derived from mother. The portion of the family name that is derived from the person's mother." />
      <type>
        <code value="Extension" />
        <profile value="http://hl7.org/fhir/StructureDefinition/humanname-mothers-family" />
      </type>
      <isModifier value="false" />
    </element>
    <element id="Patient.name.given">
      <path value="Patient.name.given" />
      <short value="Nombre del paciente" />
      <definition value="Given names (not always 'first'). Includes middle names" />
      <min value="1" />
    </element>
    <element id="Patient.telecom">
      <path value="Patient.telecom" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="system" />
        </discriminator>
        <discriminator>
          <type value="value" />
          <path value="use" />
        </discriminator>
        <rules value="open" />
      </slicing>
    </element>
    <element id="Patient.telecom:Telefono">
      <path value="Patient.telecom" />
      <sliceName value="Telefono" />
      <short value="Teléfono móvil de contacto" />
      <definition value="A contact detail for the individual. A contact detail (e.g. a telephone number or an email address) by which the individual may be contacted." />
      <fixedContactPoint>
        <system value="phone" />
        <use value="mobile" />
      </fixedContactPoint>
    </element>
    <element id="Patient.telecom:Telefono.system">
      <path value="Patient.telecom.system" />
      <short value="phone" />
      <definition value="Telecommunications form for contact point - what communications system is required to make use of the contact (phone | fax | email | pager | url | sms | other)." />
    </element>
    <element id="Patient.telecom:Telefono.value">
      <path value="Patient.telecom.value" />
      <short value="Número de teléfono móvil" />
    </element>
    <element id="Patient.telecom:OtroTelefonos">
      <path value="Patient.telecom" />
      <sliceName value="OtroTelefonos" />
      <short value="Otro teléfonos" />
      <definition value="A contact detail for the individual. A contact detail (e.g. a telephone number or an email address) by which the individual may be contacted." />
      <fixedContactPoint>
        <system value="phone" />
        <use value="home" />
      </fixedContactPoint>
    </element>
    <element id="Patient.telecom:OtroTelefonos.system">
      <path value="Patient.telecom.system" />
      <short value="phone" />
      <definition value="Telecommunications form for contact point - what communications system is required to make use of the contact (phone | fax | email | pager | url | sms | other)." />
    </element>
    <element id="Patient.telecom:OtroTelefonos.value">
      <path value="Patient.telecom.value" />
      <short value="Número de teléfono" />
    </element>
    <element id="Patient.telecom:CorreoElectronico">
      <path value="Patient.telecom" />
      <sliceName value="CorreoElectronico" />
      <short value="Correo electrónico" />
      <definition value="A contact detail for the individual. A contact detail (e.g. a telephone number or an email address) by which the individual may be contacted." />
      <fixedContactPoint>
        <system value="email" />
      </fixedContactPoint>
    </element>
    <element id="Patient.telecom:CorreoElectronico.system">
      <path value="Patient.telecom.system" />
      <short value="email" />
      <definition value="Telecommunications form for contact point - what communications system is required to make use of the contact (phone | fax | email | pager | url | sms | other)." />
    </element>
    <element id="Patient.telecom:CorreoElectronico.value">
      <path value="Patient.telecom.value" />
      <short value="Dirección de correo electrónico" />
    </element>
    <element id="Patient.gender">
      <path value="Patient.gender" />
      <short value="Sexo asignado al nacer" />
      <definition value="Administrative Gender - the gender that the patient is considered to have for administration and record keeping purposes. (male | female | other | unknown)" />
      <min value="1" />
    </element>
    <element id="Patient.birthDate">
      <path value="Patient.birthDate" />
      <short value="Fecha de nacimiento del paciente" />
      <min value="1" />
    </element>
    <element id="Patient.deceased[x]">
      <path value="Patient.deceased[x]" />
      <short value="Fallecido/a" />
    </element>
    <element id="Patient.address">
      <path value="Patient.address" />
      <short value="Domicilio del paciente" />
      <min value="0" />
    </element>
    <element id="Patient.address.extension">
      <path value="Patient.address.extension" />
      <min value="0" />
    </element>
    <element id="Patient.address.extension:provincia">
      <path value="Patient.address.extension" />
      <sliceName value="provincia" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="https://unicas-fhir.sanidad.gob.es/StructureDefinition/Provincia" />
      </type>
      <isModifier value="false" />
    </element>
    <element id="Patient.address.line">
      <path value="Patient.address.line" />
      <short value="Tipo de vía, Nombre de vía, Número de vía, Piso, Letra del paciente" />
      <definition value="Street name, number, direction &amp; P.O. Box etc. This component contains the house number, apartment number, street name, street direction, P.O. Box number, delivery hints, and similar address information." />
      <min value="0" />
    </element>
    <element id="Patient.address.city">
      <path value="Patient.address.city" />
      <short value="Ciudad" />
      <min value="0" />
    </element>
    <element id="Patient.address.district">
      <path value="Patient.address.district" />
      <short value="Municipio en la dirección" />
      <min value="0" />
    </element>
    <element id="Patient.address.state">
      <path value="Patient.address.state" />
      <short value="Comunidad Autónoma" />
      <definition value="Sub-unit of country (abbreviations ok). Sub-unit of a country with limited sovereignty in a federally organized country. A code may be used if codes are in common use (e.g. US 2 letter state codes)." />
      <min value="0" />
    </element>
    <element id="Patient.address.postalCode">
      <path value="Patient.address.postalCode" />
      <short value="Código postal" />
      <definition value="Postal code for area. A postal code designating a region defined by the postal service" />
      <min value="0" />
    </element>
    <element id="Patient.address.country">
      <path value="Patient.address.country" />
      <short value="País" />
      <definition value="Country - a nation as commonly understood or generally accepted. (e.g. may be ISO 3166 2 or 3 letter code)" />
      <min value="0" />
    </element>
    <element id="Patient.contact">
      <path value="Patient.contact" />
      <short value="Persona de contacto del paciente" />
    </element>
    <element id="Patient.contact.relationship">
      <path value="Patient.contact.relationship" />
      <short value="Tipo de relación de la persona contacto con el paciente" />
      <definition value="The kind of relationship. The nature of the relationship between the patient and the contact person." />
      <binding>
        <strength value="extensible" />
        <description value="Value set de Tipos de relaciones entre el paciente y su persona de contacto en ÚNICAS" />
        <valueSet value="https://unicas-fhir.sanidad.gob.es/ValueSet/TiposRelacionesPersonaContacto" />
      </binding>
    </element>
    <element id="Patient.contact.relationship.coding.system">
      <path value="Patient.contact.relationship.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 relación de la persona contacto con el paciente 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="Patient.contact.relationship.coding.code">
      <path value="Patient.contact.relationship.coding.code" />
      <short value="Código del tipo de relación entre el paciente y su persona de contacto" />
    </element>
    <element id="Patient.contact.relationship.coding.display">
      <path value="Patient.contact.relationship.coding.display" />
      <short value="Descripción del tipo de relación entre el paciente y su persona de contacto" />
      <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="Patient.contact.name.text">
      <path value="Patient.contact.name.text" />
      <short value="Nombre completo de la persona contacto" />
      <definition value="Text representation of the full name. Specifies the entire name as it should be displayed e.g. on an application UI. This may be provided instead of or as well as the specific parts." />
    </element>
    <element id="Patient.contact.name.family">
      <path value="Patient.contact.name.family" />
      <short value="Apellidos de la persona contacto" />
      <definition value="Family name (often called 'Surname'). The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father." />
    </element>
    <element id="Patient.contact.name.family.extension:primerApellido">
      <path value="Patient.contact.name.family.extension" />
      <sliceName value="primerApellido" />
      <short value="Primer apellido de la persona contacto" />
      <definition value="Portion of family name derived from father. The portion of the family name that is derived from the person's father." />
      <type>
        <code value="Extension" />
        <profile value="http://hl7.org/fhir/StructureDefinition/humanname-fathers-family" />
      </type>
      <isModifier value="false" />
    </element>
    <element id="Patient.contact.name.family.extension:segundoApellido">
      <path value="Patient.contact.name.family.extension" />
      <sliceName value="segundoApellido" />
      <short value="Segundo apellido de la persona contacto" />
      <definition value="Portion of family name derived from mother. The portion of the family name that is derived from the person's mother." />
      <type>
        <code value="Extension" />
        <profile value="http://hl7.org/fhir/StructureDefinition/humanname-mothers-family" />
      </type>
      <isModifier value="false" />
    </element>
    <element id="Patient.contact.name.given">
      <path value="Patient.contact.name.given" />
      <short value="Nombre de la persona contacto" />
      <definition value="Given names (not always 'first'). Includes middle names" />
    </element>
    <element id="Patient.contact.telecom">
      <path value="Patient.contact.telecom" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="system" />
        </discriminator>
        <rules value="open" />
      </slicing>
    </element>
    <element id="Patient.contact.telecom:Telefono">
      <path value="Patient.contact.telecom" />
      <sliceName value="Telefono" />
      <short value="Teléfonos de contacto" />
      <definition value="A contact detail for the person. A contact detail for the person, e.g. a telephone number or an email address." />
    </element>
    <element id="Patient.contact.telecom:Telefono.system">
      <path value="Patient.contact.telecom.system" />
      <short value="phone" />
      <definition value="Telecommunications form for contact point - what communications system is required to make use of the contact (phone | fax | email | pager | url | sms | other)." />
      <fixedCode value="phone" />
    </element>
    <element id="Patient.contact.telecom:Telefono.value">
      <path value="Patient.contact.telecom.value" />
      <short value="Número de teléfono" />
    </element>
    <element id="Patient.contact.telecom:CorreoElectronico">
      <path value="Patient.contact.telecom" />
      <sliceName value="CorreoElectronico" />
      <short value="Correo electrónico de contacto" />
    </element>
    <element id="Patient.contact.telecom:CorreoElectronico.system">
      <path value="Patient.contact.telecom.system" />
      <short value="email" />
      <definition value="Telecommunications form for contact point - what communications system is required to make use of the contact (phone | fax | email | pager | url | sms | other)." />
      <fixedCode value="email" />
    </element>
    <element id="Patient.contact.telecom:CorreoElectronico.value">
      <path value="Patient.contact.telecom.value" />
      <short value="Dirección de correo electrónico de contacto" />
    </element>
    <element id="Patient.managingOrganization">
      <path value="Patient.managingOrganization" />
      <short value="Referencia al centro de atención primaria" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://unicas-fhir.sanidad.gob.es/StructureDefinition/UNICASOrganization" />
      </type>
    </element>
    <element id="Patient.managingOrganization.reference">
      <path value="Patient.managingOrganization.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]/Organization?identifier=[OID registro de número de REGCESS]|[Código REGCESS de la institución]" />
    </element>
    <element id="Patient.managingOrganization.type">
      <path value="Patient.managingOrganization.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.&#xA;&#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)." />
      <min value="1" />
    </element>
    <element id="Patient.managingOrganization.identifier">
      <path value="Patient.managingOrganization.identifier" />
      <short value="Identificador del centro de atención primaria. Cuando no tengamos recurso Organization, se debera informar el identificador de institución mediante código REGCESS" />
      <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." />
      <min value="1" />
    </element>
    <element id="Patient.managingOrganization.identifier.system">
      <path value="Patient.managingOrganization.identifier.system" />
      <short value="OID registro de número de REGCESS" />
      <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="Patient.managingOrganization.identifier.value">
      <path value="Patient.managingOrganization.identifier.value" />
      <short value="Código REGCESS" />
      <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="Patient.managingOrganization.display">
      <path value="Patient.managingOrganization.display" />
      <short value="Nombre completo del centro de atención primaria" />
      <definition value="Text alternative for the resource. Plain text narrative that identifies the resource in addition to the resource reference." />
    </element>
  </differential>
</StructureDefinition>