|
@@ -5,8 +5,13 @@ 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.model.doc.BeHospitalizedDoc;
|
|
|
+import com.lantone.qc.pub.model.entity.AllergyMedicine;
|
|
|
+import com.lantone.qc.pub.model.label.PastLabel;
|
|
|
+import com.lantone.qc.pub.util.StringUtil;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
+import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
|
/**
|
|
@@ -18,16 +23,35 @@ import java.util.Map;
|
|
|
@Component
|
|
|
public class FIRP0184 extends QCCatalogue {
|
|
|
public void start(InputInfo inputInfo, OutputInfo outputInfo) {
|
|
|
- if (inputInfo.getFirstPageRecordDoc() == null){
|
|
|
- status.set("0");
|
|
|
+ status.set("0");
|
|
|
+ BeHospitalizedDoc beHospitalizedDoc = inputInfo.getBeHospitalizedDoc();
|
|
|
+ if (inputInfo.getFirstPageRecordDoc() == null || beHospitalizedDoc == null) {
|
|
|
return;
|
|
|
}
|
|
|
- if (inputInfo.getFirstPageRecordDoc().getStructureMap() != null) {
|
|
|
- Map<String, String> firstpageStructureMap = inputInfo.getFirstPageRecordDoc().getStructureMap();
|
|
|
+ Map<String, String> firstpageStructureMap = inputInfo.getFirstPageRecordDoc().getStructureMap();
|
|
|
+ PastLabel pastLabel = beHospitalizedDoc.getPastLabel();
|
|
|
+ if (pastLabel == null) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ List<AllergyMedicine> allergyMedicines = pastLabel.getAllergyMedicines();
|
|
|
+ if (allergyMedicines == null) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ long count = allergyMedicines.stream().filter(allergyMedicine -> {
|
|
|
+ boolean flag = false;
|
|
|
+ if (allergyMedicine.getNegative() == null
|
|
|
+ && StringUtil.isNotBlank(allergyMedicine.getName())) {
|
|
|
+ flag = true;
|
|
|
+ }
|
|
|
+ return flag;
|
|
|
+ }).count();
|
|
|
+
|
|
|
+ if (count > 0 && firstpageStructureMap != null) {
|
|
|
String drugAllergy = firstpageStructureMap.get(Content.drugAllergy);
|
|
|
-// String allergyDrug = firstpageStructureMap.get(Content.allergyDrug);
|
|
|
- if (!CatalogueUtil.isEmpty(drugAllergy)) {
|
|
|
- status.set("0");
|
|
|
+ if (CatalogueUtil.isEmpty(drugAllergy)) {
|
|
|
+ status.set("-1");
|
|
|
+ return;
|
|
|
}
|
|
|
}
|
|
|
}
|