<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="pt-lm-Endpoint" />
  <text>
    <status value="empty" />
    <div xmlns="http://www.w3.org/1999/xhtml">No narrative is provided for definitional resources. A human-readable rendering can be found in the implementation guide(s) where this resource is used.</div>
  </text>
  <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-type-characteristics">
    <valueCode value="can-be-target" />
  </extension>
  <url value="http://medmij.nl/fhir/StructureDefinition/pt-lm-Endpoint" />
  <name value="PtLmEndpoint" />
  <title value="Endpoint" />
  <status value="draft" />
  <publisher value="MedMij" />
  <contact>
    <name value="MedMij" />
    <telecom>
      <system value="email" />
      <value value="info@medmij.nl" />
      <use value="work" />
    </telecom>
  </contact>
  <description value="Technical FHIR REST endpoint of a source system (XIS), used by a Task to retrieve and update task data and the required context for the Provider Tasks use case." />
  <purpose value="This LogicalModel represents the Endpoint building block for patient use cases in the context of the data service Provider Tasks (Aanbiedertaken)." />
  <copyright value="Copyright and related rights waived via CC0, https://creativecommons.org/publicdomain/zero/1.0/. This does not apply to information from third parties, for example a medical terminology system. The implementer alone is responsible for identifying and obtaining any necessary licenses or authorizations to utilize third party IP in connection with the specification or otherwise." />
  <fhirVersion value="4.0.1" />
  <mapping>
    <identity value="pt-dataset-100-alpha1-20260511" />
    <name value="Dataset Aanbiedertaken MedMij 1.0.0-alpha.2 20260511" />
  </mapping>
  <kind value="logical" />
  <abstract value="false" />
  <type value="http://medmij.nl/fhir/StructureDefinition/pt-lm-Endpoint" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Element" />
  <derivation value="specialization" />
  <snapshot>
    <element id="pt-lm-Endpoint">
      <path value="pt-lm-Endpoint" />
      <short value="Endpoint" />
      <definition value="Technical FHIR REST endpoint of a source system (XIS), used by a Task to retrieve and update task data and the required context for the Provider Tasks use case." />
      <alias value="Endpoint" />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="pt-lm-Endpoint" />
        <min value="0" />
        <max value="*" />
      </base>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() or (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
        <source value="http://hl7.org/fhir/StructureDefinition/Element" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="pt-dataset-100-alpha1-20260511" />
        <map value="pt-dataelement-25" />
        <comment value="Endpoint" />
      </mapping>
    </element>
    <element id="pt-lm-Endpoint.id">
      <path value="pt-lm-Endpoint.id" />
      <representation value="xmlAttr" />
      <short value="Unique id for inter-element referencing" />
      <definition value="Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Element.id" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type">
          <valueUrl value="string" />
        </extension>
        <code value="http://hl7.org/fhirpath/System.String" />
      </type>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
    </element>
    <element id="pt-lm-Endpoint.extension">
      <path value="pt-lm-Endpoint.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <description value="Extensions are always sliced by (at least) url" />
        <rules value="open" />
      </slicing>
      <short value="Additional content defined by implementations" />
      <definition value="May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension." />
      <comment value="There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone." />
      <alias value="extensions" />
      <alias value="user content" />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="Element.extension" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Extension" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() or (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
        <source value="http://hl7.org/fhir/StructureDefinition/Element" />
      </constraint>
      <constraint>
        <key value="ext-1" />
        <severity value="error" />
        <human value="Must have either extensions or value[x], not both" />
        <expression value="extension.exists() != value.exists()" />
        <xpath value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])" />
        <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="pt-lm-Endpoint.ClientID">
      <path value="pt-lm-Endpoint.ClientID" />
      <short value="Client ID" />
      <definition value="The client ID used as the audience input parameter in the token exchange request between PHR and the DVA authorisation server." />
      <comment value="Note that FHIR strings SHALL NOT exceed 1MB in size" />
      <alias value="ClientID" />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="pt-lm-Endpoint.ClientID" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() or (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
        <source value="http://hl7.org/fhir/StructureDefinition/Element" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="pt-dataset-100-alpha1-20260511" />
        <map value="pt-dataelement-26" />
        <comment value="ClientID" />
      </mapping>
    </element>
    <element id="pt-lm-Endpoint.Status">
      <path value="pt-lm-Endpoint.Status" />
      <short value="Status" />
      <definition value="The operational status of the endpoint (e.g., active, suspended, error, off, entered-in-error)." />
      <comment value="Note that FHIR strings SHALL NOT exceed 1MB in size" />
      <alias value="Status" />
      <min value="1" />
      <max value="1" />
      <base>
        <path value="pt-lm-Endpoint.Status" />
        <min value="1" />
        <max value="1" />
      </base>
      <type>
        <code value="code" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() or (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
        <source value="http://hl7.org/fhir/StructureDefinition/Element" />
      </constraint>
      <binding>
        <strength value="required" />
        <valueSet value="http://hl7.org/fhir/ValueSet/endpoint-status" />
      </binding>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="pt-dataset-100-alpha1-20260511" />
        <map value="pt-dataelement-27" />
        <comment value="Status" />
      </mapping>
    </element>
    <element id="pt-lm-Endpoint.ConnectionType">
      <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status">
        <valueCode value="normative" />
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-normative-version">
        <valueCode value="4.0.0" />
      </extension>
      <path value="pt-lm-Endpoint.ConnectionType" />
      <short value="Connection type" />
      <definition value="Protocol/profile used to communicate with the endpoint." />
      <comment value="Codes may be defined very casually in enumerations or code lists, up to very formal definitions such as SNOMED CT - see the HL7 v3 Core Principles for more information." />
      <alias value="Verbindingstype" />
      <min value="1" />
      <max value="1" />
      <base>
        <path value="pt-lm-Endpoint.ConnectionType" />
        <min value="1" />
        <max value="1" />
      </base>
      <type>
        <code value="Coding" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() or (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
        <source value="http://hl7.org/fhir/StructureDefinition/Element" />
      </constraint>
      <binding>
        <strength value="extensible" />
        <valueSet value="http://vzvz.nl/fhir/ValueSet/endpoint-connection-type" />
      </binding>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="CE/CNE/CWE subset one of the sets of component 1-3 or 4-6" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="CV" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:Coding rdfs:subClassOf dt:CDCoding" />
      </mapping>
      <mapping>
        <identity value="pt-dataset-100-alpha1-20260511" />
        <map value="pt-dataelement-28" />
        <comment value="ConnectionType" />
      </mapping>
    </element>
    <element id="pt-lm-Endpoint.ManagingOrganization">
      <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status">
        <valueCode value="normative" />
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-normative-version">
        <valueCode value="4.0.0" />
      </extension>
      <path value="pt-lm-Endpoint.ManagingOrganization" />
      <short value="Managing organization" />
      <definition value="Organization that manages this endpoint (and not necessarily the technical infrastructure hosting it)." />
      <comment value="References SHALL be a reference to an actual FHIR resource, and SHALL be resolveable (allowing for access control, temporary unavailability, etc.). Resolution can be either by retrieval from the URL, or, where applicable by resource type, by treating an absolute reference as a canonical URL and looking it up in a local registry/repository." />
      <alias value="BeherendeOrganisatie" />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="pt-lm-Endpoint.ManagingOrganization" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Organization" />
        <targetProfile value="http://nictiz.nl/fhir/StructureDefinition/nl-core-HealthcareProvider-Organization" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() or (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
        <source value="http://hl7.org/fhir/StructureDefinition/Element" />
      </constraint>
      <constraint>
        <key value="ref-1" />
        <severity value="error" />
        <human value="SHALL have a contained resource if a local reference is provided" />
        <expression value="reference.exists() implies (reference.startsWith('#').not() or (reference.substring(1).trace('url') in %rootResource.contained.id.trace('ids')) or (reference='#' and %rootResource!=%resource))" />
        <xpath value="not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])" />
        <source value="http://hl7.org/fhir/StructureDefinition/Reference" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="The target of a resource reference is a RIM entry point (Act, Role, or Entity)" />
      </mapping>
      <mapping>
        <identity value="pt-dataset-100-alpha1-20260511" />
        <map value="pt-dataelement-29" />
        <comment value="ManagingOrganization" />
      </mapping>
    </element>
  </snapshot>
  <differential>
    <element id="pt-lm-Endpoint">
      <path value="pt-lm-Endpoint" />
      <short value="Endpoint" />
      <definition value="Technical FHIR REST endpoint of a source system (XIS), used by a Task to retrieve and update task data and the required context for the Provider Tasks use case." />
      <alias value="Endpoint" />
      <mapping>
        <identity value="pt-dataset-100-alpha1-20260511" />
        <map value="pt-dataelement-25" />
        <comment value="Endpoint" />
      </mapping>
    </element>
    <element id="pt-lm-Endpoint.ClientID">
      <path value="pt-lm-Endpoint.ClientID" />
      <short value="Client ID" />
      <definition value="The client ID used as the audience input parameter in the token exchange request between PHR and the DVA authorisation server." />
      <alias value="ClientID" />
      <min value="0" />
      <max value="*" />
      <type>
        <code value="string" />
      </type>
      <mapping>
        <identity value="pt-dataset-100-alpha1-20260511" />
        <map value="pt-dataelement-26" />
        <comment value="ClientID" />
      </mapping>
    </element>
    <element id="pt-lm-Endpoint.Status">
      <path value="pt-lm-Endpoint.Status" />
      <short value="Status" />
      <definition value="The operational status of the endpoint (e.g., active, suspended, error, off, entered-in-error)." />
      <alias value="Status" />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="code" />
      </type>
      <binding>
        <strength value="required" />
        <valueSet value="http://hl7.org/fhir/ValueSet/endpoint-status" />
      </binding>
      <mapping>
        <identity value="pt-dataset-100-alpha1-20260511" />
        <map value="pt-dataelement-27" />
        <comment value="Status" />
      </mapping>
    </element>
    <element id="pt-lm-Endpoint.ConnectionType">
      <path value="pt-lm-Endpoint.ConnectionType" />
      <short value="Connection type" />
      <definition value="Protocol/profile used to communicate with the endpoint." />
      <alias value="Verbindingstype" />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="Coding" />
      </type>
      <binding>
        <strength value="extensible" />
        <valueSet value="http://vzvz.nl/fhir/ValueSet/endpoint-connection-type" />
      </binding>
      <mapping>
        <identity value="pt-dataset-100-alpha1-20260511" />
        <map value="pt-dataelement-28" />
        <comment value="ConnectionType" />
      </mapping>
    </element>
    <element id="pt-lm-Endpoint.ManagingOrganization">
      <path value="pt-lm-Endpoint.ManagingOrganization" />
      <short value="Managing organization" />
      <definition value="Organization that manages this endpoint (and not necessarily the technical infrastructure hosting it)." />
      <alias value="BeherendeOrganisatie" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Organization" />
        <targetProfile value="http://nictiz.nl/fhir/StructureDefinition/nl-core-HealthcareProvider-Organization" />
      </type>
      <mapping>
        <identity value="pt-dataset-100-alpha1-20260511" />
        <map value="pt-dataelement-29" />
        <comment value="ManagingOrganization" />
      </mapping>
    </element>
  </differential>
</StructureDefinition>