-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpatientinfo.js
57 lines (33 loc) · 1.25 KB
/
patientinfo.js
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
function loadPatientInfo() {
var name = "none";
var age = "none";
var blood = "none";
var allergies = "none";
var medConditions = "none";
var contact = "none";
var year = new Date().getFullYear();
const queryString = window.location.search;
const urlParams = new URLSearchParams(queryString);
name = urlParams.get('n');
age = urlParams.get('a');
blood = urlParams.get('bl');
allergies = urlParams.get('all');
medConditions = urlParams.get('cd');
contact = urlParams.get('ct');
name=name.replace(/_/g," ");
age=age.replace(/_/g,"");
blood=blood.replace(/_/g," ");
allergies=allergies.replace(/_/g," ");
medConditions=medConditions.replace(/_/g," ");
contact=contact.replace(/_/g," ");
if (age == "Unknown"){
age = year - age;
}
document.getElementById("name").innerHTML = name;
document.getElementById("age").innerHTML = age;
document.getElementById("blood").innerHTML = blood;
document.getElementById("allergies").innerHTML = allergies;
document.getElementById("medconditions").innerHTML = medConditions;
document.getElementById("contact").innerHTML = contact;
}
window.onload = loadPatientInfo;