Hospital Management System - Io
Hospital Management System - Io
PROGRAM
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main() {
// Add Patient
scanf("%d", &patient_id);
scanf("%s", patient_name);
scanf("%s", patient_medical_history);
// Display Patients
printf("\nPatients:\n");
printf("ID: %d, Name: %s, Medical History: %s\n", patient_id, patient_name, patient_medical_history);
// Schedule Appointment
scanf("%d", &appointment_id);
scanf("%d", &appointment_patient_id);
scanf("%d", &appointment_doctor_id);
printf("Enter date: \n");
scanf("%s", appointment_date);
scanf("%s", appointment_time);
// Display Appointments
printf("\nAppointments:\n");
printf("ID: %d, Patient ID: %d, Doctor ID: %d, Date: %s, Time: %s\n", appointment_id, appointment_patient_id,
appointment_doctor_id, appointment_date, appointment_time);
// Generate Bill
scanf("%d", &patient_id);
scanf("%d", &doctor_fee);
scanf("%d", &room_charge);
scanf("%d", &lab_charge);
scanf("%d", &medicine_charge);
printf("Generating bill...\n");
return 0;
}
OUTPUT
Patients:
23
Enter date:
2.3.25
Enter time:
12:32
Appointments:
ID: 1, Patient ID: 2, Doctor ID: 23, Date: 2.3.25, Time: 12:32
Generating bill...
Patient ID: 1
ALGORITHM
1. Add Patient:
2. Display Patient:
3. Schedule Appointment:
Input appointment ID, patient ID, doctor ID, date, and time.
4. Display Appointment:
5. Generate Bill:
Calculate total.
Print bill.
6. End Program
PSEDOCODE
1. Add Patient:
- Read patient_id
- Read patient_name
- Read patient_medical_history
2. Display Patient:
- Print "\nPatients:\n"
- Print "ID: patient_id, Name: patient_name, Medical History: patient_medical_history"
3. Schedule Appointment:
- Read appointment_id
- Read appointment_patient_id
- Read appointment_doctor_id
- Read appointment_date
- Read appointment_time
4. Display Appointment:
- Print "\nAppointments:\n"
- Print "ID: appointment_id, Patient ID: appointment_patient_id, Doctor ID: appointment_doctor_id, Date:
appointment_date, Time: appointment_time"
5. Generate Bill:
- Read patient_id
- Read doctor_fee
- Read room_charge
- Read lab_charge
- Read medicine_charge
6. End Program: