|
@@ -5,13 +5,12 @@ import com.lantone.qc.pub.Content;
|
|
import com.lantone.qc.pub.model.InputInfo;
|
|
import com.lantone.qc.pub.model.InputInfo;
|
|
import com.lantone.qc.pub.model.OutputInfo;
|
|
import com.lantone.qc.pub.model.OutputInfo;
|
|
import com.lantone.qc.pub.model.entity.Diag;
|
|
import com.lantone.qc.pub.model.entity.Diag;
|
|
-import com.lantone.qc.pub.util.ListUtil;
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
-import java.util.ArrayList;
|
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
/**
|
|
* @ClassName : FIRP0173
|
|
* @ClassName : FIRP0173
|
|
@@ -22,42 +21,21 @@ import java.util.Map;
|
|
@Component
|
|
@Component
|
|
public class FIRP0173 extends QCCatalogue {
|
|
public class FIRP0173 extends QCCatalogue {
|
|
public void start(InputInfo inputInfo, OutputInfo outputInfo) {
|
|
public void start(InputInfo inputInfo, OutputInfo outputInfo) {
|
|
- status.set("0");
|
|
|
|
if (inputInfo.getFirstPageRecordDoc() != null && inputInfo.getFirstPageRecordDoc().getStructureMap() != null
|
|
if (inputInfo.getFirstPageRecordDoc() != null && inputInfo.getFirstPageRecordDoc().getStructureMap() != null
|
|
&& inputInfo.getBeHospitalizedDoc() != null && inputInfo.getBeHospitalizedDoc().getPresentLabel() != null) {
|
|
&& inputInfo.getBeHospitalizedDoc() != null && inputInfo.getBeHospitalizedDoc().getPresentLabel() != null) {
|
|
Map<String, Object> firstpageStructureMap = inputInfo.getFirstPageRecordDoc().getStructureExtMap();
|
|
Map<String, Object> firstpageStructureMap = inputInfo.getFirstPageRecordDoc().getStructureExtMap();
|
|
//病案首页门急诊诊断
|
|
//病案首页门急诊诊断
|
|
String outpatientEmergencyDiag = (String) firstpageStructureMap.get(Content.outpatientEmergencyDiag);
|
|
String outpatientEmergencyDiag = (String) firstpageStructureMap.get(Content.outpatientEmergencyDiag);
|
|
if (StringUtils.isEmpty(outpatientEmergencyDiag)) {
|
|
if (StringUtils.isEmpty(outpatientEmergencyDiag)) {
|
|
- return;
|
|
|
|
|
|
+ status.set("0");
|
|
}
|
|
}
|
|
//现病史所有诊断
|
|
//现病史所有诊断
|
|
List<Diag> presentDiags = inputInfo.getBeHospitalizedDoc().getPresentLabel().getDiags();
|
|
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.set("-1");
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- private void putFirstpageDiagToList(String outpatientEmergencyDiag, List<String> firstpageDiag) {
|
|
|
|
- firstpageDiag.add(outpatientEmergencyDiag);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- private void putPossibleDiagToList(List<Diag> diagList, List<String> presentPossibleDiag) {
|
|
|
|
- for (Diag diag : diagList) {
|
|
|
|
- if (diag.getPossible() != null) {
|
|
|
|
- presentPossibleDiag.add(diag.getName());
|
|
|
|
|
|
+ List<Diag> presentPossibleDiag = presentDiags.stream().filter(diag -> diag.getPossible() != null).collect(Collectors.toList());
|
|
|
|
+ if (presentPossibleDiag.size() > 0) {
|
|
|
|
+ if (presentPossibleDiag.get(0).getHospitalDiagName().equals(outpatientEmergencyDiag)) {
|
|
|
|
+ status.set("0");
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|