Namibia - Placeholder Event Generation

Remaining work on this document

  • Review the data dictionary for field definitions and skip logic

  • Review the JSON form from the Android Client

  • Export sample forms and fill in the code above.

  • Create a data dictionary for the import

  • Create an Excel template where each row is an event that needs to be built

This scoping document defines the process for building placeholder events in place of missing events that were identified in Namibia in Q4 2019.

Links

January missing event details

Namibia Data Dictionary

Summary

There are a total of 946 missing events that need to be rebuilt with task business status of “Sprayed”, “Partially-Sprayed” or “Not Sprayed”. We need to build a process for creating “placeholder” events that can be posted to the OpenSRP server so that they show up in the Android client. Below is a summary of placeholder events that need to be generated based on operational area and business status:

Village

Partially Sprayed

Sprayed

Not Sprayed

Total

OMUKANDU-1

0

0

1

1

OKANGWENA

0

11

9

20

OSHAKATI EAST

3

3

9

15

EHEKE-2

3

10

3

16

OKAHONGO

6

4

0

10

OMBONDE-1

1

3

0

4

OSHIPUMBU

2

9

8

19

ONAMBANGO NO.1

6

7

0

13

EVULULUKO

66

40

147

253

KANDJENGEDI

49

76

241

366

SKY LOCATION (ONGWEDIVA)

4

3

2

9

NEW RECEPTION

16

12

18

46

ONAWA

0

0

0

0

ONESHILA

0

0

0

0

OMAALALA-2

0

0

0

0

other

2

21

6

29

OSHOOPALA-2

7

28

61

96

OKANDONGWENA

0

0

0

0

SKY (OSHAKATI)

0

6

20

26

OMBUGA YAMUNYOKO

0

0

0

0

EXTENSION 1

0

0

0

0

UUPINDI

7

7

9

23

Total

172

240

534

946

Process

  1. (We are here) Scope and create an excel spreadsheet that defines the fields that need to be captured for the missing events.

  2. Akros will estimate the number of rooms to add for each operational area and share those with Ona

  3. Ona will fill in the spreadsheet template and work with Akros to confirm that the estimated number of rooms will reflect correctly in the totals for each operational area

  4. Convert each row of the spreadsheet to JSON so it can be posted

  5. POST three events, one for each business status, to the Namibia production environment to test that they functions as expected in the Android app

  6. Try to edit the three events in the Android app (offline) and confirm that it is able to save.

  7. Track that event to confirm that the dashboard was updated in the Namibia Web UI

  8. Once confirmed, POST all other events to the Namibia production server

  9. Perform a spot check in the Android app in each operational area to confirm that events were applied correctly.

  10. Review the Namibia dashboards to confirm the numbers are updated

  11. Export the data from Superset and confirm that the events all show up

Expected Outcomes

We expect the following to be achieved through this process:

  1. 946 events need to be generated and posted to the OpenSRP server, one for each missing event identified in the table above and linked document.

  2. Users will be able to see these events in the Android app when they tap a location in the card pop up clearly marked as “Placeholder Event”

  3. Users will be able to edit events to update that location in the plan if they ever visit that location again in the field.

Sample JSON from Namibia Production

This section contains sample code of each event extracted from Namibia’s production environment (identifying information removed).

Namibia Spray Form JSON

{ "count": "1", "encounter_type": "Spray", "entity_id": "", "metadata": { "start": { "openmrs_entity_parent": "", "openmrs_entity": "concept", "openmrs_data_type": "start", "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, "end": { "openmrs_entity_parent": "", "openmrs_entity": "concept", "openmrs_data_type": "end", "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, "today": { "openmrs_entity_parent": "", "openmrs_entity": "encounter", "openmrs_entity_id": "encounter_date" }, "deviceid": { "openmrs_entity_parent": "", "openmrs_entity": "concept", "openmrs_data_type": "deviceid", "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, "subscriberid": { "openmrs_entity_parent": "", "openmrs_entity": "concept", "openmrs_data_type": "subscriberid", "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, "simserial": { "openmrs_entity_parent": "", "openmrs_entity": "concept", "openmrs_data_type": "simserial", "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, "phonenumber": { "openmrs_entity_parent": "", "openmrs_entity": "concept", "openmrs_data_type": "phonenumber", "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, "encounter_location": "" }, "step1": { "title": "Record Spray Status", "display_back_button": "true", "fields": [ { "key": "householdAccessible", "openmrs_entity_parent": "", "openmrs_entity": "", "openmrs_entity_id": "", "type": "native_radio", "label": "Were you able to access this household?", "options": [ { "key": "yes", "text": "Yes" }, { "key": "no", "text": "No" } ], "value": "no", "v_required": { "value": "true", "err": "Required field" } }, { "key": "nSprayableTotal", "openmrs_entity_parent": "", "openmrs_entity": "", "openmrs_entity_id": "", "type": "edit_text", "hint": "# of total sprayable structures", "text_size": "8sp", "v_required": { "value": "true", "err": "Required field" }, "v_numeric": { "value": "true", "err": "Must be a number" }, "v_min": { "value": "0", "err": "Must be greater than or equal to 0" }, "v_max": { "value": "99", "err": "Cannot be greater than 99" }, "relevance": { "rules-engine": { "ex-rules": { "rules-file": "namibia-spray-relevance-rules.yml" } } } }, { "key": "nSprayableZinc", "openmrs_entity_parent": "", "openmrs_entity": "", "openmrs_entity_id": "", "type": "edit_text", "hint": "# of sprayable zinc structures", "text_size": "8sp", "v_required": { "value": "true", "err": "Required field" }, "v_numeric": { "value": "true", "err": "Must be a number" }, "v_min": { "value": "0", "err": "Must be greater than or equal to 0" }, "v_relative_max": { "value": "nSprayableTotal", "err": "Cannot be more than # of total sprayable structures" }, "relevance": { "rules-engine": { "ex-rules": { "rules-file": "namibia-spray-relevance-rules.yml" } } } }, { "key": "nSprayableTrad", "openmrs_entity_parent": "", "openmrs_entity": "", "openmrs_entity_id": "", "type": "edit_text", "hint": "# of sprayable traditional structures", "text_size": "8sp", "v_required": { "value": "true", "err": "Required field" }, "v_numeric": { "value": "true", "err": "Must be a number" }, "v_min": { "value": "0", "err": "Must be greater than or equal to 0" }, "v_relative_max": { "value": "nSprayableTotal", "err": "Cannot be more than # of total sprayable structures" }, "relevance": { "rules-engine": { "ex-rules": { "rules-file": "namibia-spray-relevance-rules.yml" } } } }, { "key": "nSprayableMod", "openmrs_entity_parent": "", "openmrs_entity": "", "openmrs_entity_id": "", "type": "edit_text", "hint": "# of sprayable modern structures", "text_size": "8sp", "v_required": { "value": "true", "err": "Required field" }, "v_numeric": { "value": "true", "err": "Must be a number" }, "v_min": { "value": "0", "err": "Must be greater than or equal to 0" }, "v_relative_max": { "value": "nSprayableTotal", "err": "Cannot be more than # of total sprayable structures" }, "relevance": { "rules-engine": { "ex-rules": { "rules-file": "namibia-spray-relevance-rules.yml" } } } }, { "key": "nSprayableCanopy", "openmrs_entity_parent": "", "openmrs_entity": "", "openmrs_entity_id": "", "type": "edit_text", "hint": "# of sprayable canopy structures", "text_size": "8sp", "v_required": { "value": "true", "err": "Required field" }, "v_numeric": { "value": "true", "err": "Must be a number" }, "v_min": { "value": "0", "err": "Must be greater than or equal to 0" }, "v_cumulative_total": { "value": "nSprayableTotal", "related_fields": [ "nSprayableZinc", "nSprayableTrad", "nSprayableMod" ], "err": "The sum of Zinc, traditional, modern, canopy must equal total number of sprayable structures" }, "relevance": { "rules-engine": { "ex-rules": { "rules-file": "namibia-spray-relevance-rules.yml" } } } }, { "key": "nUnsprayable", "openmrs_entity_parent": "", "openmrs_entity": "", "openmrs_entity_id": "", "type": "edit_text", "hint": "# of structures not sprayable", "text_size": "8sp", "v_required": { "value": "true", "err": "Required field" }, "v_numeric": { "value": "true", "err": "Must be a number" }, "v_min": { "value": "0", "err": "Must be greater than or equal to 0" }, "v_max": { "value": "99", "err": "Cannot be greater than 99" }, "relevance": { "rules-engine": { "ex-rules": { "rules-file": "namibia-spray-relevance-rules.yml" } } } }, { "key": "firstVisitGroupHeading", "openmrs_entity_parent": "", "openmrs_entity": "", "openmrs_entity_id": "", "type": "label", "text": "First Visit or Revisit", "relevance": { "rules-engine": { "ex-rules": { "rules-file": "namibia-spray-relevance-rules.yml" } } } }, { "key": "ableToSprayFirst", "openmrs_entity_parent": "", "openmrs_entity": "", "openmrs_entity_id": "", "type": "native_radio", "label": "Were you able to spray this household on a first visit or re-visit?", "options": [ { "key": "yes", "text": "Yes" }, { "key": "no", "text": "No" } ], "value": "no", "v_required": { "value": "true", "err": "Required field" }, "relevance": { "rules-engine": { "ex-rules": { "rules-file": "namibia-spray-relevance-rules.yml" } } } }, { "key": "nSprayedTotalFirst", "openmrs_entity_parent": "", "openmrs_entity": "", "openmrs_entity_id": "", "type": "edit_text", "hint": "# total structures sprayed", "text_size": "8sp", "v_required": { "value": "true", "err": "Required field" }, "v_numeric": { "value": "true", "err": "Must be a number" }, "v_min": { "value": "0", "err": "Must be greater than or equal to 0" }, "v_max": { "value": "99", "err": "Cannot be greater than 99" }, "v_relative_max": { "value": "nSprayableTotal", "err": "Cannot be more than # of total sprayable structures" }, "relevance": { "rules-engine": { "ex-rules": { "rules-file": "namibia-spray-relevance-rules.yml" } } } }, { "key": "nSprayedDDTFirst", "openmrs_entity_parent": "", "openmrs_entity": "", "openmrs_entity_id": "", "type": "edit_text", "hint": "# structures sprayed with DDT", "text_size": "8sp", "v_required": { "value": "true", "err": "Required field" }, "v_numeric": { "value": "true", "err": "Must be a number" }, "v_min": { "value": "0", "err": "Must be greater than or equal to 0" }, "v_relative_max": { "value": "nSprayableTotal", "err": "Cannot be more than # of total sprayable structures" }, "relevance": { "rules-engine": { "ex-rules": { "rules-file": "namibia-spray-relevance-rules.yml" } } } }, { "key": "nSprayedDeltaFirst", "openmrs_entity_parent": "", "openmrs_entity": "", "openmrs_entity_id": "", "type": "edit_text", "hint": "# structures sprayed with Delta", "text_size": "8sp", "v_required": { "value": "true", "err": "Required field" }, "v_numeric": { "value": "true", "err": "Must be a number" }, "v_min": { "value": "0", "err": "Must be greater than or equal to 0" }, "v_relative_max": { "value": "nSprayableTotal", "err": "Cannot be more than # of total sprayable structures" }, "relevance": { "rules-engine": { "ex-rules": { "rules-file": "namibia-spray-relevance-rules.yml" } } } }, { "key": "nSprayedActellicFirst", "openmrs_entity_parent": "", "openmrs_entity": "", "openmrs_entity_id": "", "type": "edit_text", "hint": "# structures sprayed with Actellic", "text_size": "8sp", "v_required": { "value": "true", "err": "Required field" }, "v_numeric": { "value": "true", "err": "Must be a number" }, "v_min": { "value": "0", "err": "Must be greater than or equal to 0" }, "v_cumulative_total": { "value": "nSprayedTotalFirst", "related_fields": [ "nSprayedDDTFirst", "nSprayedDeltaFirst" ], "err": "The sum of DDT, Delta and Actellic must equal total sprayed" }, "relevance": { "rules-engine": { "ex-rules": { "rules-file": "namibia-spray-relevance-rules.yml" } } } }, { "key": "nUnsprayedTotalFirst", "openmrs_entity_parent": "", "openmrs_entity": "", "openmrs_entity_id": "", "type": "hidden", "calculation": { "rules-engine": { "ex-rules": { "rules-file": "namibia-spray-calculation-rules.yml" } } } }, { "key": "nUnsprayedTotalFirstLabel", "openmrs_entity_parent": "", "openmrs_entity": "", "openmrs_entity_id": "", "type": "toaster_notes", "text": "{nUnsprayedTotalFirst} total structures unsprayed after first visit", "text_color": "#000000", "toaster_type": "info", "calculation": { "rules-engine": { "ex-rules": { "rules-file": "namibia-spray-calculation-rules.yml" } } }, "relevance": { "rules-engine": { "ex-rules": { "rules-file": "namibia-spray-relevance-rules.yml" } } } }, { "key": "nUnsprayedZincFirst", "openmrs_entity_parent": "", "openmrs_entity": "", "openmrs_entity_id": "", "type": "edit_text", "hint": "# of unsprayed zinc structures", "text_size": "8sp", "v_required": { "value": "true", "err": "Required field" }, "v_numeric": { "value": "true", "err": "Must be a number" }, "v_min": { "value": "0", "err": "Must be greater than or equal to 0" }, "v_relative_max": { "value": "nSprayableZinc", "err": "Cannot be more than # of structures of this type" }, "relevance": { "rules-engine": { "ex-rules": { "rules-file": "namibia-spray-relevance-rules.yml" } } } }, { "key": "nUnsprayedTradFirst", "openmrs_entity_parent": "", "openmrs_entity": "", "openmrs_entity_id": "", "type": "edit_text", "hint": "# of unsprayed traditional structures", "text_size": "8sp", "v_required": { "value": "true", "err": "Required field" }, "v_numeric": { "value": "true", "err": "Must be a number" }, "v_min": { "value": "0", "err": "Must be greater than or equal to 0" }, "v_relative_max": { "value": "nSprayableTrad", "err": "Cannot be more than # of structures of this type" }, "relevance": { "rules-engine": { "ex-rules": { "rules-file": "namibia-spray-relevance-rules.yml" } } } }, { "key": "nUnsprayedModFirst", "openmrs_entity_parent": "", "openmrs_entity": "", "openmrs_entity_id": "", "type": "edit_text", "hint": "# of unsprayed modern structures", "text_size": "8sp", "v_required": { "value": "true", "err": "Required field" }, "v_numeric": { "value": "true", "err": "Must be a number" }, "v_min": { "value": "0", "err": "Must be greater than or equal to 0" }, "v_relative_max": { "value": "nSprayableMod", "err": "Cannot be more than # of structures of this type" }, "relevance": { "rules-engine": { "ex-rules": { "rules-file": "namibia-spray-relevance-rules.yml" } } } }, { "key": "nUnsprayedCanopyFirst", "openmrs_entity_parent": "", "openmrs_entity": "", "openmrs_entity_id": "", "type": "edit_text", "hint": "# of unsprayed canopy structures", "text_size": "8sp", "v_required": { "value": "true", "err": "Required field" }, "v_numeric": { "value": "true", "err": "Must be a number" }, "v_min": { "value": "0", "err": "Must be greater than or equal to 0" }, "v_relative_max": { "value": "nSprayableCanopy", "err": "Cannot be more than # of structures of this type" }, "v_cumulative_total": { "value": "nUnsprayedTotalFirst", "related_fields": [ "nUnsprayedZincFirst", "nUnsprayedTradFirst", "nUnsprayedModFirst" ], "err": "The sum of unsprayed Zinc, traditional, modern, canopy must equal total number of unsprayed structures" }, "relevance": { "rules-engine": { "ex-rules": { "rules-file": "namibia-spray-relevance-rules.yml" } } } }, { "key": "unsprayedReasonFirst", "openmrs_entity_parent": "", "openmrs_entity": "", "openmrs_entity_id": "", "type": "native_radio", "label": "Reason for not spraying these structures", "options": [ { "key": "refused", "text": "Refused" }, { "key": "locked", "text": "Locked or no one home" }, { "key": "noAdultHome", "text": "No adult home" } ], "v_required": { "value": "true", "err": "Required field" }, "relevance": { "rules-engine": { "ex-rules": { "rules-file": "namibia-spray-relevance-rules.yml" } } } }, { "key": "refusalReasonFirst", "openmrs_entity_parent": "", "openmrs_entity": "", "openmrs_entity_id": "", "type": "native_radio", "label": "Refusal reason", "options": [ { "key": "pregnantOrNewborn", "text": "Pregnant or Newborn" }, { "key": "sick", "text": "Sick" }, { "key": "notUnderstand", "text": "Does not understand" }, { "key": "other", "text": "Other (specify)" } ], "v_required": { "value": "true", "err": "Required field" }, "relevance": { "rules-engine": { "ex-rules": { "rules-file": "namibia-spray-relevance-rules.yml" } } } }, { "key": "refusalReasonOtherFirst", "openmrs_entity_parent": "", "openmrs_entity": "", "openmrs_entity_id": "", "type": "edit_text", "hint": "Specify other refusal reason", "text_size": "8sp", "v_required": { "value": "true", "err": "A reason must be entered" }, "relevance": { "rules-engine": { "ex-rules": { "rules-file": "namibia-spray-relevance-rules.yml" } } } }, { "key": "mopUpVisit", "openmrs_entity_parent": "", "openmrs_entity": "", "openmrs_entity_id": "", "type": "native_radio", "label": "Register a Mop-up Visit?", "options": [ { "key": "yes", "text": "Yes" }, { "key": "no", "text": "No" } ], "value": "no", "v_required": { "value": "true", "err": "Required field" }, "relevance": { "rules-engine": { "ex-rules": { "rules-file": "namibia-spray-relevance-rules.yml" } } } }, { "key": "mopupVisitGroupHeading", "openmrs_entity_parent": "", "openmrs_entity": "", "openmrs_entity_id": "", "type": "label", "text": "Mop-up Visit", "relevance": { "rules-engine": { "ex-rules": { "rules-file": "namibia-spray-relevance-rules.yml" } } } }, { "key": "mopupStructuresToBeSprayed", "openmrs_entity_parent": "", "openmrs_entity": "", "openmrs_entity_id": "", "type": "hidden", "calculation": { "rules-engine": { "ex-rules": { "rules-file": "namibia-spray-calculation-rules.yml" } } } }, { "key": "mopupStructuresToBeSprayedLabel", "openmrs_entity_parent": "", "openmrs_entity": "", "openmrs_entity_id": "", "type": "toaster_notes", "text": "{mopupStructuresToBeSprayed} structures to be sprayed", "text_color": "#000000", "toaster_type": "info", "calculation": { "rules-engine": { "ex-rules": { "rules-file": "namibia-spray-calculation-rules.yml" } } }, "relevance": { "rules-engine": { "ex-rules": { "rules-file": "namibia-spray-relevance-rules.yml" } } } }, { "key": "nSprayedTotalMop", "openmrs_entity_parent": "", "openmrs_entity": "", "openmrs_entity_id": "", "type": "edit_text", "hint": "# total structures sprayed during mop-up", "text_size": "8sp", "v_required": { "value": "true", "err": "Required field" }, "v_numeric": { "value": "true", "err": "Must be a number" }, "v_min": { "value": "0", "err": "Must be greater than or equal to 0" }, "v_relative_max": { "value": "mopupStructuresToBeSprayed", "err": "Cannot be more than # of structures remaining unsprayed" }, "relevance": { "rules-engine": { "ex-rules": { "rules-file": "namibia-spray-relevance-rules.yml" } } } }, { "key": "nSprayedDDTMop", "openmrs_entity_parent": "", "openmrs_entity": "", "openmrs_entity_id": "", "type": "edit_text", "hint": "# structures sprayed with DDT during mop-up", "text_size": "8sp", "v_required": { "value": "true", "err": "Required field" }, "v_numeric": { "value": "true", "err": "Must be a number" }, "v_min": { "value": "0", "err": "Must be greater than or equal to 0" }, "v_relative_max": { "value": "mopupStructuresToBeSprayed", "err": "Cannot be more than # of structures remaining unsprayed" }, "relevance": { "rules-engine": { "ex-rules": { "rules-file": "namibia-spray-relevance-rules.yml" } } } }, { "key": "nSprayedDeltaMop", "openmrs_entity_parent": "", "openmrs_entity": "", "openmrs_entity_id": "", "type": "edit_text", "hint": "# structures sprayed with Delta during mop-up", "text_size": "8sp", "v_required": { "value": "true", "err": "Required field" }, "v_numeric": { "value": "true", "err": "Must be a number" }, "v_min": { "value": "0", "err": "Must be greater than or equal to 0" }, "v_relative_max": { "value": "mopupStructuresToBeSprayed", "err": "Cannot be more than # of structures remaining unsprayed" }, "relevance": { "rules-engine": { "ex-rules": { "rules-file": "namibia-spray-relevance-rules.yml" } } } }, { "key": "nSprayedActellicMop", "openmrs_entity_parent": "", "openmrs_entity": "", "openmrs_entity_id": "", "type": "edit_text", "hint": "# structures sprayed with Actellic during mop-up", "text_size": "8sp", "v_required": { "value": "true", "err": "Required field" }, "v_numeric": { "value": "true", "err": "Must be a number" }, "v_min": { "value": "0", "err": "Must be greater than or equal to 0" }, "v_cumulative_total": { "value": "nSprayedTotalMop", "related_fields": [ "nSprayedDDTMop", "nSprayedDeltaMop" ], "err": "The sum of DDT, Delta and Actellic must equal total sprayed during mop-up" }, "relevance": { "rules-engine": { "ex-rules": { "rules-file": "namibia-spray-relevance-rules.yml" } } } }, { "key": "nUnsprayedTotalMop", "openmrs_entity_parent": "", "openmrs_entity": "", "openmrs_entity_id": "", "type": "hidden", "calculation": { "rules-engine": { "ex-rules": { "rules-file": "namibia-spray-calculation-rules.yml" } } } }, { "key": "nUnsprayedTotalMopLabel", "openmrs_entity_parent": "", "openmrs_entity": "", "openmrs_entity_id": "", "type": "toaster_notes", "text": "{nUnsprayedTotalMop} total structures unsprayed after mop-up visit", "text_color": "#000000", "toaster_type": "info", "calculation": { "rules-engine": { "ex-rules": { "rules-file": "namibia-spray-calculation-rules.yml" } } }, "relevance": { "rules-engine": { "ex-rules": { "rules-file": "namibia-spray-relevance-rules.yml" } } } }, { "key": "unsprayedReasonMop", "openmrs_entity_parent": "", "openmrs_entity": "", "openmrs_entity_id": "", "type": "native_radio", "label": "Reason for not spraying these structures", "options": [ { "key": "refused", "text": "Refused" }, { "key": "locked", "text": "Locked or no one home" }, { "key": "noAdultHome", "text": "No adult home" } ], "v_required": { "value": "true", "err": "Required field" }, "relevance": { "rules-engine": { "ex-rules": { "rules-file": "namibia-spray-relevance-rules.yml" } } } }, { "key": "refusalReasonMop", "openmrs_entity_parent": "", "openmrs_entity": "", "openmrs_entity_id": "", "type": "native_radio", "label": "Refusal reason", "options": [ { "key": "pregnantOrNewborn", "text": "Pregnant or Newborn" }, { "key": "sick", "text": "Sick" }, { "key": "notUnderstand", "text": "Does not understand" }, { "key": "other", "text": "Other (specify)" } ], "v_required": { "value": "true", "err": "Required field" }, "relevance": { "rules-engine": { "ex-rules": { "rules-file": "namibia-spray-relevance-rules.yml" } } } }, { "key": "refusalReasonOtherMop", "openmrs_entity_parent": "", "openmrs_entity": "", "openmrs_entity_id": "", "type": "edit_text", "hint": "Specify other refusal reason", "text_size": "8sp", "v_required": { "value": "true", "err": "A reason must be entered" }, "relevance": { "rules-engine": { "ex-rules": { "rules-file": "namibia-spray-relevance-rules.yml" } } } }, { "key": "unsprayedReasonHH", "openmrs_entity_parent": "", "openmrs_entity": "", "openmrs_entity_id": "", "type": "native_radio", "label": "Reason for not spraying this household", "options": [ { "key": "refused", "text": "Refused" }, { "key": "locked", "text": "Locked or no one home" }, { "key": "noAdultHome", "text": "No adult home" } ], "v_required": { "value": "true", "err": "Required field" }, "relevance": { "rules-engine": { "ex-rules": { "rules-file": "namibia-spray-relevance-rules.yml" } } } }, { "key": "refusalReasonHH", "openmrs_entity_parent": "", "openmrs_entity": "", "openmrs_entity_id": "", "type": "native_radio", "label": "Refusal reason", "options": [ { "key": "pregnantOrNewborn", "text": "Pregnant or Newborn" }, { "key": "sick", "text": "Sick" }, { "key": "notUnderstand", "text": "Does not understand" }, { "key": "other", "text": "Other (specify)" } ], "v_required": { "value": "true", "err": "Required field" }, "relevance": { "rules-engine": { "ex-rules": { "rules-file": "namibia-spray-relevance-rules.yml" } } } }, { "key": "refusalReasonOtherHH", "openmrs_entity_parent": "", "openmrs_entity": "", "openmrs_entity_id": "", "type": "edit_text", "hint": "Specify other refusal reason", "text_size": "8sp", "v_required": { "value": "true", "err": "A reason must be entered" }, "relevance": { "rules-engine": { "ex-rules": { "rules-file": "namibia-spray-relevance-rules.yml" } } } },{ "key": "popTotal", "openmrs_entity_parent": "", "openmrs_entity": "", "openmrs_entity_id": "", "type": "edit_text", "hint": "# total people living in the homestead/house", "text_size": "8sp", "v_required": { "value": "true", "err": "Required field" }, "v_numeric": { "value": "true", "err": "Must be a number" }, "v_min": { "value": "1", "err": "Must be greater than 0" }, "v_max": { "value": "99", "err": "Cannot be greater than 99" }, "relevance": { "rules-engine": { "ex-rules": { "rules-file": "namibia-spray-relevance-rules.yml" } } } },{ "key": "nPeopleProtected", "openmrs_entity_parent": "", "openmrs_entity": "", "openmrs_entity_id": "", "type": "edit_text", "hint": "# people sleeping in sprayed rooms", "text_size": "8sp", "v_required": { "value": "true", "err": "Required field" }, "v_numeric": { "value": "true", "err": "Must be a number" }, "v_min": { "value": "0", "err": "Must be greater than or equal to 0" }, "v_relative_max": { "value": "popTotal", "err": "Population protected cannot be greater than total population" }, "relevance": { "rules-engine": { "ex-rules": { "rules-file": "namibia-spray-relevance-rules.yml" } } } }, { "key": "nameHoH", "openmrs_entity_parent": "", "openmrs_entity": "", "openmrs_entity_id": "", "type": "edit_text", "hint": "Head of household name", "text_size": "8sp", "is_mandatory": "true", "v_required": { "value": "true", "err": "Required field" }, "relevance": { "rules-engine": { "ex-rules": { "rules-file": "namibia-spray-relevance-rules.yml" } } } }, { "key": "structureType", "openmrs_entity_parent": "", "openmrs_entity": "", "openmrs_entity_id": "", "type": "hidden", "value": "Residential" }, { "key": "business_status", "openmrs_entity_parent": "", "openmrs_entity": "", "openmrs_entity_id": "", "type": "hidden", "calculation": { "rules-engine": { "ex-rules": { "rules-file": "namibia-spray-calculation-rules.yml" } } } } ] } }

Sample Spray Event (THIS IS WHAT THE OUTPUT SHOULD LOOK LIKE)

This demonstrates a complete sample spray event. The subsequent samples show form data that has been processed after the ETL process and are available in the data warehouse. You can access this event by accessing https://reveal-na.smartregister.org/opensrp/rest/event/findById?id=8333c67a-8dba-4afb-8f20-75dddce31e6f You can access the task for this event at https://reveal-na.smartregister.org/opensrp/rest/task/58b5e8ca-3b72-4133-a9ee-080bbdc35445

 

{ "type": "Event", "dateCreated": 1574875038051, "serverVersion": 1574875037950, "clientApplicationVersion": 7, "clientDatabaseVersion": 3, "identifiers": {}, "baseEntityId": "12d208b7-963d-4292-a011-3a69828a7fd6", "locationId": "4748ec18-d398-11e9-bb65-2a2ae2dbcce4", "eventDate": 1574719200000, "eventType": "Spray", "formSubmissionId": "3b790d75-8517-4868-a95a-a0ebfed3f326", "providerId": "username", "duration": 0, "obs": [ { "fieldType": "formsubmissionField", "fieldDataType": "text", "fieldCode": "householdAccessible", "parentCode": "", "values": [ "yes" ], "comments": null, "formSubmissionField": "householdAccessible", "effectiveDatetime": null, "humanReadableValues": [] }, { "fieldType": "formsubmissionField", "fieldDataType": "text", "fieldCode": "nSprayableTotal", "parentCode": "", "values": [ "15" ], "comments": null, "formSubmissionField": "nSprayableTotal", "effectiveDatetime": null, "humanReadableValues": [] }, { "fieldType": "formsubmissionField", "fieldDataType": "text", "fieldCode": "nSprayableZinc", "parentCode": "", "values": [ "2" ], "comments": null, "formSubmissionField": "nSprayableZinc", "effectiveDatetime": null, "humanReadableValues": [] }, { "fieldType": "formsubmissionField", "fieldDataType": "text", "fieldCode": "nSprayableTrad", "parentCode": "", "values": [ "2" ], "comments": null, "formSubmissionField": "nSprayableTrad", "effectiveDatetime": null, "humanReadableValues": [] }, { "fieldType": "formsubmissionField", "fieldDataType": "text", "fieldCode": "nSprayableMod", "parentCode": "", "values": [ "11" ], "comments": null, "formSubmissionField": "nSprayableMod", "effectiveDatetime": null, "humanReadableValues": [] }, { "fieldType": "formsubmissionField", "fieldDataType": "text", "fieldCode": "nSprayableCanopy", "parentCode": "", "values": [ "0" ], "comments": null, "formSubmissionField": "nSprayableCanopy", "effectiveDatetime": null, "humanReadableValues": [] }, { "fieldType": "formsubmissionField", "fieldDataType": "text", "fieldCode": "nUnsprayable", "parentCode": "", "values": [ "0" ], "comments": null, "formSubmissionField": "nUnsprayable", "effectiveDatetime": null, "humanReadableValues": [] }, { "fieldType": "formsubmissionField", "fieldDataType": "text", "fieldCode": "ableToSprayFirst", "parentCode": "", "values": [ "yes" ], "comments": null, "formSubmissionField": "ableToSprayFirst", "effectiveDatetime": null, "humanReadableValues": [] }, { "fieldType": "formsubmissionField", "fieldDataType": "text", "fieldCode": "nSprayedTotalFirst", "parentCode": "", "values": [ "15" ], "comments": null, "formSubmissionField": "nSprayedTotalFirst", "effectiveDatetime": null, "humanReadableValues": [] }, { "fieldType": "formsubmissionField", "fieldDataType": "text", "fieldCode": "nSprayedDDTFirst", "parentCode": "", "values": [ "0" ], "comments": null, "formSubmissionField": "nSprayedDDTFirst", "effectiveDatetime": null, "humanReadableValues": [] }, { "fieldType": "formsubmissionField", "fieldDataType": "text", "fieldCode": "nSprayedDeltaFirst", "parentCode": "", "values": [ "15" ], "comments": null, "formSubmissionField": "nSprayedDeltaFirst", "effectiveDatetime": null, "humanReadableValues": [] }, { "fieldType": "formsubmissionField", "fieldDataType": "text", "fieldCode": "nSprayedActellicFirst", "parentCode": "", "values": [ "0" ], "comments": null, "formSubmissionField": "nSprayedActellicFirst", "effectiveDatetime": null, "humanReadableValues": [] }, { "fieldType": "formsubmissionField", "fieldDataType": "text", "fieldCode": "nUnsprayedTotalFirst", "parentCode": "", "values": [ "0.0" ], "comments": null, "formSubmissionField": "nUnsprayedTotalFirst", "effectiveDatetime": null, "humanReadableValues": [] }, { "fieldType": "formsubmissionField", "fieldDataType": "text", "fieldCode": "mopupStructuresToBeSprayed", "parentCode": "", "values": [ "0.0" ], "comments": null, "formSubmissionField": "mopupStructuresToBeSprayed", "effectiveDatetime": null, "humanReadableValues": [] }, { "fieldType": "formsubmissionField", "fieldDataType": "text", "fieldCode": "nUnsprayedTotalMop", "parentCode": "", "values": [ "0.0" ], "comments": null, "formSubmissionField": "nUnsprayedTotalMop", "effectiveDatetime": null, "humanReadableValues": [] }, { "fieldType": "formsubmissionField", "fieldDataType": "text", "fieldCode": "popTotal", "parentCode": "", "values": [ "3" ], "comments": null, "formSubmissionField": "popTotal", "effectiveDatetime": null, "humanReadableValues": [] }, { "fieldType": "formsubmissionField", "fieldDataType": "text", "fieldCode": "nPeopleProtected", "parentCode": "", "values": [ "3" ], "comments": null, "formSubmissionField": "nPeopleProtected", "effectiveDatetime": null, "humanReadableValues": [] }, { "fieldType": "formsubmissionField", "fieldDataType": "text", "fieldCode": "nameHoH", "parentCode": "", "values": [ "HOHNAME" ], "comments": null, "formSubmissionField": "nameHoH", "effectiveDatetime": null, "humanReadableValues": [] }, { "fieldType": "formsubmissionField", "fieldDataType": "text", "fieldCode": "structureType", "parentCode": "", "values": [ "Residential Structure" ], "comments": null, "formSubmissionField": "structureType", "effectiveDatetime": null, "humanReadableValues": [] }, { "fieldType": "formsubmissionField", "fieldDataType": "text", "fieldCode": "business_status", "parentCode": "", "values": [ "Sprayed" ], "comments": null, "formSubmissionField": "business_status", "effectiveDatetime": null, "humanReadableValues": [] }, { "fieldType": "concept", "fieldDataType": "start", "fieldCode": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "parentCode": "", "values": [ "2019-11-26 10:14:17" ], "comments": null, "formSubmissionField": "start", "effectiveDatetime": null, "humanReadableValues": [] }, { "fieldType": "concept", "fieldDataType": "end", "fieldCode": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "parentCode": "", "values": [ "2019-11-26 10:15:33" ], "comments": null, "formSubmissionField": "end", "effectiveDatetime": null, "humanReadableValues": [] }, { "fieldType": "concept", "fieldDataType": "deviceid", "fieldCode": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "parentCode": "", "values": [ "00000" ], "comments": null, "formSubmissionField": "deviceid", "effectiveDatetime": null, "humanReadableValues": [] }, { "fieldType": "concept", "fieldDataType": "subscriberid", "fieldCode": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "parentCode": "", "values": [ "00000" ], "comments": null, "formSubmissionField": "subscriberid", "effectiveDatetime": null, "humanReadableValues": [] }, { "fieldType": "concept", "fieldDataType": "simserial", "fieldCode": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "parentCode": "", "values": [ "00000" ], "comments": null, "formSubmissionField": "simserial", "effectiveDatetime": null, "humanReadableValues": [] } ], "entityType": "Structure", "details": { "taskStatus": "READY", "location_id": "12d208b7-963d-4292-a011-3a69828a7fd6", "form_version": "", "locationUUID": "c38bd0a5-a856-4af8-8e0e-22d7c7cfc795", "appVersionName": "2.6.1", "taskIdentifier": "58b5e8ca-3b72-4133-a9ee-080bbdc35445", "locationVersion": "0", "taskBusinessStatus": "Not Visited" }, "version": 1574756133620, "teamId": "e897e637-e8b3-46bd-970c-634a77f4fea8", "team": "B", "_id": "8333c67a-8dba-4afb-8f20-75dddce31e6f", "_rev": "v1" }

Business Status: Sprayed Form Data

SQLLab Query:

SELECT form_data FROM events
WHERE form_data @> '{"business_status":["Sprayed"]}'
Limit 100;

{ "end": [ "2019-11-26 10:15:33" ], "start": [ "2019-11-26 10:14:17" ], "nameHoH": [ "HOHNAME" ], "deviceid": [ "00000" ], "popTotal": [ "3" ], "simserial": [ "00000" ], "nUnsprayable": [ "0" ], "subscriberid": [ "00000" ], "nSprayableMod": [ "11" ], "structureType": [ "Residential Structure" ], "nSprayableTrad": [ "2" ], "nSprayableZinc": [ "2" ], "business_status": [ "Sprayed" ], "nSprayableTotal": [ "15" ], "ableToSprayFirst": [ "yes" ], "nPeopleProtected": [ "3" ], "nSprayableCanopy": [ "0" ], "nSprayedDDTFirst": [ "0" ], "nSprayedDeltaFirst": [ "15" ], "nSprayedTotalFirst": [ "15" ], "nUnsprayedTotalMop": [ "0.0" ], "householdAccessible": [ "yes" ], "nUnsprayedTotalFirst": [ "0.0" ], "nSprayedActellicFirst": [ "0" ], "mopupStructuresToBeSprayed": [ "0.0" ] }

Business Status: Partially Sprayed Form Data

SQLLab Query: SELECT form_data FROM events
WHERE form_data @> '{"business_status":["Partially Sprayed"]}' AND form_data @> '{"mopUpVisit":["no"]}'
Limit 100;

Note, there is variability here. For example, if they choose unsprayedReasonHH = “refused” the form asks for a refusalReasonHH like “sick”

Business Status: Not Sprayed Form Data

SQLLab Query:

SELECT form_data FROM events

WHERE form_data @> '{"business_status":["Not Sprayed"]}'
Limit 100;

Note, there is variability here. For example, if they choose unsprayedReasonHH = “refused” the form asks for a refusalReasonHH like “sick”

Assumptions

We make the following assumptions:

  • Namibia dropped points when they created forms in the field. After they created a location the task was automatically generated. We will use the date information from the task to complete the event templates

Task/Event Field Mapping

This section defines the field mapping of the tasks and events.

Task Field Name

Event Field

Sample value

Task Field Name

Event Field

Sample value

for

baseEntityId, details.location_id

dfc9692c-5e24-4c42-a1ba-9abc174697ba

group

 

07900578-8924-4d81-a4c0-921df105fb3e

authoredOn

start end eventDate

2019-09-18T20:54:08.544+07:00

businessStatus

business_status

Sprayed

owner

providerId

placeholder.event

 

formSubmissionId

GUID

id

taskIdentifier

 

Event Template and Google Sheet Formulas

Business Status: Not Sprayed

Sample template

Formula for the Google Sheet