Skip to content

Commit

Permalink
added forgotten files : migrations and renamed batches_files
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Mukiza committed Aug 19, 2013
1 parent 27fb260 commit e35dda4
Show file tree
Hide file tree
Showing 6 changed files with 780 additions and 0 deletions.
27 changes: 27 additions & 0 deletions survey/batch_seeds/batch_b.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
from survey.models import *

survey = Survey.objects.create(name='MICS Uganda 2013', description='MICS Uganda 2013')
batch = Batch.objects.create(survey=survey, order=2, name="Batch B")

indicator = Indicator.objects.create(batch=batch, order=1, identifier="MN17")
question_1 = Question.objects.create(indicator=indicator, text="How many women aged between 15-49 years are in this household?", answer_type=Question.NUMBER, order=1)
question_2 = Question.objects.create(indicator=indicator, text="How many of these women has had a live birth in the last 2 years?", answer_type=Question.NUMBER, order=2)

indicator = Indicator.objects.create(batch=batch, order=2, identifier="MN18")
question_3 = Question.objects.create(indicator=indicator, text="How many of these child births were delivered in a health facility?", answer_type=Question.NUMBER, order=1)
question_4 = Question.objects.create(indicator=indicator, text="How many of these child births were assisted by a skilled health personnel?", answer_type=Question.NUMBER, order=2)

indicator = Indicator.objects.create(batch=batch, order=3, identifier="MN25")
question_5 = Question.objects.create(indicator=indicator, text="How many of these new borns were breast fed within 1 hour of birth?", answer_type=Question.NUMBER, order=1)


# Rules
AnswerRule.objects.create(question=question_1, action=AnswerRule.ACTIONS['END_INTERVIEW'], condition=AnswerRule.CONDITIONS['EQUALS'], validate_with_value=0)

AnswerRule.objects.create(question=question_2, action=AnswerRule.ACTIONS['REANSWER'], condition=AnswerRule.CONDITIONS['GREATER_THAN_QUESTION'], validate_with_question=question_1)

AnswerRule.objects.create(question=question_3, action=AnswerRule.ACTIONS['REANSWER'], condition=AnswerRule.CONDITIONS['GREATER_THAN_QUESTION'], validate_with_question=question_2)

AnswerRule.objects.create(question=question_4, action=AnswerRule.ACTIONS['REANSWER'], condition=AnswerRule.CONDITIONS['GREATER_THAN_QUESTION'], validate_with_question=question_2)

AnswerRule.objects.create(question=question_5, action=AnswerRule.ACTIONS['REANSWER'], condition=AnswerRule.CONDITIONS['GREATER_THAN_QUESTION'], validate_with_question=question_2)
19 changes: 19 additions & 0 deletions survey/batch_seeds/batch_c.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from survey.models import *

survey = Survey.objects.create(name='MICS Uganda 2013', description='MICS Uganda 2013')
batch = Batch.objects.create(survey=survey, order=2, name="Batch C")

indicator = Indicator.objects.create(batch=batch, order=1, identifier="MN2")
question_1 = Question.objects.create(indicator=indicator, text="How many times did you receive antenatal care during the last pregnancy?", answer_type=Question.NUMBER, order=1)

question_2 = Question.objects.create(indicator=indicator, text="During any of these antenatal visits for the pregnancy, how many times did you take medicine to prevent malaria?", answer_type=Question.NUMBER, order=2)

indicator = Indicator.objects.create(batch=batch, order=2, identifier="MN6")
question_3 = Question.objects.create(indicator=indicator, text="During the last pregnancy, did you receive any injection on the arm or shoulder to prevent the baby from getting tetanus?", answer_type=Question.MULTICHOICE, order=1)
QuestionOption.objects.create(question=question_3, text="Yes", order=1)
no_option = QuestionOption.objects.create(question=question_3, text="No", order=2)

question_4 = Question.objects.create(indicator=indicator, text="How many times did you receive this tetanus injection during your pregnancy?", answer_type=Question.NUMBER, order=2)

# Rules
AnswerRule.objects.create(question=question_3, action=AnswerRule.ACTIONS['END_INTERVIEW'], condition=AnswerRule.CONDITIONS['EQUALS_OPTION'], validate_with_option=no_option)
63 changes: 63 additions & 0 deletions survey/batch_seeds/batch_d.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
from survey.models import *

survey = Survey.objects.create(name='MICS Uganda 2013', description='MICS Uganda 2013')
batch = Batch.objects.create(survey=survey, order=2, name="Batch D")

indicator = Indicator.objects.create(batch=batch, order=1, identifier="MN17")
question_1 = Question.objects.create(indicator=indicator, text="How many women aged between 15-49 years are in this household?", answer_type=Question.NUMBER, order=1)

indicator = Indicator.objects.create(batch=batch, order=2, identifier="__")
question_2 = Question.objects.create(indicator=indicator, text="Have you ever heard of an illness called AIDS?", answer_type=Question.MULTICHOICE, order=1)
QuestionOption.objects.create(question=question_2, text="Yes", order=1)
QuestionOption.objects.create(question=question_2, text="No", order=2)

indicator = Indicator.objects.create(batch=batch, order=3, identifier="HA27")
question_3 = Question.objects.create(indicator=indicator, text="Do you know of a place where people can go to get tested for the AIDS virus?", answer_type=Question.MULTICHOICE, order=1)
QuestionOption.objects.create(question=question_3, text="Yes", order=1)
QuestionOption.objects.create(question=question_3, text="No", order=2)

indicator = Indicator.objects.create(batch=batch, order=4, identifier="__")
question_4 = Question.objects.create(indicator=indicator, text="Have you ever been tested to see if you have the AIDS virus?", answer_type=Question.MULTICHOICE, order=1)
QuestionOption.objects.create(question=question_4, text="Yes", order=1)
QuestionOption.objects.create(question=question_4, text="No", order=2)

indicator = Indicator.objects.create(batch=batch, order=5, identifier="__")
question_5 = Question.objects.create(indicator=indicator, text="When was the most recent time you were tested?", answer_type=Question.MULTICHOICE, order=1)
QuestionOption.objects.create(question=question_5, text="Less than 12 months ago", order=1)
QuestionOption.objects.create(question=question_5, text="12-23 months ago", order=2)
QuestionOption.objects.create(question=question_5, text="2 or more years ago", order=3)

indicator = Indicator.objects.create(batch=batch, order=6, identifier="HA8")
question_6 = Question.objects.create(indicator=indicator, text="Can the virus that causes AIDS be transmitted from a mother to her baby during pregnancy?", answer_type=Question.MULTICHOICE, order=1)
QuestionOption.objects.create(question=question_6, text="Yes", order=1)
QuestionOption.objects.create(question=question_6, text="No", order=2)

question_7 = Question.objects.create(indicator=indicator, text="Can the virus that causes AIDS be transmitted from a mother to her baby during delivery?", answer_type=Question.MULTICHOICE, order=2)
QuestionOption.objects.create(question=question_7, text="Yes", order=1)
QuestionOption.objects.create(question=question_7, text="No", order=2)

question_8 = Question.objects.create(indicator=indicator, text="Can the virus that causes AIDS be transmitted from a mother to her baby by breastfeeding?", answer_type=Question.MULTICHOICE, order=3)
QuestionOption.objects.create(question=question_8, text="Yes", order=1)
QuestionOption.objects.create(question=question_8, text="No", order=2)

indicator = Indicator.objects.create(batch=batch, order=9, identifier="MT2")
question_9 = Question.objects.create(indicator=indicator, text="How often do you read a newspaper or magazine?", answer_type=Question.MULTICHOICE, order=1)
QuestionOption.objects.create(question=question_9, text="Almost every day", order=1)
QuestionOption.objects.create(question=question_9, text="At least once a week", order=2)
QuestionOption.objects.create(question=question_9, text="Less than once a week", order=3)
QuestionOption.objects.create(question=question_9, text="Not at all", order=4)

question_10 = Question.objects.create(indicator=indicator, text="How often do you listen to the radio?", answer_type=Question.MULTICHOICE, order=2)
QuestionOption.objects.create(question=question_10, text="Almost every day", order=1)
QuestionOption.objects.create(question=question_10, text="At least once a week", order=2)
QuestionOption.objects.create(question=question_10, text="Less than once a week", order=3)
QuestionOption.objects.create(question=question_10, text="Not at all", order=4)

question_11 = Question.objects.create(indicator=indicator, text="How often do you watch television?", answer_type=Question.MULTICHOICE, order=3)
QuestionOption.objects.create(question=question_11, text="Almost every day", order=1)
QuestionOption.objects.create(question=question_11, text="At least once a week", order=2)
QuestionOption.objects.create(question=question_11, text="Less than once a week", order=3)
QuestionOption.objects.create(question=question_11, text="Not at all", order=4)

# Rules
AnswerRule.objects.create(question=question_1, action=AnswerRule.ACTIONS['END_INTERVIEW'], condition=AnswerRule.CONDITIONS['EQUALS'], validate_with_value=0)
69 changes: 69 additions & 0 deletions survey/batch_seeds/batch_e.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
from survey.models import *

survey = Survey.objects.create(name='MICS Uganda 2013', description='MICS Uganda 2013')
batch = Batch.objects.create(survey=survey, order=2, name="Batch E")

indicator = Indicator.objects.create(batch=batch, order=1, identifier="HA1")
question_1 = Question.objects.create(indicator=indicator, text="Can people reduce their chance of getting the AIDS virus by having just one uninfected sex partner who has no other sex partners?", answer_type=Question.MULTICHOICE, order=1)
QuestionOption.objects.create(question=question_1, text="Yes", order=1)
QuestionOption.objects.create(question=question_1, text="No", order=2)
QuestionOption.objects.create(question=question_1, text="Don't know", order=3)

question_2 = Question.objects.create(indicator=indicator, text="Can people get the AIDS virus because of witchcraft or other supernatural means?", answer_type=Question.MULTICHOICE, order=2)
QuestionOption.objects.create(question=question_2, text="Yes", order=1)
QuestionOption.objects.create(question=question_2, text="No", order=2)
QuestionOption.objects.create(question=question_2, text="Don't know", order=3)

question_3 = Question.objects.create(indicator=indicator, text="Can people reduce their chance of getting the AIDS virus by using a condom every time they have sex?", answer_type=Question.MULTICHOICE, order=3)
QuestionOption.objects.create(question=question_3, text="Yes", order=1)
QuestionOption.objects.create(question=question_3, text="No", order=2)
QuestionOption.objects.create(question=question_3, text="Don't know", order=3)

question_4 = Question.objects.create(indicator=indicator, text="Can people get the AIDS virus from mosquito bites?", answer_type=Question.MULTICHOICE, order=4)
QuestionOption.objects.create(question=question_4, text="Yes", order=1)
QuestionOption.objects.create(question=question_4, text="No", order=2)
QuestionOption.objects.create(question=question_4, text="Don't know", order=3)

question_5 = Question.objects.create(indicator=indicator, text="Can people get the AIDS virus by sharing food with a person who has the AIDS virus?", answer_type=Question.MULTICHOICE, order=5)
QuestionOption.objects.create(question=question_5, text="Yes", order=1)
QuestionOption.objects.create(question=question_5, text="No", order=2)
QuestionOption.objects.create(question=question_5, text="Don't know", order=3)

question_6 = Question.objects.create(indicator=indicator, text="Is it possible for a healthy-looking person to have the AIDS virus?", answer_type=Question.MULTICHOICE, order=6)
QuestionOption.objects.create(question=question_6, text="Yes", order=1)
QuestionOption.objects.create(question=question_6, text="No", order=2)
QuestionOption.objects.create(question=question_6, text="Don't know", order=3)

indicator = Indicator.objects.create(batch=batch, order=7, identifier="MT6")
question_7 = Question.objects.create(indicator=indicator, text="In the last 12 months, have you used a computer?", answer_type=Question.MULTICHOICE, order=1)
QuestionOption.objects.create(question=question_7, text="Yes", order=1)
QuestionOption.objects.create(question=question_7, text="No", order=2)

question_8 = Question.objects.create(indicator=indicator, text="During the last one month, how often did you use a computer?", answer_type=Question.MULTICHOICE, order=2)
QuestionOption.objects.create(question=question_8, text="Almost every day", order=1)
QuestionOption.objects.create(question=question_8, text="At least once a week", order=2)
QuestionOption.objects.create(question=question_8, text="Less than once a week", order=3)
QuestionOption.objects.create(question=question_8, text="Not at all", order=4)

question_9 = Question.objects.create(indicator=indicator, text="In the last 12 months, have you used the internet?", answer_type=Question.MULTICHOICE, order=3)
QuestionOption.objects.create(question=question_9, text="Yes", order=1)
QuestionOption.objects.create(question=question_9, text="No", order=2)

question_10 = Question.objects.create(indicator=indicator, text="During the last one month, how often did you use the internet?", answer_type=Question.MULTICHOICE, order=4)
QuestionOption.objects.create(question=question_10, text="Almost every day", order=1)
QuestionOption.objects.create(question=question_10, text="At least once a week", order=2)
QuestionOption.objects.create(question=question_10, text="Less than once a week", order=3)
QuestionOption.objects.create(question=question_10, text="Not at all", order=4)

indicator = Indicator.objects.create(batch=batch, order=11, identifier="LS14")
question_11 = Question.objects.create(indicator=indicator, text="Compared to this time last year, would you say that your life has improved, stayed more or less the same, or worsened, overall?", answer_type=Question.MULTICHOICE, order=1)
QuestionOption.objects.create(question=question_11, text="Improved", order=1)
QuestionOption.objects.create(question=question_11, text="More or less the same", order=2)
QuestionOption.objects.create(question=question_11, text="Worsened", order=3)

question_12 = Question.objects.create(indicator=indicator, text="And in one year from now, do you expect that your life will be better, will be more or less the same, or will be worse, overall?", answer_type=Question.MULTICHOICE, order=2)
QuestionOption.objects.create(question=question_12, text="Better", order=1)
QuestionOption.objects.create(question=question_12, text="More or less the same", order=2)
QuestionOption.objects.create(question=question_12, text="Worsened", order=3)

# Rules

0 comments on commit e35dda4

Please sign in to comment.