Skip to content

Commit

Permalink
update the param of getMedicalsWard method
Browse files Browse the repository at this point in the history
  • Loading branch information
ArnaudFofou committed Nov 19, 2024
1 parent ff3ee06 commit cb20185
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ protected void validateMovementWard(MovementWard mov) throws OHDataValidationExc
* @return the retrieved medicals.
* @throws OHServiceException
*/
public List<MedicalWard> getMedicalsWard(char wardId, boolean stripeEmpty) throws OHServiceException {
public List<MedicalWard> getMedicalsWard(String wardId, boolean stripeEmpty) throws OHServiceException {
return ioOperations.getMedicalsWard(wardId, stripeEmpty);
}

Expand All @@ -111,7 +111,7 @@ public List<MedicalWard> getMedicalsWard(String wardId, int medId, boolean strip
* @return the retrieved medicals.
* @throws OHServiceException
*/
public List<MedicalWard> getMedicalsWardTotalQuantity(char wardId) throws OHServiceException {
public List<MedicalWard> getMedicalsWardTotalQuantity(String wardId) throws OHServiceException {
return ioOperations.getMedicalsWardTotalQuantity(wardId);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,8 @@ protected void updateStockWardQuantity(MovementWard movement) throws OHServiceEx
* @return the retrieved medicals.
* @throws OHServiceException if an error occurs during the medical retrieving.
*/
public List<MedicalWard> getMedicalsWard(char wardId, boolean stripeEmpty) throws OHServiceException {
return getMedicalsWard(String.valueOf(wardId), 0, stripeEmpty);
public List<MedicalWard> getMedicalsWard(String wardId, boolean stripeEmpty) throws OHServiceException {
return getMedicalsWard(wardId, 0, stripeEmpty);
}

/**
Expand Down Expand Up @@ -287,7 +287,7 @@ public List<MovementWard> getWardMovementsToPatient(Integer patId) {
* @return the retrieved medicals.
* @throws OHServiceException
*/
public List<MedicalWard> getMedicalsWardTotalQuantity(char wardId) throws OHServiceException {
public List<MedicalWard> getMedicalsWardTotalQuantity(String wardId) throws OHServiceException {
String wardID = String.valueOf(wardId);
List<MedicalWard> medicalWards = getMedicalsWard(wardId, true);

Expand Down
10 changes: 5 additions & 5 deletions src/test/java/org/isf/medicalstockward/Tests.java
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ void testIoDeleteMovementWard() throws Exception {
void testIoGetMedicalsWard() throws Exception {
MedicalWardId code = setupTestMedicalWard(false);
MedicalWard foundMedicalWard = medicalStockWardIoOperationRepository.findOneWhereCodeAndMedical(code.getWard().getCode(), code.getMedical().getCode());
List<MedicalWard> medicalWards = medicalStockWardIoOperations.getMedicalsWard(foundMedicalWard.getWard().getCode().charAt(0), true);
List<MedicalWard> medicalWards = medicalStockWardIoOperations.getMedicalsWard(foundMedicalWard.getWard().getCode(), true);
assertThat(medicalWards.get(0).getQty()).isCloseTo(foundMedicalWard.getIn_quantity() - foundMedicalWard.getOut_quantity(), offset(0.1));
}

Expand All @@ -412,7 +412,7 @@ void testIoGetMedicalsWardStripEmptyLots() throws Exception {
medicalWard.setIn_quantity(10.0f);
medicalWard.setOut_quantity(10.0f);
medicalStockWardIoOperationRepository.saveAndFlush(medicalWard);
List<MedicalWard> medicalWards = medicalStockWardIoOperations.getMedicalsWard(medicalWard.getWard().getCode().charAt(0), true);
List<MedicalWard> medicalWards = medicalStockWardIoOperations.getMedicalsWard(medicalWard.getWard().getCode(), true);
assertThat(medicalWards).isEmpty();
}

Expand Down Expand Up @@ -465,7 +465,7 @@ void testIoGetMedicalsWardTotalQuantity() throws Exception {

medicalStockWardIoOperations.newMovementWard(movementWard);

List<MedicalWard> medicalWards = medicalStockWardIoOperations.getMedicalsWardTotalQuantity('X');
List<MedicalWard> medicalWards = medicalStockWardIoOperations.getMedicalsWardTotalQuantity("X");
assertThat(medicalWards).hasSize(1);
assertThat(medicalWards.get(0).getWard().getCode()).isEqualTo("X");
}
Expand All @@ -491,7 +491,7 @@ void testIoListenerShouldUpdatePatientToMergedWhenPatientMergedEventArrive() thr
void testMgrGetMedicalsWard() throws Exception {
MedicalWardId code = setupTestMedicalWard(false);
MedicalWard foundMedicalWard = medicalStockWardIoOperationRepository.findOneWhereCodeAndMedical(code.getWard().getCode(), code.getMedical().getCode());
List<MedicalWard> medicalWards = movWardBrowserManager.getMedicalsWard(foundMedicalWard.getWard().getCode().charAt(0), true);
List<MedicalWard> medicalWards = movWardBrowserManager.getMedicalsWard(foundMedicalWard.getWard().getCode(), true);
assertThat(medicalWards.get(0).getQty()).isCloseTo(foundMedicalWard.getIn_quantity() - foundMedicalWard.getOut_quantity(), offset(0.1));
}

Expand Down Expand Up @@ -689,7 +689,7 @@ void testMgrGetMedicalsWardTotalQuantity() throws Exception {

movWardBrowserManager.newMovementWard(movementWard);

List<MedicalWard> medicalWards = movWardBrowserManager.getMedicalsWardTotalQuantity('X');
List<MedicalWard> medicalWards = movWardBrowserManager.getMedicalsWardTotalQuantity("X");
assertThat(medicalWards).hasSize(1);
assertThat(medicalWards.get(0).getWard().getCode()).isEqualTo("X");
}
Expand Down

0 comments on commit cb20185

Please sign in to comment.