{
  "resourceType": "StructureDefinition",
  "id": "test-digidot-ServiceRequest-no",
  "url": "http://novari.no/fhir/digidot/StructureDefinition/test-digidot-ServiceRequest-no",
  "version": "0.1.1-test",
  "name": "TestDigidotServiceRequestNo",
  "title": "TEST DigiDot ServiceRequest (NO)",
  "status": "draft",
  "date": "2026-05-19",
  "publisher": "Novari AS - DigiDOT",
  "description": "TEST comparison draft. Not for production use. DigiDOT profile for planned, proposed or ordered dental services and procedures. This is the planning/request layer that may later result in Appointment, Encounter and Procedure resources.",
  "purpose": "Use this profile as the planning or request layer before dental activity is scheduled or performed. Performed clinical work should link back to the request with Procedure.basedOn.",
  "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"
      },
      {
        "id": "ServiceRequest.basedOn",
        "path": "ServiceRequest.basedOn",
        "short": "Higher-level plan or request that this plan is based on.",
        "definition": "Use ServiceRequest.basedOn only when this request fulfils or refines another plan/request. Do not use it to link performed procedures; performed procedures should point back with Procedure.basedOn.",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://novari.no/fhir/digidot/StructureDefinition/test-digidot-ServiceRequest-no",
              "http://hl7.org/fhir/StructureDefinition/ServiceRequest"
            ]
          }
        ]
      },
      {
        "id": "ServiceRequest.replaces",
        "path": "ServiceRequest.replaces",
        "short": "Previous plan/request that this plan replaces.",
        "definition": "Use ServiceRequest.replaces when the treatment plan changes because the clinical situation is different than first assumed, for example when a procedure becomes more complex and a revised plan is created. The old ServiceRequest should normally be completed or revoked according to local workflow.",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://novari.no/fhir/digidot/StructureDefinition/test-digidot-ServiceRequest-no",
              "http://hl7.org/fhir/StructureDefinition/ServiceRequest"
            ]
          }
        ]
      },
      {
        "id": "ServiceRequest.status",
        "path": "ServiceRequest.status",
        "short": "Status of the plan/request, not the status of a performed procedure.",
        "definition": "Use ServiceRequest.status for the lifecycle of the planned/requested dental service. Keep it active while the plan can still be fulfilled, use on-hold when the plan is paused, completed when the planned work is fulfilled or closed, and revoked when the plan is cancelled before fulfilment. Use Procedure.status for what actually happened clinically.",
        "min": 1,
        "max": "1"
      },
      {
        "id": "ServiceRequest.intent",
        "path": "ServiceRequest.intent",
        "min": 1,
        "max": "1"
      },
      {
        "id": "ServiceRequest.code",
        "path": "ServiceRequest.code",
        "min": 1,
        "binding": {
          "strength": "extensible",
          "description": "Use a code from the DigiDOT dental procedure value set when it covers the requested service or planned procedure. The value set represents reportable/refset procedure values, including values relevant for KPR reporting. For clinical planning and storage, a broader SNOMED CT concept may be used when the refset does not cover the intended meaning. A postcoordinated SNOMED CT expression may be included as additional semantic precision.",
          "valueSet": "http://novari.no/fhir/digidot/ValueSet/dental-procedures"
        },
        "constraint": [
          {
            "key": "sr-sct-min1",
            "severity": "warning",
            "human": "At least one SNOMED CT code (pre- or postcoordinated) should be present.",
            "expression": "coding.where(system = 'http://snomed.info/sct').exists()"
          }
        ]
      },
      {
        "id": "ServiceRequest.code.coding",
        "path": "ServiceRequest.code.coding",
        "slicing": {
          "discriminator": [
            {
              "type": "profile",
              "path": "$this"
            }
          ],
          "rules": "open"
        },
        "min": 1,
        "max": "2"
      },
      {
        "id": "ServiceRequest.code.coding:SCTpre",
        "path": "ServiceRequest.code.coding",
        "sliceName": "SCTpre",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Coding",
            "profile": [
              "http://novari.no/fhir/digidot/StructureDefinition/test-digidot-Coding-SCTpre-no"
            ]
          }
        ],
        "binding": {
          "strength": "extensible",
          "description": "For planned dental services, use a precoordinated SNOMED CT concept from the DigiDOT dental procedure refset when it covers the intended request. Broader SNOMED CT concepts are allowed for clinical planning when the refset does not cover the meaning. Stricter KPR/reporting validation should be handled by a reporting-specific profile or extraction rule.",
          "valueSet": "http://novari.no/fhir/digidot/ValueSet/dental-procedures"
        }
      },
      {
        "id": "ServiceRequest.code.coding:SCTpost",
        "path": "ServiceRequest.code.coding",
        "sliceName": "SCTpost",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Coding",
            "profile": [
              "http://novari.no/fhir/digidot/StructureDefinition/test-digidot-Coding-SCTpost-no"
            ]
          }
        ]
      },
      {
        "id": "ServiceRequest.subject",
        "path": "ServiceRequest.subject",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://hl7.no/fhir/StructureDefinition/no-basis-Patient",
              "http://hl7.org/fhir/StructureDefinition/Patient"
            ]
          }
        ]
      },
      {
        "id": "ServiceRequest.encounter",
        "path": "ServiceRequest.encounter",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://novari.no/fhir/digidot/StructureDefinition/test-digidot-Encounter-no",
              "http://hl7.org/fhir/StructureDefinition/Encounter"
            ]
          }
        ]
      },
      {
        "id": "ServiceRequest.occurrence[x]",
        "path": "ServiceRequest.occurrence[x]",
        "short": "Requested time or period for the planned service.",
        "definition": "Use occurrenceDateTime, occurrencePeriod or occurrenceTiming when the planned work has a known or expected time window. Appointment remains the scheduling resource; occurrence is the clinical/request timing on the plan."
      },
      {
        "id": "ServiceRequest.requester",
        "path": "ServiceRequest.requester",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://hl7.no/fhir/StructureDefinition/no-basis-Practitioner",
              "http://hl7.no/fhir/StructureDefinition/no-basis-PractitionerRole",
              "http://hl7.no/fhir/StructureDefinition/no-basis-Organization",
              "http://hl7.no/fhir/StructureDefinition/no-basis-Patient",
              "http://hl7.no/fhir/StructureDefinition/no-basis-RelatedPerson",
              "http://hl7.org/fhir/StructureDefinition/Practitioner",
              "http://hl7.org/fhir/StructureDefinition/PractitionerRole",
              "http://hl7.org/fhir/StructureDefinition/Organization",
              "http://hl7.org/fhir/StructureDefinition/Patient",
              "http://hl7.org/fhir/StructureDefinition/RelatedPerson"
            ]
          }
        ]
      },
      {
        "id": "ServiceRequest.performer",
        "path": "ServiceRequest.performer",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://hl7.no/fhir/StructureDefinition/no-basis-Practitioner",
              "http://hl7.no/fhir/StructureDefinition/no-basis-PractitionerRole",
              "http://hl7.no/fhir/StructureDefinition/no-basis-Organization",
              "http://hl7.no/fhir/StructureDefinition/no-basis-HealthcareService",
              "http://hl7.org/fhir/StructureDefinition/Practitioner",
              "http://hl7.org/fhir/StructureDefinition/PractitionerRole",
              "http://hl7.org/fhir/StructureDefinition/Organization",
              "http://hl7.org/fhir/StructureDefinition/HealthcareService"
            ]
          }
        ]
      },
      {
        "id": "ServiceRequest.locationReference",
        "path": "ServiceRequest.locationReference",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://hl7.no/fhir/StructureDefinition/no-basis-Location",
              "http://hl7.org/fhir/StructureDefinition/Location"
            ]
          }
        ]
      },
      {
        "id": "ServiceRequest.reasonReference",
        "path": "ServiceRequest.reasonReference",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://novari.no/fhir/digidot/StructureDefinition/test-digidot-Condition-no",
              "http://novari.no/fhir/digidot/StructureDefinition/test-digidot-Observation-no",
              "http://hl7.org/fhir/StructureDefinition/Condition",
              "http://hl7.org/fhir/StructureDefinition/Observation"
            ]
          }
        ]
      },
      {
        "id": "ServiceRequest.bodySite",
        "path": "ServiceRequest.bodySite",
        "min": 0,
        "max": "*",
        "constraint": [
          {
            "key": "tooth-required-if-surface",
            "severity": "error",
            "human": "If tooth surfaces are provided, a tooth must also be provided.",
            "expression": "coding.where(memberOf('http://novari.no/fhir/digidot/ValueSet/tooth-surfaces')).empty() or coding.where(memberOf('http://novari.no/fhir/digidot/ValueSet/teeth')).exists()"
          }
        ]
      },
      {
        "id": "ServiceRequest.bodySite.coding",
        "path": "ServiceRequest.bodySite.coding",
        "slicing": {
          "discriminator": [
            {
              "type": "profile",
              "path": "$this"
            }
          ],
          "rules": "open"
        },
        "min": 0,
        "max": "*"
      },
      {
        "id": "ServiceRequest.bodySite.coding:tooth",
        "path": "ServiceRequest.bodySite.coding",
        "sliceName": "tooth",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Coding",
            "profile": [
              "http://novari.no/fhir/digidot/StructureDefinition/test-digidot-Coding-tooth-no"
            ]
          }
        ],
        "binding": {
          "strength": "required",
          "valueSet": "http://novari.no/fhir/digidot/ValueSet/teeth"
        }
      },
      {
        "id": "ServiceRequest.bodySite.coding:surface",
        "path": "ServiceRequest.bodySite.coding",
        "sliceName": "surface",
        "min": 0,
        "max": "*",
        "type": [
          {
            "code": "Coding",
            "profile": [
              "http://novari.no/fhir/digidot/StructureDefinition/test-digidot-Coding-tooth-surface-no"
            ]
          }
        ],
        "binding": {
          "strength": "required",
          "valueSet": "http://novari.no/fhir/digidot/ValueSet/tooth-surfaces"
        }
      },
      {
        "id": "ServiceRequest.bodySite.coding.system",
        "path": "ServiceRequest.bodySite.coding.system",
        "min": 1,
        "fixedUri": "http://snomed.info/sct"
      }
    ]
  }
}