|
@@ -1,6 +1,7 @@
|
|
package com.lantone.qc.kernel.catalogue.behospitalized;
|
|
package com.lantone.qc.kernel.catalogue.behospitalized;
|
|
|
|
|
|
import com.lantone.qc.kernel.catalogue.QCCatalogue;
|
|
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.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;
|
|
@@ -20,26 +21,33 @@ import java.util.Map;
|
|
public class BEH0414 extends QCCatalogue {
|
|
public class BEH0414 extends QCCatalogue {
|
|
public void start(InputInfo inputInfo, OutputInfo outputInfo) {
|
|
public void start(InputInfo inputInfo, OutputInfo outputInfo) {
|
|
status.set("0");
|
|
status.set("0");
|
|
- if (inputInfo.getBeHospitalizedDoc() == null || inputInfo.getFirstPageRecordDoc() == null) {
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- Map<String, String> structureMap = inputInfo.getBeHospitalizedDoc().getStructureMap();
|
|
|
|
- Map<String, String> firstStructMap = inputInfo.getFirstPageRecordDoc().getStructureMap();
|
|
|
|
- String contactAddress_bh = structureMap.get("年龄");
|
|
|
|
- String contactAddress_first = firstStructMap.get(Content.age);
|
|
|
|
- if (StringUtil.isNotBlank(contactAddress_bh) && StringUtil.isNotBlank(contactAddress_first)) {
|
|
|
|
- contactAddress_bh = removeUnit(contactAddress_bh);
|
|
|
|
- contactAddress_first = removeUnit(contactAddress_first);
|
|
|
|
- if (!contactAddress_first.equals(contactAddress_bh)) {
|
|
|
|
|
|
+ if (inputInfo.getFirstPageRecordDoc() != null && inputInfo.getFirstPageRecordDoc().getStructureMap() != null
|
|
|
|
+ && inputInfo.getBeHospitalizedDoc() != null && inputInfo.getBeHospitalizedDoc().getStructureMap() != null) {
|
|
|
|
+ Map<String, String> firstpageStructureMap = inputInfo.getFirstPageRecordDoc().getStructureMap();
|
|
|
|
+ Map<String, String> beHospitalStructureMap = inputInfo.getBeHospitalizedDoc().getStructureMap();
|
|
|
|
+ String firstAdmissionAge = firstpageStructureMap.get(Content.age);
|
|
|
|
+ String admissionAge = beHospitalStructureMap.get(Content.age);
|
|
|
|
+ if (StringUtil.isBlank(firstAdmissionAge) || StringUtil.isBlank(admissionAge)) {
|
|
|
|
+ status.set("0");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ int firstAdmissionAgeNum = removalUnit(firstAdmissionAge);
|
|
|
|
+ int admissionAgeNum = removalUnit(admissionAge);
|
|
|
|
+ if (firstAdmissionAgeNum != admissionAgeNum) {
|
|
status.set("-1");
|
|
status.set("-1");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- private String removeUnit(String str) {
|
|
|
|
- if (str.contains("岁")) {
|
|
|
|
- return str.replace("岁", "");
|
|
|
|
|
|
+ private int removalUnit(String admissionAge) {
|
|
|
|
+ int age = 0;
|
|
|
|
+ if (StringUtil.isNotBlank(admissionAge) && admissionAge.contains("岁")) {
|
|
|
|
+ admissionAge = admissionAge.replaceAll("[岁天]", "");
|
|
|
|
+ }
|
|
|
|
+ admissionAge = admissionAge.replaceAll("[^0-9]","");
|
|
|
|
+ if (CatalogueUtil.numbersOnly(admissionAge)) {
|
|
|
|
+ age = Integer.parseInt(admissionAge);
|
|
}
|
|
}
|
|
- return str;
|
|
|
|
|
|
+ return age;
|
|
}
|
|
}
|
|
}
|
|
}
|