Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
6c2fb73
BED-17: Queries for BedPatientAssignment should account for the field
Oct 2, 2025
e683740
Fix build failure
Oct 2, 2025
dded9cb
BED-17: Queries for BedPatientAssignment should account for the field
Oct 2, 2025
8d5dd34
Update the branch
Oct 12, 2025
6f37ff3
Update tests to account for voided BedPatientAssignments
Oct 12, 2025
d08fd7b
Add unit tests to handle voided BedPatientAssignments
Oct 12, 2025
30761d2
Ensure voided is correctly set
Oct 13, 2025
dc3e4f6
correctly mock getBedById for voided assignment tests
Oct 13, 2025
004ec4d
Refactor imports
Oct 13, 2025
a88772b
BED-17: Queries for BedPatientAssignment should account for the field
Oct 2, 2025
5a50714
Merge branch 'BED-17' of https://github.com/jwnasambu/openmrs-module-…
Oct 15, 2025
3507c3e
BED-17: Call methods directly in tests instead of mocking
Oct 16, 2025
4f00ac5
BED-17:Refactor some tests to call real methods instead of mocking
Oct 17, 2025
6bd7366
BED-17: Use real DAO for key bed management methods, keep other mocks.
Oct 21, 2025
70d8c9e
Bed-17: Remove wildcard imports
Oct 21, 2025
f67a3ea
Bed-17: Create BedManagementDaoImplTest to test DAO methods without m…
Oct 26, 2025
5ef4f73
Bed-17: code refactor
Oct 26, 2025
e4d74bd
BED-17: Added missing moduleApplicationContext.xml
Oct 27, 2025
4442096
BED-17: Resolve the Spring sessionFactory bean error
Oct 27, 2025
2993ebe
Bed-17: Refactored applicationContext-service.xml
Oct 27, 2025
83ea660
BED-17: Fix Surefire test failure in bedmanagement-atom-feed
Oct 27, 2025
08a982c
BED-17: Fix Spring XML schema in moduleApplicationContext.xml
Oct 27, 2025
cae1697
Move BedManagementDaoImplTest to API main folder
Oct 28, 2025
af3b9a3
esolve ApplicationContext loading errors in BedManagementDaoImplTest
Oct 29, 2025
c27cb95
BED-23: chore: remove unused moduleApplicationContext.xml from omod r…
Oct 29, 2025
9dddb07
BED-17: load moduleApplicationContext.xml in BedManagementDaoImplTest
Oct 29, 2025
a76f280
BED-17: Updated BedManagementDaoImplTest to use TestingApplicationCon…
Oct 29, 2025
28cdceb
BED-17: Code refactor
Oct 31, 2025
1c9f492
Bed-17: Remove redundant @ContextConfiguration from BedManagementDaoI…
Nov 4, 2025
934f011
Merge branch 'master' of https://github.com/jwnasambu/openmrs-module-…
Nov 4, 2025
65fb6d0
BED-17: Remove custom configuration
Nov 4, 2025
1b2a2a7
BED-17: Add unit tests to verify DAO methods exclude voided BedPatien…
Nov 11, 2025
11ba938
BED-17: Remove trailing whitespace
Nov 11, 2025
d5b3f8f
BED-17: Remove trailing whitespace from BedManagementServiceImplTest.…
Nov 12, 2025
ed7822c
BED-17: Ensures test coverage aligns with real database query behavior
Nov 12, 2025
ffa2279
BED-17: code cleaning
Nov 12, 2025
d41c0f3
Merge branch 'master' into BED-17
jwnasambu Nov 16, 2025
999567f
BED-17: Add voided rows to test dataset
Nov 18, 2025
4915bb9
Merge branch 'master' into BED-17
jwnasambu Nov 18, 2025
0fd4758
BED-17: Remove voided column from LOCATION_TAG_MAP
Nov 19, 2025
027b83e
BED-17: Refactor BedManagementDaoImplTest to use EncounterService.get…
Nov 21, 2025
0826974
BED-17: load existing patients instead of creating new ones in BedMan…
Nov 23, 2025
bcc9b7b
BED-17: Refactor BedManagementDaoImplTest to use existing test datase…
Nov 24, 2025
d1d70dd
BED-17: Use valid dataset patients and encounters
Nov 25, 2025
ad199ce
BED-17: Eliminate unnecessary null checks
Nov 25, 2025
4863cb8
Merge branch 'master' of https://github.com/openmrs/openmrs-module-be…
Nov 25, 2025
589b7f9
BED-17: Removed unnecessary null checks for visits and encounters
Nov 25, 2025
a5f69ca
BED-17: Refactor BedManagementDaoImplTest to fetch Visit and Encounte…
Nov 25, 2025
63026d6
BED-17: Retrieve the correct single Visit/Encounter
Nov 26, 2025
37a3a38
BED-17: Fix merge conflicts
Nov 30, 2025
5d41799
BED-17: Removed unnecessary manual object creation
Dec 2, 2025
a16c521
BED-17: Update test dataset path to load bedManagementDAOComponentTes…
Dec 3, 2025
11d4ba4
Merge branch 'master' of https://github.com/openmrs/openmrs-module-be…
Dec 10, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* The contents of this file are subject to the OpenMRS Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* compliance with the License. You may obtain a copy of the License a
* http://license.openmrs.org
*
* Software distributed under the License is distributed on an "AS IS"
Expand All @@ -27,202 +27,223 @@
import java.util.List;

public interface BedManagementDao {

Bed getBedById(int id);

Bed getBedByUuid(String uuid);

Bed getBedByPatient(Patient patient);

Location getWardForBed(Bed bed);

BedPatientAssignment getBedPatientAssignmentByUuid(String uuid);

List<BedPatientAssignment> getBedPatientAssignmentByPatient(String patientUuid, boolean includeEnded);

List<BedPatientAssignment> getBedPatientAssignmentByEncounter(String encounterUuid, boolean includeEnded);

List<BedPatientAssignment> getBedPatientAssignmentByVisit(String visitUuid, boolean includeEnded);

List<BedPatientAssignment> getCurrentAssignmentsByBed(Bed bed);

Bed getLatestBedByVisit(String visitUuid);

List<BedTag> getAllBedTags();

/**
* Get all admission locations
*
*
* @param locations {@link List<Location>}
* @return {@link List<AdmissionLocation>}
*/
List<AdmissionLocation> getAdmissionLocations(List<Location> locations);

/**
* Get admission location for for a given location. Locations marked with the appropriate tag are
* <i>admission</i> locations. This method returns the admission location, if applicable, when given
* Get admission location for for a given location. Locations marked with the
* appropriate tag are
* <i>admission</i> locations. This method returns the admission location, if
* applicable, when given
* a candidate location.
*
* @param location {@link Location}
* @return {@link AdmissionLocation} return null if not exist
* @return {@link AdmissionLocation} return null if not exis
*/
AdmissionLocation getAdmissionLocationForLocation(Location location);

/**
* Get bed location mappings by location
*
* @param location {@link Location}
* @return {@link List< BedLocationMapping >}
*/
List<BedLocationMapping> getBedLocationMappingsByLocation(Location location);

/**
* Get bed location mapping by location and row and column
*
* @param location {@link Location} ward's room location
* @param row {@link Integer} bed row
* @param column {@link Integer} bed column
* @param row {@link Integer} bed row
* @param column {@link Integer} bed column
* @return {@link BedLocationMapping}
*/
BedLocationMapping getBedLocationMappingByLocationAndRowAndColumn(Location location, Integer row, Integer column);

/**
* Save / Update Bed location mapping
*
* @param bedLocationMapping {@link BedLocationMapping}
* @return {@link BedLocationMapping}
*/
BedLocationMapping saveBedLocationMapping(BedLocationMapping bedLocationMapping);

/**
* Get bed layout by location
*
* @param location {@link Location}
* @return {@link List<BedLayout>}
*/
List<BedLayout> getBedLayoutsByLocation(Location location);

/**
* Get bed location mapping {@link BedLocationMapping} by bed
*
* @param bed {@link Bed} bed
* @return {@link BedLocationMapping}
*/
BedLocationMapping getBedLocationMappingByBed(Bed bed);

/**
* Get beds.
*
* @param location {@link Location} admission location, if null filter by location criteria will not
* applied
* @param bedType {@link BedType} bed type, if null filter by bed type criteria will not applied
* @param status {@link BedStatus} bed status, if filter by null bed type criteria will not applied
* @param limit {@link Integer} limit result set, return all result set if limit is null
* @param offset {@link Integer} specify the starting row offset into the result set
* @param location {@link Location} admission location, if null filter by
* location criteria will no
* applied
* @param bedType {@link BedType} bed type, if null filter by bed type criteria
* will not applied
* @param status {@link BedStatus} bed status, if filter by null bed type
* criteria will not applied
* @param limit {@link Integer} limit result set, return all result set if
* limit is null
* @param offset {@link Integer} specify the starting row offset into the
* result se
* @return {@link List<Bed>}
*/
List<Bed> getBeds(Location location, BedType bedType, BedStatus status, Integer limit, Integer offset);

/**
* Get total bed number by location {@link Location} uuid
*
* @param location {@link Location} ward's room location
* @return {@link Long} total number of beds
*/
Integer getBedCountByLocation(Location location);

/**
* Save / update bed
*
* @param bed {@link Bed}
* @return {@link Bed}
*/
Bed saveBed(Bed bed);

/**
* Get bed tag by Uuid
*
* @param uuid {@link String} bed tag uuid
* @return {@link BedTag}
*/
BedTag getBedTagByUuid(String uuid);

/**
* Return bed tags
*
* @param name {@link String} bed tag name, if null filter by name criteria will not applied
* @param limit {@link Integer} limit result set, return all result set if limit is null
* @param offset {@link Integer} specify the starting row offset into the result set
* @param name {@link String} bed tag name, if null filter by name criteria
* will not applied
* @param limit {@link Integer} limit result set, return all result set if
* limit is null
* @param offset {@link Integer} specify the starting row offset into the resul
* se
* @return {@link List<BedTag>}
*/
List<BedTag> getBedTags(String name, Integer limit, Integer offset);

/**
* Save / Update bed tag
*
* @param bedTag {@link BedTag}
* @return {@link BedTag}
*/
BedTag saveBedTag(BedTag bedTag);

/**
* Delete bed tag
*
* @param bedTag {@link BedTag}
*/
void deleteBedTag(BedTag bedTag);

/**
* Get bed type by Id
*
*
* @param id {@link Integer} bed Id
* @return {@link BedType}
*/
BedType getBedTypeById(Integer id);

/**
* Get bed type by Uuid
*
* @param uuid {@link String} bed Uuid
* @return {@link BedType}
*/
BedType getBedTypeByUuid(String uuid);

/**
* Get bed sypes
*
* @param name {@link String} bed type name, if null filter by name criteria will not applied
* @param limit {@link Integer} limit result set, return all result set if limit is null
* @param offset {@link Integer} specify the starting row offset into the result set
* @param name {@link String} bed type name, if null filter by name criteria
* will not applied
* @param limit {@link Integer} limit result set, return all result set if
* limit is null
* @param offset {@link Integer} specify the starting row offset into the resul
* se
* @return {@link List<BedType>}
*/
List<BedType> getBedTypes(String name, Integer limit, Integer offset);

/**
* Save/Update bed type
*
* @param bedType {@link BedType}
* @return {@link BedType}
*/
BedType saveBedType(BedType bedType);

/**
* Delete Bed type
*
* @param bedType {@link BedType}
*/
void deleteBedType(BedType bedType);

/**
* Delete Bed location mapping
*
* @param bedLocationMapping
*/
void deleteBedLocationMapping(BedLocationMapping bedLocationMapping);

/**
* @param bedPatientAssignment the BedPatientAssignment to save
* @return the saved BedPatientAssignment
* @return the saved BedPatientAssignmen
*/
BedPatientAssignment saveBedPatientAssignment(BedPatientAssignment bedPatientAssignment);

/**
* Get a bed by its bed number.
*
* @param bedNumber {@link String} the bed number
* @return {@link Bed} the bed with the given number, or null if not found
*/
Bed getBedByBedNumber(String bedNumber);
}
Loading
Loading