DOWNLOAD PDF )"; } else{ $fname="/home/sites/nationalcordbloodprogram.com/www/patient_reg/docs/" . intval($_GET['id']) . ".PDF"; if(file_exists($filename) && is_readable($filename)){ $pdflink="( DOWNLOAD PDF )"; } } if($seclevel == "TPCU"){ $query = "SELECT *, request.doctor_id as doctor_id, request.transplant_center_id as transplant_center_id FROM request, doctor WHERE ( (doctor.seclevel = 'ADM' OR doctor.seclevel = 'NYBC') OR (doctor.seclevel = 'TC' AND doctor.transplant_center_id = request.transplant_center_id) OR (doctor.seclevel = 'DR' AND doctor.doctor_id = request.doctor_id) ) AND request.deleted='N' AND request_id = " . $HTTP_GET_VARS['id']; #echo $query; } else { $query = "SELECT *, request.doctor_id as doctor_id, request.transplant_center_id as transplant_center_id FROM request, doctor WHERE username = \"" . getenv("REMOTE_USER") . "\" AND ( (doctor.seclevel = 'ADM' OR doctor.seclevel = 'NYBC') OR (doctor.seclevel = 'TC' AND doctor.transplant_center_id = request.transplant_center_id) OR (doctor.seclevel = 'DR' AND doctor.doctor_id = request.doctor_id) ) AND request.deleted='N' AND request_id = " . $HTTP_GET_VARS['id']; } $result = mysql_query($query) or die(mysql_error()); if( mysql_num_rows($result) ) { $data = mysql_fetch_array($result, MYSQL_ASSOC); $exists = 1; } } else { $query = "SELECT * FROM doctor WHERE username = \"" . getenv("REMOTE_USER") . "\""; $result = mysql_query($query) or die(mysql_error()); $data = mysql_fetch_array($result, MYSQL_ASSOC); } $edit = 0; if ( $HTTP_GET_VARS['mode'] == "edit" ) { $edit = 1; } $month = array( 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' ); print << var fields = new Array('patientlast','family name','alpha','patientfirst','given name','alpha','patientgender','patient gender','radio','patientdob_m','month of birth','select','patientdob_d','day of birth','select','patientdob_y','year of birth','select','patientdob','date of birth','date','patientdob','date of birth','comparedate NOW today','patientdob','date of birth','comparedate diagdate diagnosis date','patientrace','ethnicity/race','select','diagnosis_id','diagnosis','select','diagdate_d','diagnosis day','select','diagdate_m','diagnosis month','select','diagdate_y','diagnosis year','select','diagdate','diagnosis date','date','diagdate','diagnosis date','comparedate NOW today','transplant_center_id','Transplant Center','select','doctor_id','Requesting Doctor','select','HLAA1','HLA A1','select','HLAA2','HLA A2','select','HLAB1','HLA B1','select','HLAB2','HLA B2','select','HLADR1','HLA DR1','select','HLADR2','HLA DR2','select','patientwt','Body Weight','weight','testdate','date of test','comparedate NOW today'); var allele_fields = new Array('A1', 'A2', 'B1', 'B2', 'DR1', 'DR2' ); HTML; // print ""; if($exists) { //print '
"; foreach($types[$db_key] as $op) { $theop = $op; if( $theop == $data[$db_key] ) { $selected = "selected"; } $res .= ""; $selected = ""; } $res .= ""; return $res; } function get_hla($data,$key) { $res=""; $types["HLAA1"]=array("",1,2,3,9,10,11,19,23,24,25,26,27,28,29,30,31,32,33,34,36,43,66,68,69,74,80); $types["HLAA2"]=array("","bl",1,2,3,9,10,11,19,23,24,25,26,28,29,30,31,32,33,34,36,43,66,68,69,74,80); $types["HLAB1"]=array("",5,7,8,12,13,14,15,16,17,18,21,22,27,35,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,67,70,71,72,73,75,76,77,78,81); $types["HLAB2"]=array("","bl",5,7,8,12,13,14,15,16,17,18,21,22,27,35,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,67,70,71,72,73,75,76,77,78,81); $types["HLAC1"]=array("help","help","help"); $types["HLAC2"]=array("help","help","help"); $types["HLADRB1A"]=array("",1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18); $types["HLADRB1B"]=array("","bl",1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18); $types["HLADR1"]=array("",1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18); $types["HLADR2"]=array("","bl",1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18); $types["DR1"] = array("0101","0102","0103","0104","0105","0106","0107","0108","0109","0110", "0111","0112","0113","0114","0115","0116","0301","0302","0303","0304", "0305","0306","0307","0308","0309","0310","0311","0312","0313","0314", "0315","0316","0317","0318","0319","0320","0321","0322","0323","0324", "0325","0326","0327","0328","0329","0330","0331","0401","0402","0403", "0404","0405","0406","0407","0408","0409","0410","0411","0412","0413", "0414","0415","0416","0417","0418","0419","0420","0421","0422","0423", "0424","0425","0426","0427","0428","0429","0430","0431","0432","0433", "0434","0435","0436","0437","0438","0439","0440","0441","0442","0443", "0444","0445","0446","0447","0448","0449","0450","0451","0452","0453", "0454","0455","0456","0457","0458","0459","0460","0461","0462","0463", "0701","0703","0704","0705","0706","0707","0708","0709","0710","0711", "0712","0801","0802","0803","0804","0805","0806","0807","0808","0809", "0810","0811","0812","0813","0814","0815","0816","0817","0818","0819", "0820","0821","0822","0823","0824","0825","0826","0827","0828","0829", "0830","0831","0832","0901","0902","0903","0904","0905","0906","1", "10","1001","11","1101","1102","1103","1104","1105","1106","1107", "1108","1109","1110","1111","1112","1113","1114","1115","1116","1117", "1118","1119","1120","1121","1122","1123","1124","1125","1126","1127", "1128","1129","1130","1131","1132","1133","1134","1135","1136","1137", "1138","1139","1140","1141","1142","1143","1144","1145","1146","1147", "1148","1149","1150","1151","1152","1153","1154","1155","1156","1157", "1158","1159","1160","12","1201","1202","1203","1204","1205","1206", "1207","1208","1209","1210","1211","1212","1213","1214","1215","13", "1301","1302","1303","1304","1305","1306","1307","1308","1309","1310", "1311","1312","1313","1314","1315","1316","1317","1318","1319","1320", "1321","1322","1323","1324","1325","1326","1327","1328","1329","1330", "1331","1332","1333","1334","1335","1336","1337","1338","1339","1340", "1341","1342","1343","1344","1345","1346","1347","1348","1349","1350", "1351","1352","1353","1354","1355","1356","1357","1358","1359","1360", "1361","1362","1363","1364","1365","1366","1367","1368","1369","1370", "1371","1372","1373","1374","1375","14","1401","1402","1403","1404", "1405","1406","1407","1408","1409","1410","1411","1412","1413","1414", "1415","1416","1417","1418","1419","1420","1421","1422","1423","1424", "1425","1426","1427","1428","1429","1430","1431","1432","1433","1434", "1435","1436","1437","1438","1439","1440","1441","1442","1443","1444", "1445","1446","1447","1448","1449","1450","1451","1452","1453","1454", "1455","1456","1457","1458","1459","1460","1461","1462","1463","1464", "15","1501","1502","1503","1504","1505","1506","1507","1508","1509", "1510","1511","1512","1513","1514","1515","1516","1517","1518","1519", "1520","1521","1522","16","1601","1602","1603","1604","1605","1607", "1608","1609","1610","1611","17","18","2","3","4","6","7","8","9","bl" ); $types["DR2"] = array("0101","0102","0103","0104","0105","0106","0107","0108","0109","0110", "0111","0112","0113","0114","0115","0116","0301","0302","0303","0304", "0305","0306","0307","0308","0309","0310","0311","0312","0313","0314", "0315","0316","0317","0318","0319","0320","0321","0322","0323","0324", "0325","0326","0327","0328","0329","0330","0331","0401","0402","0403", "0404","0405","0406","0407","0408","0409","0410","0411","0412","0413", "0414","0415","0416","0417","0418","0419","0420","0421","0422","0423", "0424","0425","0426","0427","0428","0429","0430","0431","0432","0433", "0434","0435","0436","0437","0438","0439","0440","0441","0442","0443", "0444","0445","0446","0447","0448","0449","0450","0451","0452","0453", "0454","0455","0456","0457","0458","0459","0460","0461","0462","0463", "0701","0703","0704","0705","0706","0707","0708","0709","0710","0711", "0712","0801","0802","0803","0804","0805","0806","0807","0808","0809", "0810","0811","0812","0813","0814","0815","0816","0817","0818","0819", "0820","0821","0822","0823","0824","0825","0826","0827","0828","0829", "0830","0831","0832","0901","0902","0903","0904","0905","0906","1", "10","1001","11","1101","1102","1103","1104","1105","1106","1107", "1108","1109","1110","1111","1112","1113","1114","1115","1116","1117", "1118","1119","1120","1121","1122","1123","1124","1125","1126","1127", "1128","1129","1130","1131","1132","1133","1134","1135","1136","1137", "1138","1139","1140","1141","1142","1143","1144","1145","1146","1147", "1148","1149","1150","1151","1152","1153","1154","1155","1156","1157", "1158","1159","1160","12","1201","1202","1203","1204","1205","1206", "1207","1208","1209","1210","1211","1212","1213","1214","1215","13", "1301","1302","1303","1304","1305","1306","1307","1308","1309","1310", "1311","1312","1313","1314","1315","1316","1317","1318","1319","1320", "1321","1322","1323","1324","1325","1326","1327","1328","1329","1330", "1331","1332","1333","1334","1335","1336","1337","1338","1339","1340", "1341","1342","1343","1344","1345","1346","1347","1348","1349","1350", "1351","1352","1353","1354","1355","1356","1357","1358","1359","1360", "1361","1362","1363","1364","1365","1366","1367","1368","1369","1370", "1371","1372","1373","1374","1375","14","1401","1402","1403","1404", "1405","1406","1407","1408","1409","1410","1411","1412","1413","1414", "1415","1416","1417","1418","1419","1420","1421","1422","1423","1424", "1425","1426","1427","1428","1429","1430","1431","1432","1433","1434", "1435","1436","1437","1438","1439","1440","1441","1442","1443","1444", "1445","1446","1447","1448","1449","1450","1451","1452","1453","1454", "1455","1456","1457","1458","1459","1460","1461","1462","1463","1464", "15","1501","1502","1503","1504","1505","1506","1507","1508","1509", "1510","1511","1512","1513","1514","1515","1516","1517","1518","1519", "1520","1521","1522","16","1601","1602","1603","1604","1605","1607", "1608","1609","1610","1611","17","18","2","3","4","6","7","8","9","bl" ); $res .= ""; return $res; } function request_history($id){ $query="SELECT user, action, date FROM request_history WHERE request_id=$id ORDER BY date desc"; $result = mysql_query($query) or die(mysql_error()); if( mysql_num_rows($result) ) { $i=0; echo "REQUEST HISTORY| User | Action | Date |
| " . $line["user"] . " | " . $line["action"] . " | " . $line["date"] . " |