|
@@ -146,14 +146,15 @@ public class PatientController extends LifeCenterController {
|
|
|
|
|
|
//patientCare Insert
|
|
|
//System.out.println( "dto.getJumin().substring(2) : " + dto.getJumin().replace( "-" , "" ).substring(2) );
|
|
|
- String jumin = dto.getJumin().replace( "-" , "" );
|
|
|
+ String jumin = dto.getJumin();
|
|
|
+ jumin = LifeCenterFunction.removeStringChar(jumin, "-");
|
|
|
+ dto.setJumin( jumin );
|
|
|
|
|
|
dto.setId( dto.getWardNumber().trim() + dto.getRoomNumber().trim() );
|
|
|
|
|
|
// 환자 password는 생년월일(yyyymmdd)을 암호화
|
|
|
// dto.setPw( LifeCenterFunction.aesEncrypt( config.aesKey, config.IV, jumin ) );
|
|
|
dto.setPw( LifeCenterFunction.sha256Encrypt( jumin ) );
|
|
|
- dto.setJumin( jumin );
|
|
|
dto.setCenterCode( sesCenterCode );
|
|
|
dto.setState( "H" ); // H : 입소
|
|
|
dto.setCreateBy( sesId );
|
|
@@ -196,7 +197,7 @@ public class PatientController extends LifeCenterController {
|
|
|
dto = patientService.selectPatientOne(dto);
|
|
|
|
|
|
String jumin = dto.getJumin();
|
|
|
- jumin = jumin.substring(0, 4) + "년 " + jumin.substring(4, 6) + "월 " + jumin.substring(6, 8) + "일";
|
|
|
+ jumin = LifeCenterFunction.changeJuminToBirthday(jumin);
|
|
|
dto.setJumin(jumin);
|
|
|
|
|
|
dto.setPatientPhone(LifeCenterFunction.phone(dto.getPatientPhone()));
|
|
@@ -216,7 +217,6 @@ public class PatientController extends LifeCenterController {
|
|
|
strDisease = LifeCenterFunction.getDisease(dto);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
mv.addObject( "disease", strDisease );
|
|
|
mv.addObject( "symptom", strSymptom );
|
|
|
mv.addObject( "patientIdx", patientIdx );
|
|
@@ -254,45 +254,51 @@ public class PatientController extends LifeCenterController {
|
|
|
public ModelAndView patientEdit(
|
|
|
@ModelAttribute("dto") PatientDTO patientDTO,
|
|
|
HttpServletRequest request,HttpServletResponse response ) {
|
|
|
+
|
|
|
+ ModelAndView mv = setMV("patient/edit");
|
|
|
+
|
|
|
String sesCenterCode = LifeCenterSessionController.getSession( request, "sesCenterCode" );
|
|
|
String sesId = LifeCenterSessionController.getSession( request, "sesId" );
|
|
|
|
|
|
int patientIdx = patientDTO.getPatientIdx();
|
|
|
- patientDTO = patientService.selectPatientOne( patientDTO );
|
|
|
-
|
|
|
-
|
|
|
- // 세션의 센터코드 들고와서 치료센터명 조회후 view 전달
|
|
|
- // 센터가 존재하는지 체크
|
|
|
- CenterInfoDTO dto = new CenterInfoDTO();
|
|
|
- dto.setCenterCode( Integer.valueOf( sesCenterCode ) );
|
|
|
- dto.setStaffId( sesId );
|
|
|
- String centerName = "";
|
|
|
- int centerCount = centerService.selectCenterCount( dto );
|
|
|
-
|
|
|
- if( centerCount > 0 ) {
|
|
|
- centerName = centerService.selectCenterInfoOne( dto ).getCenterName();
|
|
|
+ int cnt = patientService.selectPatientOneCount(patientDTO);
|
|
|
+ if (cnt > 0) {
|
|
|
+ patientDTO = patientService.selectPatientOne( patientDTO );
|
|
|
+
|
|
|
+ // 세션의 센터코드 들고와서 치료센터명 조회후 view 전달
|
|
|
+ // 센터가 존재하는지 체크
|
|
|
+ CenterInfoDTO dto = new CenterInfoDTO();
|
|
|
+ dto.setCenterCode( Integer.valueOf( sesCenterCode ) );
|
|
|
+ dto.setStaffId( sesId );
|
|
|
+ String centerName = "";
|
|
|
+ int centerCount = centerService.selectCenterCount( dto );
|
|
|
+
|
|
|
+ if( centerCount > 0 ) {
|
|
|
+ centerName = centerService.selectCenterInfoOne( dto ).getCenterName();
|
|
|
+ } else {
|
|
|
+ LifeCenterFunction.scriptMessage(response, "alertBox({ txt : '문진이 정상적으로 제출되었습니다.', callBack : function(){ history.back(); } });" );
|
|
|
+ // return ""; 아직처리안함
|
|
|
+ }
|
|
|
+
|
|
|
+ String bloodPress = patientDTO.getBloodPressureLevel();
|
|
|
+
|
|
|
+ if (!bloodPress.equals("") && !bloodPress.equals("|")) {
|
|
|
+ String[] bloodPressureLevel = bloodPress.split("[|]");
|
|
|
+ patientDTO.setBloodPressureLevelCon(bloodPressureLevel[0]);
|
|
|
+ patientDTO.setBloodPressureLevelRel(bloodPressureLevel[1]);
|
|
|
+ }
|
|
|
+
|
|
|
+ mv.addObject( "centerName", centerName );
|
|
|
+ mv.addObject( "centerCount", centerCount );
|
|
|
+
|
|
|
+ mv.addObject( "patientIdx", patientIdx );
|
|
|
+ mv.addObject( "patientData", patientDTO );
|
|
|
+ mv.addObject( "actionType", "edit" );
|
|
|
} else {
|
|
|
- LifeCenterFunction.scriptMessage(response, "alertBox({ txt : '문진이 정상적으로 제출되었습니다.', callBack : function(){ history.back(); } });" );
|
|
|
- // return ""; 아직처리안함
|
|
|
+ mv.addObject( "error", "error" );
|
|
|
+ mv.addObject( "message", "삭제되었거나 존재하지 않는 환자입니다." );
|
|
|
}
|
|
|
|
|
|
- String bloodPress = patientDTO.getBloodPressureLevel();
|
|
|
-
|
|
|
- if (!bloodPress.equals("") && !bloodPress.equals("|")) {
|
|
|
- String[] bloodPressureLevel = bloodPress.split("[|]");
|
|
|
- patientDTO.setBloodPressureLevelCon(bloodPressureLevel[0]);
|
|
|
- patientDTO.setBloodPressureLevelRel(bloodPressureLevel[1]);
|
|
|
- }
|
|
|
-
|
|
|
- ModelAndView mv = setMV("patient/edit");
|
|
|
-
|
|
|
- mv.addObject( "centerName", centerName );
|
|
|
- mv.addObject( "centerCount", centerCount );
|
|
|
-
|
|
|
- mv.addObject( "patientIdx", patientIdx );
|
|
|
- mv.addObject( "patientData", patientDTO );
|
|
|
- mv.addObject( "actionType", "edit" );
|
|
|
-
|
|
|
return mv;
|
|
|
}
|
|
|
|
|
@@ -308,11 +314,13 @@ public class PatientController extends LifeCenterController {
|
|
|
dto.setPatientIdx( patientIdx );
|
|
|
|
|
|
//patientCare Update
|
|
|
- String jumin = dto.getJumin().replace( "-" , "" );
|
|
|
+ String jumin = dto.getJumin();
|
|
|
+ jumin = LifeCenterFunction.removeStringChar(jumin, "-");
|
|
|
+ dto.setJumin( jumin );
|
|
|
|
|
|
dto.setId( dto.getWardNumber().trim() + dto.getRoomNumber().trim() );
|
|
|
dto.setPw( LifeCenterFunction.sha256Encrypt( jumin ) );
|
|
|
- dto.setJumin( jumin );
|
|
|
+
|
|
|
dto.setCenterCode( sesCenterCode );
|
|
|
dto.setUpdateBy( sesId );
|
|
|
|