-
Notifications
You must be signed in to change notification settings - Fork 644
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for bulk creating beds inside a location #10585
Comments
i would like to work on this. |
issues will be assigned once the solution to solve this is approved; do share your thoughts on how to solve this. |
Hmm, as much as I understood, we can have the prefix name from user and also starting and ending numbering label for example A1 to A10. And prefix 'Bed' and push the array from Bed A1 to Bed A10 |
Approach for Dynamic Bed Naming & Optimized API Request1. User Input Fields in Location Form
2. Real-Time Bed Name Preview
3. Optimized API Request Structure
{
"location_id": "12345",
"bed_type": "ICU",
"count": 3
} 4. Backend Processing & Database Update
5. Validation Rules
|
@rithviknishad is the backend open for contributions now |
@rithviknishad we can ask the user to add multiple beds once the user selects location form as bed. We can create a separate model for Bed in the backend with fields bed_type, number_of_units, location referencing to existing facilityLocation model or we can also create a JSON field of beds in FacilityLocation Model anything can be preferred. And it will be better to create a separate model for Bed Types also which would allow admin to add default bed types. In frontend we can show a select field with all those bed types as choices. |
@rithviknishad Could you assign this issue to me. ApproachWe can add an option where the user can select the number of beds. For example, the user types the name of the location as bed and selects 10 beds. After clicking "Create," the API is called, which checks if there are already entries in the database labeled as bed. If no such entries exist, the beds are created starting from bed 1 (then bed 2, bed 3, and so on up to bed 10). |
Checkout We can achieve this without modifying the backend. |
|
Approach1We can add an option where the user can select the number of beds and then push the stringified details of all the beds in an array then send this array to backend. For example, the user types the name of the location as bed and selects 10 beds. After clicking, if the backend supports bulk creation we can just push all the requests in an array, each request with same name prefix and different number (like bed 1 , bed 2 ) and then stringify the whole array and then send it to the backend. |
Approach2We can add an option where the user can select the number of beds and then push the beds in an array and use promise.all() / make a recursive function / use a loop to send these requests with the prefix bed and there respective number |
Hey @rithviknishad , Could you assign m this issue ? I made it work locally by following guidelines stated in the issue (hardcoded 3 for demo) Screen.Recording.2025-02-24.at.10.53.33.PM.mov |
Is your feature request related to a problem? Please describe.
When setting up locations of a facility, there'd be multiple beds inside a location. To ease data entry effort, we should be able to bulk create beds (eg. Bed 1, Bed 2, Bed 3, etc...).
Describe the solution you'd like
We could either ask the prefix name from the user and call the API.
Describe alternatives you've considered
We def. can/should explore more better ways to approach this
The text was updated successfully, but these errors were encountered: