CareScribe Inpatients API

Comprehensive API documentation for inpatient management, patient care, and healthcare workflows

API Gateway URL

Base URL for all API requests:

https://carescribe-app-api-8to2squd.wl.gateway.dev
Important:
  • All API endpoints should be prefixed with this gateway URL
  • Example: https://carescribe-app-api-8to2squd.wl.gateway.dev/software/inpatientsetup
  • The gateway URL is required for all API calls.

Inpatient Setup

POST /software/inpatientsetup

Summary: Toggle Inpatient Setup

Description: Enables or disables the inpatient setup configuration for a hospital. The hospital is identified using the hospital_id query parameter.

Headers: x-api-key (required)
Query: hospital_id (required)

Body

{
  "inpatientSetup": true
}

Response 200 — Success

{
  "success": true,
  "message": "Inpatient setup has been turned ON",
  "inpatientSetup": true
}

Errors

  • 400: {"message": "Invalid inpatient_setup value"}
  • 404: {"message": "hospital_id not found"}
  • 500: {"message": "Failed to update inpatient setup", "error": "Database error"}

Floor

PATCH /software/floor-variable

Summary: Update Floor Variable

Description: Updates the floor variable configuration for a hospital. The floor variable determines how inpatient areas are categorized, such as Floors, Blocks, or Buckets.

Headers: x-api-key (required)
Query: hospital_id (required)

Body

{
  "floor_variable": "Floors"
}

Response 200 — Success

{
  "message": "floor_variable updated successfully.",
  "data": "Floors"
}

Errors

  • 400: {"message": "floor_variable is required."}
  • 404: {"message": "hospital_id not found."}
  • 500: {"message": "Failed to update floor_variable.", "error": "Database error"}

Floor Management

GET /software/getallfloor

Summary: Get All Floors

Description: Retrieves all floors for a given hospital. The hospital_id is used to identify the organization.

Headers: x-api-key (required)
Query: hospital_id (required)

Response 200 — Floors fetched successfully

{
  "message": "Floors fetched successfully.",
  "data": [
    {
      "floor_id": 12,
      "floor_name": "Second Floor",
      "organization_id": 5,
      "createdAt": "2025-01-15T10:30:00Z",
      "updatedAt": "2025-01-15T10:30:00Z"
    }
  ]
}

Errors

  • 400: {"message": "hospital_id is required."}
  • 404: {"message": "No Floors found for this hospital."}
  • 500: {"message": "Failed to retrieve floors.", "error": "Database error"}
POST /software/createfloor

Summary: Create Floor

Description: Creates a new floor for a given hospital. The hospital_id is used to identify the organization. Floor name must be unique within the organization.

Headers: x-api-key (required)
Body required: floor_name, hospital_id

Body

{
  "floor_name": "First Floor",
  "hospital_id": "9"
}

Response 201 — Floor created successfully

{
  "message": "Floor created successfully.",
  "data": {
    "floor_id": 12,
    "floor_name": "First Floor",
    "organization_id": 3
  }
}

Errors

  • 400: {"message": "floor_name and hospital_id are required"}
  • 404: {"message": "Organization not found"}
  • 409: {"message": "Floor already exists for this organization."}
  • 500: {"message": "Failed to create floor", "error": "Database connection failed"}
PUT /software/updatefloor

Summary: Update Floor

Description: Updates an existing floor for a given hospital. The hospital_id is used to identify the organization. Prevents duplicate floor names within the same organization.

Headers: x-api-key (required)
Query: hospital_id (required)
Body required: floor_id

Body

{
  "floor_id": 2,
  "floor_name": "New Floor"
}

Response 200 — Floor updated successfully

{
  "message": "Floor updated successfully.",
  "data": {
    "floor_id": 2,
    "floor_name": "New Floor",
    "organization_id": 3
  }
}

Errors

  • 400: {"message": "hospital_id is required."}
  • 404: {"message": "Floor not found."}
  • 409: {"message": "Floor with this name already exists."}
  • 500: {"message": "Failed to update.", "error": "Database error"}
DELETE /software/deletefloor

Summary: Delete Floor

Description: Deletes an existing floor for a given hospital. The hospital_id is used to identify the organization and ensures the floor belongs to the organization before deletion.

Headers: x-api-key (required)
Query: hospital_id (required), floor_id (required)

Response 200 — Floor deleted successfully

{
  "message": "Floor deleted successfully."
}

Errors

  • 400: {"message": "floor_id is required."}
  • 404: {"message": "Floor not found."}
  • 500: {"message": "Failed to delete", "error": "Database error"}

Bed

GET /software/get/bedslist

Summary: Get All Beds List

Description: Fetches all beds for a hospital, including floor details.

Headers: x-api-key (required)
Query: hospital_id (required)

Response 200 — Success

{
  "message": "Beds fetched successfully.",
  "beds": [
    {
      "bed_id": "BED12345",
      "bed_no": "101",
      "ward": "General Ward",
      "bed_type": "General",
      "is_occupied": false,
      "status": "Available",
      "floor": {
        "floor_id": "FLOOR01",
        "floor_name": "First Floor"
      },
      "created_at": "2025-10-15T12:30:00Z"
    }
  ]
}

Errors

  • 400: {"message": "hospital_id is required"}
  • 404: {"message": "Invalid hospital_id"}
  • 500: {"message": "Internal Server Error"}
POST /software/create/bed

Summary: Create a new inpatient bed

Description: Creates a bed for a hospital; status/maintenance fields optional.

Body

{
  "hospital_id": 9,
  "bed_no": "3",
  "bed_type": "general",
  "ward": "general",
  "floor": "2",
  "is_occupied": false,
  "status": "available",
  "need_maintenance": false,
  "last_cleaned_at": "2025-11-26",
  "patient_id": null,
  "inpatient_id": null,
  "admitted_at": null
}

Response 201 — Created

{
  "message": "Bed created successfully.",
  "bed": { /* new bed details */ }
}

Errors

  • 400: {"message": "Bed number already exists."}
  • 404: {"message": "Invalid hospital_id"}
  • 500: {"message": "Internal Server Error"}
POST /software/update/bed

Summary: Update an existing inpatient bed

Description: Updates ward/bed info, status, floor, maintenance flags.

Headers: x-api-key (required)
Query: bed_id (required)

Body

{
  "hospital_id": 9,
  "bed_no": "3",
  "ward": "general",
  "bed_type": "ICU",
  "is_occupied": false,
  "status": "occupied",
  "floor": "floor-2",
  "need_maintenance": false,
  "last_cleaned_at": "2025-11-26"
}

Response 200 — Success

{
  "message": "Bed updated successfully.",
  "bed": { /* updated bed details */ }
}

Errors

  • 400: {"message": "Bed number already exists on this floor/ward."}
  • 404: {"message": "Invalid hospital_id / Invalid floor / Bed not found."}
  • 500: {"message": "Internal Server Error"}

Ward Management

GET /software/bedtypes-wards

Summary: Get Bed Types and Wards

Description: Retrieves bed types and wards configured for a hospital. Data is returned as arrays even if stored as JSON strings.

Headers: x-api-key (required)
Query: hospital_id (required)

Response 200 — Bed types and wards retrieved successfully

{
  "bedtypes": [
    "ICU",
    "General",
    "Semi-Private"
  ],
  "wards": [
    "Ward A",
    "Ward B",
    "Emergency"
  ]
}

Errors

  • 404: {"message": "hospital not found."}
  • 500: {"message": "Failed to retrieve bed types and wards", "error": "Error details message here"}
POST /software/ward/add

Summary: Add Ward to Organization

Description: Adds a new ward to the organization based on hospital_id.

Headers: x-api-key (required)
Query: hospital_id (required)
Body required: ward

Body

{
  "ward": "Ward 15"
}

Response 200 — Ward added successfully

{
  "message": "Ward added successfully.",
  "data": {
    "wards": [
      "Ward 1",
      "Ward 2",
      "Ward 15"
    ]
  }
}

Errors

  • 400: {"message": "hospital_id is required."}
  • 404: {"message": "Organization not found."}
  • 409: {"message": "This ward already exists for the organization."}
  • 500: {"message": "Failed to add ward", "error": "Error details message here"}
PUT /software/ward/update

Summary: Update Ward Name

Description: Updates an existing ward name for an organization using hospital_id.

Headers: x-api-key (required)
Query: hospital_id (required)
Body required: old_ward, new_ward

Body

{
  "old_ward": "ward 15",
  "new_ward": "ward 17"
}

Response 200 — Ward updated successfully

{
  "message": "Ward updated successfully.",
  "data": {
    "organization_id": 101,
    "hospital_id": "9",
    "wards": [
      "Ward 1",
      "Ward 2",
      "Ward 17"
    ]
  }
}

Errors

  • 400: {"message": "Old ward and new ward are required."}
  • 404: {"message": "Ward not found."}
  • 409: {"message": "This ward already exists for the organization."}
  • 500: {"message": "Failed to update ward", "error": "Error details message here"}
DELETE /software/ward/delete

Summary: Remove Ward

Description: Removes an existing ward from the organization using hospital_id.

Headers: x-api-key (required)
Query: hospital_id (required)
Body required: ward

Body

{
  "ward": "ward 17"
}

Response 200 — Ward removed successfully

{
  "message": "Ward removed successfully.",
  "data": {
    "wards": [
      "Ward 1",
      "Ward 2"
    ]
  }
}

Errors

  • 400: {"message": "Ward name is required."}
  • 404: {"message": "Ward not found."}
  • 500: {"message": "Failed to remove ward", "error": "Error details message here"}
POST /software/upload-csv/partitionsetup

Summary: Upload CSV for Floor, Bed Type, and Ward Setup

Description: Uploads a CSV file to configure floors, bed types, and wards for a hospital.

Headers: x-api-key (required)
Query: hospital_id (required)
Form Data: csvFile (required, multipart/form-data)

CSV Requirements

  • CSV must contain at least one of the following headers:
    • Floor Name
    • Bed Type
    • Ward
  • Rows with all empty values are treated as invalid.
  • Existing values in the database are skipped automatically.

Response 200 — CSV uploaded and processed successfully

{
  "message": "CSV uploaded and processed successfully.",
  "data": {
    "floorsCreated": 3,
    "floorsSkipped": 1,
    "bedTypesAdded": 2,
    "bedTypesSkipped": 1,
    "wardsAdded": 2,
    "wardsSkipped": 1,
    "totalFloors": 5,
    "totalBedTypes": 4,
    "totalWards": 6
  },
  "invalidRows": [
    {
      "row": 5,
      "reason": "Row is empty"
    }
  ],
  "duplicateRows": [],
  "skippedRows": []
}

Errors

  • 400: {"message": "A CSV file is required."}
  • 404: {"message": "Organization not found for the given hospital_id."}
  • 500: {"message": "Failed to upload CSV", "error": "Error details message here"}

Inpatient Management

POST /software/createinpatient

Summary: Create Inpatient

Description: Creates a new inpatient record for a given hospital. Validates hospital, practitioner, floor, and organization details. Generates unique patient_id and inpatient_id automatically.

Headers: x-api-key (required)
Query: hospital_id (required)
Body required: practitioner_id, patient_category, floor_id, hospital_inpatient_id

Body

{
  "first_name": "Ravi",
  "last_name": "Kumar",
  "hospital_inpatient_id": "IN-GEN9-202601-00025",
  "practitioner_id": "0123",
  "patient_category": "Inpatient",
  "floor_id": 29,
  "speciality_id": 5,
  "hospital_patient_id": "HSP123",
  "date_of_birth": "1995-06-15",
  "phone_number": "9876543210",
  "age": 30,
  "gender": "Male",
  "address1": "Chennai",
  "email": "ravi@gmail.com",
  "marital_status": "Single",
  "aadhar_number": "123412341234",
  "Referred_by_doctor": "Dr. Suresh",
  "in_date": "2026-01-05",
  "bed_id": 12,
  "ward": "Ward-A",
  "timeZone": "Asia/Kolkata"
}

Response 201 — Inpatient created successfully

{
  "message": "Inpatient created successfully.",
  "patient": { /* Patient details */ },
  "inpatient": { /* Inpatient details */ }
}

Errors

  • 400: {"message": "hospital_id is required."}
  • 404: {"message": "Floor not found for this hospital."}
  • 500: {"message": "Error creating Inpatient", "error": "Database error"}
GET /software/inpatientlistsbyhospital

Summary: Get Inpatients List by Hospital

Description: Retrieves all active inpatients for a given hospital. The hospital_id is used to identify the organization and fetch associated patient, doctor, bed, and floor details.

Headers: x-api-key (required)
Query: hospital_id (required)

Response 200 — Inpatients fetched successfully

{
  "inpatients": [
    {
      "inpatient_id": "IN-ORG1-202601-00001",
      "patient_id": "ORG1-202601-00001",
      "in_date": "2026-01-05",
      "out_date": null,
      "primarydoctor": 12,
      "floor_id": 3,
      "active": true,
      "Patient": {
        "patient_id": "ORG1-202601-00001",
        "patient_category": "Inpatient",
        "first_name": "John",
        "last_name": "Doe",
        "phone_number": "+919876543210",
        "gender": "Male"
      },
      "primaryDoctor": {
        "doctor_id": 12,
        "first_name": "Dr. Arjun",
        "last_name": "Sharma"
      },
      "Bed": { /* Bed details */ },
      "floor": {
        "floor_id": 3,
        "floor_name": "First Floor"
      }
    }
  ]
}

Errors

  • 400: {"error": "hospital_id is required"}
  • 404: {"error": "Organization not found for the given hospital_id"}
  • 500: {"message": "Error fetching inpatients", "error": "Database error"}
PUT /software/inpatient/assign-primary-doctor

Summary: Assign Primary Doctor / Update Inpatient by Hospital

Description: Updates an inpatient record using hospital_inpatient_id for a given hospital. Use this endpoint to assign or change the primary doctor via practitioner_id, and in the same call update the floor, bed, ward, patient category, admission date, attender details, and insurance details. If bed_no is changed, the previous bed is released and the new bed is marked occupied for the inpatient.

Headers: x-api-key (required)
Query: hospital_id (required)
Body required: hospital_inpatient_id

Body

{
  "hospital_inpatient_id": "IN-GEN9-202601-00025",
  "practitioner_id": "108",
  "floor_id": 29,
  "bed_no": "B123",
  "ward": "General",
  "patient_id": "GEN9-202601-00025",
  "patient_category": "Inpatient",
  "in_date": "2025-01-06T10:00:00Z",
  "attender_mobile_no": "+919876543210",
  "insurance_type": "Cashless",
  "attender_name": "Suresh Kumar",
  "attender_relation": "Brother"
}

Response 200 — Inpatient updated successfully

{
  "message": "Inpatient updated successfully",
  "inpatient": {
    "inpatient_id": "IN-GEN9-202601-00025",
    "hospital_inpatient_id": "IN-GEN9-202601-00025",
    "patient_id": "GEN9-202601-00025",
    "ward": "General",
    "bed_no": "B123",
    "in_date": "2025-01-06T10:00:00Z",
    "out_date": null,
    "active": true,
    "Patient": {
      "patient_id": "GEN9-202601-00025",
      "hospital_patient_id": "HP-001",
      "first_name": "Ravi",
      "last_name": "Kumar",
      "phone_number": "+919876543210",
      "gender": "Male"
    },
    "primaryDoctor": {
      "doctor_id": 12,
      "first_name": "Dr. Arjun",
      "last_name": "Sharma"
    },
    "Bed": { /* Bed details */ },
    "floor": {
      "floor_id": 29,
      "floor_name": "First Floor"
    }
  }
}

Common uses:

  • Assign or change the primary doctor for an inpatient using practitioner_id.
  • Move the inpatient to a different floor_id, ward, or bed_no.
  • Update admission metadata like patient_category and in_date.
  • Update attender and insurance fields in the same request.

Errors

  • 400: {"error": "hospital_id is required"}
  • 400: {"error": "hospital_inpatient_id is required"}
  • 404: {"message": "Inpatient not found with the given hospital_inpatient_id for this hospital"}
  • 404: {"error": "Organization not found for the given hospital_id"}
  • 404: {"error": "Doctor not found for the given practitioner_id"}
  • 500: {"message": "Server error", "error": "Database error"}

Doctor

POST /software/fetchinpatientsbydoctor

Summary: Fetch Inpatients by Doctor

Description: Retrieves all active inpatients assigned to a specific doctor. The doctor is resolved using practitioner_id and filtered by hospital_id. Returns patient, doctor, nurse, and bed details.

Headers: x-api-key (required)
Body required: practitioner_id, hospital_id

Body

{
  "practitioner_id": "0123",
  "hospital_id": "9"
}

Response 200 — Inpatients fetched successfully

[
  {
    "inpatient_id": "IN-ORG1-202601-00001",
    "patient_id": "ORG1-202601-00001",
    "in_date": "2026-01-05",
    "out_date": null,
    "patient": {
      "patient_id": "ORG1-202601-00001",
      "hospital_patient_id": "HP-001",
      "first_name": "John",
      "last_name": "Doe",
      "phone_number": "+919876543210",
      "gender": "Male"
    },
    "assignedDoctors": [
      {
        "doctor_id": 12,
        "doctor_name": "Dr. Ravi Kumar"
      }
    ],
    "assignedNurses": [
      {
        "nurse_id": 5,
        "nurse_name": "Anitha S",
        "shift": "Day"
      }
    ],
    "bed": {
      "bed_no": "B12",
      "ward": "Ward-A",
      "status": "occupied",
      "inpatient_id": "IN-ORG1-202601-00001"
    }
  }
]

Errors

  • 400: {"error": "hospital_id is required"}
  • 404: {"error": "Doctor not found for the given practitioner_id"}
  • 500: {"error": "Internal server error"}

Nurse

GET /software/nurse/hospitalnurselist

Summary: Get Nurse List by Hospital ID

Description: Fetches nurses for the organization mapped from hospital_id.

Headers: x-api-key (required)
Query: hospital_id (required)

Response 200 — Success

{
  "message": "Nurse list fetched successfully",
  "count": 3,
  "data": [
    {
      "nurse_id": "NURSE001",
      "first_name": "Priya",
      "last_name": "K",
      "phone_number": "+919876543210",
      "email": "nurse@example.com",
      "organization_id": "ORG123"
    }
  ]
}

Errors

  • 400: {"message": "hospital_id is required"}
  • 404: {"message": "Invalid hospital_id"}
  • 500: {"message": "Server error", "error": "Database connection failed"}
POST /software/nurse/create

Summary: Create Nurse

Description: Maps hospital_id to organization and creates nurse; email optional (auto-generated if blank).

Headers: x-api-key (required)
Query: hospital_id (required)

Body

{
  "firstname": "Sarah",
  "lastname": "John",
  "email": "",
  "phone": "994056789",
  "floor_id": 2,
  "caregiver_id": "LI7897"
}

Response 201 — Created

{
  "message": "Nurse created successfully",
  "data": {
    "nurse_id": "NURSE102",
    "first_name": "Sarah",
    "last_name": "John",
    "email": "sarahjohnmul123@gmail.com",
    "phone_number": "994056789",
    "floor_id": 2,
    "caregiver_id": "LI7897",
    "role": "nurse,nurse_admin",
    "shift": "day",
    "organization_id": "ORG123"
  }
}

Errors

  • 400: {"message": "firstname, lastname, and floor_id are required fields"}
  • 404: {"message": "Invalid hospital_id"}
  • 500: {"message": "Server error", "error": "Database connection failed"}
POST /software/inpatient/assign-by-caregiver-practitioner

Summary: Assign Inpatient

Description: Assign nurses and doctors to an inpatient. Accepts single value or array for both caregiver_id and practitioner_id.

Headers: x-api-key (required)
Query: hospital_id (required)
Body required: inpatient_id plus at least one of caregiver_id or practitioner_id.
Tip: You can send a string (one ID) or an array (multiple IDs) for each field.

Body

{
  "inpatient_id": "IN-GEN9-202508-00004",
  "caregiver_id": ["carescribe-nurse001", "carescribe-nurse002"],
  "practitioner_id": "123"
}

Response 200 — Assignment successful

{
  "message": "Inpatient assignment processed",
  "data": {
    "inpatient_id": "IN-GEN9-202508-00004",
    "assigned_nurses": [
      { "caregiver_id": "carescribe-nurse001", "nurse_id": 45 },
      { "caregiver_id": "carescribe-nurse002", "nurse_id": 46 }
    ],
    "assigned_doctors": [
      { "practitioner_id": "123", "doctor_id": 217 }
    ]
  }
}

Response 207 — Partial success

{
  "message": "Processed with partial failures",
  "data": {
    "inpatient_id": "IN-GEN9-202508-00004",
    "assigned_nurses": [{ "caregiver_id": "carescribe-nurse001", "nurse_id": 45 }],
    "assigned_doctors": []
  },
  "errors": [
    { "type": "practitioner", "id": "999", "message": "Practitioner not found" }
  ]
}

Errors

  • 400: {"message": "At least one caregiver_id or practitioner_id is required."}
  • 404: {"message": "Invalid hospital_id"}
  • 500: {"message": "Internal server error", "error": "details"}

Nurse Inpatient Queue

GET /software/nurse/fetch-inpatients

Summary: Fetch Inpatients Assigned to a Nurse

Description: Returns the list of inpatients assigned to a nurse (caregiver_id) in a given hospital. Verifies caregiver_id and hospital_id. Finds nurse using caregiver_id. Finds organization using hospital_id. Fetches all inpatient_ids assigned to that nurse. Applies optional date filter to fetch inpatients active on that date. Includes details of patient, assigned doctors, assigned nurses, and bed information.

Headers: x-api-key (required)
Body required: caregiver_id, hospital_id (optional: date, timeZone)

Body

{
  "caregiver_id": "carescribe-nurse001",
  "hospital_id": "9",
  "date": "2025-11-19",
  "timeZone": "Asia/Kolkata"
}

Response 200 — Inpatients fetched successfully

{
  "caregiver_id": "carescribe-nurse001",
  "hospital_id": 9,
  "data": [
    {
      "inpatient_id": "IN-GEN9-202511-00463",
      "patient_id": "P-10023",
      "in_date": "2025-11-18T10:00:00Z",
      "out_date": null,
      "Patient": {
        "patient_id": "P-10023",
        "hospital_patient_id": "HP-09-221",
        "first_name": "Sneha",
        "last_name": "Rao",
        "phone_number": "9876543210",
        "gender": "Female"
      },
      "assignedDoctors": [
        {
          "doctor_id": "100",
          "doctor_name": "Dr. Arjun Sharma"
        }
      ],
      "assignedNurses": [
        {
          "nurse_id": "N-22",
          "caregiver_id": "carescribe-nurse001",
          "nurse": "Priya Das",
          "shift": "Night"
        }
      ],
      "bed": {
        "bed_no": "B12",
        "ward": "General",
        "status": "Occupied",
        "inpatient_id": "IN-GEN9-202511-00463"
      }
    }
  ]
}

Errors

  • 400: {"error": "Missing required field: caregiver_id must be provided"}
  • 404: {"error": "Nurse not found with the provided caregiver_id"}
  • 500: {"error": "Internal server error", "details": "Database connection failed"}
GET /software/nurse/getnursedetails

Summary: Get nurse details using caregiver_id

Description: Fetch nurse details by caregiver_id. Requires hospital_id and caregiver_id as query parameters.

Headers: x-api-key (required)
Query: hospital_id (required), caregiver_id (required)

Response 200 — Nurse fetched successfully

{
  "message": "Nurse fetched successfully",
  "data": { /* Nurse details */ }
}

Errors

  • 400: {"message": "caregiver_id is required"}
  • 404: {"message": "Nurse not found with the provided caregiver_id"}
  • 500: {"message": "Server error", "error": "Database error"}

Todo List

GET /software/doctortodo

Summary: Get Doctor Todo List

Description: Fetches the To-Do details for a doctor using hospital_inpatient_id and hospital_id. The API first attempts to retrieve data from the chatbot service. If the chatbot fails, it falls back to fetching interaction records from the database.

Headers: x-api-key (required)
Query: hospital_inpatient_id (required), hospital_id (required)

Response 200 — Doctor todo fetched successfully

{
  "patient_id": "GEN9-202601-00048",
  "inpatient_id": "IN-GEN9-202601-00008",
  "todo_data": [
    {
      "interaction_id": "102463",
      "created_at": null,
      "gcs_uri": "gs://medscribe-dev/webm_files/todos/record-notes-9_GEN9-202601-00048_2382db3c-13e2-4746-aa21-cbfd7d8ce2a0.txt",
      "todos": [
        {
          "investigations": [],
          "opinions": [],
          "prescription_tasks": [
            {
              "medication_name": "(CALPOL TABLET)",
              "medication_type": "Tablet",
              "route": "Oral",
              "dosage": "",
              "dosage_time": ["6:00 AM", "6:00 PM"],
              "duration": "1 week",
              "instructions": "Take one in the morning and one at night. Follow up in one week.",
              "med_status": "continue",
              "scheduled_date": null,
              "frequency_morning": [
                {
                  "frequency": "1",
                  "status": "Pending"
                }
              ],
              "frequency_afternoon": [],
              "frequency_evening": [],
              "frequency_night": [
                {
                  "frequency": "1",
                  "status": "Pending"
                }
              ]
            }
          ]
        }
      ]
    }
  ]
}

Errors

  • 400: {"message": "hospital_inpatient_id is required"}
  • 404: {"message": "Invalid hospital_id"}
  • 500: {"message": "Error fetching doctor todos"}
PUT /software/doctor/approvetodo

Summary: Approve Doctor Todo

Description: Approves a doctor's todo item using hospital_inpatient_id. Fetches patient_id and inpatient_id from the database. Calls chatbot service (`doc_approved`) if available, otherwise uses fallback.

Headers: x-api-key (required)
Query: hospital_id (required), hospital_inpatient_id (required), interaction_id (required)
Body: Optional todo data to be approved

Body (Optional)

{
  "patient_id": "GEN9-202601-00048",
  "inpatient_id": "IN-GEN9-202601-00008",
  "todo_data": [
    {
      "interaction_id": "102463",
      "created_at": null,
      "gcs_uri": "gs://medscribe-dev/webm_files/todos/record-notes-9_GEN9-202601-00048_2382db3c-13e2-4746-aa21-cbfd7d8ce2a0.txt",
      "todos": [
        {
          "investigations": [],
          "opinions": [],
          "prescription_tasks": [
            {
              "medication_name": "(CALPOL TABLET)",
              "medication_type": "Tablet",
              "route": "Oral",
              "dosage": "",
              "dosage_time": ["6:00 AM", "6:00 PM"],
              "duration": "1 week",
              "instructions": "Take one in the morning and one at night. Follow up in one week.",
              "med_status": "continue",
              "scheduled_date": null,
              "frequency_morning": [
                {
                  "frequency": "1",
                  "status": "Pending"
                }
              ],
              "frequency_afternoon": [],
              "frequency_evening": [],
              "frequency_night": [
                {
                  "frequency": "1",
                  "status": "Pending"
                }
              ]
            }
          ]
        }
      ]
    }
  ]
}

Response 200 — Todo approved successfully

{
  "message": "Doctor approved for this interaction_id=102474 and patient_id=GEN9-202601-00048."
}

Errors

  • 400: {"status": false, "message": "hospital_id, hospital_inpatient_id and interaction_id are required"}
  • 404: {"status": false, "message": "Invalid hospital_id or hospital_inpatient_id"}
  • 500: {"status": false, "message": "Error approving todo", "error": "Database connection failed"}
GET /software/nurse/todo

Summary: Get Nurse Todo List

Description: Fetches the approved todo list for a nurse using hospital_inpatient_id. The API first queries the chatbot service (`approved-todo-list`). If the chatbot is unreachable or fails, the system returns an empty fallback response.

Headers: x-api-key (required)
Query: hospital_id (required), hospital_inpatient_id (required)

Response 200 — Successfully fetched nurse todo list

{
  "patient_id": "GEN9-202601-00048",
  "inpatient_id": "IN-GEN9-202601-00008",
  "todo_data": [
    {
      "created_at": "2026-01-06 10:26:56",
      "interaction_id": "101969",
      "gcs_uri": "gs://duckdb-carescribe/duckdb/database/patient/GEN9-202601-00048/GEN9-202601-00048-101969_todos-lab_data.parquet",
      "todos": [
        {
          "prescription_tasks": []
        }
      ]
    },
    {
      "created_at": "2026-01-06 12:39:24",
      "interaction_id": "102086",
      "gcs_uri": "gs://duckdb-carescribe/duckdb/database/patient/GEN9-202601-00048/GEN9-202601-00048-102086_todos-lab_data.parquet",
      "todos": [
        {
          "investigations": [],
          "opinions": [],
          "prescription_tasks": [
            {
              "dosage": "",
              "dosage_time": ["6:00 AM", "6:00 PM"],
              "duration": "1 week",
              "frequency_afternoon": [],
              "frequency_evening": [],
              "frequency_morning": [
                {
                  "frequency": "",
                  "status": "Completed"
                }
              ],
              "frequency_night": [
                {
                  "frequency": "",
                  "status": "Pending"
                }
              ],
              "instructions": "Take one in the morning and one at night. Follow up in one week.",
              "med_status": "continue",
              "medication_name": "(CALPOL TABLET)",
              "medication_type": "Tablet",
              "route": "Oral",
              "scheduled_date": null
            }
          ]
        }
      ]
    },
    {
      "created_at": "2026-01-07 11:17:07",
      "interaction_id": "102456",
      "gcs_uri": "gs://duckdb-carescribe/duckdb/database/patient/GEN9-202601-00048/GEN9-202601-00048-102456_todos-lab_data.parquet",
      "todos": [
        {
          "investigations": [],
          "opinions": [],
          "prescription_tasks": [
            {
              "dosage": "",
              "dosage_time": ["6:00 AM", "6:00 PM"],
              "duration": "1 week",
              "frequency_afternoon": [],
              "frequency_evening": [],
              "frequency_morning": [
                {
                  "frequency": "1",
                  "status": "Pending"
                }
              ],
              "frequency_night": [
                {
                  "frequency": "1",
                  "status": "Pending"
                }
              ],
              "instructions": "Take one in the morning and one at night. Follow up in one week.",
              "med_status": "continue",
              "medication_name": "(CALPOL TABLET)",
              "medication_type": "Tablet",
              "route": "Oral",
              "scheduled_date": null
            },
            {
              "dosage": "",
              "dosage_time": null,
              "duration": "1 Week",
              "frequency_afternoon": [
                {
                  "frequency": "1",
                  "status": "Pending"
                }
              ],
              "frequency_evening": [
                {
                  "frequency": "1",
                  "status": "Pending"
                }
              ],
              "frequency_morning": [
                {
                  "frequency": "1",
                  "status": "Pending"
                }
              ],
              "frequency_night": [
                {
                  "frequency": "1",
                  "status": "Completed"
                }
              ],
              "instructions": "",
              "med_status": null,
              "medication_name": "BUDEPRL 0.5MG RESPULES BUDESONIDE",
              "medication_type": "Tablet",
              "route": "Oral",
              "scheduled_date": "2026-01-07"
            }
          ]
        }
      ]
    }
  ]
}

Errors

  • 400: {"status": false, "message": "hospital_id and hospital_inpatient_id are required"}
  • 404: {"status": false, "message": "Invalid hospital_id or hospital_inpatient_id"}
  • 500: {"status": false, "message": "Error fetching nurse todos", "error": "Database connection failed"}
PUT /software/nurse/updatestatus

Summary: Update Nurse Todo Status

Description: Updates the status of a nurse's todo item using hospital_inpatient_id. The API first attempts to update status using the chatbot (`nurse-status-update`). If the chatbot fails, a fallback success response is returned.

Headers: x-api-key (required)
Query: hospital_id (required), hospital_inpatient_id (required)
Body required: interaction_id, gcs_uri, todos

Body

{
  "interaction_id": "102456",
  "gcs_uri": "gs://duckdb-carescribe/duckdb/database/patient/GEN9-202601-00048/GEN9-202601-00048-102456_todos-lab_data.parquet",
  "todos": [
    {
      "investigations": [],
      "opinions": [],
      "prescription_tasks": [
        {
          "medication_name": "(CALPOL TABLET)",
          "medication_type": "Tablet",
          "route": "Oral",
          "dosage": "",
          "dosage_time": ["6:00 AM", "6:00 PM"],
          "duration": "1 week",
          "instructions": "Take one in the morning and one at night. Follow up in one week.",
          "med_status": "continue",
          "scheduled_date": "2026-01-07",
          "frequency_morning": [
            {
              "frequency": "1",
              "status": "Pending"
            }
          ],
          "frequency_afternoon": [
            {
              "frequency": "1",
              "status": "Pending"
            }
          ],
          "frequency_evening": [
            {
              "frequency": "1",
              "status": "Pending"
            }
          ],
          "frequency_night": [
            {
              "frequency": "1",
              "status": "Completed"
            }
          ]
        }
      ]
    }
  ]
}

Response 200 — Nurse status updated successfully

{
  "message": "Successfully updated"
}

Errors

  • 400: {"status": false, "message": "hospital_id and hospital_inpatient_id are required"}
  • 404: {"status": false, "message": "Invalid hospital_id or hospital_inpatient_id"}
  • 500: {"status": false, "message": "Error updating nurse status", "error": "Database connection failed"}

Inpatient Integration

POST /software/integration/inpatient

Summary: Inpatient software integration

Description: Creates or updates an inpatient record. Generates a secure session URL for clinician access.

Headers: x-api-key (required)
Important:
  • Provide EITHER doctor.practitioner_id OR nurse.caregiver_id
  • If both are provided → request will be rejected
  • Empty caregiver_id or practitioner_id is treated as NOT provided

Request Body - Doctor Login

Use this payload when a doctor is accessing the inpatient record:

{
  "hospital_id": "9",
  "doctor": {
    "practitioner_id": "1001"
  },
  "patient": {
    "patient_id": "HOSP-PAT-001",
    "name": "John Doe",
    "age": 45,
    "gender": "Male"
  },
  "inpatient": {
    "hospital_inpatient_id": "INP-HOSP-PAT-001"
  }
}

Request Body - Nurse Login

Use this payload when a nurse is accessing the inpatient record:

{
  "hospital_id": "9",
  "nurse": {
    "caregiver_id": "LI7987"
  },
  "patient": {
    "patient_id": "HOSP-PAT-001",
    "name": "John Doe",
    "age": 45,
    "gender": "Male"
  },
  "inpatient": {
    "hospital_inpatient_id": "INP-HOSP-PAT-001"
  }
}

Response 200 — Success – session URL generated

Doctor Login Response:

{
  "message": "Patient already exists. Inpatient record updated.",
  "path": "/session_id?...&practitioner_id=1001",
  "patient_id": "4435c603-a0b8-48a6-9766-4ca911770fac",
  "inpatient_id": "INP-HOSP-PAT-001",
  "interaction_id": 105574
}

Nurse Login Response:

{
  "message": "Patient already exists. Inpatient record updated.",
  "path": "/session_id?...&caregiver_id=LI7987",
  "patient_id": "4435c603-a0b8-48a6-9766-4ca911770fac",
  "inpatient_id": "INP-HOSP-PAT-001",
  "interaction_id": 105574
}
Session URL Notes:
  • Session URL includes ONLY the identifier provided in request
  • Doctor flow: The path will contain practitioner_id parameter
  • Nurse flow: The path will contain caregiver_id parameter
  • The path field contains the complete session URL that can be used to access the inpatient record

Errors

  • 400: "Provide either practitioner_id (doctor) or caregiver_id (nurse), not both. Please use one and try again."
  • 404: "Organization not found"
  • 409: "Another clinician is currently visiting this inpatient."
  • 500: "Internal Server Error"

Endpoint: POST /software/integration/inpatient

When IPD modules are used, data is sent to your system following a two-payload pattern (see detailed explanation below). The outer status can be "initial" when the form is opened, or "complete" when the form is saved.

Base Response Structure

This structure applies to both Initial Payload and Final Payload - only the status values change.

Initial Payload Example (Form Opened)

{
  "status": "initial",
  "data": {
    "SessionId": "GEN9-202509-00170",
    "hospitalId": "9",
    "patientId": "GEN9-202509-00170",
    "IpId": "105219",
    "OpId": "",
    "PractitionerId": null,
  "type": "ipd",
    "formName": "drug_chart",
    "process": "drug_chart",
    "response": "{\"drug_chart\":[...]}",
    "medication_templates": [],
    "additional_response": null,
    "status": "initial payload"
  }
}

Final Payload Example (Form Saved)

{
  "status": "complete",
  "data": {
    "SessionId": "GEN9-202509-00170",
    "hospitalId": "9",
    "patientId": "GEN9-202509-00170",
    "IpId": "105219",
    "OpId": "",
    "PractitionerId": null,
    "type": "ipd",
    "formName": "drug_chart",
    "process": "drug_chart",
    "response": "{\"drug_chart\":[...]}",
    "medication_templates": [],
    "additional_response": null,
    "status": "complete"
  }
}
POST /software/api/ipd/generate-document

Summary: Generate IPD Document

Description: Generates IPD documents such as initial assessment, progress notes, surgery notes, nurse notes, and nursing care plan based on patient, inpatient, and clinician details. For doctor forms provide practitioner_id; for nurse forms provide caregiver_id.

Request

{
  "hospital_id": 9,
  "patient_id": "GEN9-202509-00435",
  "inpatient_id": "IN-GEN9-202509-00034",
  "practitioner_id": "9871",
  "document_type": "surgery_notes"
}

Allowed document_type values

- initial_assessment
- progress_notes
- surgery_notes
- nurse_notes
- nurse_care_plan

Response 200 — Document generated successfully

{
  "success": true,
  "message": "Document generated successfully",
  "data": {
    "session_id": "112170",
    "patient_id": "GEN9-202509-00435",
    "inpatient_id": "IN-GEN9-202509-00034",
    "doctor_id": 226,
    "patient_type": "surgery_notes",
    "answer": {
      "pre_operative_diagnosis": "Abnormal uterine bleeding, complicated fibroid.",
      "name_of_operation": "Total laparoscopic hysterectomy",
      "surgeon_remarks": "Patient shifted to OT."
    }
  }
}

Errors

POST /software/documents/upload

Summary: Upload patient document

Description: Upload a patient document file and patient details. Send the request as multipart/form-data.

Query Parameters

  • hospital_id (required): Hospital identifier used to resolve the organization.

Form Data

  • patient_id (required): Patient identifier.
  • name (required): Patient name.
  • age (required): Patient age.
  • gender (required): Patient gender.
  • language (required): Patient preferred language.
  • practitioner_id (required): Practitioner identifier.
  • caregiver_id (required): Caregiver identifier.
  • patient_type (required): Patient type for the upload flow. Use opd or ipd.
  • hospital_inpatient_id (required): Inpatient identifier from the HMS.
  • file (required, binary): File to upload. Supported examples include PDF, DOC, DOCX, TXT, JPG, JPEG, PNG, GIF, AVIF, and HEIC.

Payload Example

hospital_id=9
patient_id=GEN9-202604-00301
name=Rajesh Ravi
age=21
gender=Male
language=English
practitioner_id=888
caregiver_id=carescribe-001-nr001
patient_type=ipd
hospital_inpatient_id=IN-GEN9-202602-00038
file=@patient-document.pdf

Response 200 - Document uploaded successfully

{
  "message": "Document uploaded successfully."
}
POST /software/ipd/forms

Summary: Dynamic IPD Forms API

Description: Processes and returns IPD form data for doctor and nurse workflows. The endpoint now returns additional structured bundle responses for CAUTI, CLABSI, and Vascular bundle forms.

Body Fields

  • hospital_id (required): Hospital identifier.
  • hospital_inpatient_id (required): Inpatient identifier from the HMS.
  • form_name (required): IPD form/action name.
  • practitioner_id or caregiver_id: Include the clinician identifier that matches the workflow.
  • start_date, end_date (optional): Supported for date-range forms such as IPD_VITALS and IPD_INTAKE_OUTTAKE.

Bundle form_name values

cauti_bundle
clabsi_bundle
IPD_CAUTI_BUNDLE
IPD_CLABSI_BUNDLE
IPD_VASCULAR_BUNDLE

CAUTI Bundle Response

{
  "patient_id": "GUN8-202605-00039",
  "inpatient_id": "IN-GUN8-202605-00014",
  "structured_data": {
    "IPD_CAUTI_BUNDLE": [
      {
        "interaction_id": "116604",
        "note_time": "01:27 PM 01/06/2026",
        "caregiver_id": "CG-72",
        "cauti_bundle": {
          "insertion_checklist_form": {},
          "daily_maintenance_checklist_form": {},
          "removal_checklist_form": {},
          "summary_form": {}
        }
      }
    ]
  }
}

CLABSI Bundle Response

{
  "patient_id": "GEN9-202605-00191",
  "inpatient_id": "IN-GEN9-202605-00056",
  "structured_data": {
    "IPD_CLABSI_BUNDLE": [
      {
        "interaction_id": "116320",
        "caregiver_id": "CG-72",
        "central_line_insertion": {},
        "clabsi_bundle_compliance": {},
        "daily_maintenance": []
      }
    ]
  }
}

Vascular Bundle Response

{
  "patient_id": "GUN8-202605-00012",
  "inpatient_id": "IN-GUN8-202605-00002",
  "structured_data": {
    "IPD_VASCULAR_BUNDLE": [
      {
        "interaction_id": "116791",
        "caregiver_id": "CG-122",
        "vascular_bundle": {
          "insertion_checklist_form": {},
          "daily_maintenance_checklist_form": {},
          "vad_removal_checklist_form": {},
          "complication_report_form": {}
        }
      }
    ]
  }
}
GET /software/get-all-ipd-notes-grouped-by-date

Summary: Get All IPD Notes Grouped By Date

Description: Fetches IPD notes grouped by date for a given patient and inpatient record. Categories must be passed exactly as shown: IPD_PERIPHERAL_CHART, IPD_INTAKE_OUTTAKE, IPD_VITALS. If an incorrect category is provided, the API may return an empty response.

Query parameters

- hospital_id (required) — Unique hospital identifier. Example: "9"
- patient_id (optional) — Patient identifier. Example: "GEN9-202509-00435"
- inpatient_id (required) — Inpatient identifier. Example: "IN-GEN9-202509-00034"
- categories (optional) — One of: IPD_PERIPHERAL_CHART, IPD_INTAKE_OUTTAKE, IPD_VITALS. Example: "IPD_VITALS"

Response 200 — Successfully fetched IPD notes grouped by date

{
  "patient_id": "GEN9-202509-00435",
  "inpatient_id": "IN-GEN9-202509-00034",
  "structured_data": {
    "IPD_VITALS": [
      {
        "date": "23/02/2026",
        "noOfDays": "",
        "daysPostOp": "",
        "time": "01:25 PM",
        "pulse": null,
        "temperature": null,
        "respiration": null,
        "blood_pressure": null,
        "blood_sugar": null,
        "spo2": null,
        "interaction_id": "106804"
      }
    ]
  }
}

Errors

  • 400: { "message": "hospital_id and inpatient_id query parameters are required" }
  • 404: { "message": "Invalid hospital_id" }
  • 502: { "message": "Failed to fetch from chat service", "details": {} }
  • 500: { "message": "Internal server error" }
POST /software/api/ipd/discharge-summary

Summary: Generate IPD Discharge Summary

Description: Generates a discharge summary for an IPD patient. Required fields: patient_id, inpatient_id, interaction_id, practitioner_id. Provide hospital_id as a query parameter.

Request (POST to gateway)

{
  "patient_id": "GEN9-202509-00299",
  "inpatient_id": "IN-GEN9-202509-00025",
  "interaction_id": "107225",
  "practitioner_id": "9871"
}

Response 200 — Discharge summary generated successfully

{
  "success": true,
  "message": "Discharge summary generated successfully",
  "data": "data: event: status\r\ndata: data: {\"status\": \"discharge_summary_generation_started\", \"patient_id\": \"GEN9-202509-00299\", \"inpatient_id\": \"IN-GEN9-202509-00025\", \"user_id\": \"206\", \"interaction_id\": \"107225\"}\r\ndata: \r\ndata: \r\n\r\ndata: event: status\r\ndata: data: {\"status\": \"processing\", \"patient_id\": \"GEN9-202509-00299\", \"inpatient_id\": \"IN-GEN9-202509-00025\", \"user_id\": \"206\", \"interaction_id\": \"107225\"}\r\ndata: \r\ndata: \r\n\r\n...long stream...\r\n\r\ndata: event: completed\r\ndata: data: {\"discharge_summary\": {\"diagnosis\": \"Abnormal uterine bleeding; Complicated fibroid\", \"procedure\": \"\", \"reason_for_admission\": \"Patient reports profuse bleeding per vaginal during menstrual cycle for two years. Patient has back pain on and off, and currently presents with mild pain in the abdomen.\", ... }, \"user_id\": \"206\", \"interaction_id\": \"107225\"}\r\ndata: \r\n"
}

Errors

GET /software/api/ipd/case-sheet

Summary: Get IPD Case Sheet

Description: Fetches the case sheet for a given IPD patient using patient and inpatient details. Required query params: hospital_id, patient_id, inpatient_id. Optional: practitioner_id.

Response 200 — Case sheet fetched successfully

{
  "patient_id": "c7f71411-fe49-4c43-852d-61db953fa0c4",
  "inpatient_id": "INP-newmereal-PAT-0011",
  "doctor_initial_assessment": {},
  "nurse_initial_assessment": {},
  "surgery_notes": {},
  "counselling": {},
  "ipd_data": {
    "patient_id": "c7f71411-fe49-4c43-852d-61db953fa0c4",
    "inpatient_id": "INP-newmereal-PAT-0011",
    "structured_data": {}
  },
  "drug_chart": { ... },
  "progress_notes": { ... },
  "nurse_notes": { ... },
  "nurse_care_plan": {},
  "blood_glucose_monitoring_chart": { "structured_data": { "IPD_BLOOD_GLUCOSE_MONITORING": [] } },
  "anaesthesia_forms": { ... }
}

Errors

GET /software/get-drug-chart

Summary: Get Drug Chart

Description: Fetches the drug chart details for a given IPD patient using hospital_id , inpatient_id and patient_id.

Response 200 — Drug chart fetched successfully

{
    "patient_id": "GEN9-202601-00106",
    "inpatient_id": "IN-GEN9-202601-00013",
    "merged_schema": {
      "prescription_data": {
        "allergies": {
          "has_known_allergies": false,
          "allergies": []
        },
        "once_only_drugs": [
          {
            "dosage": "8 mg",
            "dosage_time": [
              "12:25 PM"
            ],
            "duration": "stat",
            "frequency_afternoon": [
              {
                "frequency": "1",
                "status": "Pending"
              }
            ],
            "frequency_evening": [],
            "frequency_morning": [],
            "frequency_night": [],
            "instructions": "stat",
            "med_status": "continue",
            "medication_name": "(EMESET 8MG INJECTION)",
            "medication_type": "Injection",
            "route": "IV",
            "scheduled_date": "2026-01-23",
            "created_at": "2026-01-23T08:06:49.416405"
          },
          {
            "dosage": "40 mg",
            "dosage_time": [
              "12:25 PM"
            ],
            "duration": "stat",
            "frequency_afternoon": [
              {
                "frequency": "1",
                "status": "Pending"
              }
            ],
            "frequency_evening": [],
            "frequency_morning": [],
            "frequency_night": [],
            "instructions": "stat",
            "med_status": "continue",
            "medication_name": "(PAN 40MG INJECTION)",
            "medication_type": "Injection",
            "route": "IV",
            "scheduled_date": "2026-01-23",
            "created_at": "2026-01-23T08:06:49.416405"
          },
          {
            "dosage": "0.5 cc",
            "dosage_time": [
              "12:25 PM"
            ],
            "duration": "stat",
            "frequency_afternoon": [
              {
                "frequency": "1",
                "status": "Pending"
              }
            ],
            "frequency_evening": [],
            "frequency_morning": [],
            "frequency_night": [],
            "instructions": "stat",
            "med_status": "continue",
            "medication_name": "(TT 0.5 CC INJECTION)",
            "medication_type": "Injection",
            "route": "IM",
            "scheduled_date": "2026-01-23",
            "created_at": "2026-01-23T08:06:49.416405"
          },
          {
            "dosage": "0.1 cc",
            "dosage_time": [
              "12:25 PM"
            ],
            "duration": "stat",
            "frequency_afternoon": [
              {
                "frequency": "1",
                "status": "Pending"
              }
            ],
            "frequency_evening": [],
            "frequency_morning": [],
            "frequency_night": [],
            "instructions": "stat",
            "med_status": "continue",
            "medication_name": "(XYLO 0.1 CC INJECTION)",
            "medication_type": "Injection",
            "route": "ID",
            "scheduled_date": "2026-01-23",
            "created_at": "2026-01-23T08:06:49.416405"
          },
          {
            "dosage": "1 gram",
            "dosage_time": [
              "12:25 PM"
            ],
            "duration": "stat",
            "frequency_afternoon": [
              {
                "frequency": "1",
                "status": "Pending"
              }
            ],
            "frequency_evening": [],
            "frequency_morning": [],
            "frequency_night": [],
            "instructions": "stat",
            "med_status": "continue",
            "medication_name": "(ZONE 1 GRAM INJECTION)",
            "medication_type": "Injection",
            "route": "IV",
            "scheduled_date": "2026-01-23",
            "created_at": "2026-01-23T08:06:49.416405"
          }
        ],
        "oral_anticoagulation": [],
        "thromboprophylaxis": [],
        "antiplatelet": [],
        "drug_chart": [
          {
            "dosage": "35 mg",
            "dosage_time": [
              "6:00 AM",
              "6:00 PM"
            ],
            "duration": "for 5 days",
            "frequency_afternoon": [],
            "frequency_evening": [],
            "frequency_morning": [
              {
                "frequency": "1",
                "status": "Pending"
              }
            ],
            "frequency_night": [
              {
                "frequency": "1",
                "status": "Pending"
              }
            ],
            "instructions": "morning one, evening one",
            "med_status": "continue",
            "medication_name": "(AZILERT 35MG TABLET)",
            "medication_type": "Tablet",
            "route": "Oral",
            "scheduled_date": "2026-01-23",
            "created_at": "2026-01-23T12:10:44.980616",
            "nurse_administrations": []
          }
        ],
        "prn_drugs": [],
        "infusions": [],
        "iv_fluids": [],
        "oxygen": [],
        "administrations": [],
        "medication_reconciliation": null
      },
      "total_records": {
        "drug_chart": 1,
        "once_only_drugs": 5,
        "oral_anticoagulation": 0,
        "thromboprophylaxis": 0,
        "antiplatelet": 0,
        "prn_drugs": 0,
        "infusions": 0,
        "oxygen": 0
      }
    }
  }
  

Errors

GET /software/blood-glucose-monitoring-chart

Summary: Get Blood Glucose Monitoring Chart

Description: Fetches blood glucose monitoring chart data for a given IPD patient using hospital_id, inpatient_id, and patient_id.

Response 200 — Blood glucose monitoring chart fetched successfully

{
  "patient_id": "GEN9-202602-00090",
  "inpatient_id": "IN-GEN9-202602-00038",
  "structured_data": {
    "IPD_BLOOD_GLUCOSE_MONITORING": [
      {
        "date": "12/02/2026",
        "entries": [
          {
            "date": "12/02/2026",
            "time": "11:23 AM",
            "blood_sugar": "192 mg/dl",
            "medication": "",
            "nurse_id": "72",
            "doctor_id": "",
            "interaction_id": "106046"
          },
          {
            "date": "12/02/2026",
            "time": "11:25 AM",
            "blood_sugar": "high mg/dL",
            "medication": "PARACETAMOL (500MG) (CALPOL 500 MG TABLETS)",
            "nurse_id": " ",
            "doctor_id": "142",
            "interaction_id": "106049"
          },
          {
            "date": "12/02/2026",
            "time": "02:03 PM",
            "blood_sugar": "192 mg/dl",
            "medication": "",
            "nurse_id": " ",
            "doctor_id": "142",
            "interaction_id": "106098"
          },
          {
            "date": "12/02/2026",
            "time": "02:04 PM",
            "blood_sugar": "192 mg/dl",
            "medication": "Human Actrapid",
            "nurse_id": "72",
            "doctor_id": "",
            "interaction_id": "106099"
          },
          {
            "date": "12/02/2026",
            "time": "02:20 PM",
            "blood_sugar": "182 mg/dl",
            "medication": "",
            "nurse_id": "72",
            "doctor_id": "",
            "interaction_id": "106101"
          },
          {
            "date": "12/02/2026",
            "time": "02:22 PM",
            "blood_sugar": "182 mg/dl",
            "medication": "Human Actrapid",
            "nurse_id": "72",
            "doctor_id": "",
            "interaction_id": "106102"
          }
        ],
        "total": "",
        "remarks": ""
      },
      {
        "creatinine_level": "",
        "consent_for_insulin": false
      }
    ]
  }
}

Errors

POST /software/interactionDetail/update/botResponse

Summary: Update Bot Response and Trigger Ingestion

Description: Updates interaction detail content (edited bot response), uploads it to storage, and triggers ingestion processing. Required query param: hospital_id. Required body fields: interaction_id, interaction_detail_type, ingestionType, content.

Example request (gateway URL)


{
  "content": {
    "basicInformation": {},
    "nutritionalAssessment": {
      "diet": {},
      "fluidsMonitoring": {},
      "mucousMembranes": {},
      "skinTurgor": {},
      "recentWeightChanges": true
    },
    "painAssessment": {
      "numericalPainScore": 2,
      "wongBakerPainScore": 4,
      "interventions": []
    }
  },
  "interaction_id": 112174,
  "interaction_detail_type": "initial_assessment",
  "ingestionType": "initial_assessment",
  "attachment_url": "",
  "role": "nurse"
}

Response 200 — Interaction updated and ingested successfully

{
  "status": true,
  "message": "Interaction details created and ingested successfully",
  "interaction_id": 112174,
  "uploadedUrls": "gs://medscribe-dev/webm_files/edited_initial_assessment/112174_679e4e09-1b17-4c5e-9c34-21bed611a9ef.txt",
  "pdfingestIntraction": {
    "patient_id": "GEN9-202509-00439",
    "interaction_date": "2026-04-15T05:53:38.000Z",
    "interaction_status": "0",
    "inpatient_id": "IN-GEN9-202509-00035",
    "interaction_id": 112174,
    "nurse_id": 72,
    "doctor_id": null,
    "InteractionDetails": [
      {
        "interaction_id": 112174,
        "interaction_detail_type": "edited_initial_assessment",
        "attachment_url": "gs://medscribe-dev/webm_files/edited_initial_assessment/112174_679e4e09-1b17-4c5e-9c34-21bed611a9ef.txt",
        "vitals": null,
        "detail_id": 79970,
        "processedFileContent": "{\n  \"basicInformation\": {},\n  \"nutritionalAssessment\": {\n    \"diet\": {},\n    \"fluidsMonitoring\": {},\n    \"mucousMembranes\": {},\n    \"skinTurgor\": {},\n    \"recentWeightChanges\": true\n  },\n  \"painAssessment\": {\n    \"numericalPainScore\": 2,\n    \"wongBakerPainScore\": 4,\n    \"interventions\": []\n  }\n}",
        "processedFileContentImage": null
      }
    ]
  }
}

Errors

PUT /software/api/ipd/update_nurse_notes

Summary: Update IPD Nurse Notes / Chat Data

This endpoint updates IPD nurse notes or doctor notes for a specific patient interaction. Although the operation is named update_nurse_notes, it accepts structured notes authored by either nurses or doctors. Provide the appropriate data payload and include practitioner_id or caregiver_id in upstream systems when required.

Required query parameters: hospital_id, patient_id, inpatient_id, and interaction_id.

The request body contains a single field data, which can be either a plain string or a JSON string representing the notes.

Example request (gateway URL)


{
  "data": "**Assessment:** Patient is experiencing severe pain, described as somewhat unbearable.\n\n**Medical Administration:** **Paracetamol:** Administered "
}

Response 200 — IPD data updated successfully

{
    "IPD_VITALS": [],
    "IPD_INTAKE_OUTTAKE": [],
    "IPD_PERIPHERAL_CHART": [],
    "IPD_BLOOD_GLUCOSE_MONITORING": [],
    "IPD_CAUTI_BUNDLE": [],
    "IPD_CLABSI_BUNDLE": []
}

Errors

Login Types and Available Forms

IPD module responses are posted for two different login types:

Doctor Login

The following forms are available when a doctor logs in (in order):

  1. drug_chart - Drug Chart
  2. io_chart - I/O Chart (Intake/Output Chart)
  3. peripheral_chart - Peripheral Chart
  4. tpr_chart - TPR Chart (Temperature, Pulse, Respiration)
  5. discharge_summary - Discharge Summary
  6. progress_notes - Progress Notes
  7. doctor_initial_assessment - Doctor Initial Assessment
  8. surgery_notes - Surgery Notes

Nurse Login

The following forms are available when a nurse logs in (in order):

  1. drug_chart - Drug Chart
  2. io_chart - I/O Chart (Intake/Output Chart)
  3. peripheral_chart - Peripheral Chart
  4. tpr_chart - TPR Chart (Temperature, Pulse, Respiration)
  5. nurse_care_plan - Nurse Care Plan
  6. nurse_notes - Nurse Notes
  7. nurse_initial_assessment - Nurse Initial Assessment

Note: Some forms (drug_chart, io_chart, peripheral_chart, tpr_chart) are available to both doctors and nurses, while others are role-specific.

Doctor Login Forms

Drug Chart

formName: "drug_chart"

Complete Response Structure (Real Data Example)

{
  "status": "complete",
  "data": {
    "SessionId": "GEN9-202512-00286",
    "hospitalId": "9",
    "patientId": "GEN9-202512-00286",
    "OpId": "",
    "IpId": "95535",
    "type": "ipd",
    "formName": "drug_chart",
    "process": "drug_chart",
    "response": "{\"drug_chart\":[...],\"once_only_drugs\":[...],\"iv_infusion_therapy\":[]}",
    "medication_templates": [...],
    "additional_response": null,
    "status": "initial payload"
  }
}

Parsed Response Structure (Real Data Example)

{
  "drug_chart": [
    {
      "dosage": "",
      "dosage_time": ["6:00 AM", "12:00 PM", "6:00 PM"],
      "duration": "for 3 days",
      "frequency_afternoon": [],
      "frequency_evening": [
        {
          "frequency": "0",
          "status": "Pending"
        }
      ],
      "frequency_morning": [],
      "frequency_night": [
        {
          "frequency": "1",
          "status": "Pending"
        }
      ],
      "instructions": "Take three times a day for three days, after food. Take for three days without fail.",
      "medication_name": "AMOXYCILLIN  (500MG) +  CLAVULANIC ACID (125MG) (CLAVIFORD 625 MG TABLETS)",
      "medication_type": "",
      "route": "",
      "scheduled_date": "2025-12-08",
      "created_at": "2025-12-08T06:15:39.148516",
      "nurse_administrations": []
    },
    {
      "dosage": "",
      "dosage_time": ["6:00 AM", "12:00 PM", "6:00 PM"],
      "duration": "for 3 days",
      "frequency_afternoon": [
        {
          "frequency": "1",
          "status": "Pending"
        }
      ],
      "frequency_evening": [
        {
          "frequency": "1",
          "status": "Pending"
        }
      ],
      "frequency_morning": [
        {
          "frequency": "1",
          "status": "Pending"
        }
      ],
      "frequency_night": [],
      "instructions": "Take three times a day for three days, after food. Take for three days without fail.",
      "medication_name": "AMOXYCILLIN  (500MG) +  CLAVULANIC ACID (125MG) (CLAVIFORD 625 MG TABLETS)",
      "medication_type": "",
      "route": "",
      "scheduled_date": "2025-12-09",
      "created_at": "2025-12-08T06:15:39.148516",
      "nurse_administrations": []
    },
    {
      "dosage": "",
      "dosage_time": ["6:00 AM", "12:00 PM", "6:00 PM"],
      "duration": "for 3 days",
      "frequency_afternoon": [
        {
          "frequency": "1",
          "status": "Pending"
        }
      ],
      "frequency_evening": [
        {
          "frequency": "1",
          "status": "Pending"
        }
      ],
      "frequency_morning": [
        {
          "frequency": "1",
          "status": "Pending"
        }
      ],
      "frequency_night": [],
      "instructions": "Take three times a day for three days, after food. Take for three days without fail.",
      "medication_name": "AMOXYCILLIN  (500MG) +  CLAVULANIC ACID (125MG) (CLAVIFORD 625 MG TABLETS)",
      "medication_type": "",
      "route": "",
      "scheduled_date": "2025-12-10",
      "created_at": "2025-12-08T06:15:39.148516",
      "nurse_administrations": []
    }
  ],
  "once_only_drugs": [
    {
      "dosage": "",
      "dosage_time": [],
      "duration": "",
      "frequency_afternoon": [],
      "frequency_evening": [],
      "frequency_morning": [],
      "frequency_night": [
        {
          "frequency": "1",
          "status": "Pending"
        }
      ],
      "instructions": "Take once at night, after food.",
      "medication_name": "CETIRIZINE (10MG) (ALERID 10 MG TABLETS)",
      "medication_type": "",
      "route": "",
      "scheduled_date": "2025-12-08",
      "created_at": "2025-12-08T06:15:39.148516"
    }
  ],
  "iv_infusion_therapy": []
}

IO Chart (Intake/Output Chart)

formName: "io_chart"

Complete Response Structure (Real Data Example)

{
  "status": "complete",
  "data": {
    "SessionId": "GEN9-202508-00394",
    "hospitalId": "9",
    "patientId": "GEN9-202508-00394",
    "OpId": "",
    "IpId": "99661",
    "type": "ipd",
    "formName": "io_chart",
    "process": "io_chart",
    "response": "{\"IPD_INTAKE_OUTTAKE\":[...]}",
    "medication_templates": [],
    "additional_response": null,
    "status": "initial payload"
  }
}

Parsed Response Structure (Real Data Example)

{
  "IPD_INTAKE_OUTTAKE": [
    {
      "note_time": "12:59 PM 22/12/2025",
      "intake": [
        {
          "oral_rt": "",
          "oral_rt_quantity_ml": 0,
          "parenteral": "Injection TPN",
          "parenteral_quantity_ml": 100
        },
        {
          "oral_rt": "",
          "oral_rt_quantity_ml": 0,
          "parenteral": "Injection Metrogyl",
          "parenteral_quantity_ml": 100
        },
        {
          "oral_rt": "Water",
          "oral_rt_quantity_ml": 600,
          "parenteral": "",
          "parenteral_quantity_ml": 0
        },
        {
          "oral_rt": "Tea",
          "oral_rt_quantity_ml": 250,
          "parenteral": "",
          "parenteral_quantity_ml": 0
        },
        {
          "oral_rt": "Coconut water",
          "oral_rt_quantity_ml": 100,
          "parenteral": "",
          "parenteral_quantity_ml": 0
        },
        {
          "oral_rt": "Water",
          "oral_rt_quantity_ml": 300,
          "parenteral": "",
          "parenteral_quantity_ml": 0
        }
      ],
      "output": [
        {
          "drainage_ml": 0,
          "ryles_aspiration_ml": 0,
          "urine_ml": 1050,
          "vomitus_bowels_ml": 250
        }
      ],
      "intake_description": "Injection TPN 100ml; Injection Metrogyl 100ml; Water 600ml; Tea 250ml; Coconut water 100ml; Water 300ml",
      "output_description": "Urine 1050ml; Vomitus/Bowels 250ml",
      "intake_total_ml": 1450,
      "output_total_ml": 1300,
      "balance_ml": 150,
      "interaction_id": "98254"
    },
    {
      "note_time": "12:56 PM 22/12/2025",
      "intake": [
        {
          "oral_rt": "",
          "oral_rt_quantity_ml": 0,
          "parenteral": "Injection TPN",
          "parenteral_quantity_ml": 100
        },
        {
          "oral_rt": "",
          "oral_rt_quantity_ml": 0,
          "parenteral": "Injection Metrogyl",
          "parenteral_quantity_ml": 100
        },
        {
          "oral_rt": "Water",
          "oral_rt_quantity_ml": 600,
          "parenteral": "",
          "parenteral_quantity_ml": 0
        },
        {
          "oral_rt": "Tea",
          "oral_rt_quantity_ml": 250,
          "parenteral": "",
          "parenteral_quantity_ml": 0
        },
        {
          "oral_rt": "Coconut water",
          "oral_rt_quantity_ml": 100,
          "parenteral": "",
          "parenteral_quantity_ml": 0
        },
        {
          "oral_rt": "Water",
          "oral_rt_quantity_ml": 300,
          "parenteral": "",
          "parenteral_quantity_ml": 0
        }
      ],
      "output": [
        {
          "drainage_ml": 0,
          "ryles_aspiration_ml": 0,
          "urine_ml": 1050,
          "vomitus_bowels_ml": 250
        }
      ],
      "intake_description": "Injection TPN 100ml; Injection Metrogyl 100ml; Water 600ml; Tea 250ml; Coconut water 100ml; Water 300ml",
      "output_description": "Urine 1050ml; Vomitus/Bowels 250ml",
      "intake_total_ml": 1450,
      "output_total_ml": 1300,
      "balance_ml": 150,
      "interaction_id": "98252"
    }
  ]
}

Peripheral Chart

formName: "peripheral_chart"

Complete Response Structure (Real Data Example)

{
  "status": "complete",
  "data": {
    "SessionId": "GEN9-202512-00286",
    "hospitalId": "9",
    "patientId": "GEN9-202512-00286",
    "OpId": "",
    "IpId": "95535",
    "type": "ipd",
    "formName": "peripheral_chart",
    "process": "peripheral_chart",
    "response": "{\"IPD_PERIPHERAL_CHART\":[...]}",
    "medication_templates": [],
    "additional_response": null,
    "status": "initial payload"
  }
}

Parsed Response Structure (Real Data Example)

{
  "IPD_PERIPHERAL_CHART": [
    {
      "notes": {
        "insertion_details": {
          "aseptic_technique_used": false,
          "date_of_insertion": "2025-10-29",
          "site_of_insertion": "",
          "time_of_insertion": "12:00:00.000Z"
        },
        "maintenance_checklist": [
          {
            "date": "08/12/2025",
            "entries": [
              {
                "assessment_of_need_for_line": true,
                "erythema_at_insertion_site": false,
                "extravasation_into_soft_tissue": false,
                "leakage_into_soft_tissue": false,
                "nurse_id": "72",
                "pain_at_insertion_site": false,
                "thrombophlebitis_evidence": false,
                "interaction_id": "95463",
                "note_time": "11:35 AM 11:35 AM"
              }
            ],
            "line_removal_date": null,
            "line_removal_time": null
          }
        ],
        "notes_text": ""
      }
    }
  ]
}

TPR Chart (Temperature, Pulse, Respiration)

formName: "tpr_chart"

Complete Response Structure (Real Data Example)

{
  "status": "complete",
  "data": {
    "SessionId": "403a9674-1720-499e-ad46-0c0134f845d5",
    "hospitalId": "9",
    "patientId": "ragul001",
    "OpId": "",
    "IpId": "105739",
    "type": "ipd",
    "formName": "tpr_chart",
    "process": "tpr_chart",
    "response": "{\"IPD_VITALS\":[...]}",
    "medication_templates": [],
    "additional_response": null,
    "status": "initial payload"
  }
}

Parsed Response Structure (Real Data Example)

{
  "IPD_VITALS": [
    {
      "date": "2026-02-02",
      "noOfDays": "Day 68",
      "daysPostOp": "",
      "time": "11:30",
      "pulse": "",
      "temperature": "38 degrees Celsius",
      "respiration": "",
      "urine": "",
      "bath": "",
      "weight": "",
      "diet": "",
      "interaction_id": "104622",
      "blood_pressure": null,
      "blood_sugar": "99 mg/dl",
      "spo2": "91%"
    },
    {
      "date": "2026-02-02",
      "noOfDays": "Day 68",
      "daysPostOp": "",
      "time": "11:40",
      "pulse": "",
      "temperature": "39°C, 45°F",
      "respiration": "",
      "urine": "",
      "bath": "",
      "weight": "",
      "diet": "",
      "interaction_id": "104628",
      "blood_pressure": null,
      "blood_sugar": null,
      "spo2": "93%"
    },
    {
      "date": "2026-02-02",
      "noOfDays": "Day 68",
      "daysPostOp": "",
      "time": "11:41",
      "pulse": "120 bpm",
      "temperature": "40°C",
      "respiration": "180 breaths/min",
      "urine": "",
      "bath": "",
      "weight": "",
      "diet": "",
      "interaction_id": "104629",
      "blood_pressure": "180 mmHg",
      "blood_sugar": null,
      "spo2": "91%"
    },
    {
      "date": "2026-02-02",
      "noOfDays": "Day 68",
      "daysPostOp": "",
      "time": "11:42",
      "pulse": "121 bpm",
      "temperature": "105°F / 41°C",
      "respiration": "188 breaths per minute",
      "urine": "",
      "bath": "",
      "weight": "",
      "diet": "",
      "interaction_id": "104630",
      "blood_pressure": null,
      "blood_sugar": null,
      "spo2": "92%"
    },
    {
      "date": "2026-02-02",
      "noOfDays": "Day 68",
      "daysPostOp": "",
      "time": "11:43",
      "pulse": "",
      "temperature": "101°F, 38°C",
      "respiration": "",
      "urine": "",
      "bath": "",
      "weight": "",
      "diet": "",
      "interaction_id": "104631",
      "blood_pressure": null,
      "blood_sugar": null,
      "spo2": "90%"
    },
    {
      "date": "2026-02-02",
      "noOfDays": "Day 68",
      "daysPostOp": "",
      "time": "11:44",
      "pulse": "88 bpm",
      "temperature": "98 °F, 36 °C",
      "respiration": "180 breaths/min",
      "urine": "",
      "bath": "",
      "weight": "",
      "diet": "",
      "interaction_id": "104632",
      "blood_pressure": null,
      "blood_sugar": null,
      "spo2": "91 %"
    },
    {
      "date": "2026-02-02",
      "noOfDays": "Day 68",
      "daysPostOp": "",
      "time": "11:45",
      "pulse": "92 bpm",
      "temperature": "96°F",
      "respiration": "188 breaths/min",
      "urine": "",
      "bath": "",
      "weight": "",
      "diet": "",
      "interaction_id": "104633",
      "blood_pressure": null,
      "blood_sugar": null,
      "spo2": "90%"
    },
    {
      "date": "2026-02-02",
      "noOfDays": "Day 68",
      "daysPostOp": "",
      "time": "19:37",
      "pulse": "88 bpm",
      "temperature": "99.2°F",
      "respiration": "18 breaths/min",
      "urine": "",
      "bath": "",
      "weight": "",
      "diet": "",
      "interaction_id": "104784",
      "blood_pressure": "118/76 mmHg",
      "blood_sugar": null,
      "spo2": "99%"
    }
  ]
}

Discharge Summary

formName: "discharge_summary"

Complete Response Structure (Real Data Example)

{
  "status": "complete",
  "data": {
    "SessionId": "GEN9-202509-00170",
    "hospitalId": "9",
    "patientId": "GEN9-202509-00170",
    "OpId": "",
    "IpId": "105673",
    "PractitionerId": null,
    "type": "ipd",
    "formName": "discharge_summary",
    "process": "discharge_summary",
    "response": "{\"discharge_summary\":{...},\"treatment_given\":[...],\"advice_on_discharge\":{...}}",
    "medication_templates": [...],
    "additional_response": null,
    "status": "initial payload"
  }
}

Parsed Response Structure (Real Data Example)

{
  "discharge_summary": {
    "diagnosis": "Acute appendicitis; Persistent right-sided chest wall pain",
    "procedure": "",
    "reason_for_admission": "Patient presents with severe right-sided lower abdominal pain for two days...",
    "patient_past_history": "The patient has no history of hypertension, diabetes mellitus, or asthma...",
    "personal_history": "Patient follows a vegetarian diet and has a good sleep pattern...",
    "general_examination": "Patient is conscious and oriented with mild distress.",
    "vital_signs": {
      "pulse_rate": "",
      "blood_pressure": "",
      "spo2": "",
      "temperature": ""
    },
    "cardiovascular_system": "",
    "respiratory_system": "",
    "abdomen": "Tenderness is present at McBurney's point with rebound tenderness. No palpable mass.",
    "central_nervous_system": "",
    "local_examination": "",
    "investigations": "Urine Test (Ordered on 2026-01-13, Status: Ordered); Blood Test...",
    "course_in_hospital": "The patient was admitted with severe right-sided lower abdominal pain..."
  },
  "procedure_details": "",
  "findings": "",
  "date_of_procedure": "",
  "procedure_notes": "",
  "treatment_given": [
    {
      "medication_name": "ESOMEPRAZOLE (20MG) (NEXPRO FAST 20MG TABLET)",
      "medication_type": null,
      "dosage": "",
      "frequency": {
        "morning": 1,
        "afternoon": 0,
        "evening": 1,
        "night": 1
      },
      "duration": null
    },
    {
      "medication_name": "PARACETAMOL 500MG (CALPOL 500MG TABLET)",
      "medication_type": null,
      "dosage": "",
      "frequency": {
        "morning": 1,
        "afternoon": 0,
        "evening": 0,
        "night": 1
      },
      "duration": null
    }
    // ... more medications
  ],
  "advice_on_discharge": {
    "medications": [
      {
        "medication_name": "Acetaminophen",
        "medication_type": "Analgesic",
        "dosage": "650mg",
        "frequency": {
          "morning": 1,
          "afternoon": 0,
          "evening": 0,
          "night": 1
        },
        "duration": "3 days"
      },
      {
        "medication_name": "Amoxicillin",
        "medication_type": "Antibiotic",
        "dosage": "500mg",
        "frequency": {
          "morning": 1,
          "afternoon": 0,
          "evening": 0,
          "night": 0
        },
        "duration": "7 days"
      }
      // ... more discharge medications
    ],
    "general_advice": "Patient is advised to continue walking. Patient is advised to fast before the surgery...",
    "diet": "Normal diet, no dietary restrictions required. Patient follows a vegetarian diet.",
    "follow_up": "Patient should follow up in five days to reassess the pain and decide on further management..."
  },
  "emergency_instructions": "Please call emergency: ___________ if you have any of the following symptoms:\n1. Worsening abdominal pain\n2. Fever or chills...",
  "patient_id": "GEN9-202509-00170",
  "inpatient_id": "IN-GEN9-202509-00009",
  "user_id": "9",
  "interaction_id": "105673"
}

Progress Notes

formName: "progress_notes"

Complete Response Structure (Real Data Example)

{
  "status": "complete",
  "data": {
    "SessionId": "GEN9-202509-00170",
    "hospitalId": "9",
    "patientId": "GEN9-202509-00170",
    "OpId": "",
    "IpId": "105219",
    "PractitionerId": null,
    "type": "ipd",
    "formName": "progress_notes",
    "process": "progress_notes",
    "response": "{\"patientInfo\":{...},\"progressNotes\":[...]}",
    "medication_templates": [],
    "additional_response": null,
    "status": "initial payload"
  }
}

Parsed Response Structure (Real Data Example)

{
  "patientInfo": {
    "knownDrugAllergies": "None",
    "diagnosis": "Acute appendicitis"
  },
  "progressNotes": [
    {
      "id": "314",
      "date": "2026-01-30 14:30:00",
      "notes": "**Assessment and Plan:**\nPatient is stable. Continue current medications.",
      "doctorSignature": "Dr. 314"
    },
    {
      "id": "314",
      "date": "2026-01-31 10:15:00",
      "notes": "",
      "doctorSignature": "Dr. 314"
    }
  ]
}

Doctor Initial Assessment

formName: "doctor_initial_assessment"

Parsed Response Structure (Real Data Example)

{
  "status": "complete",
  "data": {
    "SessionId": "GEN9-202509-00170",
    "hospitalId": "9",
    "patientId": "GEN9-202509-00170",
    "OpId": "",
    "IpId": "101142",
    "PractitionerId": null,
    "type": "ipd",
    "formName": "doctor_initial_assessment",
    "process": "doctor_initial_assessment",
    "response": "Chief Complaints:* Patient presents with persistent right-sided chest wall pain..\n\nHistory of Present Illness:* The patient reports continuous, localized pain that sometimes intensifies. The pain is described as aching and sometimes feels like a wound. He has been taking Tablet Ultra H as needed (approximately once every 4-5 days to a week), which provides about 80% relief. He denies any heavy lifting or strenuous activities at home. The pain is more prominent in the evenings.\n\nPast Medical History and Duration:* The patient has a known history of fatty liver. He previously consulted another physician who performed some blood tests and a nerve-related test. An injection was suggested but not administered. He was prescribed a gel which was not effective.\n\nPersonal History:* Patient engages in walking for exercise. He does not have a night shift.\n\nPrevious Medication:* Patient has used a topical gel for the pain, which was ineffective.\n\nPresent Medication:* Patient is currently taking Tablet Ultra H on an as-needed basis for pain. He is also taking Maxgain NT (Pregabalin NT) daily as prescribed by another doctor, and E-Pirose F for cholesterol.\n\nPrevious Investigations:* include three blood tests and a nerve test. Liver Function Tests (LFT) and enzyme levels were normal, with the exception of elevated triglycerides. An ultrasound scan has been done previously.\n\nPlan of Care:* The patient is advised to continue his current medications. He will be started on a short course of Gabawin NT. A Fibroscan of the liver is planned to further evaluate his fatty liver. A nerve block injection is being considered if the pain does not resolve with medication.\n\nRecommendations:* Patient is advised to continue walking. He should follow up in five days to reassess the pain and decide on further management, such as a nerve block.",
    "medication_templates": [
      {
        "dosage": "",
        "dosage_time": null,
        "duration": "for 5 days",
        "frequency_afternoon": null,
        "frequency_evening": null,
        "frequency_morning": null,
        "frequency_night": null,
        "instructions": "Continue for 5 days",
        "med_status": "continue",
        "medication_name": "(ULTRA PLUS H TABLET)",
        "medication_type": "Tablet",
        "route": "Oral",
        "scheduled_date": null,
        "is_stat": false
      },
      {
        "dosage": "",
        "dosage_time": null,
        "duration": "for 3 days",
        "frequency_afternoon": null,
        "frequency_evening": null,
        "frequency_morning": null,
        "frequency_night": ["1"],
        "instructions": "Take one tablet at night for 3 days.",
        "med_status": "continue",
        "medication_name": "(GABAWIN NT TABLET)",
        "medication_type": "Tablet",
        "route": "Oral",
        "scheduled_date": null,
        "is_stat": false
      },
      {
        "dosage": "",
        "dosage_time": null,
        "duration": "",
        "frequency_afternoon": null,
        "frequency_evening": null,
        "frequency_morning": null,
        "frequency_night": null,
        "instructions": "Continue as prescribed.",
        "med_status": "continue",
        "medication_name": "(MAXGAIN NT TABLET)",
        "medication_type": "Tablet",
        "route": "Oral",
        "scheduled_date": null,
        "is_stat": false
      },
      {
        "dosage": "2ml",
        "dosage_time": null,
        "duration": "",
        "frequency_afternoon": null,
        "frequency_evening": null,
        "frequency_morning": null,
        "frequency_night": null,
        "instructions": "Continue as prescrib for cholesterol.",
        "med_status": "continue",
        "medication_name": "PIROXICAM 20 MG /ML (DOLOFORCE 2ML INJECTION)",
        "medication_type": "Tablet",
        "route": "Oral",
        "scheduled_date": null,
        "is_stat": false
      }
    ],
    "additional_response": null,
    "status": "initial payload"
  }
}

Surgery Notes

formName: "surgery_notes"

Complete Response Structure (Real Data Example)

{
  "status": "complete",
  "data": {
    "SessionId": "GEN9-202509-00170",
    "hospitalId": "9",
    "patientId": "GEN9-202509-00170",
    "OpId": "",
    "IpId": "105219",
    "PractitionerId": null,
    "type": "ipd",
    "formName": "surgery_notes",
    "process": "surgery_notes",
    "response": "{\"pre_operative_diagnosis\":\"...\",\"post_operative_diagnosis\":\"...\",...}",
    "medication_templates": [],
    "additional_response": null,
    "status": "initial payload"
  }
}

Parsed Response Structure (Real Data Example)

{
  "pre_operative_diagnosis": "Acute appendicitis",
  "post_operative_diagnosis": "Acute appendicitis, confirmed",
  "surgeon": "Dr. Smith",
  "anesthetist": "Dr. Jones",
  "assistant1": "Dr. Brown",
  "assistant2": "",
  "scrub_nurse": "Nurse Johnson",
  "circ_nurse": "",
  "findings": "Inflamed appendix, no perforation",
  "name_of_operation": "Appendectomy",
  "procedure": "Laparoscopic appendectomy performed successfully",
  "post_medications": "Paracetamol 500mg TDS",
  "diet": "Clear liquids",
  "postoperative_condition": "Stable",
  "surgeon_remarks": "Patient tolerated procedure well",
  "biopsy_specimen": "Appendix sent for histopathology"
}

Nurse Login Forms

Shared Forms: "drug_chart", "io_chart", "peripheral_chart", "tpr_chart"

These forms are used by nurses to record medication administration, intake/output measurements, peripheral IV line details, and vital signs.

Note: These forms are documented above in the Doctor Login Forms section. Refer to that section for complete documentation.

Nurse Care Plan

formName: "nurse_care_plan"

Complete Response Structure (Real Data Example)

{
  "status": "complete",
  "data": {
    "SessionId": "GEN9-202602-00044",
    "hospitalId": "9",
    "patientId": "GEN9-202602-00044",
    "OpId": "",
    "IpId": "105474",
    "type": "ipd",
    "formName": "nurse_care_plan",
    "process": "nurse_care_plan",
    "response": "## 05 February 2026\n04:52 PM: Patient complaining severe abdominal pain. Pain score 7/10. Vitals stable. Patient guarding abdomen.\n05:26 PM: Patient checked. Patient reports no abdominal pain. Pain score is 3. Patient appears fine and is stable.\n",
    "medication_templates": [],
    "additional_response": null,
    "status": "initial payload"
  }
}

Parsed Response Structure (Real Data Example)

## 05 February 2026
04:52 PM: Patient complaining severe abdominal pain. Pain score 7/10. Vitals stable. Patient guarding abdomen.
05:26 PM: Patient checked. Patient reports no abdominal pain. Pain score is 3. Patient appears fine and is stable.

Nurse Notes

formName: "nurse_notes"

Complete Response Structure (Real Data Example)

{
  "status": "complete",
  "data": {
    "SessionId": "403a9674-1720-499e-ad46-0c0134f845d5",
    "hospitalId": "9",
    "patientId": "ragul001",
    "OpId": "",
    "IpId": "105583",
    "type": "ipd",
    "formName": "nurse_notes",
    "process": "nurse_notes",
    "response": "{\"special_notes\":{...},\"care_given\":{...}}",
    "medication_templates": [],
    "additional_response": null,
    "status": "initial payload"
  }
}

Parsed Response Structure (Real Data Example)

{
  "special_notes": {
    "29 January 2026": {
      "11:27 AM": {
        "description": "Intake: IV Fluids: Injection PPN 100 ml IV, Injection Metrogyl 100 ml IV. Oral Fluids: Water 600 ml oral, Tea 250 ml, Coconut water 100 ml, Water evening 300 ml. Output: Urine clear 1050 ml, Vomit noted 250 ml. Medications administered: AZITHROMYCIN ORAL SUSPENSION IP 100 MG (ORS ORANGE LIQ 200 ML IIQUID) 100 ml IV, METRONIDAZOLE (200MG/5ML) (METROGYL 60 ML SUSPENSION) 100 ml IV. General Observations: Urine is clear. Vomit noted."
      },
      "11:40 AM": {
        "description": "Intake: IV fluids: Injection PPN 100 ml IV, Injection Metrogyl 100 ml IV. Oral fluids: Water 600 ml oral, Tea 250 ml, Coconut water 100 ml, Water evening 300 ml. Output: Urine clear 1050 ml, Vomit noted 250 ml. Medications administered: AZITHROMYCIN ORAL SUSPENSION IP 100 MG (ORS ORANGE LIQ 200 ML IIQUID) 100 ml IV, METRONIDAZOLE (200MG/5ML) (METROGYL 60 ML SUSPENSION) 100 ml IV. General Observations: Urine is clear."
      },
      "11:48 AM": {
        "description": "Intake: IV fluids: Injection PPN 100 ml IV, Injection Metrogyl 100 ml IV. Oral fluids: Water 600 ml oral, Tea 250 ml, Coconut water 100 ml, Water evening 300 ml. Output: Urine clear 1050 ml, Vomit noted 250 ml. General Observations: Urine is clear."
      }
    },
    "02 February 2026": {
      "11:30 AM": {
        "description": "SPO2: 91%, Blood sugar level: 99 mg/dl, Temperature: 38 degrees Celsius."
      },
      "11:40 AM": {
        "description": "Temperature: 39°C, 45°F. SpO2: 93%."
      },
      "11:41 AM": {
        "description": "SPO2: 91%, Respiration: 180 breaths/min, Temperature: 40°C, Pulse: 120 bpm, Blood Pressure: 180 mmHg."
      },
      "11:42 AM": {
        "description": "Pulse: 121 bpm. Respiration: 188 breaths per minute. Temperature: 105°F / 41°C. SpO2: 92%. General Observations: Patient's vitals were recorded."
      },
      "11:43 AM": {
        "description": "Temperature: 101°F, 38°C. SpO2: 90%."
      },
      "11:44 AM": {
        "description": "Respiration 180 breaths/min, Temperature 98°F / 36°C, Pulse 88 bpm, SpO2 91%."
      },
      "11:45 AM": {
        "description": "Temperature: 96°F / 35°C, Respiration: 188 breaths/min, Pulse: 92 bpm, SpO2: 90%."
      }
    },
    "03 February 2026": {
      "05:08 PM": {
        "description": "Patient admitted via OPD for surgical evaluation. Allergies: Others, no nothing. Functional Assessment: Washing: true, Dressing: true, Feeding: false, Toileting: true, Transferring: true, Mobility: true. Nutritional Assessment: Diet: no special diet. Recent Weight Changes: false, Supplements: false, Conditions Affecting Eating: false, Monitoring Required At Meal Times: false. Fluids Monitoring: no monitoring. Mucous Membranes: assessed, Moist. Skin Turgor: assessed. Vitals: Blood Pressure: 118/76 mmHg, Pulse: 88 bpm, Respiration: 18 breaths/min, Temperature: 99.2°F, SpO2: 99%. Overall severity: normal."
      }
    },
    "05 February 2026": {
      "02:07 PM": {
        "description": "Nurse care plan. Patient was admitted by OPD today evening 7:30 PM and we converted the patient to IPD around 10 AM. This is nurse care plan. Patient was admitted by OPD today evening 7:30 PM and we converted the patient to IPD around 11 AM."
      },
      "02:09 PM": {
        "description": "Nursing care plan. Patient has severe bleeding on head and we gave first aid to the patient and admitted in OPD room number 78. General Observations: Patient has severe bleeding on head, first aid was given, and the patient was admitted to OPD room number 78."
      },
      "02:13 PM": {
        "description": "Nursing care plan. Patient has severe bleeding on head and we gave first aid to the patient and admitted in OPD room number 78. General Observations: Nursing care plan. Patient has severe bleeding on head and we gave first aid to the patient and admitted in OPD room number 78."
      },
      "03:02 PM": {
        "description": "Instructed to move to IPD at 10 o'clock. General Observations: Instructed to move patient to IPD at 10 o'clock."
      }
    },
    "09 February 2026": {
      "11:52 AM": {
        "description": "Patient abdomen pain. Pain score six. General Observations: Patient abdomen pain. Pain score six."
      }
    }
  },
  "care_given": {
    "hygienic_needs": null,
    "elimination_needs": "Urine clear 1050 ml. Vomit noted 250 ml.",
    "catheter_care": null,
    "care_of_invasive_lines": "Injection PPN 100 ml IV, Injection Metrogyl 100 ml IV.",
    "position_change_and_back_care": null,
    "wound_dressing": null,
    "tracheostomy_care": null
  }
}

Nurse Initial Assessment

formName: "nurse_initial_assessment"

Complete Response Structure (Real Data Example)

{
  "status": "complete",
  "data": {
    "SessionId": "403a9674-1720-499e-ad46-0c0134f845d5",
    "hospitalId": "9",
    "patientId": "ragul001",
    "OpId": "",
    "IpId": "105739",
    "type": "ipd",
    "formName": "nurse_initial_assessment",
    "process": "nurse_initial_assessment",
    "response": "{\"basicInformation\":{...},\"functionalAssessment\":{...},\"nutritionalAssessment\":{...},\"painAssessment\":{...}}",
    "medication_templates": [],
    "additional_response": null,
    "status": "initial payload"
  }
}

Parsed Response Structure (Real Data Example)

{
  "basicInformation": {
    "how_admitted": "walking",
    "attendant_present": "yes",
    "mother_tongue": "Tamil",
    "allergies": "Others",
    "height": "162 cm",
    "weight": "56 kg",
    "vitals": [
      {
        "blood_pressure": "118/76 mmHg",
        "pulse": "88 bpm",
        "respiration": "18 breaths/min",
        "temperature": "99.2°F",
        "spo2": "99%",
        "blood_sugar": "",
        "abnormality_detected": false,
        "abnormal_vitals_message": "",
        "overall_severity": "normal"
      }
    ],
    "special_notes": "Patient admitted via OPD for surgical evaluation.",
    "consultant": "",
    "oral": "",
    "allergiesOther": "no nothing"
  },
  "functionalAssessment": {
    "washing": true,
    "dressing": true,
    "feeding": false,
    "toileting": true,
    "transferring": true,
    "mobility": true
  },
  "nutritionalAssessment": {
    "diet": {
      "isSpecialDiet": false,
      "type": ""
    },
    "recentWeightChanges": false,
    "supplements": false,
    "conditionsAffectingEating": false,
    "monitoringRequiredAtMealTimes": false,
    "fluidsMonitoring": {
      "isMonitoring": false,
      "type": ""
    },
    "mucousMembranes": {
      "isAssessed": true,
      "state": "Moist"
    },
    "skinTurgor": {
      "isAssessed": true,
      "state": ""
    }
  },
  "painAssessment": {
    "numericalPainScore": 7,
    "wongBakerPainScore": 0,
    "interventions": [
      {
        "assessmentDateTime": "",
        "painScore": 7,
        "location": "Lower right abdomen",
        "interventionDateTime": "11:45",
        "intervention": "IV Paracetamol 1 gm",
        "postInterventionDateTime": "",
        "postInterventionScore": 5
      }
    ]
  },
  "vitals_abnormality": {
    "abnormality_detected": false,
    "abnormal_vitals_message": "",
    "overall_severity": "normal"
  },
  "monitoring_tasks": [],
  "iv_infusions": []
}