Skip to content

Commit 14a571c

Browse files
AMM-1266 and lmpDateformat corrected (#59)
* AMM-1204 * AMM-1340 * AMM-1266 and lmpDate&EDD date corrected * variable name corrected
1 parent 7da467c commit 14a571c

File tree

2 files changed

+15
-12
lines changed

2 files changed

+15
-12
lines changed

src/main/java/com/iemr/ecd/controller/outboundworklist/OutBoundWorklistController.java

+9-2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
*/
2222
package com.iemr.ecd.controller.outboundworklist;
2323

24+
import java.text.SimpleDateFormat;
2425
import java.util.List;
2526

2627
import org.springframework.beans.factory.annotation.Autowired;
@@ -33,6 +34,8 @@
3334
import org.springframework.web.bind.annotation.RequestMapping;
3435
import org.springframework.web.bind.annotation.RestController;
3536

37+
import com.fasterxml.jackson.core.JsonProcessingException;
38+
import com.fasterxml.jackson.databind.ObjectMapper;
3639
import com.iemr.ecd.dao_temp.FetchChildOutboundWorklist;
3740
import com.iemr.ecd.dao_temp.FetchMotherOutboundWorklist;
3841
import com.iemr.ecd.service.outbound_worklist.OutboundWorkListServiceImpl;
@@ -60,8 +63,12 @@ public class OutBoundWorklistController {
6063
@ApiResponse(responseCode = CustomExceptionResponse.INTERNAL_SERVER_ERROR_SC_V, description = CustomExceptionResponse.INTERNAL_SERVER_ERROR_SC),
6164
@ApiResponse(responseCode = CustomExceptionResponse.DB_EXCEPTION_SC_V, description = CustomExceptionResponse.DB_EXCEPTION_SC),
6265
@ApiResponse(responseCode = CustomExceptionResponse.BAD_REQUEST_SC_V, description = CustomExceptionResponse.BAD_REQUEST_SC) })
63-
public ResponseEntity<List<FetchMotherOutboundWorklist>> getMotherWorklist(@PathVariable int userId) {
64-
return new ResponseEntity<>(outboundWorkListServiceImpl.getMotherWorkList(userId), HttpStatus.OK);
66+
public ResponseEntity<String> getMotherWorklist(@PathVariable int userId) throws JsonProcessingException {
67+
List<FetchMotherOutboundWorklist> motherWorkList = outboundWorkListServiceImpl.getMotherWorkList(userId);
68+
ObjectMapper objectMapper = new ObjectMapper();
69+
objectMapper.setDateFormat(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"));
70+
String resp = objectMapper.writeValueAsString(motherWorkList);
71+
return new ResponseEntity<>(resp,HttpStatus.OK);
6572
}
6673

6774
@GetMapping(value = "/get-child-data/{userId}", produces = MediaType.APPLICATION_JSON_VALUE)

src/main/java/com/iemr/ecd/service/associate/CallClosureImpl.java

+6-10
Original file line numberDiff line numberDiff line change
@@ -173,16 +173,6 @@ public String closeCall(CallClosureDTO request) {
173173

174174
}
175175

176-
if (request.getIsHrp() != null) {
177-
callObj.setIsHighRisk(request.getIsHrp());
178-
/*
179-
* if (null != obj.getReceivedRoleName() &&
180-
* (obj.getReceivedRoleName().equalsIgnoreCase(Constants.ANM) ||
181-
* obj.getReceivedRoleName().equalsIgnoreCase(Constants.ASSOCIATE))) {
182-
* callObj.setCallStatus(Constants.OPEN); }
183-
*/
184-
}
185-
186176
if (request.getIsHrni() != null) {
187177
callObj.setIsHrni(request.getIsHrni());
188178
}
@@ -216,6 +206,12 @@ public String closeCall(CallClosureDTO request) {
216206
callObj.setCallAttemptNo(0);
217207
callObj.setAllocationStatus(Constants.UNALLOCATED);
218208
}
209+
if (request.getIsHrp() != null) {
210+
callObj.setIsHighRisk(request.getIsHrp());
211+
if(obj.getReceivedRoleName().equalsIgnoreCase(Constants.ANM)){
212+
callObj.setCallStatus(Constants.OPEN);
213+
}
214+
}
219215
outboundCallsRepo.save(callObj);
220216
} else
221217
throw new ECDException(

0 commit comments

Comments
 (0)