|
@@ -18,10 +18,17 @@ import com.diagbot.vo.ItemExt;
|
|
|
import com.diagbot.vo.StandConvertCrfVO;
|
|
|
import com.diagbot.vo.TestIndicationVO;
|
|
|
import com.diagbot.vo.TestLineVO;
|
|
|
+import org.apache.commons.fileupload.FileItem;
|
|
|
+import org.apache.commons.fileupload.FileItemFactory;
|
|
|
+import org.apache.commons.fileupload.disk.DiskFileItemFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
+import java.io.File;
|
|
|
+import java.io.FileInputStream;
|
|
|
+import java.io.IOException;
|
|
|
+import java.io.OutputStream;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.LinkedHashMap;
|
|
|
import java.util.List;
|
|
@@ -97,76 +104,76 @@ public class TestFacade {
|
|
|
|
|
|
if (StringUtil.isNotEmpty(bean.getNeoType())) {
|
|
|
switch (bean.getNeoType()) {
|
|
|
- case "1": // 性别
|
|
|
- if ("男性".equals(bean.getNeoName())) {
|
|
|
- indicationPushVO.setSex(1);
|
|
|
- } else if ("女性".equals(bean.getNeoName())) {
|
|
|
- indicationPushVO.setSex(2);
|
|
|
- }
|
|
|
- break;
|
|
|
- case "2": // 化验, 示例:血小板计数,<,50,10^9/L
|
|
|
- String lisStr = bean.getNeoName();
|
|
|
- String[] lisArr = lisStr.split(",");
|
|
|
-
|
|
|
- List<Lis> lisList = new ArrayList<>();
|
|
|
- Lis lisBean = new Lis();
|
|
|
- lisBean.setUniqueName(lisArr[0]);
|
|
|
- lisBean.setName(lisArr[0]);
|
|
|
- lisBean.setDetailName(lisArr[0]);
|
|
|
- lisBean.setValue(getValue(lisArr));
|
|
|
- lisList.add(lisBean);
|
|
|
- indicationPushVO.setLis(lisList);
|
|
|
- break;
|
|
|
- case "3": // 临床表现
|
|
|
- indicationPushVO.setChief(bean.getNeoName());
|
|
|
- break;
|
|
|
- case "4": //辅助检查描述
|
|
|
- indicationPushVO.setSymptom("B超:提示" + bean.getNeoName());
|
|
|
- break;
|
|
|
- case "5": // 诊断
|
|
|
- List<Item> diag = new ArrayList<>();
|
|
|
- Item diagItem = new Item();
|
|
|
- diagItem.setName(bean.getNeoName());
|
|
|
- diagItem.setUniqueName(bean.getNeoName());
|
|
|
- diag.add(diagItem);
|
|
|
- indicationPushVO.setDiag(diag);
|
|
|
- break;
|
|
|
- case "6": // 服用药品
|
|
|
- StringBuffer symptom = new StringBuffer("发病来,神志清,精神可,胃纳一般,睡眠可,二便无殊。一直服用");
|
|
|
- symptom.append(bean.getNeoName()).append("。");
|
|
|
- indicationPushVO.setSymptom(symptom.toString());
|
|
|
- break;
|
|
|
+ // case "1": // 性别
|
|
|
+ // if ("男性".equals(bean.getNeoName())) {
|
|
|
+ // indicationPushVO.setSex(1);
|
|
|
+ // } else if ("女性".equals(bean.getNeoName())) {
|
|
|
+ // indicationPushVO.setSex(2);
|
|
|
+ // }
|
|
|
+ // break;
|
|
|
+ // case "2": // 化验, 示例:血小板计数,<,50,10^9/L
|
|
|
+ // String lisStr = bean.getNeoName();
|
|
|
+ // String[] lisArr = lisStr.split(",");
|
|
|
+ //
|
|
|
+ // List<Lis> lisList = new ArrayList<>();
|
|
|
+ // Lis lisBean = new Lis();
|
|
|
+ // lisBean.setUniqueName(lisArr[0]);
|
|
|
+ // lisBean.setName(lisArr[0]);
|
|
|
+ // lisBean.setDetailName(lisArr[0]);
|
|
|
+ // lisBean.setValue(getValue(lisArr));
|
|
|
+ // lisList.add(lisBean);
|
|
|
+ // indicationPushVO.setLis(lisList);
|
|
|
+ // break;
|
|
|
+ // case "3": // 临床表现
|
|
|
+ // indicationPushVO.setChief(bean.getNeoName());
|
|
|
+ // break;
|
|
|
+ // case "4": //辅助检查描述
|
|
|
+ // indicationPushVO.setSymptom("B超:提示" + bean.getNeoName());
|
|
|
+ // break;
|
|
|
+ // case "5": // 诊断
|
|
|
+ // List<Item> diag = new ArrayList<>();
|
|
|
+ // Item diagItem = new Item();
|
|
|
+ // diagItem.setName(bean.getNeoName());
|
|
|
+ // diagItem.setUniqueName(bean.getNeoName());
|
|
|
+ // diag.add(diagItem);
|
|
|
+ // indicationPushVO.setDiag(diag);
|
|
|
+ // break;
|
|
|
+ // case "6": // 服用药品
|
|
|
+ // StringBuffer symptom = new StringBuffer("发病来,神志清,精神可,胃纳一般,睡眠可,二便无殊。一直服用");
|
|
|
+ // symptom.append(bean.getNeoName()).append("。");
|
|
|
+ // indicationPushVO.setSymptom(symptom.toString());
|
|
|
+ // break;
|
|
|
case "7" : // 药品过敏原
|
|
|
StringBuffer pastStr = new StringBuffer("");
|
|
|
pastStr.append("有“").append(bean.getNeoName()).append("”过敏。");
|
|
|
indicationPushVO.setPasts(pastStr.toString());
|
|
|
break;
|
|
|
- case "12": // 体征
|
|
|
- StringBuffer sbVital = new StringBuffer();
|
|
|
- String[] vitalArr = bean.getNeoName().split(",");
|
|
|
- if (vitalArr.length > 1) {
|
|
|
- if ("收缩压".equals(vitalArr[0]) || "舒张压".equals(vitalArr[0])) {
|
|
|
- if ("收缩压".equals(vitalArr[0])) {
|
|
|
- sbVital.append("血压");
|
|
|
- sbVital.append(getValue(vitalArr) + "/100mmHg");
|
|
|
- indicationPushVO.setVital(sbVital.toString());
|
|
|
- } else if ("舒张压".equals(vitalArr[0])) {
|
|
|
- sbVital.append("血压");
|
|
|
- sbVital.append("100/" + getValue(vitalArr) + "mmHg");
|
|
|
- indicationPushVO.setVital(sbVital.toString());
|
|
|
- }
|
|
|
- } else {
|
|
|
- // 其他数值类型
|
|
|
- sbVital.append(vitalArr[0]);
|
|
|
- sbVital.append(getValue(vitalArr));
|
|
|
- sbVital.append(vitalArr[3]);
|
|
|
- indicationPushVO.setVital(sbVital.toString());
|
|
|
- }
|
|
|
- } else {
|
|
|
- sbVital.append(vitalArr[0]);
|
|
|
- indicationPushVO.setVital(sbVital.toString());
|
|
|
- }
|
|
|
- break;
|
|
|
+ // case "12": // 体征
|
|
|
+ // StringBuffer sbVital = new StringBuffer();
|
|
|
+ // String[] vitalArr = bean.getNeoName().split(",");
|
|
|
+ // if (vitalArr.length > 1) {
|
|
|
+ // if ("收缩压".equals(vitalArr[0]) || "舒张压".equals(vitalArr[0])) {
|
|
|
+ // if ("收缩压".equals(vitalArr[0])) {
|
|
|
+ // sbVital.append("血压");
|
|
|
+ // sbVital.append(getValue(vitalArr) + "/100mmHg");
|
|
|
+ // indicationPushVO.setVital(sbVital.toString());
|
|
|
+ // } else if ("舒张压".equals(vitalArr[0])) {
|
|
|
+ // sbVital.append("血压");
|
|
|
+ // sbVital.append("100/" + getValue(vitalArr) + "mmHg");
|
|
|
+ // indicationPushVO.setVital(sbVital.toString());
|
|
|
+ // }
|
|
|
+ // } else {
|
|
|
+ // // 其他数值类型
|
|
|
+ // sbVital.append(vitalArr[0]);
|
|
|
+ // sbVital.append(getValue(vitalArr));
|
|
|
+ // sbVital.append(vitalArr[3]);
|
|
|
+ // indicationPushVO.setVital(sbVital.toString());
|
|
|
+ // }
|
|
|
+ // } else {
|
|
|
+ // sbVital.append(vitalArr[0]);
|
|
|
+ // indicationPushVO.setVital(sbVital.toString());
|
|
|
+ // }
|
|
|
+ // break;
|
|
|
default:
|
|
|
continue;
|
|
|
}
|
|
@@ -871,4 +878,24 @@ public class TestFacade {
|
|
|
operationOrder.add(item);
|
|
|
indicationPushVO.setOperationOrder(operationOrder);
|
|
|
}
|
|
|
+
|
|
|
+ private FileItem createFileItem(File file) {
|
|
|
+ String fieldName = "textField";
|
|
|
+ FileItemFactory factory = new DiskFileItemFactory(16, null);
|
|
|
+ FileItem item = factory.createItem(fieldName, "text/plain", true, file.getName());
|
|
|
+ int bytesRead = 0;
|
|
|
+ byte[] buffer = new byte[8192];
|
|
|
+ try {
|
|
|
+ FileInputStream fis = new FileInputStream(file);
|
|
|
+ OutputStream os = item.getOutputStream();
|
|
|
+ while ((bytesRead = fis.read(buffer, 0, 8192)) != -1) {
|
|
|
+ os.write(buffer, 0, bytesRead);
|
|
|
+ }
|
|
|
+ os.close();
|
|
|
+ fis.close();
|
|
|
+ } catch (IOException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ return item;
|
|
|
+ }
|
|
|
}
|