{
  "resourceType": "StructureDefinition",
  "url": "https://unicas-fhir.sanidad.gob.es/StructureDefinition/UNICASAllergyIntolerance",
  "name": "UNICASAllergyIntolerance",
  "title": "AllergyIntolerance Alergia ÚNICAS",
  "status": "draft",
  "description": "Este profile define las restricciones del recurso AllergyIntolerance para representar el registro de una alergia en el contexto del caso de uso de ÚNICAS.",
  "fhirVersion": "5.0.0",
  "kind": "resource",
  "abstract": false,
  "type": "AllergyIntolerance",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/AllergyIntolerance",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "AllergyIntolerance.identifier",
        "path": "AllergyIntolerance.identifier",
        "short": "Identificador único",
        "definition": "External ids for this item. Business identifiers assigned to this AllergyIntolerance by the performer or other systems which remain constant as the resource is updated and propagates from server to server.",
        "min": 1
      },
      {
        "id": "AllergyIntolerance.identifier.system",
        "path": "AllergyIntolerance.identifier.system",
        "short": "Sistema para identificar el origen",
        "definition": "Formato: urn:regcess:[CódigoREGCESS]\r\nDebe 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": "AllergyIntolerance.identifier.value",
        "path": "AllergyIntolerance.identifier.value",
        "short": "Identificador interno del sistema para la alergia",
        "definition": "Debe indicar el ID interno del sistema de origen utilizado para la alergia.",
        "min": 1
      },
      {
        "id": "AllergyIntolerance.clinicalStatus",
        "path": "AllergyIntolerance.clinicalStatus",
        "short": "Estado de la alergia",
        "definition": "The clinical status of the allergy or intolerance. (active | inactive | resolved)"
      },
      {
        "id": "AllergyIntolerance.verificationStatus",
        "path": "AllergyIntolerance.verificationStatus",
        "short": "Nivel de certeza",
        "definition": "Assertion about certainty associated with the propensity, or potential risk, of a reaction to the identified substance (including pharmaceutical product).  The verification status pertains to the allergy or intolerance, itself, not to any specific AllergyIntolerance attribute. (unconfirmed | presumed | confirmed | refuted | entered-in-error)"
      },
      {
        "id": "AllergyIntolerance.criticality",
        "path": "AllergyIntolerance.criticality",
        "short": "Criticidad clínica",
        "definition": "Estimate of the potential clinical harm, or seriousness, of the reaction to the identified substance. (low | high | unable-to-assess)"
      },
      {
        "id": "AllergyIntolerance.code",
        "path": "AllergyIntolerance.code",
        "short": "Agente causal",
        "definition": "Code that identifies the allergy or intolerance. Code for an allergy or intolerance statement (either a positive or a negated/excluded statement).  This may be a code for a substance or pharmaceutical product that is considered to be responsible for the adverse reaction risk (e.g., \"Latex\"), an allergy or intolerance condition (e.g., \"Latex allergy\"), or a negated/excluded code for a specific substance or class (e.g., \"No latex allergy\") or a general or categorical negated statement (e.g.,  \"No known allergy\", \"No known drug allergies\").  Note: the substance for a specific reaction may be different from the substance identified as the cause of the risk, but it must be consistent with it. For instance, it may be a more specific substance (e.g. a brand medication) or a composite product that includes the identified substance. It must be clinically safe to only process the 'code' and ignore the 'reaction.substance'.  If a receiving system is unable to confirm that AllergyIntolerance.reaction.substance falls within the semantic scope of AllergyIntolerance.code, then the receiving system should ignore AllergyIntolerance.reaction.substance.",
        "min": 1,
        "binding": {
          "strength": "extensible",
          "description": "Value set de Agente causal",
          "valueSet": "https://unicas-fhir.sanidad.gob.es/ValueSet/AgenteCausal"
        }
      },
      {
        "id": "AllergyIntolerance.code.coding.system",
        "path": "AllergyIntolerance.code.coding.system",
        "short": "URL del SNOMED CT. Extensión para España del SNS",
        "definition": "Posible URL de terminología utilizada para indicar el agente causal y su descripción correspondiente:\r\n\r\n- SNOMED CT. Extensión para España del SNS con filtro aplicado a los ejes sustancia, producto, objeto físico y fuerza física: http://snomed.info/sct/900000001000122104",
        "min": 1
      },
      {
        "id": "AllergyIntolerance.code.coding.code",
        "path": "AllergyIntolerance.code.coding.code",
        "short": "Código del agente causal",
        "min": 1
      },
      {
        "id": "AllergyIntolerance.code.coding.display",
        "path": "AllergyIntolerance.code.coding.display",
        "short": "Descripción del agente causal",
        "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": "AllergyIntolerance.patient",
        "path": "AllergyIntolerance.patient",
        "short": "Referencia al paciente",
        "definition": "Who the allergy or intolerance is for. The patient who has the allergy or intolerance.",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://unicas-fhir.sanidad.gob.es/StructureDefinition/UNICASPatient"
            ]
          }
        ]
      },
      {
        "id": "AllergyIntolerance.patient.reference",
        "path": "AllergyIntolerance.patient.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": "AllergyIntolerance.patient.type",
        "path": "AllergyIntolerance.patient.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": "AllergyIntolerance.patient.identifier",
        "path": "AllergyIntolerance.patient.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": "AllergyIntolerance.patient.identifier.type",
        "path": "AllergyIntolerance.patient.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": "AllergyIntolerance.patient.identifier.type.coding.system",
        "path": "AllergyIntolerance.patient.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": "AllergyIntolerance.patient.identifier.type.coding.code",
        "path": "AllergyIntolerance.patient.identifier.type.coding.code",
        "short": "Código del identificador"
      },
      {
        "id": "AllergyIntolerance.patient.identifier.type.coding.display",
        "path": "AllergyIntolerance.patient.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": "AllergyIntolerance.patient.identifier.system",
        "path": "AllergyIntolerance.patient.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": "AllergyIntolerance.patient.identifier.value",
        "path": "AllergyIntolerance.patient.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": "AllergyIntolerance.patient.display",
        "path": "AllergyIntolerance.patient.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": "AllergyIntolerance.encounter",
        "path": "AllergyIntolerance.encounter",
        "short": "Referencia a la interacción clínica",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://unicas-fhir.sanidad.gob.es/StructureDefinition/UNICASEncounter"
            ]
          }
        ]
      },
      {
        "id": "AllergyIntolerance.encounter.reference",
        "path": "AllergyIntolerance.encounter.reference",
        "short": "Referencia recurso FHIR",
        "definition": "Formato: [base]/Encounter?identifier=urn:regcess:[CódigoREGCESS]|[Id interno del sistema para la interacción clínica]"
      },
      {
        "id": "AllergyIntolerance.encounter.type",
        "path": "AllergyIntolerance.encounter.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": "AllergyIntolerance.encounter.identifier",
        "path": "AllergyIntolerance.encounter.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": "AllergyIntolerance.encounter.identifier.system",
        "path": "AllergyIntolerance.encounter.identifier.system",
        "short": "Sistema para identificar el origen",
        "definition": "Formato: urn:regcess:[CódigoREGCESS]\r\nDebe incluir el código REGCESS después de urn:regcess:"
      },
      {
        "id": "AllergyIntolerance.encounter.identifier.value",
        "path": "AllergyIntolerance.encounter.identifier.value",
        "short": "Identificador interno del sistema para la interacción clínica",
        "definition": "Debe indicar el ID interno del sistema de origen utilizado para la interacción clínica"
      },
      {
        "id": "AllergyIntolerance.onset[x]",
        "path": "AllergyIntolerance.onset[x]",
        "short": "Fecha de inicio (Fecha en que se identificó por primera vez la alergia o ocurrió la primera reacción)",
        "definition": "When allergy or intolerance was identified. Estimated or actual date,  date-time, or age when allergy or intolerance was identified.",
        "min": 1,
        "type": [
          {
            "code": "dateTime"
          }
        ]
      },
      {
        "id": "AllergyIntolerance.participant",
        "path": "AllergyIntolerance.participant",
        "short": "Profesional sanitario",
        "definition": "Who or what participated in the activities related to the allergy or intolerance and how they were involved. Indicates who or what participated in the activities related to the allergy or intolerance and how they were involved.",
        "min": 1
      },
      {
        "id": "AllergyIntolerance.participant.actor",
        "path": "AllergyIntolerance.participant.actor",
        "short": "Referencia al profesional sanitario",
        "definition": "Who or what participated in the activities related to the allergy or intolerance. Indicates who or what participated in the activities related to the allergy or intolerance.",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://unicas-fhir.sanidad.gob.es/StructureDefinition/UNICASPractitionerRole",
              "https://unicas-fhir.sanidad.gob.es/StructureDefinition/UNICASPractitioner",
              "https://unicas-fhir.sanidad.gob.es/StructureDefinition/UNICASOrganization"
            ]
          }
        ]
      },
      {
        "id": "AllergyIntolerance.participant.actor.reference",
        "path": "AllergyIntolerance.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": "AllergyIntolerance.participant.actor.type",
        "path": "AllergyIntolerance.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": "AllergyIntolerance.participant.actor.identifier",
        "path": "AllergyIntolerance.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": "AllergyIntolerance.participant.actor.identifier.extension:numeroColegiadoProfesionalSanitario",
        "path": "AllergyIntolerance.participant.actor.identifier.extension",
        "sliceName": "numeroColegiadoProfesionalSanitario",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "https://unicas-fhir.sanidad.gob.es/StructureDefinition/NumeroColegiadoProfesionalSanitario"
            ]
          }
        ],
        "isModifier": false
      },
      {
        "id": "AllergyIntolerance.participant.actor.identifier.type",
        "path": "AllergyIntolerance.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": "AllergyIntolerance.participant.actor.identifier.type.coding.system",
        "path": "AllergyIntolerance.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": "AllergyIntolerance.participant.actor.identifier.type.coding.code",
        "path": "AllergyIntolerance.participant.actor.identifier.type.coding.code",
        "short": "Código del identificador"
      },
      {
        "id": "AllergyIntolerance.participant.actor.identifier.type.coding.display",
        "path": "AllergyIntolerance.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": "AllergyIntolerance.participant.actor.identifier.system",
        "path": "AllergyIntolerance.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": "AllergyIntolerance.participant.actor.identifier.value",
        "path": "AllergyIntolerance.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": "AllergyIntolerance.participant.actor.display",
        "path": "AllergyIntolerance.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": "AllergyIntolerance.lastOccurrence",
        "path": "AllergyIntolerance.lastOccurrence",
        "short": "Fecha de fin (Puede corresponder a la fecha de la última ocurrencia de la reacción alérgica)",
        "definition": "Date(/time) of last known occurrence of a reaction. Represents the date and/or time of the last known occurrence of a reaction event."
      },
      {
        "id": "AllergyIntolerance.note",
        "path": "AllergyIntolerance.note",
        "short": "Comentario",
        "definition": "Additional text not captured in other fields. Additional narrative about the propensity for the Adverse Reaction, not captured in other fields."
      },
      {
        "id": "AllergyIntolerance.note.text",
        "path": "AllergyIntolerance.note.text",
        "short": "Comentario",
        "definition": "The annotation  - text content (as markdown). The text of the annotation in markdown format."
      },
      {
        "id": "AllergyIntolerance.reaction.substance",
        "path": "AllergyIntolerance.reaction.substance",
        "short": "Agente causal",
        "definition": "Specific substance or pharmaceutical product considered to be responsible for event. Identification of the specific substance (or pharmaceutical product) considered to be responsible for the Adverse Reaction event. Note: the substance for a specific reaction may be different from the substance identified as the cause of the risk, but it must be consistent with it. For instance, it may be a more specific substance (e.g. a brand medication) or a composite product that includes the identified substance. It must be clinically safe to only process the 'code' and ignore the 'reaction.substance'.  If a receiving system is unable to confirm that AllergyIntolerance.reaction.substance falls within the semantic scope of AllergyIntolerance.code, then the receiving system should ignore AllergyIntolerance.reaction.substance.",
        "binding": {
          "strength": "extensible",
          "description": "Value set de Agente causal",
          "valueSet": "https://unicas-fhir.sanidad.gob.es/ValueSet/AgenteCausal"
        }
      },
      {
        "id": "AllergyIntolerance.reaction.substance.coding.system",
        "path": "AllergyIntolerance.reaction.substance.coding.system",
        "short": "URL del SNOMED CT. Extensión para España del SNS",
        "definition": "Posible URL de terminología utilizada para indicar el agente causal y su descripción correspondiente:\r\n\r\n- SNOMED CT. Extensión para España del SNS con filtro aplicado a los ejes sustancia, producto, objeto físico y fuerza física: http://snomed.info/sct/900000001000122104"
      },
      {
        "id": "AllergyIntolerance.reaction.substance.coding.code",
        "path": "AllergyIntolerance.reaction.substance.coding.code",
        "short": "Código del agente causal"
      },
      {
        "id": "AllergyIntolerance.reaction.substance.coding.display",
        "path": "AllergyIntolerance.reaction.substance.coding.display",
        "short": "Descripción del agente causal",
        "definition": "Representation defined by the system. A representation of the meaning of the code in the system, following the rules of the system."
      },
      {
        "id": "AllergyIntolerance.reaction.manifestation",
        "path": "AllergyIntolerance.reaction.manifestation",
        "short": "Manifestación clínica",
        "definition": "Clinical symptoms/signs associated with the Event. Clinical symptoms and/or signs that are observed or associated with the adverse reaction event.",
        "binding": {
          "strength": "extensible",
          "description": "Value set de Manifestaciones clínicas",
          "valueSet": "https://unicas-fhir.sanidad.gob.es/ValueSet/ManifestacionesClinicas"
        }
      },
      {
        "id": "AllergyIntolerance.reaction.manifestation.concept",
        "path": "AllergyIntolerance.reaction.manifestation.concept",
        "short": "Manifestación clínica",
        "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": "AllergyIntolerance.reaction.manifestation.concept.coding.system",
        "path": "AllergyIntolerance.reaction.manifestation.concept.coding.system",
        "short": "URL del SNOMED CT. Extensión para España del SNS | OID de la terminología CIE-10-ES. Diagnósticos",
        "definition": "Posibles URLs y/o OIDs de terminologías utilizadas para indicar la manifestación clínica y su descripción correspondiente:\r\n\n- SNOMED CT. Extensión para España del SNS con filtro aplicado a los ejes hallazgo y situación: http://snomed.info/sct/900000001000122104\n- CIE-10-ES. Diagnósticos: urn:oid:2.16.724.4.21.5.29",
        "min": 1
      },
      {
        "id": "AllergyIntolerance.reaction.manifestation.concept.coding.code",
        "path": "AllergyIntolerance.reaction.manifestation.concept.coding.code",
        "short": "Código de la manifestación clínica",
        "min": 1
      },
      {
        "id": "AllergyIntolerance.reaction.manifestation.concept.coding.display",
        "path": "AllergyIntolerance.reaction.manifestation.concept.coding.display",
        "short": "Descripción de la manifestación clínica",
        "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": "AllergyIntolerance.reaction.severity",
        "path": "AllergyIntolerance.reaction.severity",
        "short": "Gravedad de la reacción",
        "definition": "Clinical assessment of the severity of the reaction event as a whole, potentially considering multiple different manifestations. (mild | moderate | severe (of event as a whole))"
      }
    ]
  }
}