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

edmSurvey.qst

.title=Diabetes Risk Survey
.instances=500
.menuhidden=false
.progressbar=true
.backgroundimage=edmSurvey.png

.qu=intro,type=void
The Canadian Diabetes Risk Assessment Questionnaire
The questions in this survey will help you to find out if you are at risk
 of developing type 2 diabetes.  Knowing your risk of having diabetes later
in life can help you to make healthy choices now that will reduce your risk
or even prevent you from developing diabetes.

You will be asked questions about important risk factors for diabetes.  These
include your age, family history of diabetes, ethnicity, and other factors.
 Please answer as honestly and completely as you can.  If you wish, a friend
or family member can help you complete this questionnaire.

Answer all questions.

<b> This questionnaire is intended for adults aged 40 to 74 years.</b>
<b> Click "next" to continue </b>
.an
.next

.qu=a1,type=number
What year were you born? (yyyy)
.an
.lo=1900
.hi=2100
.if (a1 = 1900) fin
.next

.qu=a2,type=number
How much do you weigh in lb?
<span style="color: #d96c6c;">
(in lb - enter number only)
If you wish to enter weight in kg, enter '0' and click "next"
</span>
.an
.lo=0
.hi=1000
.if (a2 = 0) a2b
.next=a2c

.qu=a2b,type=number
How much do you weigh in kg?
<span style="color: #d96c6c;">
(in lb - enter number only)
If you wish to enter weight in lb, enter '0' and click "next"
</span>
.an
.lo=0
.hi=1000
.if (a2b = 0) a2
.next=a2c

.qu=a2c,type=number
<script type="text/javascript" language="JavaScript"><%--
function populate() {
var feetVal = document.getElementById('feet').value;
if (feetVal == '') feetVal = 0;
var inchVal = document.getElementById('inches').value;
if (inchVal == '') inchVal = 0;
var totalInches = parseInt(feetVal)*12 + parseInt(inchVal);
if (isNaN(totalInches)) {
alert("Feet and inches must both be numbers");
document.getElementById('feet').value = "";
document.getElementById('inches').value = "";
return;
}
document.getElementById('answer').value = totalInches;
}
--%></script>How tall are you without shoes on?
<span style="color: #d96c6c;">
You can either type feet and inches below, or type your total height
in inches in the blue box at the bottom.
(If you wish to enter height in centimeters, enter 0 in the blue box and click "next")
</span>
feet: <input type="text" id="feet" size="2" onchange="populate()"> inches: <input type="text" id="inches" size="2" onchange="populate()"> <input type="button" value="Update" onclick="populate()">
.an
.lo=0
.hi=1000
.if (a2c = 0) a2d
.next=a3a

.qu=a2d,type=number
How tall are you without shoes on?
<span style="color: #d96c6c;">
(in centimeters - enter number only)
If you wish to enter height in inches, enter '0' and click "next"
</span>
.an
.lo=0
.hi=1000
.if (a2d = 0) a2c
.next=a3a

.qu=a3a,type=select
Are you male or female?
.an
1 = Male
2 = Female
.next

.qu=a3,type=number
Using the tape measure, place it around your waist at the level of your
belly button.  Measure after breathing out (do not hold your breath) and
type your results in the field below.
<span style="color: #d96c6c;">
(in inches - enter number only)
If you wish to enter waist circumference in centimeters, enter '0' and click "next"
</span>
.an
.lo=0
.hi=350
.if (a3 = 0) a3b
.next=a4

.qu=a3b,type=number
Using the tape measure, place it around your waist at the level of your
belly button.  Measure after breathing out (do not hold your breath) and
type your results in the field below.
<span style="color: #d96c6c;">
(in centimeters - enter number only)
If you wish to enter waist circumference in inches, enter '0' and click "next"
</span>
.an
.lo=0
.hi=350
.if (a3b = 0) a3
.next=a4


.qu=a4,type=select
Do you usually do some physical activity such as brisk walking for at
least 30 minutes every day?  This activity can be done while at work or at home.
.an
1 = Yes
2 = No
.next

.qu=a5,type=select
How often do you eat vegetables or fruits?
.an
1 = Every day
2 = Not every day
.next

.qu=a6,type=select
Have you ever been told by a doctor or nurse that you have high blood
pressure OR have you ever taken high blood pressure pills?
.an
1 = Yes
2 = No
2 = Don't know
.next

.qu=a7,type=select
Have you ever been found to have a high blood sugar (abnormal) either
from a blood test, during an illness, or during pregnancy?
.an
1 = Yes
2 = No
2 = Don't know
.next

.qu=a8,type=check
Which of your blood relatives ever been diagnosed with diabetes?
<span style="color: #d96c6c;">
(You may check multiple boxes.  If a certain relative has never been
diagnosed, or you don't know, don't check the box)
</span>
.an
1 = Mother
2 = Father
3 = Brothers/Sisters
4 = Children
5 = Other
.next

.qu=a9,type=check
Please check off which of the following ethnic groups your biological
(blood) <u><b>father</b></u> belongs to:
.an
1 = White (Caucasian)
2 = Aboriginal (First Nations person, Metis, Inuit)
3 = Black
4 = Latin American
5 = South Asian (East Indian, Pakistani, Sri Lankan, etc.)
6 = East Asian (Chinese, Vietnamese, Filipino, Korean, etc.)
7 = Other
.next

.qu=a10,type=check
Please check off which of the following ethnic groups your biological
(blood) <u><b>mother</b></u> belongs to:
.an
1 = White (Caucasian)
2 = Aboriginal (First Nations person, Metis, Inuit)
3 = Black
4 = Latin American
5 = South Asian (East Indian, Pakistani, Sri Lankan, etc.)
6 = East Asian (Chinese, Vietnamese, Filipino, Korean, etc.)
7 = Other
.next

.qu=a11,type=select
What is the highest level of education that you have completed?
.an
1 = Some high school or less
2 = High school diploma
3 = Some college or university
4 = University degree
.next

.qu=a12,type=select
In general, would you say your health is...
.an
1 = Excellent
2 = Very good
3 = Fair
4 = Poor
.next

.qu=a13,type=select
At the present time, do you smoke cigarettes?
.an
1 = Daily
2 = Occasionally
3 = Not at all
.next

.qu=a14,type=number
Over your entire lifetime, about how many years in total did you smoke?
.an
.lo=0
.hi=150
.if (a3a = 1) fin
.next

.qu=a15,type=select
Have you ever been told that you have diabetes related to pregnancy
(gestational diabetes)?
.an
1 = Yes
2 = No
3 = Don't know
.next

.qu=a16,type=select
Have you ever given birth to a large baby weighing 9 pounds (4.1 kg) or more?
.an
1 = Yes
2 = No
3 = Don't know
.next

.qu=fin,type=hidden
Thank you for completing the questionaire.
Your BMI is <span id="bmiSpan"></span>.
Your Score is <span id="scoreSpan"></span>.
Estimated 10 year risk of developing type 2 diabetes: <u><b><span id="riskSpan"></span></b></u>.

<%--<center><table style="border: 1px solid #dedede; padding: 0px;">
  <tr>
    <th style="background-color: #dedede;">Score</th>
    <th style="background-color: #dedede;">Risk</th>
  </tr>
  <tr id="lower7">
    <td style="text-align: center;">lower than 7</td>
    <td> --> low risk: 1 in 100</td>
  </tr>
  <tr id="7to11">
    <td style="text-align: center;">7-11</td>
    <td> --> slightly elevated risk: 1 in 25</td>
  </tr>
  <tr id="12to14">
    <td style="text-align: center;">12-14</td>
    <td> --> moderate risk: 1 in 6</td>
  </tr>
  <tr id="15to20">
    <td style="text-align: center;">15-20</td>
    <td> --> high risk: 1 in 3</td>
  </tr>
  <tr id="over20">
    <td style="text-align: center;">over 20</td>
    <td> --> very high: 1 in 2</td>
  </tr>
</table></center>
<div style="border-top: 1px solid #eaeaea; font-weight: bold; margin-top: 6px;">
Assessed Risk Factors:
</div>
<center><table style="border: 1px solid #dedede; padding: 0px;">
  <tr>
    <th style="background-color: #dedede;">Factor</th>
    <th style="background-color: #dedede;">Answer</th>
    <th style="background-color: #dedede;">Score</th>
  </tr>
  <tr>
    <td>Age:</td>
    <td id="qAge" style="text-align: center; color: #ff7200;"></td>
    <td id="qAgeScore" style="text-align: center;"></td>
  </tr>
  <tr>
    <td>Body Mass Index:</td>
    <td id="qBmi" style="text-align: center; color: #ff7200;"></td>
    <td id="qBmiScore" style="text-align: center;"></td>
  </tr>
  <tr>
    <td>Waist Circumference:</td>
    <td id="qWC" style="text-align: center; color: #ff7200;"></td>
    <td id="qWCScore" style="text-align: center;"></td>
  </tr>
    <td>Physical Activity:</td>
    <td id="qPhysicalActivity" style="text-align: center; color: #ff7200;"></td>
    <td id="qPhysicalActivityScore" style="text-align: center;"></td>
  </tr>
  <tr>
    <td>Vruits Vegetables:</td>
    <td id="qFruitsVeggies" style="text-align: center; color: #ff7200;"></td>
    <td id="qFruitsVeggiesScore" style="text-align: center;"></td>
  </tr>
  <tr>
    <td>High Blood Pressure:</td>
    <td id="qBP" style="text-align: center; color: #ff7200;"></td>
    <td id="qBPScore" style="text-align: center;"></td>
  </tr>
  <tr>
    <td>High Blood Sugar:</td>
    <td id="qBS" style="text-align: center; color: #ff7200;"></td>
    <td id="qBSScore" style="text-align: center;"></td>
  </tr>
  <tr>
    <td>Diabetes in Family:</td>
    <td id="qDiabetes" style="text-align: center; color: #ff7200;"></td>
    <td id="qDiabetesScore" style="text-align: center;"></td>
  </tr>
  <tr>
    <td style="border-top: 1px solid black"><b>Total</b></td>
    <td style="text-align: center; color: #ff7200; border-top: 1px solid black;">&nbsp;</td>
    <td id="qTotalScore" style="text-align: center; border-top: 1px solid black; font-weight: bold;"></td>
  </tr>
</table></center>--%>
Click "Next" to save the results and exit
<script type="text/javascript" language="JavaScript"><%--
function doOnload() {
doScore();
}
function doScore() {
var today = new Date();
var age = today.getFullYear() - ${survey.questions.a1};
var score = 0;
var ageScore = 0;
if (age >= 40 && age <= 44) ageScore = 0;
else if (age >= 45 && age <= 54) ageScore = 2;
else if (age >= 55 && age <= 64) ageScore = 3;
else if (age >= 65 && age <= 74) ageScore = 4;
score = score + ageScore;
document.getElementById("qAge").innerHTML = age;
document.getElementById("qAgeScore").innerHTML = ageScore;

var weightLb = parseInt('${survey.questions.a2}');
var weightKg = parseInt('${survey.questions.a2b}');
var heightIn = parseInt('${survey.questions.a2c}');
var heightCm = parseInt('${survey.questions.a2d}');
if (weightLb != "" && weightLb != 0) {
weightKg = weightLb*0.4536;
}
if (heightIn != "" && heightIn != 0) {
heightCm = heightIn*2.54;
}

var bmi = weightKg/Math.pow(heightCm/100, 2);
bmi = Math.round(bmi);
if (isNaN(bmi)) bmi = "Undetermined";
document.getElementById('bmiSpan').innerHTML = bmi;

var bmiScore = 0;
if (bmi < 25) bmiScore = 0;
if (bmi >= 25 && bmi <= 30) bmiScore = 1;
if (bmi > 30) bmiScore = 3;

score = score + bmiScore;
document.getElementById("qBmi").innerHTML = bmi;
document.getElementById("qBmiScore").innerHTML = bmiScore;

var wcScore = 0;
var genderMale = '${survey.questions.a3a}'; //1 = male, 2 = female
var waistCircIn = parseInt('${survey.questions.a3}');
var waistCircCm = parseInt('${survey.questions.a3b}');
if (waistCircIn != '' && waistCircIn != 0) {
waistCircCm = waistCircIn*2.54;
}
if (genderMale == '1' && waistCircCm < 94) wcScore = 0;
else if (genderMale == '1' && waistCircCm >= 94 && waistCircCm <= 102) wcScore = 3;
else if (genderMale == '1' && waistCircCm > 102) wcScore = 4;

if (genderMale == '2' && waistCircCm < 80) wcScore = 0;
else if (genderMale == '2' && waistCircCm >= 80 && waistCircCm <= 88) wcScore = 3;
else if (genderMale == '2' && waistCircCm > 88) wcScore = 4;

score = score + wcScore;
var genderString = 'male';
if (genderMale == '2') genderString = 'female';
document.getElementById("qWC").innerHTML = waistCircCm + " cm (" + genderString + ")";
document.getElementById("qWCScore").innerHTML = wcScore;

var paScore = 0;
var physicalActivity = '${survey.questions.a4}';
if (physicalActivity == '1') paScore = 0;
else if (physicalActivity == '2') paScore = 2;
score = score + paScore;
var physicalActivityString = 'at least 30 min';
if (physicalActivity == '2') physicalActivityString = 'less than 30 min';
document.getElementById("qPhysicalActivity").innerHTML = physicalActivityString;
document.getElementById("qPhysicalActivityScore").innerHTML = paScore;

var fruitsVeggiesScore = 0;
var fruitsAndVeggies = '${survey.questions.a5}';
if (fruitsAndVeggies == '1') fruitsVeggiesScore = 0;
else if (fruitsAndVeggies == '2') fruitsVeggiesScore = 1;
score = score + fruitsVeggiesScore;
var fruitsVeggiesString = 'every day';
if (fruitsAndVeggies == '2') fruitsAndVeggiesString = 'not every day';
document.getElementById("qFruitsVeggies").innerHTML = fruitsVeggiesString;
document.getElementById("qFruitsVeggiesScore").innerHTML = fruitsVeggiesScore;

var highBPScore = 0;
var highBP = '${survey.questions.a6}';
if (highBP == '1') highBPScore = 2;
else if (highBP == '2' || highBP == '3') highBPScore = 0;
score = score + highBPScore;
var highBPString = 'Yes';
if (highBP == '2') highBPString = 'No';
if (highBP == '3') highBPString = 'Dont Know';
document.getElementById("qBP").innerHTML = highBPString;
document.getElementById("qBPScore").innerHTML = highBPScore;

var highSugarScore = 0;
var highSugar = '${survey.questions.a7}';
if (highSugar == '1') highSugarScore = 5;
else if (highSugar == '2' || higihSugar == '3') highSugarScore = 0;
score = score + highSugarScore;
var highSugarString = 'Yes';
if (highSugar == '2') highSugarString = 'No';
if (highSugar == '3') highSugarString = 'Dont Know';
document.getElementById("qBS").innerHTML = highSugarString;
document.getElementById("qBSScore").innerHTML = highSugarScore;

var relativesScore = 0;
var relatives = [${survey.questions.a8}];
if (contains(relatives, 1)) relativesScore = 5;
else if (contains(relatives, 2)) relativesScore = 5;
else if (contains(relatives, 3)) relativesScore = 5;
else if (contains(relatives, 4)) relativesScore = 5;
else if (contains(relatives, 5)) relativesScore = 3;
else relativesScore = 0;
score = score + relativesScore;
var relativesString = 'Close Relatives';
if (relativesScore == 3) relativesString = 'Distant Relatives';
else if (relativesScore == 0) relativesString = 'None or dont know';
document.getElementById("qDiabetes").innerHTML = relativesString;
document.getElementById("qDiabetesScore").innerHTML = relativesScore;

document.getElementById('scoreSpan').innerHTML = score;

var risk = '';
if (score < 7) {
  risk = 'low risk: 1 in 100';
  document.getElementById("lower7").style.color = '#ff7e15';
  document.getElementById("lower7").style.backgroundColor = '#defcff';
}
else if (score >= 7 && score <= 11) {
  risk = 'slightly elevated risk: 1 in 25 will develop diabetes';
  document.getElementById("7to11").style.color = '#ff7e15';
  document.getElementById("7to11").style.backgroundColor = '#defcff';
}
else if (score >= 12 && score  <= 14) {
  risk = 'moderate risk: 1 in 6 will develop diabetes';
  document.getElementById("12to14").style.color = '#ff7e15';
  document.getElementById("12to14").style.backgroundColor = '#defcff';
}
else if (score >= 15 && score <= 20) {
  risk = 'high risk: 1 in 3 will develop diabetes';
  document.getElementById("15to20").style.color = '#ff7e15';
  document.getElementById("15to20").style.backgroundColor = '#defcff';
}
else if (score > 20) {
  risk = 'very high: 1 in 2 will develop diabetes';
  document.getElementById("over20").style.color = '#ff7e15';
  document.getElementById("over20").style.backgroundColor = '#defcff';
}

document.getElementById('qTotalScore').innerHTML = score;

document.getElementById('riskSpan').innerHTML = risk;

document.getElementById('answer').value = score;
document.forms['surveyQuestion'].action = 'srvsendinmessage.jsp';
}

function contains(a, obj){
  for(var i = 0; i < a.length; i++) {
    if(a[i] == obj){
      return true;
    }
  }
  return false;
}
--%></script>
.an
.next

Document Actions