{
  "resourceType": "StructureDefinition",
  "url": "https://unicas-fhir.sanidad.gob.es/StructureDefinition/UNICASLocation",
  "name": "UNICASLocation",
  "title": "Location Localización y Servicio Asistencial ÚNICAS",
  "status": "draft",
  "description": "Este profile define las restricciones del recurso Location para representar la localización y el servicio asistencial en el contexto del caso de uso de ÚNICAS.",
  "fhirVersion": "5.0.0",
  "kind": "resource",
  "abstract": false,
  "type": "Location",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Location",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Location.identifier",
        "path": "Location.identifier",
        "short": "Identificador único",
        "definition": "Unique code or number identifying the location to its users",
        "min": 1
      },
      {
        "id": "Location.identifier.system",
        "path": "Location.identifier.system",
        "short": "Sistema para identificar el origen",
        "definition": "Formato: urn:regcess:[CódigoREGCESS] Debe 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": "Location.identifier.value",
        "path": "Location.identifier.value",
        "short": "Identificador interno del sistema para la localización",
        "definition": "Debe indicar el ID interno del sistema de origen utilizado para la localización.",
        "min": 1
      },
      {
        "id": "Location.name",
        "path": "Location.name",
        "short": "Lugar donde se realiza la cita",
        "min": 1
      },
      {
        "id": "Location.description",
        "path": "Location.description",
        "short": "Descripción completa de lugar donde se realiza la cita",
        "definition": "Additional details about the location that could be displayed as further information to identify the location beyond its name. Description of the Location, which helps in finding or referencing the place."
      },
      {
        "id": "Location.managingOrganization",
        "path": "Location.managingOrganization",
        "short": "Referencia al servicio asistencial donde se realiza la cita",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://unicas-fhir.sanidad.gob.es/StructureDefinition/UNICASOrganization"
            ]
          }
        ]
      },
      {
        "id": "Location.managingOrganization.reference",
        "path": "Location.managingOrganization.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]/Organization?identifier=[OID registro de número de REGCESS]|[Código REGCESS de la institución]"
      },
      {
        "id": "Location.managingOrganization.type",
        "path": "Location.managingOrganization.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": "Location.managingOrganization.identifier",
        "path": "Location.managingOrganization.identifier",
        "short": "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": "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": "Location.managingOrganization.identifier.system",
        "path": "Location.managingOrganization.identifier.system",
        "short": "OID registro de número de REGCESS",
        "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": "Location.managingOrganization.identifier.value",
        "path": "Location.managingOrganization.identifier.value",
        "short": "Código REGCESS",
        "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": "Location.managingOrganization.display",
        "path": "Location.managingOrganization.display",
        "short": "Nombre completo del servicio asistencial",
        "definition": "Text alternative for the resource. Plain text narrative that identifies the resource in addition to the resource reference."
      }
    ]
  }
}