Personal tools
You are here: Home / MyOSCAR PHR / Developers / Survey Creation

Index_html

The MyOSCAR Survey Module was built to read a source MUMPS configuration file that defines the survey questions and flow. The purpose of this document is to describe the format of the configuration file.
The configuration file begins with several global parameters.  For example:
.title=Diabetes Risk Survey
.instances=1
.hidden=false

 Property  Values     Default 
 Explanation
 .title  text
   Title of the survey as it will show up in the drop-down list menu
 .instances  number (integer)
 65000  A number of surveys each user can fill out.  If one-time survey, enter "1".  Once the survey # has been reached by the user, it will no longer appear in the drop-down menu.
 .menuhidden  true/false  false  true/false field indicating whether the survey will appear in the menu.  If "false" is selected, it will not appear in the menu and the users must have the link to the survey to fill it out.  This is useful if a research investigator wishes to e-mail out links to surveys at specific time points in the study.
.progressbar
 true/false  true  indicates whether the question progress bar is displayed in the survey
.geomapping  true/false  false  Turns the geomapping module for the survey on/off (to map responses geographically).  This was used in the pandemic surveillance survey.
.booleanResultStatement  statement that evaluates to true or false
   This allows the result for each survey to be rendered as true or false.  For example:  (A1.size()>=3) means that question A1 must have at least 3 items checked off.  This was used in the pandemic surveillance survey to indicate that the user must check off at least 3 symptoms to be classified as "true" for having the infectious disease.


The configuration file consists of a series of questions, where the beginning of each question is marked by a line starting with '.qu='. The following is an example of the question block:
.qu=E3a,type=select
Do you have any difficulty walking up 10 steps?
 
.an=1
1 = No
2 = Yes
3 = No longer do this due to the difficulty of doing it
4 = No longer do this, but reasons are not related to my health
5 = Never did it
6 = Don't know / refused
.lo=1
.hi=6
.if (E2a = 1) E2c
.if (E2a = 2) E2b
.if (E2a = 3) E2e
.if (E2a = 5) E3a
.if (E2a = 6) E2c

.next=E3b
The following are components of the question block:
Line Description
.qu=E1a,type=select
*Required*.qu= indicates the start of the question E1a is the question identifier (only alphanumeric characters are allowed. Keep this short and simple, no spaces!) , separates the properties type=select defines the answer to this question type as "select" (see below for possible question types).
Do you have any difficulty walking up 10 steps?
*Required*This block defines the actual question text.  You can use HTML to add various font properties or images.  The question block is always terminated by the .an statement (next).  When the text is displayed the rendering survey engine puts <br> (enterspaces) in the html, so if you put multi-line html and javascript, you must escape it with <%--   your stuff here      --%> otherwise your code/html will be interspersed with <br> tags.
.an
*Required* .an stands for "answer", and indicates the start of the answer block. If the question shows the participant a list of choices, they would be listed underneath
1 = No
2 = Yes
3 = No longer do this due to the difficulty of doing it
4 = No longer do this, but reasons are not related to my health
5 = Never did it
6 = Don't know / refused
This block defines the answer choices, and is only applicable for question types "check" and "select". This is ignored for all other question types. Each choice consists of two parts: the identifier and text, separated by ' = '. The identifier is an integer that will be used to reference the answer choice in 'if' statements (see below), and the text is the part seen by the survey participant. Note that the identifier is optional, and defaults to incrementing numbers starting with 1. However, including the identifier is considered good form.
.lo=1
.hi=6
This defines integer answer validation, where .lo and .hi indicate the lowest and highest allowed integers respectively. To avoid problems, it is advisable that this is included ONLY for questions of type "number" (otherwise using these properties makes no sense).
.if (E2a = 1) E2c
.if (E2a = 2) E2b
.if (E2a = 3) E2e
.if (E2a = 4) E2c
.if (E2c = 2) E2d
.if ((E2d @ 3) and (E2d @ 4)) E3a
.if ((E2a = 1 or E2a = 6) and (E2c = 1 or E2c = 3 or E2c = 4)) E3a
This is the 'if' statement block that defines the survey question flow. In this example, E2a, E2c, etc.. are question identifiers. The answer to each of these questions is mathematically compared to the value using operators such as =, >=, <=, <, >, @. If the condition is true, the survey jumps to the next question specified at the end of the line. For instance:
- The first statement is interpreted as "if answer to question E2a is '1', go to question E2c".
These 'if' statements are executed in order as defined. If one evaluates to "true", all the other ones are ignored.
If the question is of type "check", it holds multiple answers. In this case the operator '@' must be used to symbolize "contains". For example
- The 6th statement reads "if the answer list to question E2d contains 3 and 4, go to question E3a"
.next
*Required*This defines the next question if the 'if' statements are missing, or all evaluate to 'false'. In this case, ".next" indicates that the next question in the configuration file is displayed. Optionally, the question identifier can be specified to direct the survey to go to a different question (i.e. ".next=E3c");
CAUTION: Make sure that the questions in the condition of the 'if' statement have been asked before. If the question appears in an 'if' condition that has not yet been asked, the survey module shows an error at runtime.
The following question types are curently supported:
  • void - the question does not require a response. This is useful for displaing information such as introduction and conclusion instructions
  • number - the user enters an integer answer.
  • string - the user is given a textbox to type words or sentences.
  • select - the user is given a series of options to select from (can select only ONE answer)
  • check - the user is given a series of checkbox options to select from (multiple selection allowed)
  • decimal - the user is given a small text box and value is stored as a decimal
DO's and DON'T's: - If you must ask the user the same question more than once, copy + paste it under a different ID (don't make this more confusing that it has to)

Survey links:
This is used to link the users directly to their particular survey.  Modify the domain and surveyid portions of this example URL:
http://rehab.myoscar.org/myoscar_client_rehab/surveys/startSurvey.do?surveyid=rapa2

To reload survey properties without restarting server: /myoscar_client/reloadSurveys.do
To reload client properties without restarting server: /myoscar_client/reloadProperties.do

Document Actions