Bahmni 0.91.. Unable to create new Bed layout

Hello Everyone, Am testing the new Bed management of the latest bahmni version but am having some problems creating bed layout. Any solution? or the old sql script still apply?

2 Likes

I can confirm this issue.

@barnaby85, did you find a solution?

Other than that, here is what I found out:

  1. It is possible to create beds via API, e.g.:
curl -k -u Superman:Admin123 -X POST https://my-bahmni-installation/openmrs/ws/rest/v1/bed \
-H "Content-Type: application/json" \
--data-binary @- << EOF
{
   "bedNumber": "Test",
   "bedType": "LUXURY",
   "row": 1,
   "column": 2,
   "status": "AVAILABLE",
   "locationUuid": "0f67687d-d6e4-42c8-b807-813da458f233"
}
EOF
  1. The underlying error

The underlying error is caused by an SQL statement that is executed with bed_id null, this can be seen in the openmrs log file (/var/log/openmrs/openmrs.log):

Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Column 'bed_id' cannot be null

I looked in the mysql log file (/var/lib/mysql/localhost.log), and it shows the following:

insert into bed_location_map (location_id, bed_id, row_number, column_number) values (17, null, 1, 1)
1 Like