myvoice-nigeria/myvoice — pull request #225 by boyombo (2014-08-25 06:29:35+00:00)
Title: Textit questions

These changes are to help make the system more flexible, so that questions can be changed without affecting the meanings of previous surveys.
1. Major report parameters are calculated when a SurveyQuestionResponse is saved:
patient_satisfaction, survey_participation, survey_completion (in the Visit model)
positive_response (in SurveyQuestionResponse model)
2. The report headings are de-coupled from the SurveyQuestion labels (which will require that we get more fitting names for the report headings)

Details
---------

Added new fields to Visit model:
- satisfied, survey_started, survey_completed
to match reports that are required.

Also added fields to the SurveyQuestion:
- display_label (so that question labels are de-coupled from headers, etc on reports and potentially multiple questions can be used for same report)
- last_negative (to support the convention of having the last item in a categories list be -ve e.g. 'Wait Time')
- last_required (to indicate that with this response the survey is effectively complete)
- for_satisfaction (to indicate that this question is used in determining patient_satisfaction)

Added a field to SurveyQuestionResponse:
- positive_response (to indicate that the response is a positive one. This removes the need for expensive and complex calculations for reports)