Outgoing messages can use Mustache templating to insert certain variables and use certain data formats.
For examples, you can check out the standard config. Note that it uses translation keys for the message contents.
For the latest list, checkout the formatters
in medic-sentinel
date
: example
Displays dates according to the date_format
specified in app_settings. See doc for Moment.js format for details.
datetime
: example
Displays dates according to the reported_date_format
specified in app_settings. See doc for Moment.js format for details.
bikram_sambat_date
Displays dates in Bikram Sambat calendar (most commonly used calendar in Nepal). Currently display format is hardocded to e.g. "१५ चैत २०७३", see code.
You can insert special variables relating to the patient and/or the CHW in the messages.
Sentinel exposes values from the report
doc.
-
clinic
is the nearestclinic
parent. Typicallyclinic
type docs are CHW areas. To figure that out, check out for instance theplaces_by_type_parent_id_name
view onmedic-client
design doc in couch (Bad link? Try CouchDB 1 link). -
contact
is the Primary Contact attached to theclinic
. To see examples, check out thecontacts_by_type
view onmedic-client
design doc in couch (Bad link? Try CouchDB 1 link). -
form fields : sentinel also exposes the
fields
property of the reports doc, e.g.patient_name
andpatient_id
. That depends on what fields are in the corresponding form. To see reports in your DB and check out what's infields
, look at thereports_by_date
view onmedic-client
ddoc for instance (Bad link? Try CouchDB 1 link). -
fields added by registration transition triggers, like
patient_id
field added byadd_patient_id
trigger,expected_date
field added byadd_expected_date
trigger,birth_date
field added byadd_birth_date
trigger.
TODO : What's chw_sms
?