Table of Contents
Table of Contents | ||
---|---|---|
|
List Form Templates
Current Implementation
The application reads the list of form templates from the server right after the user is logged in. The list of forms is then cached until the next successful login.
API Sample
curl 'http://192.168.2.102:8080/PresentationServices/getForms?formType=formLibrary&userId=poda&token=d2360c39-637b-41da-988d-f031db5affbb&_=1395133673253' -H 'Accept: application/json, text/javascript, */*; q=0.01' -H 'User-Agent: Mozilla/5.0 (Linux; Android 4.4.2; Nexus 5 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/30.0.0.0 Mobile Safari/537.36' --compressed
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
{ "formsFact": { "statusFact": { "success": true }, "forms": [ { "name": "New Line Report", "groupName": "Catheter Associated Bloodstream Infections", "interactive": false, "language": "EN", "surveyClass": "org.kmr2.mock.SurveyBean", "surveyQuestions": [ { "position": 0, "itemId": "q001", "questionName": "InsertionDate", "preLabel": "Date/Time of insertion:", "required": true, "answerType": "datetime-local", "suggestedControl": "text", "groupAnswers": false, "splitDisplay": true, "validation": "new Date(~).getTime()+(new Date(~).getTimezoneOffset() * 60000) - new Date().getTime() <= 0 && new Date(~).getTime()+(new Date(~).getTimezoneOffset() * 60000) - new Date().getTime() > -31536000000\\Date of Insertion cannot be in the future or more than 365 days in the past" }, { "possibleAnswers": [ { "position": 1, "value": "A", "label": "Day" }, { "position": 2, "value": "P", "label": "Night" } ], "position": 0, "itemId": "q002", "questionName": "Shift", "preLabel": "Shift:", "required": true, "answerType": "text", "suggestedControl": "radio", "groupAnswers": true, "splitDisplay": true }, { "possibleAnswers": [ { "position": 1, "value": "3", "label": "Broviac" }, { "position": 2, "value": "4", "label": "Other" }, { "position": 3, "value": "1", "label": "PICC" }, { "position": 4, "value": "2", "label": "UAC" }, { "position": 5, "value": "5", "label": "UVC" } ], "position": 0, "itemId": "q003", "questionName": "CatheterType_Id", "preLabel": "Catheter Type:", "required": true, "answerType": "text", "suggestedControl": "radio", "groupAnswers": false, "splitDisplay": true }, { "possibleAnswers": [ { "position": 1, "value": "New", "label": "New Catheter" }, { "position": 2, "value": "Existing", "label": "Existing Central Catheter Exchanged, Replaced or Repaired" }, { "position": 3, "value": "Outside", "label": "Catheter Placed Outside of Unit" } ], "position": 0, "itemId": "q004", "questionName": "Origin", "preLabel": "Origin:", "required": true, "answerType": "text", "suggestedControl": "radio", "groupAnswers": false, "splitDisplay": true }, { "possibleAnswers": [ { "position": 1, "value": "Without", "label": "Without Prompting" }, { "position": 2, "value": "With", "label": "With Prompting" }, { "position": 3, "value": "Not", "label": "Not Done" } ], "position": 0, "itemId": "q005", "questionName": "UnitTimeOutProcedureFollowed", "preLabel": "Was Unit Time Out prompting procedure followed?", "required": true, "answerType": "text", "suggestedControl": "radio", "displayWhen": "~q004~=='New'||~q004~=='Existing'", "groupAnswers": false, "splitDisplay": true }, { "possibleAnswers": [ { "position": 1, "value": "Without", "label": "Without Prompting" }, { "position": 2, "value": "With", "label": "With Prompting" }, { "position": 3, "value": "Not", "label": "Not Done" } ], "position": 0, "itemId": "q006", "questionName": "InserterPerformedHandHygiene", "preLabel": "Did inserter perform hand hygiene prior to gloving for central line insertion?", "required": true, "answerType": "text", "suggestedControl": "radio", "displayWhen": "~q004~=='New'||~q004~=='Existing'", "groupAnswers": false, "splitDisplay": true }, { "possibleAnswers": [ { "position": 1, "value": "Without", "label": "Without Prompting" }, { "position": 2, "value": "With", "label": "With Prompting" }, { "position": 3, "value": "Not", "label": "Not Done" } ], "position": 0, "itemId": "q007", "questionName": "WoreSterileBarrierPrecautions", "preLabel": "Did inserter and assistant wear maximal sterile barrier precautions to include mask/eye shield, sterile gown, sterile gloves and cap?", "required": true, "answerType": "text", "suggestedControl": "radio", "displayWhen": "~q004~=='New'||~q004~=='Existing'", "groupAnswers": false, "splitDisplay": true }, { "possibleAnswers": [ { "position": 1, "value": "Without", "label": "Without Prompting" }, { "position": 2, "value": "With", "label": "With Prompting" }, { "position": 3, "value": "Not", "label": "Not Done" } ], "position": 0, "itemId": "q008", "questionName": "CoveredWithDrapes", "preLabel": "Was infant totally covered with large sterile drapes?", "required": true, "answerType": "text", "suggestedControl": "radio", "displayWhen": "~q004~=='New'||~q004~=='Existing'", "groupAnswers": false, "splitDisplay": true }, { "possibleAnswers": [ { "position": 1, "value": "Chlorhexidine", "label": "Chlorhexidine" }, { "position": 2, "value": "Povidone Iodine", "label": "Povidone Iodine" }, { "position": 3, "value": "Alcohol", "label": "Alcohol" }, { "position": 4, "value": "Sterile Water", "label": "Sterile Water" }, { "position": 5, "value": "None", "label": "None" } ], "position": 0, "itemId": "q009", "questionName": "SkinPrep", "preLabel": "Select all used for skin prep:", "required": true, "answerType": "text", "suggestedControl": "checkbox", "displayWhen": "~q004~=='New'||~q004~=='Existing'", "groupAnswers": false, "splitDisplay": true }, { "possibleAnswers": [ { "position": 1, "value": "Yes", "label": "Yes" }, { "position": 2, "value": "No", "label": "No" } ], "position": 0, "itemId": "q010", "questionName": "SkinPrepDry", "preLabel": "Skin prep dry at time of puncture?", "required": true, "answerType": "text", "suggestedControl": "radio", "displayWhen": "(~q004~=='New'||~q004~=='Existing') && ~q009~!='None' && ~q009~!=undefined", "groupAnswers": false, "splitDisplay": true }, { "possibleAnswers": [ { "position": 1, "value": "Yes", "label": "Yes" }, { "position": 2, "value": "No", "label": "No" } ], "position": 0, "itemId": "q011", "questionName": "AllSuppliesBedside", "preLabel": "Were all supplies at bedside prior to insertion?", "required": true, "answerType": "text", "suggestedControl": "radio", "displayWhen": "~q004~=='New'||~q004~=='Existing'", "groupAnswers": true, "splitDisplay": true }, { "position": 0, "itemId": "q014", "questionName": "RemovalDate", "preLabel": "Removal Date/Time", "required": true, "answerType": "datetime-local", "suggestedControl": "text", "displayWhen": "false", "groupAnswers": false, "splitDisplay": true }, { "position": 0, "itemId": "maintenanceId", "questionName": "MaintenanceId", "preLabel": "Maintenance Survey guid that sourced the Removal Date", "required": true, "answerType": "text", "suggestedControl": "text", "displayWhen": "false", "groupAnswers": false, "splitDisplay": true } ], "surveyId": "1", "dirty": false, "canSaveDraft": false, "exitOnEmpty": false, "hasDetails": false }, { "name": "Maintenance Report", ... } ]}} |
Patient Admission Form [View]
Current Implementation
This form is not retrieved from the local forms cache. Every time this form is opened, its definition is retrieved from PS. The reason behind this is that the current value for ChartId question is filled on demand based on the current information present in Patient table.
API Sample
curl 'http://192.168.2.102:8080/PresentationServices/getForms?patientId=000000003f59c2aa013f6898a5470043&formType=patientDetail&userId=sigal&token=de8301d3-4b43-4bd9-9b90-a294e2296066&_=1395133673275' -H 'Accept: application/json, text/javascript, */*; q=0.01' -H 'User-Agent: Mozilla/5.0 (Linux; Android 4.4.2; Nexus 5 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/30.0.0.0 Mobile Safari/537.36' --compressed
New line/Infection/Mental Health Forms [View]
Current Implementation
The information for these forms is retrieved and cached upon login.
API Sample
None
Maintenance Form [View]
Current Implementation
The structure of this form is currently being retrieved from the forms cache created upon login. The problem here is that one of the questions ('Open Lines') needs to retrieve data from the server side.
API Sample
For the 'Open Lines' question options:
curl 'http://192.168.2.102:8080/PresentationServices/getFormDetails?surveyId=2&patientId=000000003f59c2aa013f6898a5470043&userId=poda&token=d2360c39-637b-41da-988d-f031db5affbb&_=1395133673261' -H 'Accept: application/json, text/javascript, */*; q=0.01' -H 'User-Agent: Mozilla/5.0 (Linux; Android 4.4.2; Nexus 5 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/30.0.0.0 Mobile Safari/537.36' --compressed
Human Breast Milk Forms [View]
Current Implementation
This form is not being currently retrieved from the local forms cache. The reason is that this form contains some questions that might need to be hidden based on previously submitted forms. Instead of going through the 'getFormDetails' mechanism (as Maintenance Form does) the whole form definition is re-read from the server each time this form is displayed.
API Sample
curl 'http://192.168.2.102:8080/PresentationServices/getForms?patientId=000000003f59c2aa013f6898a5470043&surveyId=4&formType=formLibrary&userId=poda&token=d2360c39-637b-41da-988d-f031db5affbb&_=1395133673262' -H 'Accept: application/json, text/javascript, */*; q=0.01' -H 'User-Agent: Mozilla/5.0 (Linux; Android 4.4.2; Nexus 5 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/30.0.0.0 Mobile Safari/537.36' --compressed
Forms Submission
Current Implementation
Server-side validations
Some of the validations of a form's answers are currently being performed by PS (actually is survey-agent) in server-side. Some of these validations include: checking whether a patient has open lines or not or checking whether the Chart Id selected for a patient is already in use.
This kind of validation require server-side data in order to work.
Entities state modification
Te submission of a form is currently being persisted in Survey and SurveyAnswer database tables.
Most of the surveys only impact on those 2 tables. But there are special situation where a form submission could also impact in the state of exiting entities in the system, such as the Patient entity. This modifications are being performed by PS when a form is submitted.
Alert generation
When a form is submitted, a set of rules are being evaluated by survey-agent in order to determine whether alerts must be generated. When an alert is generated for a patient, all of the associated users receive a copy of it. All of the devices where the associated users are logged in also receive a notification.
API Sample
curl 'http://192.168.2.102:8080/PresentationServices/setForm' -H 'Accept: application/json, text/javascript, */*; q=0.01' -H 'Origin: file://' -H 'User-Agent: Mozilla/5.0 (Linux; Android 4.4.2; Nexus 5 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/30.0.0.0 Mobile Safari/537.36' -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' --data 'surveyId=4&patientId=000000003f59c2aa013f6898a5470043&action=Submit&q001a=&q001=2014-03-18&q002a=&q002=No&q003=No&q004=No&q005=No&q006=No&q008=No&q009=1200.000&q010=No&q011=&q012=&q007=&userId=poda&token=d2360c39-637b-41da-988d-f031db5affbb' --compressed