<?xml version="1.0" encoding="UTF-8"?>

<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="pt-lm-ServiceRequest"/>
  <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>
  <url value="http://medmij.nl/fhir/StructureDefinition/pt-lm-ServiceRequest"/>
  <version value="0.1.0"/>
  <name value="LmServiceRequest"/>
  <title value="ServiceRequest"/>
  <status value="active"/>
  <date value="2026-05-08T08:30:17+00:00"/>
  <publisher value="koppelmij"/>
  <contact>
    <name value="koppelmij"/>
    <telecom>
      <system value="url"/>
      <value value="https://github.com/KoppelMij/"/>
    </telecom>
  </contact>
  <description value="Patient-specific clinical order for a digital (eHealth) activity that a healthcare professional requests for a patient, such as completing a questionnaire, performing home measurements, viewing educational content, or launching a third-party module."/>
  <purpose value="To represent the clinical order to start or perform a specific digital (eHealth) activity for a patient. This ServiceRequest provides the clinical intent, context, requested schedule, and patient-specific instructions, and can serve as the basis for one or more Task resources that manage execution and tracking of the activity."/>
  <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="rim"/>
    <uri value="http://hl7.org/v3"/>
    <name value="RIM Mapping"/>
  </mapping>
  <kind value="logical"/>
  <abstract value="true"/>
  <type value="http://medmij.nl/fhir/StructureDefinition/pt-lm-ServiceRequest"/>
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Element"/>
  <derivation value="specialization"/>
  <snapshot>
    <extension url="http://hl7.org/fhir/tools/StructureDefinition/snapshot-base-version">
      <valueString value="4.0.1"/>
    </extension>
    <element id="pt-lm-ServiceRequest">
      <path value="pt-lm-ServiceRequest"/>
      <short value="ServiceRequest"/>
      <definition value="Patient-specific clinical order for a digital (eHealth) activity that a healthcare professional requests for a patient, such as completing a questionnaire, performing home measurements, viewing educational content, or launching a third-party module."/>
      <alias value="Zorgopdracht"/>
      <min value="0"/>
      <max value="*"/>
      <base>
        <path value="Element"/>
        <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>
      <isModifier value="false"/>
      <mapping>
        <identity value="rim"/>
        <map value="n/a"/>
      </mapping>
    </element>
    <element id="pt-lm-ServiceRequest.id">
      <path value="pt-lm-ServiceRequest.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>
      <isModifier value="false"/>
      <isSummary value="false"/>
      <mapping>
        <identity value="rim"/>
        <map value="n/a"/>
      </mapping>
    </element>
    <element id="pt-lm-ServiceRequest.extension">
      <path value="pt-lm-ServiceRequest.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>
      <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(.), &quot;value&quot;)])"/>
        <source value="http://hl7.org/fhir/StructureDefinition/Extension"/>
      </constraint>
      <isModifier value="false"/>
      <isSummary value="false"/>
      <mapping>
        <identity value="rim"/>
        <map value="n/a"/>
      </mapping>
    </element>
    <element id="pt-lm-ServiceRequest.Identifier">
      <path value="pt-lm-ServiceRequest.Identifier"/>
      <short value="Business identifier that uniquely identifies this ServiceRequest within or across systems."/>
      <definition value="Business identifier that uniquely identifies this ServiceRequest within or across systems."/>
      <alias value="Identifier"/>
      <min value="0"/>
      <max value="*"/>
      <base>
        <path value="pt-lm-ServiceRequest.Identifier"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <type>
        <code value="Identifier"/>
      </type>
    </element>
    <element id="pt-lm-ServiceRequest.Status">
      <path value="pt-lm-ServiceRequest.Status"/>
      <short value="Current state of the service request (e.g. draft, active, completed, cancelled)."/>
      <definition value="Current state of the service request (e.g. draft, active, completed, cancelled)."/>
      <alias value="Status"/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="pt-lm-ServiceRequest.Status"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="code"/>
      </type>
    </element>
    <element id="pt-lm-ServiceRequest.Intent">
      <path value="pt-lm-ServiceRequest.Intent"/>
      <short value="Indicates the level of authority or intention associated with the request (e.g., order or plan)."/>
      <definition value="Indicates the level of authority or intention associated with the request (e.g., order or plan)."/>
      <alias value="Bedoeling"/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="pt-lm-ServiceRequest.Intent"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="code"/>
      </type>
    </element>
    <element id="pt-lm-ServiceRequest.Subject">
      <path value="pt-lm-ServiceRequest.Subject"/>
      <short value="Patient for whom the digital activity is requested."/>
      <definition value="Patient for whom the digital activity is requested."/>
      <alias value="Patiënt"/>
      <min value="1"/>
      <max value="1"/>
      <base>
        <path value="pt-lm-ServiceRequest.Subject"/>
        <min value="1"/>
        <max value="1"/>
      </base>
      <type>
        <code value="Reference"/>
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Patient"/>
      </type>
    </element>
    <element id="pt-lm-ServiceRequest.patientInstruction">
      <path value="pt-lm-ServiceRequest.patientInstruction"/>
      <short value="Patient or consumer-oriented instructions for how the requested activity should be performed. Use this element for patient-specific guidance that should be shown alongside the Task(s) executing this order (e.g., home blood pressure monitoring for 8 weeks, once daily in the morning)."/>
      <definition value="Patient or consumer-oriented instructions for how the requested activity should be performed. Use this element for patient-specific guidance that should be shown alongside the Task(s) executing this order (e.g., home blood pressure monitoring for 8 weeks, once daily in the morning)."/>
      <alias value="PatiëntenInstructie"/>
      <min value="1"/>
      <max value="1"/>
      <base>
        <path value="pt-lm-ServiceRequest.patientInstruction"/>
        <min value="1"/>
        <max value="1"/>
      </base>
      <type>
        <code value="string"/>
      </type>
    </element>
    <element id="pt-lm-ServiceRequest.Occurrence">
      <path value="pt-lm-ServiceRequest.Occurrence"/>
      <short value="Requested schedule for performing the provider module, such as duration, frequency and time of day."/>
      <definition value="Requested schedule for performing the provider module, such as duration, frequency and time of day."/>
      <alias value="Tijdschema"/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="pt-lm-ServiceRequest.Occurrence"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="Timing"/>
      </type>
    </element>
    <element id="pt-lm-ServiceRequest.Requester">
      <path value="pt-lm-ServiceRequest.Requester"/>
      <short value="Healthcare professional role that requests this activity for the patient."/>
      <definition value="Healthcare professional role that requests this activity for the patient."/>
      <alias value="Aanvrager"/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="pt-lm-ServiceRequest.Requester"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="Reference"/>
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/PractitionerRole"/>
      </type>
    </element>
    <element id="pt-lm-ServiceRequest.AuthoredOn">
      <path value="pt-lm-ServiceRequest.AuthoredOn"/>
      <short value="Date and time when this service request was created."/>
      <definition value="Date and time when this service request was created."/>
      <alias value="AanmaakDatumTijd"/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="pt-lm-ServiceRequest.AuthoredOn"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="dateTime"/>
      </type>
    </element>
  </snapshot>
  <differential>
    <element id="pt-lm-ServiceRequest">
      <path value="pt-lm-ServiceRequest"/>
      <short value="ServiceRequest"/>
      <definition value="Patient-specific clinical order for a digital (eHealth) activity that a healthcare professional requests for a patient, such as completing a questionnaire, performing home measurements, viewing educational content, or launching a third-party module."/>
      <alias value="Zorgopdracht"/>
    </element>
    <element id="pt-lm-ServiceRequest.Identifier">
      <path value="pt-lm-ServiceRequest.Identifier"/>
      <short value="Business identifier that uniquely identifies this ServiceRequest within or across systems."/>
      <definition value="Business identifier that uniquely identifies this ServiceRequest within or across systems."/>
      <alias value="Identifier"/>
      <min value="0"/>
      <max value="*"/>
      <type>
        <code value="Identifier"/>
      </type>
    </element>
    <element id="pt-lm-ServiceRequest.Status">
      <path value="pt-lm-ServiceRequest.Status"/>
      <short value="Current state of the service request (e.g. draft, active, completed, cancelled)."/>
      <definition value="Current state of the service request (e.g. draft, active, completed, cancelled)."/>
      <alias value="Status"/>
      <min value="0"/>
      <max value="1"/>
      <type>
        <code value="code"/>
      </type>
    </element>
    <element id="pt-lm-ServiceRequest.Intent">
      <path value="pt-lm-ServiceRequest.Intent"/>
      <short value="Indicates the level of authority or intention associated with the request (e.g., order or plan)."/>
      <definition value="Indicates the level of authority or intention associated with the request (e.g., order or plan)."/>
      <alias value="Bedoeling"/>
      <min value="0"/>
      <max value="1"/>
      <type>
        <code value="code"/>
      </type>
    </element>
    <element id="pt-lm-ServiceRequest.Subject">
      <path value="pt-lm-ServiceRequest.Subject"/>
      <short value="Patient for whom the digital activity is requested."/>
      <definition value="Patient for whom the digital activity is requested."/>
      <alias value="Patiënt"/>
      <min value="1"/>
      <max value="1"/>
      <type>
        <code value="Reference"/>
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Patient"/>
      </type>
    </element>
    <element id="pt-lm-ServiceRequest.patientInstruction">
      <path value="pt-lm-ServiceRequest.patientInstruction"/>
      <short value="Patient or consumer-oriented instructions for how the requested activity should be performed. Use this element for patient-specific guidance that should be shown alongside the Task(s) executing this order (e.g., home blood pressure monitoring for 8 weeks, once daily in the morning)."/>
      <definition value="Patient or consumer-oriented instructions for how the requested activity should be performed. Use this element for patient-specific guidance that should be shown alongside the Task(s) executing this order (e.g., home blood pressure monitoring for 8 weeks, once daily in the morning)."/>
      <alias value="PatiëntenInstructie"/>
      <min value="1"/>
      <max value="1"/>
      <type>
        <code value="string"/>
      </type>
    </element>
    <element id="pt-lm-ServiceRequest.Occurrence">
      <path value="pt-lm-ServiceRequest.Occurrence"/>
      <short value="Requested schedule for performing the provider module, such as duration, frequency and time of day."/>
      <definition value="Requested schedule for performing the provider module, such as duration, frequency and time of day."/>
      <alias value="Tijdschema"/>
      <min value="0"/>
      <max value="1"/>
      <type>
        <code value="Timing"/>
      </type>
    </element>
    <element id="pt-lm-ServiceRequest.Requester">
      <path value="pt-lm-ServiceRequest.Requester"/>
      <short value="Healthcare professional role that requests this activity for the patient."/>
      <definition value="Healthcare professional role that requests this activity for the patient."/>
      <alias value="Aanvrager"/>
      <min value="0"/>
      <max value="1"/>
      <type>
        <code value="Reference"/>
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/PractitionerRole"/>
      </type>
    </element>
    <element id="pt-lm-ServiceRequest.AuthoredOn">
      <path value="pt-lm-ServiceRequest.AuthoredOn"/>
      <short value="Date and time when this service request was created."/>
      <definition value="Date and time when this service request was created."/>
      <alias value="AanmaakDatumTijd"/>
      <min value="0"/>
      <max value="1"/>
      <type>
        <code value="dateTime"/>
      </type>
    </element>
  </differential>
</StructureDefinition>