|
@@ -1,7 +1,7 @@
|
|
|
package com.lantone.qc.kernel.catalogue.firstpagerecord;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
import com.lantone.qc.kernel.catalogue.QCCatalogue;
|
|
|
-import com.lantone.qc.kernel.util.CatalogueUtil;
|
|
|
import com.lantone.qc.pub.Content;
|
|
|
import com.lantone.qc.pub.model.InputInfo;
|
|
|
import com.lantone.qc.pub.model.OutputInfo;
|
|
@@ -12,6 +12,7 @@ import com.lantone.qc.pub.model.label.DiagLabel;
|
|
|
import com.lantone.qc.pub.util.ListUtil;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
@@ -24,7 +25,7 @@ import java.util.Map;
|
|
|
@Component
|
|
|
public class FIRP0272 extends QCCatalogue {
|
|
|
public void start(InputInfo inputInfo, OutputInfo outputInfo) {
|
|
|
- if (inputInfo.getFirstPageRecordDoc() == null){
|
|
|
+ if (inputInfo.getFirstPageRecordDoc() == null) {
|
|
|
status.set("0");
|
|
|
return;
|
|
|
}
|
|
@@ -33,17 +34,19 @@ public class FIRP0272 extends QCCatalogue {
|
|
|
if (leaveHospitalDoc != null) {
|
|
|
Map<String, Object> firstPageMap = firstPageRecordDoc.getStructureExtMap();
|
|
|
if (firstPageMap != null) {
|
|
|
- List<String> outDiags = (List<String>) firstPageMap.get(Content.dischargeDiag);
|
|
|
+ List<JSONObject> outDiags = (List<JSONObject>) firstPageMap.get(Content.dischargeDiag);
|
|
|
if (ListUtil.isEmpty(outDiags)) {
|
|
|
status.set("0");
|
|
|
return;
|
|
|
}
|
|
|
+ List<String> jsonDiagList = getJsonDiagList(outDiags);
|
|
|
DiagLabel leaveDiagLabel = leaveHospitalDoc.getLeaveDiagLabel();
|
|
|
if (leaveDiagLabel != null) {
|
|
|
//出院诊断
|
|
|
List<Diag> diags = leaveDiagLabel.getDiags();
|
|
|
if (diags != null) {
|
|
|
- if (outDiags.size() == diags.size() && outDiags.containsAll(diags)) {
|
|
|
+ List<String> diagList = getDiagList(diags);
|
|
|
+ if (jsonDiagList.size() == diagList.size() && isOrder(jsonDiagList, diagList)) {
|
|
|
status.set("0");
|
|
|
}
|
|
|
} else {
|
|
@@ -53,4 +56,35 @@ public class FIRP0272 extends QCCatalogue {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ private boolean isOrder(List<String> firstList, List<String> secondList) {
|
|
|
+ for (int i = 0; i < firstList.size(); i++) {
|
|
|
+ if (!firstList.get(i).equals(secondList.get(i))) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ private List<String> getJsonDiagList(List<JSONObject> diags) {
|
|
|
+ List<String> diagList = new ArrayList<>();
|
|
|
+ for (JSONObject diag : diags) {
|
|
|
+ if (diag.get(Content.diagnoseName) != null) {
|
|
|
+ diagList.add(diag.get(Content.diagnoseName).toString());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return diagList;
|
|
|
+ }
|
|
|
+
|
|
|
+ private List<String> getDiagList(List<Diag> diags) {
|
|
|
+ List<String> diagList = new ArrayList<>();
|
|
|
+ for (Diag diag : diags) {
|
|
|
+ if (diag.getHospitalDiagName() != null) {
|
|
|
+ diagList.add(diag.getHospitalDiagName());
|
|
|
+ } else if (diag.getName() != null) {
|
|
|
+ diagList.add(diag.getName());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return diagList;
|
|
|
+ }
|
|
|
}
|