Merge branch '0418_小程序开发' of http://182.92.166.109:3000/zhuangyuanke/PostDischargePatientManage into 0418_小程序开发
This commit is contained in:
commit
3737124901
@ -6,7 +6,7 @@ spring:
|
||||
druid:
|
||||
# 主库数据源
|
||||
master:
|
||||
url: jdbc:mysql://192.168.16.64:3306/post-discharge?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
url: jdbc:mysql://192.168.16.64:3306/post-discharge?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&allowMultiQueries=true
|
||||
username: root
|
||||
password: 1qaz!@#$
|
||||
# 从库数据源
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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;
|
||||
}
|
||||
@ -4,9 +4,10 @@ import com.xinelu.manage.domain.labelfieldcontent.LabelFieldContent;
|
||||
import com.xinelu.manage.vo.labelfieldcontent.GroupingValue;
|
||||
import com.xinelu.manage.vo.labelfieldcontent.LabelFieldContentVO;
|
||||
import com.xinelu.manage.vo.labelfieldcontent.LabelFieldInfoContentVo;
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 标签字段内容信息Mapper接口
|
||||
*
|
||||
@ -81,7 +82,7 @@ public interface LabelFieldContentMapper {
|
||||
List<LabelFieldContentVO> selectLabelFieldContent(@Param("labelFieldIds") List<Long> labelFieldIds);
|
||||
|
||||
/**
|
||||
* 画像查询
|
||||
* 画像内容查询
|
||||
*
|
||||
* @param taskPartitionDictId 细分id
|
||||
* @param patientId 患者id
|
||||
@ -96,4 +97,20 @@ public interface LabelFieldContentMapper {
|
||||
* @return 患者标签字段列表
|
||||
*/
|
||||
List<LabelFieldInfoContentVo> selectByPatientId(Long patientId);
|
||||
|
||||
/**
|
||||
* 批量新增
|
||||
*
|
||||
* @param labelFieldContentList 标签内容
|
||||
* @return int
|
||||
*/
|
||||
int insertLabelFieldContentList(List<GroupingValue> labelFieldContentList);
|
||||
|
||||
/**
|
||||
* 批量修改 (dev.yml url &allowMultiQueries=true)
|
||||
*
|
||||
* @param labelFieldContentList 标签内容
|
||||
* @return int
|
||||
*/
|
||||
int updateContentRemarkLabelFieldContentList(List<GroupingValue> labelFieldContentList);
|
||||
}
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package com.xinelu.manage.mapper.labelfieldinfo;
|
||||
|
||||
import com.xinelu.manage.domain.labelfieldinfo.LabelFieldInfo;
|
||||
import com.xinelu.manage.vo.labelfieldcontent.GroupingValue;
|
||||
import com.xinelu.manage.vo.labelfieldinfo.LabelFieldVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
@ -86,4 +87,12 @@ public interface LabelFieldInfoMapper {
|
||||
* @return LabelFieldInfo
|
||||
*/
|
||||
List<LabelFieldInfo> taskPartitionDictIdList(String taskPartitionDictName);
|
||||
|
||||
/**
|
||||
* 查询标签
|
||||
*
|
||||
* @param taskPartitionDictId 标签
|
||||
* @return GroupingValue
|
||||
*/
|
||||
List<GroupingValue> selectLabelFieldInfoByTaskPartitionDictId(Long taskPartitionDictId);
|
||||
}
|
||||
|
||||
@ -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<PatientAllInfoView> selectPatientAllInfoListViewByPatientId(Long patientId);
|
||||
List<PatientAllInfoViewUppercase> selectPatientAllInfoListViewByPatientId(Long patientId);
|
||||
}
|
||||
|
||||
@ -84,5 +84,11 @@ public interface ILabelFieldContentService {
|
||||
*/
|
||||
List<List<GroupingValue>> groupingValue(Long taskPartitionDictId, Long patientId);
|
||||
|
||||
/**
|
||||
* 画像内容新增
|
||||
*
|
||||
* @param labelField 画像信息
|
||||
* @return AjaxResult
|
||||
*/
|
||||
AjaxResult insertLabelField(LabelField labelField);
|
||||
}
|
||||
|
||||
@ -10,30 +10,28 @@ 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;
|
||||
import com.xinelu.manage.mapper.labelfieldinfo.LabelFieldInfoMapper;
|
||||
import com.xinelu.manage.mapper.patientinfo.PatientAllInfoViewMapper;
|
||||
import com.xinelu.manage.mapper.patientinfo.PatientInfoMapper;
|
||||
import com.xinelu.manage.mapper.signpatientmanageroute.SignPatientManageRouteMapper;
|
||||
import com.xinelu.manage.mapper.signpatientmanageroutenode.SignPatientManageRouteNodeMapper;
|
||||
import com.xinelu.manage.mapper.specialdiseasenode.SpecialDiseaseNodeMapper;
|
||||
import com.xinelu.manage.mapper.taskpartitiondict.TaskPartitionDictMapper;
|
||||
import com.xinelu.manage.service.labelfieldcontent.ILabelFieldContentService;
|
||||
import com.xinelu.manage.vo.labelfieldcontent.GroupingValue;
|
||||
import com.xinelu.manage.vo.labelfieldcontent.LabelField;
|
||||
import com.xinelu.manage.vo.labelfieldcontent.LabelFieldContentVO;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
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.*;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@ -199,35 +197,88 @@ public class LabelFieldContentServiceImpl implements ILabelFieldContentService {
|
||||
return new ArrayList<>(collect.values());
|
||||
}
|
||||
//查询未维护标签及从患者表取值
|
||||
List<GroupingValue> labelFieldContentList = labelFieldContentMapper.groupingValue(taskPartitionDictId, null, null);
|
||||
List<GroupingValue> labelFieldContentList = labelFieldInfoMapper.selectLabelFieldInfoByTaskPartitionDictId(taskPartitionDictId);
|
||||
JSONObject paramsValue = getParamsValue(patientId);
|
||||
if (CollectionUtils.isEmpty(labelFieldContentList)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
for (GroupingValue groupingValue : labelFieldContentList) {
|
||||
//获取不同的文件路径
|
||||
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;
|
||||
//取属性名
|
||||
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<String> strings1 = Arrays.asList(strings);
|
||||
for (GroupingValue groupingValue : labelFieldContentList) {
|
||||
groupingValue.setPatientId(patientId);
|
||||
String s = strings1.stream().filter(Objects::nonNull).filter(item -> item.equals(groupingValue.getFieldCode())).findFirst().orElse(new String());
|
||||
groupingValue.setFieldValue(paramsValue.getOrDefault(s, "").toString());
|
||||
}
|
||||
List<List<GroupingValue>> lists = new ArrayList<>();
|
||||
lists.add(labelFieldContentList);
|
||||
return lists;
|
||||
}
|
||||
|
||||
/**
|
||||
* 画像内容新增
|
||||
*
|
||||
* @param labelField 画像信息
|
||||
* @return AjaxResult
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public AjaxResult insertLabelField(LabelField labelField) {
|
||||
if (CollectionUtils.isEmpty(labelField.getGroupingValues())) {
|
||||
return AjaxResult.success();
|
||||
}
|
||||
List<GroupingValue> groupingValues = new ArrayList<>();
|
||||
try {
|
||||
for (List<GroupingValue> groupingValue : labelField.getGroupingValues()) {
|
||||
if (StringUtils.isBlank(groupingValue.get(0).getPortraitSn())) {
|
||||
String portraitSn = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmssSSS"));
|
||||
groupingValue.forEach(item -> item.setPortraitSn(portraitSn));
|
||||
}
|
||||
groupingValues.addAll(groupingValue);
|
||||
TimeUnit.MILLISECONDS.sleep(10);
|
||||
}
|
||||
} catch (InterruptedException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
List<GroupingValue> updateGroupingValues = new ArrayList<>();
|
||||
List<GroupingValue> insertGroupingValues = new ArrayList<>();
|
||||
//传入标签ids
|
||||
List<Long> afferentLabelFieldInfoIds = groupingValues.stream().filter(Objects::nonNull).map(GroupingValue::getLabelFieldInfoId).filter(Objects::nonNull).collect(Collectors.toList());
|
||||
//传入标签内容ids
|
||||
List<Long> afferentLabelFieldContentIds = groupingValues.stream().filter(Objects::nonNull).map(GroupingValue::getLabelFieldContentId).filter(Objects::nonNull).collect(Collectors.toList());
|
||||
//数据库标签内容ids
|
||||
List<LabelFieldContentVO> databaseLabelFieldContents = labelFieldContentMapper.selectLabelFieldContent(afferentLabelFieldInfoIds);
|
||||
List<Long> databaseLabelFieldContentIds = databaseLabelFieldContents.stream().filter(Objects::nonNull).map(LabelFieldContentVO::getLabelFieldContentId).filter(Objects::nonNull).collect(Collectors.toList());
|
||||
//做差集
|
||||
List<Long> subtractLabelFieldContentIds = (List<Long>) CollectionUtils.subtract(databaseLabelFieldContentIds, afferentLabelFieldContentIds);
|
||||
if (CollectionUtils.isNotEmpty(subtractLabelFieldContentIds)) {
|
||||
labelFieldContentMapper.deleteLabelFieldContentByIds(subtractLabelFieldContentIds.toArray(new Long[0]));
|
||||
}
|
||||
for (GroupingValue groupingValue : groupingValues) {
|
||||
groupingValue.setFieldId(groupingValue.getLabelFieldInfoId());
|
||||
if (Objects.isNull(groupingValue.getLabelFieldContentId())) {
|
||||
groupingValue.setCreateBy(SecurityUtils.getUsername());
|
||||
groupingValue.setCreateTime(LocalDateTime.now());
|
||||
insertGroupingValues.add(groupingValue);
|
||||
}
|
||||
if (Objects.nonNull(groupingValue.getLabelFieldContentId())) {
|
||||
groupingValue.setCreateTime(LocalDateTime.now());
|
||||
groupingValue.setCreateBy(SecurityUtils.getUsername());
|
||||
updateGroupingValues.add(groupingValue);
|
||||
}
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(insertGroupingValues)) {
|
||||
int insert = labelFieldContentMapper.insertLabelFieldContentList(insertGroupingValues);
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(updateGroupingValues)) {
|
||||
int update = labelFieldContentMapper.updateContentRemarkLabelFieldContentList(updateGroupingValues);
|
||||
}
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -238,19 +289,14 @@ public class LabelFieldContentServiceImpl implements ILabelFieldContentService {
|
||||
*/
|
||||
private JSONObject getParamsValue(Long patientId) {
|
||||
JSONObject retObj;
|
||||
List<PatientAllInfoView> patientAllInfoViews = patientAllInfoViewMapper.selectPatientAllInfoListViewByPatientId(patientId);
|
||||
List<PatientAllInfoViewUppercase> 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;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult insertLabelField(LabelField labelField) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,10 +1,8 @@
|
||||
package com.xinelu.manage.service.labelfieldinfo.impl;
|
||||
|
||||
import com.xinelu.common.constant.Constants;
|
||||
import com.xinelu.common.core.domain.AjaxResult;
|
||||
import com.xinelu.common.exception.ServiceException;
|
||||
import com.xinelu.common.utils.SecurityUtils;
|
||||
import com.xinelu.common.utils.codes.GenerateSystemCodeUtil;
|
||||
import com.xinelu.manage.domain.labelfieldinfo.LabelFieldInfo;
|
||||
import com.xinelu.manage.dto.labelfieldinfo.LabelFieldInfoAddDTO;
|
||||
import com.xinelu.manage.mapper.labelfieldcontent.LabelFieldContentMapper;
|
||||
@ -20,7 +18,6 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
import javax.annotation.Resource;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@ -35,9 +32,6 @@ public class LabelFieldInfoServiceImpl implements ILabelFieldInfoService {
|
||||
@Resource
|
||||
private LabelFieldInfoMapper labelFieldInfoMapper;
|
||||
|
||||
@Resource
|
||||
private GenerateSystemCodeUtil systemCodeUtil;
|
||||
|
||||
@Resource
|
||||
private LabelFieldContentMapper labelFieldContentMapper;
|
||||
|
||||
@ -110,10 +104,6 @@ public class LabelFieldInfoServiceImpl implements ILabelFieldInfoService {
|
||||
if (ObjectUtils.isEmpty(fieldInfo)) {
|
||||
throw new ServiceException("当前标签信息不存在,无法修改,请联系管理员");
|
||||
}
|
||||
// 检查除当前记录外有没有重复的标签信息名称
|
||||
if (labelFieldInfoMapper.countByFieldNameExcludingId(labelFieldInfo.getId(), labelFieldInfo.getFieldType(), labelFieldInfo.getFieldName()) > 0) {
|
||||
throw new ServiceException("当前字段类型下字段名称已存在");
|
||||
}
|
||||
// 执行修改操作
|
||||
labelFieldInfo.setUpdateBy(SecurityUtils.getUsername());
|
||||
labelFieldInfo.setUpdateTime(LocalDateTime.now());
|
||||
@ -155,7 +145,6 @@ public class LabelFieldInfoServiceImpl implements ILabelFieldInfoService {
|
||||
}
|
||||
// 如果不存在,执行新增操作
|
||||
for (LabelFieldInfo labelFieldInfo : fieldInfoList) {
|
||||
labelFieldInfo.setFieldCode(Constants.FIELD_ENCODING + systemCodeUtil.generateDepartCode(Constants.FIELD_ENCODING));
|
||||
labelFieldInfo.setCreateBy(SecurityUtils.getUsername());
|
||||
labelFieldInfo.setCreateTime(LocalDateTime.now());
|
||||
if (labelFieldInfoMapper.insertLabelFieldInfo(labelFieldInfo) <= 0) {
|
||||
|
||||
@ -7,5 +7,5 @@ import java.util.List;
|
||||
@Data
|
||||
public class LabelField {
|
||||
|
||||
private List<GroupingValue> groupingValues;
|
||||
private List<List<GroupingValue>> groupingValues;
|
||||
}
|
||||
|
||||
@ -246,6 +246,7 @@
|
||||
lfi.task_type_name,
|
||||
lfc.id labelFieldContentId,
|
||||
lfc.field_id,
|
||||
lfc.patient_id,
|
||||
lfc.field_name,
|
||||
lfc.field_code,
|
||||
lfc.field_value,
|
||||
@ -279,4 +280,72 @@
|
||||
from label_field_content content left join label_field_info info on content.field_id = info.id
|
||||
where content.patient_id = #{patientId} and content.portrait_status='INUSE'
|
||||
</select>
|
||||
|
||||
<insert id="insertLabelFieldContentList">
|
||||
insert into label_field_content(
|
||||
field_id,
|
||||
field_name,
|
||||
field_code,
|
||||
field_value,
|
||||
portrait_sn,
|
||||
patient_id,
|
||||
portrait_status,
|
||||
content_sort,
|
||||
content_remark,
|
||||
create_by,
|
||||
create_time
|
||||
)
|
||||
values
|
||||
<foreach item="GroupingValue" index="index" collection="list" separator=",">
|
||||
(
|
||||
#{GroupingValue.fieldId},
|
||||
#{GroupingValue.fieldName},
|
||||
#{GroupingValue.fieldCode},
|
||||
#{GroupingValue.fieldValue},
|
||||
#{GroupingValue.portraitSn},
|
||||
#{GroupingValue.patientId},
|
||||
#{GroupingValue.portraitStatus},
|
||||
#{GroupingValue.contentSort},
|
||||
#{GroupingValue.contentRemark},
|
||||
#{GroupingValue.createBy},
|
||||
#{GroupingValue.createTime}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<update id="updateContentRemarkLabelFieldContentList">
|
||||
<foreach collection="list" item="labelFieldContentList" index="index" open="" close="" separator=";">
|
||||
update label_field_content
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="labelFieldContentList.fieldId != null">field_id =
|
||||
#{labelFieldContentList.fieldId},
|
||||
</if>
|
||||
<if test="labelFieldContentList.fieldName != null">field_name =
|
||||
#{labelFieldContentList.fieldName},
|
||||
</if>
|
||||
<if test="labelFieldContentList.fieldCode != null">field_code =
|
||||
#{labelFieldContentList.fieldCode},
|
||||
</if>
|
||||
<if test="labelFieldContentList.fieldValue != null">field_value =
|
||||
#{labelFieldContentList.fieldValue},
|
||||
</if>
|
||||
<if test="labelFieldContentList.portraitSn != null">portrait_sn =
|
||||
#{labelFieldContentList.portraitSn},
|
||||
</if>
|
||||
<if test="labelFieldContentList.patientId != null">patient_id =
|
||||
#{labelFieldContentList.patientId},
|
||||
</if>
|
||||
<if test="labelFieldContentList.portraitStatus != null">portrait_status =
|
||||
#{labelFieldContentList.portraitStatus},
|
||||
</if>
|
||||
<if test="labelFieldContentList.updateBy != null">update_by =
|
||||
#{labelFieldContentList.updateBy},
|
||||
</if>
|
||||
<if test="labelFieldContentList.updateTime != null">update_time =
|
||||
#{labelFieldContentList.updateTime},
|
||||
</if>
|
||||
</trim>
|
||||
where id = #{labelFieldContentList.labelFieldContentId}
|
||||
</foreach>
|
||||
</update>
|
||||
</mapper>
|
||||
@ -225,4 +225,27 @@
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectLabelFieldInfoByTaskPartitionDictId"
|
||||
resultType="com.xinelu.manage.vo.labelfieldcontent.GroupingValue">
|
||||
select id labelFieldInfoId,
|
||||
field_name,
|
||||
field_code,
|
||||
field_type,
|
||||
field_sort,
|
||||
field_remark,
|
||||
task_partition_dict_id,
|
||||
task_partition_dict_name,
|
||||
task_type_id,
|
||||
task_type_name
|
||||
from label_field_info
|
||||
<where>
|
||||
<if test="taskPartitionDictId != null and taskPartitionDictId != 0">
|
||||
and task_partition_dict_id = #{taskPartitionDictId}
|
||||
</if>
|
||||
<if test="taskPartitionDictId == null">
|
||||
and task_partition_dict_id is null
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
@ -74,49 +74,49 @@
|
||||
</select>
|
||||
|
||||
<select id="selectPatientAllInfoListViewByPatientId"
|
||||
resultType="com.xinelu.manage.domain.patientinfo.PatientAllInfoView">
|
||||
select paiv.patient_id,
|
||||
paiv.patient_name,
|
||||
paiv.patient_phone,
|
||||
paiv.family_member_phone,
|
||||
paiv.birth_date,
|
||||
paiv.card_no,
|
||||
paiv.sex,
|
||||
paiv.address,
|
||||
paiv.patient_type,
|
||||
paiv.patient_visit_record_id,
|
||||
paiv.visit_method,
|
||||
paiv.visit_date,
|
||||
paiv.hospital_agency_name,
|
||||
paiv.campus_agency_name,
|
||||
paiv.department_name,
|
||||
paiv.ward_name,
|
||||
paiv.attending_physician_name,
|
||||
paiv.main_diagnosis,
|
||||
paiv.admission_time,
|
||||
paiv.discharge_time,
|
||||
paiv.hospitalization_days,
|
||||
paiv.in_hospital_info,
|
||||
paiv.out_hospital_info,
|
||||
paiv.visit_serial_number,
|
||||
paiv.in_hospital_number,
|
||||
paiv.responsible_nurse,
|
||||
paiv.surgical_name,
|
||||
paiv.surgical_record,
|
||||
paiv.sign_patient_record_id,
|
||||
paiv.payment_status,
|
||||
paiv.health_manage_name,
|
||||
paiv.service_status,
|
||||
paiv.sign_status,
|
||||
paiv.billing_doctor_name,
|
||||
paiv.sign_time,
|
||||
paiv.package_name,
|
||||
paiv.package_payment_status,
|
||||
paiv.package_price,
|
||||
paiv.service_start_time,
|
||||
paiv.service_end_time,
|
||||
paiv.package_term,
|
||||
paiv.package_term_unit
|
||||
resultType="com.xinelu.manage.domain.patientinfo.PatientAllInfoViewUppercase">
|
||||
select paiv.patient_id PATIENTID,
|
||||
paiv.patient_name PATIENTNAME,
|
||||
paiv.patient_phone PATIENTPHONE,
|
||||
paiv.family_member_phone FAMILYMEMBERPHONE,
|
||||
paiv.birth_date BIRTHDATE,
|
||||
paiv.card_no CARDNO,
|
||||
paiv.sex SEX,
|
||||
paiv.address ADDRESS,
|
||||
paiv.patient_type PATIENTTYPE,
|
||||
paiv.patient_visit_record_id PATIENTVISITRECORDID,
|
||||
paiv.visit_method VISITMETHOD,
|
||||
paiv.visit_date VISITDATE,
|
||||
paiv.hospital_agency_name HOSPITALAGENCYNAME,
|
||||
paiv.campus_agency_name CAMPUSAGENCYNAME,
|
||||
paiv.department_name DEPARTMENTNAME,
|
||||
paiv.ward_name WARDNAME,
|
||||
paiv.attending_physician_name ATTENDINGPHYSICIANNAME,
|
||||
paiv.main_diagnosis MAINDIAGNOSIS,
|
||||
paiv.admission_time ADMISSIONTIME,
|
||||
paiv.discharge_time DISCHARGETIME,
|
||||
paiv.hospitalization_days HOSPITALIZATIONDAYS,
|
||||
paiv.in_hospital_info INHOSPITALINFO,
|
||||
paiv.out_hospital_info OUTHOSPITALINFO,
|
||||
paiv.visit_serial_number VISITSERIALNUMBER,
|
||||
paiv.in_hospital_number INHOSPITALNUMBER,
|
||||
paiv.responsible_nurse RESPONSIBLENURSE,
|
||||
paiv.surgical_name SURGICALNAME,
|
||||
paiv.surgical_record SURGICALRECORD,
|
||||
paiv.sign_patient_record_id SIGNPATIENTRECORDID,
|
||||
paiv.payment_status PAYMENTSTATUS,
|
||||
paiv.health_manage_name HEALTHMANAGENAME,
|
||||
paiv.service_status SERVICESTATUS,
|
||||
paiv.sign_status SIGNSTATUS,
|
||||
paiv.billing_doctor_name BILLINGDOCTORNAME,
|
||||
paiv.sign_time SIGNTIME,
|
||||
paiv.package_name PACKAGENAME,
|
||||
paiv.package_payment_status PACKAGEPAYMENTSTATUS,
|
||||
paiv.package_price PACKAGEPRICE,
|
||||
paiv.service_start_time SERVICESTARTTIME,
|
||||
paiv.service_end_time SERVICEENDTIME,
|
||||
paiv.package_term PACKAGETERM,
|
||||
paiv.package_term_unit PACKAGETERMUNIT
|
||||
from patient_all_info_view paiv
|
||||
left join patient_info pi ON pi.id = paiv.patient_id
|
||||
where paiv.patient_id = #{patientId}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user