Dietary order

DSP dietary orders capture diet type, texture, fluid restrictions, supplements, and feeding routes. FHIR has a purpose-built resource — NutritionOrder — that maps almost one-to-one. Unlike the other DSP orders (which are all ServiceRequest flavours), dietary gets its own resource.

DSP content_type

order.dietary

FHIR target

NutritionOrder

Field-by-field

DSPFHIR R4Notes
type: DIETARY_ORDERNutritionOrderThe resource type itself is the category — no category mapping required.
intentNutritionOrder.intentR4 NutritionOrder.intent uses the same request-intent value set as the other request resources.
order_data.diet_typeoralDiet.typeCodeableConcept — bind to SNOMED diet types (e.g. 182922004 diabetic diet, 435801000124108 low-sodium).
order_data.textureoralDiet.texture.modifierSNOMED texture codes (pureed, mechanical soft, etc.).
order_data.fluid_consistencyoralDiet.fluidConsistencyTypeThickened liquids, nectar-thick, etc.
order_data.supplementssupplement[]supplement.type + productName + quantity + schedule.
order_data.enteral_formulaenteralFormulaFor tube-feeding orders.
order_data.food_preferencesoralDiet.instruction + foodPreferenceModifierPatient-stated preferences (Patient-level) vs clinical modifiers (order-level) — keep them distinct.
order_data.exclusions / allergiesexcludeFoodModifier + AllergyIntolerance refAllergen-driven exclusions should also surface as an AllergyIntolerance resource.
order_data.scheduleoralDiet.schedule (R4: Timing)NPO periods, with-meals, etc.
reasonreasonCode / reasonReferenceRenamed to reason in R5 — prefer R4 until xver needed.

Side-by-side example

DSP

{
  "id": "diet-001",
  "type": "DIETARY_ORDER",
  "context": { "content_type": "order.dietary" },
  "description": "Diabetic diet, low sodium, thickened liquids (nectar)",
  "intent": "order",
  "reason": "Type 2 diabetes; dysphagia post-stroke",
  "reason_references": ["cond-002","cond-003"],
  "provenance": [42, 44],
  "order_data": {
    "diet_type": "diabetic_low_sodium",
    "fluid_consistency": "nectar_thick",
    "exclusions": ["added_sugar","high_sodium"],
    "schedule": "with_meals"
  }
}

FHIR R4 (DSP-FHIR profile)

{
  "resourceType":"NutritionOrder",
  "status":"active","intent":"order",
  "patient":{"reference":"Patient/pat-67890"},
  "encounter":{"reference":"Encounter/enc-12345"},
  "dateTime":"2026-04-23T14:32:00Z",
  "oralDiet":{
    "type":[
      { "coding":[{"system":"http://snomed.info/sct","code":"182922004","display":"Diabetic diet"}]},
      { "coding":[{"system":"http://snomed.info/sct","code":"386619000","display":"Low sodium diet"}]}
    ],
    "fluidConsistencyType":[
      {"coding":[{"system":"http://snomed.info/sct","code":"439021000124105","display":"Nectar-thick liquid"}]}
    ],
    "excludeFoodModifier":[
      {"coding":[{"system":"http://snomed.info/sct","code":"226355009","display":"Added sugar"}]}
    ]
  },
  "reasonCode":[{"text":"Type 2 diabetes; dysphagia post-stroke"}],
  "reasonReference":[
    {"reference":"Condition/cond-002"},
    {"reference":"Condition/cond-003"}
  ],
  "extension":[
    { "url":"https://dsp-fhir.org/StructureDefinition/transcript-turn-refs",
      "extension":[
        { "url":"transcript","valueReference":{"reference":"DocumentReference/dr-transcript-001"}},
        { "url":"turn","valueInteger":42 },
        { "url":"turn","valueInteger":44 }
      ]
    }
  ]
}

DSP → FHIR mapping

Skeleton for DspDietaryOrder → NutritionOrder. The cleanest one-to-one shape of any DSP order type.

map "https://dsp-fhir.org/StructureMap/DspDietaryOrderToNutritionOrder" = "DspDietaryOrderToNutritionOrder"

uses "https://dsp-fhir.org/StructureDefinition/DspResource" alias DspResource as source
uses "http://hl7.org/fhir/StructureDefinition/NutritionOrder" alias NutritionOrder as target

group DspDietaryOrderToNutritionOrder(source src : DspResource, target tgt : NutritionOrder) {
  src.id as id -> tgt.id = id;
  src -> tgt.status = 'active';
  src -> tgt.intent = 'order';
  src -> tgt.dateTime = 'now';

  src.payload as p then {
    p.diet_type as dt -> tgt.oralDiet as od, od.type as t,
      t.coding as co, co.system = 'http://snomed.info/sct', co.display = dt "diet-type";
    p.restrictions as r -> tgt.excludeFoodModifier as efm, efm.text = r "restriction";
    p.instructions as i -> tgt.note as n, n.text = i "instructions";
  };

  src.confidence as conf -> tgt.extension as ext then {
    conf -> ext.url = 'https://dsp-fhir.org/StructureDefinition/dsp-confidence-score',
            ext.value = create('decimal') as v, v.value = conf;
  } "confidence";
}

FHIR → DSP (canonical $graphql read)

NutritionOrder is the cleanest one-to-one DSP order — most fields land on native FHIR slots.

Canonical query

query DspDietaryOrder($id: ID!) {
  NutritionOrder(id: $id) {
    id status intent dateTime
    oralDiet {
      type { coding { system code display } text }
      texture { modifier { coding { system code display } text } }
      fluidConsistencyType { coding { system code display } text }
      schedule { repeat { frequency period periodUnit } }
      instruction
    }
    excludeFoodModifier { coding { system code display } text }
    foodPreferenceModifier { coding { system code display } text }
    supplement {
      type { coding { system code display } }
      productName
      quantity { value unit }
    }
    enteralFormula { baseFormulaType { coding { system code display } } }
    note { text }
    reasonCode { text }
    reasonReference { reference }

    confidence: extension(url: "https://dsp-fhir.org/StructureDefinition/dsp-confidence-score") {
      valueDecimal
    }
    turnRefs: extension(url: "https://dsp-fhir.org/StructureDefinition/dsp-transcript-turn-ref") {
      transcript: extension(url: "transcript") { valueReference { reference } }
      turn:       extension(url: "turn")       { valueInteger }
    }
  }
}

DSP reconstruction adapter

function toDspDietaryOrder(n) {
  const od = n.oralDiet;
  const turnRefs = n.turnRefs ?? [];
  return {
    id: n.id,
    type: 'DIETARY_ORDER',
    intent: n.intent,
    description: od?.type?.[0]?.text ?? od?.type?.[0]?.coding?.[0]?.display,
    reason: n.reasonCode?.[0]?.text,
    reason_references: n.reasonReference?.map(r => r.reference),
    order_data: {
      diet_type:         od?.type?.map(t => t.coding?.[0]?.code ?? t.text),
      texture:           od?.texture?.map(t => t.modifier?.coding?.[0]?.code ?? t.modifier?.text),
      fluid_consistency: od?.fluidConsistencyType?.[0]?.coding?.[0]?.code,
      exclusions:        n.excludeFoodModifier?.map(e => e.coding?.[0]?.code ?? e.text),
      food_preferences:  n.foodPreferenceModifier?.map(p => p.coding?.[0]?.code ?? p.text),
      supplements:       n.supplement?.map(s => ({
                            type:     s.type?.coding?.[0]?.code,
                            product:  s.productName,
                            quantity: s.quantity?.value,
                            unit:     s.quantity?.unit,
                         })),
      enteral_formula: n.enteralFormula?.baseFormulaType?.coding?.[0]?.code,
      schedule:        od?.schedule?.repeat,
      instructions:    od?.instruction ?? n.note?.map(x => x.text).join('\n'),
    },
    confidence_score: n.confidence?.[0]?.valueDecimal,
    provenance:       turnRefs.map(t => t.turn?.valueInteger),
    transcript_ref:   turnRefs[0]?.transcript?.valueReference?.reference,
  };
}
No data loss. NutritionOrder is the best-fit FHIR resource for DSP dietary — every field lands natively.

SQL-on-FHIR v2 ViewDefinition that flattens every field above — including DSP extensions — into a tabular projection. Runnable as-is on any spec-conformant engine (Pathling, sof-exec, Aidbox SQL-on-FHIR, Databricks). See the SQL-on-FHIR v2 spec. These ViewDefinitions also ship as JSON in the IG zip.

dsp_nutrition_order — DSP Dietary order (NutritionOrder)

Flattens DSP dietary orders: oralDiet type, food preferences, exclusions.

{
  "resourceType": "ViewDefinition",
  "url": "https://dsp-fhir.org/ViewDefinition/dsp-nutrition-order",
  "name": "dsp_nutrition_order",
  "title": "DSP Dietary order (NutritionOrder)",
  "status": "draft",
  "description": "Flattens DSP dietary orders: oralDiet type, food preferences, exclusions.",
  "resource": "NutritionOrder",
  "fhirVersion": [
    "4.0.1"
  ],
  "select": [
    {
      "column": [
        {
          "name": "id",
          "path": "id",
          "type": "id",
          "description": "Server-assigned logical id."
        },
        {
          "name": "version_id",
          "path": "meta.versionId",
          "type": "id",
          "description": "FHIR version id (drives NEW/UPDATED classification)."
        },
        {
          "name": "last_updated",
          "path": "meta.lastUpdated",
          "type": "instant",
          "description": "Instant of last mutation."
        },
        {
          "name": "meta_source",
          "path": "meta.source",
          "type": "uri"
        },
        {
          "name": "payload_version",
          "path": "meta.tag.where(system='https://dsp-fhir.org/CodeSystem/payload-version').code.first()",
          "type": "code",
          "description": "DSP payload version this resource was last emitted under."
        },
        {
          "name": "confidence_score",
          "path": "extension('https://dsp-fhir.org/StructureDefinition/confidence-score').value.ofType(decimal)",
          "type": "decimal",
          "description": "DSP confidence (0..1)."
        },
        {
          "name": "transcript_ref",
          "path": "extension('https://dsp-fhir.org/StructureDefinition/transcript-turn-refs').extension('transcript').value.ofType(Reference).reference",
          "type": "string",
          "description": "DocumentReference/<id>/_history/<v> that pins the transcript version for turn indices."
        },
        {
          "name": "turn_indices",
          "path": "extension('https://dsp-fhir.org/StructureDefinition/transcript-turn-refs').extension('turn').value.ofType(integer)",
          "type": "integer",
          "collection": true,
          "description": "Turn indices joined by $ground into transcript content."
        },
        {
          "name": "spoken_forms",
          "path": "extension('https://dsp-fhir.org/StructureDefinition/spoken-forms').extension('form').value.ofType(string)",
          "type": "string",
          "collection": true
        },
        {
          "name": "search_terms",
          "path": "extension('https://dsp-fhir.org/StructureDefinition/search-terms').extension('term').value.ofType(string)",
          "type": "string",
          "collection": true
        },
        {
          "name": "status",
          "path": "status",
          "type": "code"
        },
        {
          "name": "intent",
          "path": "intent",
          "type": "code"
        },
        {
          "name": "patient_id",
          "path": "patient.reference.substring(8)",
          "type": "string"
        },
        {
          "name": "encounter_id",
          "path": "encounter.reference.substring(10)",
          "type": "string"
        },
        {
          "name": "date_time",
          "path": "dateTime",
          "type": "dateTime"
        },
        {
          "name": "orderer_practitioner_id",
          "path": "orderer.reference.substring(13)",
          "type": "string"
        },
        {
          "name": "oral_diet_type_code",
          "path": "oralDiet.type.coding.code.first()",
          "type": "code"
        },
        {
          "name": "oral_diet_type_display",
          "path": "oralDiet.type.coding.display.first()",
          "type": "string"
        },
        {
          "name": "oral_diet_schedule",
          "path": "oralDiet.schedule.repeat.frequency.first()",
          "type": "integer"
        },
        {
          "name": "food_preference_modifiers",
          "path": "foodPreferenceModifier.coding.code",
          "type": "code",
          "collection": true
        },
        {
          "name": "exclude_food_modifiers",
          "path": "excludeFoodModifier.coding.code",
          "type": "code",
          "collection": true
        },
        {
          "name": "instruction",
          "path": "note.text.first()",
          "type": "string"
        }
      ]
    }
  ]
}
Best-fit DSP order. NutritionOrder is a one-to-one structural match — no ServiceRequest profiling, no fabricated extensions for the order shape itself. The only DSP-specific additions are the usual cross-cutting extensions (confidence-score, transcript-turn-refs, spoken-forms).