Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
web-ui
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
WEBGDE-Components
web-ui
Commits
40354686
Commit
40354686
authored
Sep 18, 2023
by
Owen Ryan Ang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Integration
parent
43a4b5c9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
263 additions
and
26 deletions
+263
-26
config.js
WebGde/WebContent/WebGde-Widgets/DataInputWidget/config.js
+2
-1
generateFields.js
...bContent/WebGde-Widgets/DataInputWidget/generateFields.js
+8
-2
LogInClass.js
WebGde/WebContent/WebGde-Widgets/LogInWidget/LogInClass.js
+1
-0
LoginStyle.css
WebGde/WebContent/WebGde-Widgets/LogInWidget/LoginStyle.css
+9
-3
XML_Saver.js
...e/WebContent/WebGde-Widgets/Submit/XMLWriter/XML_Saver.js
+1
-1
submit.js
WebGde/WebContent/WebGde-Widgets/Submit/submit.js
+6
-3
schema_sqa.json
...e/WebContent/WebGde-Widgets/sample_schema/schema_sqa.json
+218
-0
index.html
WebGde/WebContent/index.html
+2
-2
script.js
WebGde/WebContent/script.js
+16
-14
No files found.
WebGde/WebContent/WebGde-Widgets/DataInputWidget/config.js
View file @
40354686
//Data Input Field Config
export
var
SCHEMA_FILE_PATH
=
"./WebGde-Widgets/sample_schema/
08-30-test
.json"
;
export
var
SCHEMA_FILE_PATH
=
"./WebGde-Widgets/sample_schema/
schema_sqa
.json"
;
// export var SCHEMA_FILE_PATH = "./WebGde-Widgets/sample_schema/HR Speed Test schema.json";
//DBLookup Webservice URL
export
var
DB_URL
=
"http://localhost:8080/WebGde/svc/gfs-rest/db-lookup"
\ No newline at end of file
WebGde/WebContent/WebGde-Widgets/DataInputWidget/generateFields.js
View file @
40354686
...
...
@@ -957,6 +957,7 @@ const inputChecklist = (key, validation) => {
var
checkbox
=
document
.
createElement
(
'input'
);
checkbox
.
type
=
'checkbox'
;
checkbox
.
classList
.
add
(
'checkboxOption'
);
checkbox
.
name
=
'checkboxChoices'
;
checkbox
.
value
=
item
;
if
(
index
==
0
)
checkbox
.
setAttribute
(
'id'
,
`
${
key
}
`
);
...
...
@@ -974,9 +975,10 @@ const inputChecklist = (key, validation) => {
dependentDiv
.
classList
.
add
(
'checkbox'
);
var
dependentCheckbox
=
document
.
createElement
(
'input'
);
dependentCheckbox
.
type
=
'checkbox'
;
checkbox
.
classList
.
add
(
'checkboxOption'
);
dependentCheckbox
.
name
=
'checkboxChoices'
;
dependentCheckbox
.
id
=
'checkDP'
;
dependentCheckbox
.
value
=
''
;
// Set the value here based on the input text
dependentCheckbox
.
value
=
'
other
'
;
// Set the value here based on the input text
dependentDiv
.
appendChild
(
dependentCheckbox
);
var
dependentLabel
=
document
.
createTextNode
(
'other'
);
...
...
@@ -987,6 +989,7 @@ const inputChecklist = (key, validation) => {
var
inputTextBox
=
document
.
createElement
(
'input'
);
inputTextBox
.
type
=
'text'
;
inputTextBox
.
id
=
'dependentTB'
;
inputTextBox
.
classList
.
add
(
'checkboxOther'
);
inputTextBox
.
style
.
display
=
'none'
;
inputTextBox
.
style
.
padding
=
'0px'
;
dropdownContent
.
appendChild
(
inputTextBox
);
...
...
@@ -1045,6 +1048,7 @@ const inputRadiolist = (key, validation) => {
var
radio
=
document
.
createElement
(
'input'
);
radio
.
type
=
'radio'
;
radio
.
name
=
`radioChoices_
${
key
}
`
;
radio
.
classList
.
add
(
'radioOption'
);
radio
.
value
=
item
;
if
(
index
==
0
)
radio
.
setAttribute
(
'id'
,
`
${
key
}
`
);
...
...
@@ -1060,8 +1064,9 @@ const inputRadiolist = (key, validation) => {
dependentDiv
.
classList
.
add
(
'radio-like-checkbox'
);
var
dependentRadio
=
document
.
createElement
(
'input'
);
dependentRadio
.
type
=
'radio'
;
dependentRadio
.
classList
.
add
(
'radioOption'
);
dependentRadio
.
name
=
`radioChoices_
${
key
}
`
;
dependentRadio
.
value
=
''
;
dependentRadio
.
value
=
'
other
'
;
dependentDiv
.
appendChild
(
dependentRadio
);
var
dependentLabel
=
document
.
createTextNode
(
'other'
);
...
...
@@ -1071,6 +1076,7 @@ const inputRadiolist = (key, validation) => {
var
inputTextBox
=
document
.
createElement
(
'input'
);
inputTextBox
.
type
=
'text'
;
inputTextBox
.
id
=
'dependentTB'
;
inputTextBox
.
classList
.
add
(
'radioOther'
);
inputTextBox
.
style
.
display
=
'none'
;
inputTextBox
.
style
.
padding
=
'0px'
;
dropdownContent
.
appendChild
(
inputTextBox
);
...
...
WebGde/WebContent/WebGde-Widgets/LogInWidget/LogInClass.js
View file @
40354686
...
...
@@ -155,6 +155,7 @@ export class LogInClass {
document
.
getElementById
(
"loginContainer"
).
innerHTML
=
"Logged in"
;
sessionStorage
.
setItem
(
"token"
,
await
json
.
access_token
);
sessionStorage
.
setItem
(
"token_type"
,
await
json
.
token_type
);
sessionStorage
.
setItem
(
"user_id"
,
this
.
logInForm
.
username
.
value
);
this
.
createLoginPrompt
(
"Log-in successful"
,
"success-message"
);
showPrompt
(
"Logged In"
,
"Successfully logged in"
,
"success"
,
"OK"
,
removePrompt
);
document
.
getElementById
(
"loginContainer"
).
remove
();
...
...
WebGde/WebContent/WebGde-Widgets/LogInWidget/LoginStyle.css
View file @
40354686
...
...
@@ -4,7 +4,7 @@ body{
}
#logInMainContainer
{
height
:
100vh
;
height
:
100vh
!important
;
}
/* Extra small devices (phones, 600px and down) */
...
...
@@ -47,7 +47,7 @@ body{
}
.input-icons
i
{
position
:
relative
;
position
:
relative
!important
;
}
.input-icons
{
...
...
@@ -87,7 +87,7 @@ body{
background-color
:
transparent
;
}
.container
{
.container
.login-container
{
width
:
80%
;
margin
:
auto
;
height
:
100%
;
...
...
@@ -118,6 +118,11 @@ body{
color
:
#FFFFFF
;
}
#username
,
#password
{
padding
:
0
;
height
:
25px
;
}
#username
:focus
,
#password
:focus
{
/* border-style: solid !important;
border-color: #23569f !important;
...
...
@@ -160,6 +165,7 @@ body{
.wrapper.invert
span
{
color
:
black
;
font-size
:
60px
;
}
.wrapper.invert
span
::before
{
...
...
WebGde/WebContent/WebGde-Widgets/Submit/XMLWriter/XML_Saver.js
View file @
40354686
...
...
@@ -20,7 +20,7 @@ export async function WriteForm(e,metrics,doctype,section) {
let
fid
=
Nodes
[
i
].
id
;
if
(
fid
==
'DocType'
||
fid
==
'Section'
||
fid
==
''
||
fid
==
"submitButton"
)
continue
// Skip the textbox in checklist and radiolist
if
(
fid
==
'dependentTB'
)
continue
;
if
(
Nodes
[
i
].
classList
.
contains
(
'radioOther'
)
||
Nodes
[
i
].
classList
.
contains
(
'checkboxOther'
)
)
continue
;
// Skip elements of type "button", "submit", and files
if
(
Nodes
[
i
].
type
===
'button'
||
Nodes
[
i
].
type
===
'submit'
||
fid
==
''
||
Nodes
[
i
].
name
===
'hidden_file_content'
)
continue
;
...
...
WebGde/WebContent/WebGde-Widgets/Submit/submit.js
View file @
40354686
...
...
@@ -26,7 +26,7 @@ export const submitForm = async (e) => {
}
const
{
id
,
value
,
type
,
name
}
=
element
// Skip submit, buttons, and files
if
(
id
===
'dependentTB'
)
continue
;
if
(
element
.
classList
.
contains
(
'radioOther'
)
||
element
.
classList
.
contains
(
'checkboxOther'
)
)
continue
;
if
(
element
.
classList
.
contains
(
'geotag'
)
||
element
.
classList
.
contains
(
'altitude'
)
||
element
.
classList
.
contains
(
'direction'
))
{
continue
;
}
...
...
@@ -34,8 +34,8 @@ export const submitForm = async (e) => {
if
(
type
===
'submit'
)
continue
if
(
type
===
'file'
)
continue
if
(
type
===
'hidden'
)
continue
if
(
id
===
'Radio_List'
||
name
==
'radioChoices'
)
continue
if
(
id
===
'Checkbox_List'
||
name
==
'checkboxChoices'
)
continue
if
(
id
===
'Radio_List'
||
element
.
classList
.
contains
(
'radioOption'
)
)
continue
if
(
id
===
'Checkbox_List'
||
element
.
classList
.
contains
(
'checkboxOption'
)
)
continue
if
(
id
===
'DocType'
)
{
doctype
=
element
.
options
[
element
.
selectedIndex
].
text
;
...
...
@@ -110,6 +110,9 @@ export const submitForm = async (e) => {
// await uploadTOGFS(await getFile.text(), sessionStorage.getItem("recentlySavedFileName"));
}
else
{
createInfoModal
(
null
,
'OK'
,
'Error while uploading'
);
return
false
}
// saveForm(sessionStorage.getItem("display_counter"));
}
...
...
WebGde/WebContent/WebGde-Widgets/sample_schema/schema_sqa.json
0 → 100644
View file @
40354686
{
"MEDICAL RECORD"
:
{
"PATIENT INFORMATION"
:
{
"patient_image"
:
{
"fieldLabel"
:
"Patient Image"
,
"aka"
:
"field1"
,
"validation"
:
{
"collection"
:
"image-capture"
,
"mandatory"
:
true
}
},
"full_name"
:
{
"fieldLabel"
:
"Full Name (Last, First, M.I)"
,
"aka"
:
"field2"
,
"validation"
:
{
"fieldLength"
:
50.0
,
"collection"
:
"alphanumeric"
,
"invalidchar"
:
"`~!@#&$%^*_={}[]:;/
\"
|
\\
<>0123456789"
,
"mandatory"
:
true
}
},
"date_of_birth"
:
{
"fieldLabel"
:
"Date of Birth (mm/dd/yyyy)"
,
"aka"
:
"field3"
,
"source"
:
"S"
,
"validation"
:
{
"fieldLength"
:
10.0
,
"collection"
:
"datepicker"
,
"mandatory"
:
true
}
},
"gender"
:
{
"fieldLabel"
:
"Gender (M/F)"
,
"aka"
:
"field4"
,
"validation"
:
{
"fieldLength"
:
1.0
,
"collection"
:
"radiolist"
,
"items"
:
[
"M"
,
"F"
],
"mandatory"
:
true
}
},
"contact_details"
:
{
"fieldLabel"
:
"Contact Details"
,
"aka"
:
"field5"
,
"validation"
:
{
"fieldLength"
:
20.0
,
"collection"
:
"alphanumeric"
,
"invalidchar"
:
"`~!@#&$%^*_={}[]:;/
\"
|
\\
<>"
,
"mandatory"
:
true
}
},
"emergency_contact"
:
{
"fieldLabel"
:
"Emergency Contact"
,
"aka"
:
"field6"
,
"validation"
:
{
"fieldLength"
:
50.0
,
"collection"
:
"alphanumeric"
,
"mandatory"
:
false
}
},
"medical_record_no"
:
{
"fieldLabel"
:
"Medical Record Number"
,
"aka"
:
"field7"
,
"validation"
:
{
"fieldLength"
:
10.0
,
"collection"
:
"alphanumeric"
,
"mandatory"
:
true
}
}
},
"MEDICAL HISTORY"
:
{
"past_conditions"
:
{
"fieldLabel"
:
"Past Conditions"
,
"aka"
:
"field8"
,
"validation"
:
{
"fieldLength"
:
50.0
,
"collection"
:
"alphanumeric"
,
"mandatory"
:
false
}
},
"surgical_procedures"
:
{
"fieldLabel"
:
"Surgical Procedures"
,
"aka"
:
"field9"
,
"validation"
:
{
"fieldLength"
:
50.0
,
"collection"
:
"alphanumeric"
,
"mandatory"
:
false
}
},
"allergies"
:
{
"fieldLabel"
:
"Allergies"
,
"aka"
:
"field10"
,
"validation"
:
{
"fieldLength"
:
50.0
,
"collection"
:
"alphanumeric"
,
"mandatory"
:
false
}
},
"family_history"
:
{
"fieldLabel"
:
"Family History"
,
"aka"
:
"field11"
,
"validation"
:
{
"fieldLength"
:
50.0
,
"collection"
:
"alphanumeric"
,
"mandatory"
:
false
}
}
},
"CURRENT MEDICATIONS"
:
{
"num_current_meds"
:
{
"fieldLabel"
:
"No. of Current Medications"
,
"aka"
:
"field12"
,
"validation"
:
{
"fieldLength"
:
2.0
,
"collection"
:
"numeric"
,
"mandatory"
:
true
}
},
"name_of_med_1"
:
{
"fieldLabel"
:
"Name of Medication 1"
,
"aka"
:
"field13"
,
"validation"
:
{
"fieldLength"
:
25.0
,
"collection"
:
"alphanumeric"
,
"mandatory"
:
true
},
"childof"
:
"num_current_meds"
,
"parentvalue"
:
[
"1"
]
},
"dosage_1"
:
{
"fieldLabel"
:
"Dosage 1"
,
"aka"
:
"field14"
,
"validation"
:
{
"fieldLength"
:
7.0
,
"collection"
:
"alphanumeric"
,
"invalidchar"
:
"`~!@#&$%^*_={}[]:;/
\"
|
\\
<>"
,
"mandatory"
:
true
},
"childof"
:
"num_current_meds"
,
"parentvalue"
:
[
"1"
]
},
"frequency_1"
:
{
"fieldLabel"
:
"Frequency 1"
,
"aka"
:
"field15"
,
"validation"
:
{
"fieldLength"
:
20.0
,
"collection"
:
"alphanumeric"
,
"invalidchar"
:
"`~!@#&$%^*_={}[]:;/
\"
|
\\
<>"
,
"mandatory"
:
true
},
"childof"
:
"num_current_meds"
,
"parentvalue"
:
[
"1"
]
},
"prescribing_physician_1"
:
{
"fieldLabel"
:
"Prescribing Physician 1"
,
"aka"
:
"field16"
,
"validation"
:
{
"fieldLength"
:
50.0
,
"collection"
:
"alphanumeric"
,
"invalidchar"
:
"`~!@#&$%^*_={}[]:;/
\"
|
\\
<>0123456789"
,
"mandatory"
:
false
},
"childof"
:
"num_current_meds"
,
"parentvalue"
:
[
"1"
],
"hidden"
:
true
},
"name_of_med_2"
:
{
"fieldLabel"
:
"Name of Medication 2"
,
"aka"
:
"field17"
,
"validation"
:
{
"fieldLength"
:
25.0
,
"collection"
:
"alphanumeric"
,
"mandatory"
:
true
},
"childof"
:
"num_current_meds"
,
"parentvalue"
:
[
"2"
]
},
"dosage_2"
:
{
"fieldLabel"
:
"Dosage 2"
,
"aka"
:
"field18"
,
"validation"
:
{
"fieldLength"
:
7.0
,
"collection"
:
"alphanumeric"
,
"invalidchar"
:
"`~!@#&$%^*_={}[]:;/
\"
|
\\
<>"
,
"mandatory"
:
true
},
"childof"
:
"num_current_meds"
,
"parentvalue"
:
[
"2"
]
},
"frequency_2"
:
{
"fieldLabel"
:
"Frequency 2"
,
"aka"
:
"field19"
,
"validation"
:
{
"fieldLength"
:
20.0
,
"collection"
:
"alphanumeric"
,
"invalidchar"
:
"`~!@#&$%^*_={}[]:;/
\"
|
\\
<>"
,
"mandatory"
:
true
},
"childof"
:
"num_current_meds"
,
"parentvalue"
:
[
"2"
]
},
"prescribing_physician_2"
:
{
"fieldLabel"
:
"Prescribing Physician 2"
,
"aka"
:
"field20"
,
"validation"
:
{
"fieldLength"
:
50.0
,
"collection"
:
"alphanumeric"
,
"invalidchar"
:
"`~!@#&$%^*_={}[]:;/
\"
|
\\
<>0123456789"
,
"mandatory"
:
false
},
"childof"
:
"num_current_meds"
,
"parentvalue"
:
[
"2"
],
"hidden"
:
true
}
}
}
}
\ No newline at end of file
WebGde/WebContent/index.html
View file @
40354686
...
...
@@ -5,8 +5,8 @@
<meta
charset=
"UTF-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"ie=edge"
>
<
!-- <
link rel="stylesheet" href="./style.css">
<link rel="stylesheet" href="./WebGde-Widgets/ImageViewerWidget/modules/imageViewer/imageViewer.css">
-->
<link
rel=
"stylesheet"
href=
"./style.css"
>
<link
rel=
"stylesheet"
href=
"./WebGde-Widgets/ImageViewerWidget/modules/imageViewer/imageViewer.css"
>
<link
id=
"loginStylesheet"
rel=
"stylesheet"
href=
"./WebGde-Widgets/LogInWidget/LoginStyle.css"
>
<script
type=
"module"
src=
"./script.js"
></script>
<script
src=
"https://code.jquery.com/jquery-3.6.0.min.js"
...
...
WebGde/WebContent/script.js
View file @
40354686
...
...
@@ -18,30 +18,32 @@ export async function startApplication(){
async
function
initializeWebGDE
(){
// Create and append the new link elements for the first two stylesheets
const
styleSheet1
=
document
.
createElement
(
'link'
);
styleSheet1
.
rel
=
'stylesheet'
;
styleSheet1
.
href
=
'./style.css'
;
//
const styleSheet1 = document.createElement('link');
//
styleSheet1.rel = 'stylesheet';
//
styleSheet1.href = './style.css';
const
styleSheet2
=
document
.
createElement
(
'link'
);
styleSheet2
.
rel
=
'stylesheet'
;
styleSheet2
.
href
=
'./WebGde-Widgets/ImageViewerWidget/modules/imageViewer/imageViewer.css'
;
//
const styleSheet2 = document.createElement('link');
//
styleSheet2.rel = 'stylesheet';
//
styleSheet2.href = './WebGde-Widgets/ImageViewerWidget/modules/imageViewer/imageViewer.css';
// Append the new link elements to the head of the document
document
.
head
.
appendChild
(
styleSheet1
);
document
.
head
.
appendChild
(
styleSheet2
);
//
document.head.appendChild(styleSheet1);
//
document.head.appendChild(styleSheet2);
// Remove login stylesheet
const
stylesheetToRemove
=
document
.
getElementById
(
"loginStylesheet"
);
if
(
stylesheetToRemove
)
{
stylesheetToRemove
.
parentNode
.
removeChild
(
stylesheetToRemove
);
}
sessionStorage
.
setItem
(
'user_id'
,
'worker1'
)
//
const stylesheetToRemove = document.getElementById("loginStylesheet");
//
if (stylesheetToRemove) {
//
stylesheetToRemove.parentNode.removeChild(stylesheetToRemove);
//
}
//
sessionStorage.setItem('user_id','worker1')
await
createWebGdeInterface
(
null
);
// setDocumentControlObject(new DocumentControlWidget());
// document.getElementById("input-field-container").appendChild(DOCUMENT_CONTROL_OBJECT.getWidget());
setDocumentControlObject
(
new
DocumentControlWidget
());
document
.
getElementById
(
"input-field-container"
).
appendChild
(
DOCUMENT_CONTROL_OBJECT
.
getWidget
());
var
mainLogInScreenContainer
=
document
.
getElementById
(
"logInMainContainer"
);
mainLogInScreenContainer
.
remove
();
removeLoadingScreen
();
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment