|
@@ -0,0 +1,46 @@
|
|
|
+package com.lantone.qc.kernel.catalogue.deathrecord;
|
|
|
+
|
|
|
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
|
|
|
+import com.lantone.qc.kernel.util.CatalogueUtil;
|
|
|
+import com.lantone.qc.pub.model.InputInfo;
|
|
|
+import com.lantone.qc.pub.model.OutputInfo;
|
|
|
+import com.lantone.qc.pub.model.doc.FirstPageRecordDoc;
|
|
|
+import org.springframework.stereotype.Component;
|
|
|
+
|
|
|
+import java.text.ParseException;
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
+import java.util.Date;
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
+/**
|
|
|
+ * @ClassName : DEAR0561
|
|
|
+ * @Description : 死亡记录未在患者离院后24小时内完成
|
|
|
+ * @Author : 胡敬
|
|
|
+ * @Date: 2020-03-18 18:38
|
|
|
+ */
|
|
|
+@Component
|
|
|
+public class DEAR0561 extends QCCatalogue {
|
|
|
+ public static String FORMAT_LONC_CN_MI = "yyyy/MM/dd HH:mm";
|
|
|
+ public void start(InputInfo inputInfo, OutputInfo outputInfo) throws ParseException {
|
|
|
+ status.set("0");
|
|
|
+ if (inputInfo.getDeathRecordDoc() != null && inputInfo.getDeathRecordDoc().getStructureMap() != null) {
|
|
|
+ Map<String, String> deathRecordStructureMap = inputInfo.getDeathRecordDoc().getStructureMap();
|
|
|
+ if (!CatalogueUtil.isEmpty(deathRecordStructureMap.get("死亡时间"))) {
|
|
|
+ String deathDate = deathRecordStructureMap.get("死亡时间");
|
|
|
+ FirstPageRecordDoc firstPageRecordDoc = inputInfo.getFirstPageRecordDoc();
|
|
|
+ if(firstPageRecordDoc != null && firstPageRecordDoc.getStructureMap() != null){
|
|
|
+ Map<String, String> firstPageMap = firstPageRecordDoc.getStructureMap();
|
|
|
+ String outDate = firstPageMap.get("出院时间");
|
|
|
+ if(outDate != null && deathDate != null){
|
|
|
+ Date date_in = new SimpleDateFormat(FORMAT_LONC_CN_MI).parse(deathDate);
|
|
|
+ Date date_out = new SimpleDateFormat(FORMAT_LONC_CN_MI).parse(outDate);
|
|
|
+ int hours = (int) ((date_out.getTime() - date_in.getTime()) / (1000*3600));
|
|
|
+ if(hours >24){
|
|
|
+ status.set("-1");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|