|
@@ -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;
|
|
@@ -41,6 +46,8 @@ public class THR03076 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 || threeLevelWardDocs.size() == 0) {
|
|
@@ -68,6 +75,15 @@ public class THR03076 extends QCCatalogue {
|
|
|
//抗生素及开医嘱时间 <抗生素名,<抗生素用量,[抗生素使用时间...]>>
|
|
|
Map<String, Map<String, List<Double>>> antibioticWardInfo = Maps.newLinkedHashMap();
|
|
|
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(antibioticWardInfo, drugs, dateStr);
|
|
|
+ }
|
|
|
+ }
|
|
|
/*********************************************查房记录********************************************************/
|
|
|
if (threeLevelWardDocs.size() > 0) {
|
|
|
List<ThreeLevelWardDoc> allDoctorWradDocs = threeLevelWardDocs.get(0).getAllDoctorWradDocs();
|
|
@@ -81,22 +97,33 @@ public class THR03076 extends QCCatalogue {
|
|
|
getCourseDrugInfo(antibioticWardInfo, drugs, dateStr);
|
|
|
}
|
|
|
}
|
|
|
- /*********************************************术后首程********************************************************/
|
|
|
+ /**********************************************手术记录、术后首程************************************************/
|
|
|
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(antibioticWardInfo, x.getOperationRecordLabel().getDrugs(), x.getStructureMap().get("病历日期")));
|
|
|
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(antibioticWardInfo, drugs, dateStr);
|
|
|
- }
|
|
|
+ operationDiscussionDocs.forEach(x -> getCourseDrugInfo(antibioticWardInfo, x.getOperationDiscussionLabel().getDrugs(), x.getStructureMap().get("记录日期")));
|
|
|
+ }
|
|
|
+ /*********************************************会诊结果单********************************************************/
|
|
|
+ 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(antibioticWardInfo, x.getConsultationResultLabel().getDrugs(), x.getStructureMap().get("会诊日期及时间")));
|
|
|
}
|
|
|
/*********************************************出院小结********************************************************/
|
|
|
if (leaveHospitalDoc != null) {
|