childcount.forms

Please see with ChildCount+ for information on what forms and commands are.

childcount.forms.CCForm

class childcount.forms.CCForm.CCForm(message, date, chw, params, health_id)[source]

An abstract class to hold the logic for an SMS form.

Parameters:
  • message (rapidsms.Message) – SMS message being processed by this form
  • date (datetime.datetime) – Encounter date of this form
  • chw (childcount.models.CHW) – CHW who submitted this form
  • params (list) – Parameters passed to this form (as in sys.argv())
  • health_id (str) – Health ID for the encounter’s patient
MULTIPLE_PATIENTS = True
PREFIX = '+'

The character prefix that should precede the form keyword. We use “+” everywhere to keep things standardized.

post_process(forms_list)[source]

Processing to be done after all process() has been called on all submitted forms.

Parameters:forms_list (list of instantiated childcount.forms.CCForm objects) – List of successfully processed forms
pre_process()[source]

Processing to be done by this form before the patient’s health ID is validated.

This method used primarily for patient registration – when the health ID is not valid until the registration has completed. See apps/childcount/forms/PatientRegistrationForm.py for an example.

process(patient)[source]

Processing to be done by this form once the encounter patient has been identified. Most forms implement their validation and DB logic here.

Pre-Defined Forms

All ChildCount+ forms are defined in :file:’apps/childcount/forms/‘. Before writing a new form, check to see if someone has already written a form that suits your application.