-
Type:
Bug
-
Resolution: Done
-
Priority:
Medium
-
Affects Version/s: 2.3, 2.3.1
Summary
Some General OPD visits can never be sent to the hub, and the app doesn't tell the user. They stay UNSYNCED on the tablet indefinitely, so those consultations are missing from the hub and from central.
Evidence
- Counter 2 at camp 467 (app 2.3.1 (25)), on every push run on 11 and 12 Nov: General OPD id=34/36/39/40/42/45/47/49/52 remains pending: unresolved or incomplete prescription data.
- These are 9 visits, logged as a warning only.
Cause
TBRepo.prepareGeneralOpdRequest → GeneralOpdSaveRequest.from throws IllegalArgumentException unless all of these hold:
- every chief complaint has an ID above 0;
- every medicine resolves to a drug master (drugId, drugName, itemFormId, drugForm);
- every medicine has a frequency, a duration count above 0 and a duration unit;
- the saved prescription rows match the visit's medication list.
pushUnSyncedRecordsGeneralOpd catches the exception, logs a warning and skips the record. The same record fails the same way on every later run.
Likely sources:
- visits saved before the drug or complaint masters were downloaded;
- medicines that aren't in the masters;
- older records that have only a single shared duration.
Expected
- Try to resolve again against the current masters on each run (already partly done).
- Show any visit that still can't be sent on the sync screen, with the reason ("medicine X not found in the drug list", "duration missing", and so on), and let the nurse open it and fix it.
- Count these visits as "needs attention", not as pending sync.
Test
- Save an OPD visit with a medicine whose master entry is missing, or with a duration of 0.
- Confirm it appears on the sync screen as needing attention, with the reason.
- Fix it, and confirm it syncs once.
- is blocked by
-
STOP-813 General OPD visits re-sent on every sync create duplicate prescriptions and extra visits on the hub (camp 467: 4,184 prescriptions for 192 beneficiaries in 3 days)
-
- Closed
-