【丽水】首页查询出、入院看病人次和人数,出院服务量分为首次服务、再次服务、专病服务
| | |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.PageUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.system.service.ISysConfigService; |
| | | import com.smartor.domain.PatMedInhosp; |
| | | import com.smartor.domain.PatMedInhospVO; |
| | | import com.smartor.domain.PatMedReq; |
| | |
| | | |
| | | @Autowired |
| | | private IPatMedOuthospService iPatMedOuthospService; |
| | | |
| | | //todo |
| | | @Autowired |
| | | private ISysConfigService configService; |
| | | |
| | | |
| | | /** |
| | | * 查询患者住院记录列表 |
| | |
| | | return success(patMedInhospService.getDeptCodeByPatId(patMedInhosp)); |
| | | } |
| | | |
| | | /** |
| | | * 查询出、入院看病人次和人数(人数分为首次服务、再次服务、专病服务) |
| | | */ |
| | | @PostMapping("/selectPatMedInhospListCount") |
| | | @ApiOperation("查询出、入院看病人次和人数") |
| | | public AjaxResult selectPatMedInhospListCount(@RequestBody PatMedReq patMedReq) { |
| | |
| | | // } |
| | | // } |
| | | |
| | | @ApiOperation("测试定时任务dealOutHospInfo") |
| | | @PostMapping("/dealOutHospInfo") |
| | | public void dealOutHospInfo() { |
| | | String config = configService.selectConfigByKey("visit.early.day"); |
| | | //出院表 |
| | | patMedInhospService.dealOutHospInfo(config); |
| | | } |
| | | } |
| | |
| | | @ApiModelProperty(value = "人数") |
| | | private Integer rs; |
| | | |
| | | /** |
| | | * 首次随访人数 |
| | | */ |
| | | @ApiModelProperty(value = "首次随访人数") |
| | | private Integer scsf; |
| | | |
| | | /** |
| | | * 再次随访人数 |
| | | */ |
| | | @ApiModelProperty(value = "再次随访人数") |
| | | private Integer zcsf; |
| | | |
| | | /** |
| | | * 专病随访人数 |
| | | */ |
| | | @ApiModelProperty(value = "专病随访人数") |
| | | private Integer zbsf; |
| | | } |
| | |
| | | <select id="selectPatMedInhospCount" parameterType="com.smartor.domain.PatMedReq" |
| | | resultType="com.smartor.domain.PatMedRes"> |
| | | SELECT SUM( rs ) AS rs, |
| | | SUM( rc ) AS rc |
| | | SUM( rc ) AS rc, |
| | | SUM( scsf ) AS scsf, |
| | | SUM( zcsf ) AS zcsf, |
| | | SUM( zbsf ) AS zbsf |
| | | FROM ( |
| | | <!-- 出院人次--> |
| | | SELECT |
| | | COUNT(1) AS rc, |
| | | 0 AS rs |
| | | 0 AS rs, |
| | | 0 AS scsf, |
| | | 0 AS zcsf, |
| | | 0 AS zbsf |
| | | FROM |
| | | pat_med_inhosp |
| | | <where> |
| | |
| | | </foreach> |
| | | </if> |
| | | </if> |
| | | |
| | | </where> |
| | | <!-- 随访服务人数 --> |
| | | union all |
| | | select |
| | | 0 AS rc, |
| | | count(1) AS rs |
| | | count(1) AS rs, |
| | | 0 AS scsf, |
| | | 0 AS zcsf, |
| | | 0 AS zbsf |
| | | FROM |
| | | service_subtask |
| | | <where> |
| | |
| | | </foreach> |
| | | </if> |
| | | </where> |
| | | <!-- 首次随访人数 --> |
| | | union all |
| | | select |
| | | 0 AS rc, |
| | | 0 AS rs, |
| | | count(1) AS scsf, |
| | | 0 AS zcsf, |
| | | 0 AS zbsf |
| | | FROM |
| | | service_subtask |
| | | <where> |
| | | del_flag = 0 |
| | | and service_type=2 |
| | | and is_visit_again = 0 |
| | | <if test="orgid != null"> |
| | | AND orgid = #{orgid} |
| | | </if> |
| | | <if test="startDate != null"> |
| | | AND date_format( visit_time, '%y%m%d' ) >= date_format( #{startDate}, '%y%m%d' ) |
| | | </if> |
| | | <if test="endDate != null"> |
| | | AND date_format( visit_time, '%y%m%d' ) <= date_format(#{endDate},'%y%m%d') |
| | | </if> |
| | | <if test="deptcodeList != null and deptcodeList.size() > 0"> |
| | | and deptcode in |
| | | <foreach collection="deptcodeList" item="deptcode" open="(" separator="," close=")"> |
| | | #{deptcode} |
| | | </foreach> |
| | | </if> |
| | | </where> |
| | | <!-- 再次随访人数 --> |
| | | union all |
| | | select |
| | | 0 AS rc, |
| | | 0 AS rs, |
| | | 0 AS scsf, |
| | | count(1) AS zcsf, |
| | | 0 AS zbsf |
| | | FROM |
| | | service_subtask |
| | | <where> |
| | | del_flag = 0 |
| | | and service_type=2 |
| | | and is_visit_again = 1 |
| | | <if test="orgid != null"> |
| | | AND orgid = #{orgid} |
| | | </if> |
| | | <if test="startDate != null"> |
| | | AND date_format( visit_time, '%y%m%d' ) >= date_format( #{startDate}, '%y%m%d' ) |
| | | </if> |
| | | <if test="endDate != null"> |
| | | AND date_format( visit_time, '%y%m%d' ) <= date_format(#{endDate},'%y%m%d') |
| | | </if> |
| | | <if test="deptcodeList != null and deptcodeList.size() > 0"> |
| | | and deptcode in |
| | | <foreach collection="deptcodeList" item="deptcode" open="(" separator="," close=")"> |
| | | #{deptcode} |
| | | </foreach> |
| | | </if> |
| | | </where> |
| | | <!-- 专病随访人数 --> |
| | | union all |
| | | select |
| | | 0 AS rc, |
| | | 0 AS rs, |
| | | 0 AS scsf, |
| | | 0 AS zcsf, |
| | | count(1) AS zbsf |
| | | FROM |
| | | service_subtask |
| | | <where> |
| | | del_flag = 0 |
| | | and service_type=13 |
| | | <if test="orgid != null"> |
| | | AND orgid = #{orgid} |
| | | </if> |
| | | <if test="startDate != null"> |
| | | AND date_format( visit_time, '%y%m%d' ) >= date_format( #{startDate}, '%y%m%d' ) |
| | | </if> |
| | | <if test="endDate != null"> |
| | | AND date_format( visit_time, '%y%m%d' ) <= date_format(#{endDate},'%y%m%d') |
| | | </if> |
| | | <if test="deptcodeList != null and deptcodeList.size() > 0"> |
| | | and deptcode in |
| | | <foreach collection="deptcodeList" item="deptcode" open="(" separator="," close=")"> |
| | | #{deptcode} |
| | | </foreach> |
| | | </if> |
| | | </where> |
| | | ) AS combined_data |
| | | </select> |
| | | |
| | | </mapper> |