|
@@ -359,7 +359,15 @@ public class ClinicController extends LifeCenterController {
|
|
|
public @ResponseBody String insertPhrDataAPI(@ModelAttribute("dto") final PatientPHRHistoryDTO dto) {
|
|
|
|
|
|
try {
|
|
|
+ SimpleDateFormat format = new SimpleDateFormat ( "yyyy-MM-dd HH:mm");
|
|
|
+ Date time = new Date();
|
|
|
+ String recordedDate = format.format(time);
|
|
|
+
|
|
|
+ if (dto.getRecordedDate() == null) {
|
|
|
+ dto.setRecordedDate(recordedDate);
|
|
|
+ }
|
|
|
phrService.insertPHR(dto);
|
|
|
+
|
|
|
if (dto.getPhrValueExtra() != null) {
|
|
|
PatientPHRHistoryDTO pulseRateDto = new PatientPHRHistoryDTO();
|
|
|
pulseRateDto.setPatientIdx(dto.getPatientIdx());
|
|
@@ -367,10 +375,13 @@ public class ClinicController extends LifeCenterController {
|
|
|
pulseRateDto.setPhrValue(dto.getPhrValueExtra());
|
|
|
pulseRateDto.setRecordedByName(dto.getRecordedByName());
|
|
|
if (dto.getRecordedById() != null) {
|
|
|
- pulseRateDto.setRecordedById(dto.getRecordedById());
|
|
|
+ pulseRateDto.setRecordedById(dto.getRecordedById());
|
|
|
}
|
|
|
if (dto.getRecordedDate() != null) {
|
|
|
- pulseRateDto.setRecordedDate(dto.getRecordedDate());
|
|
|
+ pulseRateDto.setRecordedDate(dto.getRecordedDate());
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ pulseRateDto.setRecordedDate(recordedDate);
|
|
|
}
|
|
|
phrService.insertPHR(pulseRateDto);
|
|
|
}
|