|
@@ -0,0 +1,206 @@
|
|
|
+package com.diagbot.repository;
|
|
|
+
|
|
|
+
|
|
|
+import com.diagbot.biz.push.entity.Item;
|
|
|
+import com.diagbot.biz.push.entity.Lis;
|
|
|
+import com.diagbot.biz.push.entity.Pacs;
|
|
|
+import com.diagbot.dto.OtherTipPacsNeoDTO;
|
|
|
+import com.diagbot.dto.OtherTipTransfusionNeoDTO;
|
|
|
+import com.diagbot.dto.WordCrfDTO;
|
|
|
+import com.diagbot.entity.node.PacsRemind;
|
|
|
+import com.diagbot.entity.node.TransfusionSuggest;
|
|
|
+import com.diagbot.entity.node.YiBaoDiseaseName;
|
|
|
+import com.diagbot.entity.node.YiBaoOperationName;
|
|
|
+import com.diagbot.util.ListUtil;
|
|
|
+import com.diagbot.util.StringUtil;
|
|
|
+
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.HashMap;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
+public class PacsRemindNode {
|
|
|
+
|
|
|
+ public List<OtherTipPacsNeoDTO> getReminds(List<PacsRemind> pacsReminds, WordCrfDTO wordCrfDTO) {
|
|
|
+
|
|
|
+ List<OtherTipPacsNeoDTO> otherPacsNeoDTOs = new ArrayList<>();
|
|
|
+
|
|
|
+ OtherTipPacsNeoDTO otherPacsNeoDTO;
|
|
|
+
|
|
|
+ Item item;
|
|
|
+ List<String> diseases = new ArrayList<>();
|
|
|
+ List<String> pacsresult = new ArrayList<>();
|
|
|
+ String pacsgender = "";
|
|
|
+ String disname, gender, psresult, posres, negres, msg;
|
|
|
+ Integer age, agerange;
|
|
|
+ Integer minage = null;
|
|
|
+ Integer maxage = null;
|
|
|
+
|
|
|
+
|
|
|
+ for (Item dg : wordCrfDTO.getDiag()) {
|
|
|
+ diseases.add(dg.getUniqueName());
|
|
|
+ }
|
|
|
+
|
|
|
+ for (Pacs pacs : wordCrfDTO.getPacs()) {
|
|
|
+ pacsresult.add(pacs.getResult());
|
|
|
+ }
|
|
|
+
|
|
|
+ if (wordCrfDTO.getSex()==1) {
|
|
|
+ pacsgender = "男";
|
|
|
+ }
|
|
|
+ else if (wordCrfDTO.getSex()==2) {
|
|
|
+ pacsgender = "女";
|
|
|
+ }
|
|
|
+
|
|
|
+ age = wordCrfDTO.getAge();
|
|
|
+
|
|
|
+ for (PacsRemind pr : pacsReminds) {
|
|
|
+
|
|
|
+ disname = "";
|
|
|
+ gender = "";
|
|
|
+ agerange = 0;
|
|
|
+ psresult = "";
|
|
|
+ posres = "";
|
|
|
+ negres = "";
|
|
|
+
|
|
|
+ msg = pr.getMsg();
|
|
|
+
|
|
|
+ if (StringUtil.isNotBlank(pr.getDisease())) {
|
|
|
+ disname = pr.getDisease();
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtil.isNotBlank(pr.getGender())) {
|
|
|
+ gender = pr.getGender();
|
|
|
+ }
|
|
|
+
|
|
|
+ agerange = pr.getRange();
|
|
|
+
|
|
|
+ if (null!=pr.getMinval()) {
|
|
|
+ minage = pr.getMinval();
|
|
|
+ }
|
|
|
+
|
|
|
+ if (null!=pr.getMaxval()) {
|
|
|
+ maxage = pr.getMaxval();
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtil.isNotBlank(pr.getResult())) {
|
|
|
+ psresult = pr.getResult();
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtil.isNotBlank(pr.getPostoken())) {
|
|
|
+ posres = pr.getPostoken();
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtil.isNotBlank(pr.getNegtoken())) {
|
|
|
+ negres = pr.getNegtoken();
|
|
|
+ }
|
|
|
+
|
|
|
+ otherPacsNeoDTO = null;
|
|
|
+ boolean proceed = true;
|
|
|
+ if (StringUtil.isNotBlank(psresult)) {
|
|
|
+
|
|
|
+ if (StringUtil.isNotBlank(disname) && proceed) {
|
|
|
+ if (disname.equals(diseases.get(0))) {
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ proceed = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtil.isNotBlank(gender) && proceed) {
|
|
|
+ if (gender.contains(pacsgender)) {
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ proceed =false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (agerange==0 && proceed) {
|
|
|
+ if (null!=minage && null!=maxage && minage<maxage) {
|
|
|
+ if (age>minage && age<maxage) {
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ proceed = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else if (agerange==1 && proceed) {
|
|
|
+ if (null!=minage) {
|
|
|
+ if (age<minage) {
|
|
|
+
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ proceed =false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else if (null!=maxage) {
|
|
|
+ if (age > maxage) {
|
|
|
+
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ proceed = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if (pacsresult.get(0).contains(psresult)) {
|
|
|
+
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ proceed = false;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtil.isNotBlank(posres)) {
|
|
|
+ if (pacsresult.get(0).contains(posres)) {
|
|
|
+
|
|
|
+ } else {
|
|
|
+ proceed = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtil.isNotBlank(negres)) {
|
|
|
+ if (!pacsresult.get(0).contains(negres)) {
|
|
|
+
|
|
|
+ } else {
|
|
|
+ proceed = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ if (proceed) {
|
|
|
+ if (null==otherPacsNeoDTO) {
|
|
|
+ otherPacsNeoDTO = new OtherTipPacsNeoDTO();
|
|
|
+ }
|
|
|
+ otherPacsNeoDTO.setMsg(msg);
|
|
|
+ otherPacsNeoDTOs.add(otherPacsNeoDTO);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ return otherPacsNeoDTOs;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取建议输血提醒列表
|
|
|
+ */
|
|
|
+ public List<OtherTipPacsNeoDTO> getPacsReminds(WordCrfDTO wordCrfDTO, PacsRemindRepository pacsRemindRepository) {
|
|
|
+
|
|
|
+ List<OtherTipPacsNeoDTO> tpNeoDTOs = new ArrayList<>();
|
|
|
+
|
|
|
+
|
|
|
+ List<PacsRemind> prlist;
|
|
|
+
|
|
|
+ prlist = pacsRemindRepository.findByNameContaining("");
|
|
|
+
|
|
|
+ if (ListUtil.isNotEmpty(prlist)) {
|
|
|
+ tpNeoDTOs = getReminds(prlist, wordCrfDTO);
|
|
|
+ }
|
|
|
+
|
|
|
+ return tpNeoDTOs;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|