Multi-source Outpatient JSON: every key explained

Reference for the supplied multiple-doctor, one-patient recording response. Reviewed 11 November 2026. Types and examples describe this response; they are not a complete validation schema for every possible server result.

Original outpatient key reference ? Multi-source integration guide ? Recording tester

How to read this document

First parse the WebSocket frame with JSON.parse(event.data), then parse message.allData.processedText. The result is one clinical object for the shared consultation, not one object per microphone.

assessment[].doctor_id means the key in every investigation row. Empty text "", empty arrays [], null, boolean false, and string "0" have different meanings. A heading-only narrative contains no clinical details. Preserve returned types and Markdown text such as **Diagnosis:**.

socket.addEventListener("message", ({ data }) => {
  const message = JSON.parse(data);
  if (message.type !== "session.processed") return;
  const clinical = JSON.parse(message.allData.processedText);
  console.log(clinical.assessment);
  console.log(clinical.medication_templates);
  // Render returned text using textContent or a sanitized Markdown renderer.
});

Every WebSocket response envelope key

The clinical keys below are inside allData.processedText; the session and result metadata stay outside that string.

KeyType in samplePurpose and sample meaning
typestringMessage kind. session.processed identifies the final processed-result event.
session_idstringShared consultation session ID originally sent by all sources.
interaction_idstringCreated interaction identifier. String "154679" in this sample.
statusstringProcessing state. processed means the final payload is available.
allDataobjectResult envelope containing clinical output and interaction metadata.

Every key in allData

KeyType in samplePurpose and sample meaning
workflow_request_idnullWorkflow correlation identifier when supplied. null in this response.
interaction_idstringInteraction identifier repeated inside the envelope. String "154679" here.
user_idnullUser identifier when supplied. null in this response.
doctor_idnumberInternal doctor identifier for the interaction. Number 143 in this response; not an array of all connected doctors.
organization_idnumberInternal organization identifier. Number 9 in this response.
attachment_urlstringCloud-storage URI for the processed output text file. Not a direct HTTP download link.
processedTextstringJSON-encoded string containing all clinical fields documented below. Parse this string after parsing the outer frame.
funct_namenullFunction metadata when supplied. null here; preserve this exact returned key spelling.
interaction_typestringOutput interaction type. get-opd in this response.
textingestIntractionnullText-ingestion metadata when supplied. null here; preserve the exact returned spelling rather than renaming it.

Doctor attribution in a multi-source consultation

Each doctor connects with a unique source_id and their own practitioner_id. Exactly one source declares primary_practitioner_id. Source IDs identify audio connections; they are not doctor identifiers.

Read attribution per row: Investigation and medication objects carry doctor_id, practitioner_id, and doctor_name. In this supplied response all investigation and medication rows identify practitioner 1001. The sample does not demonstrate rows attributed to a second doctor. Do not create a row for every connected doctor or infer that a missing row means a doctor never joined.

Keep row attribution when displaying, editing, grouping, or forwarding orders. Do not replace every row?s identifiers with the current viewer?s ID. cross_dr_id and admission_dr_id are referral selections, not the participant roster. Use WebSocket session.state.sources to inspect the recording sources.

All 34 top-level keys in processedText

These are the keys in the decoded clinical object, in the same order as the supplied response.

KeyType in samplePurpose and sample meaning
chief_complaintsstringMain reasons for the visit. This sample describes abdominal pain with headache and a two-day duration.
history_of_presenting_illnessstringNarrative of symptom onset, progression, recurrence, associated symptoms, and reported negatives. This sample describes abdominal pain, intermittent headache, fatigue, dehydration, and nausea/vomiting sensations.
past_medical_historystringPrior illnesses, operations, and relevant history. This sample records appendectomy, hypertension, and hypothyroidism.
past_medicationsstringMedicines taken before this consultation. Separate from new prescription rows; the sample mentions antihypertensive treatment and Dolo.
personal_historystringLifestyle and personal history. This sample describes prolonged sitting, screen time, and limited exercise.
obstetric_historystringPregnancy and childbirth history. The sample supplies only a heading; no details are provided.
examination_findingsstringRecorded examination observations. Obesity is mentioned in this sample.
procedurestringProcedure narrative. Heading only; it does not establish that any planned procedure was performed.
investigationsstringNarrative investigation text. Heading only here, while structured investigation orders appear in assessment[]. Keep those two representations distinct.
diagnosisstringNarrative diagnostic text. The sample lists abdominal pain, migraine, dehydration, and obesity. Separate from ICD-coded diagnosis rows.
recommendationsstringRecorded general advice. The sample describes walking breaks and exercise advice; retain the supplied text.
dietstringRecorded dietary and hydration advice. The sample describes ORS, vegetables, fiber, and avoiding oily foods.
follow_upstringNarrative review advice: review after one week. Separate from the structured followup_date and followup_time fields.
planstringPlanned management and investigations. The sample mentions MRI and ultrasound evaluation. Narrative alone does not establish an appointment or completed test.
continue_current_medicationsbooleanMedication-continuation metadata. false is supplied; it must not be converted into an instruction to stop every medicine. The original reference does not establish direct consumption by the outpatient form.
omit_medicationsnullMedication-omission metadata. null means no omission information is supplied; this sample does not define a non-null schema.
assessmentarrayStructured investigation orders. Two rows are supplied: MRI and Ultrasound scan. Each row includes doctor attribution; see every child key below.
medication_templatesarrayPrescription rows. Two objects describe Emeset and Thyronorm. Both include doctor attribution and use the same 28 child keys in this sample.
blood_borneobjectObject with seven infection-related entries. All are null; no positive or negative results are supplied.
drug_allergiesarrayDrug-allergy rows. Empty in this sample; this is not confirmation of no drug allergies.
food_allergiesarrayFood-allergy rows. Empty in this sample; no item schema can be inferred from the response alone.
other_allergiesarrayOther allergy rows. Empty in this sample; see the existing reference for supported form row fields.
vitalsarrayStructured vital-sign rows. Empty here; no measurements are supplied. Do not substitute bp_apparatus_required for this array.
detected_languagestringDetected spoken-language metadata, supplied as a Markdown-labelled string containing ta (Tamil), rather than a bare language code.
family_history_notesstringRelevant family medical history. The sample contains only a heading, so no history details are supplied.
additional_responsestringAdditional/canonical assessment narrative. Empty here. The original reference explains that the form formatter can consume this field; the separate top-level narratives are not automatically concatenated by that fallback.
phonetic_uristringCloud-storage reference for medication-correction CSV data. A gs:// URI is not a direct browser download URL and is separate from allData.attachment_url.
icd_diagnosisarrayStructured coded-diagnosis rows. Empty here; no ICD codes are supplied.
diagnosis_free_textstringUncoded diagnosis text for the ICD workflow. Empty here; separate from the populated diagnosis narrative.
cross_dr_idarrayCross-referral/opinion doctor selections. Empty here. This is not the roster of doctors connected to the audio session.
admission_dr_idarrayAdmission-referral doctor selections. Empty here. This does not identify every doctor contributing to the consultation.
followup_datenullStructured follow-up appointment date. null means no date is supplied, even though follow_up contains review advice.
followup_timestringStructured follow-up time, supplied as 00:00. Without a date this does not establish a midnight appointment.
bp_apparatus_requiredobjectDedicated current-value object for the BP/cardiology table: bp, hba1c, ldl, and basic_activity. All are null in this response; the object name does not make its children boolean equipment flags.

Every field in assessment[]

Two investigation objects are supplied: MRI and Ultrasound scan. Each has 12 keys. Null template metadata does not remove the test name or doctor attribution.

KeyType in samplePurpose and sample meaning
assessment_templatenullInvestigation-template metadata. null in both rows; the sample does not establish a populated structure.
template_testsstringInvestigation/test name. The two values are MRI and Ultrasound scan.
template_idnullInvestigation-template identifier when available. null in both rows.
template_typenullTemplate classification when available. null in both rows; no allowed non-null values are established by this sample.
hospital_idnullHospital identifier attached to this investigation row. null in both rows; use the session/envelope context separately.
remarksstringInvestigation remarks or preparation instructions. Empty text in both rows.
active_fromnullStart of the investigation entry?s active period, when supplied. null in both rows; no date-format claim is made from these null values.
active_tonullEnd of the investigation entry?s active period, when supplied. null in both rows.
is_activebooleanActivity flag for the investigation entry. true in both rows; this is not a completed-test or test-result flag.
doctor_idstringInternal CareScribe doctor identifier. Supplied as the string "143" in each row; allData.doctor_id is the number 143. Keep the returned representation when forwarding the payload.
practitioner_idstringExternal/hospital practitioner identifier associated with this row. Supplied as "1001". Different from source_id, which identifies an audio connection.
doctor_namestringDoctor display name associated with this row. This sample uses Dr Ragul Palanisamy. Use identifiers for matching rather than the name.

Every field in medication_templates[]

The two medication objects contain 28 keys each. Preserve row-specific schedules, quantities, dates, and attribution.

KeyType in samplePurpose and sample meaning
medication_namestringFormatted/display medication name. The sample contains (EMESET 2MG TABLET) and THYROXINE SODIUM 25MCG (THYRONORM 25MCG TABLET).
medication_typestringDosage form. Tablet in both rows.
dosagestringDose/strength text as supplied: 2 mg and 25 mcg. Retain alongside dosage_value and unit; do not derive an administration amount from strength alone.
routestringAdministration route. Oral in both rows.
frequency_morningstringMorning schedule slot. String "1" in both rows; preserve as a string rather than a boolean.
frequency_afternoonstringAfternoon schedule slot. String "0" in both rows.
frequency_eveningstringEvening schedule slot. String "0" in both rows.
frequency_nightstringNight schedule slot. String "1" for Emeset and "0" for Thyronorm. Slot values can carry amount/unit text in other responses.
durationstringTreatment-duration text. "3 days" for Emeset; empty for Thyronorm, meaning no duration is supplied in that row.
instructionsstringAdditional administration instructions. "after food" for Emeset; empty for Thyronorm.
when_to_takestringMeal-related timing. "after food" for Emeset; empty for Thyronorm. Separate from time-of-day slots.
vaccinebooleanWhether this is a vaccine row. false for both.
is_statbooleanImmediate/stat-dose flag. false for both.
is_once_onlybooleanOne-time-dose flag. false for both.
is_sosbooleanAs-needed/SOS flag. false for both.
quantitynumber | nullSupplied dispensing quantity. Number 6 for Emeset; null for Thyronorm. Do not substitute zero for the null quantity.
medication_start_datestringPrescription start date in this sample: 11/11/2026 (11 November 2026), using day/month/year.
medication_end_datestringPrescription end date: 13/11/2026 for Emeset; empty text for Thyronorm. Keep an unspecified end date distinct from a supplied date.
doctor_idstringInternal CareScribe doctor identifier. Supplied as the string "143" in each row; allData.doctor_id is the number 143. Keep the returned representation when forwarding the payload.
actual_medication_namestringRetained original/acquired name used in editing and correction workflows: emeset 2mg tablet and Thyronorm.
auto_correctbooleanMedication-correction/editor metadata. false for both; this alone does not establish clinical verification.
brand_namestringStructured brand/product name: emeset 2mg tablet and THYRONORM 25MCG TABLET.
generic_namestringStructured generic ingredient name. Empty for Emeset and THYROXINE SODIUM 25MCG for Thyronorm. Empty does not mean no active ingredient exists.
med_from_llmbooleanMedication-list/review flag used for editor highlighting. true for Emeset and false for Thyronorm. The existing reference describes true as a medicine outside the medication list requiring doctor review.
dosage_valuestringNumeric portion of the dosage, returned as a string: "2" and "25". Used together with unit.
unitstringUnit for dosage_value: mg and mcg. Preserve the distinction between milligrams and micrograms.
practitioner_idstringExternal/hospital practitioner identifier associated with this row. Supplied as "1001". Different from source_id, which identifies an audio connection.
doctor_namestringDoctor display name associated with this row. This sample uses Dr Ragul Palanisamy. Use identifiers for matching rather than the name.

Every field in blood_borne

All seven values are null. This sample does not establish the non-null result schema or any positive/negative finding.

KeyType in samplePurpose and sample meaning
hivnullHuman immunodeficiency virus-related status/result metadata.
hcvnullHepatitis C virus-related status/result metadata.
hbvnullHepatitis B virus-related status/result metadata.
syphilisnullSyphilis-related status/result metadata.
htlvnullHuman T-lymphotropic virus-related status/result metadata.
malarianullMalaria-related status/result metadata.
cmvnullCytomegalovirus-related status/result metadata.

Every field in bp_apparatus_required

This is a dedicated current-value object, separate from vitals[]. The form helper reads strings and finite numbers from this object and shows null values as empty cells. It does not fill these values from vitals or top-level aliases.

KeyType in samplePurpose and sample meaning
bpnullBlood-pressure current value for the dedicated table. null here, so no measurement is supplied.
hba1cnullHbA1c current value for the dedicated table. null here; no value or unit is supplied by this sample.
ldlnullLDL-cholesterol current value for the dedicated table. null here; no value or unit is supplied by this sample.
basic_activitynullDaily physical-activity current value for the dedicated table. null here; no activity duration is supplied.

Arrays with no supplied rows

The sample has empty drug_allergies, food_allergies, other_allergies, vitals, icd_diagnosis, cross_dr_id, and admission_dr_id arrays. There are no child keys to enumerate from these sample arrays. Empty arrays do not establish negative clinical findings.

The existing reference documents the form-supported fields when these arrays are populated: vitals, ICD diagnoses, referrals, and allergies. Those definitions describe supported form data, not additional values present in this response.

Full parsed processedText sample

This is the clinical object after the second JSON parse. The integration guide contains the full outer response with the escaped string.

Show all decoded clinical fields
{
  "chief_complaints": "**Chief Complaints:** **Abdominal pain** with headache, **Abdominal pain** for 2 days.",
  "history_of_presenting_illness": "**History of Presenting Illness:** Patient reports experiencing **abdominal pain** associated with **headache (migraine-like)**, fatigue, dehydration, and nausea/vomiting sensations. No cold or cough reported. Abdominal pain has been persistent for the past 2 days; previously occurred once weekly. Headaches occur intermittently with abdominal pain, sometimes accompanied by vomiting, though no active vomiting currently.",
  "past_medical_history": "**Past Medical History:** **Status post Appendectomy** 3 years ago at Leo Hospital, **Hypertension** for 2 years on medication, **Hypothyroidism** on treatment.",
  "past_medications": "**Past Medications:** Antihypertensive medication, **Tab. Dolo 650 mg** weekly once.",
  "personal_history": "**Personal History:** Patient has prolonged sitting and reduced physical mobility. Works in IT with daily screen time of 12 hours on laptop and 2 hours on phone (14–16 hours total), with no walking or physical exercise routine.",
  "obstetric_history": "**Obstetric History:** ",
  "examination_findings": "**Examination Findings:** Patient is noted to have **obesity**.",
  "procedure": "**Procedure:** ",
  "investigations": "**Investigations:** ",
  "diagnosis": "**Diagnosis:** **Abdominal pain, Migraine, Dehydration, Obesity**",
  "recommendations": "**Recommendations:** Advised to take a 5-minute walk every 30 minutes to maintain body mobility. Recommended morning walking, mild exercises, and 20–30 minutes of daily cardio.",
  "diet": "**Diet:** Advised to take ORS sachet mixed in 150 ml of warm water to maintain hydration. Advised to consume a high-fiber diet, plenty of vegetables, and avoid oily foods.",
  "follow_up": "**Follow-up:** Review after 1 week.",
  "plan": "**Plan:** Advised to undergo an MRI scan and an ultrasound scan for evaluation.",
  "continue_current_medications": false,
  "omit_medications": null,
  "assessment": [
    {
      "assessment_template": null,
      "template_tests": "MRI",
      "template_id": null,
      "template_type": null,
      "hospital_id": null,
      "remarks": "",
      "active_from": null,
      "active_to": null,
      "is_active": true,
      "doctor_id": "143",
      "practitioner_id": "1001",
      "doctor_name": "Dr Ragul Palanisamy"
    },
    {
      "assessment_template": null,
      "template_tests": "Ultrasound scan",
      "template_id": null,
      "template_type": null,
      "hospital_id": null,
      "remarks": "",
      "active_from": null,
      "active_to": null,
      "is_active": true,
      "doctor_id": "143",
      "practitioner_id": "1001",
      "doctor_name": "Dr Ragul Palanisamy"
    }
  ],
  "medication_templates": [
    {
      "medication_name": "(EMESET 2MG TABLET)",
      "medication_type": "Tablet",
      "dosage": "2 mg",
      "route": "Oral",
      "frequency_morning": "1",
      "frequency_afternoon": "0",
      "frequency_evening": "0",
      "frequency_night": "1",
      "duration": "3 days",
      "instructions": "after food",
      "when_to_take": "after food",
      "vaccine": false,
      "is_stat": false,
      "is_once_only": false,
      "is_sos": false,
      "quantity": 6,
      "medication_start_date": "11/11/2026",
      "medication_end_date": "13/11/2026",
      "doctor_id": "143",
      "actual_medication_name": "emeset 2mg tablet",
      "auto_correct": false,
      "brand_name": "emeset 2mg tablet",
      "generic_name": "",
      "med_from_llm": true,
      "dosage_value": "2",
      "unit": "mg",
      "practitioner_id": "1001",
      "doctor_name": "Dr Ragul Palanisamy"
    },
    {
      "medication_name": "THYROXINE SODIUM 25MCG (THYRONORM 25MCG TABLET)",
      "medication_type": "Tablet",
      "dosage": "25 mcg",
      "route": "Oral",
      "frequency_morning": "1",
      "frequency_afternoon": "0",
      "frequency_evening": "0",
      "frequency_night": "0",
      "duration": "",
      "instructions": "",
      "when_to_take": "",
      "vaccine": false,
      "is_stat": false,
      "is_once_only": false,
      "is_sos": false,
      "quantity": null,
      "medication_start_date": "11/11/2026",
      "medication_end_date": "",
      "doctor_id": "143",
      "actual_medication_name": "Thyronorm",
      "auto_correct": false,
      "brand_name": "THYRONORM 25MCG TABLET",
      "generic_name": "THYROXINE SODIUM 25MCG",
      "med_from_llm": false,
      "dosage_value": "25",
      "unit": "mcg",
      "practitioner_id": "1001",
      "doctor_name": "Dr Ragul Palanisamy"
    }
  ],
  "blood_borne": {
    "hiv": null,
    "hcv": null,
    "hbv": null,
    "syphilis": null,
    "htlv": null,
    "malaria": null,
    "cmv": null
  },
  "drug_allergies": [],
  "food_allergies": [],
  "other_allergies": [],
  "vitals": [],
  "detected_language": "**detected_language:** ta",
  "family_history_notes": "**Family History:** ",
  "additional_response": "",
  "phonetic_uri": "gs://medscribe-dev/9/GENERAL AND LAPAROSCOPIC SURGERY/153/medication_autocorrect.csv",
  "icd_diagnosis": [],
  "diagnosis_free_text": "",
  "cross_dr_id": [],
  "admission_dr_id": [],
  "followup_date": null,
  "followup_time": "00:00",
  "bp_apparatus_required": {
    "bp": null,
    "hba1c": null,
    "ldl": null,
    "basic_activity": null
  }
}

Implementation references

The layout follows the original outpatient reference. The multi-source init and per-source metadata are implemented in Backend/src/transports/audio-websocket.ts. Dedicated BP table value handling is defined in Frontend/src/pages/OPD/forms/doctor/forms/OutpatientDataTemplate/bpApparatus.ts. Medication editing and investigation-template handling live in the adjacent OutpatientMedicationEditorSection.tsx, medicationNameChanges.ts, and OutpatientDataTemplate.tsx modules.