IFRCGo / go-frontend

MIT License
21 stars 5 forks source link

[PROD] Field Report won't submit if source selected but no figure populated #987

Closed nanometrenat closed 4 years ago

nanometrenat commented 4 years ago

Issue

I can't replicate this in Staging however saw for myself that the problem was happening in Production, when a colleague was trying to submit a field report last night.

User was getting the error "Error: Could not submit field report" and could not figure out why - country was valid and all data looked valid.

I looked in user's console and could see that create_field_report was returning a 400 error, with the message {other_num_displaced: ["A valid integer is required"!}

Looking back through the screens of the user's in-progress field report I could see that the user had selected a "source" radio button for the Affected on the Situation screen, but had not input a number. As the user cannot de-select a radio button once they have selected one, they must put in a figure (e.g. 0) or they cannot submit.

Possible fixes could be:

Steps to reproduce

image

Related feature

Several other field report tickets open but don't think related.

Impact

Low incidence

Severity

Users cannot submit field report if they hit this, and don't know why

Is there a workaround?

Can put a dummy zero in (if they know to do that)

nanometrenat commented 4 years ago

Note that (strangely) the other way is fine - but shouldn't be! By that I mean, there is nothing to stop me submitting figures but without selecting a source. If I do that I can submit the FR but the figures I've input just completely disappear.

Suggest also adding validation such that if the user inputs a figure then they MUST select a source.

mmusori commented 4 years ago

In addition Health would like the following logic for Numeric details on the epi Field Report: EPI Field Report Form design (page 2)

  1. “Case” sub-classifications: “Suspect cases”, “Probable cases” and “Confirmed cases” are not independent variables, but rather part of a multi-level classification of “Cases”. Recommend indenting the “Suspect”, “Probable”, and “Confirmed” terms (within the form design) to show the relationship between the value fields (screenshot below)

image

  1. Logic rules for “Cases”: Depending on the outbreak specific MoH/WHO case definition, a disease may have multiple sub-classifications (or not). For example with the COVID response, we are hearing a lot about “Cases” and “Confirmed cases”. For other diseases the classification varies (e.g. SARS uses “Suspect” and “Probable”, MERS uses “Confirmed” and “Probable”, Plague uses all three sub-classifications). Independent of the disease-specific case definition classification the logic is the same: Cases = SUM(Confirmed + Probable + Suspect). This implies we should be able to develop logic rules. A National Society should be able to share “Cases” only (if that is the only key figure available). However if more than one sub-classification of “cases” is used, then the sum of “Confirmed”, “Probable”, and “Suspect” cases should equal “Cases”.
  2. Date/Source: All key figures (“Cases” (“suspect”, “probable”, and “confirmed”) and “Deaths”) should come from the same “Source” as well as the same time (“Date”). Users should not be able to give WHO data for “suspect cases”, MOH data for “probable cases”, and “other” for deaths. If able to do this, there is a very high likelihood of the numbers not adding up (see logic rules above). To highlight this, I am going to work through a COVID example from the United States. The first screenshot is from WHO, last updated April 27, with 931, 698 cases and 47,980 deaths. US CDC (MoH) is reporting: 928,619 cases, 52,459 deaths as of 25 April (2 days ago). When comparing the two data sources: WHO is over reporting cases by .3%, but under reporting deaths by 9%! I tried to get around the option of citing different sources by giving one “source” (screenshot above). The Form mock-up currently shows three separate data collection fields for “Source”, “Date”, and “Source details”. Maybe a design colleague has a better idea on how to highlight/display what is effectively the EPI Key Figure metadata.

image