|
@@ -1,12 +1,16 @@
|
|
|
package com.lantone.qc.kernel.catalogue.hospital.yiwu.firstpagerecord;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONArray;
|
|
|
+import com.google.common.collect.Lists;
|
|
|
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;
|
|
|
+import com.lantone.qc.pub.util.StringUtil;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
+import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
|
/**
|
|
@@ -17,12 +21,14 @@ import java.util.Map;
|
|
|
*/
|
|
|
@Component
|
|
|
public class FIRP0200 extends QCCatalogue {
|
|
|
+ private List<String> icdCodeList = Lists.newArrayList("Z37.0", "Z37.2", "Z37.3", "Z37.5", "Z37.6");
|
|
|
+
|
|
|
public void start(InputInfo inputInfo, OutputInfo outputInfo) {
|
|
|
status.set("0");
|
|
|
if (inputInfo.getFirstPageRecordDoc() != null && inputInfo.getFirstPageRecordDoc().getStructureMap() != null) {
|
|
|
Map<String, String> firstpageStructureMap = inputInfo.getFirstPageRecordDoc().getStructureMap();
|
|
|
String newbornWeightStr = firstpageStructureMap.get(Content.newbornWeight);
|
|
|
- if (CatalogueUtil.isEmpty(newbornWeightStr) || !CatalogueUtil.numbersOnly(newbornWeightStr)) {
|
|
|
+/* if (CatalogueUtil.isEmpty(newbornWeightStr) || !CatalogueUtil.numbersOnly(newbornWeightStr)) {
|
|
|
return;
|
|
|
}
|
|
|
double newbornWeight = Double.parseDouble(newbornWeightStr);
|
|
@@ -34,7 +40,52 @@ public class FIRP0200 extends QCCatalogue {
|
|
|
Map<String, Object> structureExtMap = inputInfo.getFirstPageRecordDoc().getStructureExtMap();
|
|
|
String xmlId = CatalogueUtil.getXmlId(structureExtMap, Content.newbornWeight);
|
|
|
id.set(xmlId);
|
|
|
+ }*/
|
|
|
+ if (CatalogueUtil.isEmpty(newbornWeightStr)) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ //为阿拉伯数字情况下,比较体重范围
|
|
|
+ if (CatalogueUtil.numbersOnly(newbornWeightStr)) {
|
|
|
+ double newbornWeight = Double.parseDouble(newbornWeightStr);
|
|
|
+ if (newbornWeight <= 100 || newbornWeight >= 9999) {
|
|
|
+ status.set("-1");
|
|
|
+ Map<String, Object> structureExtMap = inputInfo.getFirstPageRecordDoc().getStructureExtMap();
|
|
|
+ String xmlId = CatalogueUtil.getXmlId(structureExtMap, Content.newbornWeight);
|
|
|
+ id.set(xmlId);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ String newbornDaye = firstpageStructureMap.get("新生儿出生天数");
|
|
|
+ if (StringUtil.isNotEmpty(newbornDaye) && Long.valueOf(newbornDaye) <= 28) {
|
|
|
+ if (newbornWeightStr.equals("-")) {
|
|
|
+ status.set("-1");
|
|
|
+ Map<String, Object> structureExtMap = inputInfo.getFirstPageRecordDoc().getStructureExtMap();
|
|
|
+ String xmlId = CatalogueUtil.getXmlId(structureExtMap, Content.newbornWeight);
|
|
|
+ id.set(xmlId);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ String hospitalDiagnosis = firstpageStructureMap.get("出院诊断");
|
|
|
+ if (StringUtil.isNotEmpty(hospitalDiagnosis)) {
|
|
|
+ List<Map<String, String>> diagnosisMapList = (List<Map<String, String>>) JSONArray.parse(hospitalDiagnosis);
|
|
|
+ for (Map<String, String> diagnosisMap : diagnosisMapList) {
|
|
|
+ String diagnosisIcd = diagnosisMap.get("诊断编码");
|
|
|
+ if (StringUtil.isNotEmpty(diagnosisIcd)) {
|
|
|
+ for (String icdCode : icdCodeList) {
|
|
|
+ if (diagnosisIcd.startsWith(icdCode)) {
|
|
|
+ if (newbornWeightStr.equals("-")) {
|
|
|
+ status.set("-1");
|
|
|
+ Map<String, Object> structureExtMap = inputInfo.getFirstPageRecordDoc().getStructureExtMap();
|
|
|
+ String xmlId = CatalogueUtil.getXmlId(structureExtMap, Content.newbornWeight);
|
|
|
+ id.set(xmlId);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
+ return;
|
|
|
}
|
|
|
}
|
|
|
}
|