|
@@ -0,0 +1,80 @@
|
|
|
|
+package com.lantone.qc.kernel.catalogue.threelevelward;
|
|
|
|
+
|
|
|
|
+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.DoctorAdviceDoc;
|
|
|
|
+import com.lantone.qc.pub.model.doc.ThreeLevelWardDoc;
|
|
|
|
+import com.lantone.qc.pub.util.StringUtil;
|
|
|
|
+import org.springframework.stereotype.Component;
|
|
|
|
+
|
|
|
|
+import java.util.Date;
|
|
|
|
+import java.util.HashMap;
|
|
|
|
+import java.util.List;
|
|
|
|
+import java.util.Map;
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * @ClassName : THR02985
|
|
|
|
+ * @Description : 医嘱有抗生素使用病程无记录
|
|
|
|
+ * @Author : 胡敬
|
|
|
|
+ * @Date: 2020-06-23 10:04
|
|
|
|
+ */
|
|
|
|
+@Component
|
|
|
|
+public class THR02985 extends QCCatalogue {
|
|
|
|
+ public void start(InputInfo inputInfo, OutputInfo outputInfo) {
|
|
|
|
+ List<DoctorAdviceDoc> doctorAdviceDocs = inputInfo.getDoctorAdviceDocs();
|
|
|
|
+ List<ThreeLevelWardDoc> threeLevelWardDocs = inputInfo.getThreeLevelWardDocs();
|
|
|
|
+ if (doctorAdviceDocs.size() == 0 || threeLevelWardDocs.size() == 0) {
|
|
|
|
+ status.set("0");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ Map<Date, String> doctorAdviceDrugMap = new HashMap<>();
|
|
|
|
+ for (DoctorAdviceDoc adviceDoc : doctorAdviceDocs) {
|
|
|
|
+ Map<String, String> adviceDocStructureMap = adviceDoc.getStructureMap();
|
|
|
|
+ String name = adviceDocStructureMap.get("医嘱项目名称");
|
|
|
|
+ String drugCategory = adviceDocStructureMap.get("医嘱药品类别");
|
|
|
|
+ String startDateStr = adviceDocStructureMap.get("医嘱开始时间");
|
|
|
|
+ if (StringUtil.isNotBlank(drugCategory) && drugCategory.contains("抗生素")) {
|
|
|
|
+ if (StringUtil.isNotBlank(name)) {
|
|
|
|
+ doctorAdviceDrugMap.put(StringUtil.parseDateTime(startDateStr), name);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ List<ThreeLevelWardDoc> allDoctorWradDocs = threeLevelWardDocs.get(0).getAllDoctorWradDocs();
|
|
|
|
+ if (allDoctorWradDocs.size() == 0) {
|
|
|
|
+ status.set("0");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ String infoStr = "";
|
|
|
|
+ for (Map.Entry<Date, String> doctorAdviceDrug : doctorAdviceDrugMap.entrySet()) {
|
|
|
|
+ Date doctorAdviceDate = doctorAdviceDrug.getKey();
|
|
|
|
+ String drug = doctorAdviceDrug.getValue();
|
|
|
|
+ int matchSum = 0;
|
|
|
|
+ matchSum = getMatchSum(allDoctorWradDocs, doctorAdviceDate, drug, matchSum, 2);
|
|
|
|
+ if (matchSum == 0) {
|
|
|
|
+ infoStr = CatalogueUtil.concatInfo(infoStr, drug);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (StringUtil.isNotBlank(infoStr)) {
|
|
|
|
+ status.set("-1");
|
|
|
|
+ info.set(infoStr);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private int getMatchSum(List<ThreeLevelWardDoc> allDoctorWradDocs, Date doctorAdviceDate, String drug, int matchSum, int days) {
|
|
|
|
+ for (ThreeLevelWardDoc threeLevelWardDoc : allDoctorWradDocs) {
|
|
|
|
+ Map<String, String> wardDocStructureMap = threeLevelWardDoc.getStructureMap();
|
|
|
|
+ String wardDateStr = wardDocStructureMap.get("查房日期");
|
|
|
|
+ String content = wardDocStructureMap.get("病情记录");
|
|
|
|
+ Date wardDate = StringUtil.parseDateTime(wardDateStr);
|
|
|
|
+ if (doctorAdviceDate.before(wardDate) && !CatalogueUtil.compareTime(doctorAdviceDate, wardDate, days * 24 * 60L)) {
|
|
|
|
+ if (content.contains(drug)) {
|
|
|
|
+ matchSum++;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return matchSum;
|
|
|
|
+ }
|
|
|
|
+}
|