From 6dc21982d96e7da73be35f137cb28e880abcc50d Mon Sep 17 00:00:00 2001 From: zhangheng <3226558941@qq.com> Date: Wed, 26 Jun 2024 15:00:36 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=87=E7=AD=BE=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LabelFieldContentController.java | 3 + .../PatientAllInfoViewUppercase.java | 283 ++++++++++++++++++ .../patientinfo/PatientAllInfoViewMapper.java | 4 +- .../ILabelFieldContentService.java | 6 + .../impl/LabelFieldContentServiceImpl.java | 49 ++- .../patientinfo/PatientAllInfoViewMapper.xml | 86 +++--- 6 files changed, 360 insertions(+), 71 deletions(-) create mode 100644 postdischarge-manage/src/main/java/com/xinelu/manage/domain/patientinfo/PatientAllInfoViewUppercase.java diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/controller/labelfieldcontent/LabelFieldContentController.java b/postdischarge-manage/src/main/java/com/xinelu/manage/controller/labelfieldcontent/LabelFieldContentController.java index 8cc66db2..d96aa9e4 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/controller/labelfieldcontent/LabelFieldContentController.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/controller/labelfieldcontent/LabelFieldContentController.java @@ -108,6 +108,9 @@ public class LabelFieldContentController extends BaseController { return labelFieldContentService.groupingValue(taskPartitionDictId, patientId); } + /** + * 画像内容新增 + */ @PostMapping("/insertLabelField") public AjaxResult insertLabelField(@RequestBody LabelField labelField) { return labelFieldContentService.insertLabelField(labelField); diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/domain/patientinfo/PatientAllInfoViewUppercase.java b/postdischarge-manage/src/main/java/com/xinelu/manage/domain/patientinfo/PatientAllInfoViewUppercase.java new file mode 100644 index 00000000..0056052b --- /dev/null +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/domain/patientinfo/PatientAllInfoViewUppercase.java @@ -0,0 +1,283 @@ +package com.xinelu.manage.domain.patientinfo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.LocalDateTime; + +/** + * 患者全部信息视图对象 patient_all_info_view + * + * @author xinelu + * @date 2024-06-11 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@ApiModel(value = "患者全部信息视图对象", description = "patient_all_info_view") +public class PatientAllInfoViewUppercase { + + private static final long serialVersionUID = 1L; + + /** + * 患者主键 + */ + @ApiModelProperty(value = "患者主键") + private Long PATIENTID; + + /** + * 患者姓名 + */ + @ApiModelProperty(value = "患者姓名") + private String PATIENTNAME; + + /** + * 患者电话 + */ + @ApiModelProperty(value = "患者电话") + private String PATIENTPHONE; + + /** + * 家属电话 + */ + @ApiModelProperty(value = "家属电话") + private String FAMILYMEMBERPHONE; + + /** + * 出生日期,格式:yyyy-MM-dd + */ + @ApiModelProperty(value = "出生日期,格式:yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd") + private LocalDate BIRTHDATE; + + /** + * 身份证号 + */ + @ApiModelProperty(value = "身份证号") + private String CARDNO; + + /** + * 性别,男:MALE,女:FEMALE + */ + @ApiModelProperty(value = "性别,男:MALE,女:FEMALE") + private String SEX; + + /** + * 住址 + */ + @ApiModelProperty(value = "住址") + private String ADDRESS; + + /** + * 患者类型,预住院患者:PRE_HOSPITALIZED_PATIENT,在院患者:IN_HOSPITAL_PATIENT,门诊患者:OUTPATIENT,出院患者:DISCHARGED_PATIENT,签约患者:CONTRACTED_PATIENT + */ + @ApiModelProperty(value = "患者类型,预住院患者:PRE_HOSPITALIZED_PATIENT,在院患者:IN_HOSPITAL_PATIENT,门诊患者:OUTPATIENT,出院患者:DISCHARGED_PATIENT,签约患者:CONTRACTED_PATIENT") + private String PATIENTTYPE; + + /** + * 就诊记录id + */ + @ApiModelProperty(value = "就诊记录id") + private Long PATIENTVISITRECORDID; + + /** + * 就诊类型,门诊:OUTPATIENT_SERVICE,住院:BE_HOSPITALIZED + */ + @ApiModelProperty(value = "就诊类型,门诊:OUTPATIENT_SERVICE,住院:BE_HOSPITALIZED") + private String VISITMETHOD; + + /** + * 就诊时间,格式:yyyy-MM-dd HH:mm:ss + */ + @ApiModelProperty(value = "就诊时间,格式:yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm") + private LocalDateTime VISITDATE; + + /** + * 所属医院名称 + */ + @ApiModelProperty(value = "所属医院名称") + private String HOSPITALAGENCYNAME; + + /** + * 所属院区名称 + */ + @ApiModelProperty(value = "所属院区名称") + private String CAMPUSAGENCYNAME; + + /** + * 所属科室名称 + */ + @ApiModelProperty(value = "所属科室名称") + private String DEPARTMENTNAME; + + /** + * 所属病区名称 + */ + @ApiModelProperty(value = "所属病区名称") + private String WARDNAME; + + /** + * 主治医生姓名 + */ + @ApiModelProperty(value = "主治医生姓名") + private String ATTENDINGPHYSICIANNAME; + + /** + * 主要诊断 + */ + @ApiModelProperty(value = "主要诊断") + private String MAINDIAGNOSIS; + + /** + * 入院时间 + */ + @ApiModelProperty(value = "入院时间") + private LocalDateTime ADMISSIONTIME; + + /** + * 出院时间 + */ + @ApiModelProperty(value = "出院时间") + private LocalDateTime DISCHARGETIME; + + /** + * 住院天数(出院记录),单位为:天 + */ + @ApiModelProperty(value = "住院天数") + private Integer HOSPITALIZATIONDAYS; + + /** + * 入院病历信息,存储患者入院的整个病历信息 + */ + @ApiModelProperty(value = "入院病历信息,存储患者入院的整个病历信息") + private String INHOSPITALINFO; + + /** + * 出院病历信息,存储患者出院的整个病历信息 + */ + @ApiModelProperty(value = "出院病历信息,存储患者出院的整个病历信息") + private String OUTHOSPITALINFO; + + /** + * 就诊流水号 + */ + @ApiModelProperty(value = "就诊流水号") + private String VISITSERIALNUMBER; + + /** + * 门诊/住院号 + */ + @ApiModelProperty(value = "门诊/住院号") + private String INHOSPITALNUMBER; + + /** + * 责任护士 + */ + @ApiModelProperty(value = "责任护士") + private String RESPONSIBLENURSE; + + /** + * 手术名称 + */ + @ApiModelProperty(value = "手术名称") + private String SURGICALNAME; + + /** + * 手术记录 + */ + @ApiModelProperty(value = "手术记录") + private String SURGICALRECORD; + + /** + * 签约记录表id + */ + @ApiModelProperty(value = "签约记录表id") + private Long SIGNPATIENTRECORDID; + + /** + * 缴费状态,已缴费:PAID,未交费:UNPAID_FEES + */ + @ApiModelProperty(value = "缴费状态,已缴费:PAID,未交费:UNPAID_FEES") + private String PAYMENTSTATUS; + + /** + * 所属健康管理师名称(用户表名称) + */ + @ApiModelProperty(value = "所属健康管理师名称") + private String HEALTHMANAGENAME; + + /** + * 服务状态,意向签约:INTENTIONAL_SIGNING,服务中:SERVICE_CENTER,服务结束:SERVICE_END + */ + @ApiModelProperty(value = "服务状态,意向签约:INTENTIONAL_SIGNING,服务中:SERVICE_CENTER,服务结束:SERVICE_END") + private String SERVICESTATUS; + + /** + * 签约状态,在签:IN_SIGN,忽略:IGNORE_SIGN,解约:SEPARATE_SIGN,续约:CONTINUOUS_SIGN + */ + @ApiModelProperty(value = "签约状态,在签:IN_SIGN,忽略:IGNORE_SIGN,解约:SEPARATE_SIGN,续约:CONTINUOUS_SIGN") + private String SIGNSTATUS; + + /** + * 开单医生姓名(意向签约) + */ + @ApiModelProperty(value = "开单医生姓名") + private String BILLINGDOCTORNAME; + + /** + * 签约时间,格式:yyyy-MM-dd HH:mm:ss + */ + @ApiModelProperty(value = "签约时间,格式:yyyy-MM-dd HH:mm:ss") + private LocalDateTime SIGNTIME; + + /** + * 服务包名称 + */ + @ApiModelProperty(value = "服务包名称") + private String PACKAGENAME; + + /** + * 服务包缴费状态,已缴费:PAID,未交费:UNPAID_FEES + */ + @ApiModelProperty(value = "服务包缴费状态,已缴费:PAID,未交费:UNPAID_FEES") + private String PACKAGEPAYMENTSTATUS; + + /** + * 服务包价格,小数点后两位 + */ + @ApiModelProperty(value = "服务包价格,小数点后两位") + private BigDecimal PACKAGEPRICE; + + /** + * 服务开始时间,格式:yyyy-MM-dd HH:mm:ss + */ + @ApiModelProperty(value = "服务开始时间,格式:yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd") + private LocalDateTime SERVICESTARTTIME; + + /** + * 服务结束时间,格式:yyyy-MM-dd HH:mm:ss + */ + @ApiModelProperty(value = "服务结束时间,格式:yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd") + private LocalDateTime SERVICEENDTIME; + + /** + * 服务包期限 + */ + @ApiModelProperty(value = "服务包期限") + private Integer PACKAGETERM; + + /** + * 服务包期限单位,年,月,日 + */ + @ApiModelProperty(value = "服务包期限单位,年,月,日") + private String PACKAGETERMUNIT; +} \ No newline at end of file diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/patientinfo/PatientAllInfoViewMapper.java b/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/patientinfo/PatientAllInfoViewMapper.java index 77fb24bb..f6402f90 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/patientinfo/PatientAllInfoViewMapper.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/patientinfo/PatientAllInfoViewMapper.java @@ -1,6 +1,8 @@ package com.xinelu.manage.mapper.patientinfo; import com.xinelu.manage.domain.patientinfo.PatientAllInfoView; +import com.xinelu.manage.domain.patientinfo.PatientAllInfoViewUppercase; + import java.util.List; @@ -33,5 +35,5 @@ public interface PatientAllInfoViewMapper { * @param patientId 患者主键 * @return 患者全部信息视图对象 */ - List selectPatientAllInfoListViewByPatientId(Long patientId); + List selectPatientAllInfoListViewByPatientId(Long patientId); } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/labelfieldcontent/ILabelFieldContentService.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/labelfieldcontent/ILabelFieldContentService.java index ee5962e7..5babb5d8 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/labelfieldcontent/ILabelFieldContentService.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/labelfieldcontent/ILabelFieldContentService.java @@ -84,5 +84,11 @@ public interface ILabelFieldContentService { */ List> groupingValue(Long taskPartitionDictId, Long patientId); + /** + * 画像内容新增 + * + * @param labelField 画像信息 + * @return AjaxResult + */ AjaxResult insertLabelField(LabelField labelField); } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/labelfieldcontent/impl/LabelFieldContentServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/labelfieldcontent/impl/LabelFieldContentServiceImpl.java index 0eab350b..1530b297 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/labelfieldcontent/impl/LabelFieldContentServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/labelfieldcontent/impl/LabelFieldContentServiceImpl.java @@ -10,6 +10,7 @@ import com.xinelu.common.utils.bean.BeanUtils; import com.xinelu.manage.domain.labelfieldcontent.LabelFieldContent; import com.xinelu.manage.domain.labelfieldinfo.LabelFieldInfo; import com.xinelu.manage.domain.patientinfo.PatientAllInfoView; +import com.xinelu.manage.domain.patientinfo.PatientAllInfoViewUppercase; import com.xinelu.manage.dto.labelfieldcontent.LabelFieldContentAddDTO; import com.xinelu.manage.dto.labelfieldcontent.LabelFieldContentDTO; import com.xinelu.manage.mapper.labelfieldcontent.LabelFieldContentMapper; @@ -25,12 +26,10 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; +import java.lang.reflect.Field; import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; +import java.util.*; import java.util.stream.Collectors; /** @@ -201,31 +200,21 @@ public class LabelFieldContentServiceImpl implements ILabelFieldContentService { if (CollectionUtils.isEmpty(labelFieldContentList)) { return new ArrayList<>(); } + //取属性名 + PatientAllInfoView patientAllInfoView = new PatientAllInfoView(); + Field[] declaredFields = patientAllInfoView.getClass().getDeclaredFields(); + String[] strings = new String[declaredFields.length]; + for (int i = 0; i < declaredFields.length; i++) { + strings[i] = declaredFields[i].getName().toUpperCase(); + } + List strings1 = Arrays.asList(strings); for (GroupingValue groupingValue : labelFieldContentList) { - groupingValue.setPatientId(patientId); - //获取不同的文件路径 - switch (groupingValue.getFieldName()) { - case "姓名": - String s = paramsValue.getOrDefault("patientName", "").toString(); - groupingValue.setFieldValue(paramsValue.getOrDefault("patientName", "").toString()); - break; - case "患者电话": - groupingValue.setFieldValue(paramsValue.getOrDefault("patientPhone", "").toString()); - break; - case "性别": - groupingValue.setFieldValue(paramsValue.getOrDefault("sex", "").toString()); - break; - case "医院": - groupingValue.setFieldValue(paramsValue.getOrDefault("hospitalAgencyName", "").toString()); - break; - default: - break; - } + String s = strings1.stream().filter(Objects::nonNull).filter(item -> item.equals(groupingValue.getFieldCode())).findFirst().orElse(new String()); + groupingValue.setFieldValue(paramsValue.getOrDefault(s, "").toString()); } List> lists = new ArrayList<>(); lists.add(labelFieldContentList); return lists; - } /** @@ -236,17 +225,23 @@ public class LabelFieldContentServiceImpl implements ILabelFieldContentService { */ private JSONObject getParamsValue(Long patientId) { JSONObject retObj; - List patientAllInfoViews = patientAllInfoViewMapper.selectPatientAllInfoListViewByPatientId(patientId); + List patientAllInfoViews = patientAllInfoViewMapper.selectPatientAllInfoListViewByPatientId(patientId); if (CollectionUtils.isEmpty(patientAllInfoViews) || ObjectUtils.isEmpty(patientAllInfoViews.get(0))) { throw new ServiceException("患者信息获取错误,请联系管理员!"); } - PatientAllInfoView patientAllInfoView = patientAllInfoViews.get(0); + PatientAllInfoViewUppercase patientAllInfoView = patientAllInfoViews.get(0); retObj = JSONObject.parseObject(JSONObject.toJSONString(patientAllInfoView)); // 性别转换成中文、计算年龄 - retObj.fluentPut("sex", PatientSexEnum.getInfoByCode(patientAllInfoView.getSex()).getInfo()).fluentPut("age", BaseUtil.getAge(patientAllInfoView.getBirthDate())); + retObj.fluentPut("SEX", PatientSexEnum.getInfoByCode(patientAllInfoView.getSEX()).getInfo()).fluentPut("AGE", BaseUtil.getAge(patientAllInfoView.getBIRTHDATE())); return retObj; } + /** + * 画像内容新增 + * + * @param labelField 画像信息 + * @return AjaxResult + */ @Transactional(rollbackFor = Exception.class) @Override public AjaxResult insertLabelField(LabelField labelField) { diff --git a/postdischarge-manage/src/main/resources/mapper/manage/patientinfo/PatientAllInfoViewMapper.xml b/postdischarge-manage/src/main/resources/mapper/manage/patientinfo/PatientAllInfoViewMapper.xml index dc9fee36..f95ac747 100644 --- a/postdischarge-manage/src/main/resources/mapper/manage/patientinfo/PatientAllInfoViewMapper.xml +++ b/postdischarge-manage/src/main/resources/mapper/manage/patientinfo/PatientAllInfoViewMapper.xml @@ -74,49 +74,49 @@