1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203
|
#include <iostream>
#include <fstream>
#include<conio.h>
#include<cstring>
#include<string.h>
using namespace std;
string lname, fname, mname, lname2, fname2, mname2, contact, disease, consult, department, ward, blood, slname,sfname, smname;
char gender;
int age, month, day, year, month2, day2, year2, height, weight, room, bed, hour, minutes;
int main();
{
int register()
{
cout<<"\n\t\t--------------- ISKOPITAL ------------------"<<endl;
cout<<"\n\t\t-------------REGISTER THE PATIENT-----------"<<endl;
cout<<" Patient name"<<endl;
cout<<" \tLast Name:";
cin>>lname;
cout<<" \tFirst Name:";
cin>>fname;
cout<<" \tMiddle Name:";
cin>>mname;
cout<<" \n\t\tAge:";
cin>>age;
cout<<" \n\tGender [F/M]:";
cin>>gender;
cout<<" \n\tWeight [kg]:";
cin>>weight;
cout<<" \n\tHeight [cm]:";
cin>>height;
cout<<" \n\tBlood Type:";
cin>>blood;
cout<<" \n\tDate of Birth";
cout<<" \n\t\t\tMonth:";
cin>>month;
cout<<" \tDay:";
cin>>day;
cout<<" \tYear:";
cin>>year;
cout<<" \n\tContact No.:";
cin>>contact;
cout<<" \n\tMedical History";
cout<<" \n\t\t\tDisease:";
cin>>disease;
cout<<" \n\tAppointment Details";
cout<<" \n\t\t\tConsultation type:";
cin>>consult;
cout<<" \tDepartment:";
cin>>department;
cout<<" \tConsultant Doctor";
cout<<" \n\t\t\t\tLast Name:";
cin>>fname2;
cout<<" \tFirst Name:";
cin>>lname2;
cout<<" \tMiddle Name:";
cin>>mname2;
cout<<" \n\tDate of Admission";
cout<<" \n\t\t\tMonth:";
cin>>month2;
cout<<" Day:";
cin>>day2;
cout<<" Year:";
cin>>year2;
cout<<" \n\tTime of Admission";
cout<<" \n\t\t\tHour:";
cin>>hour;
cout<<" \tMinutes:";
cin>>minutes;
cout<<" \n\tWard Type [Public/Private]:";
cin>>ward;
cout<<" \n\tRoom No.:";
cin>>room;
cout<<" \n\tBed No.:";
cin>>bed;
}
ofstream H("D:\\example.txt",ios::ate|ios::trunc);
if (H.is_open())
{
H<<"\n\t\t--------------- ISKOPITAL ------------------"<<endl;
H<<"\n\t\t-------------REGISTER THE PATIENT-----------"<<endl;
H<<"----------------------------------------------------------------------"<<endl;
H<<"| Patient Name :"<< lname <<" "<< fname <<" "<< mname <<endl;
H<<"| Age :"<<age<<endl;
H<<"| Gender :"<<gender<<endl;
H<<"| Weight :"<<weight<<endl;
H<<"| Height :"<<height<<endl;
H<<"| Blood Type :"<<blood<<endl;
H<<"| Date of Birth :"<< month <<" "<< day <<" "<< year <<" "<<endl;
H<<"| Contact No. :"<<contact<<endl;
H<<"| Disease :"<<disease<<endl;
H<<"| Consultation Type :"<<consult<<endl;
H<<"| Department :"<<department<<endl;
H<<"| Consultant Doctor :"<< lname2 <<" "<< fname2 <<" "<< mname2 <<endl;
H<<"| Date of Admission :"<< month2 <<" "<< day2 <<" "<< year2 <<" "<<endl;
H<<"| Time of Admission :"<< hour <<":"<< minutes <<endl;
H<<"| Ward Type :"<<ward<<endl ;
H<<"| Room No. :"<<room<<endl;
H<<"| Bed No. :"<<bed<<endl;
H<<"----------------------------------------------------------------------";
H.close();
}
else cout << "Unable to open file";
getch();
return 0;
int search()
{
Cout<<"Enter Patient first name: ";
cin>> fname;
Cout<<"Last name: ";
cin>>lname;
cout<<"age: ";
ifstream H("example.txt");
while (H)
{
getline(H, wfname, ';');
getline(H, wlname, ';');
getline(H, wname,';');
getline(H,wheight,';');
getline(H,wweight,';');
getline(H,wblood,';');
getline(H,wdbirth,';');
getline(H,wcontact,';');
getline(H,wdisease,';');
getline(H,wconsulttype,';');
getline(H,wdepartment,';');
getline(H,wconsultdoc,';');
getline(H,wdadmission,';');
getline(H,wtadmission,';');
getline(H,wwardtype,';');
getline(H,wroomno,';');
getline(H,wbedno,';');
getline(H,example);
if (wfname==fname && wlname==wlname && wage==age)
{
insert whatever
return 0;
}
}
cout<<"no rec found";
}
int release()
{
cout<<"\n\t\t--------------- ISKOPITAL ------------------"<<endl;
cout<<"\n\t\t-------------INFORMATION TO BE RELEASED-----------"<<endl;
cout<<" Patient name"<<endl;
cout<<" \tLast Name:";
cin>>lname;
cout<<" \tFirst Name:";
cin>>fname;
cout<<" \tMiddle Name:";
cin>>mname;
cout<<" \n\t\Medical Record:";
cin>>record;
cout<<" \n\tX-ray Record:";
cin>>xray;
cout<<" \n\tPhysical Theraphy:";
cin>>theraphy;
cout<<" \n\tLab/Pathology slides:";
cin>>slides;
cout<<" \n\tEmergency Record:";
cin>>emergency;
cout<<" \n\tNeuro/Sleep Studies:";
cin>>studies;
cout<<" \n\tCardilogy:";
cin>>cardiology;
cout<<" \n\tSpecify Dates of treatment";
cout<<" \n\t\t\tMonth:";
cout<<" Day:";
cin>>day;
cout<<" Year:";
cin>>year;
cout<<" \n\tPayment:";
ofstream H("D:\\example2.txt",ios::ate|ios::trunc);
if (H.is_open())
{
H<<"\n\t\t--------------- ISKOPITAL ------------------"<<endl;
H<<"----------------------------------------------------------------------"<<endl;
H<<"| Patient Name :"<< lname <<" "<< fname <<" "<< mname <<endl;
H<<"| Medical Record :"<< record <<endl;
H<<"| X-ray Record :"<< xray <<endl;
H<<"| Physical Theraphy :"<< theraphy <<endl;
H<<"| Lab/ Pathology Slides :"<< slides << endl;
H<<"| Emergency Record :"<< emergency <<endl;
H<<"| Neuro/Sleep Studies :"<< studies <<endl;
H<<"| Cardiology :"<< cardiology <<endl;
H<<"| Date of Treatment :"<< month <<" "<< day <<" "<< year <<" "<<endl;
H<<"----------------------------------------------------------------------";
H.close();
}
else cout << "Unable to open file";
getch();
return 0;
}
}
|