|
@@ -27,7 +27,11 @@ public class OPE0587 extends QCCatalogue {
|
|
public void start(InputInfo inputInfo, OutputInfo outputInfo) {
|
|
public void start(InputInfo inputInfo, OutputInfo outputInfo) {
|
|
status.set("0");
|
|
status.set("0");
|
|
List<OperationDoc> operationDocs = inputInfo.getOperationDocs();
|
|
List<OperationDoc> operationDocs = inputInfo.getOperationDocs();
|
|
- List<ThreeLevelWardDoc> threeLevelWardDocs = inputInfo.getThreeLevelWardDocs().get(0).getAllDoctorWradDocs();
|
|
|
|
|
|
+ List<ThreeLevelWardDoc> threeLevelWardDocs1 = inputInfo.getThreeLevelWardDocs();
|
|
|
|
+ if (ListUtil.isEmpty(threeLevelWardDocs1)) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ List<ThreeLevelWardDoc> threeLevelWardDocs = threeLevelWardDocs1.get(0).getAllDoctorWradDocs();
|
|
if (ListUtil.isEmpty(operationDocs) || ListUtil.isEmpty(threeLevelWardDocs)) {
|
|
if (ListUtil.isEmpty(operationDocs) || ListUtil.isEmpty(threeLevelWardDocs)) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
@@ -42,60 +46,72 @@ public class OPE0587 extends QCCatalogue {
|
|
roundsDate.add(formatter.format(threeLevelDate));
|
|
roundsDate.add(formatter.format(threeLevelDate));
|
|
}
|
|
}
|
|
|
|
|
|
- //取出出院时间
|
|
|
|
- Map<String, String> structureMaps = inputInfo.getFirstPageRecordDoc().getStructureMap();
|
|
|
|
- String leaveHospitalDate = structureMaps.get("出院时间") == null ? null : structureMaps.get("出院时间");
|
|
|
|
- Date leaveDate = StringUtil.parseDateTime(leaveHospitalDate);
|
|
|
|
|
|
+ //取出出院时间,先从病案首页取,若没有,再去出院小结取
|
|
|
|
+ String leaveHospitalDate = null;
|
|
|
|
+ if (inputInfo.getFirstPageRecordDoc() != null) {
|
|
|
|
+ Map<String, String> structureMaps = inputInfo.getFirstPageRecordDoc().getStructureMap();
|
|
|
|
+ leaveHospitalDate = structureMaps.get("出院时间");
|
|
|
|
+ }
|
|
|
|
+ if (leaveHospitalDate == null && inputInfo.getLeaveHospitalDoc() != null) {
|
|
|
|
+ leaveHospitalDate = inputInfo.getLeaveHospitalDoc().getStructureMap().get("出院时间");
|
|
|
|
+ }
|
|
//没有出院时间, 直接退出
|
|
//没有出院时间, 直接退出
|
|
- if (leaveHospitalDate != null) {
|
|
|
|
- //取出病程信息里的手术信息的所有 手术日期
|
|
|
|
- List<String> operDateList = new ArrayList<>();
|
|
|
|
- for (OperationDoc opera : operationDocs) {
|
|
|
|
- OperationRecordDoc operationRecordDoc = opera.getOperationRecordDoc();
|
|
|
|
- if (operationRecordDoc != null) {
|
|
|
|
- String operDate = operationRecordDoc.getStructureMap().get("手术日期") == null ? null : operationRecordDoc.getStructureMap().get("手术日期");
|
|
|
|
- if (StringUtil.isNotBlank(operDate)) {
|
|
|
|
- operDateList.add(operDate);
|
|
|
|
- }
|
|
|
|
|
|
+ if (StringUtil.isBlank(leaveHospitalDate)) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ Date leaveDate = StringUtil.parseDateTime(leaveHospitalDate);
|
|
|
|
+ if (leaveDate == null) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //取出病程信息里的手术信息的所有 手术日期
|
|
|
|
+ List<String> operDateList = new ArrayList<>();
|
|
|
|
+ for (OperationDoc opera : operationDocs) {
|
|
|
|
+ OperationRecordDoc operationRecordDoc = opera.getOperationRecordDoc();
|
|
|
|
+ if (operationRecordDoc != null) {
|
|
|
|
+ String operDate = operationRecordDoc.getStructureMap().get("手术日期") == null ? null : operationRecordDoc.getStructureMap().get("手术日期");
|
|
|
|
+ if (StringUtil.isNotBlank(operDate)) {
|
|
|
|
+ operDateList.add(operDate);
|
|
}
|
|
}
|
|
|
|
+
|
|
}
|
|
}
|
|
- if (operDateList.size() > 0) {
|
|
|
|
- for (String operDates : operDateList) {
|
|
|
|
- Date oper = StringUtil.parseDateTime(operDates);
|
|
|
|
- //手术时间 减去 出院时间
|
|
|
|
- long day = (leaveDate.getTime() - oper.getTime()) / (24 * 60 * 60 * 1000);
|
|
|
|
- //时间大于三天才能判断有没有连续三天查房
|
|
|
|
- if (day > 3) {
|
|
|
|
- List<String> operDatesNew = new ArrayList<>();
|
|
|
|
- //用手术时间加三天
|
|
|
|
- for (int i = 1; i < 4; i++) {
|
|
|
|
- Date firstTimeOfDay = DateUtil.getFirstTimeOfDay(DateUtil.addDay(oper, i));
|
|
|
|
- operDatesNew.add(formatter.format(firstTimeOfDay));
|
|
|
|
- }
|
|
|
|
- if (roundsDate.size() > 2) {//查房日期取出没有3天时间, 直接报错
|
|
|
|
- //去重
|
|
|
|
- List<String> listTemp = new ArrayList<String>();
|
|
|
|
- for (int i = 0; i < roundsDate.size(); i++) {
|
|
|
|
- if (!listTemp.contains(roundsDate.get(i))) {
|
|
|
|
- listTemp.add(roundsDate.get(i));
|
|
|
|
- }
|
|
|
|
|
|
+ }
|
|
|
|
+ if (operDateList.size() > 0) {
|
|
|
|
+ for (String operDates : operDateList) {
|
|
|
|
+ Date oper = StringUtil.parseDateTime(operDates);
|
|
|
|
+ //手术时间 减去 出院时间
|
|
|
|
+ long day = (leaveDate.getTime() - oper.getTime()) / (24 * 60 * 60 * 1000);
|
|
|
|
+ //时间大于三天才能判断有没有连续三天查房
|
|
|
|
+ if (day > 3) {
|
|
|
|
+ List<String> operDatesNew = new ArrayList<>();
|
|
|
|
+ //用手术时间加三天
|
|
|
|
+ for (int i = 1; i < 4; i++) {
|
|
|
|
+ Date firstTimeOfDay = DateUtil.getFirstTimeOfDay(DateUtil.addDay(oper, i));
|
|
|
|
+ operDatesNew.add(formatter.format(firstTimeOfDay));
|
|
|
|
+ }
|
|
|
|
+ if (roundsDate.size() > 2) {//查房日期取出没有3天时间, 直接报错
|
|
|
|
+ //去重
|
|
|
|
+ List<String> listTemp = new ArrayList<String>();
|
|
|
|
+ for (int i = 0; i < roundsDate.size(); i++) {
|
|
|
|
+ if (!listTemp.contains(roundsDate.get(i))) {
|
|
|
|
+ listTemp.add(roundsDate.get(i));
|
|
}
|
|
}
|
|
- int i = 0;
|
|
|
|
- //循环两个时间List,
|
|
|
|
- for (String str : operDatesNew) {
|
|
|
|
- for (String s : listTemp) {
|
|
|
|
- if (str.equals(s)) {
|
|
|
|
- i++;
|
|
|
|
- }
|
|
|
|
|
|
+ }
|
|
|
|
+ int i = 0;
|
|
|
|
+ //循环两个时间List,
|
|
|
|
+ for (String str : operDatesNew) {
|
|
|
|
+ for (String s : listTemp) {
|
|
|
|
+ if (str.equals(s)) {
|
|
|
|
+ i++;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- if (i < 3) {
|
|
|
|
- status.set("-1");
|
|
|
|
- }
|
|
|
|
- } else {
|
|
|
|
|
|
+ }
|
|
|
|
+ if (i < 3) {
|
|
status.set("-1");
|
|
status.set("-1");
|
|
- return;
|
|
|
|
}
|
|
}
|
|
|
|
+ } else {
|
|
|
|
+ status.set("-1");
|
|
|
|
+ return;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|