|
@@ -3,9 +3,13 @@ package com.lantone.qc.kernel.catalogue.hangzhoudiqi.threelevelward;
|
|
|
import com.lantone.qc.kernel.catalogue.QCCatalogue;
|
|
|
import com.lantone.qc.pub.model.InputInfo;
|
|
|
import com.lantone.qc.pub.model.OutputInfo;
|
|
|
+import com.lantone.qc.pub.model.doc.DailyCourseRecordDoc;
|
|
|
+import com.lantone.qc.pub.model.doc.StagesSummaryDoc;
|
|
|
import com.lantone.qc.pub.model.doc.ThreeLevelWardDoc;
|
|
|
import com.lantone.qc.pub.util.DateUtil;
|
|
|
+import com.lantone.qc.pub.util.ListUtil;
|
|
|
import com.lantone.qc.pub.util.StringUtil;
|
|
|
+import org.apache.commons.lang3.time.DateUtils;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
@@ -29,10 +33,12 @@ public class THR03010 extends QCCatalogue {
|
|
|
if (inputInfo.getFirstPageRecordDoc() == null || inputInfo.getFirstPageRecordDoc().getStructureMap().size() == 0) {
|
|
|
return;
|
|
|
}
|
|
|
- Map<String, String> structureMap = inputInfo.getBeHospitalizedDoc().getStructureMap();
|
|
|
- String behospitalDate = structureMap.get("入院日期") == null ? null : structureMap.get("入院日期");
|
|
|
+ // Map<String, String> structureMap = inputInfo.getBeHospitalizedDoc().getStructureMap();
|
|
|
+ // String behospitalDate = structureMap.get("入院日期") == null ? null : structureMap.get("入院日期");
|
|
|
+ Map<String, String> structureMap = inputInfo.getMedicalRecordInfoDoc().getStructureMap();
|
|
|
//String leaveHospitalDate = structureMap.get("leaveHospitalDate") == null ? null : structureMap.get("leaveHospitalDate");
|
|
|
Map<String, String> structureMaps = inputInfo.getFirstPageRecordDoc().getStructureMap();
|
|
|
+ String behospitalDate = structureMap.get("beHospitalDate") == null ? null : structureMap.get("beHospitalDate");
|
|
|
String leaveHospitalDate = structureMaps.get("出院时间")== null ? null : structureMap.get("leaveHospitalDate");
|
|
|
if (behospitalDate != null && leaveHospitalDate != null) {
|
|
|
Date beDate = StringUtil.parseDateTime(behospitalDate);
|
|
@@ -52,7 +58,40 @@ public class THR03010 extends QCCatalogue {
|
|
|
Date threeLevelDate = StringUtil.parseDateTime(t.getStructureMap().get("查房日期"));
|
|
|
stringList.add(formatter.format(threeLevelDate));
|
|
|
}
|
|
|
- if (stringList.size() > 2) {//查房日期取出没有3天时间, 直接报错
|
|
|
+ //阶段小结获取时间
|
|
|
+ ArrayList<String> stageSummaryList = new ArrayList<>();
|
|
|
+ List<StagesSummaryDoc> stagesSummaryDocs = inputInfo.getStagesSummaryDocs();
|
|
|
+ if(ListUtil.isNotEmpty(stagesSummaryDocs)) {
|
|
|
+ for (StagesSummaryDoc stagesSummaryDoc : stagesSummaryDocs) {
|
|
|
+ String stagesSummaryTime = stagesSummaryDoc.getStructureMap().get("记录时间");
|
|
|
+ Date stagesSummaryDate = StringUtil.parseDateTime(stagesSummaryTime);
|
|
|
+ stageSummaryList.add(formatter.format(stagesSummaryDate));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //循环入院之后的三天
|
|
|
+ rr:for (String date : stringDate) {
|
|
|
+ Date stringTimeDate = StringUtil.parseDateTime(date);
|
|
|
+ //查房时间
|
|
|
+ for (String s : stringList) {
|
|
|
+ Date sDate = StringUtil.parseDateTime(s);
|
|
|
+ //判断是否为同一天
|
|
|
+ if(DateUtils.isSameDay(stringTimeDate,sDate)){
|
|
|
+ continue rr;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //阶段小结时间
|
|
|
+ for (String stageSummary : stageSummaryList) {
|
|
|
+ Date stageSummaryDate = StringUtil.parseDateTime(stageSummary);
|
|
|
+ //判断是否为同一天
|
|
|
+ if(DateUtils.isSameDay(stringTimeDate,stageSummaryDate)){
|
|
|
+ continue rr;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ status.set("-1");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+/* if (stringList.size() > 2) {//查房日期取出没有3天时间, 直接报错
|
|
|
//去重
|
|
|
List<String> listTemp = new ArrayList<String>();
|
|
|
for (int i = 0; i < stringList.size(); i++) {
|
|
@@ -73,7 +112,7 @@ public class THR03010 extends QCCatalogue {
|
|
|
}
|
|
|
} else {
|
|
|
status.set("-1");
|
|
|
- }
|
|
|
+ }*/
|
|
|
|
|
|
}
|
|
|
}
|