is there any module that can manage Bed in hospital instead of adding script simple UI

hi Dev team

i wondering if there is any module available UI for Bed management, i have seen there is some instruction however for me i could not understand where to put those code and make it work, lets say i have x4 ward with 13 Bed each ward, in this case how am i going to do this. i have seen there is a sample .sql file saying it has to upload Openmrs database, can i directly import this sql file via Phpmyadmin. but i need x4 Ward and each ward 13 Bed. lets say ward name ward1, ward2, ward3, ward4,

i believe first i have to add location from openmrs and map those location or something i have to play around to make this work, one more things i dont understand where to add those line in configuration file can you please guide me how can i do this i watch video in youtube showing easy way to adding bed from GUI https://youtu.be/mybhWIf6oG0

sorry for my ignorant, im kind of little tech background, we are planning to implement Bahmni in rural remote site.

  1. Setup Variables SET @parent_location_id = (select location_id from location where name=‘General Ward’); SET @location_id = (select location_id from location where name=‘Physical General Ward’); SET @location_tag_id = (select location_tag_id from location_tag where name=‘Admission Location’);

  2. Setup wards insert into location (name, description, creator, retired, date_created, uuid) values(‘General Ward’, ‘General Ward’, 1, 0, NOW(), UUID()); insert into location (name, description, creator, retired, date_created, uuid, parent_location) values(‘Physical General Ward’, ‘1st Floor of General Ward’, 1, 0, NOW(), UUID(), @parent_location_id); insert into location_tag_map values( @parent_location_id , @location_tag_id); insert into location_tag_map values( @location_id , @location_tag_id);

  3. Add Bed Types insert into bed_type values(1, ‘deluxe’, ‘deluxe bed’, ‘DLX’);

  4. Add Beds insert into bed (bed_id, bed_number, status, bed_type_id, uuid, creator, date_created, voided) values(1, ‘304-a’, ‘AVAILABLE’, 1, UUID(), 1, NOW(), false);

  5. Map beds to ward list insert into bed_location_map(bed_location_map_id, location_id, row_number, column_number, bed_id) values(1, @location_id, 1, 1, 1);

hope to hear soon

with best Regard. Bhandari

Moved to the #software:bahmni category.

hi there

any update for this case, thank you .

with best regard Bhandari

Hi @andrewbhandari, Please check In-Patient Management wiki page for Beds and Wards Management App in Bahmni.

You can achieve this by importing the sql file as mentioned in the wiki page. You have to change that sql file according to your requirement based on number of wards and beds. Make sure you don’t have duplicate locations in the respective database tables. Otherwise sql import will fail.[quote=“andrewbhandari, post:1, topic:11808”] one more things i dont understand where to add those line in configuration file [/quote] No need to do the configuration changes. Sql import does the work.

As per my knowledge this feature is not there in Bahmni. I think some community member has implemented that. Hope this helps.

hi @binduak

after following above method output i have attached snap as well i have sql file could you please kindly look at it and let me know where i missing. thank you !!

i have uploaded edited sql file below link can you please look at it and suggest me what needs to be done in order to make this work:slight_smile:

with best Regard Bhandari

hi @binduak

im unable to upload sql file, i have edited and try to upload unfortunately no luck i have attached sql file could you please look it it and if it is a mistake can you please correct for me and send it back to me. and also let me know what other parameter i have to configure before i import sql file sorry i’m new. thank you . appreciate your time.

with best regard bhandari

Hi @andrewbhandari, Please follow below few suggestions for executing the bed_management_location.sql queries

  • Don’t import entire sql file on the database if you face issues. Try to run each sql command one by one from mysql prompt. That will help understand the queries.

[quote] insert into location_tag (name, description, creator, retired, date_created, uuid) values(‘Admission Location’, ‘General Ward Patients’, 2, 0, NOW(), UUID()); SET @location_tag_id = (select location_tag_id from location_tag where name=‘Admission Location’); [/quote]

Make sure the same entry is not there in the respective table before running insert command. In the above query make sure select shouldn’t return more than one entry.

I think once you resolve these issue then you can successfully add number of Wards and Beds as per your requirement. Hope this helps.

hi @binduak

sorry to bothering you !! i have try to follow wiki unfortunately no luck i got an error while executing syntax!! could you please guide me little bit :slight_smile: appreciate your help !!

mysql> SET @parent_location_id = (select location_id from location where name='Emergency Ward');
Query OK, 0 rows affected (0.00 sec)

mysql> SET @location_id = (select location_id from location where name='Emergency General Ward');
Query OK, 0 rows affected (0.00 sec)

mysql> SET @location_tag_id = (select location_tag_id from location_tag where name='Admission Location');
Query OK, 0 rows affected (0.00 sec)

mysql> insert into location (name, description, creator, retired, date_created, uuid) values('General Ward', 'Emergency Ward', 1, 0, NOW(), UUID());
Query OK, 1 row affected (0.11 sec)

mysql>
mysql> insert into location (name, description, creator, retired, date_created, uuid, parent_location) values('Physical General Ward', '2ND Floor of General Ward', 1, 0, NOW(), UUID(), @parent_location_id);
Query OK, 1 row affected (0.07 sec)

mysql> insert into location_tag_map values( @parent_location_id , @location_tag_id);
ERROR 1048 (23000): Column 'location_id' cannot be null
mysql>

with best Regard. Bhandari

According to mysql output : [quote=“andrewbhandari, post:8, topic:11808”] ERROR 1048 (23000): Column ‘location_id’ cannot be null [/quote]

a Location with the name ‘Emergency General Ward’ seems to be not available in your table

execute this query with a name that exist in your table, or creating the location should fix it

This specific issue is officially tracked as BAH-313: Add/modify/delete wards and beds through new UI. Cc @darius @mjsanish

Am I correct to assume that we are in the realm of metadata management? Which would usually occur through the old admin UI as Sanish is suggesting on Slack:

I would tend to think that metadata management should not usually happen through Bahmni Apps. However this depends on how those changes happen. I would assume that wards would not be treated very differently to locations for instance, however beds might just be another ballgame.

If we decide for adding Angular or React views to Bahmni Apps, then I see that there is already a BedResource. At first (and quick) look it seems like Bed Management’s REST API would have to be enriched.

Let me revise and extend my comments:

I think that for any new features in Bahmni should avoid writing code in old-style JSPs. This is generally deprecated by OpenMRS, and it’s harder to make a nice UI this way. You’re correct that this is metadata management so it should be accessible from the admin UI.

So, we should write a modern JS+REST UI for managing beds/wards, and link to it from the admin screen, and if we need to then we can enrich the REST resources (I was incorrect to suggest it should go in Bahmni Apps, rather all this code can live in the Bed Management module itself. In the future I’d consider putting this in an OWA, but I think that’s an unnecessary degree of difficulty for now.)

@mjsanish, no new Bahmni feature should be built without some analysis and UI design, with a chance for people to publicly comment on it. You may be right that we don’t need a pretty user-friendly UI, and an administrative UI is sufficient, but I would want to ensure that it doesn’t lead people to make inconsistent or invalid bed/ward layouts. If you want to propose this approach, then please do a quick low-fidelity sketch or mockup of what you’re proposing, and attach it here or on the JIRA ticket so that i and others can comment on it.

Please review UI for Bed Management.

@mjsanish this looks like the legacy admin UI to me. I think that we would like to get to something a bit fancier and more modern looking.

Note that the point of this task is also to onboard devs to start looking at the sort of technologies that make Bahmni the dynamic and responsive app that it is. Practically speaking and as Darius hinted that means leveraging Angular JS or ReactJS on the client-side to lean towards a dynamic one page app (maybe).

Are there opinions out there as the sort of UI flow that would be desired around managing wards/rooms/beds? Should we design this UI flow while anticipating that the views we may come up with could eventually be used beyond just metadata management?

@mjsanish, I agree with Dimitri’s comment that we should make this look more modern, and in particular it should should look more like the Bahmni UI.

As a side-effect of this, we should improve upon the Bahmni UI Quick Reference wiki page.

Seeing this, I do think its fine to just have tables of things with an “add xyz” link or button, but I would expect two things:

  1. Ensure you’re don’t create an inconsistent bed layout (e.g. you can’t put multiple beds in row 1 column 1, unless we’re explicitly intending to allow it). I think this is just validation + error messages.

  2. The Manage Room screen should show the actual layout in the same way it’s shown in the IPD app. Something like this:

  • I would expect that clicking on an empty slot does Add Bed for that row+column
  • I would expect that clicking on an existing bed brings up an Edit Bed screen
  • I would do a quick dev analysis of how much extra effort it would take to have some kind of fancy drag and drop UI. It’s not necessary at this point, but it would be nice to know if that would take additional hours, days, or weeks.

@darius @mksd These low-fidelity sketch or mockup that I am proposing are If we want to build bed management at openMRS admin as current other module admin UI.

I am planning to add bed management UI at openmrs-module-bedmanagement (https://github.com/openmrs/openmrs-module-bedmanagement) and send a pull request. So that this feature not only available to Bahmni, it also available to OpenMRS too.

If you really want to fancier and more modern looking UI, designer team should design UI for this first. I think adding fancier design at openmrs admin look inconsistency from other module UI.

As a start can you assess whether the REST API of the module is sufficient to do what we’re trying to do?

@darius openmrs-module-bedmanagement module has not sufficient API for manage or add/edit/delete wards/bed. We have to create API for that. And I am not sure where are we going to create API whether in bahmni-core or openmrs bademanagement module if we want to create API for bed management.

If we want to manage and add/edit/delete related to a module from openmrs-module-bedmanagement with legacy admin UI as other modules, we do not need to create API for that. but we have to add some services in openmrs-module-bedmanagement module and create UI with JSP.

I know how we would do it in the legacy UI. I’m wondering if the current REST API is sufficient to do that same UI functionality with JS+REST, e.g. for estimation of effort.

-Darius (by phone)

Please review new design.

Few comments

  • “Add room” link? - is it “add bed”?
  • You may add a “room” at the top level as “ward”. You may consider both of them as Top level “Location”, but in that case, you should have attributes (location attributes) to distinguish between them - API as well as visual.
  • I think it will be great to have a visual way to define beds depending on slots/positions in a ward/room (like @darius suggested above). Considering this, maybe its better to start layout definition of a “ward” first.