[
  {
    "name": "raw_doctor_notes",
    "aliases": [],
    "mode": "Read latest stored note",
    "request": {
      "hospital_id": "${HOSPITAL_ID}",
      "hospital_inpatient_id": "${HMS_ADMISSION_ID}",
      "practitioner_id": "${PRACTITIONER_ID}",
      "form_name": "raw_doctor_notes"
    },
    "response": "StoredNoteResponse",
    "notes": "Latest stored doctor_notes detail for this admission, ordered by update time. This is not the full note history. The practitioner identifier is required, but the stored-note query is admission-wide rather than filtered to that practitioner. answer can be a JSON value, text, or null if attachment content is unavailable. No stored note returns 404 with resultData: [].",
    "model": null
  },
  {
    "name": "raw_nurse_notes",
    "aliases": [],
    "mode": "Read latest stored note",
    "request": {
      "hospital_id": "${HOSPITAL_ID}",
      "hospital_inpatient_id": "${HMS_ADMISSION_ID}",
      "caregiver_id": "${CAREGIVER_ID}",
      "form_name": "raw_nurse_notes"
    },
    "response": "StoredNoteResponse",
    "notes": "Same stored-note envelope as raw_doctor_notes, selecting nurse_notes. The caregiver identifier is required; the stored-note query is admission-wide. 404 when no matching stored note exists.",
    "model": null
  },
  {
    "name": "doctor_notes",
    "aliases": [],
    "mode": "Retrieve and assemble progress notes",
    "request": {
      "hospital_id": "${HOSPITAL_ID}",
      "hospital_inpatient_id": "${HMS_ADMISSION_ID}",
      "practitioner_id": "${PRACTITIONER_ID}",
      "form_name": "doctor_notes"
    },
    "response": "Response_doctor_notes",
    "notes": "notes is an object keyed by interaction ID, not an array. Values contain created_at, updated_at, interaction_type, answer and clinician IDs; read_error may be present. A no-table response may return status: \"table not exists\" and notes: {}. The service can assemble notes; do not treat this as a side-effect-free generation trigger.",
    "model": null
  },
  {
    "name": "nurse_notes",
    "aliases": [],
    "mode": "Retrieve and assemble nurse notes",
    "request": {
      "hospital_id": "${HOSPITAL_ID}",
      "hospital_inpatient_id": "${HMS_ADMISSION_ID}",
      "caregiver_id": "${CAREGIVER_ID}",
      "form_name": "nurse_notes"
    },
    "response": "Response_nurse_notes",
    "notes": "notes is an array of handover-delimited sets. Each set contains a notes map keyed by interaction ID plus generated care/pain sections, and may contain section_error or braden_scale. Also returns handover_interactions and pain_graph. On a no-table response notes can instead be {}.",
    "model": "NurseNotes"
  },
  {
    "name": "initial_assessment",
    "aliases": [],
    "mode": "Generate document",
    "request": {
      "hospital_id": "${HOSPITAL_ID}",
      "hospital_inpatient_id": "${HMS_ADMISSION_ID}",
      "practitioner_id": "${PRACTITIONER_ID}",
      "form_name": "initial_assessment"
    },
    "response": "GeneratedDocumentResponse",
    "notes": "Use practitioner_id for the doctor assessment or caregiver_id for the nurse workflow. Identity and template configuration determine the generated form. Patient and admission IDs are resolved internally. See the clinical models for field-level content; the data envelope is not a fixed template.",
    "model": "DoctorInitialAssessment"
  },
  {
    "name": "progress_notes",
    "aliases": [],
    "mode": "Generate document",
    "request": {
      "hospital_id": "${HOSPITAL_ID}",
      "hospital_inpatient_id": "${HMS_ADMISSION_ID}",
      "practitioner_id": "${PRACTITIONER_ID}",
      "form_name": "progress_notes"
    },
    "response": "GeneratedDocumentResponse",
    "notes": "Calls document generation, distinct from doctor_notes retrieval. Optional interaction_id selects a recording; omitted/zero falls back to the latest matching interaction. Response data is the upstream generation result.",
    "model": "InitialAssessment"
  },
  {
    "name": "surgery_notes",
    "aliases": [],
    "mode": "Generate document",
    "request": {
      "hospital_id": "${HOSPITAL_ID}",
      "hospital_inpatient_id": "${HMS_ADMISSION_ID}",
      "practitioner_id": "${PRACTITIONER_ID}",
      "form_name": "surgery_notes"
    },
    "response": "GeneratedDocumentResponse",
    "notes": "practitioner_id is mandatory. Response data contains the generated surgery document; the supplied surgery response below records a known shape, not a universal set of required fields.",
    "model": null
  },
  {
    "name": "nurse_care_plan",
    "aliases": [],
    "mode": "Generate care plan",
    "request": {
      "hospital_id": "${HOSPITAL_ID}",
      "hospital_inpatient_id": "${HMS_ADMISSION_ID}",
      "caregiver_id": "${CAREGIVER_ID}",
      "form_name": "nurse_care_plan"
    },
    "response": "GeneratedDocumentResponse",
    "notes": "caregiver_id is mandatory. Care-plan rows include diagnosis, goal, interventions and evaluation. This generates a plan; it is not the upstream read-all-care-plans API.",
    "model": "NurseCarePlanSchema"
  },
  {
    "name": "discharge_summary",
    "aliases": [],
    "mode": "Generate discharge document",
    "request": {
      "hospital_id": "${HOSPITAL_ID}",
      "hospital_inpatient_id": "${HMS_ADMISSION_ID}",
      "practitioner_id": "${PRACTITIONER_ID}",
      "form_name": "discharge_summary"
    },
    "response": "GeneratedDocumentResponse",
    "notes": "Either clinician ID is accepted. The current handler always resolves the latest interaction ordered by updated_at; a supplied interaction_id does not select an older interaction. A missing interaction returns 404. Invalid upstream document content returns 502. Generating this document does not discharge the admission.",
    "model": null
  },
  {
    "name": "case_sheet",
    "aliases": [],
    "mode": "Assemble case sheet",
    "request": {
      "hospital_id": "${HOSPITAL_ID}",
      "hospital_inpatient_id": "${HMS_ADMISSION_ID}",
      "practitioner_id": "${PRACTITIONER_ID}",
      "form_name": "case_sheet",
      "force_regenerate": false
    },
    "response": "Response_case_sheet",
    "notes": "Either clinician ID is accepted. force_regenerate is optional. Sections aggregate assessments, notes, charts and care plans; the service may generate missing notes/plans while assembling the case sheet. Empty objects/arrays represent unavailable sections. Nested chart objects use the dedicated response definitions. Content inside assessment.response depends on the configured template.",
    "model": null
  },
  {
    "name": "get_drug_chart",
    "aliases": [
      "drug_chart"
    ],
    "mode": "Read medication chart",
    "request": {
      "hospital_id": "${HOSPITAL_ID}",
      "hospital_inpatient_id": "${HMS_ADMISSION_ID}",
      "practitioner_id": "${PRACTITIONER_ID}",
      "form_name": "get_drug_chart"
    },
    "response": "Response_get_drug_chart",
    "notes": "Read merged_schema.prescription_data and merged_schema.total_records. Includes medications, administration records, allergies and reconciliation. Category/category filters are stripped by the proxy for this endpoint. Counts describe the full response, not an example subset.",
    "model": "DrugChartRoot"
  },
  {
    "name": "blood_glucose_monitoring_chart",
    "aliases": [
      "get_blood_glucose_monitoring_chart"
    ],
    "mode": "Read glucose chart",
    "request": {
      "hospital_id": "${HOSPITAL_ID}",
      "hospital_inpatient_id": "${HMS_ADMISSION_ID}",
      "caregiver_id": "${CAREGIVER_ID}",
      "form_name": "blood_glucose_monitoring_chart"
    },
    "response": "GlucoseResponse",
    "notes": "The array mixes dated day records and a final creatinine_level/consent_for_insulin record. Do not assume every item has date or entries. Each day has entries, total and remarks. Medication and measurement rows can be separate. Category filters are ignored.",
    "model": null
  },
  {
    "name": "get_all_ipd_notes_grouped_by_date",
    "aliases": [
      "ipd_notes_grouped_by_date"
    ],
    "mode": "Read grouped charts",
    "request": {
      "hospital_id": "${HOSPITAL_ID}",
      "hospital_inpatient_id": "${HMS_ADMISSION_ID}",
      "caregiver_id": "${CAREGIVER_ID}",
      "form_name": "get_all_ipd_notes_grouped_by_date"
    },
    "response": "GroupedResponse",
    "notes": "Omit categories to retrieve the upstream default category set. To select one category, send its exact name in categories. The wrapper converts categories to a string; arrays/comma-separated multiple categories are not a documented multi-select contract. Body start_date/end_date are not forwarded on this generic branch. Use the exact IPD_VITALS/IPD_INTAKE_OUTTAKE shortcut for body date filters.",
    "model": null
  },
  {
    "name": "IPD_VITALS",
    "aliases": [],
    "mode": "Read chart category",
    "request": {
      "hospital_id": "${HOSPITAL_ID}",
      "hospital_inpatient_id": "${HMS_ADMISSION_ID}",
      "caregiver_id": "${CAREGIVER_ID}",
      "form_name": "IPD_VITALS",
      "start_date": "29/09/2026",
      "end_date": "29/09/2026"
    },
    "response": "Response_IPD_VITALS",
    "notes": "Vitals grouped into date records. Values may include units as text. start_date/end_date filter the chart.",
    "model": "VitalSigns"
  },
  {
    "name": "IPD_INTAKE_OUTTAKE",
    "aliases": [],
    "mode": "Read chart category",
    "request": {
      "hospital_id": "${HOSPITAL_ID}",
      "hospital_inpatient_id": "${HMS_ADMISSION_ID}",
      "caregiver_id": "${CAREGIVER_ID}",
      "form_name": "IPD_INTAKE_OUTTAKE",
      "start_date": "29/09/2026",
      "end_date": "29/09/2026"
    },
    "response": "Response_IPD_INTAKE_OUTTAKE",
    "notes": "Intake/output rows plus optional IPD_INTAKE_OUTTAKE_SUMMARY. Without dates the current service shows the current nursing shift; cumulative balance can include earlier shifts. Date filtering is not simply midnight-to-midnight.",
    "model": "IntakeOutput"
  },
  {
    "name": "IPD_CAUTI_BUNDLE",
    "aliases": [
      "cauti_bundle",
      "cautiBundle"
    ],
    "mode": "Read chart category",
    "request": {
      "hospital_id": "${HOSPITAL_ID}",
      "hospital_inpatient_id": "${HMS_ADMISSION_ID}",
      "caregiver_id": "${CAREGIVER_ID}",
      "form_name": "IPD_CAUTI_BUNDLE"
    },
    "response": "Response_cauti_bundle",
    "notes": "Catheter lifecycle records: insertion, daily maintenance, removal and summary. Preserve interaction identifiers within nested rows.",
    "model": "CautiBundle"
  },
  {
    "name": "IPD_CLABSI_BUNDLE",
    "aliases": [
      "clabsi_bundle",
      "clabsiBundle"
    ],
    "mode": "Read chart category",
    "request": {
      "hospital_id": "${HOSPITAL_ID}",
      "hospital_inpatient_id": "${HMS_ADMISSION_ID}",
      "caregiver_id": "${CAREGIVER_ID}",
      "form_name": "IPD_CLABSI_BUNDLE"
    },
    "response": "Response_CLABSI_Bundle",
    "notes": "Central-line lifecycle records, including insertion, maintenance, dressing and removal. Preserve multiple devices/lifecycles.",
    "model": "ClabsiBundle"
  },
  {
    "name": "IPD_VASCULAR_BUNDLE",
    "aliases": [],
    "mode": "Read chart category",
    "request": {
      "hospital_id": "${HOSPITAL_ID}",
      "hospital_inpatient_id": "${HMS_ADMISSION_ID}",
      "caregiver_id": "${CAREGIVER_ID}",
      "form_name": "IPD_VASCULAR_BUNDLE"
    },
    "response": "Response_Vascular_Bundle",
    "notes": "Vascular access device records. A record contains vascular_bundle with insertion_checklist_form, daily_maintenance_checklist_form, vad_removal_checklist_form and complication_report_form.",
    "model": "VascularAccessDeviceBundle"
  },
  {
    "name": "IPD_BLOOD_GLUCOSE_MONITORING",
    "aliases": [],
    "mode": "Read chart category",
    "request": {
      "hospital_id": "${HOSPITAL_ID}",
      "hospital_inpatient_id": "${HMS_ADMISSION_ID}",
      "caregiver_id": "${CAREGIVER_ID}",
      "form_name": "IPD_BLOOD_GLUCOSE_MONITORING"
    },
    "response": "GlucoseResponse",
    "notes": "Same grouped glucose retrieval shape as blood_glucose_monitoring_chart.",
    "model": null
  },
  {
    "name": "IPD_VENTI_FORM",
    "aliases": [],
    "mode": "Read chart category",
    "request": {
      "hospital_id": "${HOSPITAL_ID}",
      "hospital_inpatient_id": "${HMS_ADMISSION_ID}",
      "caregiver_id": "${CAREGIVER_ID}",
      "form_name": "IPD_VENTI_FORM"
    },
    "response": "VentilationResponse",
    "notes": "This category is an OBJECT with venti_insert and venti_maintain arrays, not an array of date groups. Doctor insertion and nurse maintenance records are merged separately.",
    "model": null
  },
  {
    "name": "IPD_BLOOD_TRANSFUSION",
    "aliases": [],
    "mode": "Read chart category",
    "request": {
      "hospital_id": "${HOSPITAL_ID}",
      "hospital_inpatient_id": "${HMS_ADMISSION_ID}",
      "caregiver_id": "${CAREGIVER_ID}",
      "form_name": "IPD_BLOOD_TRANSFUSION"
    },
    "response": "BloodTransfusionResponse",
    "notes": "This category is an OBJECT containing blood_transfusion_reaction_report and blood_transfusion_monitoring_sheet. The latter also contains checklist, fluid_monitoring and post_transfusion_record. It is not an array of date groups. Doctor orders and nurse monitoring/reaction records are combined.",
    "model": "NurBloodTrans"
  },
  {
    "name": "IPD_NUTRITION_FORM",
    "aliases": [],
    "mode": "Read chart category",
    "request": {
      "hospital_id": "${HOSPITAL_ID}",
      "hospital_inpatient_id": "${HMS_ADMISSION_ID}",
      "caregiver_id": "${CAREGIVER_ID}",
      "form_name": "IPD_NUTRITION_FORM"
    },
    "response": "NutritionResponse",
    "notes": "Nutrition periods and clinical sections; the retrieval serializer enriches nutrition with assessment/scoring data. Preserve unknown fields and distinguish absent data from a zero score.",
    "model": "NutritionNotes"
  },
  {
    "name": "IPD_ICU_FORM",
    "aliases": [],
    "mode": "Read chart category",
    "request": {
      "hospital_id": "${HOSPITAL_ID}",
      "hospital_inpatient_id": "${HMS_ADMISSION_ID}",
      "caregiver_id": "${CAREGIVER_ID}",
      "form_name": "IPD_ICU_FORM"
    },
    "response": "IcuResponse",
    "notes": "Assembled ICU view: front, tpr, intake_outtake, eye_movement and position_ent. FAST HUGS BID lives under front.fasthug; it is not a standalone /ipd/forms name.",
    "model": null
  },
  {
    "name": "IPD_GENERAL_OBSERVATIONS",
    "aliases": [],
    "mode": "Read chart category",
    "request": {
      "hospital_id": "${HOSPITAL_ID}",
      "hospital_inpatient_id": "${HMS_ADMISSION_ID}",
      "caregiver_id": "${CAREGIVER_ID}",
      "form_name": "IPD_GENERAL_OBSERVATIONS"
    },
    "response": "Response_IPD_GENERAL_OBSERVATIONS",
    "notes": "Stored general observations. Entries are service-defined; no stable nested response DTO is declared by the upstream API.",
    "model": null
  },
  {
    "name": "IPD_ASSESSMENT_DETAILS",
    "aliases": [],
    "mode": "Read chart category",
    "request": {
      "hospital_id": "${HOSPITAL_ID}",
      "hospital_inpatient_id": "${HMS_ADMISSION_ID}",
      "caregiver_id": "${CAREGIVER_ID}",
      "form_name": "IPD_ASSESSMENT_DETAILS"
    },
    "response": "Response_IPD_ASSESSMENT_DETAILS",
    "notes": "Stored assessment details. The inner content follows the assessment template; it is not one fixed schema.",
    "model": null
  },
  {
    "name": "IPD_PRESCRIPTION_ADMINISTRATIONS",
    "aliases": [],
    "mode": "Read chart category",
    "request": {
      "hospital_id": "${HOSPITAL_ID}",
      "hospital_inpatient_id": "${HMS_ADMISSION_ID}",
      "caregiver_id": "${CAREGIVER_ID}",
      "form_name": "IPD_PRESCRIPTION_ADMINISTRATIONS"
    },
    "response": "Response_IPD_PRESCRIPTION_ADMINISTRATIONS",
    "notes": "Medication administration entries; preserve the record and actor IDs and the stated administration time.",
    "model": "PrescriptionAdministration"
  },
  {
    "name": "update_ipd_data",
    "aliases": [],
    "mode": "Write: extract chart data from edited notes",
    "request": {
      "hospital_id": "${HOSPITAL_ID}",
      "hospital_inpatient_id": "${HMS_ADMISSION_ID}",
      "caregiver_id": "${CAREGIVER_ID}",
      "form_name": "update_ipd_data",
      "interaction_id": "${INTERACTION_ID}",
      "data": "${EDITED_NOTE_TEXT}"
    },
    "response": "WriteResponse",
    "notes": "Requires interaction_id and non-null data. data is notes text or an object serialized to JSON by the wrapper. The upstream extracts chart information; this is not a generic JSON patch operation. Optional doctor_id/nurse_id are internal IDs and are not inferred from the external clinician IDs on this branch. Omit org_id; the server derives it. If supplied, it must match the hospital.",
    "model": null
  },
  {
    "name": "ingest_chart_data",
    "aliases": [],
    "mode": "Write: persist returned chart structure",
    "request": {
      "hospital_id": "${HOSPITAL_ID}",
      "hospital_inpatient_id": "${HMS_ADMISSION_ID}",
      "caregiver_id": "${CAREGIVER_ID}",
      "form_name": "ingest_chart_data",
      "interaction_id": "${INTERACTION_ID}",
      "structured_data": {
        "IPD_VITALS": []
      }
    },
    "response": "IngestResponse",
    "notes": "Send interaction_id and structured_data containing ONE supported chart category with the returned record structure and your edits. The upstream handles only its first recognized category, so do not combine unrelated charts in one update. Preserve nested interaction IDs. Supported write categories are listed below; the current ingestion handler does not support nutrition writes.",
    "model": null
  }
]
