Browse Source

添加辅检的危急值处理

kongwz 5 years ago
parent
commit
3c6d77b0ab
1 changed files with 28 additions and 2 deletions
  1. 28 2
      push-web/src/main/java/org/diagbot/push/convert/PreProcess.java

+ 28 - 2
push-web/src/main/java/org/diagbot/push/convert/PreProcess.java

@@ -102,11 +102,37 @@ public class PreProcess {
         List<MedicalIndication> reminder = new ArrayList<>();
 
         try {
-            Map<String, Object> pacsobj = new HashMap<>();
+            Set<String> pacsResultList = new HashSet<>();
             Lexeme lexeme;
             LexemePath<Lexeme> lexemes = ParticipleUtil.participle(pacs);
             for (int i = 0; i < lexemes.size(); i++) {
-
+                lexeme = lexemes.get(i);
+                List<String> propetys = Arrays.asList(lexeme.getProperty().split(","));
+                if (lexeme.getText().trim().length() > 0) {
+                    if(propetys.contains(Constants.word_property_PACS_Result)){
+                        pacsResultList.add(lexeme.getText());
+                    }
+                }
+            }
+            if(pacsResultList.size()>0){
+                for (String pacsResult:pacsResultList) {
+                    if(rule.containsKey(pacsResult)){
+                        List<Rule> rules = rule.get(pacsResult);
+
+                        List<MedicalIndicationDetail> mds = new ArrayList<>();
+                        MedicalIndicationDetail medicalIndicationDetail = new MedicalIndicationDetail();
+                        medicalIndicationDetail.setType(4);
+                        JSONObject jsonObject = new JSONObject();
+                        jsonObject.put("controlType",2);
+                        jsonObject.put("name",rules.get(0).getIdx_name()+":"+rules.get(0).getRemind());
+                        medicalIndicationDetail.setContent(jsonObject);
+                        mds.add(medicalIndicationDetail);
+                        MedicalIndication medicalIndication = new MedicalIndication();
+                        medicalIndication.setName(pacsResult);
+                        medicalIndication.setDetails(mds);
+                        reminder.add(medicalIndication);
+                    }
+                }
             }
         } catch (Exception ex) {
             ex.printStackTrace();