|
@@ -0,0 +1,78 @@
|
|
|
+package com.lantone.qc.kernel.catalogue.hangzhoudiqi.behospitalized;
|
|
|
+
|
|
|
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
|
|
|
+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.BeHospitalizedDoc;
|
|
|
+import com.lantone.qc.pub.model.doc.MedicalRecordInfoDoc;
|
|
|
+import com.lantone.qc.pub.model.doc.ScaleDoc;
|
|
|
+import com.lantone.qc.pub.model.entity.Clinical;
|
|
|
+import com.lantone.qc.pub.util.DateUtil;
|
|
|
+import com.lantone.qc.pub.util.StringUtil;
|
|
|
+import org.springframework.stereotype.Component;
|
|
|
+
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
+
|
|
|
+/**
|
|
|
+ * @ClassName : BEH0561
|
|
|
+ * @Description : 自杀、冲动、猝死三大量表未在24小时内创建(杭州七院标准版)
|
|
|
+ * @Author : dsYun
|
|
|
+ * @Date: 2024-10-17 17:48
|
|
|
+ */
|
|
|
+@Component
|
|
|
+public class BEH0561 extends QCCatalogue {
|
|
|
+ public void start(InputInfo inputInfo, OutputInfo outputInfo) {
|
|
|
+ status.set("0");
|
|
|
+ StringBuffer sb = new StringBuffer();
|
|
|
+ String admisDate = "";
|
|
|
+ List<ScaleDoc> scaleDocs = inputInfo.getScaleDocs();
|
|
|
+ MedicalRecordInfoDoc medicalRecordInfoDoc = inputInfo.getMedicalRecordInfoDoc();
|
|
|
+ if (medicalRecordInfoDoc == null) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (medicalRecordInfoDoc.getStructureMap() == null) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ //入院日期
|
|
|
+ admisDate = medicalRecordInfoDoc.getStructureMap().get("behospitalDate");
|
|
|
+
|
|
|
+ if (CatalogueUtil.isEmpty(admisDate)) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (!CatalogueUtil.compareTime(
|
|
|
+ StringUtil.parseDateTime(admisDate),
|
|
|
+ StringUtil.parseDateTime(DateUtil.nowString()),
|
|
|
+ Long.valueOf(24 * 60))) {//如果入院还未过24小时规则不判断
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ for (ScaleDoc scaleDoc : scaleDocs) {
|
|
|
+ //模板创建日期
|
|
|
+ String firstCreateDate = scaleDoc.getStructureMap().get("firstCreateDate");
|
|
|
+ //模板title
|
|
|
+ String recTitle = scaleDoc.getStructureMap().get("recTitle");
|
|
|
+
|
|
|
+ if (CatalogueUtil.isEmpty(firstCreateDate)) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (CatalogueUtil.compareTime(
|
|
|
+ StringUtil.parseDateTime(admisDate),
|
|
|
+ StringUtil.parseDateTime(firstCreateDate),
|
|
|
+ Long.valueOf(24 * 60))) {
|
|
|
+ sb.append(recTitle + ":[" + firstCreateDate + "]、");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (sb.toString().length() > 0) {
|
|
|
+ status.set("-1");
|
|
|
+ info.set(sb.toString().substring(0, sb.toString().length() - 1));
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+}
|