|
@@ -0,0 +1,202 @@
|
|
|
+package com.lantone.qc.kernel.catalogue.operationdiscussion;
|
|
|
+
|
|
|
+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.DoctorAdviceDoc;
|
|
|
+import com.lantone.qc.pub.model.doc.InformedConsentDoc;
|
|
|
+import com.lantone.qc.pub.model.doc.ThreeLevelWardDoc;
|
|
|
+import com.lantone.qc.pub.model.doc.operation.OperationDoc;
|
|
|
+import com.lantone.qc.pub.model.doc.operation.OperationInformedConsentDoc;
|
|
|
+import com.lantone.qc.pub.model.doc.operation.OperationRecordDoc;
|
|
|
+import com.lantone.qc.pub.util.ListUtil;
|
|
|
+import com.lantone.qc.pub.util.StringUtil;
|
|
|
+import org.springframework.stereotype.Component;
|
|
|
+
|
|
|
+import java.text.ParseException;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
+/**
|
|
|
+ * @Description: 手术记录内植入物使用未记录
|
|
|
+ * @author: cy
|
|
|
+ * @time: 2021/05/19 14:45
|
|
|
+ */
|
|
|
+@Component
|
|
|
+public class OPE03171 extends QCCatalogue {
|
|
|
+
|
|
|
+ @Override
|
|
|
+ protected void start(InputInfo inputInfo, OutputInfo outputInfo) throws ParseException {
|
|
|
+ status.set("0");
|
|
|
+ //先判断是否进行了手术
|
|
|
+ boolean ssHz=false;
|
|
|
+ boolean zrw=false;
|
|
|
+ //是否进行了手术
|
|
|
+ List<OperationDoc> operationDocs = inputInfo.getOperationDocs();
|
|
|
+ //是否有手术记录
|
|
|
+ if(ListUtil.isEmpty(operationDocs)){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if(operationDocs!=null){
|
|
|
+ for (OperationDoc operationDoc : operationDocs) {
|
|
|
+ OperationRecordDoc operationRecordDoc = operationDoc.getOperationRecordDoc();
|
|
|
+ if (operationRecordDoc != null) {
|
|
|
+ ssHz = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //手术记录
|
|
|
+ if(ssHz){
|
|
|
+ for (OperationDoc operationDoc : operationDocs) {
|
|
|
+ OperationInformedConsentDoc operationInformedConsentDoc = operationDoc.getOperationInformedConsentDoc();
|
|
|
+ if(operationInformedConsentDoc!=null){
|
|
|
+ String str = operationInformedConsentDoc.getStructureMap().get("使用植入性材料");
|
|
|
+ if(StringUtil.isNotEmpty(str)) {
|
|
|
+ if (str.equals("true")) {
|
|
|
+ zrw = true;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ if(str.equals("false")){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ OperationRecordDoc operationRecordDoc = operationDoc.getOperationRecordDoc();
|
|
|
+ if(operationRecordDoc!=null){
|
|
|
+ String key = getKeyByHospitalId();
|
|
|
+ String str = operationRecordDoc.getStructureMap().get(key);
|
|
|
+ if(StringUtil.isNotEmpty(str)){
|
|
|
+ if(str.contains("提醒")){
|
|
|
+ String clStr = clStr(str);
|
|
|
+ if(StringUtil.isNotEmpty(clStr)){
|
|
|
+ if(zrwStr(clStr)){
|
|
|
+ zrw=true;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ if(zrwStr(str)){
|
|
|
+ zrw=true;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ String strzr = operationRecordDoc.getStructureMap().get("植入物名称");
|
|
|
+ if(StringUtil.isNotEmpty(strzr)){
|
|
|
+ if(zrwStr(str)){
|
|
|
+ zrw=true;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ List<InformedConsentDoc> informedConsentDoc = inputInfo.getInformedConsentDoc();
|
|
|
+ //知情同意书
|
|
|
+ if (ListUtil.isNotEmpty(informedConsentDoc)) {
|
|
|
+ for (InformedConsentDoc consentDoc : informedConsentDoc) {
|
|
|
+ if ("手术植入材料收费知情同意书".equals(consentDoc.getStructureMap().get("标题"))) {
|
|
|
+ zrw = true;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /****手术记录***/
|
|
|
+ if(zrw&&ssHz){
|
|
|
+ status.set("-1");
|
|
|
+ //手术记录
|
|
|
+ if(ListUtil.isNotEmpty(operationDocs)){
|
|
|
+ for (OperationDoc operationDoc : operationDocs) {
|
|
|
+ OperationRecordDoc operationRecordDoc = operationDoc.getOperationRecordDoc();
|
|
|
+ if(operationRecordDoc!=null){
|
|
|
+ String key = getKeyByHospitalId();
|
|
|
+ String str = operationRecordDoc.getStructureMap().get(key);
|
|
|
+ if(StringUtil.isNotEmpty(str)){
|
|
|
+ if(str.contains("提醒")){
|
|
|
+ String clStr = clStr(str);
|
|
|
+ if(StringUtil.isNotEmpty(clStr)){
|
|
|
+ if(zrwStr(clStr)){
|
|
|
+ status.set("0");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ if(zrwStr(str)){
|
|
|
+ status.set("0");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ String strzr = operationRecordDoc.getStructureMap().get("植入物名称");
|
|
|
+ if(StringUtil.isNotEmpty(strzr)){
|
|
|
+ if(zrwStr(str)){
|
|
|
+ status.set("0");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //植入物
|
|
|
+ private boolean zrwStr(String str){
|
|
|
+ if(StringUtil.isEmpty(str)){
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ boolean flag=false;
|
|
|
+ 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("\\/", "\\\\/");
|
|
|
+ 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]*(?=机械)[\\s\\S]*";
|
|
|
+ String rex5="[\\s\\S]*(?=起搏)[^,;,;。]{0,7}(?=器)[\\s\\S]*";
|
|
|
+ String rex6="[\\s\\S]*(?=粒子)[^,;,;。]{0,7}(?=植入)[\\s\\S]*";
|
|
|
+ //植入物集合
|
|
|
+ List<String> theImplantsList = Content.theImplantsList;
|
|
|
+ for (String theImplants : theImplantsList) {
|
|
|
+ if(str.contains(theImplants)){
|
|
|
+ flag=true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(flag || str.matches(rex1)|| str.matches(rex2)|| str.matches(rex3)|| str.matches(rex4)|| str.matches(rex5)|| str.matches(rex6)){
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ //处理手术记录中含特殊话语情况
|
|
|
+ private String clStr(String str){
|
|
|
+ String newStr="";
|
|
|
+ if(str.contains("提醒")){
|
|
|
+ int i = str.indexOf("提醒");
|
|
|
+ newStr = str.substring(0,i);
|
|
|
+ }
|
|
|
+ return newStr;
|
|
|
+ }
|
|
|
+ private String getKeyByHospitalId() {
|
|
|
+ switch (Content.hospital_Id)
|
|
|
+ {
|
|
|
+ case "3":
|
|
|
+ return "手术经过";
|
|
|
+ default:
|
|
|
+ return "手术经过及处理";
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|