-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpatient.php
More file actions
136 lines (122 loc) · 4.45 KB
/
patient.php
File metadata and controls
136 lines (122 loc) · 4.45 KB
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
<?php
require_once "config.php";
$hpcode = optional_param("hpcode","",PARAM_TEXT);
$patientid = optional_param("patientid","",PARAM_TEXT);
$submit = optional_param("submit","",PARAM_TEXT);
$protocol = optional_param("protocol",PROTOCOL_REGISTRATION,PARAM_TEXT);
$healthposts = $API->getHealthPoints();
$TITLE = getString("patientmanager.title");
if($hpcode != "" && $patientid != ""){
$patient = $API->getPatient(array('hpcode'=>$hpcode,'patid'=>$patientid));
if (isset($patient) && $patient != false && $patient->regcomplete){
$TITLE = sprintf("%s %s - %s",displayHealthPointName($patient->patienthpcode), $patient->Q_USERID, $patient->Q_USERNAME. " ". $patient->Q_USERFATHERSNAME);
} else if ($patient != false && !$patient->regcomplete) {
$TITLE = getstring("warning.patient.notregistered");
}
}
$PAGE = "patient";
require_once "includes/header.php";
printf("<h2 class='printhide'>%s</h2>", getString("patientmanager.title"));
?>
<form action="" method="get" class="printhide">
<input type="hidden" name="protocol" value="<?php echo PROTOCOL_REGISTRATION; ?>"/>
<?php echo getString("patientmanager.form.healthpost");?>
<select name="hpcode">
<?php
foreach($healthposts as $hp){
if ($hpcode == $hp->hpcode){
printf("<option value='%s' selected='selected'>%s</option>",$hp->hpcode, displayHealthPointName($hp->hpcode));
} else {
printf("<option value='%s'>%s</option>",$hp->hpcode, displayHealthPointName($hp->hpcode));
}
}
?>
</select>
<?php echo getString("patientmanager.form.patientid");?>
<input type="text" name="patientid" size="6" value="<?php echo $patientid; ?>"></input>
<input type="submit" name="submit" value="<?php echo getString("patientmanager.form.searchbtn");?>"></input>
</form>
<?php
if (!isset($patient) && $submit == ""){
include_once "includes/footer.php";
die;
} else if (!isset($patient) || $patient == false){
printf("<span class='error'>%s</span>",getString('warning.patient.notfound'));
include_once "includes/footer.php";
die;
}
echo "<h3/>".$TITLE."</h3>";
echo "<span class='printhide'>";
if(!$patient->regcomplete){
echo getstring(PROTOCOL_REGISTRATION);
} else if($protocol == PROTOCOL_REGISTRATION && $patient){
echo "<span class='selected'>".getstring(PROTOCOL_REGISTRATION)."</span>";
} else {
printf("<a href='?patientid=%s&hpcode=%s&protocol=%s'>%s</a>",$patientid,$hpcode, PROTOCOL_REGISTRATION, getstring(PROTOCOL_REGISTRATION));
}
printf(" | ");
if(count($patient->anc)==0){
echo getstring(PROTOCOL_ANC);
} else if ($protocol == PROTOCOL_ANC){
echo "<span class='selected'>".getstring(PROTOCOL_ANC)."</span>";
} else {
printf("<a href='?patientid=%s&hpcode=%s&protocol=%s'>%s</a>",$patientid,$hpcode,PROTOCOL_ANC,getstring(PROTOCOL_ANC));
}
printf(" | ");
if(count($patient->anclabtest)==0){
echo getstring(PROTOCOL_ANCLABTEST);
} else if ($protocol == PROTOCOL_ANCLABTEST){
echo "<span class='selected'>".getstring(PROTOCOL_ANCLABTEST)."</span>";
} else {
printf("<a href='?patientid=%s&hpcode=%s&protocol=%s'>%s</a>",$patientid,$hpcode,PROTOCOL_ANCLABTEST, getstring(PROTOCOL_ANCLABTEST));
}
printf(" | ");
if(!isset($patient->delivery)){
echo getstring(PROTOCOL_DELIVERY);
} else if ($protocol == PROTOCOL_DELIVERY){
echo "<span class='selected'>".getstring(PROTOCOL_DELIVERY)."</span>";
} else {
printf("<a href='?patientid=%s&hpcode=%s&protocol=%s'>%s</a>",$patientid,$hpcode,PROTOCOL_DELIVERY, getstring(PROTOCOL_DELIVERY));
}
printf(" | ");
if(count($patient->pnc)==0){
echo getstring(PROTOCOL_PNC);
} else if ($protocol == PROTOCOL_PNC){
echo "<span class='selected'>".getstring(PROTOCOL_PNC)."</span>";
} else {
printf("<a href='?patientid=%s&hpcode=%s&protocol=%s'>%s</a>",$patientid,$hpcode,PROTOCOL_PNC, getstring(PROTOCOL_PNC));
}
echo "</span>";
include_once('includes/patient/risk.php');
if ($patient->regcomplete && $protocol == PROTOCOL_REGISTRATION){
include_once('includes/patient/registration.php');
}
/*
* ANC
*/
if ($patient->anc && $protocol==PROTOCOL_ANC){
$anc = $patient->anc;
include('includes/patient/anc.php');
}
/*
* ANC Lab Tests
*/
if ($patient->anclabtest && $protocol==PROTOCOL_ANCLABTEST){
$anclabtest = $patient->anclabtest;
include('includes/patient/anclabtest.php');
}
/*
* Labour/Delivery
*/
if ($patient->delivery && $protocol==PROTOCOL_DELIVERY){
include('includes/patient/delivery.php');
}
/*
* TODO add PNC
*/
if ($patient->pnc && $protocol==PROTOCOL_PNC){
$pnc = $patient->pnc;
include('includes/patient/pnc.php');
}
include_once "includes/footer.php";
?>