|
@@ -5,11 +5,15 @@ 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.FirstPageRecordDoc;
|
|
|
+import com.lantone.qc.pub.model.doc.LeaveHospitalDoc;
|
|
|
import com.lantone.qc.pub.model.doc.transferrecord.TransferIntoDoc;
|
|
|
import com.lantone.qc.pub.model.doc.transferrecord.TransferOutDoc;
|
|
|
import com.lantone.qc.pub.model.doc.transferrecord.TransferRecordDoc;
|
|
|
import com.lantone.qc.pub.util.ListUtil;
|
|
|
import com.lantone.qc.pub.util.StringUtil;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
import java.util.List;
|
|
@@ -32,6 +36,22 @@ public class THR03137 extends QCCatalogue {
|
|
|
if(ListUtil.isEmpty(doctorAdviceDocs)){
|
|
|
return;
|
|
|
}
|
|
|
+ //1.1【首次病程录】“科别”和【出院小结】“科别”不一致为转科
|
|
|
+ FirstCourseRecordDoc firstCourseRecordDoc = inputInfo.getFirstCourseRecordDoc();
|
|
|
+ LeaveHospitalDoc leaveHospitalDoc = inputInfo.getLeaveHospitalDoc();
|
|
|
+ if(null != firstCourseRecordDoc && StringUtils.isNotBlank(firstCourseRecordDoc.getStructureMap().get("临床科室")) && null != leaveHospitalDoc && StringUtils.isNotBlank(leaveHospitalDoc.getStructureMap().get("临床科室"))){
|
|
|
+ String deptFir = firstCourseRecordDoc.getStructureMap().get("临床科室");
|
|
|
+ String deptSec= leaveHospitalDoc.getStructureMap().get("临床科室");
|
|
|
+ if(deptFir.equals(deptSec)){
|
|
|
+ flag = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //1.2【病案首页】“入院科别”和“出院科别”不一致为转科
|
|
|
+ FirstPageRecordDoc firstPageRecordDoc = inputInfo.getFirstPageRecordDoc();
|
|
|
+ if(null != firstPageRecordDoc && StringUtils.isNotBlank(firstPageRecordDoc.getStructureMap().get("入院科别")) &&
|
|
|
+ StringUtils.isNotBlank(firstPageRecordDoc.getStructureMap().get("出院科别"))){
|
|
|
+ flag = true;
|
|
|
+ }
|
|
|
for (DoctorAdviceDoc doctorAdviceDoc : doctorAdviceDocs) {
|
|
|
//取长期临时医嘱,不为作废医嘱
|
|
|
if(doctorAdviceDoc.getStructureMap()!=null){
|
|
@@ -42,7 +62,6 @@ public class THR03137 extends QCCatalogue {
|
|
|
String adviceState = doctorAdviceDocStructureMap.get(Content.doctorAdviceState);
|
|
|
if(StringUtil.isNotEmpty(adviceState)){
|
|
|
if(!Content.cancellationOrderList.contains(adviceState)){
|
|
|
- //医嘱若是包含 转*科/科*转则为一个转科患者
|
|
|
String medicalOrderName = doctorAdviceDoc.getStructureMap().get(Content.medicalOrderName);
|
|
|
if(StringUtil.isBlank(medicalOrderName)) {
|
|
|
continue;
|
|
@@ -50,11 +69,9 @@ public class THR03137 extends QCCatalogue {
|
|
|
if(medicalOrderName.startsWith("停")){
|
|
|
continue;
|
|
|
}
|
|
|
- String rex1="[\\s\\S]*(?=转)[^,;,;。]*(?=科)[\\s\\S]*";
|
|
|
- String rex2="[\\s\\S]*(?=科)[^,;,;。]*(?=转)[\\s\\S]*";
|
|
|
- if(medicalOrderName.matches(rex1)||medicalOrderName.matches(rex2)) {
|
|
|
+ //1.3【临时医嘱/长期医嘱】包含【转科医嘱】4字
|
|
|
+ if(medicalOrderName.contains("转科医嘱")){
|
|
|
flag = true;
|
|
|
- break ;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -62,22 +79,35 @@ public class THR03137 extends QCCatalogue {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- //为转科人员判断是否有转出记录
|
|
|
- if(flag){
|
|
|
+ //1.4为转科人员判断是否有【转入记录/转科记录】
|
|
|
+ if(!flag){
|
|
|
status.set("-1");
|
|
|
TransferRecordDoc transferRecordDocs = inputInfo.getTransferRecordDocs();
|
|
|
if(transferRecordDocs==null){
|
|
|
return;
|
|
|
}
|
|
|
List<TransferIntoDoc> transferIntoDocs = transferRecordDocs.getTransferIntoDocs();
|
|
|
- if(ListUtil.isNotEmpty(transferIntoDocs) || transferIntoDocs.size()>0){
|
|
|
- //转出记录存在
|
|
|
+ if(ListUtil.isNotEmpty(transferIntoDocs) && transferIntoDocs.size()>0){
|
|
|
+ //转入记录存在
|
|
|
status.set("0");
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
+ //2.1不存在【转入记录】或【转出记录】与【转入记录】数量不一致则报
|
|
|
+ status.set("-1");
|
|
|
+ TransferRecordDoc transferRecordDocs = inputInfo.getTransferRecordDocs();
|
|
|
+ if(transferRecordDocs==null){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ List<TransferIntoDoc> transferIntoDocs = transferRecordDocs.getTransferIntoDocs();
|
|
|
+ List<TransferOutDoc> transferOutDocs = transferRecordDocs.getTransferOutDocs();
|
|
|
+ if(ListUtil.isNotEmpty(transferIntoDocs) && transferIntoDocs.size()== transferOutDocs.size()){
|
|
|
+ status.set("0");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|