Commit 10984d8dabcb5ecd2a2d4d93ee849e4dead4c50d
1 parent
df8c025c45
Exists in
master
and in
6 other branches
承德市妇幼上线两癌需求-乳腺癌追访记录添加(同时更新追访信息)、追访记录列表
Showing 7 changed files with 118 additions and 17 deletions
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/IBreastAfterVisitDao.java
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/impl/BreastAfterVisitDaoImpl.java
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/BreastAfterVisitService.java
- platform-dal/src/main/java/com/lyms/platform/pojo/BreastAfterVisitModel.java
- platform-dal/src/main/java/com/lyms/platform/query/BreastAfterVisitQuery.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/CancerScreeningController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/CancerScreeningFacade.java
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/IBreastAfterVisitDao.java
View file @
10984d8
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/impl/BreastAfterVisitDaoImpl.java
View file @
10984d8
... | ... | @@ -39,6 +39,14 @@ |
39 | 39 | public void updateOneBreastAfterVisit(BreastAfterVisitModel breastAfterVisitModel) { |
40 | 40 | update(new MongoQuery(new MongoCondition("parentId", breastAfterVisitModel.getParentId(), MongoOper.IS)).convertToMongoQuery(), breastAfterVisitModel); |
41 | 41 | } |
42 | + /** | |
43 | + * 修改一条乳腺追访 | |
44 | + * @param breastAfterVisitModel | |
45 | + */ | |
46 | + @Override | |
47 | + public void updateOneBreastAfterVisit2(BreastAfterVisitModel breastAfterVisitModel) { | |
48 | + update(new MongoQuery(new MongoCondition("id", breastAfterVisitModel.getId(), MongoOper.IS)).convertToMongoQuery(), breastAfterVisitModel); | |
49 | + } | |
42 | 50 | |
43 | 51 | /** |
44 | 52 | * 查询列表 |
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/BreastAfterVisitService.java
View file @
10984d8
... | ... | @@ -45,13 +45,21 @@ |
45 | 45 | } |
46 | 46 | /** |
47 | 47 | * 修改一条乳腺追访 |
48 | - * | |
48 | + * 添加 | |
49 | 49 | * @param breastAfterVisitModel |
50 | + * @param type 1:id查询 2:parentId查询 | |
50 | 51 | */ |
51 | - public void updateOneBreastAfterVisit(BreastAfterVisitModel breastAfterVisitModel) { | |
52 | - Assert.notNull(breastAfterVisitModel.getParentId(), "updateOnebreastAfterVisitModel parentId must not be null."); | |
53 | - breastAfterVisitModel.setModified(new Date()); | |
54 | - iBreastAfterVisitDao.updateOneBreastAfterVisit(breastAfterVisitModel); | |
52 | + public void updateOneBreastAfterVisit(BreastAfterVisitModel breastAfterVisitModel,int type) { | |
53 | + if(type==1){ | |
54 | + Assert.notNull(breastAfterVisitModel.getId(), "updateOnebreastAfterVisitModel Id must not be null."); | |
55 | + breastAfterVisitModel.setModified(new Date()); | |
56 | + iBreastAfterVisitDao.updateOneBreastAfterVisit(breastAfterVisitModel); | |
57 | + }else if(type==2) { | |
58 | + Assert.notNull(breastAfterVisitModel.getParentId(), "updateOnebreastAfterVisitModel parentId must not be null."); | |
59 | + breastAfterVisitModel.setModified(new Date()); | |
60 | + iBreastAfterVisitDao.updateOneBreastAfterVisit2(breastAfterVisitModel); | |
61 | + } | |
62 | + | |
55 | 63 | } |
56 | 64 | /** |
57 | 65 | * 分页查询列表 |
platform-dal/src/main/java/com/lyms/platform/pojo/BreastAfterVisitModel.java
View file @
10984d8
platform-dal/src/main/java/com/lyms/platform/query/BreastAfterVisitQuery.java
View file @
10984d8
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/CancerScreeningController.java
View file @
10984d8
... | ... | @@ -8,6 +8,7 @@ |
8 | 8 | import com.lyms.platform.operate.web.facade.CancerScreeningFacade; |
9 | 9 | import com.lyms.platform.operate.web.request.BreastAfterVisitRequest; |
10 | 10 | import com.lyms.platform.operate.web.request.CancerScreeningRequest; |
11 | +import com.lyms.platform.pojo.BreastAfterVisitRecordModel; | |
11 | 12 | import com.lyms.platform.pojo.CancerScreeningModel; |
12 | 13 | import com.lyms.platform.pojo.ResidentsArchiveModel; |
13 | 14 | import org.springframework.beans.factory.annotation.Autowired; |
... | ... | @@ -150,6 +151,33 @@ |
150 | 151 | public BaseResponse breastAfterVisitList(BreastAfterVisitRequest breastAfterVisitRequest, HttpServletRequest request) { |
151 | 152 | LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); |
152 | 153 | return cancerScreenService.breastAfterVisitList(breastAfterVisitRequest, loginState.getId()); |
154 | + } | |
155 | + /** | |
156 | + * 添加乳腺癌追访记录 | |
157 | + * @param breastAfterVisitRecordModel | |
158 | + * @param request | |
159 | + * @return | |
160 | + */ | |
161 | + @ResponseBody | |
162 | + @RequestMapping(method = RequestMethod.POST ,value = "/breastAfterVisitRecordAdd") | |
163 | + @TokenRequired | |
164 | + public BaseResponse breastAfterVisitRecordAdd(@RequestBody BreastAfterVisitRecordModel breastAfterVisitRecordModel, HttpServletRequest request) { | |
165 | + LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); | |
166 | + return cancerScreenService.breastAfterVisitRecordAdd(breastAfterVisitRecordModel, loginState.getId()); | |
167 | + } | |
168 | + | |
169 | + /** | |
170 | + * 乳腺癌追访记录列表 | |
171 | + * @param id | |
172 | + * @param request | |
173 | + * @return | |
174 | + */ | |
175 | + @ResponseBody | |
176 | + @RequestMapping(method = RequestMethod.GET ,value = "/breastAfterVisitRecordList") | |
177 | + @TokenRequired | |
178 | + public BaseResponse breastAfterVisitRecordList(@RequestBody String id, HttpServletRequest request) { | |
179 | + LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); | |
180 | + return cancerScreenService.breastAfterVisitRecordList(id, loginState.getId()); | |
153 | 181 | } |
154 | 182 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/CancerScreeningFacade.java
View file @
10984d8
... | ... | @@ -22,10 +22,7 @@ |
22 | 22 | import com.lyms.platform.permission.model.Users; |
23 | 23 | import com.lyms.platform.permission.service.OrganizationService; |
24 | 24 | import com.lyms.platform.permission.service.UsersService; |
25 | -import com.lyms.platform.pojo.BasicConfig; | |
26 | -import com.lyms.platform.pojo.BreastAfterVisitModel; | |
27 | -import com.lyms.platform.pojo.CancerScreeningModel; | |
28 | -import com.lyms.platform.pojo.ResidentsArchiveModel; | |
25 | +import com.lyms.platform.pojo.*; | |
29 | 26 | import com.lyms.platform.query.BreastAfterVisitQuery; |
30 | 27 | import com.lyms.platform.query.CancerScreeningQuery; |
31 | 28 | import com.lyms.platform.query.ResidentsArchiveQuery; |
32 | 29 | |
33 | 30 | |
... | ... | @@ -33,10 +30,14 @@ |
33 | 30 | import org.apache.commons.collections.MapUtils; |
34 | 31 | import org.apache.commons.collections.map.HashedMap; |
35 | 32 | import org.apache.commons.lang.StringUtils; |
33 | +import org.apache.commons.lang.math.NumberUtils; | |
36 | 34 | import org.springframework.beans.*; |
37 | 35 | import org.springframework.beans.factory.annotation.Autowired; |
38 | 36 | import org.springframework.data.mongodb.core.MongoTemplate; |
37 | +import org.springframework.data.mongodb.core.query.Criteria; | |
38 | +import org.springframework.data.mongodb.core.query.Query; | |
39 | 39 | import org.springframework.stereotype.Component; |
40 | +import scala.Int; | |
40 | 41 | import scala.util.parsing.combinator.testing.Str; |
41 | 42 | |
42 | 43 | import javax.servlet.http.HttpServletResponse; |
... | ... | @@ -64,6 +65,8 @@ |
64 | 65 | private ResidentsArchiveService residentsArchiveService; |
65 | 66 | @Autowired |
66 | 67 | private BreastAfterVisitService breastAfterVisitService; |
68 | + @Autowired | |
69 | + private MongoTemplate mongoTemplate; | |
67 | 70 | |
68 | 71 | /** |
69 | 72 | * 获取当前医院或院组内的两癌检查列表 |
... | ... | @@ -645,7 +648,7 @@ |
645 | 648 | breastAfterVisitModel.setParentId(cancerScreeningModel.getId()); |
646 | 649 | breastAfterVisitModel.setCode(cancerScreeningModel.getCode()); |
647 | 650 | breastAfterVisitModel.setCheckDate(cancerScreeningModel.getCreated()); |
648 | - breastAfterVisitService.updateOneBreastAfterVisit(breastAfterVisitModel); | |
651 | + breastAfterVisitService.updateOneBreastAfterVisit(breastAfterVisitModel,2); | |
649 | 652 | } |
650 | 653 | |
651 | 654 | |
... | ... | @@ -736,7 +739,6 @@ |
736 | 739 | for (BreastAfterVisitModel model : modelList) { |
737 | 740 | Map <String, Object> map = new HashMap <>(); |
738 | 741 | map.put("id", model.getId()); |
739 | - map.put("parentId", model.getParentId()); | |
740 | 742 | map.put("name", model.getUsername()); |
741 | 743 | map.put("sex", "女"); |
742 | 744 | map.put("cardNum", model.getCertificateNum()); |
743 | 745 | |
744 | 746 | |
745 | 747 | |
746 | 748 | |
... | ... | @@ -756,17 +758,73 @@ |
756 | 758 | map.put("checkDate", DateUtil.getyyyy_MM_dd(model.getCheckDate()));//检査日期 |
757 | 759 | map.put("newRxCssj",LhUltrasoundContent.getName(StringUtils.isNotEmpty(model.getNewRxCssj())?model.getNewRxCssj():null));//超声所见 |
758 | 760 | map.put("rxXJc",LhBreastXRayContent.getName(StringUtils.isNotEmpty(model.getRxXJc())?model.getRxXJc():null));//隆化乳腺X钼靶检查 |
759 | - map.put("type",model.getType());//隆化乳腺X钼靶检查 | |
761 | + map.put("type",model.getType()); | |
760 | 762 | list.add(map); |
761 | 763 | } |
762 | 764 | } |
763 | 765 | return new BaseListResponse().setData(list).setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功").setPageInfo(query.getPageInfo()); |
764 | 766 | } |
765 | 767 | |
768 | + /** | |
769 | + * 乳腺癌追访记录添加 | |
770 | + * | |
771 | + * @param breastAfterVisitRecordModel | |
772 | + * @param id | |
773 | + * @return | |
774 | + */ | |
775 | + public BaseResponse breastAfterVisitRecordAdd(BreastAfterVisitRecordModel RecordModel, Integer id) { | |
776 | + try { | |
777 | + RecordModel.setYn(1); | |
778 | + RecordModel.setCreated(new Date()); | |
779 | + mongoTemplate.save(RecordModel); | |
780 | + //更新追访列基本信息 | |
781 | + BreastAfterVisitModel model=new BreastAfterVisitModel(); | |
782 | + model.setId(RecordModel.getParentId()); | |
783 | + if(null!=RecordModel.getAfterVisitTime()){ | |
784 | + model.setAfterVisitTime(RecordModel.getAfterVisitTime()); | |
785 | + } | |
786 | + if(null!=RecordModel.getNextAfterVisitTime()){ | |
787 | + model.setNextAfterVisitTime(RecordModel.getNextAfterVisitTime()); | |
788 | + } | |
789 | + breastAfterVisitService.updateOneBreastAfterVisit(model,1); | |
766 | 790 | |
791 | + return new BaseResponse("成功", ErrorCodeConstants.SUCCESS); | |
792 | + } catch (Exception e) { | |
793 | + e.printStackTrace(); | |
794 | + return new BaseResponse(e.getMessage(), ErrorCodeConstants.SYSTEM_ERROR); | |
795 | + } | |
796 | + } | |
767 | 797 | |
768 | - | |
769 | 798 | public static final String AREA_URL = PropertiesUtils.getPropertyValue("area_url"); |
770 | 799 | |
800 | + /** | |
801 | + * 乳腺癌追访记录列表 | |
802 | + * | |
803 | + * @param breastAfterVisitRecordModel | |
804 | + * @param id | |
805 | + * @return | |
806 | + */ | |
807 | + public BaseResponse breastAfterVisitRecordList(String id, Integer userId) { | |
808 | + Criteria criteria = Criteria.where("parentId").is(id); | |
809 | + List<BreastAfterVisitRecordModel> RecordModels = mongoTemplate.find(Query.query(criteria), BreastAfterVisitRecordModel.class); | |
810 | + List<Map> list=new ArrayList<>(); | |
811 | + for (BreastAfterVisitRecordModel recordModel : RecordModels) { | |
812 | + Map map=new HashMap(); | |
813 | + map.put("afterVisitTime", DateUtil.getyyyy_MM_dd(recordModel.getAfterVisitTime())); | |
814 | + map.put("afterVisitName", recordModel.getAfterVisitName()); | |
815 | + //追访方式 | |
816 | + String afterVisitType=""; | |
817 | + if(StringUtils.isNotEmpty(recordModel.getAfterVisitType())){ | |
818 | + if(NumberUtils.isNumber(recordModel.getAfterVisitType())){ | |
819 | + afterVisitType=TrackDownTypeEnums.getName(Integer.parseInt(recordModel.getAfterVisitType())); | |
820 | + } | |
821 | + } | |
822 | + map.put("afterVisitType", afterVisitType); | |
823 | + map.put("afterVisitResult", recordModel.getAfterVisitResult()); | |
824 | + map.put("afterVisitFlowPath", recordModel.getAfterVisitFlowPath()); | |
825 | + map.put("nextAfterVisitTime", DateUtil.getyyyy_MM_dd(recordModel.getNextAfterVisitTime())); | |
826 | + } | |
827 | + return new BaseListResponse().setData(RecordModels).setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功"); | |
828 | + } | |
771 | 829 | } |