Commit 0cfc2da86149fd8dee0a7eb236e9c5e211e6a20f

Authored by liquanyu
1 parent ba7f953ad3

update

Showing 6 changed files with 245 additions and 0 deletions

platform-common/src/main/java/com/lyms/platform/common/enums/AmnioResultEnums.java View file @ 0cfc2da
  1 +package com.lyms.platform.common.enums;
  2 +
  3 +/**
  4 + * Created by Administrator on 2019-10-18.
  5 + */
  6 +public enum AmnioResultEnums {
  7 +
  8 + A("1", "21-三体"),
  9 + B("2", "18-三体"),
  10 + C("3", "13-三体"),
  11 + D("4", "45XO(Turner)"),
  12 + E("5", "47XXX(超雌)"),
  13 + F("6", "47XXY(克氏)"),
  14 + G("7", "47XYY(超雄)"),
  15 + H("8", "22q11.2片段的微缺失"),
  16 + I("9", "22q11.2片段的微重复"),
  17 + J("10", "15q11-q13缺失"),
  18 + K("11", "7q11.23(7号长臂近着丝端片段)"),
  19 + L("12", "15q11.2-q13缺失"),
  20 + M("13", "5号短臂5-40Mb不等的缺失"),
  21 + N("14", "Xp22.3"),
  22 + O("15", "脊髓性肌肉萎缩症"),
  23 + P("16", "DMD"),
  24 + Q("17", "脆性X综合征"),
  25 + R("18", "其他");
  26 +
  27 +
  28 + AmnioResultEnums(String id, String name) {
  29 + this.id = id;
  30 + this.name = name;
  31 + }
  32 +
  33 + private String id;
  34 + private String name;
  35 +
  36 + public static String getName(String id) {
  37 + if(id == null) {
  38 + return "";
  39 + }
  40 + AmnioResultEnums[] values = AmnioResultEnums.values();
  41 + for (AmnioResultEnums value : values) {
  42 + if (value.getId().equals(id)) {
  43 + return value.getName();
  44 + }
  45 + }
  46 + return "";
  47 + }
  48 +
  49 + public String getId() {
  50 + return id;
  51 + }
  52 +
  53 + public void setId(String id) {
  54 + this.id = id;
  55 + }
  56 +
  57 + public String getName() {
  58 + return name;
  59 + }
  60 +
  61 + public void setName(String name) {
  62 + this.name = name;
  63 + }
  64 +
  65 +}
platform-dal/src/main/java/com/lyms/platform/pojo/AmniocentesisResultModel.java View file @ 0cfc2da
... ... @@ -2,7 +2,9 @@
2 2  
3 3 import com.lyms.platform.beans.SerialIdEnum;
4 4 import com.lyms.platform.common.result.BaseModel;
  5 +import com.lyms.platform.common.utils.DateUtil;
5 6 import org.springframework.data.mongodb.core.mapping.Document;
  7 +import org.springframework.format.annotation.DateTimeFormat;
6 8  
7 9 import java.util.Date;
8 10  
9 11  
10 12  
... ... @@ -24,9 +26,12 @@
24 26 private String id;
25 27  
26 28  
  29 + @DateTimeFormat(pattern = "yyyy-MM-dd")
27 30 private Date created;
28 31 //记录日期
  32 + @DateTimeFormat(pattern = "yyyy-MM-dd")
29 33 private Date recordDate;
  34 + @DateTimeFormat(pattern = "yyyy-MM-dd")
30 35 private Date modified;
31 36  
32 37 //创建用户
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/AmniocentesisController.java View file @ 0cfc2da
... ... @@ -163,5 +163,37 @@
163 163  
164 164 }
165 165  
  166 + /**
  167 + * 查看羊穿结果
  168 + * @param request
  169 + * @param id
  170 + * @return
  171 + */
  172 + @TokenRequired
  173 + @ResponseBody
  174 + @RequestMapping(value = "/queryAmnioResultView", method = RequestMethod.GET)
  175 + public BaseResponse queryAmnioResultView(HttpServletRequest request,
  176 + @RequestParam(required = true) String id) {
  177 + return amniocentesisFacade.queryAmnioResultView(id, getUserId(request));
  178 +
  179 + }
  180 +
  181 +
  182 + /**
  183 + * 根据id查询结果
  184 + * @param request
  185 + * @param id
  186 + * @return
  187 + */
  188 + @TokenRequired
  189 + @ResponseBody
  190 + @RequestMapping(value = "/queryAmnioResultById", method = RequestMethod.GET)
  191 + public BaseResponse queryAmnioResultById(HttpServletRequest request,
  192 + @RequestParam(required = true) String id) {
  193 + return amniocentesisFacade.queryAmnioResultById(id, getUserId(request));
  194 +
  195 + }
  196 +
  197 +
166 198 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AmniocentesisFacade.java View file @ 0cfc2da
... ... @@ -15,6 +15,7 @@
15 15 import com.lyms.platform.operate.web.request.AmnioResultRequest;
16 16 import com.lyms.platform.operate.web.request.AmniocentesisInfoRequest;
17 17 import com.lyms.platform.operate.web.request.AmniocentesisQueryRequest;
  18 +import com.lyms.platform.operate.web.result.AmnioResultResult;
18 19 import com.lyms.platform.operate.web.result.AmniocentesisInfo;
19 20 import com.lyms.platform.operate.web.result.AmniocentesisInfoView;
20 21 import com.lyms.platform.operate.web.utils.ResponseUtil;
... ... @@ -402,6 +403,25 @@
402 403 }
403 404 }
404 405 return datas;
  406 + }
  407 +
  408 + public BaseResponse queryAmnioResultView(String id, Integer userId) {
  409 + AmniocentesisResultQuery amniocentesisResultQuery = new AmniocentesisResultQuery();
  410 + amniocentesisResultQuery.setId(id);
  411 + AmniocentesisResultModel resultModel = amniocentesisResultService.queryOne(amniocentesisResultQuery);
  412 + AmnioResultResult resultResult = null;
  413 + if (resultModel != null)
  414 + {
  415 + resultResult = viewFacade.getAmnioResultView(resultModel);
  416 + }
  417 + return new BaseObjectResponse().setData(resultResult).setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg(ErrorCodeConstants.SUCCESS_DESCRIPTION);
  418 + }
  419 +
  420 + public BaseResponse queryAmnioResultById(String id, Integer userId) {
  421 + AmniocentesisResultQuery amniocentesisResultQuery = new AmniocentesisResultQuery();
  422 + amniocentesisResultQuery.setId(id);
  423 + AmniocentesisResultModel resultModel = amniocentesisResultService.queryOne(amniocentesisResultQuery);
  424 + return new BaseObjectResponse().setData(resultModel).setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg(ErrorCodeConstants.SUCCESS_DESCRIPTION);
405 425 }
406 426 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ViewFacade.java View file @ 0cfc2da
... ... @@ -203,6 +203,34 @@
203 203 }
204 204  
205 205  
  206 +
  207 + public AmnioResultResult getAmnioResultView(AmniocentesisResultModel destModel) {
  208 + AmnioResultResult data = new AmnioResultResult();
  209 + data.convertToResult(destModel);
  210 +
  211 + String hospital = "";
  212 + if (org.apache.commons.lang.StringUtils.isNotEmpty(destModel.getHospitalId())) {
  213 + Organization organization = organizationService.getOrganization(Integer.parseInt(destModel.getHospitalId()));
  214 + if (organization != null && organization.getYn() == YnEnums.YES.getId()) {
  215 + hospital = organization.getName();
  216 + }
  217 + }
  218 + data.setHospitalName(hospital);
  219 +
  220 + //医生
  221 + String user = "";
  222 + if (destModel.getUserId() != null) {
  223 + Users users = usersService.getUsers(destModel.getUserId());
  224 + if (users != null && users.getYn() == YnEnums.YES.getId()) {
  225 + user = users.getName();
  226 + }
  227 + }
  228 + data.setUserName(user);
  229 +
  230 + return data;
  231 + }
  232 +
  233 +
206 234 public Map<String, Object> getPatientViewData(Patients data, String id) {
207 235 Map<String, Object> map = new HashMap<>();
208 236 map.put("lastMenstrualPeriodBasis", BasisEnums.getName(data.getLastMenstrualPeriodBasis()));
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/AmnioResultResult.java View file @ 0cfc2da
  1 +package com.lyms.platform.operate.web.result;
  2 +
  3 +import com.lyms.platform.common.base.IBasicResultConvert;
  4 +import com.lyms.platform.common.enums.AmnioResultEnums;
  5 +import com.lyms.platform.common.utils.DateUtil;
  6 +import com.lyms.platform.pojo.AmniocentesisInfoModel;
  7 +import com.lyms.platform.pojo.AmniocentesisResultModel;
  8 +
  9 +import java.util.Date;
  10 +
  11 +
  12 +/**
  13 + * Created by Administrator on 2019-10-14.
  14 + */
  15 +public class AmnioResultResult implements IBasicResultConvert<AmnioResultResult, AmniocentesisResultModel> {
  16 +
  17 + //记录日期
  18 + private String recordDate;
  19 +
  20 + //创建用户
  21 + private String userName;
  22 +
  23 + //创建机构
  24 + private String hospitalName;
  25 +
  26 + //羊水染色体结果 1阴性 2阳性
  27 + private String result;
  28 +
  29 + //阳性结果选择
  30 + private String resultSelect;
  31 +
  32 +
  33 + //其他阳性结果备注框
  34 + private String otherRemark;
  35 +
  36 +
  37 + @Override
  38 + public AmnioResultResult convertToResult(AmniocentesisResultModel destModel) {
  39 +
  40 + setRecordDate(DateUtil.getyyyy_MM_dd(destModel.getRecordDate()));
  41 + setResult(destModel.getResult() == null ? "" : "1".equals(destModel.getResult()) ? "阴性" : "阳性"); //1阴性 2阳性
  42 + setOtherRemark(destModel.getOtherRemark());
  43 + setResultSelect(AmnioResultEnums.getName(destModel.getResultSelect()));
  44 +
  45 + return this;
  46 + }
  47 +
  48 + public String getRecordDate() {
  49 + return recordDate;
  50 + }
  51 +
  52 + public void setRecordDate(String recordDate) {
  53 + this.recordDate = recordDate;
  54 + }
  55 +
  56 + public String getUserName() {
  57 + return userName;
  58 + }
  59 +
  60 + public void setUserName(String userName) {
  61 + this.userName = userName;
  62 + }
  63 +
  64 + public String getHospitalName() {
  65 + return hospitalName;
  66 + }
  67 +
  68 + public void setHospitalName(String hospitalName) {
  69 + this.hospitalName = hospitalName;
  70 + }
  71 +
  72 + public String getResult() {
  73 + return result;
  74 + }
  75 +
  76 + public void setResult(String result) {
  77 + this.result = result;
  78 + }
  79 +
  80 + public String getResultSelect() {
  81 + return resultSelect;
  82 + }
  83 +
  84 + public void setResultSelect(String resultSelect) {
  85 + this.resultSelect = resultSelect;
  86 + }
  87 +
  88 + public String getOtherRemark() {
  89 + return otherRemark;
  90 + }
  91 +
  92 + public void setOtherRemark(String otherRemark) {
  93 + this.otherRemark = otherRemark;
  94 + }
  95 +}