<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="HESConnecta-ServiceRequest" />
  <url value="https://fhir.catsalut.cat/r4/mConnectaHES/StructureDefinition/HESConnecta-ServiceRequest" />
  <version value="1.0.0" />
  <name value="HESConnecta_ServiceRequest" />
  <title value="HESConnecta ServiceRequest" />
  <status value="draft" />
  <date value="2026-05-04" />
  <description value="Perfil del recurso ServiceRequest para la activación de servicios de telemonitorización en el proyecto HESConnecta" />
  <fhirVersion value="4.0.1" />
  <kind value="resource" />
  <abstract value="false" />
  <type value="ServiceRequest" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/ServiceRequest" />
  <derivation value="constraint" />
  <differential>
    <element id="ServiceRequest">
      <path value="ServiceRequest" />
      <definition value="Solicitud de activación de servicio de telemonitorización." />
    </element>
    <element id="ServiceRequest.extension:statusReason">
      <path value="ServiceRequest.extension" />
      <sliceName value="statusReason" />
      <type>
        <code value="Extension" />
        <profile value="http://hl7.org/fhir/StructureDefinition/request-statusReason" />
      </type>
      <mustSupport value="true" />
      <isModifier value="false" />
    </element>
    <element id="ServiceRequest.identifier">
      <path value="ServiceRequest.identifier" />
      <definition value="Identificadores de la solicitud. Incluye el identificador de la UP (como en el ejemplo mConnecta) y el identificador propio de la prescripción." />
      <comment value="identificació de la prescripció&#xD;&#xA;The identifier.type element is used to distinguish between the identifiers assigned by the orderer (known as the 'Placer' in HL7 v2) and the producer of the observations in response to the order (known as the 'Filler' in HL7 v2).  For further discussion and examples see the resource notes section below." />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.identifier.value">
      <path value="ServiceRequest.identifier.value" />
      <comment value="Valor de la identificación de la prescripció the value is a full URI, then the system SHALL be urn:ietf:rfc:3986.  The value's primary purpose is computational mapping.  As a result, it may be normalized for comparison purposes (e.g. removing non-significant whitespace, dashes, etc.)  A value formatted for human display can be conveyed using the [Rendered Value extension](extension-rendered-value.html). Identifier.value is to be treated as case sensitive unless knowledge of the Identifier.system allows the processer to be confident that non-case-sensitive processing is safe." />
      <min value="1" />
    </element>
    <element id="ServiceRequest.status">
      <path value="ServiceRequest.status" />
      <short value="active | revoked | completed | entered-in-error" />
      <comment value="Quan la prescripció estiga en curs sempre serà ACTIVE&#xD;&#xA;The status is generally fully in the control of the requester - they determine whether the order is draft or active and, after it has been activated, competed, cancelled or suspended. States relating to the activities of the performer are reflected on either the corresponding event (see [Event Pattern](event.html) for general discussion) or using the [Task](task.html) resource." />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.intent">
      <path value="ServiceRequest.intent" />
      <comment value="Es deixa com a motiu fixe ORDER&#xD;&#xA;This element is labeled as a modifier because the intent alters when and how the resource is actually applicable." />
      <fixedCode value="order" />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.code">
      <path value="ServiceRequest.code" />
      <comment value="vertical o cas d'ús en la qual es sitúa la prescripció del dispositiu al pacient&#xD;&#xA;&#xD;&#xA;Many laboratory and radiology procedure codes embed the specimen/organ system in the test order name, for example,  serum or serum/plasma glucose, or a chest x-ray. The specimen might not be recorded separately from the test code." />
      <min value="1" />
      <mustSupport value="true" />
      <binding>
        <strength value="required" />
        <valueSet value="https://fhir.catsalut.cat/r4/mConnectaHES/ValueSet/Verticals_mConnecta" />
      </binding>
    </element>
    <element id="ServiceRequest.code.coding">
      <path value="ServiceRequest.code.coding" />
      <min value="1" />
    </element>
    <element id="ServiceRequest.code.coding.system">
      <path value="ServiceRequest.code.coding.system" />
      <min value="1" />
    </element>
    <element id="ServiceRequest.code.coding.code">
      <path value="ServiceRequest.code.coding.code" />
      <min value="1" />
    </element>
    <element id="ServiceRequest.code.coding.display">
      <path value="ServiceRequest.code.coding.display" />
      <min value="1" />
    </element>
    <element id="ServiceRequest.subject">
      <path value="ServiceRequest.subject" />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.subject.reference">
      <path value="ServiceRequest.subject.reference" />
      <definition value="Codi d'identificació personal únic del Servei Català de la Salut (CIP-CatSalut)" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.encounter">
      <path value="ServiceRequest.encounter" />
      <comment value="traçabilitat amb l'event clínic&#xD;&#xA;&#xD;&#xA;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." />
    </element>
    <element id="ServiceRequest.encounter.reference">
      <path value="ServiceRequest.encounter.reference" />
      <comment value="traçabilitat amb l'event clínic&#xD;&#xA;&#xD;&#xA;Using absolute URLs provides a stable scalable approach suitable for a cloud/web context, while using relative/logical references provides a flexible approach suitable for use when trading across closed eco-system boundaries.   Absolute URLs do not need to point to a FHIR RESTful server, though this is the preferred approach. If the URL conforms to the structure &quot;/[type]/[id]&quot; then it should be assumed that the reference is to a FHIR RESTful server." />
    </element>
    <element id="ServiceRequest.occurrence[x]">
      <path value="ServiceRequest.occurrence[x]" />
      <comment value="dates entre les quals el pacient estarà telemonitoritzat" />
      <min value="1" />
      <type>
        <code value="Period" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.occurrence[x].start">
      <path value="ServiceRequest.occurrence[x].start" />
      <comment value="inici de la monitorització&#xD;&#xA;&#xD;&#xA;If the low element is missing, the meaning is that the low boundary is not known." />
      <min value="1" />
    </element>
    <element id="ServiceRequest.occurrence[x].end">
      <path value="ServiceRequest.occurrence[x].end" />
      <comment value="inici de la monitorització&#xD;&#xA;&#xD;&#xA;The high value includes any matching date/time. i.e. 2012-02-03T10:00:00 is in a period that has an end value of 2012-02-03." />
    </element>
    <element id="ServiceRequest.authoredOn">
      <path value="ServiceRequest.authoredOn" />
      <definition value="Data de la prescripció" />
      <comment value="data en la que es prescriu la telemonitorització" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.requester">
      <path value="ServiceRequest.requester" />
      <comment value="enllaça  al professional que ha fet la prescripció&#xD;&#xA;&#xD;&#xA;This not the dispatcher, but rather who is the authorizer.  This element is not intended to handle delegation which would generally be managed through the Provenance resource." />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.requester.identifier">
      <path value="ServiceRequest.requester.identifier" />
      <min value="1" />
    </element>
    <element id="ServiceRequest.requester.identifier.type.coding.code">
      <path value="ServiceRequest.requester.identifier.type.coding.code" />
      <fixedCode value="NUMCOL" />
    </element>
    <element id="ServiceRequest.requester.identifier.type.coding.display">
      <path value="ServiceRequest.requester.identifier.type.coding.display" />
      <fixedString value="Nombre de Col.legiat" />
    </element>
    <element id="ServiceRequest.requester.identifier.system">
      <path value="ServiceRequest.requester.identifier.system" />
      <min value="1" />
    </element>
    <element id="ServiceRequest.requester.identifier.value">
      <path value="ServiceRequest.requester.identifier.value" />
      <min value="1" />
    </element>
    <element id="ServiceRequest.performer">
      <path value="ServiceRequest.performer" />
      <comment value="Indiquem el codi UP/EP&#xD;&#xA;&#xD;&#xA;If multiple performers are present, it is interpreted as a list of *alternative* performers without any preference regardless of order.  If order of preference is needed use the [request-performerOrder extension](extension-request-performerorder.html).  Use CareTeam to represent a group of performers (for example, Practitioner A *and* Practitioner B)." />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.performer.identifier">
      <path value="ServiceRequest.performer.identifier" />
      <min value="1" />
    </element>
    <element id="ServiceRequest.performer.identifier.system">
      <path value="ServiceRequest.performer.identifier.system" />
      <comment value="POSAREM EL SISTEM DE UP/EP&#xD;&#xA;&#xD;&#xA;Identifier.system is always case sensitive." />
      <min value="1" />
    </element>
    <element id="ServiceRequest.performer.identifier.value">
      <path value="ServiceRequest.performer.identifier.value" />
      <comment value="POSAREM EL VALOR DEL UP/EP&#xD;&#xA;If the value is a full URI, then the system SHALL be urn:ietf:rfc:3986.  The value's primary purpose is computational mapping.  As a result, it may be normalized for comparison purposes (e.g. removing non-significant whitespace, dashes, etc.)  A value formatted for human display can be conveyed using the [Rendered Value extension](extension-rendered-value.html). Identifier.value is to be treated as case sensitive unless knowledge of the Identifier.system allows the processer to be confident that non-case-sensitive processing is safe." />
      <min value="1" />
    </element>
    <element id="ServiceRequest.performer.display">
      <path value="ServiceRequest.performer.display" />
      <min value="1" />
    </element>
    <element id="ServiceRequest.locationCode">
      <path value="ServiceRequest.locationCode" />
      <comment value="es tracta de la logistica d'entrega del dispositiu: domicili/centre&#xD;&#xA;&#xD;&#xA;Not all terminology uses fit this general pattern. In some cases, models should not use CodeableConcept and use Coding directly and provide their own structure for managing text, codings, translations and the relationship between elements and pre- and post-coordination." />
      <min value="1" />
      <max value="1" />
      <mustSupport value="true" />
      <binding>
        <strength value="required" />
        <valueSet value="https://fhir.catsalut.cat/r4/mConnectaHES/ValueSet/Entorns" />
      </binding>
    </element>
    <element id="ServiceRequest.locationReference">
      <path value="ServiceRequest.locationReference" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.reasonCode">
      <path value="ServiceRequest.reasonCode" />
      <comment value="es el diagnòstic del pacient que motiva la prescripció d'un dispossitiu de telemonitoratge&#xD;&#xA;&#xD;&#xA;This element represents why the referral is being made and may be used to decide how the service will be performed, or even if it will be performed at all.   Use `CodeableConcept.text` element if the data is free (uncoded) text as shown in the [CT Scan example](servicerequest-example-di.html)." />
    </element>
    <element id="ServiceRequest.supportingInfo">
      <path value="ServiceRequest.supportingInfo" />
      <comment value="com enllacem amb el dispositiu que s'ha prescrit&#xD;&#xA;&#xD;&#xA;To represent information about how the services are to be delivered use the `instructions` element." />
      <min value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://fhir.catsalut.cat/r4/mConnectaHES/StructureDefinition/HESConnecta-Device" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.supportingInfo.reference">
      <path value="ServiceRequest.supportingInfo.reference" />
      <min value="1" />
    </element>
    <element id="ServiceRequest.note">
      <path value="ServiceRequest.note" />
      <comment value="notes adicionals que es vullguen incloure&#xD;&#xA;&#xD;&#xA;For systems that do not have structured annotations, they can simply communicate a single annotation with no author or time.  This element may need to be included in narrative because of the potential for modifying information.  *Annotations SHOULD NOT* be used to communicate &quot;modifying&quot; information that could be computable. (This is a SHOULD because enforcing user behavior is nearly impossible)." />
      <max value="1" />
      <mustSupport value="true" />
    </element>
  </differential>
</StructureDefinition>