|
@ -808,14 +808,17 @@ public class PrenatalInspectorPreCardService extends BaseService {
|
|
|
String pregnancyNo = plan.getInspectionCode();
|
|
|
String patient = plan.getPatient();
|
|
|
Boolean flag = getSendStatus(prenatalId);
|
|
|
Long days = DateUtil.getDays(new Date(), planTime);
|
|
|
Long days = DateUtil.getDays(DateUtil.getNowDateShort(), planTime);
|
|
|
Date begin = DateUtil.getPreDays(planTime,-14);
|
|
|
Date end = DateUtil.getPreDays(planTime,14);
|
|
|
//有产检code
|
|
|
if (StringUtils.isNotEmpty(pregnancyNo) && (pregnancyNo != null)){
|
|
|
Boolean examStatus = getExamStatus(patient,pregnancyNo,begin,end);
|
|
|
if (examStatus){
|
|
|
Map<String,String> exams = getExamStatus(patient,pregnancyNo,begin,end);
|
|
|
String examStatus = exams.get("status");
|
|
|
if ("1".equals(examStatus)){
|
|
|
String examTime = exams.get("examTime");
|
|
|
json.put("renatalStatus", "4");
|
|
|
json.put("examTime", examTime);
|
|
|
}else {
|
|
|
if (days > 7) {
|
|
|
json.put("renatalStatus", "3");
|
|
@ -989,8 +992,9 @@ public class PrenatalInspectorPreCardService extends BaseService {
|
|
|
* @return
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public Boolean getExamStatus(String patient,String pregnancyNo,Date begin,Date end) throws Exception {
|
|
|
Boolean flag = false;
|
|
|
public Map getExamStatus(String patient,String pregnancyNo,Date begin,Date end) throws Exception {
|
|
|
Map<String,String> respose = new HashMap();
|
|
|
respose.put("status","0");
|
|
|
try {
|
|
|
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
JSONArray natals = reExamRecode(patient,pregnancyNo);
|
|
@ -999,13 +1003,15 @@ public class PrenatalInspectorPreCardService extends BaseService {
|
|
|
String exam_time = examRecord.getString("EXAM_TIME");
|
|
|
Date examTime = format.parse(exam_time);
|
|
|
if ((examTime.getTime()<= end.getTime()) && (examTime.getTime() >= begin.getTime())){
|
|
|
return true;
|
|
|
respose.put("status","1");
|
|
|
respose.put("examTime",exam_time);
|
|
|
return respose;
|
|
|
}
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
return flag;
|
|
|
return respose;
|
|
|
}
|
|
|
|
|
|
}
|