Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
#include<conio.h>
#include<string.h>
#include<stdlib.h>
struct patient
int rand();
string firstname;
string lastname;
string problem;
int IDN;
int age;
char blood[5];
char gender;
patient*next;
int r;
};
class linkedqueue
{
patient *head,*last;
public:
head=NULL;
last=NULL;
patient input();
void insertatend();
void insertatbeg();
void getpatientout();
void listofpatients();
int search(int);
char departmentname[50];
};
if(head==NULL)
return false;
else
int flag=0;
patient*p=new patient();
p=head;
while( p->next!=NULL && p->ID!=item )
p=p->next;
if(p->ID==item)
flag=1;
return true;
if(flag==0)
return false;
int readnumber()
char b[20];
cin.getline(b, sizeof(b));
return atoi(b);
int flag=0;
int r,IDN;
srand(time(0));
r = rand();
IDN=r;
getline(cin,p->firstname);
getline(cin,p->lastname);
again :
cin>>p->blood;
if((strcmp(p->blood,"A+")==0)||(strcmp(p->blood,"a+")==0)||(strcmp(p->blood,"A-
")==0)||(strcmp(p->blood,"a-")==0)||
(strcmp(p->blood,"B+")==0)||(strcmp(p->blood,"b+")==0)||(strcmp(p->blood,"B-
")==0)||(strcmp(p->blood,"b-")==0)||
(strcmp(p->blood,"O+")==0)||(strcmp(p->blood,"o+")==0)||(strcmp(p->blood,"O-
")==0)||(strcmp(p->blood,"o-")==0)||
(strcmp(p->blood,"AB+")==0)||(strcmp(p->blood,"ab+")==0)||(strcmp(p->blood,"AB-
")==0)||(strcmp(p->blood,"ab-")==0))
flag=1;
if(flag==0)
goto again;
cin>>p->gender;
cout<< "\tAge : ";
cin>>p->age;
cin>>p->problem;
cin>>p->IDN;
cin>>p->ID;
if(search(p->ID))
p->ID=0;
return *p;
cout<<"\n\t**********************************";
cout<<"\n\tGender : "<<p->gender;
cout<<"\n\tAge : "<<p->age;
cout<<"\n\tBlood Group : "<<p->blood;
cout<<"\n\tProblem : "<<p->problem;
cout<<"\n\n\t**********************************";
patient*p=new patient();
*p=input();
if(p->ID==0)
return;
if(head==NULL)
head=p;
last=p;
p->next=NULL;
else
p->next=head;
head=p;
system("cls");
cout << "\n\tPatient added:";
output(p);
patient*p=new patient();
*p=input();
if(p->ID==0)
return;
if(head==NULL)
head=p;
last=p;
p->next=NULL;
else
p->next=NULL;
last->next=p;
last=p;
system("cls");
output(p);
}
system("cls");
if(head==NULL)
else
patient*p=new patient();
p=head;
head=head->next;
output(p);
if(head==NULL)
cout<<"\n\tNo patient";
patient*p=new patient;
p=head;
while(p!=NULL)
cout<<"\nPatient data:";
cout<<"\n*************************************\n";
cout<<"\n\tGender : "<<p->gender;
cout<<"\n\tAge : "<<p->age;
cout<<"\n\tproblem : "<<p->problem;
cout<<"\n*************************************\n";
p=p->next;
cout<<"\n";
patient p;
while (choice != 5)
system("cls");
cout<<"\n\n\tWelcome To Department : " << q->departmentname;
choice=readnumber();
switch (choice)
case 1: q->insertatend();
getch();
break;
case 2: q->insertatbeg();
getch();
break;
case 3: q->getpatientout();
getch();
break;
case 4: system("cls");
q->listofpatients();
getch();
break;
int main ()
int i, choice = 0;
linkedqueue departments[5];
system("COLOR FC");
while(choice!=2)
strcpy(departments[0].departmentname,"Patient Portal\n");
system("cls");
cout<<"\n\t============================\a";
cout<<"\n\t----------------------------\n\a";
cout<<"\t["<<(i+1)<<"]: "<<departments[i].departmentname;
}
cout<<"\t[2]: Exit";
choice=readnumber();
departmentmenu(&departments[choice-1]);
if(choice==2)