|
@@ -0,0 +1,71 @@
|
|
|
+package com.lantone.qc.kernel.catalogue.firstpagerecord;
|
|
|
+
|
|
|
+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.entity.Diag;
|
|
|
+import com.lantone.qc.pub.util.ListUtil;
|
|
|
+import com.lantone.qc.pub.util.StringUtil;
|
|
|
+import org.springframework.stereotype.Component;
|
|
|
+
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
+/**
|
|
|
+ * @ClassName : FIRP0173
|
|
|
+ * @Description :门(急)诊诊断与现病史里的内容不一致
|
|
|
+ * @Author : 胡敬
|
|
|
+ * @Date: 2020-03-18 16:30
|
|
|
+ */
|
|
|
+@Component
|
|
|
+public class FIRP0173 extends QCCatalogue {
|
|
|
+ public void start(InputInfo inputInfo, OutputInfo outputInfo) {
|
|
|
+ status = "0";
|
|
|
+ if (inputInfo.getFirstPageRecordDoc() != null && inputInfo.getFirstPageRecordDoc().getStructureMap() != null
|
|
|
+ && inputInfo.getBeHospitalizedDoc() != null && inputInfo.getBeHospitalizedDoc().getPresentLabel() != null) {
|
|
|
+ Map<String, Object> firstpageStructureMap = inputInfo.getFirstPageRecordDoc().getStructureExtMap();
|
|
|
+ //病案首页门急诊诊断
|
|
|
+ List<Map<String, String>> outpatientEmergencyDiag = (List) firstpageStructureMap.get(Content.outpatientEmergencyDiag);
|
|
|
+ if (ListUtil.isEmpty(outpatientEmergencyDiag)
|
|
|
+ || ListUtil.isEmpty(inputInfo.getBeHospitalizedDoc().getPresentLabel().getDiags())) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ //现病史所有诊断
|
|
|
+ List<Diag> presentDiags = inputInfo.getBeHospitalizedDoc().getPresentLabel().getDiags();
|
|
|
+
|
|
|
+ //病案首页门急诊诊断
|
|
|
+ List<String> firstpageDiag = new ArrayList<>();
|
|
|
+ //现病史拟诊诊断
|
|
|
+ List<String> presentPossibleDiag = new ArrayList<>();
|
|
|
+ //存放病案首页门急诊诊断
|
|
|
+ putFirstpageDiagToList(outpatientEmergencyDiag, firstpageDiag);
|
|
|
+ //存放现病史拟诊诊断
|
|
|
+ putPossibleDiagToList(presentDiags, presentPossibleDiag);
|
|
|
+
|
|
|
+ if (!ListUtil.equals(firstpageDiag, presentPossibleDiag)) {
|
|
|
+ status = "-1";
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ private void putFirstpageDiagToList(List<Map<String, String>> outpatientEmergencyDiag, List<String> firstpageDiag) {
|
|
|
+ String outpatientEmergencyDiagStr = "";
|
|
|
+ for (Map<String, String> outpatientEmergencyDiagMap : outpatientEmergencyDiag) {
|
|
|
+ outpatientEmergencyDiagStr = outpatientEmergencyDiagMap.get(Content.diagnoseName);
|
|
|
+ if (StringUtil.isNotBlank(outpatientEmergencyDiagStr)) {
|
|
|
+ firstpageDiag.add(outpatientEmergencyDiagStr);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private void putPossibleDiagToList(List<Diag> diagList, List<String> presentPossibleDiag) {
|
|
|
+ for (Diag diag : diagList) {
|
|
|
+ if (diag.getPossible() != null) {
|
|
|
+ presentPossibleDiag.add(diag.getName());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|