|
@@ -0,0 +1,276 @@
|
|
|
|
+package com.lantone.qc.kernel.catalogue.hospital.changshaxy.threelevelward;
|
|
|
|
+
|
|
|
|
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
|
|
|
|
+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.*;
|
|
|
|
+import com.lantone.qc.pub.util.ListUtil;
|
|
|
|
+import com.lantone.qc.pub.util.StringUtil;
|
|
|
|
+import org.springframework.stereotype.Component;
|
|
|
|
+
|
|
|
|
+import java.util.List;
|
|
|
|
+import java.util.Map;
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * @ClassName : THR03120
|
|
|
|
+ * @Description: 病程记录未记录恶性肿瘤化学治疗相关信息
|
|
|
|
+ * @author: zh
|
|
|
|
+ * @time: 2021/04/19 11:22
|
|
|
|
+ */
|
|
|
|
+@Component
|
|
|
|
+public class THR03123 extends QCCatalogue {
|
|
|
|
+ public void start(InputInfo inputInfo, OutputInfo outputInfo) {
|
|
|
|
+ status.set("0");
|
|
|
|
+ boolean flag = false;
|
|
|
|
+ boolean bool = false;
|
|
|
|
+ FirstPageRecordDoc firstPageRecordDoc = inputInfo.getFirstPageRecordDoc();
|
|
|
|
+ List<ThreeLevelWardDoc> threeLevelWardDocs = inputInfo.getThreeLevelWardDocs();
|
|
|
|
+ List<DoctorAdviceDoc> doctorAdviceDocs = inputInfo.getDoctorAdviceDocs();
|
|
|
|
+ LeaveHospitalDoc leaveHospitalDoc = inputInfo.getLeaveHospitalDoc();
|
|
|
|
+ List<String> chemotherapyList = Content.chemotherapyDrugList;
|
|
|
|
+ List<String> tumorDiseaseList = Content.tumorDiseaseList;
|
|
|
|
+ //首页判断出院诊断
|
|
|
|
+ if (firstPageRecordDoc != null) {
|
|
|
|
+ Map<String, Object> structureExtMap = firstPageRecordDoc.getStructureExtMap();
|
|
|
|
+ List<Map<String,String>> dischargeDiag = (List) structureExtMap.get(Content.dischargeDiag);
|
|
|
|
+ if(ListUtil.isNotEmpty(dischargeDiag)){
|
|
|
|
+ zd: for (Map<String, String> diagMap : dischargeDiag) {
|
|
|
|
+ if(StringUtil.isNotBlank(diagMap.get("诊断名称"))){
|
|
|
|
+ if(exStr(diagMap.get("诊断名称"))){
|
|
|
|
+ flag=true;
|
|
|
|
+ break zd;
|
|
|
|
+ }
|
|
|
|
+ for (String tumorDisease : tumorDiseaseList) {
|
|
|
|
+ if(diagMap.get("诊断名称").contains(tumorDisease)){
|
|
|
|
+ flag=true;
|
|
|
|
+ break zd;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ if(StringUtil.isNotBlank(diagMap.get("诊断编码"))){
|
|
|
|
+ if(diagMap.get("诊断编码").toUpperCase().startsWith("C")){
|
|
|
|
+ flag=true;
|
|
|
|
+ break zd;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //出院小结判断入院诊断,出院诊断
|
|
|
|
+ if(leaveHospitalDoc!=null){
|
|
|
|
+ Map<String, String> structureMap = leaveHospitalDoc.getStructureMap();
|
|
|
|
+ //入院诊断
|
|
|
|
+ String str = structureMap.get("入院诊断");
|
|
|
|
+ if(StringUtil.isNotEmpty(str)){
|
|
|
|
+ if(exStr(str)){
|
|
|
|
+ flag=true;
|
|
|
|
+ }
|
|
|
|
+ for (String tumorDisease : tumorDiseaseList) {
|
|
|
|
+ if(str.contains(tumorDisease)){
|
|
|
|
+ flag=true;
|
|
|
|
+ break ;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //出院诊断
|
|
|
|
+ String str1 = structureMap.get("出院诊断");
|
|
|
|
+ if(StringUtil.isNotEmpty(str1)) {
|
|
|
|
+ if (exStr(str1)) {
|
|
|
|
+ flag = true;
|
|
|
|
+ }
|
|
|
|
+ for (String tumorDisease : tumorDiseaseList) {
|
|
|
|
+ if (str1.contains(tumorDisease)) {
|
|
|
|
+ flag = true;
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //是否有化疗知情同意书
|
|
|
|
+ List<InformedConsentDoc> informedConsentDoc = inputInfo.getInformedConsentDoc();
|
|
|
|
+ if (ListUtil.isNotEmpty(informedConsentDoc)) {
|
|
|
|
+ for (InformedConsentDoc consentDoc : informedConsentDoc) {
|
|
|
|
+ if(consentDoc.getStructureMap()!=null) {
|
|
|
|
+ if (StringUtil.isNotEmpty(consentDoc.getStructureMap().get("标题"))) {
|
|
|
|
+ if ("化疗知情同意书".equals(consentDoc.getStructureMap().get("标题")) || "放疗记录单".equals(consentDoc.getStructureMap().get("标题"))) {
|
|
|
|
+ flag = true;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ /**
|
|
|
|
+ * 进一步判断是否使用过化学药物
|
|
|
|
+ */
|
|
|
|
+ if (flag) {
|
|
|
|
+ //医嘱中判断是否使用过化学药物
|
|
|
|
+ if (ListUtil.isNotEmpty(doctorAdviceDocs)) {
|
|
|
|
+ for (DoctorAdviceDoc doctorAdviceDoc : doctorAdviceDocs) {
|
|
|
|
+ Map<String, String> doctorAdviceDocStrMap = doctorAdviceDoc.getStructureMap();
|
|
|
|
+ String daStatus = doctorAdviceDocStrMap.get(Content.doctorAdviceState);
|
|
|
|
+ if (StringUtil.isNotEmpty(daStatus)) {
|
|
|
|
+ if (!Content.cancellationOrderList.contains(daStatus)) {
|
|
|
|
+ //取临时医嘱
|
|
|
|
+ String doctorAsks = doctorAdviceDocStrMap.get(Content.doctorAdviceType);
|
|
|
|
+ if (StringUtil.isEmpty(doctorAsks)) {
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ if ("临时".equals(doctorAsks) || "长期".equals(daStatus)) {
|
|
|
|
+ String daItemName = doctorAdviceDocStrMap.get(Content.medicalOrderName);
|
|
|
|
+ for (String chemotherapy : chemotherapyList) {
|
|
|
|
+ if (daItemName.contains(chemotherapy)) {
|
|
|
|
+ bool = true;
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //查房
|
|
|
|
+ if(ListUtil.isNotEmpty(threeLevelWardDocs)) {
|
|
|
|
+ List<ThreeLevelWardDoc> allDoctorWradDocs = threeLevelWardDocs.get(0).getAllDoctorWradDocs();
|
|
|
|
+ cf:for (ThreeLevelWardDoc allDoctorWradDoc : allDoctorWradDocs) {
|
|
|
|
+ String illness = allDoctorWradDoc.getStructureMap().get(Content.illnessRecords);
|
|
|
|
+ for (String chemotherapy : chemotherapyList) {
|
|
|
|
+ if (illness.contains(chemotherapy)) {
|
|
|
|
+ bool=true;
|
|
|
|
+ break cf;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if(dateStr(illness)){
|
|
|
|
+ bool=true;
|
|
|
|
+ break cf;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //知情同意书
|
|
|
|
+ if (ListUtil.isNotEmpty(informedConsentDoc)) {
|
|
|
|
+ for (InformedConsentDoc consentDoc : informedConsentDoc) {
|
|
|
|
+ if ("化疗知情同意书".equals(consentDoc.getStructureMap().get("标题"))) {
|
|
|
|
+ bool = true;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //出院小结判断入院诊断,出院诊断
|
|
|
|
+ if(leaveHospitalDoc!=null){
|
|
|
|
+ Map<String, String> structureMap = leaveHospitalDoc.getStructureMap();
|
|
|
|
+ //入院诊断
|
|
|
|
+ String str = structureMap.get("入院诊断");
|
|
|
|
+ if(StringUtil.isNotEmpty(str)){
|
|
|
|
+ if(dateStr(str)){
|
|
|
|
+ bool=true;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //出院诊断
|
|
|
|
+ String str1 = structureMap.get("出院诊断");
|
|
|
|
+ if(dateStr(str1)){
|
|
|
|
+ bool=true;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //首页诊断
|
|
|
|
+ if (firstPageRecordDoc != null) {
|
|
|
|
+ Map<String, Object> structureExtMap = firstPageRecordDoc.getStructureExtMap();
|
|
|
|
+ List<Map<String,String>> dischargeDiag = (List) structureExtMap.get(Content.dischargeDiag);
|
|
|
|
+ if(ListUtil.isNotEmpty(dischargeDiag)){
|
|
|
|
+ for (Map<String, String> diagMap : dischargeDiag) {
|
|
|
|
+ if(StringUtil.isNotBlank(diagMap.get("诊断名称"))){
|
|
|
|
+ if(dateStr(diagMap.get("诊断名称"))){
|
|
|
|
+ bool=true;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if(bool){
|
|
|
|
+ //为一个恶性肿瘤化学治疗患者
|
|
|
|
+ status.set("-1");
|
|
|
|
+ if (ListUtil.isNotEmpty(threeLevelWardDocs)) {
|
|
|
|
+ List<ThreeLevelWardDoc> allDoctorWradDocs = threeLevelWardDocs.get(0).getAllDoctorWradDocs();
|
|
|
|
+ for (ThreeLevelWardDoc allDoctorWradDoc : allDoctorWradDocs) {
|
|
|
|
+ String illness = allDoctorWradDoc.getStructureMap().get(Content.illnessRecords);
|
|
|
|
+ for (String chemotherapyDrug : chemotherapyList) {
|
|
|
|
+ if(illness.contains(chemotherapyDrug)){
|
|
|
|
+ status.set("0");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //判断病程记录是否记录
|
|
|
|
+ if (dateStr(illness)) {
|
|
|
|
+ status.set("0");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ private boolean dateStr(String string){
|
|
|
|
+ if(StringUtil.isEmpty(string)){
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ String str = Str(string);
|
|
|
|
+ String rex1="[\\s\\S]*(?=化)[^,;,;。]{0,7}(?=疗)[\\s\\S]*";
|
|
|
|
+ String rex2="[\\s\\S]*(?=新辅)[^,;,;。]{0,7}(?=疗)[\\s\\S]*";
|
|
|
|
+ String rex3="[\\s\\S]*(?=解救)[^,;,;。]{0,7}(?=疗)[\\s\\S]*";
|
|
|
|
+ String rex4="[\\s\\S]*(?=恶性)[^,;,;。]{0,7}(?=肿瘤)[^,;,;。]{0,7}(?=全身)[^,;,;。]{0,7}(?=治疗)[\\s\\S]*";
|
|
|
|
+ if(str.matches(rex1) || str.matches(rex2)|| str.matches(rex3)|| str.matches(rex4) ){
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ //判断恶性肿瘤
|
|
|
|
+ private boolean exStr(String string){
|
|
|
|
+ if(StringUtil.isEmpty(string)){
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ String str = Str(string);
|
|
|
|
+ String rex1="[\\s\\S]*(?=恶性)[^,;,;。]{0,7}(?=瘤)[\\s\\S]*";
|
|
|
|
+ String rex2="[\\s\\S]*(?=新辅)[^,;,;。]{0,7}(?=治疗)[\\s\\S]*";
|
|
|
|
+ String rex3="[\\s\\S]*(?=解救)[^,;,;。]{0,7}(?=治疗)[\\s\\S]*";
|
|
|
|
+ String rex4="[\\s\\S]*(?=恶性)[^,;,;。]{0,7}(?=肿瘤)[^,;,;。]{0,7}(?=全身)[^,;,;。]{0,7}(?=治疗)[\\s\\S]*";
|
|
|
|
+ String rex5="[\\s\\S]*(?=化)[^,;,;。]{0,7}(?=疗)[\\s\\S]*";
|
|
|
|
+ if(str.contains("肉瘤") || str.contains("淋巴瘤") || str.contains("白血病") || str.contains("癌") || str.contains("canser") ||
|
|
|
|
+ str.matches(rex1) ||str.matches(rex2) ||str.matches(rex3) ||str.matches(rex4)||str.contains("can")||str.contains("CA")||str.matches(rex5)){
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ //药物治疗
|
|
|
|
+ private boolean exStrTwo(String string){
|
|
|
|
+ if(StringUtil.isEmpty(string)){
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ String str = Str(string);
|
|
|
|
+ String rex1="[\\s\\S]*(?=化)[^,;,;。]{0,7}(?=疗)[\\s\\S]*";
|
|
|
|
+ String rex2="[\\s\\S]*(?=放)[^,;,;。]{0,7}(?=疗)[\\s\\S]*";
|
|
|
|
+ if(str.contains("伽马刀") || str.contains("γ刀") || str.contains("粒子植入") || str.contains("立体定向放射") || str.contains("三维适形调强放疗")
|
|
|
|
+ || str.matches(rex1) || str.matches(rex2) ||str.contains("IMRT") ||str.contains("SRT") || str.contains("靶区勾画")
|
|
|
|
+ || str.contains("腹腔灌注")
|
|
|
|
+ || str.contains("热疗")){
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ private String Str(String str){
|
|
|
|
+ str = str.replaceAll("\\*", "\\\\*");
|
|
|
|
+ str = str.replaceAll("\\)", "\\\\)");
|
|
|
|
+ str = str.replaceAll("\\.", "\\\\.");
|
|
|
|
+ str = str.replaceAll("\\?", "\\\\?");
|
|
|
|
+ str = str.replaceAll("\\+", "\\\\+");
|
|
|
|
+ str = str.replaceAll("\\$", "\\\\$");
|
|
|
|
+ str = str.replaceAll("\\^", "\\\\^");
|
|
|
|
+ str = str.replaceAll("\\[", "\\\\[");
|
|
|
|
+ str = str.replaceAll("\\]", "\\\\]");
|
|
|
|
+ str = str.replaceAll("\\(", "\\\\(");
|
|
|
|
+ str = str.replaceAll("\\{", "\\\\{");
|
|
|
|
+ str = str.replaceAll("\\}", "\\\\}");
|
|
|
|
+ str = str.replaceAll("\\|", "\\\\|");
|
|
|
|
+ str = str.replaceAll("\\/", "\\\\/");
|
|
|
|
+ return str;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+}
|