-
Notifications
You must be signed in to change notification settings - Fork 0
/
show.c
218 lines (209 loc) · 5.52 KB
/
show.c
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
204
205
206
207
208
209
210
211
212
213
214
215
216
217
#include"show.h"
#include"otherfunc.h"
#include"stdio.h"
void showdoctor(Doctor* founddoctor)
{
Doctor*p=founddoctor->next;
int line=8;
int col=20;
int count=1;
while(p)
{
gotoXY(col,line);
printf("%d.医生姓名:%s",count++,p->name);
gotoXY(col+25,line);
printf("级别:");
switch (p->level) {
case 10:
printf("主任医师");
break;
case 20:
printf("副主任医师");
break;
case 30:
printf("主治医师");
break;
case 40:
printf("住院医师");
break;
}
gotoXY(col+43,line);
printf("工号:%s",p->ID);
gotoXY(col+60,line);
printf("出诊时间:");
for(int i=0;i<7;i++)
{
switch (i) {
case 0:
if(p->time[i])
printf("星期一 ");
break;
case 1:
if(p->time[i])
printf("星期二 ");
break;
case 2:
if(p->time[i])
printf("星期三 ");
break;
case 3:
if(p->time[i])
printf("星期四 ");
break;
case 4:
if(p->time[i])
printf("星期五 ");
break;
case 5:
if(p->time[i])
printf("星期六 ");
break;
case 6:
if(p->time[i])
printf("星期日 ");
break;
}
}
p=p->next;
line++;
}
}
void showdoctordetail(Doctor* doctor)
{
int line=11;
int col=20;
Doctor* p=doctor;
gotoXY(col+15,line);
printf("医生姓名:%s",p->name);
gotoXY(col+33,line);
printf("级别:");
switch (p->level) {
case 10:
printf("主任医师");
break;
case 20:
printf("副主任医师");
break;
case 30:
printf("主治医师");
break;
case 40:
printf("住院医师");
break;
}
gotoXY(col+47,line);
printf("工号:%s",p->ID);
gotoXY(col+58,line);
printf("出诊时间:");
for(int i=0;i<7;i++)
{
switch (i) {
case 0:
if(p->time[i])
printf("星期一 ");
break;
case 1:
if(p->time[i])
printf("星期二 ");
break;
case 2:
if(p->time[i])
printf("星期三 ");
break;
case 3:
if(p->time[i])
printf("星期四 ");
break;
case 4:
if(p->time[i])
printf("星期五 ");
break;
case 5:
if(p->time[i])
printf("星期六 ");
break;
case 6:
if(p->time[i])
printf("星期日 ");
break;
}
}
}
void showpatientsimple(Patient* patient,int line)
{
Patient* p=patient;
int col=35;
gotoXY(col-5,line-1);
printf("患者姓名:%s",p->name);
gotoXY(col+15,line-1);
printf("患者年龄:%d",p->age);
gotoXY(col+30,line-1);
printf("患者ID:%s",p->ID);
}
void showpatientdetail(Record*foundrecord,int line)
{
Record*p=foundrecord->next;
int col=30;
showpatientsimple(&p->patient,line);
gotoXY(col-4,line);
printf("------------------------------------------------------------------");
while(p)
{
gotoXY(col,line+2);
printf("单号:%s",p->ID);
gotoXY(col+25,line+2);
printf("医生名字:%s",p->doctor.name);
gotoXY(col+43,line+2);
printf("医生工号:%s",p->doctor.ID);
Medicine* m=p->detail.medicine->next;
for(int i=0;i<p->detail.medicinecount;i++)
{
gotoXY(col,line+3+i);
printf("药品名字:%s 单价:%.2f 数量:%d ",m->name,m->price,m->quantity);
m=m->next;
}
Check* n=p->detail.check->next;
for(int i=0;i<p->detail.checkcount;i++)
{
gotoXY(col,line+3+i+p->detail.medicinecount);
printf("检查名字:%s 费用:%.2f",n->name,n->expense);
n=n->next;
}
gotoXY(col,line+3+p->detail.medicinecount+p->detail.checkcount);
printf("检查总费用:%.2f 药品总费用:%.2f 住院总费用:%.2f",p->detail.checkexpense,p->detail.medicineexpense,p->detail.inhosexpense);
p=p->next;
line+=6;
}
}
void showfindtimepatient(Record*foundtime,int line)
{
Record*p=foundtime->next;
int col=30;
while(p)
{
gotoXY(col,line++);
printf("患者姓名:%s 患者年龄:%d 患者挂号:%s",p->patient.name,p->patient.age,p->patient.registernum[0]);
gotoXY(col,line++);
printf("主治医生姓名:%s 医生工号:%s",p->doctor.name,p->doctor.ID);
Medicine* m=p->detail.medicine->next;
for(int i=0;i<p->detail.medicinecount;i++)
{
gotoXY(col,line++);
printf("药品名字:%s 单价:%.2f 数量:%d ",m->name,m->price,m->quantity);
m=m->next;
}
Check* n=p->detail.check->next;
for(int i=0;i<p->detail.checkcount;i++)
{
gotoXY(col,line++);
printf("检查名字:%s 费用:%.2f",n->name,n->expense);
n=n->next;
}
gotoXY(col,line++);
printf("检查总费用:%.2f 药品总费用:%.2f ",p->detail.checkexpense,p->detail.medicineexpense);
if(p->detail.flag==1)
printf("住院总费用:%.2f",p->detail.inhosexpense);
p=p->next;
line+=2;
}
}