|
@@ -5,6 +5,8 @@ import com.lantone.qc.kernel.util.CatalogueUtil;
|
|
|
import com.lantone.qc.pub.Content;
|
|
|
import com.lantone.qc.pub.model.InputInfo;
|
|
|
import com.lantone.qc.pub.model.OutputInfo;
|
|
|
+import com.lantone.qc.pub.model.doc.DeathRecordDoc;
|
|
|
+import com.lantone.qc.pub.model.doc.LeaveHospitalDoc;
|
|
|
import com.lantone.qc.pub.model.doc.RescueDoc;
|
|
|
import com.lantone.qc.pub.model.doc.ThreeLevelWardDoc;
|
|
|
import com.lantone.qc.pub.util.ListUtil;
|
|
@@ -28,9 +30,41 @@ import java.util.TreeMap;
|
|
|
public class THR0436 extends QCCatalogue {
|
|
|
public void start(InputInfo inputInfo, OutputInfo outputInfo) {
|
|
|
status.set("0");
|
|
|
+ //没有死亡记录并且没有离院记录,直接返回
|
|
|
+ if (inputInfo.getDeathRecordDoc() == null && inputInfo.getLeaveHospitalDoc() == null) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ //没有抢救记录或者查房记录,直接返回
|
|
|
if (ListUtil.isEmpty(inputInfo.getRescueDocs()) || ListUtil.isEmpty(inputInfo.getThreeLevelWardDocs())) {
|
|
|
return;
|
|
|
}
|
|
|
+ //死亡记录不为空
|
|
|
+ if (inputInfo.getDeathRecordDoc() != null) {
|
|
|
+ DeathRecordDoc deathRecordDoc = inputInfo.getDeathRecordDoc();
|
|
|
+ Map<String, String> deathRecordStructureMap = deathRecordDoc.getStructureMap();
|
|
|
+ String deathTime = deathRecordStructureMap.get("死亡时间");
|
|
|
+ if (StringUtil.isNotBlank(deathTime)) {
|
|
|
+ Date deathDate = StringUtil.parseDateTime(deathTime);
|
|
|
+ if (deathDate != null) {
|
|
|
+ dealWithRescueRecord(inputInfo, deathDate);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //离院记录不为空
|
|
|
+ if (inputInfo.getLeaveHospitalDoc() != null) {
|
|
|
+ LeaveHospitalDoc leaveHospitalDoc = inputInfo.getLeaveHospitalDoc();
|
|
|
+ Map<String, String> leaveHospitalStructureMap = leaveHospitalDoc.getStructureMap();
|
|
|
+ String leaveHospitalTime = leaveHospitalStructureMap.get("出院时间");
|
|
|
+ if (StringUtil.isNotBlank(leaveHospitalTime)) {
|
|
|
+ Date leaveHospitalDate = StringUtil.parseDateTime(leaveHospitalTime);
|
|
|
+ if (leaveHospitalDate != null) {
|
|
|
+ dealWithRescueRecord(inputInfo, leaveHospitalDate);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private void dealWithRescueRecord(InputInfo inputInfo, Date timeOfComparison) {
|
|
|
List<RescueDoc> rescueDocs = inputInfo.getRescueDocs(); //抢救记录
|
|
|
Map<Date, Map<String, String>> dateRecord = new TreeMap<>(new Comparator<Date>() {
|
|
|
@Override
|
|
@@ -44,7 +78,7 @@ public class THR0436 extends QCCatalogue {
|
|
|
Map<String, String> rescueStructureMap = rescueDoc.getStructureMap();
|
|
|
recordTime = rescueStructureMap.get("抢救时间");
|
|
|
Date recordDate = StringUtil.parseDateTime(recordTime);
|
|
|
- if (recordDate == null) {
|
|
|
+ if (recordDate == null || CatalogueUtil.equalsDate(recordDate, timeOfComparison, "yyyy-MM-dd")) {
|
|
|
continue;
|
|
|
}
|
|
|
dateRecord.put(recordDate, rescueStructureMap);
|