intesys / openhospital-api

OpenHospital API
GNU General Public License v3.0
2 stars 4 forks source link

PatientDataForm 'city' field should be a 'select' #51

Open alefalezza opened 2 years ago

alefalezza commented 2 years ago

https://openhospital.atlassian.net/browse/OP-792

Use case analysis

When filling the for for registering a new patient, I can fill the field "city", but at the moment it's a free text field, and this produces inconsistencies in the database, where the same city can be spelled out with different names. It would be useful if the field was driven by an autosuggestion that helps to fill it in a consistent way, but it should also let the user insert a new city which is not yet suggested. Once a new city has been registered, it should also appear in the next suggestions, in order to maintain the database consistent.

Objections

It has been objected that this way, if I insert a new city with a wrong spelling, it stays there forever. This is right, but if the database is consistent, it will be more easy to fix it. We can also consider to add somewhere a new tool for managing cities, and update consequently all the records in the database.

Implementation

In order to make this feature more useful, it was suggested to move from a static datasource in the frontend code to a dynamic one, based on api. It needs: