-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchart_Functions.js
107 lines (99 loc) · 4.5 KB
/
chart_Functions.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
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
/*=========================================================================
* Notes for chartNotes
* \\par = new Paragraph line
* \\fs## = FONT SIZE ANY NUMBER
* \\fs20 = Normal Size Font
* \\fs24 = Large font
* \\i \\i0 = italics
* \\b \\b0 = bold
* \\cb1 = Not Highlighted
* \\cb2 = Highlighted Black
* \\plain = sets everything to default
*
* \t tab, \n newline, \r carriage return (press enter on keyboard)
* \" double quote, \' single quote, \\ single backslash.
*========================================================================*/
/*=========================================================================
* TMP Global Variables
*========================================================================*/
var userText = "";
var userTextTranslation = "";
var userNotes = "";
var chartNotes = "";
/*=========================================================================
* Replaces all text for current form to provided string
*========================================================================*/
function addToChartNote(str){
var form_Id = window.external.FormId;
var document_variable = "DOCUMENT.TEMPHTML0_" + form_Id;
var text_translation = str;
window.external.SetChartValue(document_variable, text_translation);
};
/*=========================================================================
* gets CurrentDatetime Varible
*========================================================================*/
function getCurrentDateTime(){
var result = new Date().toLocaleString();
return result;
};
/*=========================================================================
* formats str to bold font for patient chart
*========================================================================*/
function chartBoldText(str){
return "\\b " + str + "\\b0"
};
/*=========================================================================
* formats str to large font for patient chart
*========================================================================*/
function chartLargeFont(str){
return "\\fs24\\b " + str + "\\fs20\\b0";
};
/*=========================================================================
* ADD to CHART FUNCTION
*========================================================================*/
function updateChartNotes(){
var formId = getFormId();
var documentVariable = "DOCUMENT.TEMPHTML0_" + formId;
userTextTranslation = chartNotes + "\n\n\\b Doctors Notes\\b0 \n" + userNotes + "\n\n" + "Last Updated: " + getCurrentDateTime();
SetChartValue(documentVariable, userTextTranslation);
};
/*=========================================================================
* USER TEXTBOX ADD TO CHART FUNCTION
*========================================================================*/
function userAddToChartNote(){
userNotes += (this.userText + "\n");
this.userText = "";
updateChartNotes();
};
/*=========================================================================
* This block is to staticly add chart notes behind the scene
like the normal forms do.
*========================================================================*/
function patientChartNotes(){
chartNotes = (
"\\b Patient Information \\b0" + "\n" +
" Name: " + this.patient.firstName+" "+this.patient.middleName+" "+this.patient.lastName+"\n"+
" Sex: " + this.patient.sex + "\n" +
" Race: " + this.patient.race + "\n" +
" Ethnicity: " + this.patient.ethnicity + "\n" +
" Date Of Birth: " + this.patient.dateOfBirth + "\n" +
" Date Of Death: " + this.patient.dateOfDeath + "\n" +
" Marital Status: " + this.patient.maritalStatus + "\n" +
" Language: " + this.patient.language + "\n" +
" SSN: " + this.patient.ssn + "\n\n" +
"\\b Patient Address \\b0" + "\n" +
" Address 1: " + this.patient.address1 + "\n" +
" Address 2: " + this.patient.address2 + "\n" +
" City: " + this.patient.address.city + "\n" +
" State: " + this.patient.address.state + "\n" +
" Zip: " + this.patient.address.postCode + "\n" +
" Country: " + this.patient.address.country + "\n\n" +
"\\b Patient Contact Information \\b0" + "\n" +
" Home: " + this.patient.phone.home + "\n" +
" Business: " + this.patient.phone.business + "\n" +
" Mobile: " + this.patient.phone.mobile + "\n" +
" Fax: " + this.patient.phone.fax + "\n" +
" Email: " + JSON.stringify(usersInCurrentLocation.length)
);
updateChartNotes();
};