Task #63
openDoctor Module – Consultation Save & Print
0%
Description
Task Description:
Implement backend data persistence for the Doctor Consultation page to support the Save & Print functionality, using the exact tables and entities defined in the provided design.This task ensures that consultation data (diagnosis, prescription, and pre-consultation values) is properly stored, retrieved, and printable.
- patient_consultation
Purpose: Store the main consultation record.
Fields to handle:
consultation_id (PK)
hospital_id (INT)
patient_id (INT)
visit_id (INT)
consult_by (user_id(doctor) from session)
investigation (TEXT)
chief_complaints (TEXT)
internal_notes (TEXT)
consultation_fee (DOUBLE)
consult_date (DATETIME)
Rules:
One consultation per visit
Created when doctor clicks Save
- patient_consultation_diagnosis
Purpose: Store selected diagnoses for the consultation.
Fields to handle:
id (PK)
hospital_id (INT)
consultation_id (INT)
diagnosis_id (INT)
Rules:
Multiple diagnoses allowed
Prevent duplicate diagnosis per consultation
- patient_consultation_prescription
Purpose: Store prescribed medicines for the consultation.
Fields to handle:
id (PK)
hospital_id (INT)
consultation_id (INT)
prescription_id (INT)
Rules:
Multiple prescriptions allowed per consultation
Linked to Prescription Master
- patient_preconsultation_values
Purpose: Store pre-consultation values associated with the consultation.
Fields to handle:
id (PK)
hospital_id (INT)
consultation_id
pre_con_id
Rules:
Values are visit-specific
Used for consultation view and printing
Functional Requirements:
Save consultation data when doctor clicks Save
Persist diagnosis, prescription, and pre-consultation values
Fetch stored data for Print
Ensure all records are linked using consultation_id
Enforce hospital-level data isolation using hospital_id
Validations:
Prevent saving multiple consultations for the same visit
Disable save operation during API execution
Show success or error response accordingly(minimal)
Completion Criteria:
Consultation data is saved correctly in all related tables
Data is consistent across refresh and re-login
No cross-hospital data leakage