Commit 4cb56e9bc95f38ed58a933eccf612e95865acbf8

Authored by shiyang
1 parent 754d31729f

公卫2.0-新增产后42天-上传接口

Showing 3 changed files with 412 additions and 1 deletions

platform-operate-api/src/main/java/com/lyms/hospitalapi/lhxfy/model/saveMaternalPostpartum42FollowupInfo.java View file @ 4cb56e9
  1 +package com.lyms.hospitalapi.lhxfy.model;
  2 +
  3 +import com.lyms.platform.biz.service.PatientsService;
  4 +import com.lyms.platform.common.utils.DateUtil;
  5 +import com.lyms.platform.common.utils.StringUtils;
  6 +import com.lyms.platform.pojo.AntenatalExaminationModel;
  7 +import com.lyms.platform.pojo.Patients;
  8 +import com.lyms.platform.pojo.PostReviewModel;
  9 +import org.springframework.beans.factory.annotation.Autowired;
  10 +
  11 +import java.util.List;
  12 +
  13 +/**
  14 + * 公卫2.0-新增产后42天
  15 + */
  16 +public class saveMaternalPostpartum42FollowupInfo {
  17 + private Integer isAppCreate; //类型:Number 必有字段 备注:各厂商对接时,再确定具体的值
  18 + private String followupDoctorId; //类型:String 必有字段 备注:本次随访医师ID
  19 + private String followupDoctorName; //类型:String 必有字段 备注:本次随访医师姓名
  20 + private String deliveryDate; //类型:String 必有字段 备注:分娩日期
  21 + private String referralCode; //类型:String 必有字段 备注:转诊/结案标志
  22 + private String standard; //类型:String 必有字段 备注:国家规范版本号
  23 + private String uberCode; //类型:String 必有字段 备注:子宫情况代码
  24 + private String uberAbnormDesc; //类型:String 可有字段 备注:子宫异常描述
  25 + private String postpartumOrgName; //类型:String 可有字段 备注:产后检查机构名称(济南规范)
  26 + private String lochiaCode; //类型:String 可有字段 备注:恶露状况代码
  27 + private String lochiaAbnormDesc; //类型:String 可有字段 备注:恶露异常描述
  28 + private String handleResultCode; //类型:String 可有字段 备注:处理结果(1到位2未到位)(济南规范)
  29 + private String contactsOrPhone; //类型:String 可有字段 备注:联系人及联系方式(济南规范)
  30 + private String uterusCode; //类型:String 可有字段 备注:子宫情况代码
  31 + private String uterusAbnormDesc; //类型:String 可有字段 备注:子宫异常描述
  32 + private String woundCode; //类型:String 可有字段 备注:伤口情况代码
  33 + private String woundAbnormDesc; //类型:String 可有字段 备注:伤口异常描述
  34 + private String referralReason; //类型:String 可有字段 备注:转诊原因
  35 + private String refertoOrgName; //类型:String 可有字段 备注:转入医疗机构名称
  36 + private String followupClassifyCode; //类型:String 可有字段 备注:此次随访分类代码
  37 + private String followupClassifyValue; //类型:String 可有字段 备注:此次随访分类中文
  38 + private String checkOrgName; //类型:String 可有字段 备注:检查机构
  39 + private List<Object> recordChoice; //类型:Array 可有字段 备注:选项指标记录,用来前后交互传输数据使用的
  40 + private String followupDate; //类型:String 必有字段 备注:本次随访日期
  41 + private String resiOutDate; //类型:String 可有字段 备注:出院日期
  42 + private String healthDesc; //类型:String 可有字段 备注:一般健康情况
  43 + private String psyDesc; //类型:String 可有字段 备注:一般心理情况
  44 + private Integer systilic; //类型:Number 可有字段 备注:收缩压
  45 + private Integer diastolic; //类型:Number 可有字段 备注:舒张压
  46 + private String othersDesc; //类型:String 可有字段 备注:其他
  47 + private String personInfoId; //类型:String 必有字段 备注:个人档案ID
  48 + private String maternalRegisterId; //类型:String 必有字段 备注:孕产登记ID
  49 + private String name; //类型:String 必有字段 备注:本人姓名
  50 +
  51 + @Autowired
  52 + PatientsService patientsService;
  53 +
  54 + public void convertToDataModel(PostReviewModel postReviewModel){
  55 + setIsAppCreate(null==postReviewModel.getIsAppCreate()?0:postReviewModel.getIsAppCreate());
  56 + setFollowupDoctorId(StringUtils.isEmpty(postReviewModel.getFollowupDoctorId())?"无":postReviewModel.getFollowupDoctorId());
  57 + setFollowupDoctorName(StringUtils.isEmpty(postReviewModel.getFollowupDoctorName())?"无":postReviewModel.getFollowupDoctorName());
  58 + Patients patient = patientsService.findOnePatientById(postReviewModel.getParentId());
  59 + setDeliveryDate(null==patient.getFmDate()?"无": DateUtil.getyyyy_MM_dd_hms(patient.getFmDate()));
  60 + setReferralCode("无");//?
  61 + setStandard(StringUtils.isEmpty(postReviewModel.getStandard())?"无":postReviewModel.getStandard());
  62 + setUberCode(StringUtils.isEmpty(postReviewModel.getMatrix())?"无":postReviewModel.getMatrix());
  63 + setUberAbnormDesc(null);
  64 + setPostpartumOrgName(null);
  65 + setLochiaCode(null);
  66 + setLochiaAbnormDesc(null);
  67 + setHandleResultCode(null);
  68 + setContactsOrPhone(null);
  69 + setUterusCode(null);
  70 + setUterusAbnormDesc(null);
  71 + setWoundCode(null);
  72 + setWoundAbnormDesc(null);
  73 + setReferralReason(null);
  74 + setRefertoOrgName(null);
  75 + setFollowupClassifyCode(null);
  76 + setFollowupClassifyValue(null);
  77 + setCheckOrgName(null);
  78 + setRecordChoice(null);
  79 + setFollowupDate(StringUtils.isEmpty(postReviewModel.getFollowupDate())?"无":postReviewModel.getFollowupDate());
  80 + setResiOutDate(null);
  81 + setHealthDesc(null);
  82 + setPsyDesc(null);
  83 + setSystilic(null);
  84 + setDiastolic(null);
  85 + setOthersDesc(null);
  86 + setPersonInfoId("无");//?
  87 + setMaternalRegisterId(StringUtils.isEmpty(postReviewModel.getParentId())?"无":postReviewModel.getParentId());
  88 + setName(StringUtils.isEmpty(postReviewModel.getName())?"无":postReviewModel.getName());
  89 + }
  90 +
  91 + public Integer getIsAppCreate() {
  92 + return isAppCreate;
  93 + }
  94 +
  95 + public void setIsAppCreate(Integer isAppCreate) {
  96 + this.isAppCreate = isAppCreate;
  97 + }
  98 +
  99 + public String getFollowupDoctorId() {
  100 + return followupDoctorId;
  101 + }
  102 +
  103 + public void setFollowupDoctorId(String followupDoctorId) {
  104 + this.followupDoctorId = followupDoctorId;
  105 + }
  106 +
  107 + public String getFollowupDoctorName() {
  108 + return followupDoctorName;
  109 + }
  110 +
  111 + public void setFollowupDoctorName(String followupDoctorName) {
  112 + this.followupDoctorName = followupDoctorName;
  113 + }
  114 +
  115 + public String getDeliveryDate() {
  116 + return deliveryDate;
  117 + }
  118 +
  119 + public void setDeliveryDate(String deliveryDate) {
  120 + this.deliveryDate = deliveryDate;
  121 + }
  122 +
  123 + public String getReferralCode() {
  124 + return referralCode;
  125 + }
  126 +
  127 + public void setReferralCode(String referralCode) {
  128 + this.referralCode = referralCode;
  129 + }
  130 +
  131 + public String getStandard() {
  132 + return standard;
  133 + }
  134 +
  135 + public void setStandard(String standard) {
  136 + this.standard = standard;
  137 + }
  138 +
  139 + public String getUberCode() {
  140 + return uberCode;
  141 + }
  142 +
  143 + public void setUberCode(String uberCode) {
  144 + this.uberCode = uberCode;
  145 + }
  146 +
  147 + public String getUberAbnormDesc() {
  148 + return uberAbnormDesc;
  149 + }
  150 +
  151 + public void setUberAbnormDesc(String uberAbnormDesc) {
  152 + this.uberAbnormDesc = uberAbnormDesc;
  153 + }
  154 +
  155 + public String getPostpartumOrgName() {
  156 + return postpartumOrgName;
  157 + }
  158 +
  159 + public void setPostpartumOrgName(String postpartumOrgName) {
  160 + this.postpartumOrgName = postpartumOrgName;
  161 + }
  162 +
  163 + public String getLochiaCode() {
  164 + return lochiaCode;
  165 + }
  166 +
  167 + public void setLochiaCode(String lochiaCode) {
  168 + this.lochiaCode = lochiaCode;
  169 + }
  170 +
  171 + public String getLochiaAbnormDesc() {
  172 + return lochiaAbnormDesc;
  173 + }
  174 +
  175 + public void setLochiaAbnormDesc(String lochiaAbnormDesc) {
  176 + this.lochiaAbnormDesc = lochiaAbnormDesc;
  177 + }
  178 +
  179 + public String getHandleResultCode() {
  180 + return handleResultCode;
  181 + }
  182 +
  183 + public void setHandleResultCode(String handleResultCode) {
  184 + this.handleResultCode = handleResultCode;
  185 + }
  186 +
  187 + public String getContactsOrPhone() {
  188 + return contactsOrPhone;
  189 + }
  190 +
  191 + public void setContactsOrPhone(String contactsOrPhone) {
  192 + this.contactsOrPhone = contactsOrPhone;
  193 + }
  194 +
  195 + public String getUterusCode() {
  196 + return uterusCode;
  197 + }
  198 +
  199 + public void setUterusCode(String uterusCode) {
  200 + this.uterusCode = uterusCode;
  201 + }
  202 +
  203 + public String getUterusAbnormDesc() {
  204 + return uterusAbnormDesc;
  205 + }
  206 +
  207 + public void setUterusAbnormDesc(String uterusAbnormDesc) {
  208 + this.uterusAbnormDesc = uterusAbnormDesc;
  209 + }
  210 +
  211 + public String getWoundCode() {
  212 + return woundCode;
  213 + }
  214 +
  215 + public void setWoundCode(String woundCode) {
  216 + this.woundCode = woundCode;
  217 + }
  218 +
  219 + public String getWoundAbnormDesc() {
  220 + return woundAbnormDesc;
  221 + }
  222 +
  223 + public void setWoundAbnormDesc(String woundAbnormDesc) {
  224 + this.woundAbnormDesc = woundAbnormDesc;
  225 + }
  226 +
  227 + public String getReferralReason() {
  228 + return referralReason;
  229 + }
  230 +
  231 + public void setReferralReason(String referralReason) {
  232 + this.referralReason = referralReason;
  233 + }
  234 +
  235 + public String getRefertoOrgName() {
  236 + return refertoOrgName;
  237 + }
  238 +
  239 + public void setRefertoOrgName(String refertoOrgName) {
  240 + this.refertoOrgName = refertoOrgName;
  241 + }
  242 +
  243 + public String getFollowupClassifyCode() {
  244 + return followupClassifyCode;
  245 + }
  246 +
  247 + public void setFollowupClassifyCode(String followupClassifyCode) {
  248 + this.followupClassifyCode = followupClassifyCode;
  249 + }
  250 +
  251 + public String getFollowupClassifyValue() {
  252 + return followupClassifyValue;
  253 + }
  254 +
  255 + public void setFollowupClassifyValue(String followupClassifyValue) {
  256 + this.followupClassifyValue = followupClassifyValue;
  257 + }
  258 +
  259 + public String getCheckOrgName() {
  260 + return checkOrgName;
  261 + }
  262 +
  263 + public void setCheckOrgName(String checkOrgName) {
  264 + this.checkOrgName = checkOrgName;
  265 + }
  266 +
  267 + public List<Object> getRecordChoice() {
  268 + return recordChoice;
  269 + }
  270 +
  271 + public void setRecordChoice(List<Object> recordChoice) {
  272 + this.recordChoice = recordChoice;
  273 + }
  274 +
  275 + public String getFollowupDate() {
  276 + return followupDate;
  277 + }
  278 +
  279 + public void setFollowupDate(String followupDate) {
  280 + this.followupDate = followupDate;
  281 + }
  282 +
  283 + public String getResiOutDate() {
  284 + return resiOutDate;
  285 + }
  286 +
  287 + public void setResiOutDate(String resiOutDate) {
  288 + this.resiOutDate = resiOutDate;
  289 + }
  290 +
  291 + public String getHealthDesc() {
  292 + return healthDesc;
  293 + }
  294 +
  295 + public void setHealthDesc(String healthDesc) {
  296 + this.healthDesc = healthDesc;
  297 + }
  298 +
  299 + public String getPsyDesc() {
  300 + return psyDesc;
  301 + }
  302 +
  303 + public void setPsyDesc(String psyDesc) {
  304 + this.psyDesc = psyDesc;
  305 + }
  306 +
  307 + public Integer getSystilic() {
  308 + return systilic;
  309 + }
  310 +
  311 + public void setSystilic(Integer systilic) {
  312 + this.systilic = systilic;
  313 + }
  314 +
  315 + public Integer getDiastolic() {
  316 + return diastolic;
  317 + }
  318 +
  319 + public void setDiastolic(Integer diastolic) {
  320 + this.diastolic = diastolic;
  321 + }
  322 +
  323 + public String getOthersDesc() {
  324 + return othersDesc;
  325 + }
  326 +
  327 + public void setOthersDesc(String othersDesc) {
  328 + this.othersDesc = othersDesc;
  329 + }
  330 +
  331 + public String getPersonInfoId() {
  332 + return personInfoId;
  333 + }
  334 +
  335 + public void setPersonInfoId(String personInfoId) {
  336 + this.personInfoId = personInfoId;
  337 + }
  338 +
  339 + public String getMaternalRegisterId() {
  340 + return maternalRegisterId;
  341 + }
  342 +
  343 + public void setMaternalRegisterId(String maternalRegisterId) {
  344 + this.maternalRegisterId = maternalRegisterId;
  345 + }
  346 +
  347 + public String getName() {
  348 + return name;
  349 + }
  350 +
  351 + public void setName(String name) {
  352 + this.name = name;
  353 + }
  354 +}
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/Public2PathController.java View file @ 4cb56e9
... ... @@ -123,6 +123,21 @@
123 123 BaseResponse baseResponse=public2PathFacade.saveMaternalFollowup(startDate,endDate,hospitalId);
124 124 return baseResponse;
125 125 }
  126 + /**
  127 + * 公卫2.0-新增产后42天
  128 + * @param startDate
  129 + * @param endDate
  130 + * @param hospitalId
  131 + */
  132 + @ResponseBody
  133 + @TokenRequired
  134 + @RequestMapping(value = "/saveMaternalPostpartum42Followup", method = RequestMethod.GET)
  135 + public BaseResponse saveMaternalPostpartum42Followup(@RequestParam String startDate,
  136 + @RequestParam String endDate,
  137 + @RequestParam String hospitalId) {
  138 + BaseResponse baseResponse=public2PathFacade.saveMaternalPostpartum42Followup(startDate,endDate,hospitalId);
  139 + return baseResponse;
  140 + }
126 141  
127 142 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/Public2PathFacade.java View file @ 4cb56e9
... ... @@ -40,7 +40,8 @@
40 40 private AntenatalExaminationService antExService;
41 41 @Autowired
42 42 private AntenatalExaminationService antenatalExaminationService;
43   -
  43 + @Autowired
  44 + private PostReviewService postReviewService;
44 45 private static final String URL = "http://222.223.187.132:7076/ph-s-report";
45 46 public BaseResponse saveChildInfo(String startDate, String endDate,String hospitalId) {
46 47 BaseResponse baseResponse=new BaseResponse();
... ... @@ -307,6 +308,47 @@
307 308 e.printStackTrace();
308 309 LogUtil.error("新增非首次产前随访---"+model.getId()+"---"+e.getMessage(),null);
309 310 baseResponse.setErrormsg("新增非首次产前随访---"+model.getId()+"---"+e.getMessage());
  311 + }
  312 + }
  313 + baseResponse.setObject(baseResponseList);
  314 + return baseResponse;
  315 + }
  316 +
  317 + public BaseResponse saveMaternalPostpartum42Followup(String startDate, String endDate, String hospitalId) {
  318 + BaseResponse baseResponse=new BaseResponse();
  319 + List<String> baseResponseList=new ArrayList<>();//记录错误信息
  320 + PostReviewQuery modelQuery = new PostReviewQuery();
  321 + modelQuery.setYn(YnEnums.YES.getId());
  322 + modelQuery.setHospitalId(hospitalId);
  323 + modelQuery.setStart(DateUtil.getDayFirstSecond(DateUtil.parseYMD(startDate)));
  324 + modelQuery.setEnd(DateUtil.getDayLastSecond(DateUtil.parseYMD(endDate)));
  325 + List <PostReviewModel> models = postReviewService.findWithList(modelQuery.convertToQuery());
  326 + String url=URL+"/thirdApi/saveMaternalPostpartum42Followup/v1";//新增上传
  327 + for (PostReviewModel model : models) {
  328 + try {
  329 + //数据转换
  330 + saveMaternalPostpartum42FollowupInfo modelInfo=new saveMaternalPostpartum42FollowupInfo();
  331 + modelInfo.convertToDataModel(model);
  332 + String jsonString = JSON.toJSONString(modelInfo);
  333 + //上传数据
  334 + String result=repeatPost(url,jsonString);
  335 + if(StringUtils.isNotEmpty(result)){
  336 + List<UploadResult_Public2> results=JsonUtil.jsonToList(result, UploadResult.class);
  337 + if("0".equals(results.get(0).getCode())){
  338 + baseResponseList.add("新增产后42天---"+model.getId()+"---code:"+results.get(0).getCode()+"message:"+results.get(0).getMessage());
  339 + LogUtil.taskInfo("新增产后42天---"+model.getId()+"---code:"+results.get(0).getCode()+"message:"+results.get(0).getMessage());
  340 + }else {
  341 + baseResponseList.add("新增产后42天---"+model.getId()+"---code:"+results.get(0).getCode()+"message:"+results.get(0).getMessage());
  342 + LogUtil.error("新增产后42天---"+model.getId()+"---code:"+results.get(0).getCode()+"message:"+results.get(0).getMessage(),null);
  343 + }
  344 + }else {
  345 + baseResponseList.add("新增产后42天---"+model.getId()+"---上传返回结果为null");
  346 + LogUtil.error("新增产后42天---"+model.getId()+"---上传返回结果为null",null);
  347 + }
  348 + } catch (Exception e) {
  349 + e.printStackTrace();
  350 + LogUtil.error("新增产后42天---"+model.getId()+"---"+e.getMessage(),null);
  351 + baseResponse.setErrormsg("新增产后42天---"+model.getId()+"---"+e.getMessage());
310 352 }
311 353 }
312 354 baseResponse.setObject(baseResponseList);