修改就诊记录。
This commit is contained in:
parent
ab81503564
commit
49412f3ba1
@ -88,8 +88,8 @@ public class PatientInfoController extends BaseController {
|
||||
@PreAuthorize("@ss.hasPermi('manage:patientInfo:edit')")
|
||||
@Log(title = "患者信息", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody PatientInfo patientInfo) {
|
||||
return toAjax(patientInfoService.updatePatientInfo(patientInfo));
|
||||
public R<PatientInfo> edit(@RequestBody PatientInfo patientInfo) {
|
||||
return R.ok(patientInfoService.updatePatientInfo(patientInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -11,7 +11,6 @@ import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
/**
|
||||
* 患者就诊记录基本信息对象 patient_visit_record
|
||||
@ -92,7 +91,7 @@ public class PatientVisitRecord extends BaseEntity {
|
||||
|
||||
/** 就诊时间,格式:yyyy-MM-dd HH:mm:ss */
|
||||
@ApiModelProperty(value = "就诊时间,格式:yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
|
||||
@Excel(name = "就诊时间,格式:yyyy-MM-dd HH:mm:ss", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private LocalDateTime visitDate;
|
||||
|
||||
@ -168,15 +167,13 @@ public class PatientVisitRecord extends BaseEntity {
|
||||
|
||||
/** 入院时间 */
|
||||
@ApiModelProperty(value = "入院时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
|
||||
@Excel(name = "入院时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private LocalDateTime admissionTime;
|
||||
|
||||
/** 出院时间 */
|
||||
@ApiModelProperty(value = "出院时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
|
||||
@Excel(name = "出院时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private LocalDateTime dischargeTime;
|
||||
|
||||
|
||||
@ -5,7 +5,7 @@ import com.xinelu.common.annotation.Excel;
|
||||
import com.xinelu.common.core.domain.BaseEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.util.Date;
|
||||
import java.time.LocalDate;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
@ -43,11 +43,10 @@ public class ResidentInfo extends BaseEntity {
|
||||
@Excel(name = "家属电话")
|
||||
private String familyMemberPhone;
|
||||
|
||||
/** 出生日期,格式:yyyy-MM-dd */
|
||||
@ApiModelProperty(value = "出生日期,格式:yyyy-MM-dd")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "出生日期,格式:yyyy-MM-dd", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date birthDate;
|
||||
/** 出生日期,格式:yyyy-MM-dd */
|
||||
@ApiModelProperty(value = "出生日期,格式:yyyy-MM-dd")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private LocalDate birthDate;
|
||||
|
||||
/** 身份证号 */
|
||||
@ApiModelProperty(value = "身份证号")
|
||||
|
||||
@ -111,12 +111,12 @@ public class PatientVisitRecordSaveDto {
|
||||
|
||||
/** 入院时间 */
|
||||
@ApiModelProperty(value = "入院时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
|
||||
private LocalDateTime admissionTime;
|
||||
|
||||
/** 出院时间 */
|
||||
@ApiModelProperty(value = "出院时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
|
||||
private LocalDateTime dischargeTime;
|
||||
|
||||
/** _记录时间(入院记录) */
|
||||
|
||||
@ -41,7 +41,7 @@ public interface IPatientInfoService {
|
||||
* @param patientInfo 患者信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updatePatientInfo(PatientInfo patientInfo);
|
||||
public PatientInfo updatePatientInfo(PatientInfo patientInfo);
|
||||
|
||||
/**
|
||||
* 批量删除患者信息
|
||||
|
||||
@ -97,7 +97,7 @@ public class PatientInfoServiceImpl implements IPatientInfoService {
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updatePatientInfo(PatientInfo patientInfo) {
|
||||
public PatientInfo updatePatientInfo(PatientInfo patientInfo) {
|
||||
ResidentInfo residentInfo = new ResidentInfo();
|
||||
if (patientInfo.getResidentId() != null) {
|
||||
residentInfo = residentInfoMapper.selectResidentInfoById(patientInfo.getResidentId());
|
||||
@ -125,7 +125,8 @@ public class PatientInfoServiceImpl implements IPatientInfoService {
|
||||
patientInfo.setUpdateBy(SecurityUtils.getLoginUser().getUser().getNickName());
|
||||
patientInfo.setUpdateTime(LocalDateTime.now());
|
||||
patientInfo.setDelFlag(0);
|
||||
return patientInfoMapper.updatePatientInfo(patientInfo);
|
||||
patientInfoMapper.updatePatientInfo(patientInfo);
|
||||
return patientInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -101,11 +101,8 @@ public class PatientPreHospitalizationServiceImpl implements IPatientPreHospital
|
||||
Long patientId = patientInfo.getId();
|
||||
BeanUtils.copyBeanProp(patientInfo, preHospitalization);
|
||||
patientInfo.setId(patientId);
|
||||
int flag = patientInfoService.updatePatientInfo(patientInfo);
|
||||
if (flag >= 0) {
|
||||
return preHospitalizationMapper.updateByPrimaryKeySelective(preHospitalization);
|
||||
}
|
||||
return flag;
|
||||
patientInfoService.updatePatientInfo(patientInfo);
|
||||
return preHospitalizationMapper.updateByPrimaryKeySelective(preHospitalization);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -92,7 +92,7 @@ public class PatientVisitRecordServiceImpl implements IPatientVisitRecordService
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void insertPatientVisitRecord(PatientVisitRecordSaveDto saveDto) {
|
||||
// 根据机构id、患者身份证号判断门诊/住院号是否重复
|
||||
PatientVisitRecord patientVisitRecord = patientVisitRecordMapper.judgeRepeat(saveDto.getHospitalAgencyId(), null, saveDto.getInHospitalNumber());
|
||||
PatientVisitRecord patientVisitRecord = patientVisitRecordMapper.judgeRepeat(saveDto.getHospitalAgencyId(), saveDto.getCardNo(), saveDto.getInHospitalNumber());
|
||||
if (ObjectUtils.isNotEmpty(patientVisitRecord)) {
|
||||
throw new ServiceException("门诊/住院号重复,请确认后重新输入!");
|
||||
}
|
||||
@ -113,8 +113,9 @@ public class PatientVisitRecordServiceImpl implements IPatientVisitRecordService
|
||||
patientInfo.setDelFlag(0);
|
||||
patientInfo.setCreateBy(SecurityUtils.getLoginUser().getUser().getNickName());
|
||||
patientInfo.setCreateTime(LocalDateTime.now());
|
||||
patientInfoService.insertPatientInfo(patientInfo);
|
||||
saveBody.setPatientId(patientInfo.getId());
|
||||
PatientInfo patientSave = patientInfoService.insertPatientInfo(patientInfo);
|
||||
saveBody.setPatientId(patientSave.getId());
|
||||
saveBody.setResidentId(patientSave.getResidentId());
|
||||
} else {
|
||||
patientInfo = patientInfoList.get(0);
|
||||
Long patientId = patientInfo.getId();
|
||||
@ -163,11 +164,14 @@ public class PatientVisitRecordServiceImpl implements IPatientVisitRecordService
|
||||
}
|
||||
// 修改患者基本信息
|
||||
PatientInfo patientInfo = patientMapper.selectPatientInfoById(patientVisitRecord.getPatientId());
|
||||
Long residentId = patientInfo.getResidentId();
|
||||
setVisitDate(patientVisitRecord);
|
||||
BeanUtils.copyBeanProp(patientInfo, patientVisitRecord);
|
||||
patientInfoService.updatePatientInfo(patientInfo);
|
||||
patientInfo.setId(patientVisitRecord.getPatientId());
|
||||
patientInfo.setResidentId(residentId);
|
||||
PatientInfo afterUpd = patientInfoService.updatePatientInfo(patientInfo);
|
||||
// 修改就诊记录信息
|
||||
patientVisitRecord.setResidentId(patientInfo.getResidentId());
|
||||
patientVisitRecord.setResidentId(afterUpd.getResidentId());
|
||||
return patientVisitRecordMapper.updatePatientVisitRecord(patientVisitRecord);
|
||||
}
|
||||
|
||||
|
||||
@ -81,10 +81,10 @@
|
||||
and in_hospital_number = #{inHospitalNumber}
|
||||
</if>
|
||||
<if test="visitDateStart != null ">
|
||||
and visit_date >= #{visitDateStart}
|
||||
and date_format(visit_date,'%y%m%d') >= date_format(#{visitDateStart},'%y%m%d')
|
||||
</if>
|
||||
<if test="visitDateEnd != null ">
|
||||
and visit_date <= #{visitDateEnd}
|
||||
and date_format(visit_date,'%y%m%d') <= date_format(#{visitDateEnd},'%y%m%d')
|
||||
</if>
|
||||
</where>
|
||||
order by visit_date desc
|
||||
|
||||
Loading…
Reference in New Issue
Block a user