|
@@ -5,21 +5,21 @@ 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.FirstCourseRecordDoc;
|
|
|
import com.lantone.qc.pub.model.doc.ThreeLevelWardDoc;
|
|
|
import com.lantone.qc.pub.util.StringUtil;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
-import java.util.Date;
|
|
|
-import java.util.HashMap;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
+import java.util.*;
|
|
|
|
|
|
/**
|
|
|
* @ClassName : THR02986
|
|
|
* @Description : 医嘱有激素使用病程无记录
|
|
|
* 药品类型(0.普药 1.抗生素 2.激素)
|
|
|
* @Author : 胡敬
|
|
|
- * @Date: 2020-06-23 10:43
|
|
|
+ * @Date: 2020-06-23 10:04
|
|
|
*/
|
|
|
@Component
|
|
|
public class THR02986 extends QCCatalogue {
|
|
@@ -36,7 +36,7 @@ public class THR02986 extends QCCatalogue {
|
|
|
String name = adviceDocStructureMap.get("医嘱项目名称");
|
|
|
String drugCategory = adviceDocStructureMap.get("药品类型");
|
|
|
String startDateStr = adviceDocStructureMap.get("医嘱开始时间");
|
|
|
- if (StringUtil.isNotBlank(drugCategory) && drugCategory.contains("2")) {
|
|
|
+ if (StringUtil.isNotBlank(drugCategory) && drugCategory.equals("2")) {
|
|
|
if (StringUtil.isNotBlank(name)) {
|
|
|
doctorAdviceDrugMap.put(StringUtil.parseDateTime(startDateStr), name);
|
|
|
}
|
|
@@ -48,15 +48,27 @@ public class THR02986 extends QCCatalogue {
|
|
|
return;
|
|
|
}
|
|
|
String infoStr = "";
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
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);
|
|
|
+ Set<String> splitDrugs = CatalogueUtil.getRegexWords(doctorAdviceDrug.getValue(), "[((\\[][^\\[\\]()()]+[\\]))]");
|
|
|
+
|
|
|
+ boolean isFind = false;
|
|
|
+ for (String drug : splitDrugs) {
|
|
|
+ int matchSum = 0;
|
|
|
+ if (drug.equals("合资") || drug.equals("进口") || drug.equals("国产") ) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ matchSum = getMatchSum(inputInfo.getFirstCourseRecordDoc(), allDoctorWradDocs, doctorAdviceDate, drug, matchSum, 2);
|
|
|
+ if (matchSum > 0) {
|
|
|
+ isFind = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!isFind) {
|
|
|
+ String.format(infoStr = CatalogueUtil.concatInfo(infoStr, doctorAdviceDrug.getValue() + "<医嘱时间>:" + sdf.format(doctorAdviceDate)));
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
if (StringUtil.isNotBlank(infoStr)) {
|
|
|
status.set("-1");
|
|
|
info.set(infoStr);
|
|
@@ -65,7 +77,17 @@ public class THR02986 extends QCCatalogue {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private int getMatchSum(List<ThreeLevelWardDoc> allDoctorWradDocs, Date doctorAdviceDate, String drug, int matchSum, int days) {
|
|
|
+ private int getMatchSum(FirstCourseRecordDoc firstCourseRecordDoc, List<ThreeLevelWardDoc> allDoctorWradDocs, Date doctorAdviceDate, String drug, int matchSum, int days) {
|
|
|
+ if (firstCourseRecordDoc != null) {
|
|
|
+ String wardDateStr = firstCourseRecordDoc.getStructureMap().get("病历日期");
|
|
|
+ String content = firstCourseRecordDoc.getStructureMap().get("治疗计划") + firstCourseRecordDoc.getStructureMap().get("诊疗计划");
|
|
|
+ Date wardDate = StringUtil.parseDateTime(wardDateStr);
|
|
|
+ if (doctorAdviceDate.before(wardDate) && !CatalogueUtil.compareTime(doctorAdviceDate, wardDate, days * 24 * 60L)) {
|
|
|
+ if (content.contains(drug)) {
|
|
|
+ matchSum++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
for (ThreeLevelWardDoc threeLevelWardDoc : allDoctorWradDocs) {
|
|
|
Map<String, String> wardDocStructureMap = threeLevelWardDoc.getStructureMap();
|
|
|
String wardDateStr = wardDocStructureMap.get("查房日期");
|