Skip to content

Commit 9a8abef

Browse files
authored
Add files via upload
1 parent fe6f464 commit 9a8abef

File tree

15 files changed

+1071
-0
lines changed

15 files changed

+1071
-0
lines changed

dist/Sodium.jar

6.94 KB
Binary file not shown.

dist/dat/lst.ct

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1

dist/log/log.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Log file

dist/msg/m28Mar.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<div class="redder"><div class="sender">P1234</div>Doctor!!%20I%20am%20getting%20dry%20cough<div class="time">28March17:15</div></div><div class="redder"><div class="sender">D4354</div>Please%20drink%20lots%20of%20water<div class="time">28March17:16</div></div><div class="redder"><div class="sender">P1234</div>Nurse%2C%20Can%20you%20please%20bring%20some%20water%20for%20me<div class="time">28March17:23</div></div><div class="redder"><div class="sender">N5346</div>On%20the%20way<div class="time">28March17:23</div></div>

dist/pr/P1234.pr

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--------------------------------------------------%0A%20%20%20%20%20%20%20%20%20%20%20%20%20P%20A%20T%20I%20E%20N%20T%20%20R%20E%20C%20O%20R%20D%0A--------------------------------------------------%0ALAST%20UPDATED%20%20%20%20%20%20%20%20%20%20%20%3A%2028%20March%205%3A15pm%0A%0APATIENT%20ID%20%20%20%20%20%20%20%20%20%20%20%20%20%3A%20P1234%0ANAME%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3A%20John%0AAGE%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3A%2073%0AADDRESS%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3A%2045%2C%20king%20street%2C%20Sydney%0ALAST%20TREATMENT%20%20%20%20%20%20%20%20%20%3A%20Hydrated%0ALAST%20REQUEST%20%20%20%20%20%20%20%20%20%20%20%3A%20Extra%20mask%0ALAST%20COMPLAINT%20%20%20%20%20%20%20%20%20%3A%20Frequent%20dry%20cough%0ASTAY%20DURATION%20%20%20%20%20%20%20%20%20%20%3A%202%20weeks%0ASTATUS%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3A%20IMPROVING%0AESTIMATED%20RELEASE%20DATE%20%3A%201%20April%0ASYMPTOMS%20NOTICED%20%20%20%20%20%20%20%3A%20Dry%20cough%20and%20fever%0AVACCINE%20PROVIDED%3F%20%20%20%20%20%20%3A%20Yes%0AREMARKS%20%3A%20Cooperative%20with%20test%20medicines%20and%20injections%0A%0ADOCTOR%20SIGNATURE%0AJeremy%20Bailey%20(D4354)%0A28March2020

dist/www/Code.js

Lines changed: 276 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,276 @@
1+
function showloading()
2+
{
3+
$("#hold").css("visibility","visible");
4+
}
5+
function hideloading()
6+
{
7+
$("#hold").css("visibility","hidden");
8+
}
9+
10+
function dateformat(n)
11+
{
12+
return n<10? '0'+n:n;
13+
}
14+
15+
function ShowLocalDate()
16+
{
17+
const monthNames = ["January", "February", "March", "April", "May", "June",
18+
"July", "August", "September", "October", "November", "December"];
19+
var dNow = new Date();
20+
var localdate= dateformat(dNow.getDate())+''+monthNames[dNow.getMonth()] +''+ dNow.getHours() + ':' + dNow.getMinutes();
21+
return localdate;
22+
}
23+
24+
25+
function addpr()
26+
{
27+
/*
28+
Add a patient record
29+
Sample request: "GET /ADD?id~id243@$record~test HTTP/1.1"
30+
*/
31+
32+
if(($.trim($("#pr").val())!="")&($.trim($("#pid").val())!=""))
33+
{
34+
showloading();
35+
$.get("ADD",
36+
"id~"+$("#pid").val()+"@$record~"+encodeURIComponent($.trim($("#pr").val())),
37+
function(data)
38+
{
39+
data=$.trim(data);
40+
if(data=="success")
41+
{
42+
hideloading();
43+
$("#status").css("display","inline-block");
44+
setTimeout(function(){ $("#status").css("display","none"); }, 3000);
45+
}
46+
else alert("Error connecting Server");
47+
});
48+
49+
}
50+
else{
51+
alert("Please enter both patient id and record details");
52+
}
53+
54+
}
55+
56+
var firstTime=true;
57+
function scrolldown()
58+
{
59+
var div = document.getElementById("discussion");
60+
if(firstTime)
61+
{div.scrollTop=div.scrollHeight; firstTime=false;}
62+
else
63+
{
64+
if((div.scrollHeight-div.scrollTop)<(2*div.clientHeight)){
65+
div.scrollTop=div.scrollHeight;
66+
}
67+
else
68+
{
69+
//Show new message arrived
70+
$("#godown").css("display","inline-block");
71+
}
72+
}
73+
}
74+
75+
function forcescrolldown()
76+
{
77+
var div = document.getElementById("discussion");
78+
div.scrollTop=div.scrollHeight;
79+
$("#godown").css("display","none");
80+
}
81+
82+
function showpr()
83+
{
84+
/*
85+
Read patient record from server and show in text area
86+
Sample request: "GET /id123.pr HTTP/1.1"
87+
*/
88+
89+
if($.trim($("#pid").val())!="")
90+
{
91+
showloading();
92+
$.get($.trim($("#pid").val())+".pr","",
93+
function(data)
94+
{
95+
$("#pr").val("");
96+
$("#pr").val(decodeURIComponent(data));
97+
hideloading();
98+
});
99+
100+
}
101+
else{
102+
alert("Please enter patient id");
103+
}
104+
105+
}
106+
/*************************************
107+
Message auto sync functions
108+
**************************************/
109+
var req_complete=true;
110+
var lastid=0;
111+
112+
function refresh(){
113+
if(req_complete)
114+
{
115+
//Start the request
116+
showloading();
117+
req_complete=false;
118+
$.get("m"+ShowLocalDate().substring(0,5)+".m","",
119+
function(data)
120+
{
121+
if(decodeURIComponent($.trim(data))=="Invalid request")
122+
{
123+
$("#discussion").html("");
124+
hideloading();
125+
scrolldown();
126+
req_complete=true;
127+
}
128+
else
129+
{
130+
$("#discussion").html("");
131+
$("#discussion").append(decodeURIComponent($.trim(data)));
132+
hideloading();
133+
scrolldown();
134+
req_complete=true;
135+
}
136+
});
137+
}
138+
}
139+
140+
function refmsg()
141+
{
142+
/*
143+
Read patient record from server and show in text area
144+
Sample request: "GET /id123.pr HTTP/1.1"
145+
*/
146+
if(req_complete)
147+
{
148+
req_complete=false;
149+
//Check if there is any update on the message
150+
$.get("GETID","a~a",function(data){
151+
data=$.trim(data);
152+
if(data=="error")
153+
{
154+
//There is an error in the server. so dont disturb
155+
}
156+
else
157+
{
158+
if(lastid!=data)
159+
{
160+
lastid=data;
161+
req_complete=true; //Important as refresh function checks if previous request is complete
162+
refresh();
163+
}
164+
else{
165+
//NO new message received
166+
}
167+
}
168+
req_complete=true;
169+
});
170+
}
171+
}
172+
173+
/************************************/
174+
175+
176+
177+
function sendmsg()
178+
{
179+
/*
180+
Send message to server and update the chat screen
181+
Sample request: "GET /id123.pr HTTP/1.1"
182+
*/
183+
184+
if(($.trim($("#uid").val())!="")&($.trim($("#msg").val())!=""))
185+
{
186+
showloading();
187+
$.get("SEND",
188+
"id~"+$("#uid").val()+"@msg~"+encodeURIComponent($.trim($("#msg").val())),
189+
function(data)
190+
{
191+
data=$.trim(data);
192+
if(data=="success")
193+
{
194+
hideloading();
195+
//$("#discussion").append("<div class=\"redder\"><div class=\"sender\">"+$("#uid").val()+"</div>"+$("#msg").val()+"<div class=\"time\">"+ShowLocalDate()+"</div></div>");
196+
$("#msg").val("");
197+
//scrolldown();
198+
refmsg();
199+
}
200+
else alert("Error connecting Server");
201+
});
202+
203+
}
204+
else
205+
{
206+
alert("Please enter both your id and message");
207+
}
208+
209+
}
210+
211+
212+
function assignevents()
213+
{
214+
215+
$("#addbtn").click(
216+
function()
217+
{
218+
addpr();
219+
}
220+
);
221+
222+
$("#updatebtn").click(
223+
function()
224+
{
225+
addpr();
226+
}
227+
);
228+
229+
$("#showbtn").click(
230+
function()
231+
{
232+
showpr();
233+
}
234+
);
235+
236+
$("#msg").keyup(function(event) {
237+
if (event.keyCode === 13) {
238+
sendmsg();
239+
}
240+
});
241+
242+
$("#uid").keyup(function(event) {
243+
if (event.keyCode === 13) {
244+
sendmsg();
245+
}
246+
});
247+
248+
$("#pid").keyup(function(event) {
249+
if (event.keyCode === 13) {
250+
showpr();
251+
}
252+
});
253+
254+
$("#sendbtn").click(
255+
function()
256+
{
257+
sendmsg();
258+
}
259+
);
260+
261+
$("#refbtn").click(
262+
function()
263+
{
264+
refmsg();
265+
}
266+
);
267+
268+
$("#godown").click(
269+
function()
270+
{
271+
forcescrolldown();
272+
}
273+
);
274+
275+
}
276+

0 commit comments

Comments
 (0)