zdavatz / AmiKo-iOS

AmiKo Desitin für iPhone und iPad
https://apps.apple.com/ch/app/amiko-desitin/id687642725
GNU General Public License v3.0
1 stars 2 forks source link

Wrong patient found after scanning #86

Closed zdavatz closed 6 years ago

zdavatz commented 6 years ago
  1. Create Doctor
  2. Scan Patient A. Create Patient A including Tel and Email.
  3. Scan Patient B. Create Patient B including Tel and Email.
  4. Show prescription with Patient B. Do not save.
  5. Add one package (Ponstan Suspension). Do not save.
  6. Longtap on patient.
  7. Scan Patient B.
  8. Patient A is still there.
zdavatz commented 6 years ago

When you click on the history of the patient and select a prescription then the right patient is shown. So somehow the correct history seems to be selected. So really only the display of the patient after the scan is wrong.

bettar commented 6 years ago

It's not that the "wrong" patient is found, the functionality was implemented like that, preventing a change of patient if the prescription was in an edited state. Maybe the thinking was that if the doctor has started editing the medicines for a patient, it wouldn't make sense to change the patient and losing the changes for the previous patient. Up until now if the doctor wanted to reuse a prescription from a patient and use it for another patient, the change of patient needed to be the first step in editing a prescription. From now on, that is to resolve issue #86, it will be possible to replace the patient even for an "unsaved" prescription. Note that if the previous functionality is preferred it would make sense to disable the health card scanning if the prescription has been edited. This could be easily achieved.

zdavatz commented 6 years ago

So why does selecting a patient from the address book then work? It is only the scanning that does not work and not select the patient.

bettar commented 6 years ago

Selecting the patient from the address book works because in that case the "configuration" of the view controllers handled by SWRevealViewController doesn't change and the new patient data is just updated in the table view. When we use the scanning the view controllers are changed, and to go back to the Prescription view we end up calling viewDidAppear which loads different things depending on what is saved in the defaults and on the editing state.

zdavatz commented 6 years ago

Well lets see to it that selecting a patient by scanner works the same like selecting a patient manually.

zdavatz commented 6 years ago

fixed with 533e80c205ef276ed7e1252a9a614b9c6e8c5d1