Cht-core: Reports not linked to person if missing `patient_id`

Created on 17 Apr 2018  路  13Comments  路  Source: medic/cht-core

As first discovered here, it is possible for a report to not be associated to a person even though it should be. This seems to happen because the report does not have a patient_id -- which can happen if the app user doesn't have a good data connection or because sentinel is down/slow between when the person and the report were created.

Theoretically reproducible since at least 2.13, perhaps 2.11. Tested on 2.15.0-beta.9.

Steps to reproduce

  • Log into app with restricted user
  • Go offline (airplane mode, or set as "Offline" in network tab of Chrome dev tools)
  • Create a person (notice that they don't get a 5 digit Medic ID)
  • Create a report for that person (if using a Standard form notice that in the report's summary page the Patient ID is missing)
  • Notice that the report is not added to the person's report section
1 - High Bug

All 13 comments

This issue _might_ have been the source of the change: https://github.com/medic/medic-webapp/issues/3166

Hi @browndav,

Please ensure this ticket has a Priority, Status and Type label.

(See triaging old issues for more detail)

This seems to be pretty important, and relatively easy to fix by showing reports on the profile if the patient_id or patient_uuid match the person's.

I agree this is quite likely to happen. Scheduling for 3.0.

Does this need to be back-ported to 2.15 @abbyad and/or was it @vimemo @garethbowen ?

It fixed in 3.0.0 and above. I'll leave it to @abbyad to determine if this is acceptable for this issue.

This seems to only affect Standard projects, and since it not a common occurrence it is fine to wait for 3.0. If we get reports of this being a problem in mobile app projects we can reconsider then since they aren't likely to upgrade as quickly to 3.0.

If xform submissions do not have a patient_id attribute, they will not show under a contact's profile

Correct. The glitch here was that standard has a patient_id which is the short Medic ID and patient_uuid which is the long couch generated ID, and in some cases the short id was not populated in time. All mobile projects would have the long ID as the patient_id field, and are therefore immune to this problem.

LGTM . Tested on alpha.dev . Pregnancy card shows even with no Medic ID
image

Hi Team,
Any way this can be backported to v2.16 . I have the same problem

@abbyad any chance of getting this backported to the most recent 2.X

There are a lot of fixes already in the 3.0 release that we need to prioritize getting to projects. Within the next week we'll have a better idea of the 3.0 release date, and from that can decide if we need to have a bugfix release before then.

Was this page helpful?
0 / 5 - 0 ratings