<StructureDefinition xmlns="http://hl7.org/fhir">
  <url value="https://unicas-fhir.sanidad.gob.es/StructureDefinition/UNICASEndpoint" />
  <name value="UNICASEndpoint" />
  <title value="Endpoint Sistema de Información ÚNICAS" />
  <status value="draft" />
  <description value="Este profile define las restricciones del recurso Endpoint para representar el sistema de información en el contexto del caso de uso de ÚNICAS." />
  <fhirVersion value="5.0.0" />
  <kind value="resource" />
  <abstract value="false" />
  <type value="Endpoint" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Endpoint" />
  <derivation value="constraint" />
  <differential>
    <element id="Endpoint.identifier">
      <path value="Endpoint.identifier" />
      <short value="Identificador único" />
      <definition value="Identifies this endpoint across multiple systems. Identifier for the organization that is used to identify the endpoint across multiple disparate systems." />
      <min value="1" />
    </element>
    <element id="Endpoint.identifier.system">
      <path value="Endpoint.identifier.system" />
      <short value="Sistema para identificar el origen" />
      <definition value="Formato: urn:regcess:[CódigoREGCESS] Debe incluir el código REGCESS después de urn:regcess:" />
      <min value="1" />
      <constraint>
        <key value="regcess-system" />
        <severity value="warning" />
        <human value="system debe comenzar por urn:regcess: seguido del identificador del sistema." />
        <expression value="matches('^urn:regcess:[A-Za-z0-9]+$')" />
      </constraint>
    </element>
    <element id="Endpoint.identifier.value">
      <path value="Endpoint.identifier.value" />
      <short value="Identificador interno del sistema para el sistema de información" />
      <definition value="Debe indicar el ID interno del sistema de origen utilizado para el sistema de información." />
      <min value="1" />
    </element>
    <element id="Endpoint.name">
      <path value="Endpoint.name" />
      <short value="Nombre del sistema de información" />
      <definition value="A name that this endpoint can be identified by. A friendly name that this endpoint can be referred to with." />
    </element>
    <element id="Endpoint.description">
      <path value="Endpoint.description" />
      <short value="Descripción del sistema de información" />
      <definition value="Additional details about the endpoint that could be displayed as further information to identify the description beyond its name. The description of the endpoint and what it is for (typically used as supplemental information in an endpoint directory describing its usage/purpose)." />
    </element>
    <element id="Endpoint.managingOrganization">
      <path value="Endpoint.managingOrganization" />
      <short value="Referencia al servicio asistencial" />
      <definition value="Organization that manages this endpoint (might not be the organization that exposes the endpoint). The organization that manages this endpoint (even if technically another organization is hosting this in the cloud, it is the organization associated with the data)." />
      <type>
        <code value="Reference" />
        <targetProfile value="https://unicas-fhir.sanidad.gob.es/StructureDefinition/UNICASOrganization" />
      </type>
    </element>
    <element id="Endpoint.managingOrganization.reference">
      <path value="Endpoint.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="Endpoint.managingOrganization.type">
      <path value="Endpoint.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="Endpoint.managingOrganization.identifier">
      <path value="Endpoint.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="Endpoint.managingOrganization.identifier.system">
      <path value="Endpoint.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="Endpoint.managingOrganization.identifier.value">
      <path value="Endpoint.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="Endpoint.managingOrganization.display">
      <path value="Endpoint.managingOrganization.display" />
      <short value="Nombre completo del servicio asistencial" />
      <definition value="Text alternative for the resource. Plain text narrative that identifies the resource in addition to the resource reference." />
    </element>
    <element id="Endpoint.address">
      <path value="Endpoint.address" />
      <short value="URL de endpoint" />
      <definition value="The technical base address for connecting to this endpoint. The uri that describes the actual end-point to connect to." />
    </element>
  </differential>
</StructureDefinition>