{
  "resourceType": "StructureDefinition",
  "id": "HESConnecta-ServiceRequest",
  "url": "https://fhir.catsalut.cat/r4/mConnectaHES/StructureDefinition/HESConnecta-ServiceRequest",
  "version": "1.0.0",
  "name": "HESConnecta_ServiceRequest",
  "title": "HESConnecta ServiceRequest",
  "status": "draft",
  "date": "2026-05-04",
  "description": "Perfil del recurso ServiceRequest para la activación de servicios de telemonitorización en el proyecto HESConnecta",
  "fhirVersion": "4.0.1",
  "kind": "resource",
  "abstract": false,
  "type": "ServiceRequest",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/ServiceRequest",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "ServiceRequest",
        "path": "ServiceRequest",
        "definition": "Solicitud de activación de servicio de telemonitorización."
      },
      {
        "id": "ServiceRequest.extension:statusReason",
        "path": "ServiceRequest.extension",
        "sliceName": "statusReason",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://hl7.org/fhir/StructureDefinition/request-statusReason"
            ]
          }
        ],
        "mustSupport": true,
        "isModifier": false
      },
      {
        "id": "ServiceRequest.identifier",
        "path": "ServiceRequest.identifier",
        "definition": "Identificadores de la solicitud. Incluye el identificador de la UP (como en el ejemplo mConnecta) y el identificador propio de la prescripción.",
        "comment": "identificació de la prescripció\r\nThe 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": 1,
        "mustSupport": true
      },
      {
        "id": "ServiceRequest.identifier.value",
        "path": "ServiceRequest.identifier.value",
        "comment": "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": 1
      },
      {
        "id": "ServiceRequest.status",
        "path": "ServiceRequest.status",
        "short": "active | revoked | completed | entered-in-error",
        "comment": "Quan la prescripció estiga en curs sempre serà ACTIVE\r\nThe 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": true
      },
      {
        "id": "ServiceRequest.intent",
        "path": "ServiceRequest.intent",
        "comment": "Es deixa com a motiu fixe ORDER\r\nThis element is labeled as a modifier because the intent alters when and how the resource is actually applicable.",
        "fixedCode": "order",
        "mustSupport": true
      },
      {
        "id": "ServiceRequest.code",
        "path": "ServiceRequest.code",
        "comment": "vertical o cas d'ús en la qual es sitúa la prescripció del dispositiu al pacient\r\n\r\nMany 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": 1,
        "mustSupport": true,
        "binding": {
          "strength": "required",
          "valueSet": "https://fhir.catsalut.cat/r4/mConnectaHES/ValueSet/Verticals_mConnecta"
        }
      },
      {
        "id": "ServiceRequest.code.coding",
        "path": "ServiceRequest.code.coding",
        "min": 1
      },
      {
        "id": "ServiceRequest.code.coding.system",
        "path": "ServiceRequest.code.coding.system",
        "min": 1
      },
      {
        "id": "ServiceRequest.code.coding.code",
        "path": "ServiceRequest.code.coding.code",
        "min": 1
      },
      {
        "id": "ServiceRequest.code.coding.display",
        "path": "ServiceRequest.code.coding.display",
        "min": 1
      },
      {
        "id": "ServiceRequest.subject",
        "path": "ServiceRequest.subject",
        "mustSupport": true
      },
      {
        "id": "ServiceRequest.subject.reference",
        "path": "ServiceRequest.subject.reference",
        "definition": "Codi d'identificació personal únic del Servei Català de la Salut (CIP-CatSalut)",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "ServiceRequest.encounter",
        "path": "ServiceRequest.encounter",
        "comment": "traçabilitat amb l'event clínic\r\n\r\nReferences 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."
      },
      {
        "id": "ServiceRequest.encounter.reference",
        "path": "ServiceRequest.encounter.reference",
        "comment": "traçabilitat amb l'event clínic\r\n\r\nUsing 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 \"/[type]/[id]\" then it should be assumed that the reference is to a FHIR RESTful server."
      },
      {
        "id": "ServiceRequest.occurrence[x]",
        "path": "ServiceRequest.occurrence[x]",
        "comment": "dates entre les quals el pacient estarà telemonitoritzat\r\n",
        "min": 1,
        "type": [
          {
            "code": "Period"
          }
        ],
        "mustSupport": true
      },
      {
        "id": "ServiceRequest.occurrence[x].start",
        "path": "ServiceRequest.occurrence[x].start",
        "comment": "inici de la monitorització\r\n\r\nIf the low element is missing, the meaning is that the low boundary is not known.",
        "min": 1
      },
      {
        "id": "ServiceRequest.occurrence[x].end",
        "path": "ServiceRequest.occurrence[x].end",
        "comment": "inici de la monitorització\r\n\r\nThe 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."
      },
      {
        "id": "ServiceRequest.authoredOn",
        "path": "ServiceRequest.authoredOn",
        "definition": "Data de la prescripció",
        "comment": "data en la que es prescriu la telemonitorització\r\n",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "ServiceRequest.requester",
        "path": "ServiceRequest.requester",
        "comment": "enllaça  al professional que ha fet la prescripció\r\n\r\nThis 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": 1,
        "mustSupport": true
      },
      {
        "id": "ServiceRequest.requester.identifier",
        "path": "ServiceRequest.requester.identifier",
        "min": 1
      },
      {
        "id": "ServiceRequest.requester.identifier.type.coding.code",
        "path": "ServiceRequest.requester.identifier.type.coding.code",
        "fixedCode": "NUMCOL"
      },
      {
        "id": "ServiceRequest.requester.identifier.type.coding.display",
        "path": "ServiceRequest.requester.identifier.type.coding.display",
        "fixedString": "Nombre de Col.legiat"
      },
      {
        "id": "ServiceRequest.requester.identifier.system",
        "path": "ServiceRequest.requester.identifier.system",
        "min": 1
      },
      {
        "id": "ServiceRequest.requester.identifier.value",
        "path": "ServiceRequest.requester.identifier.value",
        "min": 1
      },
      {
        "id": "ServiceRequest.performer",
        "path": "ServiceRequest.performer",
        "comment": "Indiquem el codi UP/EP\r\n\r\nIf 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": 1,
        "mustSupport": true
      },
      {
        "id": "ServiceRequest.performer.identifier",
        "path": "ServiceRequest.performer.identifier",
        "min": 1
      },
      {
        "id": "ServiceRequest.performer.identifier.system",
        "path": "ServiceRequest.performer.identifier.system",
        "comment": "POSAREM EL SISTEM DE UP/EP\r\n\r\nIdentifier.system is always case sensitive.",
        "min": 1
      },
      {
        "id": "ServiceRequest.performer.identifier.value",
        "path": "ServiceRequest.performer.identifier.value",
        "comment": "POSAREM EL VALOR DEL UP/EP\r\nIf 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": 1
      },
      {
        "id": "ServiceRequest.performer.display",
        "path": "ServiceRequest.performer.display",
        "min": 1
      },
      {
        "id": "ServiceRequest.locationCode",
        "path": "ServiceRequest.locationCode",
        "comment": "es tracta de la logistica d'entrega del dispositiu: domicili/centre\r\n\r\nNot 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": 1,
        "max": "1",
        "mustSupport": true,
        "binding": {
          "strength": "required",
          "valueSet": "https://fhir.catsalut.cat/r4/mConnectaHES/ValueSet/Entorns"
        }
      },
      {
        "id": "ServiceRequest.locationReference",
        "path": "ServiceRequest.locationReference",
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "ServiceRequest.reasonCode",
        "path": "ServiceRequest.reasonCode",
        "comment": "es el diagnòstic del pacient que motiva la prescripció d'un dispossitiu de telemonitoratge\r\n\r\nThis 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)."
      },
      {
        "id": "ServiceRequest.supportingInfo",
        "path": "ServiceRequest.supportingInfo",
        "comment": "com enllacem amb el dispositiu que s'ha prescrit\r\n\r\nTo represent information about how the services are to be delivered use the `instructions` element.",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://fhir.catsalut.cat/r4/mConnectaHES/StructureDefinition/HESConnecta-Device"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "ServiceRequest.supportingInfo.reference",
        "path": "ServiceRequest.supportingInfo.reference",
        "min": 1
      },
      {
        "id": "ServiceRequest.note",
        "path": "ServiceRequest.note",
        "comment": "notes adicionals que es vullguen incloure\r\n\r\nFor 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 \"modifying\" information that could be computable. (This is a SHOULD because enforcing user behavior is nearly impossible).",
        "max": "1",
        "mustSupport": true
      }
    ]
  }
}