|
@@ -8,11 +8,16 @@ import com.lantone.qc.kernel.util.SimilarityUtil;
|
|
|
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.LeaveHospitalDoc;
|
|
|
import com.lantone.qc.pub.model.doc.ThreeLevelWardDoc;
|
|
|
+import com.lantone.qc.pub.model.doc.consultation.ConsultationDoc;
|
|
|
+import com.lantone.qc.pub.model.doc.consultation.ConsultationResultsDoc;
|
|
|
import com.lantone.qc.pub.model.doc.operation.OperationDiscussionDoc;
|
|
|
import com.lantone.qc.pub.model.doc.operation.OperationDoc;
|
|
|
+import com.lantone.qc.pub.model.doc.operation.OperationRecordDoc;
|
|
|
import com.lantone.qc.pub.model.entity.Drug;
|
|
|
+import com.lantone.qc.pub.model.label.DrugLabel;
|
|
|
import com.lantone.qc.pub.model.label.LeaveHospitalLabel;
|
|
|
import com.lantone.qc.pub.model.label.ThreeLevelWardLabel;
|
|
|
import com.lantone.qc.pub.util.DateUtil;
|
|
@@ -39,6 +44,8 @@ public class THR03077 extends QCCatalogue {
|
|
|
status.set("0");
|
|
|
List<DoctorAdviceDoc> doctorAdviceDocs = inputInfo.getDoctorAdviceDocs();
|
|
|
List<ThreeLevelWardDoc> threeLevelWardDocs = inputInfo.getThreeLevelWardDocs();
|
|
|
+ FirstCourseRecordDoc firstCourseRecordDoc = inputInfo.getFirstCourseRecordDoc();
|
|
|
+ List<ConsultationDoc> consultationDocs = inputInfo.getConsultationDocs();
|
|
|
List<OperationDoc> operationDocs = inputInfo.getOperationDocs();
|
|
|
LeaveHospitalDoc leaveHospitalDoc = inputInfo.getLeaveHospitalDoc();
|
|
|
if (doctorAdviceDocs.size() == 0) {
|
|
@@ -83,6 +90,15 @@ public class THR03077 extends QCCatalogue {
|
|
|
//病程记录中没有用量的抗生素及查房时间 key:抗生素名 "2020-08-20,2020-08-21 ..."
|
|
|
Map<String, List<String>> antibioticDateCourse = Maps.newHashMap();
|
|
|
String dateStr = null;
|
|
|
+ /*********************************************首程治疗计划********************************************************/
|
|
|
+ if (firstCourseRecordDoc != null) {
|
|
|
+ DrugLabel drugLabel = firstCourseRecordDoc.getDrugLabel();
|
|
|
+ dateStr = firstCourseRecordDoc.getStructureMap().get("记录时间");
|
|
|
+ if (drugLabel != null && StringUtil.isNotBlank(dateStr)) {
|
|
|
+ List<Drug> drugs = drugLabel.getDrugs();
|
|
|
+ getCourseDrugInfo(antibioticDateCourse, dateStr, drugs);
|
|
|
+ }
|
|
|
+ }
|
|
|
/*********************************************查房记录********************************************************/
|
|
|
if (threeLevelWardDocs.size() > 0) {
|
|
|
List<ThreeLevelWardDoc> allDoctorWradDocs = threeLevelWardDocs.get(0).getAllDoctorWradDocs();
|
|
@@ -96,22 +112,33 @@ public class THR03077 extends QCCatalogue {
|
|
|
getCourseDrugInfo(antibioticDateCourse, dateStr, drugs);
|
|
|
}
|
|
|
}
|
|
|
- /*********************************************术后首程********************************************************/
|
|
|
+ /*********************************************手术记录、术后首程************************************************/
|
|
|
if (operationDocs.size() > 0) {
|
|
|
+ //手术记录
|
|
|
+ List<OperationRecordDoc> operationRecordDocs = operationDocs
|
|
|
+ .stream()
|
|
|
+ .map(OperationDoc::getOperationRecordDoc)
|
|
|
+ .filter(Objects::nonNull)
|
|
|
+ .filter(x -> x.getOperationRecordLabel() != null && StringUtil.isNotBlank(x.getStructureMap().get("病历日期")))
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ operationRecordDocs.forEach(x -> getCourseDrugInfo(antibioticDateCourse, x.getStructureMap().get("病历日期"), x.getOperationRecordLabel().getDrugs()));
|
|
|
List<OperationDiscussionDoc> operationDiscussionDocs = operationDocs
|
|
|
.stream()
|
|
|
.map(OperationDoc::getOperationDiscussionDoc)
|
|
|
.filter(Objects::nonNull)
|
|
|
- .filter(x -> x.getOperationDiscussionLabel() != null)
|
|
|
+ .filter(x -> x.getOperationDiscussionLabel() != null && StringUtil.isNotBlank(x.getStructureMap().get("记录日期")))
|
|
|
.collect(Collectors.toList());
|
|
|
- for (OperationDiscussionDoc discussionDoc : operationDiscussionDocs) {
|
|
|
- dateStr = discussionDoc.getStructureMap().get("记录日期");
|
|
|
- if (StringUtil.isBlank(dateStr)) {
|
|
|
- continue;
|
|
|
- }
|
|
|
- List<Drug> drugs = discussionDoc.getOperationDiscussionLabel().getDrugs();
|
|
|
- getCourseDrugInfo(antibioticDateCourse, dateStr, drugs);
|
|
|
- }
|
|
|
+ operationDiscussionDocs.forEach(x -> getCourseDrugInfo(antibioticDateCourse, x.getStructureMap().get("记录日期"), x.getOperationDiscussionLabel().getDrugs()));
|
|
|
+ }
|
|
|
+ /*********************************************会诊结果单********************************************************/
|
|
|
+ if (consultationDocs.size() > 0) {
|
|
|
+ List<ConsultationResultsDoc> consultationResultsDocs = consultationDocs
|
|
|
+ .stream()
|
|
|
+ .map(ConsultationDoc::getConsultationResultsDoc)
|
|
|
+ .filter(Objects::nonNull)
|
|
|
+ .filter(x -> x.getConsultationResultLabel() != null && StringUtil.isNotBlank(x.getStructureMap().get("会诊日期及时间")))
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ consultationResultsDocs.forEach(x -> getCourseDrugInfo(antibioticDateCourse, x.getStructureMap().get("会诊日期及时间"), x.getConsultationResultLabel().getDrugs()));
|
|
|
}
|
|
|
/*********************************************出院小结********************************************************/
|
|
|
if (leaveHospitalDoc != null) {
|
|
@@ -126,7 +153,7 @@ public class THR03077 extends QCCatalogue {
|
|
|
antibioticDateCourse.forEach((x, y) -> y.sort(Comparator.naturalOrder()));
|
|
|
|
|
|
/**
|
|
|
- * 1.antibioticDate:从医嘱中取 key:抗生素名 value:医嘱中该抗生素所有加用时的时间(包括初始使用时间)
|
|
|
+ * 1.antibioticDate:从医嘱中取 key:抗生素名 value:医嘱中该抗生素所有剂量变化的时间(包括初始使用时间)
|
|
|
* 2.antibioticDateWard:从查房记录中取 key:抗生素名 value:病程记录中该抗生素所有没有用量时的查房时间(包括初始使用时间)
|
|
|
* 3.医嘱中该抗生素初始使用时间往后两天内,查房记录中出现该抗生素并且该抗生素没有用量,报出该抗生素
|
|
|
*/
|
|
@@ -134,7 +161,7 @@ public class THR03077 extends QCCatalogue {
|
|
|
String drugKey = null, start = null, change = null, wardStartStr = null, wardChangeStr = null;
|
|
|
List<String> dateList = null;
|
|
|
for (Map.Entry<String, List<String>> ad : antibioticDate.entrySet()) {
|
|
|
- drugKey = ad.getKey();
|
|
|
+ drugKey = ad.getKey().replaceAll("[^\u4e00-\u9fa5]", "");
|
|
|
String drugStandardWord = similarityUtil.getDrugStandardWord(drugKey);
|
|
|
if (StringUtil.isNotBlank(drugStandardWord)) {
|
|
|
drugKey = drugStandardWord;
|