Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

new PatientId is generated on every refresh of New Patinet page #/patients/edit/new #245

Closed
SwathiVarkala opened this issue Dec 14, 2015 · 3 comments

Comments

@SwathiVarkala
Copy link

On every load/refresh of #/patients/edit/new page, the Patient id is incrementing even if no patient is created.
Steps to Reproduce :
1.Open New Patient page.
Ex : Patient Id field shows auto generated Patient Id as P001
2.Reload the Page without creating the patient.
Expected : Patient Id after reload should still be P001 as it is not used for any Patient
Actual : Patient Id Field now shows P002

@BrianHC
Copy link

BrianHC commented Feb 6, 2016

@tangollama I have also experienced this issue, I'd like to address this issue.

@hex007
Copy link

hex007 commented Feb 6, 2016

I think that this measure is necessary. If a user opens "add new patient"
in two separate windows then the id should not be same. if ID is same then
saving the patient data will be a problem. Hence every request to create
new patient page should be called with a different id.

A solution to this problem can be to have a pool to add new patients that
dynamically allots patient id based on the order and current patient count
in DB. A user can query multiple times for the "add new patient" page. The
page should have no ID field. Once the patent is successfully added to the
database the browser can be redirected to the "patient details" page with
allotted ID. This will prevent creating multiple patients with same ID or
skipping of IDs due to dropped/discarded pages .

@tangollama
Copy link
Member

After discussing this further, I'm inclined to close this as an issue. As I understand it, the primary concern appears to be "burning" a unique sequence. For the complexity of what a solution would introduce to the system, I don't believe this is worth the effort. If someone has a truly compelling, helpful argument, I'm happy to re-open the conversation. Otherwise, closing.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants