|
@@ -172,26 +172,27 @@ public class PHRService {
|
|
|
return phrList;
|
|
|
}
|
|
|
|
|
|
- public void insertSymptom(PatientSymptomSimDTO dto) {
|
|
|
+ public void insertSymptom(PatientSymptomSimDTO dto) {
|
|
|
+
|
|
|
+ Date time = new Date();
|
|
|
+ SimpleDateFormat format = new SimpleDateFormat ("yyyy-MM-dd HH:mm");
|
|
|
+
|
|
|
+ if (dto.getRecordedDate() == null || dto.getRecordedDate().equals("")) {
|
|
|
+ dto.setRecordedDate(format.format(time));
|
|
|
+ } else {
|
|
|
+ try {
|
|
|
+ time = format.parse(dto.getRecordedDate());
|
|
|
+ } catch (ParseException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
mapperSymptom.insertSymptom(dto);
|
|
|
|
|
|
PatientPHRLatestDTO phrLatestDTO = new PatientPHRLatestDTO();
|
|
|
phrLatestDTO.setPatientIdx(dto.getPatientIdx());
|
|
|
- phrLatestDTO.setSymptomYN("Y");
|
|
|
-
|
|
|
- SimpleDateFormat format = new SimpleDateFormat ("yyyy-MM-dd HH:mm");
|
|
|
- Date time = new Date();
|
|
|
- try {
|
|
|
- time = format.parse(dto.getRecordedDate());
|
|
|
- } catch (ParseException e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
-
|
|
|
- if (dto.getRecordedDate() == null || dto.getRecordedDate().equals("")) {
|
|
|
- phrLatestDTO.setSymptomCreateDate(time);
|
|
|
- } else {
|
|
|
- phrLatestDTO.setSymptomCreateDate(time);
|
|
|
- }
|
|
|
+ phrLatestDTO.setSymptomYN("Y");
|
|
|
+ phrLatestDTO.setSymptomCreateDate(time);
|
|
|
|
|
|
// 기록일시가 오늘보다 과거이면 최신데이터에 추가나 업데이트를 하지 않는다.
|
|
|
LocalDate recordedDate = LocalDate.ofInstant(time.toInstant(), ZoneId.systemDefault());
|