HMS Integration Guide

Comprehensive guide for integrating CareScribe with Hospital Management Systems (HMS) for both OPD and IPD 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/speciality/list
  • The gateway URL is required for all API calls.

OPD Integration

CareScribe Session Link Integration allows you to integrate CareScribe with your Hospital Management System for Outpatient Department (OPD) workflows. This integration enables seamless data flow between your HMS and CareScribe's AI-powered documentation system.

The integration follows a step-by-step process to set up hospitals, doctors, patients, and handle OPD session data.

Step 1: Create a Hospital

Call the CareScribe team to book an appointment: https://carescribe.health/

Note: Hospital setup is done through the CareScribe team. Contact them to get your hospital registered in the system.

Required Hospital Information

When contacting the CareScribe team, please provide the following information for hospital setup:

Hospital Details
Hospital Name: The official name of your hospital or organization
Hospital ID: Must be in format "orgname-somenumber" (e.g., carescribe-001, carescribe-002). If you have multiple hospitals with the same organization, use sequential numbers.
Time Zone: Hospital time zone (e.g., Asia/Kolkata, America/Los_Angeles, Europe/London)
Client Endpoint URL: The URL endpoint in your HMS system where CareScribe will send POST requests with OPD data. This should be a publicly accessible HTTPS endpoint (e.g., https://api.yourhospital.com/carescribe/opd)
Location: Address details including:
  • Street Address
  • City
  • State/Province
  • Country
  • Postal/PIN Code

Additional Information (Optional)

You may also provide the following optional details:

  • Phone Number: Hospital contact number
  • Email: Hospital contact email
  • Website: Hospital website URL
  • Fax Number: Hospital fax number
  • Tax ID Number: Hospital tax identification number

Step 2: Get the Specialty List

GET /software/speciality/list

Summary: Get all specialities

Description: Retrieves a list of all specialities available in the system.

Sample Response (200 OK):

[
    {
        "speciality_id": 5,
        "specialty_name": "Cardiology",
        "description": "Deals with heart and cardiovascular system.",
        "short_prompt_id": "6",
        "long_prompt_id": "6"
    },
    {
        "speciality_id": 6,
        "specialty_name": "Dermatology",
        "description": "Handles skin health and disorders.",
        "short_prompt_id": "7",
        "long_prompt_id": "7"
    },
    {
        "speciality_id": 7,
        "specialty_name": "Gastroenterology",
        "description": "Focuses on digestive system health.",
        "short_prompt_id": "8",
        "long_prompt_id": "8"
    },
    {
        "speciality_id": 8,
        "specialty_name": "Gynaecology",
        "description": "Cares for women's reproductive health.",
        "short_prompt_id": "9",
        "long_prompt_id": "9"
    }
]

Responses:

  • 200: Successful operation - Returns array of specialty objects
  • 500: Internal server error

Step 3: Create a Doctor

POST /software/doctor/create

Summary: Create a doctor

Description: Creates a new doctor record in the system.

Body

{
    "first_name": "Alex",
    "last_name": "Patel",
    "speciality_id": 1,
    "salutation": "Dr",
    "hospital_id": "carescribe-001",
    "license_no": "TN12345",
    "phone_number": "+918883761709",
    "email": "alex.patel@example.com",
    "practitioner_id": "carescribe-001-dr001"
}

Note:

  • hospital_id: Required β€” Must be in format "orgname-somenumber" (e.g., carescribe-001, carescribe-002). If you have multiple hospitals with the same organization, use sequential numbers like carescribe-001, carescribe-002, etc.
  • practitioner_id: Required and must be unique β€” Must be in format "hospital_id-drsomenumber" (e.g., carescribe-001-dr001, carescribe-001-dr002). Format: your hospital_id followed by "-dr" and a number.
  • first_name: Required
  • last_name: Required
  • speciality_id: Required β€” fetch from /software/speciality/list endpoint
  • license_no: Required β€” if not available, pass as an empty string (" ")

Responses:

  • 201: Doctor created successfully
  • 400: Invalid input
  • 409: Doctor with practitioner_id or email already exists
  • 500: Internal server error

Step 4: Create a Patient and Return the Path URL

POST /patient/softwareintegration

Summary: Integrate patient software data

Description: Accepts patient, doctor, hospital, and vitals data for integration. This endpoint creates or updates patient information and prepares the system for OPD session data.

Body

{
    "hospital_id": "9",
    "doctor": {
    "practitioner_id": "1000"
    },
    "patient": {
    "patient_id": "PAT-123",
        "name": "John Doe",
    "age": 30,
        "gender": "Male",
        "language": "English",
        "past_history": [
      {
        "condition": "Hypertension",
        "diagnosed_on": "2023-01-15",
        "status": "Active"
      }
    ],
    "family_history": [
      {
        "relation": "Father",
        "condition": "Diabetes"
      }
        ]
    },
    "vitals": {
    "height_cm": 170,
    "weight_kg": 70,
    "bmi": 24.2,
    "chest_circumference": null,
    "head_circumference": null,
    "blood_pressure": "120/80",
    "pulse_rate": 72,
    "respiratory_rate": 16,
    "temperature_celsius": 36.6,
    "oxygen_saturation": 98,
    "glucose_mg_dl": 90,
    "spo2": 98,
    "ecg_status": "Normal",
        "abnormal_conditions": [
      {
        "condition": "Arrhythmia",
        "severity": "Mild",
        "note": "Observed during routine checkup"
      }
        ]
    }
}

Note:

  • Hospital ID: Required β€” The hospital identifier
  • Doctor Practitioner ID: Required β€” The practitioner ID of the doctor
  • Patient ID: Required β€” Unique patient identifier
  • Past History: Optional β€” Array of past medical conditions with optional diagnosis date and status
  • Family History: Optional β€” Array of family medical history with relation and condition
  • Vitals: Optional β€” Comprehensive vital signs, including ECG status and abnormal conditions, can be sent as an empty object, and if no vital signs are available, the vitals field may be provided as an empty object ({}).

Response (200 OK):

{
    "message": "New patient created successfully. Vitals uploaded.",
    "path": "https://app.carescribe.health/session_id?id=c49647ab-b910-4a18-a732-4c87e8167c11&token=U2FsdGVkX19r1xFPiH3OIdX9qS5ZKg8RbUh3l%2F%2FiijsnUPlOuBhdOwEsdd2%2FipMwrUpLQXJL%2BYvdlN4vKycfnA%3D%3D"
}

Note: The path in the response contains the session URL that can be used to access the CareScribe session for this patient. This URL includes a unique session ID and an encrypted token for secure access.

Responses:

  • 200: Patient created or already exists and vitals uploaded β€” Returns success message with session path URL
  • 400: The following required field(s) are missing: ${missing.join(", ")}. Please check and try again.
  • 404: Organization or doctor not found
  • 500: Internal server error

Step 5: POST Client Endpoint URL - Send OPD Data

Summary: Save Patient and Medical Data

Description: This endpoint saves patient, diagnosis, medication, and vitals data. The patient's outpatient data is sent to the client's system using the URL specified in the organization.api_url field. The data transmission includes both the initial and final payloads as part of the client response.

Initial Payload

The initial payload is sent when the session starts processing:

{
          "status": "complete",
          "data": {
            "SessionId": "GEN9-202603-00091",
            "hospitalId": "9",
            "patientId": "GEN9-202603-00091",
            "OpId": "329455",
            "IpId": "",
            "PractitionerId": "1000",
            "type": "opd",
            "response": "**Diagnosis:** **Right costochondritis**.\n\n",
            "additional_response": "**Chief Complaints:** Pain in the right costal margin.\n\n**History of Presenting Illness:** Patient presents for a follow-up regarding pain in the right costal margin. Patient states the pain is persistent and sometimes becomes severe. Patient reports taking Ultra hctz tablet when the pain is severe, which provides approximately 80% relief. Patient takes this medication intermittently, about once every 4-5 days or once a week. Patient denies any history of heavy lifting. The pain is described as a wound-like pain at a specific point. Patient mentions that the pain is continuous but light, with occasional severe episodes. Patient also reports that walking sometimes aggravates the pain.\n\n**Past Medical History:** **Non-alcoholic fatty liver disease**. **Hypercholesterolemia**.\n\n**Personal History:** Patient reports doing walking exercises.\n\n**Past Medications:** Atorvastatin.\n\n**Examination Findings:** On examination, there is point tenderness over the right costal margin.\n\n**Investigations:** LFT and enzyme tests are normal. Triglycerides are high.\n\n**Recommendations:** Patient is advised to continue walking exercises. Patient should avoid anxiety.\n\n**Follow-up:** Patient is advised to follow up after 5 days to assess response to treatment and decide on further management, such as a nerve block injection.\n\n**Plan:** Patient is advised to undergo a FibroScan. The appointment will be scheduled, possibly on the 15th or 19th of the month.\n\n",
            "vitals": [
                    {
                        "id": 0,
                        "pulse": "55",
                        "height": "139",
                        "weight": "62",
                        "systolicBP": "72",
                        "diastolicBP": "58",
                        "oxygenSaturation": "57",
                        "temperature": "95",
                        "respRate": "70",
                        "bloodSugar": "87",
                        "bmi": "32.09",
                        "chest_circumference": null,
                        "head_circumference": null,
                        "cancer": true,
                        "epilepsy": "",
                        "arthritis": true,
                        "abnormalPulse": "",
                        "abnormalOxygen": true,
                        "hyperthyrodism": true,
                        "kidneyDiseases": true,
                        "cardiacDiseases": true,
                        "diabetesMellitus": true,
                        "asthma": "",
                        "hypertension": "",
                        "hypothyroidism": true,
                        "abnormalSystolic": true,
                        "dyslipidemia": "",
                        "allergy": true
                    }
                ],
        
            "medication_templates": [
              {
                "medication_name": "FEXAFENADINE HCL 120MG (ALLEGRA 120MG TAB)",
                "brand_name": "ALLEGRA 120MG TAB",
                "brand_id": "A090",
                "generic_name": "FEXAFENADINE HCL 120MG",
                "strength": "120mg",
                "uom": "mg",
                "frequency_morning": "0",
                "frequency_afternoon": "0",
                "frequency_evening": "0",
                "frequency_night": "1",
                "days": 3,
                "quantity": 3,
                "dosage_value": "120",
                "prn": "",
                "route": "Oral",
                "drug_type": "tablet",
                "vaccine": false,
                "duration": "3 days",
                "instructions": "Take at night.",
                "frequency_code": "",
                "frequency_description": "",
                "route_code": "",
                "route_description": "",
                "uom_code": "NUMBR",
                "uom_description": "No(s)",
                "duration_code": "DAYS",
                "duration_description": 3,
                "medication_start_date": "17/03/2026",
                "medication_end_date": "19/03/2026"
              },
              {
                "medication_name": "RANITIDINE 150MG (ACILOC  150MG TAB)",
                "brand_name": "ACILOC  150MG TAB",
                "brand_id": "7851",
                "generic_name": "RANITIDINE 150MG",
                "strength": "150MG",
                "uom": "mg",
                "frequency_morning": "01",
                "frequency_afternoon": "0",
                "frequency_evening": "0",
                "frequency_night": "1",
                "days": 1,
                "quantity": 2,
                "dosage_value": 150,
                "prn": "",
                "route": "oral",
                "drug_type": "tab",
                "vaccine": false,
                "duration": "1 days",
                "instructions": "Take at night.",
                "frequency_code": "",
                "frequency_description": "",
                "route_code": "",
                "route_description": "",
                "uom_code": "NUMBR",
                "uom_description": "No(s)",
                "duration_code": "DAYS",
                "duration_description": 1,
                "medication_start_date": "17-03-2026",
                "medication_end_date": "18-03-2026"
              }
            ],
            "vitals": [],
            "assessment": [
              {
                "assessment_template": "CBG",
                "template_tests": "CBG",
                "template_id": "708",
                "template_type": "Lab",
                "hospital_id": "ASTIL00015",
                "showList": false
              }
            ],
            "dermatology_notes": {},
            "dermatology_image": null,
            "reference_image": [],
            "icd_diagnosis": [
              {
                "icd_type": "icd_10",
                "icd_code": "M93.28",
                "icd_name": "Osteochondritis dissecans other site"
              }
            ],
            "cross_dr_id": [
              {
                "doctor_id": 161,
                "speciality_id": 3,
                "speciality_name": "GENERAL MEDICINE",
                "practitioner_id": "abc-dr1"
              }
            ],
            "status": "end payload",
            "opd_data": {
              "diagnosis": "**Right costochondritis**.",
              "chief_complaints": "Pain in the right costal margin.",
              "history_of_presenting_illness": "Patient presents for a follow-up regarding pain in the right costal margin. Patient states the pain is persistent and sometimes becomes severe. Patient reports taking Ultra hctz tablet when the pain is severe, which provides approximately 80% relief. Patient takes this medication intermittently, about once every 4-5 days or once a week. Patient denies any history of heavy lifting. The pain is described as a wound-like pain at a specific point. Patient mentions that the pain is continuous but light, with occasional severe episodes. Patient also reports that walking sometimes aggravates the pain.",
              "patient_history": "**Non-alcoholic fatty liver disease**. **Hypercholesterolemia**.",
              "Past_Medications": "Atorvastatin.",
              "personal_history": "Patient reports doing walking exercises.",
              "examination_findings": "On examination, there is point tenderness over the right costal margin.",
              "investigations": "LFT and enzyme tests are normal. Triglycerides are high.",
              "recommendations": "Patient is advised to continue walking exercises. Patient should avoid anxiety.",
              "follow_up": "Patient is advised to follow up after 5 days to assess response to treatment and decide on further management, such as a nerve block injection.",
              "plan": "Patient is advised to undergo a FibroScan. The appointment will be scheduled, possibly on the 15th or 19th of the month."
            }
          }
        }

End Payload

The end payload is sent when the session processing is complete:


         {
          "status": "complete",
          "data": {
            "SessionId": "GEN9-202603-00091",
            "hospitalId": "9",
            "patientId": "GEN9-202603-00091",
            "OpId": "329455",
            "IpId": "",
            "PractitionerId": "1000",
            "type": "opd",
            "response": "**Diagnosis:** **Right costochondritis**.\n\n",
            "additional_response": "**Chief Complaints:** Pain in the right costal margin.\n\n**History of Presenting Illness:** Patient presents for a follow-up regarding pain in the right costal margin. Patient states the pain is persistent and sometimes becomes severe. Patient reports taking Ultra hctz tablet when the pain is severe, which provides approximately 80% relief. Patient takes this medication intermittently, about once every 4-5 days or once a week. Patient denies any history of heavy lifting. The pain is described as a wound-like pain at a specific point. Patient mentions that the pain is continuous but light, with occasional severe episodes. Patient also reports that walking sometimes aggravates the pain.\n\n**Past Medical History:** **Non-alcoholic fatty liver disease**. **Hypercholesterolemia**.\n\n**Personal History:** Patient reports doing walking exercises.\n\n**Past Medications:** Atorvastatin.\n\n**Examination Findings:** On examination, there is point tenderness over the right costal margin.\n\n**Investigations:** LFT and enzyme tests are normal. Triglycerides are high.\n\n**Recommendations:** Patient is advised to continue walking exercises. Patient should avoid anxiety.\n\n**Follow-up:** Patient is advised to follow up after 5 days to assess response to treatment and decide on further management, such as a nerve block injection.\n\n**Plan:** Patient is advised to undergo a FibroScan. The appointment will be scheduled, possibly on the 15th or 19th of the month.\n\n",
            "vitals": [
                    {
                        "id": 0,
                        "pulse": "55",
                        "height": "139",
                        "weight": "62",
                        "systolicBP": "72",
                        "diastolicBP": "58",
                        "oxygenSaturation": "57",
                        "temperature": "95",
                        "respRate": "70",
                        "bloodSugar": "87",
                        "bmi": "32.09",
                        "chest_circumference": null,
                        "head_circumference": null,
                        "cancer": true,
                        "epilepsy": "",
                        "arthritis": true,
                        "abnormalPulse": "",
                        "abnormalOxygen": true,
                        "hyperthyrodism": true,
                        "kidneyDiseases": true,
                        "cardiacDiseases": true,
                        "diabetesMellitus": true,
                        "asthma": "",
                        "hypertension": "",
                        "hypothyroidism": true,
                        "abnormalSystolic": true,
                        "dyslipidemia": "",
                        "allergy": true
                    }
                ],
       
            "medication_templates": [
              {
                "medication_name": "FEXAFENADINE HCL 120MG (ALLEGRA 120MG TAB)",
                "brand_name": "ALLEGRA 120MG TAB",
                "brand_id": "A090",
                "generic_name": "FEXAFENADINE HCL 120MG",
                "strength": "120mg",
                "uom": "mg",
                "frequency_morning": "0",
                "frequency_afternoon": "0",
                "frequency_evening": "0",
                "frequency_night": "1",
                "days": 3,
                "quantity": 3,
                "dosage_value": "120",
                "prn": "",
                "route": "Oral",
                "drug_type": "tablet",
                "vaccine": false,
                "duration": "3 days",
                "instructions": "Take at night.",
                "frequency_code": "",
                "frequency_description": "",
                "route_code": "",
                "route_description": "",
                "uom_code": "NUMBR",
                "uom_description": "No(s)",
                "duration_code": "DAYS",
                "duration_description": 3,
                "medication_start_date": "17/03/2026",
                "medication_end_date": "19/03/2026"
              },
              {
                "medication_name": "RANITIDINE 150MG (ACILOC  150MG TAB)",
                "brand_name": "ACILOC  150MG TAB",
                "brand_id": "7851",
                "generic_name": "RANITIDINE 150MG",
                "strength": "150MG",
                "uom": "mg",
                "frequency_morning": "01",
                "frequency_afternoon": "0",
                "frequency_evening": "0",
                "frequency_night": "1",
                "days": 1,
                "quantity": 2,
                "dosage_value": 150,
                "prn": "",
                "route": "oral",
                "drug_type": "tab",
                "vaccine": false,
                "duration": "1 days",
                "instructions": "Take at night.",
                "frequency_code": "",
                "frequency_description": "",
                "route_code": "",
                "route_description": "",
                "uom_code": "NUMBR",
                "uom_description": "No(s)",
                "duration_code": "DAYS",
                "duration_description": 1,
                "medication_start_date": "17-03-2026",
                "medication_end_date": "18-03-2026"
              },
              {
                  "medication_name": "PARACETAMOL 650MG TAB",
                  "brand_name": "DOLO 650",
                  "brand_id": "D650",
                  "generic_name": "PARACETAMOL",
                  "strength": "650mg",
                  "uom": "mg",
                  "frequency_morning": "1",
                  "frequency_afternoon": "0",
                  "frequency_evening": "1",
                  "frequency_night": "0",
                  "days": "3 days",
                  "dosage_value": "650",
                  "prn": "if pain",
                  "route": "Oral",
                  "drug_type": "tablet",
                  "instructions": "take after food",
                  "medication_name": "PARACETAMOL 650MG TAB",
                  "medicine_type": "new",
                  "vaccine": false,
                  "duration": "3 days",
                  "frequency_code": "",
                  "frequency_description": "",
                  "route_code": "",
                  "route_description": "",
                  "uom_code": "NUMBR",
                  "uom_description": "No(s)",
                  "duration_code": "DAYS",
                  "duration_description": 3,
                  "medication_start_date": "17/03/2026",
                  "medication_end_date": "19/03/2026"
                }
            ],
            "vitals": [],
            "assessment": [
              {
                "assessment_template": "CBG",
                "template_tests": "CBG",
                "template_id": "708",
                "template_type": "Lab",
                "hospital_id": "ASTIL00015",
                "showList": false
              }
            ],
            "dermatology_notes": {},
            "dermatology_image": null,
            "reference_image": [],
            "icd_diagnosis": [
              {
                "icd_type": "icd_10",
                "icd_code": "M93.28",
                "icd_name": "Osteochondritis dissecans other site"
              }
            ],
            "cross_dr_id": [
              {
                "doctor_id": 161,
                "speciality_id": 3,
                "speciality_name": "GENERAL MEDICINE",
                "practitioner_id": "abc-dr1"
              }
            ],
            "status": "end payload",
            "opd_data": {
              "diagnosis": "**Right costochondritis**.",
              "chief_complaints": "Pain in the right costal margin.",
              "history_of_presenting_illness": "Patient presents for a follow-up regarding pain in the right costal margin. Patient states the pain is persistent and sometimes becomes severe. Patient reports taking Ultra hctz tablet when the pain is severe, which provides approximately 80% relief. Patient takes this medication intermittently, about once every 4-5 days or once a week. Patient denies any history of heavy lifting. The pain is described as a wound-like pain at a specific point. Patient mentions that the pain is continuous but light, with occasional severe episodes. Patient also reports that walking sometimes aggravates the pain.",
              "patient_history": "**Non-alcoholic fatty liver disease**. **Hypercholesterolemia**.",
              "Past_Medications": "Atorvastatin.",
              "personal_history": "Patient reports doing walking exercises.",
              "examination_findings": "On examination, there is point tenderness over the right costal margin.",
              "investigations": "LFT and enzyme tests are normal. Triglycerides are high.",
              "recommendations": "Patient is advised to continue walking exercises. Patient should avoid anxiety.",
              "follow_up": "Patient is advised to follow up after 5 days to assess response to treatment and decide on further management, such as a nerve block injection.",
              "plan": "Patient is advised to undergo a FibroScan. The appointment will be scheduled, possibly on the 15th or 19th of the month."
            }
          }
        }
        

Patient Interaction Response β€” Field Guide

This GET API returns an EMR-style interaction bundle. The total number of interaction records is returned in count, each interaction is listed inside data[], and the full clinical payload for each interaction is stored inside that item’s nested data object.

Note: Depending on the interaction type and available clinical data, some fields may be null, empty strings, empty arrays, or empty objects.

1. Response Top Level

FieldMeaning
count Total number of interaction records returned in data.
data Array of interaction records. Each element represents one consultation or visit.

2. Each Item in data[] (Interaction Header)

FieldMeaning
interaction_id Internal identifier for the interaction.
patient_id Patient identifier stored in the interaction record.
doctor_id Identifier of the doctor who handled the consultation.
patient Patient demographic details such as name, age, gender, and patient identifiers.
interaction_date Date and time when the consultation occurred.
interaction_detail_type Type or format of the interaction, such as Edited OPD or audio-based data.
created_at Date and time when this interaction record was created in CareScribe.
data Nested clinical payload containing vitals, medications, investigations, diagnosis, notes, coded diagnoses, and referral details.

3. Patient Object

FieldMeaning
patient_id Patient identifier as stored in the interaction record.
hospital_patient_id Patient identifier as maintained in the hospital/HMS system.
first_name, last_name Patient name.
date_of_birth Patient date of birth, if available.
gender Patient gender, if available.
age Patient age, if available.

4. Inner data β€” Vitals (vitals[])

The vitals array contains one or more vital-sign entries recorded during the interaction. Common fields include: pulse, height, weight, systolicBP, diastolicBP, oxygenSaturation, temperature, respRate, bloodSugar, bmi, chest_circumference, and head_circumference.

It may also include abnormality flags such as abnormalPulse, abnormalOxygen, and abnormalSystolic.

5. Condition Flags and Related Dates

The vitals payload may also contain condition/history fields such as hypertension, diabetesMellitus, asthma, cardiacDiseases, kidneyDiseases, arthritis, epilepsy, cancer, and allergy.

Related date fields use the *Date suffix, for example hypertensionDate, cancerDate, and diabetesMellitusDate.

6. Lab, Dermatology, and Images

FieldMeaning
dashboard_notes Optional dashboard-facing notes object, when present.
lab_report Structured lab report or summary object.
dermatology_notes Dermatology-specific notes.
dermatology_image Dermatology image URL or null.
reference_image Array of additional reference image URLs.

7. assessment[] (Investigations / Tests)

The assessment array contains ordered investigations or test templates for the interaction.

FieldMeaning
assessment_template Name of the assessment or test template.
template_tests Test description or linked test name.
template_id Template or test identifier, where available.
template_type Optional template type.
hospital_id Hospital identifier associated with the template, when present.
showList Optional UI/helper flag used by the client.

8. medication_templates[]

The medication_templates array contains one object per prescribed medication.

Field GroupMeaning
medication_name, brand_name, brand_id, generic_name Medication identity details.
strength, uom, dosage_value Dosage strength and measurement details.
frequency_morning, frequency_afternoon, frequency_evening, frequency_night Time-of-day dosage schedule.
prn, instructions Special instructions or β€œas needed” usage details.
route, drug_type, vaccine Route of administration, drug form/type, and vaccine flag.
duration, days, quantity Medication duration text, duration in days, and prescribed quantity.
frequency_code, route_code, uom_code, duration_code Master-data codes used for medication metadata.
frequency_description, route_description, uom_description, duration_description Human-readable descriptions for the corresponding master-data codes.
medication_start_date, medication_end_date Medication schedule start and end dates.

9. Doctor Narrative (Clinical Notes)

These fields store the doctor’s narrative notes and summary for the interaction. Common fields include: Diagnosis, chief_complaints, history_of_presenting_illness, patient_history, Past_Medications, personal_history, examination_findings, investigations, recommendations, Diet, follow_up, and plan.

Depending on the case, many of these fields may be empty strings or null.

10. icd_diagnosis[]

The icd_diagnosis array contains coded diagnoses for the interaction.

FieldMeaning
icd_type Diagnosis coding standard, such as icd_10.
icd_code Coded diagnosis value.
icd_name Human-readable diagnosis name.

11. cross_dr_id[] (Referrals / Cross Consultation)

The cross_dr_id array contains referral or cross-consultation details when the patient is referred to another doctor.

FieldMeaning
doctor_id Internal identifier of the referred doctor.
speciality_id Internal identifier of the speciality or department.
speciality_name Name of the speciality or department.
practitioner_id External practitioner identifier used by the hospital/system.

In summary, this response returns one or more patient interactions along with demographic, clinical, medication, diagnosis, and referral data for each interaction.

Responses:

  • 200: Data posted successfully with initial payload
  • 201: Data posted successfully with end payload

Step 6: Upload Medication List

Summary: Upload medication data for your organization

Description: You can upload medication lists in two ways: via JSON payload or via CSV file upload. Both methods allow you to add brand names and generic names for medications that will be used in your hospital setup.

⚠️ Important: Use post medication api call only for the initial upload. If you use upload again for appending data, it will delete the existing list and replace it completely with the new data. For any modifications or additions, always use the update (put) medication api call.

Two Methods Available

Choose the method that best fits your workflow:

JSON JSON Payload Method

Endpoint:

POST /software/post-medication

CSV CSV File Upload Method

Endpoint:

POST /software/uploadMedicationCsv

Method 1: JSON Payload

POST /software/post-medication

Summary: Upload medication master data (JSON) and store as CSV

Description: Uploads medication master data for a hospital in JSON format and stores it as a CSV file.

Requirements:

  • hospital_id and a non-empty medications array are required.
  • Each medication must contain BRAND NAME and GENERIC NAME.
  • BRAND ID is optional, but if provided in any item, it must be present in all items.

Optional Fields:

  • UOM CODE
  • UOM DESCRIPTION (if provided, UOM CODE is required).
  • ACTIVE FROM (DD/MM/YYYY)
  • ACTIVE TO (DD/MM/YYYY)
  • MEDICATION TYPE

Validation:

  • Duplicate BRAND ID values in the request are marked invalid.
  • Duplicate BRAND NAME and GENERIC NAME combinations are marked invalid.

The API stores the valid data as a CSV file and returns the processed file URL along with any invalid rows.

Body

Example 1: Basic payload (BRAND NAME and GENERIC NAME only)

{
  "hospital_id": "9",
  "medications": [
    {
      "BRAND NAME": "Tylenol",
      "GENERIC NAME": "Acetaminophen"
    },
    {
      "BRAND NAME": "Advil",
      "GENERIC NAME": "Ibuprofen"
    }
  ]
}

Example 2: Complete payload (all possible fields)

{
  "hospital_id": "9",
  "medications": [
    {
      "BRAND ID": "13752",
      "BRAND NAME": "OLVANCE 40MG TAB",
      "GENERIC NAME": "OLMESARTAN MEDOXOMIL 40MG",
      "UOM CODE": "mg",
      "UOM DESCRIPTION": "Milligram"
    },
    {
      "BRAND ID": "13753",
      "BRAND NAME": "CROXIN 500MG TAB",
      "GENERIC NAME": "PARACETAMOL 500MG",
      "UOM CODE": "mg",
      "UOM DESCRIPTION": "Milligram"
    }
  ]
}

Supported fields (case-sensitive as shown in examples):

  • BRAND NAME (required)
  • GENERIC NAME (required)
  • BRAND ID (conditionally required if present in any item)
  • UOM CODE (optional)
  • UOM DESCRIPTION (optional; if provided, UOM CODE is required)

Response (200 OK):

{
  "message": "Medication data uploaded successfully",
  "data": "https://storage.googleapis.com/bucket/processed/ORG123_20260305123456.json",
  "invalid": [
    {
      "BRAND ID": "13752",
      "BRAND NAME": "MERSILK 5062",
      "GENERIC NAME": "MERSILK",
      "UOM CODE": "",
      "UOM DESCRIPTION": "Milligram",
      "error": "BRAND NAME and GENERIC NAME combination already exists"
    }
  ]
}

Responses:

  • 200: Medication data uploaded successfully β€” Returns success message, processed output URL, and list of invalid rows rejected during validation
  • 400: Bad Request (validation failure) β€” Examples: {"message": "Invalid request body: hospital_id and non-empty medications array are required"}, {"message": "Inconsistent data: All medications must include BRAND ID if any include it"}, {"message": "No valid medications provided"}
  • 404: Organization not found β€” {"message": "Organization not found"}
  • 500: Internal server error β€” {"message": "Internal server error"}

Method 2: CSV File Upload

POST /software/uploadMedicationCsv

Summary: Upload medication CSV

Description: Uploads a medication master CSV for a hospital and replaces the existing stored file (if any). The API validates the CSV, stores only valid rows, and returns the processed file URL.

Query Parameters:

  • hospital_id (required): Hospital/organization identifier

Form Data:

  • csvFile (required, binary): Medication CSV file to upload

Supported CSV header formats (case-sensitive):

  • BRAND NAME, GENERIC NAME
  • BRAND ID, BRAND NAME, GENERIC NAME
  • BRAND NAME, GENERIC NAME, UOM CODE, UOM DESCRIPTION
  • BRAND ID, BRAND NAME, GENERIC NAME, UOM CODE, UOM DESCRIPTION
  • Any format above may continue with optional ACTIVE FROM, ACTIVE TO, and MEDICATION TYPE columns in that order.

Validation rules:

  • BRAND NAME and GENERIC NAME are required.
  • BRAND ID is required only if the header contains BRAND ID.
  • UOM CODE and UOM DESCRIPTION are optional.
  • If UOM DESCRIPTION is provided, UOM CODE must also be provided.
  • ACTIVE FROM and ACTIVE TO, when present, must use DD/MM/YYYY.
  • Duplicate BRAND ID values are rejected.
  • Duplicate BRAND NAME + GENERIC NAME combinations are rejected.
  • Empty values or values containing only , or . are rejected.

Invalid rows are returned in the invalid field of the response.

Response (200 OK):

{
  "message": "CSV uploaded and saved",
  "data": "https://storage.googleapis.com/bucket/processed/ORG123_20260305123456.json",
  "invalid": []
}

Responses:

  • 200: CSV uploaded successfully β€” Returns success message, processed URL generated from the uploaded CSV, and rows rejected due to validation errors
  • 400: Bad request β€” Examples: {"message": "No valid rows in CSV"}, {"error": "Invalid hospital_id provided.", "invalid": []}
  • 404: Organization not found β€” {"message": "Organization not found"}
  • 500: Internal server error β€” {"message": "Failed to upload", "error": "Error processing CSV file"}

Update Medication List

Description: Update existing medication lists by merging new medication entries with existing data. You can update medication lists in two ways: via JSON payload or via CSV file upload.

Two Methods Available

Choose the method that best fits your workflow:

JSON JSON Payload Method

Endpoint:

PUT /software/updateMedicationCsv

CSV CSV File Upload Method

Endpoint:

PUT /software/updateMedicationCsvList

Method 1: JSON Payload

PUT /software/updateMedicationCsv

Summary: Update medication data (merge into existing CSV)

Description: Updates the medication master data for a hospital by merging the given JSON medications with the existing stored CSV.

  • hospital_id and non-empty medications are required.
  • Each item must contain BRAND NAME and GENERIC NAME.
  • BRAND ID is optional, but if used in any item, it must be present in all items.
  • UOM CODE and UOM DESCRIPTION are optional (if UOM DESCRIPTION is provided, UOM CODE is required).
  • ACTIVE FROM, ACTIVE TO, and MEDICATION TYPE are optional. Dates must use DD/MM/YYYY.
  • If an existing CSV is present, both datasets must agree on whether BRAND ID is present.
  • Final merged data is stored back as a CSV file.

Body

Example 1: Basic payload (BRAND NAME and GENERIC NAME only)

{
  "hospital_id": "9",
  "medications": [
    {
      "BRAND NAME": "Amlodipine",
      "GENERIC NAME": "Amlodipine Besylate"
    },
    {
      "BRAND NAME": "Metformin",
      "GENERIC NAME": "Metformin Hydrochloride"
    }
  ]
}

Example 2: Complete payload (all possible fields)

{
  "hospital_id": "9",
  "medications": [
    {
      "BRAND ID": "13752",
      "BRAND NAME": "OLVANCE 40MG TAB",
      "GENERIC NAME": "OLMESARTAN MEDOXOMIL 40MG",
      "UOM CODE": "mg",
      "UOM DESCRIPTION": "Milligram"
    },
    {
      "BRAND ID": "13753",
      "BRAND NAME": "CROXIN 500MG TAB",
      "GENERIC NAME": "PARACETAMOL 500MG",
      "UOM CODE": "mg",
      "UOM DESCRIPTION": "Milligram"
    }
  ]
}

Response (200 OK):

{
  "message": "Medication data updated successfully (delta applied)",
  "data": [
    {
      "BRAND ID": "13752",
      "BRAND NAME": "OLVANCE 40MG TAB",
      "GENERIC NAME": "OLMESARTAN MEDOXOMIL 40MG",
      "UOM CODE": "mg",
      "UOM DESCRIPTION": "Milligram"
    }
  ],
  "invalid": []
}

Responses:

  • 200: Medication data updated successfully β€” Returns success message, final merged medication rows (stored in CSV), and list of invalid entries (will be empty when update succeeds)
  • 400: Bad Request (validation/header mismatch) β€” Examples: {"message": "Invalid request body: hospital_id and non-empty medications array are required"}, {"message": "Inconsistent data: All medications must include BRAND ID if any include it"}, {"message": "Validation errors in medication data"}, {"message": "Header mismatch between existing and new medication data", "invalid": [...]}
  • 404: Organization not found β€” {"message": "Organization not found"}
  • 500: Internal server error β€” {"message": "Internal server error", "error": "Unexpected error"}

Method 2: CSV File Upload

PUT /software/updateMedicationCsvList

Summary: Update medication CSV data

Description: Uploads a medication CSV for the given hospital_id and merges it with the existing medication CSV stored in Google Cloud Storage (GCS).

Query Parameters:

  • hospital_id (required): Hospital identifier for the organization

Form Data:

  • csvFile (required, binary): Medication CSV file to upload (must end with .csv)

CSV header formats (case-sensitive, must match exactly one):

  • 1) BRAND NAME, GENERIC NAME
  • 2) BRAND ID, BRAND NAME, GENERIC NAME
  • 3) BRAND NAME, GENERIC NAME, UOM CODE, UOM DESCRIPTION
  • 4) BRAND ID, BRAND NAME, GENERIC NAME, UOM CODE, UOM DESCRIPTION
  • Each format may continue with optional ACTIVE FROM, ACTIVE TO, and MEDICATION TYPE columns in that order.

Validation rules (applies to both existing CSV and uploaded CSV):

  • BRAND NAME and GENERIC NAME are required in every row.
  • Empty values or values containing only , or . are rejected.
  • Duplicate BRAND ID values (when BRAND ID exists) are rejected.
  • Duplicate BRAND NAME + GENERIC NAME combinations are rejected.
  • If UOM DESCRIPTION is provided, UOM CODE is required.
  • ACTIVE FROM and ACTIVE TO, when present, must use DD/MM/YYYY.
  • If an existing medication CSV is present, the uploaded CSV must have the same header count (same number of columns), otherwise the API returns 400 with Header mismatch between existing and new CSV.

Merge behavior:

  • If the uploaded header includes BRAND ID, the merge key is BRAND ID.
  • Otherwise, the merge key is BRAND NAME + GENERIC NAME.
  • Uploaded rows overwrite matching existing rows.

Response (200 OK):

{
  "message": "Medication data updated successfully (merged, duplicates removed)",
  "url": "https://storage.googleapis.com/bucket/csv_uploads/123_20260305_120102.csv",
  "invalid": []
}

Responses:

  • 200: Medication data updated successfully (merged and uploaded) β€” Returns success message, GCS URL of the merged CSV, and rows rejected due to validation errors (may be empty)
  • 400: Invalid request (missing hospital_id, invalid CSV, invalid columns, header mismatch, or no valid rows) β€” Examples: {"message": "Header mismatch between existing and new CSV", "invalid": []}
  • 404: Organization not found β€” {"message": "Organization not found"}
  • 500: Internal server error β€” {"message": "Internal server error", "error": "Unexpected error"}

Step 7: Upload Investigation List

Summary: Upload investigation data for your organization

Description: You can upload investigation lists in two ways: via JSON payload or via CSV file upload. Both methods allow you to add investigation data including Service ID, Standard Lab Test Name, and Alias Name that will be used in your hospital setup.

⚠️ Important: Use upload only for the initial upload. If you use upload again, it will delete the existing list and replace it completely with the new data. For any modifications or additions, always use the update call.

Two Methods Available

Choose the method that best fits your workflow:

JSON JSON Payload Method

Endpoint:

POST /software/uploadInvestigationJson

CSV CSV File Upload Method

Endpoint:

POST /software/uploadInvestigationCsv

Method 1: JSON Payload

POST /software/uploadInvestigationJson

Summary: Upload investigation data as JSON

Description: Upload investigation data for an organization as a JSON array. The data is converted to CSV format and stored in Google Cloud Storage, replacing any existing investigation data.

Query Parameters:

  • hospital_id (required): The ID of the hospital associated with the organization

Body

{
  "data": [
    {
      "Service ID": "INV001",
      "Standard Lab Test Name": "Complete Blood Count",
      "Alias Name": "CBC",
      "Service Type": "Laboratory",
      "Hospital ID": "HOSP123"
    },
    {
      "Service ID": "INV002",
      "Standard Lab Test Name": "Blood Glucose",
      "Alias Name": "BG",
      "Service Type": "Laboratory"
    }
  ]
}

Note:

  • hospital_id: Required β€” The ID of the hospital/organization (query parameter)
  • data: Required β€” Array of investigation objects
  • Service ID: Required β€” Identifier that forms the row key together with Service Type
  • Standard Lab Test Name: Required β€” Standard name of the lab test
  • Alias Name: Optional β€” Alias or short name for the test; a blank value defaults to Standard Lab Test Name
  • Service Type: Optional β€” Type of service (e.g., "Laboratory")
  • Hospital ID: Optional β€” Hospital identifier
  • ACTIVE FROM: Optional β€” Start date in DD/MM/YYYY format
  • ACTIVE TO: Optional β€” End date in DD/MM/YYYY format

Response (200 OK):

{
  "message": "Investigation data uploaded successfully",
  "data": "https://storage.googleapis.com/bucket/investigation_csv/org123_2025_09_02_13_30_45_filtered.csv",
  "invalid": [
    {
      "Service ID": "INV001",
      "error": "Service ID is required"
    }
  ]
}

Responses:

  • 200: Investigation data uploaded successfully β€” Returns success message, data URL, and list of invalid entries if any
  • 400: Invalid request β€” {"message": "JSON data is required in request body", "error": "Invalid hospital_id provided."}
  • 404: Organization not found
  • 500: Internal server error β€” {"message": "Failed to upload investigation data", "error": "Error message details"}

Method 2: CSV File Upload

POST /software/uploadInvestigationCsv

Summary: Upload an investigation CSV file

Description: Upload a CSV file containing investigation data for an organization, identified by hospital_id. The file is stored in Google Cloud Storage, and any existing file is deleted.

Query Parameters:

  • hospital_id (required): The ID of the hospital associated with the organization

Form Data:

  • csvFile (required, binary): CSV with required columns Service ID and Standard Lab Test Name; optional columns are Alias Name, Service Type, Hospital ID, ACTIVE FROM, and ACTIVE TO.

Note: CSV data should contain the following columns:

SERVICE ID STANDARD LAB TEST NAME ALIAS NAME
INV001 Complete Blood Count CBC
INV002 Blood Glucose BG

Optional columns: Alias Name, Service Type, Hospital ID, ACTIVE FROM, ACTIVE TO. Active dates must use DD/MM/YYYY. The case-insensitive Service ID + Service Type pair is the merge key.

Response (200 OK):

{
  "message": "CSV updated and saved",
  "data": "https://storage.googleapis.com/bucket/investigation_csv/org123_2025_09_02_13_30_45_filtered.csv",
  "invalid": [
    {
      "Service ID": "INV001",
      "Standard Lab Test Name": "Complete Blood Count",
      "Alias Name": "CBC",
      "error": "Service ID is required"
    }
  ]
}

Responses:

  • 200: CSV updated and saved successfully β€” Returns success message, data URL, and list of invalid entries with error details
  • 400: Invalid request β€” {"message": "A valid CSV file is required", "error": "Invalid hospital_id provided."}
  • 404: Organization not found
  • 500: Internal server error β€” {"message": "Failed to upload", "error": "Error message details"}

Update Investigation List

Description: You can update existing investigation lists in two ways: via JSON payload or via CSV file upload. Both methods allow you to add new investigations to your existing investigation list.

Two Methods Available

Choose the method that best fits your workflow:

JSON JSON Payload Method

Endpoint:

POST /software/updateInvestigationJson

Note: Merges new investigation data with existing data and stores the updated file.

CSV CSV File Upload Method

Endpoint:

POST /software/updateInvestigationCsvs

Note: New file will be merged with existing file.

Method 1: JSON Payload

POST /software/updateInvestigationJson

Summary: Update investigation data as JSON

Description: Update investigation data for an organization by merging new JSON data with existing data. The merged data is converted to CSV format and stored in Google Cloud Storage.

Query Parameters:

  • hospital_id (required): The ID of the hospital associated with the organization

Body

{
  "data": [
    {
      "Service ID": "INV001",
      "Standard Lab Test Name": "Complete Blood Count",
      "Alias Name": "CBC",
      "Service Type": "Laboratory",
      "Hospital ID": "HOSP123"
    },
    {
      "Service ID": "INV002",
      "Standard Lab Test Name": "Blood Glucose",
      "Alias Name": "BG",
      "Service Type": "Laboratory"
    }
  ]
}

Note:

  • hospital_id: Required β€” The ID of the hospital/organization (query parameter)
  • data: Required β€” Array of investigation objects to merge with existing data
  • Service ID: Required β€” Identifier that forms the row key together with Service Type
  • Standard Lab Test Name: Required β€” Standard name of the lab test
  • Alias Name: Optional β€” Alias or short name for the test
  • Service Type: Optional β€” Type of service (e.g., "Laboratory")
  • Hospital ID: Optional β€” Hospital identifier
  • ACTIVE FROM: Optional β€” Start date in DD/MM/YYYY format
  • ACTIVE TO: Optional β€” End date in DD/MM/YYYY format
  • The system will merge new data with existing data

Response (200 OK):

{
  "message": "Investigation data updated successfully",
  "data": "https://storage.googleapis.com/bucket/investigation_csv/org123_2025_09_02_13_30_45_filtered.csv",
  "invalid": [
    {
      "Service ID": "INV001",
      "error": "Service ID is required"
    }
  ]
}

Responses:

  • 200: Investigation data updated successfully β€” Returns success message, data URL, and list of invalid entries if any
  • 400: Invalid request β€” {"message": "JSON must be an array of objects", "error": "Invalid hospital_id provided."}
  • 404: Organization not found
  • 500: Internal server error β€” {"message": "Failed to update investigation data", "error": "Error message details"}

Method 2: CSV File Upload

POST /software/updateInvestigationCsvs

Summary: Update an investigation CSV file

Description: Update a CSV file containing investigation data for an organization, identified by hospital_id. The file is stored in Google Cloud Storage, and new file will be merged with existing file.

Query Parameters:

  • hospital_id (required): The ID of the hospital associated with the organization

Form Data:

  • csvFile (required, binary): CSV with required columns Service ID and Standard Lab Test Name; optional columns are Alias Name, Service Type, Hospital ID, ACTIVE FROM, and ACTIVE TO.

Note: CSV data should contain the following columns (same as upload):

SERVICE ID STANDARD LAB TEST NAME ALIAS NAME
INV001 Complete Blood Count CBC
INV002 Blood Glucose BG

Optional columns: Alias Name, Service Type, Hospital ID, ACTIVE FROM, ACTIVE TO. Active dates must use DD/MM/YYYY. The case-insensitive Service ID + Service Type pair is the merge key.

Important: The new CSV file will be merged with the existing file, not replaced.

Response (200 OK):

{
  "message": "CSV uploaded and saved",
  "data": "https://storage.googleapis.com/bucket/investigation_csv/org123_2025_09_02_13_30_45_filtered.csv",
  "invalid": [
    {
      "Service ID": "INV001",
      "Standard Lab Test Name": "Complete Blood Count",
      "Alias Name": "CBC",
      "error": "Service ID is required"
    }
  ]
}

Responses:

  • 200: CSV uploaded and saved successfully β€” Returns success message, data URL, and list of invalid entries with error details
  • 400: Invalid request β€” {"message": "A valid CSV file is required", "error": "Invalid hospital_id provided."}
  • 404: Organization not found
  • 500: Internal server error β€” {"message": "Failed to update", "error": "Error message details"}

Step 8: Upload Route List

Summary: Upload route data for your organization

Description: You can upload route lists in two ways: via JSON payload or via CSV file upload. Both methods allow you to add route data including ROUTE CODE and ROUTE DESCRIPTION that will be used in your hospital setup.

⚠️ Important: Use upload only for the initial upload. If you use upload again, it will delete the existing list and replace it completely with the new data. For any modifications or additions, always use the update call.

Two Methods Available

Choose the method that best fits your workflow:

JSON JSON Payload Method

Endpoint:

POST /software/uploadRouteJson

CSV CSV File Upload Method

Endpoint:

POST /software/uploadRouteCsv

Method 1: JSON Payload

POST /software/uploadRouteJson

Summary: Upload route data

Description:

  • Uploads Route master data for an organization in JSON format and stores it as a CSV file
  • This API should be used only for the initial upload of Route data
  • If this API is called again, the existing Route list will be completely deleted and replaced with the newly uploaded data
  • For any modifications or additions to the existing Route list, please use the updateRouteJson API

Query Parameters:

  • hospital_id (required): The ID of the hospital/organization

Body

{
  "data": [
    {
      "ROUTE CODE": "24",
      "ROUTE DESCRIPTION": "Oral"
    },
    {
      "ROUTE CODE": "25",
      "ROUTE DESCRIPTION": "Intravenous"
    }
  ]
}

Note:

  • data: Required β€” Array of route objects
  • ROUTE CODE: Required β€” Code representing the route of administration
  • ROUTE DESCRIPTION: Required β€” Description of the route of administration
  • ACTIVE FROM: Optional β€” Start date in DD/MM/YYYY format
  • ACTIVE TO: Optional β€” End date in DD/MM/YYYY format

Response (200 OK):

{
  "message": "JSON uploaded and saved as CSV",
  "data": "https://storage.googleapis.com/bucket/route_csv/ORG123_20250901123000_filtered.csv",
  "invalid": [
    {
      "index": 1,
      "error": "ROUTE DESCRIPTION is empty"
    }
  ],
  "totalItems": 2,
  "invalidItemsCount": 0
}

Responses:

  • 200: Route JSON uploaded and converted to CSV successfully β€” Returns success message, data URL, and list of invalid entries if any
  • 400: Invalid request β€” {"message": "Request body must be an array or { data: array }"}
  • 404: Organization not found
  • 500: Internal server error β€” {"message": "Failed to upload", "error": "Unexpected server error"}

Method 2: CSV File Upload

POST /software/uploadRouteCsv

Summary: Upload a Route CSV file

Description:

  • Uploads a Route master CSV for the specified hospital_id (query parameter)
  • Required CSV columns: ROUTE CODE and ROUTE DESCRIPTION. Optional columns: ACTIVE FROM and ACTIVE TO (DD/MM/YYYY).
  • Use the uploadRouteCsv API only for the initial upload of Route master data
  • If this API is called again for appending data, the existing Route list will be completely deleted and replaced with the newly uploaded CSV data
  • For any modifications, additions, or updates to the existing Route list, please use the updateRouteCsvs API

Query Parameters:

  • hospital_id (required): The ID of the hospital associated with the organization

Form Data:

  • csvFile (required, binary): CSV with required headers ROUTE CODE and ROUTE DESCRIPTION; ACTIVE FROM and ACTIVE TO are optional.

CSV Format: ROUTE CODE and ROUTE DESCRIPTION are required. ACTIVE FROM and ACTIVE TO are optional and use DD/MM/YYYY:

ROUTE CODE ROUTE DESCRIPTION
24 Oral
25 Intravenous

Response (200 OK):

{
  "message": "CSV uploaded and saved",
  "data": "https://storage.googleapis.com/bucket/route_csv/ORG_20260304_123000_filtered.csv",
  "invalid": [
    {
      "ROUTE CODE": "",
      "ROUTE DESCRIPTION": "Oral",
      "error": "ROUTE CODE is empty"
    }
  ]
}

Responses:

  • 200: CSV uploaded and saved successfully β€” Returns success message, data URL, and list of invalid entries with error details
  • 400: Invalid request β€” {"message": "Hospital ID is required", "error": "Invalid hospital_id provided."}
  • 404: Organization not found
  • 500: Internal server error β€” {"message": "Failed to upload", "error": "Invalid column names. Required: [\"ROUTE CODE\",\"ROUTE DESCRIPTION\"]."}

Update Route List

Description: You can update existing route lists in two ways: via JSON payload or via CSV file upload. Both methods allow you to merge new route entries with existing data.

Two Methods Available

Choose the method that best fits your workflow:

JSON JSON Payload Method

Endpoint:

POST /software/updateRouteJson

Note: Merges new route data with existing data, removes duplicates, and stores the updated file.

CSV CSV File Upload Method

Endpoint:

POST /software/updateRouteCsvs

Note: Merges new CSV data with existing data.

Method 1: JSON Payload

POST /software/updateRouteJson

Summary: Update Route Data using JSON

Description:

  • This API updates route data for a hospital
  • The uploaded Route json will be merged with the existing route data (if available) stored for the organization
  • The merged data is saved as a CSV file

Query Parameters:

  • hospital_id (required): Hospital ID used to identify the organization

Body

{
  "data": [
    {
      "ROUTE CODE": "24",
      "ROUTE DESCRIPTION": "Oral"
    },
    {
      "ROUTE CODE": "26",
      "ROUTE DESCRIPTION": "Intramuscular"
    }
  ]
}

Note:

  • data: Required β€” Array of route objects to merge
  • ROUTE CODE: Required β€” Code representing the route of administration
  • ROUTE DESCRIPTION: Required β€” Description of the route of administration
  • ACTIVE FROM: Optional β€” Start date in DD/MM/YYYY format
  • ACTIVE TO: Optional β€” End date in DD/MM/YYYY format
  • The system will merge new data with existing data and remove duplicates

Response (200 OK):

{
  "status": "success",
  "message": "Route data updated successfully (merged, stored as CSV)",
  "data": "https://storage.googleapis.com/bucket/route_csv/file.csv",
  "invalid": [
    {
      "ROUTE CODE": "24",
      "ROUTE DESCRIPTION": "Oral",
      "error": "ROUTE CODE already exists"
    }
  ]
}

Responses:

  • 200: Route data updated successfully β€” Returns success message, data URL, and list of invalid entries if any
  • 400: Validation error β€” {"status": "error", "message": "Validation failed", "invalid": [...]}
  • 404: Organization not found
  • 500: Internal server error β€” {"message": "Internal server error", "error": "Failed to process route data"}

Method 2: CSV File Upload

POST /software/updateRouteCsvs

Summary: Update (merge) Route CSV

Description:

  • Uploads a Route CSV file for the specified hospital_id and merges it with the existing Route data (if available) stored for the organization
  • Requirements: ROUTE CODE and ROUTE DESCRIPTION are required; ACTIVE FROM and ACTIVE TO are optional and use DD/MM/YYYY.
  • Each ROUTE CODE must be unique within the uploaded file
  • Validation: If duplicate ROUTE CODE values are found in the uploaded CSV, those rows will be reported in the `invalid` field of the response
  • Merge Behavior:
    • ROUTE CODE is used as the unique key
    • If a ROUTE CODE already exists in the stored Route data, the uploaded value overwrites the existing one
    • New ROUTE CODE entries are added to the dataset
  • The final merged dataset is stored as a CSV file and linked to the organization

Query Parameters:

  • hospital_id (required): Hospital ID used to resolve organization

Form Data:

  • csvFile (required, binary): CSV with required headers ROUTE CODE and ROUTE DESCRIPTION; ACTIVE FROM and ACTIVE TO are optional.

Response (200 OK):

{
  "message": "Route data updated successfully (merged, duplicates removed)",
  "data": "https://storage.googleapis.com/bucket/csv_uploads/route_ORG_20260304_123000.csv",
  "invalid": [
    {
      "ROUTE CODE": "24",
      "ROUTE DESCRIPTION": "Oral",
      "error": "ROUTE CODE already exists"
    }
  ]
}

Responses:

  • 200: Route data updated successfully (merged, duplicates removed) β€” Returns success message, data URL, and list of invalid entries
  • 400: Bad request β€” {"message": "Bad request: invalid headers or missing/invalid file", "invalid": [...]}
  • 404: Organization not found
  • 500: Internal server error β€” {"message": "Internal server error", "error": "Failed to process CSV file"}

Step 9: Upload Frequency List

Summary: Upload frequency data for your organization

Description: You can upload frequency lists in two ways: via JSON payload or via CSV file upload. Both methods allow you to add frequency data including FREQUENCY CODE and FREQUENCY DESCRIPTION that will be used in your hospital setup.

⚠️ Important: Use upload only for the initial upload. If you use upload again, it will delete the existing list and replace it completely with the new data. For any modifications or additions, always use the update call.

Two Methods Available

Choose the method that best fits your workflow:

JSON JSON Payload Method

Endpoint:

POST /software/uploadFrequencyJson

CSV CSV File Upload Method

Endpoint:

POST /software/uploadFrequencyCsv

Method 1: JSON Payload

POST /software/uploadFrequencyJson

Summary: Upload frequency data

Description:

  • This API uploads or updates Frequency master data for a hospital using JSON input and stores it as a CSV file
  • For the initial setup, this API can be used to upload the complete Frequency master list for the organization
  • If this API is called again, the existing Frequency list will be completely deleted and replaced with the newly uploaded data
  • For any modifications or incremental updates to the existing Frequency list, please use the updateFrequencyJson API
  • Requirements:
    • The request body must be an array of objects or an object in the format { data: array }
    • Each object must contain the fields "FREQUENCY CODE" and "FREQUENCY DESCRIPTION"
    • ACTIVE FROM and ACTIVE TO are optional and use DD/MM/YYYY
    • Each FREQUENCY CODE must be unique within the request payload
  • Validation:
    • If FREQUENCY CODE or FREQUENCY DESCRIPTION is missing or empty, the item will be reported in the `invalid` field and the API returns a 400 error
    • If duplicate FREQUENCY CODE values are found within the request payload, those items will be reported in the `invalid` field and the API returns a 400 error
  • Behavior:
    • FREQUENCY CODE is treated as the unique identifier for frequency records
    • During updates, if a FREQUENCY CODE already exists in the stored frequency data, the uploaded value overwrites the existing one
    • New FREQUENCY CODE entries will be added to the dataset
  • The final dataset is stored as a CSV file and linked to the organization

Query Parameters:

  • hospital_id (required): The ID of the hospital/organization

Body

{
  "data": [
    {
      "FREQUENCY CODE": "OD",
      "FREQUENCY DESCRIPTION": "Once daily"
    },
    {
      "FREQUENCY CODE": "BD",
      "FREQUENCY DESCRIPTION": "Twice daily"
    }
  ]
}

Note:

  • data: Required β€” Array of frequency objects
  • FREQUENCY CODE: Required β€” Code representing the frequency of administration
  • FREQUENCY DESCRIPTION: Required β€” Description of the frequency of administration
  • ACTIVE FROM: Optional β€” Start date in DD/MM/YYYY format
  • ACTIVE TO: Optional β€” End date in DD/MM/YYYY format

Response (200 OK):

{
  "message": "JSON uploaded and saved as CSV",
  "data": "https://storage.googleapis.com/bucket/frequency_csv/ORG123_20250901123000_filtered.csv",
  "invalid": [
    {
      "index": 1,
      "error": "FREQUENCY DESCRIPTION is empty"
    }
  ],
  "totalItems": 2,
  "invalidItemsCount": 0
}

Responses:

  • 200: Frequency JSON uploaded and converted to CSV successfully β€” Returns success message, data URL, and list of invalid entries if any
  • 400: Invalid request β€” {"message": "Request body must be an array or { data: array }"}
  • 404: Organization not found
  • 500: Internal server error β€” {"message": "Failed to upload", "error": "Unexpected server error"}

Method 2: CSV File Upload

POST /software/uploadFrequencyCsv

Summary: Upload Frequency CSV

Description:

  • Uploads a Frequency master CSV for the given hospital_id (query param) and stores it for the organization
  • Required CSV columns: FREQUENCY CODE and FREQUENCY DESCRIPTION. Optional columns: ACTIVE FROM and ACTIVE TO (DD/MM/YYYY).
  • Validation:
    • If FREQUENCY CODE is empty, the row is reported in `invalid`
    • If FREQUENCY DESCRIPTION is empty, the row is reported in `invalid`
  • This API should be used only for the initial upload of Frequency data
  • If this API is called again, the existing Frequency list will completely deleted and replaced with the newly uploaded data
  • For any modifications or additions to the existing Frequency list, please use the updateFrequencyCsvs API

Query Parameters:

  • hospital_id (required): Hospital ID used to resolve organization

Form Data:

  • csvFile (required, binary): CSV with required headers FREQUENCY CODE and FREQUENCY DESCRIPTION; ACTIVE FROM and ACTIVE TO are optional.

CSV Format: FREQUENCY CODE and FREQUENCY DESCRIPTION are required. ACTIVE FROM and ACTIVE TO are optional and use DD/MM/YYYY:

FREQUENCY CODE FREQUENCY DESCRIPTION
OD Once daily
BD Twice daily

Response (200 OK):

{
  "message": "CSV uploaded and saved",
  "data": "https://storage.googleapis.com/bucket/frequency_csv/ORG_20260304_123000_filtered.csv",
  "invalid": [
    {
      "FREQUENCY CODE": "",
      "FREQUENCY DESCRIPTION": "Once daily",
      "error": "FREQUENCY CODE is empty"
    }
  ]
}

Responses:

  • 200: Frequency CSV uploaded and saved successfully β€” Returns success message, data URL, and list of invalid entries with error details
  • 400: Invalid request β€” {"message": "Hospital ID is required", "error": "Invalid hospital_id provided."}
  • 404: Organization not found
  • 500: Internal server error β€” {"message": "Failed to upload", "error": "Invalid column names. Required: [\"FREQUENCY CODE\",\"FREQUENCY DESCRIPTION\"]."}

Update Frequency List

Description: You can update existing frequency lists in two ways: via JSON payload or via CSV file upload. Both methods allow you to merge new frequency entries with existing data.

Two Methods Available

Choose the method that best fits your workflow:

JSON JSON Payload Method

Endpoint:

POST /software/updateFrequencyJson

Note: Merges new frequency data with existing data, removes duplicates, and stores the updated file.

CSV CSV File Upload Method

Endpoint:

POST /software/updateFrequencyCsvs

Note: Merges new CSV data with existing data.

Method 1: JSON Payload

POST /software/updateFrequencyJson

Summary: Update (merge) Frequency data using JSON

Description:

  • This API updates frequency master data for a hospital using JSON input
  • The provided Frequency list will be merged with the existing frequency data (if available) stored for the organization
  • The merged data is saved as a CSV file
  • Requirements:
    • The request body must be an array of objects (or { data: array })
    • Each object must contain: "FREQUENCY CODE" and "FREQUENCY DESCRIPTION"
    • ACTIVE FROM and ACTIVE TO are optional and use DD/MM/YYYY
    • Each FREQUENCY CODE must be unique within the request payload
  • Validation:
    • If FREQUENCY CODE or FREQUENCY DESCRIPTION is missing/empty, the item will be reported in `invalid` and the API returns 400
    • If duplicate FREQUENCY CODE values are found within the request payload, the duplicates will be reported in `invalid` and the API returns 400
  • Merge Behavior:
    • FREQUENCY CODE is used as the unique key
    • If a FREQUENCY CODE already exists in the stored frequency data, the uploaded value overwrites it
    • New FREQUENCY CODE entries are added to the dataset
  • The final merged dataset is stored as a CSV file and linked to the organization

Query Parameters:

  • hospital_id (required): Hospital ID used to resolve organization

Body

{
  "data": [
    {
      "FREQUENCY CODE": "OD",
      "FREQUENCY DESCRIPTION": "Once daily"
    },
    {
      "FREQUENCY CODE": "TDS",
      "FREQUENCY DESCRIPTION": "Three times daily"
    }
  ]
}

Note:

  • data: Required β€” Array of frequency objects. Can be sent directly as an array or wrapped as an object with a data property.
  • FREQUENCY CODE: Required β€” Code representing the frequency of administration
  • FREQUENCY DESCRIPTION: Required β€” Description of the frequency of administration
  • ACTIVE FROM: Optional β€” Start date in DD/MM/YYYY format
  • ACTIVE TO: Optional β€” End date in DD/MM/YYYY format
  • The system will merge new data with existing data and remove duplicates

Response (200 OK):

{
  "status": "success",
  "message": "Frequency data updated successfully (merged, stored as CSV)",
  "data": "https://storage.googleapis.com/bucket/frequency_csv/ORG_20260304_123000.csv",
  "invalid": [
    {
      "FREQUENCY CODE": "OD",
      "FREQUENCY DESCRIPTION": "Once daily",
      "error": "FREQUENCY CODE already exists"
    }
  ]
}

Responses:

  • 200: Frequency data updated successfully (merged, stored as CSV) β€” Returns success message, data URL, and list of invalid entries
  • 400: Validation failed / bad request β€” {"status": "error", "message": "Validation failed", "invalid": [...]}
  • 404: Organization not found
  • 500: Internal server error β€” {"message": "Internal server error", "error": "Failed to process frequency data"}

Method 2: CSV File Upload

POST /software/updateFrequencyCsvs

Summary: Update (merge) Frequency CSV

Description:

  • This API updates frequency data for a hospital
  • The uploaded Frequency CSV will be merged with the existing frequency data (if available) stored for the organization
  • The merged data is saved as a CSV file
  • Requirements: FREQUENCY CODE and FREQUENCY DESCRIPTION are required; ACTIVE FROM and ACTIVE TO are optional and use DD/MM/YYYY.
  • Each FREQUENCY CODE must be unique within the uploaded file
  • Validation:
    • If duplicate FREQUENCY CODE values are found in the uploaded CSV, those rows will be reported in the `invalid` field of the response
    • If FREQUENCY CODE is empty, the row will be reported in `invalid`
    • If FREQUENCY DESCRIPTION is empty, the row will be reported in `invalid`
  • Merge Behavior:
    • FREQUENCY CODE is used as the unique key
    • If a FREQUENCY CODE already exists in the stored frequency data, the uploaded value overwrites the existing one
    • New FREQUENCY CODE entries will be added to the dataset
  • The final merged dataset will be stored as a CSV file and linked to the organization

Query Parameters:

  • hospital_id (required): Hospital ID used to resolve organization

Form Data:

  • csvFile (required, binary): CSV with required headers FREQUENCY CODE and FREQUENCY DESCRIPTION; ACTIVE FROM and ACTIVE TO are optional.

Response (200 OK):

{
  "message": "Frequency data updated successfully (merged, duplicates removed)",
  "data": "https://storage.googleapis.com/bucket/csv_uploads/frequency_ORG_20260304_123000.csv",
  "invalid": [
    {
      "FREQUENCY CODE": "OD",
      "FREQUENCY DESCRIPTION": "Once daily",
      "error": "FREQUENCY CODE already exists"
    }
  ]
}

Responses:

  • 200: Frequency data updated successfully (merged, duplicates removed) β€” Returns success message, data URL, and list of invalid entries
  • 400: Bad request β€” {"message": "Bad request: invalid headers or missing/invalid file", "invalid": [...]}
  • 404: Organization not found
  • 500: Internal server error β€” {"message": "Internal server error", "error": "Failed to process CSV file"}

Upload Patient Document

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 OK):

{
  "message": "Document uploaded successfully."
}

Responses:

  • 200: {"message": "Document uploaded successfully."}
  • 400: Validation or upload error. Examples: {"message": "Missing required field(s): hospital_id."}, {"message": "file is required."}, {"message": "Document upload size exceeds 30MB limit."}, {"message": "Upload a maximum of 10 document files in the file field."}, {"message": "Document upload failed."}
  • 404: Referenced hospital, clinician, or inpatient record was not found. Examples: {"message": "hospital_id not found."}, {"message": "practitioner_id not found."}, {"message": "caregiver_id not found."}, {"message": "inpatient_id not found for this patient."}
  • 500: {"message": "Document upload failed."}

MHC Integration

Master Health Checkup (MHC) Integration allows your HMS to register executive health checkup patients with CareScribe, obtain a clinician session URL, and later retrieve generated specialty form data via GET calls.

The integration follows two steps:

  1. Step 1: Create or update the MHC patient using POST /patient/softwareintegrationmhc.
  2. Step 2: Poll or fetch generated MHC form data using GET /software/mhc/form-data for each supported form.

Supported MHC forms (form_name):

  • Generate Eye Checkup
  • Generate Dental Checkup
  • Generate Gynecology checkup Report
  • Generate History and Physical Examination
  • Generate ENT Checkup

If an unknown form is requested, the API returns an allowed array listing all supported forms.

Step 1: MHC Integration Endpoint

POST /patient/softwareintegrationmhc

Summary: MHC Software Integration

Description: Creates or updates a Master Health Checkup (MHC) patient, assigns a doctor, and optionally uploads vitals. Returns a secure session URL and MHC identifiers.

Headers: x-api-key (required)

Request Body

{
  "hospital_id": "9",
  "package_name": "Executive Health Checkup",
  "doctor": {
    "practitioner_id": "123"
  },
  "patient": {
    "patient_id": "HPID1001",
    "name": "Ravi Kumar",
    "age": 42,
    "gender": "Male",
    "language": "English",
    "date_of_birth": "1984-01-15",
    "phone_number": "9876543210",
    "email": "ravi.kumar@example.com",
    "address1": "12 MG Road, Bengaluru",
    "marital_status": "Married",
    "occupation": "Engineer",
    "past_history": "Diabetes,Hypertension"
  },
  "vitals": [
    {
      "height": 172,
      "weight": 78,
      "bmi": 26.4,
      "systolic_bp": 130,
      "diastolic_bp": 85,
      "pulse_rate": 78,
      "temperature": 98.6,
      "spo2": 98
    }
  ]
}

Response (200 OK)

{
  "message": "MHC patient updated successfully.",
  "path": "https://app.carescribe.health/session_id?id=GEN9-202605-00010&mhc_id=MHC-GEN9-202605-00011&token=xxx&practitioner_id=123&doctor_id=403",
  "patient_id": "GEN9-202605-00010",
  "hospital_patient_id": "HPID1001",
  "mhc_id": "MHC-GEN9-202605-00011",
  "package_name": "Executive Health Checkup",
  "doctor_list": [403],
  "vitals_uploaded": true
}

Responses

  • 200: MHC patient created or updated successfully
  • 400: Missing required fields β€” {"message": "The following required field(s) are missing: hospital_id, patient_id."}
  • 404: Organization or doctor not found
  • 500: Internal server error

Step 2: Get MHC Form Data

GET /software/mhc/form-data

Summary: Get MHC form data

Description: Retrieves generated MHC form data for a patient. The API resolves the patient and active MHC record, then calls the upstream OPD chatbot to generate or return the requested form payload.

Headers: x-api-key (required)

Query Parameters

Parameter Type Required Description
hospital_id string Yes Unique hospital identifier (maps to organization)
patient_id string Yes Internal patient_id or hospital_patient_id
form_name string Yes MHC form to generate
mhc_id string No Specific MHC record. When omitted, the most recently updated active MHC record is used.

Sample Requests

GET /software/mhc/form-data?hospital_id=9&patient_id=ragulID1002&form_name=Generate%20ENT%20Checkup

GET /software/mhc/form-data?hospital_id=9&patient_id=ragulID1002&form_name=Generate%20Eye%20Checkup&mhc_id=MHC-GEN9-202606-00002

GET /software/mhc/form-data?hospital_id=9&patient_id=ragulID1002&form_name=Generate%20Dental%20Checkup

GET /software/mhc/form-data?hospital_id=9&patient_id=ragulID1002&form_name=Generate%20Gynecology%20checkup%20Report

GET /software/mhc/form-data?hospital_id=9&patient_id=ragulID1002&form_name=Generate%20History%20and%20Physical%20Examination

Sample Response Envelope (200 OK)

All successful responses share the same top-level fields. The response form_name is the internal form key (for example eye_checkup), while question_text matches the requested form label.

{
  "status": true,
  "hospital_id": "9",
  "patient_id": "ragulID1002",
  "internal_patient_id": "GEN9-202606-00221",
  "hospital_patient_id": "ragulID1002",
  "mhc_id": "MHC-GEN9-202606-00002",
  "form_name": "eye_checkup",
  "question_text": "Generate Eye Checkup",
  "interaction_id": 119880,
  "force_regenerate": 119880,
  "data": {
    "response": { }
  }
}

See MHC Form Responses below for complete data.response examples for each form.

Responses

  • 200: MHC form data retrieved successfully
  • 400: Missing or invalid parameters β€” includes allowed list of supported forms when form_name is missing or unknown
  • 404: Patient or MHC record not found
  • 500: Internal server error β€” {"status": false, "message": "Failed to fetch MHC form data."}
  • 503: OPD chatbot URL not configured β€” {"status": false, "message": "OPD_CHATBOT_URL is not configured."}

MHC Form Responses

After the clinician completes documentation in the MHC session, call GET /software/mhc/form-data with the corresponding form_name to retrieve each specialty report. Poll until data.response contains the expected form fields.

Request and Response Form Mapping

Request form_name Response form_name Response question_text
Generate Eye Checkup eye_checkup Generate Eye Checkup
Generate Dental Checkup dental_checkup Generate Dental Checkup
Generate Gynecology checkup Report gynaec_checkup Generate Gynecology checkup Report
Generate History and Physical Examination history_physical_examination Generate History and Physical Examination
Generate ENT Checkup ent_checkup Generate ENT Checkup

1. Eye Checkup

Request: form_name=Generate Eye Checkup

GET /software/mhc/form-data?hospital_id=9&patient_id=ragulID1002&form_name=Generate%20Eye%20Checkup

Response (200 OK)

{
  "status": true,
  "hospital_id": "9",
  "patient_id": "ragulID1002",
  "internal_patient_id": "GEN9-202606-00221",
  "hospital_patient_id": "ragulID1002",
  "mhc_id": "MHC-GEN9-202606-00002",
  "form_name": "eye_checkup",
  "question_text": "Generate Eye Checkup",
  "interaction_id": 119880,
  "force_regenerate": 119880,
  "data": {
    "response": {
      "ageGender": "",
      "anteriorSegment": "Front part of the eyes are normal. No redness or infection.",
      "chiefComplaints": "Patient came for a general health checkup.",
      "diagnosis": "Mild refractive error and digital eye strain.",
      "discussion": "",
      "eyeComplaints": "Patient reports slightly blurred vision for two days. Experiences eye strain after prolonged mobile use and glare when looking at lights.",
      "familyHistory": "Father uses power glasses.",
      "fundus": "Backside fundus is normal. No problem in the retina.",
      "iopLeft": "Normal",
      "iopRight": "Normal",
      "leftEyeExtra": "",
      "leftEyePg": "",
      "leftEyePh": "",
      "leftEyeSub": "Normal with some strain.",
      "leftEyeUnaided": "",
      "packageName": "General Health Checkup",
      "pastMedicalHistory": "Patient reports a history of **mild headache** for one year, which is still present. No history of **Diabetes** or **BP**.",
      "physician": "581",
      "presentMedicineOrGlasses": "Patient is not on any medication and does not use glasses.",
      "procedureCarriedOut": "Vision test, eye pressure test, and retinal function examination were performed.",
      "registrationDate": "",
      "registrationNo": "",
      "rightEyeExtra": "",
      "rightEyePg": "",
      "rightEyePh": "",
      "rightEyeSub": "Slight power present.",
      "rightEyeUnaided": "",
      "treatmentAdvised": "Advised to use light power specs and reduce screen time. Follow the 20-20-20 rule. Prescribed artificial tear drops."
    }
  }
}

2. Dental Checkup

Request: form_name=Generate Dental Checkup

GET /software/mhc/form-data?hospital_id=9&patient_id=ragulID1002&form_name=Generate%20Dental%20Checkup

Response (200 OK)

{
  "status": true,
  "hospital_id": "9",
  "patient_id": "ragulID1002",
  "internal_patient_id": "GEN9-202606-00221",
  "hospital_patient_id": "ragulID1002",
  "mhc_id": "MHC-GEN9-202606-00002",
  "form_name": "dental_checkup",
  "question_text": "Generate Dental Checkup",
  "interaction_id": 119880,
  "force_regenerate": 119880,
  "data": {
    "response": {
      "patient_information": {
        "chief_complaints": {
          "dental_complaints": "Patient reports tooth pain, especially while eating, sensitivity to cold items, and occasional gum bleeding.",
          "history_ho": "Patient has been experiencing this pain for the last six months. Patient reports consuming a lot of sweets and has not been brushing regularly recently due to night shifts."
        },
        "clinical_examination": {
          "gums_and_oral_mucosa": "Gums are swollen with mild bleeding. Oral mucosa is normal.",
          "intraoral_examination": "A cavity is present in a lower molar tooth.",
          "oral_hygiene": "POOR"
        },
        "diagnosis_treatment": {
          "diagnosis": "Dental caries. Gingivitis due to poor oral hygiene.",
          "other_diagnosis": "Gentle caries cavity. Gum inflammation.",
          "treatment_advised": "Tooth filling for the cavity. Scaling. Brushing twice daily. Avoid sweets. Gargle with salt water."
        },
        "header": {
          "department_name": "General Dentistry",
          "package_name": "",
          "physician": "143",
          "registration_date": "",
          "registration_no": ""
        }
      }
    }
  }
}

3. Gynecology Checkup Report

Request: form_name=Generate Gynecology checkup Report

GET /software/mhc/form-data?hospital_id=9&patient_id=ragulID1002&form_name=Generate%20Gynecology%20checkup%20Report

Response (200 OK)

{
  "status": true,
  "hospital_id": "9",
  "patient_id": "ragulID1002",
  "internal_patient_id": "GEN9-202606-00221",
  "hospital_patient_id": "ragulID1002",
  "mhc_id": "MHC-GEN9-202606-00002",
  "form_name": "gynaec_checkup",
  "question_text": "Generate Gynecology checkup Report",
  "interaction_id": 119880,
  "force_regenerate": 119880,
  "data": {
    "response": {
      "chief_complaints": {
        "gynaec_complaints": "Patient presents with irregular periods, lower abdominal pain, and itching."
      },
      "clinical_examination": {
        "breast": "Normal, no lumps.",
        "pap_smear": "",
        "per_abdomen": "Mild lower abdominal tenderness present.",
        "per_speculum": "Mild discharge present. No severe infection. Cervix healthy.",
        "per_vaginal": "",
        "thyroid": "Normal, no swelling.",
        "ultra_sound": "Mild PCOS changes noted.",
        "ultrasound": ""
      },
      "header": {
        "package_name": "",
        "physician": "582",
        "registration_date": "",
        "registration_no": ""
      },
      "menstrual_history": {
        "lmp": "10/03",
        "menstrual_history": "Irregular cycles, occurring every 30 to 45 days. Flow is moderate with pain for the first two days."
      },
      "obstetric_history": {
        "abortions": "No history of abortions.",
        "deliveries": "No history of deliveries.",
        "la": "No living abortion.",
        "lcb": "No previous child birth."
      },
      "past_history": {
        "family_social_history": "Mother has a history of **fibroid issues**. Patient has a sitting job in IT.",
        "past_medical_history": "No significant past medical conditions reported.",
        "surgical_history": "No history of surgeries."
      },
      "remarks": "Diagnosis is possibly **PCOS** with irregular cycles and mild infection. Advised lifestyle changes."
    }
  }
}

4. History and Physical Examination

Request: form_name=Generate History and Physical Examination

GET /software/mhc/form-data?hospital_id=9&patient_id=ragulID1002&form_name=Generate%20History%20and%20Physical%20Examination

Response (200 OK)

{
  "status": true,
  "hospital_id": "9",
  "patient_id": "ragulID1002",
  "internal_patient_id": "GEN9-202606-00221",
  "hospital_patient_id": "ragulID1002",
  "mhc_id": "MHC-GEN9-202606-00002",
  "form_name": "history_physical_examination",
  "question_text": "Generate History and Physical Examination",
  "interaction_id": 119880,
  "force_regenerate": 119880,
  "data": {
    "response": {
      "advice_given": "Patient advised to start daily exercise, get proper sleep, follow a healthy diet, increase water intake, and reduce screen time.",
      "clinical_history": {
        "chief_complaint": "Patient complains of feeling tired, frequent headaches, and recurrent fever.",
        "drug_allergies": "No known drug allergies.",
        "past_history": {
          "family_history": {
            "father": "History of **BP**.",
            "mother": "Normal.",
            "siblings": "Healthy."
          },
          "past_medical_history": "No history of **Diabetes** or **BP**.",
          "social_history": {
            "alcohol": "Rarely, sometimes.",
            "diet": "Mostly vegetarian, occasionally non-vegetarian.",
            "marital_status": "Married.",
            "no_of_children": "2",
            "physical_activity": "Goes for walking sometimes.",
            "smoking": "Non-smoker.",
            "tobacco_snuff": "None."
          },
          "surgical_history": "No history of surgery."
        },
        "present_medication": "Takes Calpol tablet for headache."
      },
      "consultant_physician": "598",
      "physical_examination": {
        "abdomen": {
          "findings": "No tenderness in the abdomen. Liver, spleen, and kidney are normal.",
          "kidney": "Normal.",
          "liver": "Normal.",
          "others": "",
          "spleen": "Normal.",
          "tenderness": "No tenderness."
        },
        "cardiovascular_system": {
          "findings": "Heart sounds normal.",
          "heart_sounds": "Normal.",
          "murmur": ""
        },
        "central_nervous_system": {
          "cranial_nerves": "Normal.",
          "findings": "Cervical nerve normal.",
          "fundus": "",
          "motor_system": "",
          "reflexes": "",
          "sensory_system": ""
        },
        "general": {
          "clubbing": "No.",
          "cyanosis": "No.",
          "edema": "No.",
          "findings": "No pallor, no cyanosis, no clubbing, no edema. Glands are normal.",
          "glands": "Normal.",
          "icteric": "",
          "jvp": "",
          "pallor": "No."
        },
        "joints": "Joints movement normal, no pain.",
        "respiratory_system": {
          "adventitious_sounds": "No extra sounds.",
          "breath_sounds": "Normal.",
          "findings": "Breathing sounds normal. No extra sounds."
        },
        "skin": "Normal."
      },
      "summary_of_abnormal_results": "",
      "vitals": {
        "blood_pressure_diastolic": "80 mmHg",
        "blood_pressure_systolic": "120 mmHg",
        "bmi_category": "Normal",
        "body_mass_index": "24.2 kg/m2",
        "height_cm": "170 cm",
        "height_ft": "5 ft 7 in",
        "pulse": "78 bpm",
        "weight_kgs": "70 kg",
        "weight_lbs": "154 lbs"
      }
    }
  }
}

5. ENT Checkup

Request: form_name=Generate ENT Checkup

GET /software/mhc/form-data?hospital_id=9&patient_id=ragulID1002&form_name=Generate%20ENT%20Checkup

Response (200 OK)

{
  "status": true,
  "hospital_id": "9",
  "patient_id": "ragulID1002",
  "internal_patient_id": "GEN9-202606-00221",
  "hospital_patient_id": "ragulID1002",
  "mhc_id": "MHC-GEN9-202606-00002",
  "form_name": "ent_checkup",
  "question_text": "Generate ENT Checkup",
  "interaction_id": 119880,
  "force_regenerate": 119880,
  "data": {
    "response": {
      "audiometry": "Both ears are hearing in the normal range",
      "clinicalFindings": "Throat: **mild redness**. Nose: **nasal macule swollen**. Ear: normal.",
      "entComplaints": "Throat pain for 2 days, difficulty swallowing with irritation, morning nasal blockage, and occasional mild ear pain",
      "historyHo": "Frequent cold, dust allergy, past history of childhood sinusitis at 5 to 6 years of age",
      "otherTests": "Throat: **mild throat inflammation**. Nose: **nasal conditions**.",
      "packageName": "Master Health Checkup Package",
      "physician": "362",
      "recommendations": "Steam inhalation daily, drink warm water, avoid dust, salt water gargle, take prescribed tablet for allergy, and take Calpol 500 mg tablet",
      "registrationDate": "",
      "registrationNo": "",
      "tuningForkTests": "Rinne test: normal, AC > BC. Weber test: no lateralization."
    }
  }
}

Note: If form data is still being generated upstream, retry the GET request after a short interval.

IPD Integration

IPD Integration allows you to integrate CareScribe with your Hospital Management System for Inpatient Department (IPD) workflows. This integration enables seamless data flow between your HMS and CareScribe's AI-powered documentation system for inpatient care.

The integration follows a step-by-step process to set up nurses, manage inpatient records, and handle IPD session data.

Where to Start IPD Integration

Prerequisites for IPD Integration:

  • If you have already completed OPD integration: You can start directly with Step 1: Create a Nurse below, as your hospital account setup and doctor creation are already completed.
  • If you are starting fresh (no OPD integration): You need to complete the initial setup steps first:
    • Complete Step 1: Create a Hospital (from OPD Integration section) to set up your hospital account
    • Complete Step 2: Get the Specialty List (from OPD Integration section) to retrieve available specialties
    • Complete Step 3: Create a Doctor (from OPD Integration section) to create at least one doctor in the system
    • Then proceed with Step 1: Create a Nurse below to begin IPD integration

Note: The hospital account setup and doctor creation are shared between OPD and IPD integrations. Once these are completed, you can use the same hospital and doctor records for both workflows.

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 OK)

{
  "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"
    }
  ]
}

Responses:

  • 200: Floors fetched successfully
  • 400: Missing hospital_id - {"message": "hospital_id is required."}
  • 404: No floors found - {"message": "No Floors found for this hospital."}
  • 500: Server error - {"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 Created)

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

Responses:

  • 201: Floor created successfully
  • 400: Invalid request - {"message": "floor_name and hospital_id are required"}
  • 404: Organization not found - {"message": "Organization not found"}
  • 409: Duplicate floor - {"message": "Floor already exists for this organization."}
  • 500: Server error - {"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 OK)

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

Responses:

  • 200: Floor updated successfully
  • 400: Missing hospital_id - {"message": "hospital_id is required."}
  • 404: Floor not found - {"message": "Floor not found."}
  • 409: Duplicate floor name - {"message": "Floor with this name already exists."}
  • 500: Server error - {"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 OK)

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

Responses:

  • 200: Floor deleted successfully
  • 400: Missing floor_id - {"message": "floor_id is required."}
  • 404: Floor not found - {"message": "Floor not found."}
  • 500: Server error - {"message": "Failed to delete", "error": "Database error"}

Bed Management

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 OK)

{
  "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"
    }
  ]
}

Responses:

  • 200: Beds fetched successfully
  • 400: Missing hospital_id - {"message": "hospital_id is required"}
  • 404: Invalid hospital_id - {"message": "Invalid hospital_id"}
  • 500: Server error - {"message": "Internal Server Error"}
POST /software/create/bed

Summary: Create a new inpatient bed

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

Headers: x-api-key (required)

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 */ }
}

Responses:

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

Summary: Update an existing inpatient bed

Description: Updates ward and bed information, status, floor, and 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 OK)

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

Responses:

  • 200: Bed updated successfully
  • 400: Duplicate bed number - {"message": "Bed number already exists on this floor/ward."}
  • 404: Invalid hospital_id, invalid floor, or bed not found - {"message": "Invalid hospital_id / Invalid floor / Bed not found."}
  • 500: Server error - {"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 OK)

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

Responses:

  • 200: Bed types and wards retrieved successfully
  • 404: Hospital not found - {"message": "hospital not found."}
  • 500: Server error - {"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 OK)

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

Responses:

  • 200: Ward added successfully
  • 400: Missing hospital_id - {"message": "hospital_id is required."}
  • 404: Organization not found - {"message": "Organization not found."}
  • 409: Duplicate ward - {"message": "This ward already exists for the organization."}
  • 500: Server error - {"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 OK)

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

Responses:

  • 200: Ward updated successfully
  • 400: Invalid request - {"message": "Old ward and new ward are required."}
  • 404: Ward not found - {"message": "Ward not found."}
  • 409: Duplicate ward - {"message": "This ward already exists for the organization."}
  • 500: Server error - {"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 OK)

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

Responses:

  • 200: Ward removed successfully
  • 400: Ward name is required - {"message": "Ward name is required."}
  • 404: Ward not found - {"message": "Ward not found."}
  • 500: Server error - {"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 OK)

{
  "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": []
}

Responses:

  • 200: CSV uploaded and processed successfully
  • 400: Missing CSV file - {"message": "A CSV file is required."}
  • 404: Organization not found - {"message": "Organization not found for the given hospital_id."}
  • 500: Server error - {"message": "Failed to upload CSV", "error": "Error details message here"}

Step 1: Create a Nurse

POST /software/nurse/create

Summary: Create Nurse

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

Query Parameters:

  • hospital_id (required): The hospital identifier

Headers:

  • x-api-key (required): API key for authentication

Body

{
  "firstname": "Sarah",
  "lastname": "John",
  "email": "",
  "phone": "994056789",
  "floor_id": 2,
  "caregiver_id": "carescribe-001-nr001"
}

Note:

  • firstname: Required β€” Nurse's first name
  • lastname: Required β€” Nurse's last name
  • email: Optional β€” If blank, email will be auto-generated
  • phone: Optional β€” Nurse's phone number
  • floor_id: Required β€” The floor/ward ID where the nurse is assigned. We will share the floor_id.
  • caregiver_id: Required and must be unique β€” Must be in format "hospital_id-nrsomenumber" (e.g., carescribe-001-nr001, carescribe-001-nr002). Format: your hospital_id followed by "-nr" and a number.

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": "carescribe-001-nr001",
    "role": "nurse,nurse_admin",
    "shift": "day",
    "organization_id": "ORG123"
  }
}

Responses:

  • 201: Nurse created successfully β€” Returns nurse data with auto-generated email if not provided
  • 400: Invalid request β€” {"message": "firstname, lastname, and floor_id are required fields"}
  • 404: Invalid hospital_id β€” {"message": "Invalid hospital_id"}
  • 500: Server error β€” {"message": "Server error", "error": "Database connection failed"}

Step 2: 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 Session Link

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"
  }
}

Response (200 OK) - Doctor Session Link:

{
  "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
}

Request Body - Nurse Session Link

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

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

Response (200 OK) - Nurse Session Link:

{
  "message": "Patient already exists. Inpatient record updated.",
  "path": "/session_id?...&caregiver_id=carescribe-001-nr001",
  "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

Responses:

  • 200: Success β€” Session URL generated with patient and inpatient details
  • 400: Invalid request β€” "Provide either practitioner_id (doctor) or caregiver_id (nurse), not both. Please use one and try again."
  • 404: Organization not found β€” "Organization not found"
  • 409: Conflict β€” "Another clinician is currently visiting this inpatient."
  • 500: Internal server error β€” "Internal Server Error"
PUT /software/inpatient/assign-primary-doctor

Summary: Assign Primary Doctor / Update Inpatient

Description: Use this endpoint after creating the doctor session link or nurse session link in Step 2 when you need to assign or change the inpatient's primary doctor. In the same request you can also update the ward, floor, bed, patient category, and admission details for that inpatient.

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

When to use this:

  • After generating a doctor session link or nurse session link for the inpatient in Step 2.
  • When you need to assign or change the primary doctor using practitioner_id.
  • When you need to update inpatient placement details such as floor_id, ward, and bed_no.

Body

{
  "hospital_inpatient_id": "INP-HOSP-PAT-001",
  "practitioner_id": "1001",
  "floor_id": 29,
  "bed_no": "B123",
  "ward": "General",
  "patient_id": "HOSP-PAT-001",
  "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 OK)

{
  "message": "Inpatient updated successfully",
  "inpatient": {
    "inpatient_id": "INP-HOSP-PAT-001",
    "hospital_inpatient_id": "INP-HOSP-PAT-001",
    "patient_id": "HOSP-PAT-001",
    "ward": "General",
    "bed_no": "B123",
    "in_date": "2025-01-06T10:00:00Z",
    "out_date": null,
    "active": true,
    "Patient": {
      "patient_id": "HOSP-PAT-001",
      "hospital_patient_id": "HP-001",
      "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": 29,
      "floor_name": "First Floor"
    }
  }
}

Responses:

  • 200: Inpatient updated successfully
  • 400: Missing hospital_id or hospital_inpatient_id
  • 404: Organization, inpatient, or doctor not found
  • 500: Server error - {"message": "Server error", "error": "Database error"}

Upload Patient Document

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 OK):

{
  "message": "Document uploaded successfully."
}

Responses:

  • 200: {"message": "Document uploaded successfully."}
  • 400: Validation or upload error. Examples: {"message": "Missing required field(s): hospital_id."}, {"message": "file is required."}, {"message": "Document upload size exceeds 30MB limit."}, {"message": "Upload a maximum of 10 document files in the file field."}, {"message": "Document upload failed."}
  • 404: Referenced hospital, clinician, or inpatient record was not found. Examples: {"message": "hospital_id not found."}, {"message": "practitioner_id not found."}, {"message": "caregiver_id not found."}, {"message": "inpatient_id not found for this patient."}
  • 500: {"message": "Document upload failed."}

Step 3: IPD Module Responses

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.

Note: This endpoint is called by CareScribe to your HMS system. Configure ipd_api_url for IPD callbacks and api_url for OPD callbacks in your organization settings to receive these POST requests.

Base Response Structure

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

When cross_dr_id is present (including OPD callbacks in Step 5), it is an array of objects, not strings. Each object has doctor_id (integer), speciality_id (integer), speciality_name (string), and practitioner_id (string, your external practitioner id). It may be an empty array when there are no cross-referrals.

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,
    "cross_dr_id": [],
    "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,
    "cross_dr_id": [],
    "status": "complete"
  }
}

Additional IPD Bundle Callback Payloads

For the bundle forms, the callback payload includes structured_data instead of only a stringified response. The same callback envelope is used for both initial and final payloads; the final saved payload uses top-level status: "complete" and inner status: "end payload".

CAUTI Bundle Callback

{
  "status": "complete",
  "data": {
    "SessionId": "143",
    "hospitalId": "9",
    "patientId": "GUN8-202605-00039",
    "OpId": "",
    "IpId": "IN-GUN8-202605-00014",
    "PractitionerId": "PR-72",
    "type": "ipd",
    "formName": "cauti_bundle",
    "process": "cauti_bundle",
    "structured_data": {
      "IPD_CAUTI_BUNDLE": [
        {
          "interaction_id": "116604",
          "note_time": "01:27 PM 01/06/2026",
          "timestamp": "2026-06-01T07:57:19.980386+00:00",
          "nurse_id": 72,
          "cauti_bundle": {
            "insertion_checklist_form": {
              "diagnosis": "appendectomy",
              "catheter_details": {
                "type_of_catheter": "foley",
                "type_options": {
                  "foley": true,
                  "suprapubic": false,
                  "other": ""
                },
                "size": "",
                "date_time_of_insertion": "01/06/2026 01:17 PM"
              },
              "indication_for_catheter": {
                "acute_urinary_retention": true,
                "accurate_urine_output_monitoring_critically_ill": false,
                "perioperative_use": false,
                "pressure_ulcer_management": false,
                "other": ""
              },
              "insertion_bundle_checklist": {
                "patient_identity_confirmed": true,
                "informed_consent_obtained": true,
                "hand_hygiene_performed": true,
                "sterile_gloves_ppe_used": true,
                "perineal_area_cleaned": true,
                "aseptic_technique_maintained": true,
                "sterile_catheter_used": true,
                "closed_drainage_system_maintained": true,
                "catheter_secured_properly": true,
                "drainage_bag_below_bladder_level": true,
                "no_kinks_obstruction_in_tubing": true
              },
              "post_insertion_care": {
                "urine_flow_confirmed": true,
                "patient_comfortable": true
              },
              "signatures": {
                "inserted_by": 72,
                "verified_by": "Sonia"
              }
            },
            "daily_maintenance_checklist_form": {
              "date_of_insertion": "01/06/2026",
              "indication": "",
              "assessments": [],
              "signs_of_infection": {
                "fever": false,
                "burning_sensation": false,
                "cloudy_urine": false,
                "foul_smell": false
              },
              "culture": "",
              "action_taken": {
                "action": "",
                "date": "",
                "signature": ""
              }
            },
            "removal_checklist_form": {
              "type_of_catheter": "",
              "date_of_removal": "",
              "removal_checklist": {
                "doctors_order_verified": false,
                "catheter_no_longer_indicated": false,
                "hand_hygiene_performed": false,
                "ppe_used": false,
                "balloon_deflated_completely": false,
                "catheter_removed_gently": false,
                "patient_monitored_post_removal": false
              },
              "post_removal_observation": {
                "able_to_void": false,
                "pain_discomfort": false,
                "retention": false,
                "others": ""
              },
              "date": "",
              "signature": ""
            },
            "summary_form": {
              "unit": "",
              "month": "",
              "catheter_date": "",
              "indication_days": "",
              "in_situ": "",
              "infection": false,
              "remarks": "",
              "total_catheter_days": "",
              "total_cauti_cases": "",
              "infection_control_nurse_signature": "",
              "date": ""
            },
            "is_form_completed": false,
            "form_completed_date_time": ""
          }
        }
      ]
    },
    "status": "end payload"
  }
}

CLABSI Bundle Callback

{
  "status": "complete",
  "data": {
    "SessionId": "143",
    "hospitalId": "9",
    "patientId": "GEN9-202605-00191",
    "OpId": "",
    "IpId": "IN-GEN9-202605-00056",
    "PractitionerId": "PR-72",
    "type": "ipd",
    "formName": "clabsi_bundle",
    "process": "clabsi_bundle",
    "structured_data": {
      "IPD_CLABSI_BUNDLE": [
        {
          "central_line_insertion": {
            "central_line_placed_in": "",
            "date_of_insertion": "26/05/2026",
            "inserted_by_name": "",
            "line_type": {
              "cvc": false,
              "dialysis_line": false,
              "other": "",
              "picc": true
            },
            "no_of_attempts": "",
            "reasons_for_insertion": "IV medications",
            "site": {
              "femoral": false,
              "internal_jugular": false,
              "subclavian": true
            },
            "time_of_insertion": "12:54 PM"
          },
          "indication_for_central_line": {
            "dialysis": true,
            "difficult_peripheral_access": false,
            "hemodynamic_monitoring": false,
            "iv_medications": true,
            "other": ""
          },
          "clabsi_bundle_compliance": {
            "all_lumens_capped": true,
            "appropriate_site_selected": false,
            "aseptic_technique_maintained": true,
            "chest_xray_done": false,
            "date_time_label_applied": false,
            "dressing_clean_dry_intact": true,
            "full_sterile_barrier_precautions_used": false,
            "hand_hygiene_performed": false,
            "informed_consent_obtained": false,
            "line_flushed_and_patent": true,
            "line_secured_properly": true,
            "patient_identity_confirmed": false,
            "procedure_documented": true,
            "review_catheter_necessity_daily_and_remove_promptly": false,
            "skin_antisepsis_with_chlorhexidine": false,
            "sterile_dressing_applied": false,
            "ultrasound_guidance_used": true
          },
          "signatures": {
            "assistant_nurse": "",
            "inserted_by": "72",
            "verified_by": ""
          },
          "daily_maintenance": [
            {
              "action_taken": "",
              "central_line_still_indicated": false,
              "chills": false,
              "date": "26/05/2026 03:04 PM",
              "day": 1,
              "dressing_change_daily": true,
              "dressing_clean_dry_intact": true,
              "fever": "",
              "hand_hygiene_before_accessing": false,
              "hand_hygiene_before_handling": false,
              "hub_port_disinfected_before_access": false,
              "line_detail_date": "26/05/2026",
              "line_secured_properly": false,
              "line_type": "",
              "local_site_infection": false,
              "no_discharge_pus": true,
              "no_redness_swelling_at_site": true,
              "nurse_name": "",
              "positive_blood_culture": false,
              "redness": false,
              "reviewed_by": "72",
              "scrub_the_hub": false,
              "site": "",
              "time": "03:04 PM",
              "tubing_cap_changed_as_per_policy": false
            },
            {
              "action_taken": "qqqq",
              "central_line_still_indicated": false,
              "chills": false,
              "date": "26/05/2026 12:54 PM",
              "day": 2,
              "dressing_change_daily": false,
              "dressing_clean_dry_intact": false,
              "fever": "43Β°C",
              "hand_hygiene_before_accessing": false,
              "hand_hygiene_before_handling": false,
              "hub_port_disinfected_before_access": false,
              "line_detail_date": "26/05/2026",
              "line_secured_properly": true,
              "line_type": "PICCdd",
              "local_site_infection": false,
              "no_discharge_pus": true,
              "no_redness_swelling_at_site": false,
              "nurse_name": "",
              "positive_blood_culture": true,
              "redness": false,
              "reviewed_by": "72",
              "scrub_the_hub": false,
              "site": "Subclavianddd",
              "time": "02:42 PM",
              "tubing_cap_changed_as_per_policy": true
            }
          ],
          "dressing_change_checklist": {
            "allowed_to_dry_completely": false,
            "date": "26/05/2026",
            "date_time_labeled": true,
            "hand_hygiene_performed": true,
            "nurse": "72",
            "old_dressing_removed_aseptically": false,
            "remarks": "",
            "signature": "",
            "site": "internal jugular",
            "site_inspected": false,
            "skin_cleaned_with_chlorhexidine": true,
            "sterile_dressing_applied": true,
            "sterile_gloves_used": false
          },
          "central_line_removal": {
            "catheter_tip_intact": true,
            "date": "26/05/2026",
            "date_of_removal": "26/05/2026",
            "doctor_nurse": "72",
            "doctors_order_verified": true,
            "hand_hygiene_performed": false,
            "hemostasis_achieved": false,
            "line_no_longer_indicated": true,
            "line_removed_using_aseptic_technique": true,
            "line_type": "",
            "others": "",
            "post_removal_monitoring": {
              "air_embolism_signs": true,
              "bleeding": false,
              "pain": false
            },
            "ppe_used": false,
            "reasons_for_removal": "",
            "removed_by": "",
            "sign": "",
            "signature": "",
            "site": "",
            "sterile_dressing_applied": true
          },
          "culture": "",
          "antibiotics": "",
          "note_time": "26/05/2026 26/05/2026 26/05/2026",
          "timestamp": "2026-05-26T09:12:36.839260+00:00",
          "interaction_id": "116320"
        }
      ]
    },
    "status": "end payload"
  }
}

Vascular Bundle Callback

{
  "status": "complete",
  "data": {
    "SessionId": "143",
    "hospitalId": "9",
    "patientId": "GUN8-202605-00012",
    "OpId": "",
    "IpId": "IN-GUN8-202605-00002",
    "PractitionerId": "PR-122",
    "type": "ipd",
    "formName": "IPD_VASCULAR_BUNDLE",
    "process": "IPD_VASCULAR_BUNDLE",
    "structured_data": {
      "IPD_VASCULAR_BUNDLE": [
        {
          "interaction_id": "116791",
          "note_time": "06:51 PM 29/05/2026",
          "timestamp": "2026-05-30T09:50:34.469184+00:00",
          "nurse_id": 122,
          "vascular_bundle": {
            "insertion_checklist_form": {
              "diagnosis": "",
              "device_details": {
                "type_of_vad": "peripheral_iv",
                "type_options": {
                  "peripheral_iv": true,
                  "picc": false,
                  "port": false
                },
                "site_selected": "Left hand",
                "date_time": "29/05/2026 06:25 PM"
              },
              "pre_insertion_checks": {
                "patient_identity_confirmed": true,
                "informed_consent_obtained": true,
                "allergy_checked": true,
                "indication_for_vad_confirmed": true,
                "hand_hygiene_performed": true,
                "prepared_sterile": true
              },
              "insertion_procedure": {
                "sterile_barrier_precautions_used": true,
                "skin_antisepsis_applied": true,
                "aseptic_technique_maintained": true,
                "correct_catheter_size_type_used": true,
                "successful_insertion": true
              },
              "post_insertion": {
                "line_flushed_and_patent": true,
                "dressing_applied_sterile": true,
                "line_secured": true,
                "label_applied_date_time": true,
                "patient_tolerated_procedure": true,
                "pain_score": ""
              },
              "signatures": {
                "inserted_by": "127",
                "verified_by": "Sonia Bai"
              },
              "patient_details": {
                "age_sex": "25/M",
                "department_ward": "GENERAL AND LAPAROSCOPIC SURGERY",
                "ip_op_no": "IN-GUN8-202605-00002",
                "name": "mr srihari"
              }
            },
            "daily_maintenance_checklist_form": {
              "type_of_vad": "peripheral_iv",
              "site": "left hand",
              "assessments": [
                {
                  "date": "29/05/2026",
                  "dressing_intact": true,
                  "hub_disinfected_before_use": false,
                  "interaction_id": "116787",
                  "line_patent_flush_working": true,
                  "note_time": "06:39 PM 29/05/2026",
                  "nurse_id": 119,
                  "pain_score": "0",
                  "redness_swelling_present": false,
                  "signature": "119",
                  "signs_of_infection": false,
                  "site_clean_dry": true,
                  "time": "06:39 PM",
                  "timestamp": "2026-05-29T13:09:55.068862+00:00",
                  "vad_still_required": true
                },
                {
                  "date": "29/05/2026",
                  "dressing_intact": true,
                  "hub_disinfected_before_use": false,
                  "interaction_id": "116791",
                  "line_patent_flush_working": true,
                  "note_time": "06:51 PM 29/05/2026",
                  "nurse_id": 122,
                  "pain_score": "0",
                  "redness_swelling_present": false,
                  "signature": "122",
                  "signs_of_infection": false,
                  "site_clean_dry": true,
                  "time": "06:51 PM",
                  "timestamp": "2026-05-29T13:21:40.064820+00:00",
                  "vad_still_required": true
                }
              ]
            },
            "vad_removal_checklist_form": {},
            "complication_report_form": {},
            "is_form_completed": false,
            "form_completed_date_time": ""
          }
        },
        {
          "interaction_id": "116783",
          "note_time": "06:23 PM 29/05/2026",
          "timestamp": "2026-05-30T09:50:34.842819+00:00",
          "nurse_id": 127,
          "vascular_bundle": {
            "insertion_checklist_form": {
              "device_details": {
                "date_time": "12/05/2026 08:27 PM",
                "site_selected": "right hand",
                "type_of_vad": "peripheral_iv",
                "type_options": {
                  "cvc": false,
                  "peripheral_iv": true,
                  "picc": false,
                  "port": false
                }
              },
              "diagnosis": "",
              "insertion_procedure": {
                "aseptic_technique_maintained": true,
                "correct_catheter_size_type_used": true,
                "skin_antisepsis_applied": true,
                "sterile_barrier_precautions_used": true,
                "successful_insertion": true
              },
              "post_insertion": {
                "dressing_applied_sterile": true,
                "label_applied_date_time": true,
                "line_flushed_and_patent": true,
                "line_secured": true,
                "pain_score": "0",
                "patient_tolerated_procedure": true
              },
              "pre_insertion_checks": {
                "allergy_checked": false,
                "hand_hygiene_performed": true,
                "indication_for_vad_confirmed": true,
                "informed_consent_obtained": true,
                "patient_identity_confirmed": false,
                "prepared_sterile": true
              },
              "signatures": {
                "inserted_by": 127,
                "verified_by": ""
              }
            },
            "daily_maintenance_checklist_form": {
              "assessments": [],
              "site": "",
              "type_of_vad": ""
            },
            "vad_removal_checklist_form": {
              "date": "29/05/2026",
              "date_of_removal": "29/05/2026",
              "nurse": 127,
              "post_removal_observation": {
                "bleeding": false,
                "pain": false,
                "swelling": false
              },
              "reason_for_removal": "bulging and pain at the site",
              "removal_checklist": {
                "catheter_venflon_removed_safely": true,
                "doctor_order_verified": false,
                "hand_hygiene_performed": true,
                "hemostasis_achieved": true,
                "others": false,
                "ppe_used": false,
                "sterile_dressing_applied": true,
                "tip_intact": true
              },
              "signature": 127,
              "site": "right hand",
              "type_of_vad": "peripheral_iv"
            },
            "complication_report_form": null,
            "is_form_completed": true,
            "form_completed_date_time": "29/05/2026 06:23 PM"
          }
        }
      ]
    },
    "status": "end payload"
  }
}

Responses:

  • 200: Data posted successfully with initial payload (when form is opened)
  • 201: Data posted successfully with final payload (when form is saved)

Session Link Types and Available Forms

IPD module responses are posted for two different session link types:

Doctor Session Link

The following forms are available when a doctor accesses via session link (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 Session Link

The following forms are available when a nurse accesses via session link (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.

1. Drug Chart

formName: "drug_chart"

Records medication prescriptions with dosage schedules, frequencies, and administration instructions.

Complete Response Structure:
{
  "status": "complete",
  "data": {
    "SessionId": "GEN9-202512-00286",
    "hospitalId": "9",
    "patientId": "GEN9-202512-00286",
    "IpId": "95535",
    "type": "ipd",
    "formName": "drug_chart",
    "process": "drug_chart",
    "response": "{\"drug_chart\":[...],\"once_only_drugs\":[...],\"iv_infusion_therapy\":[]}",
    "medication_templates": [],
    "status": "complete"
  }
}
Parsed Response Structure:
{
  "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": []
    }
  ],
  "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": []
}

2. IO Chart (Intake/Output Chart)

formName: "io_chart"

Tracks patient fluid intake (oral and parenteral) and output (urine, vomit, etc.) measurements.

Complete Response Structure:
{
  "status": "complete",
  "data": {
    "SessionId": "GEN9-202508-00394",
    "hospitalId": "9",
    "patientId": "GEN9-202508-00394",
    "IpId": "99661",
    "type": "ipd",
    "formName": "io_chart",
    "process": "io_chart",
    "response": "{\"IPD_INTAKE_OUTTAKE\":[...]}",
    "medication_templates": [],
    "status": "complete"
  }
}
Parsed Response Structure:
{
  "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": "Water",
          "oral_rt_quantity_ml": 600,
          "parenteral": "",
          "parenteral_quantity_ml": 0
        },
        {
          "oral_rt": "Tea",
          "oral_rt_quantity_ml": 250,
          "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",
      "output_description": "Urine 1050ml; Vomitus/Bowels 250ml",
      "intake_total_ml": 1450,
      "output_total_ml": 1300,
      "balance_ml": 150,
      "interaction_id": "98254"
    }
  ]
}

3. Peripheral Chart

formName: "peripheral_chart"

Documents peripheral IV line details including insertion site, date, and status.

Complete Response Structure:
{
  "status": "complete",
  "data": {
    "SessionId": "GEN9-202512-00286",
    "hospitalId": "9",
    "patientId": "GEN9-202512-00286",
    "IpId": "95535",
    "type": "ipd",
    "formName": "peripheral_chart",
    "process": "peripheral_chart",
    "response": "{\"IPD_PERIPHERAL_CHART\":[...]}",
    "medication_templates": [],
    "status": "complete"
  }
}
Parsed Response Structure:
{
  "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"
              }
            ],
            "line_removal_date": null,
            "line_removal_time": null
          }
        ],
        "notes_text": ""
      }
    }
  ]
}

4. TPR Chart (Temperature, Pulse, Respiration)

formName: "tpr_chart"

Records vital signs including temperature, pulse rate, and respiratory rate over time.

Complete Response Structure:
{
  "status": "complete",
  "data": {
    "SessionId": "403a9674-1720-499e-ad46-0c0134f845d5",
    "hospitalId": "9",
    "patientId": "ragul001",
    "IpId": "105739",
    "type": "ipd",
    "formName": "tpr_chart",
    "process": "tpr_chart",
    "response": "{\"IPD_VITALS\":[...]}",
    "medication_templates": [],
    "status": "complete"
  }
}
Parsed Response Structure:
{
  "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",
      "time": "11:40",
      "temperature": "39Β°C, 45Β°F",
      "spo2": "93%",
      "interaction_id": "104628"
    },
    {
      "date": "2026-02-02",
      "time": "11:41",
      "pulse": "120 bpm",
      "temperature": "40Β°C",
      "respiration": "180 breaths/min",
      "blood_pressure": "180 mmHg",
      "spo2": "91%",
      "interaction_id": "104629"
    }
  ]
}

5. Discharge Summary

formName: "discharge_summary"

Comprehensive summary of patient's hospital stay, diagnosis, treatment, and discharge instructions.

Complete Response Structure:
{
  "status": "complete",
  "data": {
    "SessionId": "GEN9-202509-00170",
    "hospitalId": "9",
    "patientId": "GEN9-202509-00170",
    "IpId": "105673",
    "type": "ipd",
    "formName": "discharge_summary",
    "process": "discharge_summary",
    "response": "{\"discharge_summary\":{...},\"treatment_given\":[...],\"advice_on_discharge\":{...}}",
    "medication_templates": [],
    "status": "complete"
  }
}
Parsed Response Structure:
{
  "discharge_summary": {
    "diagnosis": "Acute appendicitis; Persistent right-sided chest wall pain",
    "procedure": "",
    "reason_for_admission": "Patient presents with severe right-sided lower abdominal pain...",
    "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": ""
    },
    "abdomen": "Tenderness is present at McBurney's point with rebound tenderness. No palpable mass.",
    "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..."
  },
  "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
    }
  ],
  "advice_on_discharge": {
    "medications": [
      {
        "medication_name": "Acetaminophen",
        "medication_type": "Analgesic",
        "dosage": "650mg",
        "frequency": {
          "morning": 1,
          "afternoon": 0,
          "evening": 0,
          "night": 1
        },
        "duration": "3 days"
      }
    ],
    "general_advice": "Patient is advised to continue walking...",
    "diet": "Normal diet, no dietary restrictions required.",
    "follow_up": "Patient should follow up in five days..."
  }
}

6. Progress Notes

formName: "progress_notes"

Daily progress notes documenting patient condition, treatment response, and plan updates.

Complete Response Structure:
{
  "status": "complete",
  "data": {
    "SessionId": "GEN9-202509-00170",
    "hospitalId": "9",
    "patientId": "GEN9-202509-00170",
    "IpId": "105673",
    "type": "ipd",
    "formName": "progress_notes",
    "process": "progress_notes",
    "response": "{\"patientInfo\":{...},\"progressNotes\":[...]}",
    "medication_templates": [],
    "status": "complete"
  }
}
Parsed Response Structure:
{
  "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"
    }
  ]
}

7. Doctor Initial Assessment

formName: "doctor_initial_assessment"

Initial assessment performed by the doctor upon patient admission.

Complete Response Structure:
{
  "status": "complete",
  "data": {
    "SessionId": "GEN9-202509-00170",
    "hospitalId": "9",
    "patientId": "GEN9-202509-00170",
    "IpId": "101142",
    "type": "ipd",
    "formName": "doctor_initial_assessment",
    "process": "doctor_initial_assessment",
    "response": "Chief Complaints:* Patient presents with persistent right-sided chest wall pain...",
    "medication_templates": [],
    "status": "complete"
  }
}
Parsed Response Structure:
{
  "status": "complete",
  "data": {
    "SessionId": "GEN9-202509-00170",
    "hospitalId": "9",
    "patientId": "GEN9-202509-00170",
    "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
      }
    ],
    "additional_response": null,
    "status": "initial payload"
  }
}

8. Surgery Notes

formName: "surgery_notes"

Documentation of surgical procedures including pre-operative, intra-operative, and post-operative details.

Complete Response Structure:
{
  "status": "complete",
  "data": {
    "SessionId": "GEN9-202509-00170",
    "hospitalId": "9",
    "patientId": "GEN9-202509-00170",
    "IpId": "105673",
    "type": "ipd",
    "formName": "surgery_notes",
    "process": "surgery_notes",
    "response": "{\"pre_operative_diagnosis\":\"...\",\"post_operative_diagnosis\":\"...\",...}",
    "medication_templates": [],
    "status": "complete"
  }
}
Parsed Response Structure:
{
  "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"
}

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. Refer to the Doctor Session Link Forms section above for complete documentation of these shared forms.

5. Nurse Care Plan

formName: "nurse_care_plan"

Nursing care plan documenting patient care activities, observations, and interventions.

Complete Response Structure:
{
  "status": "complete",
  "data": {
    "SessionId": "GEN9-202602-00044",
    "hospitalId": "9",
    "patientId": "GEN9-202602-00044",
    "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": [],
    "status": "complete"
  }
}
Parsed Response Structure:
## 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.

6. Nurse Notes

formName: "nurse_notes"

Detailed nursing notes including special observations, care given, and patient status updates.

Complete Response Structure:
{
  "status": "complete",
  "data": {
    "SessionId": "403a9674-1720-499e-ad46-0c0134f845d5",
    "hospitalId": "9",
    "patientId": "ragul001",
    "IpId": "105583",
    "type": "ipd",
    "formName": "nurse_notes",
    "process": "nurse_notes",
    "response": "{\"special_notes\":{...},\"care_given\":{...}}",
    "medication_templates": [],
    "status": "complete"
  }
}
Parsed Response Structure:
{
  "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. Output: Urine clear 1050 ml, Vomit noted 250 ml. Medications administered: AZITHROMYCIN ORAL SUSPENSION IP 100 MG 100 ml IV, METRONIDAZOLE (200MG/5ML) 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. 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%."
      }
    }
  },
  "care_given": {
    // Additional care documentation
  }
}

7. Nurse Initial Assessment

formName: "nurse_initial_assessment"

Initial nursing assessment performed upon patient admission.

Complete Response Structure:
{
  "status": "complete",
  "data": {
    "SessionId": "GEN9-202509-00170",
    "hospitalId": "9",
    "patientId": "GEN9-202509-00170",
    "IpId": "105673",
    "type": "ipd",
    "formName": "nurse_initial_assessment",
    "process": "nurse_initial_assessment",
    "response": "{\"basicInformation\":{...},\"functionalAssessment\":{...},\"nutritionalAssessment\":{...}}",
    "medication_templates": [],
    "status": "complete"
  }
}
Parsed Response Structure:
{
  "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.",
    "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
  }
}