Cht-core: Cannot report via SMS about people who are registered in the web app

Created on 20 Apr 2017  路  9Comments  路  Source: medic/cht-core

To reproduce:

  1. Log into https://clone-barefoot.app.medicmobile.org
  2. Click on Arthur's Area
  3. Create a new person in that area in the web app. Sentinel will add a patient ID to this person and it will appear in the person's profile.
  4. Go to Medic Reporter. Be sure to use Arthur's phone number as the "from" number. His number can be found here: https://clone-barefoot.app.medicmobile.org/medic/_design/medic/_rewrite/#/contacts/31DA4600-27E3-1BEA-8E6E-55F13696C791
  5. Send in a report about the person you just created, such as a visit report (V [patient_id])
  6. Notice that you get an error, registration_not_found.

Since this person has a Medic ID generated, it should be possible to report about them via SMS, even though they were created in the web app.

1 - High Bug

All 9 comments

Just noting that even though the registration_not_found error is given, the form is associated to the contact:
image

One difference between a person created by app vs SMS is that the ones created by SMS show up in the registered_patients view, which is used by getRegistrations here.

Yeah that'll do it. That view is a bit of a weird one. Most code should instead use the patient_by_patient_shortcode view. I'll put together a PR fixing this.

Actually this is correct.

The new thing is that you can have patients that are not created as a result of a registration.

The current code is trying to match patient ids to registrations to work out what registrations it can potentially silence. I guess we just want to change this so that it's OK if it doesn't match a known registration, as long as it matches a known patient_id generally.

First stab at a PR: https://github.com/medic/medic-sentinel/pull/129

@estellecomment can you take a look at this one?

I'd like to merge into and bump sentinel so I this change can get into alpha.

I'm not able to fully test this kind of thing locally. I need to get some time with @abbyad to go through that, but for now it would be good to get this into a place where it can be tried on alpha.

(still active because I haven't tested it basically at all. I'll get setup and do that before closing)

TODO: we should also change the "registration_not_found" message to "patient_not_found", because I think in all (certainly nearly all) cases that's what we really mean

This has been merged to master.

Tested on 2.12.0-alpha.5615 and can no longer reproduce... so it appears to be resolved. Thanks @SCdF!

My testing was not exhaustive though so we should test SMS reports more fully with the release to ensure that there are no regressions.

Was this page helpful?
0 / 5 - 0 ratings