健康档案主页以及详情页接口实现 add by gqk 2024/04/17 14:43
This commit is contained in:
parent
c7e7425ba5
commit
17cfbd31d8
@ -1,6 +1,10 @@
|
||||
package com.xinelu.mobile.controller.appletpersoncenter;
|
||||
|
||||
import com.xinelu.common.core.controller.BaseController;
|
||||
import com.xinelu.common.core.domain.AjaxResult;
|
||||
import com.xinelu.common.core.page.TableDataInfo;
|
||||
import com.xinelu.manage.service.patientinfo.IPatientInfoService;
|
||||
import com.xinelu.mobile.dto.appletpersoncenter.HealthRecordDTO;
|
||||
import com.xinelu.mobile.service.appletpersoncenter.AppletPersonCenterService;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@ -9,6 +13,7 @@ import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description 院后小程序个人中心控制器
|
||||
@ -18,10 +23,12 @@ import javax.annotation.Resource;
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/postDischargeApplet")
|
||||
public class AppletPersonCenterController {
|
||||
public class AppletPersonCenterController extends BaseController {
|
||||
|
||||
@Resource
|
||||
private AppletPersonCenterService appletPersonCenterService;
|
||||
@Resource
|
||||
private IPatientInfoService patientInfoService;
|
||||
|
||||
/**
|
||||
* 院后微信小程序一键登录接口
|
||||
@ -52,8 +59,28 @@ public class AppletPersonCenterController {
|
||||
return appletPersonCenterService.getResidentInfoById(residentId);
|
||||
}
|
||||
|
||||
@GetMapping("/test")
|
||||
public void test() {
|
||||
appletPersonCenterService.test();
|
||||
/**
|
||||
* 根据居民表id查询患者健康档案信息
|
||||
*
|
||||
* @param residentId
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getHealthRecordListByResidentId")
|
||||
public TableDataInfo getHealthRecordListById(Long residentId) {
|
||||
startPage();
|
||||
List<HealthRecordDTO> list = appletPersonCenterService.getHealthRecordListByResidentId(residentId);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id获取患者患者健康档案信息
|
||||
*
|
||||
* @param id
|
||||
* @return PatientInfo
|
||||
*/
|
||||
@GetMapping("/getHealthRecordInfoById")
|
||||
public AjaxResult getPatientInfoById(Long id) {
|
||||
return AjaxResult.success(appletPersonCenterService.getHealthRecordInfoById(id));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,32 @@
|
||||
package com.xinelu.mobile.dto.appletpersoncenter;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @author xinelu
|
||||
* @date 2024/4/17
|
||||
* @apiNote 健康档案主页面信息
|
||||
*/
|
||||
@Data
|
||||
public class HealthRecordDTO {
|
||||
|
||||
/**
|
||||
* 患者id
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
* 就诊医院
|
||||
*/
|
||||
private String hospitalAgencyName;
|
||||
/**
|
||||
* 就诊科室
|
||||
*/
|
||||
private String departmentName;
|
||||
/**
|
||||
* 就诊时间
|
||||
*/
|
||||
|
||||
private LocalDateTime visitDate;
|
||||
}
|
||||
@ -0,0 +1,67 @@
|
||||
package com.xinelu.mobile.dto.appletpersoncenter;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @author xinelu
|
||||
* @date 2024/4/17
|
||||
* @apiNote 健康档案详情页面
|
||||
*/
|
||||
@Data
|
||||
public class HealthRecordInfoDTO {
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
* 年龄
|
||||
*/
|
||||
private Long age;
|
||||
/**
|
||||
* 出生日期
|
||||
*/
|
||||
private LocalDateTime birthDate;
|
||||
/**
|
||||
* 患者姓名
|
||||
*/
|
||||
private String patientName;
|
||||
/**
|
||||
* 患者电话
|
||||
*/
|
||||
private String patientPhone;
|
||||
/**
|
||||
* 家属电话
|
||||
*/
|
||||
private String familyMemberPhone;
|
||||
/**
|
||||
* 身份证号
|
||||
*/
|
||||
private String cardNo;
|
||||
/**
|
||||
* 是否签约
|
||||
*/
|
||||
private String signStatus;
|
||||
/**
|
||||
* 签约时间
|
||||
*/
|
||||
private LocalDateTime signTime;
|
||||
/**
|
||||
* 主治医生
|
||||
*/
|
||||
private String attendingPhysicianName;
|
||||
/**
|
||||
* 就诊医院
|
||||
*/
|
||||
private String hospitalAgencyName;
|
||||
/**
|
||||
* 就诊时间
|
||||
*/
|
||||
private LocalDateTime visitDate;
|
||||
/**
|
||||
* 就诊科室
|
||||
*/
|
||||
private String departmentName;
|
||||
|
||||
}
|
||||
@ -1,6 +1,9 @@
|
||||
package com.xinelu.mobile.mapper.appletpersoncenter;
|
||||
|
||||
import com.xinelu.manage.domain.residentinfo.ResidentInfo;
|
||||
import com.xinelu.mobile.dto.appletpersoncenter.HealthRecordDTO;
|
||||
import com.xinelu.mobile.dto.appletpersoncenter.HealthRecordInfoDTO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description 院后小程序个人中心Mapper层
|
||||
@ -9,10 +12,20 @@ import com.xinelu.manage.domain.residentinfo.ResidentInfo;
|
||||
* @Version 1.0
|
||||
*/
|
||||
public interface AppletPersonCenterMapper {
|
||||
|
||||
/**
|
||||
* 查询居民信息
|
||||
* 根据居民表id查询患者健康档案信息
|
||||
*
|
||||
* @return 居民信息
|
||||
* @param residentID
|
||||
* @return
|
||||
*/
|
||||
ResidentInfo selectResidentInfoTwo();
|
||||
List<HealthRecordDTO> getHealthRecordListByResidentID(Long residentID);
|
||||
|
||||
/**
|
||||
* 根绝id获取患者蒋康档案详细信息
|
||||
* @param id
|
||||
* @return 健康档案详细信息
|
||||
*/
|
||||
|
||||
HealthRecordInfoDTO getHealthRecordInfoById(Long id);
|
||||
}
|
||||
|
||||
@ -1,6 +1,10 @@
|
||||
package com.xinelu.mobile.service.appletpersoncenter;
|
||||
|
||||
import com.xinelu.common.core.domain.AjaxResult;
|
||||
import com.xinelu.mobile.dto.appletpersoncenter.HealthRecordDTO;
|
||||
import com.xinelu.mobile.dto.appletpersoncenter.HealthRecordInfoDTO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description 院后小程序个人中心业务层
|
||||
@ -27,5 +31,21 @@ public interface AppletPersonCenterService {
|
||||
*/
|
||||
AjaxResult getResidentInfoById(Long residentId);
|
||||
|
||||
void test();
|
||||
|
||||
|
||||
/**
|
||||
* 根据居民表id查询患者健康档案信息
|
||||
*
|
||||
* @param residentId
|
||||
* @return 列表信息
|
||||
*/
|
||||
List<HealthRecordDTO> getHealthRecordListByResidentId(Long residentId);
|
||||
|
||||
/**
|
||||
* 根绝id获取患者健康档案详细信息
|
||||
* @param id
|
||||
* @return 监控档案详细信息
|
||||
*/
|
||||
|
||||
HealthRecordInfoDTO getHealthRecordInfoById(Long id);
|
||||
}
|
||||
|
||||
@ -5,6 +5,8 @@ import com.xinelu.common.constant.Constants;
|
||||
import com.xinelu.common.core.domain.AjaxResult;
|
||||
import com.xinelu.manage.domain.residentinfo.ResidentInfo;
|
||||
import com.xinelu.manage.mapper.residentinfo.ResidentInfoMapper;
|
||||
import com.xinelu.mobile.dto.appletpersoncenter.HealthRecordDTO;
|
||||
import com.xinelu.mobile.dto.appletpersoncenter.HealthRecordInfoDTO;
|
||||
import com.xinelu.mobile.mapper.appletpersoncenter.AppletPersonCenterMapper;
|
||||
import com.xinelu.mobile.service.appletpersoncenter.AppletPersonCenterService;
|
||||
import com.xinelu.mobile.utils.WeChatAppletUtils;
|
||||
@ -17,6 +19,7 @@ import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
@ -124,8 +127,34 @@ public class AppletPersonCenterServiceImpl implements AppletPersonCenterService
|
||||
return AjaxResult.success(residentInfoMapper.selectResidentInfoById(residentId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据居民表id查询患者健康档案信息
|
||||
*
|
||||
* @param residentId
|
||||
* @return 健康档案列表
|
||||
*/
|
||||
@Override
|
||||
public void test() {
|
||||
appletPersonCenterMapper.selectResidentInfoTwo();
|
||||
public List<HealthRecordDTO> getHealthRecordListByResidentId(Long residentId) {
|
||||
return appletPersonCenterMapper.getHealthRecordListByResidentID(residentId);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id获取患者患者健康档案信息
|
||||
*
|
||||
* @param id
|
||||
* @return PatientInfo
|
||||
*/
|
||||
@Override
|
||||
public HealthRecordInfoDTO getHealthRecordInfoById(Long id) {
|
||||
HealthRecordInfoDTO healthRecordInfoDTO = appletPersonCenterMapper.getHealthRecordInfoById(id);
|
||||
//签约状态,未签约:UN_SIGN,在签:IN_SIGN,解约:SEPARATE_SIGN
|
||||
if (StringUtils.equals(healthRecordInfoDTO.getSignStatus(), "UN_SIGN") || StringUtils.equals(healthRecordInfoDTO.getSignStatus(), "SEPARATE_SIGN")) {
|
||||
healthRecordInfoDTO.setSignStatus("否");
|
||||
} else if (StringUtils.equals(healthRecordInfoDTO.getSignStatus(), "IN_SIGN")) {
|
||||
healthRecordInfoDTO.setSignStatus("是");
|
||||
}
|
||||
|
||||
return healthRecordInfoDTO;
|
||||
}
|
||||
}
|
||||
|
||||
@ -4,7 +4,50 @@
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.xinelu.mobile.mapper.appletpersoncenter.AppletPersonCenterMapper">
|
||||
|
||||
<select id="selectResidentInfoTwo" resultType="residentInfo">
|
||||
select id, patient_name, patient_phone from resident_info limit 1
|
||||
<resultMap id="HealthRecordResult" type="com.xinelu.mobile.dto.appletpersoncenter.HealthRecordDTO">
|
||||
<result property="id" column="id"/>
|
||||
<result property="hospitalAgencyName" column="hospital_agency_name"/>
|
||||
<result property="departmentName" column="department_name"/>
|
||||
<result property="visitDate" column="visit_date"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="HealthRecordInfo" type="com.xinelu.mobile.dto.appletpersoncenter.HealthRecordInfoDTO">
|
||||
<result property="id" column="id"/>
|
||||
<result property="age" column="age"/>
|
||||
<result property="birthDate" column="birth_date"/>
|
||||
<result property="patientName" column="patient_name"/>
|
||||
<result property="patientPhone" column="patient_phone"/>
|
||||
<result property="familyMemberPhone" column="family_member_phone"/>
|
||||
<result property="cardNo" column="card_no"/>
|
||||
<result property="signStatus" column="sign_status"/>
|
||||
<result property="attendingPhysicianName" column="attending_physician_name"/>
|
||||
<result property="hospitalAgencyName" column="hospital_agency_name"/>
|
||||
<result property="visitDate" column="visit_date"/>
|
||||
<result property="departmentName" column="department_name"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
<select id="getHealthRecordListByResidentID" parameterType="long" resultMap="HealthRecordResult">
|
||||
select id, hospital_agency_name, department_name, visit_date
|
||||
from patient_info
|
||||
where resident_id = #{residentID}
|
||||
</select>
|
||||
|
||||
<select id="getHealthRecordInfoById" parameterType="long" resultMap="HealthRecordInfo">
|
||||
select id,
|
||||
TIMESTAMPDIFF(YEAR, birth_date, CURDATE()) AS age,
|
||||
birth_date,
|
||||
patient_name,
|
||||
patient_phone,
|
||||
family_member_phone,
|
||||
card_no,
|
||||
sign_status,
|
||||
sign_time,
|
||||
attending_physician_name,
|
||||
hospital_agency_name,
|
||||
visit_date,
|
||||
department_name
|
||||
from patient_info
|
||||
where id = #{id}
|
||||
</select>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue
Block a user