|
@@ -0,0 +1,145 @@
|
|
|
+package com.lantone.qc.kernel.catalogue.threelevelward;
|
|
|
+
|
|
|
+import com.lantone.qc.dbanaly.util.KernelConstants;
|
|
|
+import com.lantone.qc.dbanaly.util.SpecialStorageUtil;
|
|
|
+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.DoctorAdviceDoc;
|
|
|
+import com.lantone.qc.pub.model.doc.FirstCourseRecordDoc;
|
|
|
+import com.lantone.qc.pub.model.doc.RescueDoc;
|
|
|
+import com.lantone.qc.pub.model.doc.ThreeLevelWardDoc;
|
|
|
+import com.lantone.qc.pub.util.ListUtil;
|
|
|
+import com.lantone.qc.pub.util.SpringContextUtil;
|
|
|
+import com.lantone.qc.pub.util.StringUtil;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.stereotype.Component;
|
|
|
+
|
|
|
+import java.util.Date;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
+/**
|
|
|
+ * @ClassName : THR03149
|
|
|
+ * @Description : 抢救患者上级医师(副高及以上)查房记录不及时
|
|
|
+ * @Author : Mark
|
|
|
+ * @Date: 2020-04-07 17:06
|
|
|
+ */
|
|
|
+@Component
|
|
|
+public class THR03149 extends QCCatalogue {
|
|
|
+ @Autowired
|
|
|
+ private SpecialStorageUtil specialStorageUtil;
|
|
|
+ public void start(InputInfo inputInfo, OutputInfo outputInfo) {
|
|
|
+ /**
|
|
|
+ * 【抢救开始时间】时间延后6小时内,找标题为【主任*查房】或【主任级别的姓名查房】,若无报出
|
|
|
+ *
|
|
|
+ * 1.先判断是否是抢救患者p6,并无【死亡记录】,是则找2.【抢救记录】内【抢救开始时间】标题或抢救过程中抢救开始时间延后6小时内,
|
|
|
+ * 找标题为【主任*查房】或【主任级别的姓名查房】,若有不报,若无 3.去【首次病程记录/抢救记录】内找是否有包含【请示*上级医生/请示*上级医师】,若无,报出
|
|
|
+ *
|
|
|
+ * 判断该病人是否属于抢救病人 1.【临时医嘱/长期医嘱】包含【抢救】医嘱或2.【抢救记录】文书
|
|
|
+ */
|
|
|
+ boolean flag = false;
|
|
|
+ List<DoctorAdviceDoc> doctorAdviceDocs = inputInfo.getDoctorAdviceDocs();
|
|
|
+ List<RescueDoc> rescueDocs = inputInfo.getRescueDocs();
|
|
|
+ if(ListUtil.isNotEmpty(rescueDocs)){
|
|
|
+ flag=true;
|
|
|
+ }
|
|
|
+ //为一个抢救患者
|
|
|
+ if(ListUtil.isNotEmpty(rescueDocs)){
|
|
|
+ //获取抢救时间
|
|
|
+ for (RescueDoc rescueDoc : rescueDocs) {
|
|
|
+ String saveTime = rescueDoc.getStructureMap().get("抢救开始时间");
|
|
|
+ if(StringUtil.isBlank(saveTime)){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ Date saveDate = StringUtil.parseDateTime(saveTime);
|
|
|
+ if(!getAllSaveDoctor(inputInfo,outputInfo,saveDate)){
|
|
|
+ //去【首次病程记录/抢救记录】内找是否有包含【请示*上级医生/请示*上级医师】
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if(ListUtil.isNotEmpty(doctorAdviceDocs)){
|
|
|
+ for (DoctorAdviceDoc doctorAdviceDoc : doctorAdviceDocs) {
|
|
|
+ //取长期临时医嘱,不为作废医嘱
|
|
|
+ if(doctorAdviceDoc.getStructureMap()!=null) {
|
|
|
+ Map<String, String> doctorAdviceDocStructureMap = doctorAdviceDoc.getStructureMap();
|
|
|
+ String adviceType = doctorAdviceDocStructureMap.get(Content.doctorAdviceType);
|
|
|
+ if (StringUtil.isNotEmpty(adviceType)) {
|
|
|
+ if (adviceType.equals(Content.standingOrder) || adviceType.equals(Content.statOrder)) {
|
|
|
+ String adviceState = doctorAdviceDocStructureMap.get(Content.doctorAdviceState);
|
|
|
+ if (StringUtil.isNotEmpty(adviceState)) {
|
|
|
+ if (!Content.cancellationOrderList.contains(adviceState)) {
|
|
|
+ //医嘱若是包含 转*科/科*转则为一个转科患者
|
|
|
+ String medicalOrderName = doctorAdviceDoc.getStructureMap().get(Content.medicalOrderName);
|
|
|
+ if (medicalOrderName.contains("抢救")) {
|
|
|
+ flag = true;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //抢救6小时内 找标题为【主任*查房】或【主任级别的姓名查房】
|
|
|
+ public boolean getAllSaveDoctor(InputInfo inputInfo, OutputInfo outputInfo,Date saveDate ) {
|
|
|
+ List<ThreeLevelWardDoc> threeLevelWardDocs = inputInfo.getThreeLevelWardDocs();
|
|
|
+ if (ListUtil.isEmpty(threeLevelWardDocs)) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ List<ThreeLevelWardDoc> allDoctorWradDocs = threeLevelWardDocs.get(0).getAllDoctorWradDocs();
|
|
|
+ if (ListUtil.isEmpty(allDoctorWradDocs)) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ for (ThreeLevelWardDoc allDoctorWradDoc : allDoctorWradDocs) {
|
|
|
+ Map<String, String> structureMap = allDoctorWradDoc.getStructureMap();
|
|
|
+ String checkTime = structureMap.get("查房日期");
|
|
|
+ if(StringUtil.isBlank(checkTime)){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ if (!CatalogueUtil.compareTime(
|
|
|
+ saveDate,
|
|
|
+ StringUtil.parseDateTime(checkTime),
|
|
|
+ Long.valueOf(6 * 60))) {
|
|
|
+ //不大于抢救开始时间6小时内,取查房标题
|
|
|
+ String wardRoundTitle = structureMap.get("查房标题");
|
|
|
+ //【主任*查房】或【主任级别的姓名查房】
|
|
|
+ if(StringUtil.isBlank(wardRoundTitle)){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ if(wardRoundTitle.contains("主任")){
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ if(judgeContainsDoctor(wardRoundTitle)){
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ //判断是否含有主任医师姓名
|
|
|
+ private boolean judgeContainsDoctor(String string) {
|
|
|
+ Map<String, Map<String, Object>> hospitalDoctorMap = specialStorageUtil.getJsonStringValue(KernelConstants.HOSPITAL_DOCTOR_MAP);
|
|
|
+ if (hospitalDoctorMap == null) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ for (String keyStr : hospitalDoctorMap.keySet()) {
|
|
|
+ if (string.contains(keyStr)) {
|
|
|
+ Object professor = hospitalDoctorMap.get(keyStr).get("professor");
|
|
|
+ if (professor != null) {
|
|
|
+ if (professor.toString().contains("主任")) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+}
|