forked from medic/cht-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
kanso.json
1145 lines (1144 loc) · 64.7 KB
/
kanso.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
{
"name": "medic",
"display_name": "Medic Mobile",
"version": "2.9.0",
"description": "Medic Mobile combines SMS messaging, data collection, and analytics for health workers and health systems in hard-to-reach areas with or without internet connectivity.",
"long_description" : "Medic Mobile is a web based SMS data collection and analytics tool focused on community health care workers in rural environments. We help large health organizations collect and analyze data sent from health care workers using ordinary mobile phones.",
"url": "https://github.com/medic/medic-webapp",
"categories": ["health", "sms"],
"icons": {
"16": "static/img/promo/icon_16.png",
"48": "static/img/promo/icon_48.png",
"96": "static/img/promo/icon_96.png",
"128": "static/img/promo/icon_128.png"
},
"promo_images": {
"small": "static/img/promo/promo_small.png"
},
"screenshots": [
"static/img/promo/promo-messages.png",
"static/img/promo/promo-reports.png",
"static/img/promo/promo-analytics.png"
],
"loglevel": "info",
"load": "lib/app",
"modules": ["lib"],
"attachments": [
"static/manifest.json",
"static/audio",
"static/dist",
"static/fonts",
"static/img",
"templates/inbox.html",
"translations",
"ddocs/compiled.json"
],
"changelog": "Changes.md",
"node_module_folders" : "api,sentinel",
"dependencies": {
"modules": null,
"properties": null,
"attachments": null,
"settings": null,
"libphonenumber": null,
"kujua-sms": null,
"kujua-utils": null,
"cookies": null,
"kanso-app-settings": null,
"app-settings": ">=0.0.2",
"url": null,
"querystring": null,
"duality": null,
"kanso-gardener": null
},
"postprocessors": {
"bundle_templates": "scripts/bundle_templates"
},
"status_path": "/status",
"user_data": {
"db_prefix": false,
"available_roles" : ["kujua_user","national_admin","district_admin","kujua_gateway","data_entry"],
"schema": {
"descripton": "Medic Mobile",
"type": "object",
"properties": {
"facility_id": {
"title": "Facility Id",
"type": "string",
"je:hint": "autocompleteSelect2",
"je:url" : "/{{dbname}}/_design/{{ddoc}}/_rewrite/facilities_select2.json"
},
"phone": {
"title": "Phone",
"type": "string"
},
"locale": {
"title": "Locale",
"type": "string",
"description": "Default tries to use best option according to browser settings, you can override that here.",
"default": "en"
}
}
}
},
"settings_schema" : {
"description": "Medic Mobile Settings",
"type": "object",
"properties": {
"locale": {
"title": "Default Locale For Website",
"type": "string",
"description": "The code of the default locale for users logging in to the website. Can be overridden in user settings. Must be one of the codes specified in Locales above.",
"default": "en"
},
"locale_outgoing": {
"title": "Default Locale For Outgoing Messages",
"type": "string",
"description": "The code of the default locale for outgoing messages. Must be one of the codes specified in Locales above.",
"default": "en"
},
"muvuku_webapp_url": {
"type": "string",
"title": "Medic Reporter URL",
"default": "/medic-reporter/_design/medic-reporter/_rewrite/?_embed_mode=2#/examples.json",
"description": "URL for Medic Reporter, a tool to send messages into Medic Mobile from a web interface. Use it to simulate SMS, Medic Collect or Simapp reports."
},
"date_format": {
"type": "string",
"title": "Date Format",
"default": "DD-MMM-YYYY",
"description": "Format used to display dates."
},
"reported_date_format": {
"type": "string",
"title": "DateTime Format",
"default": "DD-MMM-YYYY HH:mm:ss",
"description": "Format used to display dates and times."
},
"forms_only_mode": {
"type": "boolean",
"title": "Only Expect Forms",
"default": false,
"description": "All incoming messages will be parsed as forms. Unstractured messages will be rejected."
},
"default_responses": {
"title": "Auto-replies",
"type": "object",
"description": "When an empty message or badly formatted report is received, an error auto-reply message is sent out. When forms_only_mode is off, received messages will trigger a confirmation auto-reply message. All reply messages are generated based on translation and locale settings.",
"properties": {
"start_date": {
"type": "string",
"title": "Start Date",
"default": "",
"description": "Auto-replies are added to messages received after this date. If left empty auto-replies are not added. Use the format YYYY-MM-DD to define the date, for example 2014-03-27.",
"pattern": "(^[0-9]{4}\\-[0-9]{2}\\-[0-9]{2}\\s*$|^\\s*$)"
}
}
},
"district_admins_access_unallocated_messages": {
"type": "boolean",
"title": "Allow District Admins To View Unallocated Messages",
"default": false,
"description": "If checked/true, district administrators will be able to view messages with no allocated facility as well as messages from their district. If unchecked/false, only admins will see unallocated messages."
},
"default_country_code": {
"type": "integer",
"title": "Default Country Code",
"description": "Messages without a country code will be assigned this country code.",
"default": 1
},
"gateway_number": {
"type": "string",
"title": "Gateway Number",
"description": "This is the number where mobile reporters should send their reports. It is also the number they will receive messages from. Auto-replies will not be sent to this number to avoid message loops."
},
"outgoing_phone_replace": {
"title": "Outgoing Phone Replacement",
"type": "object",
"description": "Use this to reformat the numbers for outgoing messages. Medic Mobile uses international format for phone numbers, so if your gateway doesn't support it use this setting. Otherwise leave blank.",
"properties": {
"match": {
"type": "string",
"title": "Match",
"description": "The prefix to match. e.g. +997"
},
"replace": {
"type": "string",
"title": "Replace with",
"description": "The value to replace the match with"
}
}
},
"outgoing_phone_filters": {
"title": "Outgoing Phone Filters",
"type": "array",
"description": "These filters are applied to every phone number on an outgoing message. This can be useful if your incoming phone number and outgoing phone number formats are slightly different.",
"items": {
"type": "object",
"properties": {
"match": {
"type": "string",
"title": "Match",
"description": "A regular expression used to match a phone number. e.g. \\+997"
},
"replace": {
"type": "string",
"title": "Replace with",
"description": "Replace the match with this value."
}
}
}
},
"schedule_morning_hours" : {
"title": "Scheduled Message Morning Hours",
"description": "Only send messages on or after this hour.",
"type": "integer",
"default": 0
},
"schedule_morning_minutes" : {
"title": "Scheduled Message Morning Minutes",
"description": "Only send messages on or after this minute.",
"type": "integer",
"default": 0
},
"schedule_evening_hours" : {
"title": "Scheduled Message Evening Hours",
"description": "Only send messages on or before this hour.",
"type": "integer",
"default": 23
},
"schedule_evening_minutes" : {
"title": "Scheduled Message Evening Minutes",
"description": "Only send messages on or before this minute.",
"type": "integer",
"default": 0
},
"synthetic_date" : {
"title": "Synthetic date",
"description": "Only use this if you are testing message scheduling and want to simulate a specific date. e.g. 201304121200",
"type": "string",
"pattern": "(^[0-9]{12}$|^$)"
},
"id_format": {
"title": "Patient ID Format",
"type": "string",
"default": "1111",
"description": "Format of generated numerical identifiers. Note, an extra check digit is always used, so the default value (1111) generates a length of 5, e.g. '92345'."
},
"contact_display_short": {
"type": "string",
"title": "Short Contact Display",
"description": "How to render the contact name in short format? e.g. clinic.name, clinic.contact.name, clinic.parent.name",
"default": "clinic.name"
},
"statistics_submission": {
"type": "string",
"title": "Anonymous Statistics Submission",
"description": "Whether and how to submit anonymous statistics. Valid values: 'none', 'web', 'sms', 'both'",
"default": "none"
},
"statistics_submission_number": {
"type": "string",
"title": "Anonymous Statistics Submission SMS Number",
"description": "The phone number to send Anonymous Statistics to."
},
"kujua-reporting": {
"title": "Scheduled Reports",
"type": "array",
"description": "The forms to include in reporting rates stats.",
"items": {
"type": "object",
"properties": {
"code": {
"type": "string",
"title": "Form Code",
"description": "e.g. ZDIS"
},
"reporting_freq": {
"type": "string",
"title": "Frequency",
"default": "weekly",
"enum": [
"weekly",
"monthly"
]
}
}
},
"default": []
},
"anc_forms": {
"title": "ANC Reports",
"type": "object",
"description": "Define your ANC related form codes here, these forms will be used to generate analytics.",
"properties": {
"registration": {
"type": "string",
"title": "Pregnancy Registration Form Code",
"description": "e.g. R"
},
"registrationLmp": {
"type": "string",
"title": "Pregnancy Registration LMP Form Code",
"description": "e.g. P"
},
"visit": {
"type": "string",
"title": "Completed ANC Visit Form Code",
"description": "e.g. V"
},
"delivery": {
"type": "string",
"title": "Delivery Report Form Code",
"description": "e.g. D"
},
"flag": {
"type": "string",
"title": "Flag Pregnancy Form Code",
"description": "e.g. F"
}
}
},
"replication_depth": {
"title": "Replication depth",
"type": "array",
"description": "Defines how many levels of contacts and their reports to replicate to users with the given role. 1 = they can see their reports and children, 2 = they can see their children's reports and children, etc.",
"items": {
"type": "object",
"properties": {
"role": {
"title": "Role",
"type": "string"
},
"depth": {
"title": "Depth",
"type": "integer"
}
}
}
},
"permissions": {
"title": "Permissions",
"type": "array",
"description": "Defines which users can access which features of the webapp.",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"title": "Permission",
"description": "e.g. can_view_data_records @garethbowen Should this be an enum? Can you make up your own permissions?"
},
"roles": {
"title": "Roles",
"type": "array",
"default": [],
"description": "e.g. ['national_admin', district_admin]. You can edit each user's roles in the config pages of Medic Mobile.",
"items": {
"type": "string"
}
}
}
}
},
"alerts": {
"title": "Alerts",
"type": "array",
"description": "Send alert messages when specific conditions are received through reports. E.g. send email to Roberta when we're running out of medicine X.",
"items": {
"type": "object",
"properties": {
"form": {
"type": "string",
"title": "Form Code",
"description": "e.g. STCK"
},
"condition": {
"type": "string",
"je:hint": "textarea",
"je:textarea": {
"rows": 2
},
"title": "Condition To Send Alerts",
"description": "Alert will be sent when condition is true. Build condition using the notation `form_code(reports_ago).field_id`. E.g.: The following can be used to send an alert if the value of `s1_avail` in form `STCK` falls below the three month average of `s1_used`: \"STCK(0).s1_avail < (STCK(0).s1_used + STCK(1).s1_used + STCK(2).s1_used ) / 3\"."
},
"message": {
"type": "string",
"je:hint": "textarea",
"je:textarea": {
"rows": 2
},
"title": "Alert Text",
"description": "Text that will be sent out in the alert. Variables names can be used. E.g.: {{clinic.name}}, {{s1_name}}."
},
"recipient": {
"type": "string",
"title": "Send Alerts To",
"description": "The email or phone number to receive alerts. Can also use variable name to receive alert. E.g.: reporting_unit, parent, grandparent, [email protected], +15559870000"
}
}
}
},
"reminders": {
"title": "Scheduled Report Reminders",
"type": "array",
"description": "Configure this for forms that should be reported on a repetitive schedule.",
"items": {
"type": "object",
"properties": {
"form": {
"type": "string",
"title": "Reminder Form Code",
"description": "What form is this reminder for? e.g. ZDIS"
},
"text_expression": {
"type": "string",
"title": "Reminder Text Configuration",
"description": "A text expression definition of the schedule. See http://bunkat.github.io/later/parsers.html#text e.g. at 9am on Monday"
},
"cron": {
"type": "string",
"title": "Reminder Cron Configuration",
"description": "A cron definition of the schedule. Optional, a text expression will override this. e.g. weekly on Monday at 9am: '0 9 * * 1'"
},
"mute_after_form_for": {
"type": "string",
"title": "Mute Reminders For",
"description": "After receiving a form, how long to mute reminders for. Supported units: years, months, weeks, days, hours, minutes. e.g. 5 days"
},
"message": {
"type": "string",
"title": "Reminder Text",
"description": "Message to be sent. The following strings will be substituted into the message: {{week}}, {{year}} and {{form}}.",
"je:hint": "textarea",
"je:textarea": {
"rows": 2
}
}
}
}
},
"registrations": {
"title": "Report Actions",
"type": "array",
"description": "Actions that can be taken when a report comes in. E.g. validate the report fields, send a reply message, assign an id to the registered patient, assign a schedule (see 'Schedules' section)",
"items": {
"type": "object",
"properties": {
"form": {
"type": "string",
"title": "Form",
"description": "Form code for which to trigger actions. e.g. ANCR"
},
"events": {
"type": "array",
"name": "Triggered actions",
"description": "Trigger specific actions, e.g. a report is created in the system (on_create).",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"title": "Event Name",
"description": "Name of the event.",
"default": "on_create",
"enum": ["on_create"],
"je:hint": "enumlabels",
"je:enumlabels": {
"on_create": "On Create"
}
},
"trigger": {
"type": "string",
"title": "Triggered action",
"default": "assign_schedule",
"description": "Action triggered when form is received, e.g. enrolling in a schedule.",
"enum": ["assign_schedule", "add_patient_id", "add_expected_date", "add_birth_date"],
"je:hint": "enumlabels",
"je:enumlabels": {
"assign_schedule": "Assign a schedule",
"add_patient_id": "Add Patient ID",
"add_expected_date": "Add Expected Date",
"add_birth_date": "Add Birth Date"
}
},
"params": {
"type": "string",
"title": "Parameters",
"description": "i.e. if assigning a schedule provide the name. It has to match an existing schedule name, see 'Schedules' section."
},
"bool_expr": {
"type": "string",
"title": "Boolean expression",
"description": "If this expression evaluates to false the trigger will be skipped."
}
}
},
"default": []
},
"validations": {
"type": "object",
"description": "Specify the contraints that form fields should follow (e.g. patient_name should have more that 3 characters), to reject invalid reports.",
"properties": {
"join_responses": {
"title": "Join Validation Responses",
"type": "boolean",
"description": "By default we send one validation response at a time. Use this option to join or concatenate all validation response messages in one. Note, like all outgoing messages it will be truncated at 160 characters."
},
"list": {
"type": "array",
"items": {
"type": "object",
"properties": {
"property": {
"type": "string",
"title": "Property",
"description": "The property on the JSON form to validate. e.g. patient_name"
},
"rule": {
"type": "string",
"title": "Validation Rule",
"description": "The <a href='/medic/_design/medic/_rewrite/#/help/validation' rel='external'>validation rule</a>. Backslashes must be double escaped. e.g. lenMin(5) && lenMax(50)"
},
"message": {
"type": "array",
"title": "Response Message",
"description": "The response when validation fails. <a href='/medic/_design/medic/_rewrite/#/help/messages' rel='external'>Mustache</a> templating is supported.",
"items": {
"type": "object",
"properties": {
"content": {
"type": "string",
"title": "Message Content",
"description": "e.g. '{{patient_name}}' is not a valid patient name. Please submit a patient name between 5 and 50 characters.",
"je:hint": "textarea",
"je:textarea": {
"rows": 2
}
},
"locale": {
"title": "Locale",
"type": "string",
"description": "Set the locale if you need to support responses in multiple languages. e.g. en"
}
}
},
"default": []
}
}
}
}
}
},
"messages": {
"type": "array",
"title": "Response Messages",
"description": "When a report is valid, Medic Mobile sends a response message. If the report is invalid, see 'validations'.",
"items": {
"type": "object",
"properties": {
"message": {
"type": "array",
"title": "Message",
"description": "<a href='/medic/_design/medic/_rewrite/#/help/messages' rel='external'>Mustache</a> templating is supported",
"items": {
"type": "object",
"properties": {
"content": {
"type": "string",
"title": "Message Content",
"je:hint": "textarea",
"je:textarea": {
"rows": 2
}
},
"locale": {
"title": "Locale",
"type": "string",
"description": "Set the locale if you need to support responses in multiple languages. e.g. en"
}
}
},
"default": []
},
"recipient": {
"type": "string",
"title": "Recipient",
"description": "Contact to recieve the message. Use a field name on registration form or one of the following to reference the facility: reporting_unit, parent, grandparent. e.g. reporting_unit"
}
}
},
"default": []
}
}
}
},
"patient_reports": {
"title": "Patient Reports",
"description": "To clear reminder schedules define your visit forms here.",
"type": "array",
"items": {
"type": "object",
"properties": {
"form": {
"type": "string",
"title": "Report Form",
"description": "Form code of the report. e.g. ANCV"
},
"name": {
"type": "string",
"title": "Display Name e.g. Visits"
},
"format": {
"type": "string",
"title": "Expected Format e.g. V <patientid>"
},
"silence_type": {
"type": "string",
"title": "Schedule Name",
"description": "Name of reminder schedule(s) to clear after receiving this report. Name needs to match exactly, e.g. ANC Reminders. If you need to support clearing multiple schedules then separate the names with commas."
},
"silence_for": {
"type": "string",
"title": "Silence Window",
"description": "The length of time used to find the next reminder group to clear. Leave blank to clear all reminder groups. Supported units: years, months, weeks, days, hours, minutes. e.g. 25 days"
},
"fields": {
"title": "Fields",
"type": "array",
"description": "Available field names for use in validations",
"items": {
"type": "object",
"properties": {
"field_name": {
"type": "string",
"title": "Field Name"
},
"title": {
"type": "string",
"title": "Display Name"
}
}
},
"default": []
},
"validations": {
"type": "object",
"properties": {
"join_responses": {
"title": "Join Validation Responses",
"type": "boolean",
"description": "By default we send one validation response at a time. Use this option to join or concatenate all validation response messages in one. Note, like all outgoing messages it will be truncated at 160 characters."
},
"list": {
"type": "array",
"items": {
"type": "object",
"properties": {
"property": {
"type": "string",
"title": "Property",
"description": "The property on the JSON form to validate. e.g. patient_id"
},
"rule": {
"type": "string",
"title": "Validation Rule",
"description": "The <a href='/medic/_design/medic/_rewrite/#/help/validation' rel='external'>validation rule</a>. Backslashes must be double escaped. e.g. regex('[0-9]{5}')"
},
"message": {
"title": "Response Message",
"type": "array",
"description": "The response when validation fails. <a href='/medic/_design/medic/_rewrite/#/help/messages' rel='external'>Mustache</a> templating is supported.",
"items": {
"type": "object",
"properties": {
"content": {
"type": "string",
"title": "Message Content",
"description": "e.g. '{{patient_id}}' is not a valid.",
"je:hint": "textarea",
"je:textarea": {
"rows": 2
}
},
"locale": {
"title": "Locale",
"type": "string",
"description": "e.g. en"
}
}
},
"default": []
}
}
}
}
}
},
"messages": {
"type": "array",
"title": "Response Messages",
"items": {
"type": "object",
"properties": {
"message": {
"type": "array",
"title": "Message Text",
"description": "<a href='/medic/_design/medic/_rewrite/#/help/messages' rel='external'>Mustache</a> templating is supported",
"items": {
"type": "object",
"properties": {
"content": {
"type": "string",
"title": "Message Content",
"description": "e.g. '{{patient_id}}' is not a valid.",
"je:hint": "textarea",
"je:textarea": {
"rows": 2
}
},
"locale": {
"title": "Locale",
"type": "string",
"description": "e.g. en"
}
}
},
"default": []
},
"event_type": {
"type": "string",
"title": "Event Type",
"description": "What should trigger this message?",
"default": "report_accepted",
"enum": [
"report_accepted",
"registration_not_found"
],
"je:hint": "enumlabels",
"je:enumlabels": {
"report_accepted": "Report Accepted",
"registration_not_found": "Registration Not Found"
}
},
"recipient": {
"type": "string",
"title": "Recipient",
"description": "Contact to recieve the message. Use a field name on registration form or one of the following to reference the facility: reporting_unit, parent, grandparent. e.g. reporting_unit"
}
}
},
"default": []
}
}
},
"default": []
},
"schedules": {
"description": "Schedules are lists of messages that will be sent out periodically. You can trigger them when specific reports come in, see 'Form Actions'. When a schedule is attached to a report, you will see the list of messages at the bottom of the report in Medic Mobile. Within the schedule, messages are organized in groups. E.g. in a schedule of ANC visit reminders, there is a group of messages for each visit: one message 1 week before, one message on the due date, one message 1 week after. The message groups are cleared by visit reports that are configured in the previous section.",
"title": "Schedules",
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"title": "Name",
"description": "A unique name to define this schedule. e.g. ANC Reminders"
},
"summary": {
"type": "string",
"title": "Summary",
"description": "A brief summary of this schedule"
},
"description": {
"type": "string",
"title": "Description",
"description": "A complete description of this schedule in <a href=\"http://daringfireball.net/projects/markdown/syntax\">markdown format</a>",
"je:hint": "textarea",
"je:textarea": {
"rows": 2
}
},
"start_from": {
"type": "string",
"title": "Timestamp Property Name",
"description": "A timestamp or date property on the record that is used to calculate when messages are sent. e.g. lmp_date. Use reported_date if you want to reference the date and time the report was received."
},
"messages": {
"type": "array",
"title": "Messages",
"description": "<a href='/medic/_design/medic/_rewrite/#/help/messages' rel='external'>Mustache</a> templating is supported",
"items": {
"type": "object",
"properties": {
"message": {
"type": "array",
"items": {
"type": "object",
"properties": {
"content": {
"type": "string",
"title": "Message Content",
"je:hint": "textarea",
"je:textarea": {
"rows": 2
}
},
"locale": {
"title": "Locale",
"type": "string",
"description": "Set the locale if you need to support responses in multiple languages. e.g. en"
}
}
},
"default": []
},
"group": {
"type": "integer",
"title": "Message Group Number",
"default": 1,
"description": "You can group messages together by assigning a group number, e.g. 1. Messages in the same group will be cleared together."
},
"offset": {
"type": "string",
"title": "Send Message After",
"description": "This value is added to the timestamp property value to determine when to send the message. Supported units: years, months, weeks, days, hours, minutes. e.g. 5 days"
},
"send_day": {
"type": "string",
"title": "Send Day",
"default": "monday",
"description": "Optionally specify the nearest day to offset.",
"enum": ["", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday"],
"je:hint": "enumlabels",
"je:enumlabels": {
"": "",
"monday": "Monday",
"tuesday": "Tuesday",
"wednesday": "Wednesday",
"thursday": "Thursday",
"friday": "Friday",
"saturday": "Saturday",
"sunday": "Sunday"
}
},
"send_time": {
"type": "string",
"title": "Send Time",
"description": "Specify time of day at which the message is to be sent. Ignored if blank. If timezone offset is not specfiied GMT will be used. e.g. 20:30 +0300",
"pattern": "(^[0-9]{1,2}:[0-9]{2}\\s*(\\s+[\\+\\-][0-9]{4})?$|^\\s*$)"
},
"recipient": {
"type": "string",
"title": "Recipient",
"description": "Contact to recieve the message. Use a field name on registration form or one of the following to reference the facility: reporting_unit, parent, grandparent. e.g. reporting_unit"
}
}
},
"default": []
}
}
}
},
"notifications": {
"title": "Notifications",
"type": "object",
"description": "Define the forms that are used to enable or disable all scheduled messages for a reporter/recipient.",
"properties": {
"off_form": {
"type": "string",
"title": "Stop Notifications Form",
"description": "When receiving a form of this type, stop sending notifications. e.g. OFF"
},
"on_form": {
"type": "string",
"title": "Resume Notifications Form",
"description": "When receiving a form of this type, resume sending notifications. e.g. ON"
},
"confirm_deactivation": {
"type": "boolean",
"title": "Confirm Muting Notifications?",
"description": "Disable stopping of notification based on form submission, administrators are notified instead."
},
"validations": {
"type": "object",
"properties": {
"join_responses": {
"title": "Join Validation Responses",
"type": "boolean",
"description": "By default we send one validation response at a time. Use this option to join or concatenate all validation response messages in one. Note, like all outgoing messages it will be truncated at 160 characters."
},
"list": {
"type": "array",
"items": {
"type": "object",
"properties": {
"property": {
"type": "string",
"title": "Property",
"description": "The property on the JSON form to validate. e.g. patient_id"
},
"rule": {
"type": "string",
"title": "Validation Rule",
"description": "The <a href='/medic/_design/medic/_rewrite/#/help/validation' rel='external'>validation rule</a>. Backslashes must be double escaped. e.g. regex('[0-9]{5}')"
},
"message": {
"title": "Response Message",
"type": "array",
"description": "The response when validation fails. <a href='/medic/_design/medic/_rewrite/#/help/messages' rel='external'>Mustache</a> templating is supported.",
"items": {
"type": "object",
"properties": {
"content": {
"type": "string",
"title": "Message Content",
"description": "e.g. '{{patient_id}}' is not a valid.",
"je:hint": "textarea",
"je:textarea": {
"rows": 2
}
},
"locale": {
"title": "Locale",
"type": "string",
"description": "e.g. en"
}
}
},
"default": []
}
}
}
}
}
},
"messages": {
"type": "array",
"title": "Response Messages",
"items": {
"type": "object",
"properties": {
"message": {
"type": "array",
"title": "Message",
"description": "<a href='/medic/_design/medic/_rewrite/#/help/messages' rel='external'>Mustache</a> templating is supported",
"items": {
"type": "object",
"properties": {
"content": {
"type": "string",
"title": "Message Content",
"je:hint": "textarea",
"je:textarea": {
"rows": 2
}
},
"locale": {
"title": "Locale",
"type": "string",
"description": "Set the locale if you need to support responses in multiple languages. e.g. en"
}
}
},
"default": []
},
"event_type": {
"type": "string",
"title": "Event Type",
"description": "What should trigger this message?",
"default": "patient_not_found",
"enum": [
"patient_not_found",
"confirm_deactivation",
"on_mute",
"on_unmute"
],
"je:hint": "enumlabels",
"je:enumlabels": {
"patient_not_found": "Patient Not Found",
"confirm_deactivation": "Confirm Deactivation",
"on_mute": "On Mute",
"on_unmute": "On Unmute"
}
},
"recipient": {
"type": "string",
"title": "Recipient",
"description": "Contact to recieve the message. Use a field name on registration form or one of the following to reference the facility: reporting_unit, parent, grandparent. e.g. reporting_unit"
}
}
},
"default": []
}
}
},
"tasks": {
"title": "Task Generation",
"description": "Starting v2.6.0, Medic Mobile computes tasks and targets for each user. Tasks are actions the user has to do (e.g. go see Marie and remind her the ANC visit is due.). Targets are visualization of how far they are in their monthly goals (e.g. register 5 new patients this month).",
"type": "object",
"properties": {
"rules": {
"title": "Rules",
"type": "string",
"description": "Tasks and targets are defined by set a <a href='https://github.com/C2FO/nools#dsl' rel='external'>Nools DSL</a> rules. The rules define the events, and the 'Tasks' and 'Targets' config define when and how the tasks are diplayed.",
"je:hint": "textarea",
"je:textarea": {
"rows": 20
}
},
"targets": {
"title": "Targets",
"type": "object",
"properties": {
"enabled": {
"title": "Enabled",
"type": "boolean"
},
"items": {