{
  "resourceType": "StructureDefinition",
  "url": "https://unicas-fhir.sanidad.gob.es/StructureDefinition/UNICASObservationHabitoNoSaludable",
  "name": "UNICASObservationHabitoNoSaludable",
  "title": "Observation Hábito No Saludable ÚNICAS",
  "status": "draft",
  "description": "Este profile define las restricciones del recurso Observation para representar el registro de hábito no saludable en el contexto del caso de uso de ÚNICAS.",
  "fhirVersion": "5.0.0",
  "kind": "resource",
  "abstract": false,
  "type": "Observation",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Observation",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Observation.identifier",
        "path": "Observation.identifier",
        "short": "Identificador único",
        "definition": "Business Identifier for observation. A unique identifier assigned to this observation.",
        "min": 1
      },
      {
        "id": "Observation.identifier.system",
        "path": "Observation.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": "Observation.identifier.value",
        "path": "Observation.identifier.value",
        "short": "Identificador interno del sistema para el hábito no saludable",
        "definition": "Debe indicar el ID interno del sistema de origen utilizado para el hábito no saludable.",
        "min": 1
      },
      {
        "id": "Observation.category",
        "path": "Observation.category",
        "short": "Clasificación de observación: hallazgo relacionado con conductas vinculadas a la salud",
        "binding": {
          "strength": "extensible",
          "description": "Value set de Tipos de informaciones para ÚNICAS",
          "valueSet": "https://unicas-fhir.sanidad.gob.es/ValueSet/TiposInformacionesUNICAS"
        }
      },
      {
        "id": "Observation.category.coding.system",
        "path": "Observation.category.coding.system",
        "short": "URL del SNOMED CT. Extensión para España del SNS",
        "definition": "Posible URL de terminología utilizada para indicar la clasificación de observació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": "Observation.category.coding.code",
        "path": "Observation.category.coding.code",
        "short": "Código de la clasificación de observación"
      },
      {
        "id": "Observation.category.coding.display",
        "path": "Observation.category.coding.display",
        "short": "Descripción de la clasificación de observación",
        "definition": "Representation defined by the system. A representation of the meaning of the code in the system, following the rules of the system."
      },
      {
        "id": "Observation.code",
        "path": "Observation.code",
        "short": "Hábito no saludable",
        "definition": "Type of observation (code / type). Describes what was observed. Sometimes this is called the observation \"name\".",
        "binding": {
          "strength": "extensible",
          "description": "Value set de Hábitos y Patrones de consumo",
          "valueSet": "https://unicas-fhir.sanidad.gob.es/ValueSet/HabitosYPatronesConsumo"
        }
      },
      {
        "id": "Observation.code.coding.system",
        "path": "Observation.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 hábito no saludable y su descripción correspondiente:\r\n\r\n- SNOMED CT. Extensión para España del SNS con filtro aplicado a los ejes entidad observable y hallazgo: http://snomed.info/sct/900000001000122104",
        "min": 1
      },
      {
        "id": "Observation.code.coding.code",
        "path": "Observation.code.coding.code",
        "short": "Código del hábito no saludable",
        "min": 1
      },
      {
        "id": "Observation.code.coding.display",
        "path": "Observation.code.coding.display",
        "short": "Descripción del hábito no saludable",
        "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": "Observation.subject",
        "path": "Observation.subject",
        "short": "Referencia al paciente",
        "definition": "Who and/or what the observation is about. The patient, or group of patients, location, device, organization, procedure or practitioner this observation is about and into whose or what record the observation is placed. If the actual focus of the observation is different from the subject (or a sample of, part, or region of the subject), the `focus` element or the `code` itself specifies the actual focus of the observation.",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://unicas-fhir.sanidad.gob.es/StructureDefinition/UNICASPatient"
            ]
          }
        ]
      },
      {
        "id": "Observation.subject.reference",
        "path": "Observation.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": "Observation.subject.type",
        "path": "Observation.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.\r\n\r\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": "Observation.subject.identifier",
        "path": "Observation.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": "Observation.subject.identifier.type",
        "path": "Observation.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": "Observation.subject.identifier.type.coding.system",
        "path": "Observation.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": "Observation.subject.identifier.type.coding.code",
        "path": "Observation.subject.identifier.type.coding.code",
        "short": "Código del identificador"
      },
      {
        "id": "Observation.subject.identifier.type.coding.display",
        "path": "Observation.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": "Observation.subject.identifier.system",
        "path": "Observation.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": "Observation.subject.identifier.value",
        "path": "Observation.subject.identifier.value",
        "short": "Número 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": "Observation.subject.display",
        "path": "Observation.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": "Observation.effective[x]",
        "path": "Observation.effective[x]",
        "short": "Periodo de consumo",
        "definition": "Clinically relevant time/time-period for observation. The time or time-period the observed value is asserted as being true. For biological subjects - e.g. human patients - this is usually called the \"physiologically relevant time\". This is usually either the time of the procedure or of specimen collection, but very often the source of the date/time is not known, only the date/time itself.",
        "min": 1,
        "type": [
          {
            "code": "Period"
          }
        ]
      },
      {
        "id": "Observation.effective[x].start",
        "path": "Observation.effective[x].start",
        "short": "Fecha de incio del consumo",
        "definition": "Starting time with inclusive boundary. The start of the period. The boundary is inclusive.",
        "min": 1
      },
      {
        "id": "Observation.effective[x].end",
        "path": "Observation.effective[x].end",
        "short": "Fecha de fin de consumo",
        "definition": "End time with inclusive boundary, if not ongoing. The end of the period. If the end of the period is missing, it means no end was known or planned at the time the instance was created. The start may be in the past, and the end date in the future, which means that period is expected/planned to end at that time."
      },
      {
        "id": "Observation.performer",
        "path": "Observation.performer",
        "short": "Referencia al profesional sanitario",
        "definition": "Who is responsible for the observation. Who was responsible for asserting the observed value as \"true\".",
        "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": "Observation.performer.reference",
        "path": "Observation.performer.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": "Observation.performer.type",
        "path": "Observation.performer.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": "Observation.performer.identifier",
        "path": "Observation.performer.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": "Observation.performer.identifier.extension:numeroColegiadoProfesionalSanitario",
        "path": "Observation.performer.identifier.extension",
        "sliceName": "numeroColegiadoProfesionalSanitario",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "https://unicas-fhir.sanidad.gob.es/StructureDefinition/NumeroColegiadoProfesionalSanitario"
            ]
          }
        ],
        "isModifier": false
      },
      {
        "id": "Observation.performer.identifier.type",
        "path": "Observation.performer.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": "Observation.performer.identifier.type.coding.system",
        "path": "Observation.performer.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": "Observation.performer.identifier.type.coding.code",
        "path": "Observation.performer.identifier.type.coding.code",
        "short": "Código del identificador"
      },
      {
        "id": "Observation.performer.identifier.type.coding.display",
        "path": "Observation.performer.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": "Observation.performer.identifier.system",
        "path": "Observation.performer.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": "Observation.performer.identifier.value",
        "path": "Observation.performer.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": "Observation.performer.display",
        "path": "Observation.performer.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": "Observation.component",
        "path": "Observation.component",
        "short": "Patrón y dosis de consumo",
        "definition": "Component results. Some observations have multiple component observations.  These component observations are expressed as separate code value pairs that share the same attributes.  Examples include systolic and diastolic component observations for blood pressure measurement and multiple component observations for genetics observations."
      },
      {
        "id": "Observation.component.code",
        "path": "Observation.component.code",
        "short": "Patrón de consumo",
        "definition": "Type of component observation (code / type). Describes what was observed. Sometimes this is called the observation \"code\".",
        "binding": {
          "strength": "extensible",
          "description": "Value set de Hábitos y Patrones de consumo",
          "valueSet": "https://unicas-fhir.sanidad.gob.es/ValueSet/HabitosYPatronesConsumo"
        }
      },
      {
        "id": "Observation.component.code.coding.system",
        "path": "Observation.component.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 patrón de consumo y su descripción correspondiente:\r\n\r\n- SNOMED CT. Extensión para España del SNS con filtro aplicado a los ejes entidad observable y hallazgo: http://snomed.info/sct/900000001000122104",
        "min": 1
      },
      {
        "id": "Observation.component.code.coding.code",
        "path": "Observation.component.code.coding.code",
        "short": "Código de patrón de consumo",
        "min": 1
      },
      {
        "id": "Observation.component.code.coding.display",
        "path": "Observation.component.code.coding.display",
        "short": "Descripción de patrón de consumo",
        "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": "Observation.component.value[x]",
        "path": "Observation.component.value[x]",
        "short": "Dosis",
        "definition": "Actual component result. The information determined as a result of making the observation, if the information has a simple value.",
        "type": [
          {
            "code": "Quantity"
          }
        ]
      },
      {
        "id": "Observation.component.value[x].value",
        "path": "Observation.component.value[x].value",
        "short": "Dosis consumida",
        "definition": "Numerical value (with implicit precision). The value of the measured amount. The value includes an implicit precision in the presentation of the value."
      },
      {
        "id": "Observation.component.value[x].unit",
        "path": "Observation.component.value[x].unit",
        "short": "Unidad de dosis",
        "definition": "Unit representation. A human-readable form of the unit."
      },
      {
        "id": "Observation.component.value[x].system",
        "path": "Observation.component.value[x].system",
        "short": "URL del catálogo UCUM",
        "definition": "- Unified Code for Units of Measure (UCUM): http://unitsofmeasure.org"
      },
      {
        "id": "Observation.component.value[x].code",
        "path": "Observation.component.value[x].code",
        "short": "Código de la unidad de la dosis",
        "definition": "Coded form of the unit. A computer processable form of the unit in some unit representation system."
      }
    ]
  }
}