JAVA全系列 教程
3762个小节阅读:7089k
C语言快速入门
JAVA全系列 教程
面向对象的程序设计语言
Python全系列 教程
Python3.x版本,未来主流的版本
人工智能 教程
顺势而为,AI创新未来
大厂算法 教程
算法,程序员自我提升必经之路
C++ 教程
一门通用计算机编程语言
微服务 教程
目前业界流行的框架组合
web前端全系列 教程
通向WEB技术世界的钥匙
大数据全系列 教程
站在云端操控万千数据
AIGC全能工具班
A A
White Night
参数名称 | 备注 |
---|---|
scheudlingType | 挂号类型 1 2 |
xxxxxxxxxx
/**
* 查询就诊中的挂号信息
* GET/doctor/care/queryVisitingRegistration/{scheudlingType}
*/
"queryVisitingRegistration/{scheudlingType}") (
public AjaxResult queryVisitingRegistration( String scheudlingType){
//得到当前用户的部门ID
Long deptId= ShiroSecurityUtils.getCurrentUser().getDeptId();
//设置要查询的状态 只能是挂号单的待就诊的挂号信息
String regStatus= Constants.REG_STATUS_2;
//计算时段
// String subsectionType= HisDateUtils.getCurrentTimeType();
//查询
Long userId=ShiroSecurityUtils.getCurrentUser().getUserId();
List<Registration> list=this.registrationService.queryRegistration(deptId,null,scheudlingType,regStatus,userId);
return AjaxResult.success(list);
}
就诊中/doctor/care/queryVisitingRegistration/{scheudlingType}
参数名称 | 备注 |
---|---|
scheudlingType | 挂号类型 1 2 |
返回JSON
名称 | 类型 | 其他信息 |
---|---|---|
msg | String | |
code | int | |
data | Object [] | item 类型: object |
├─ regId | String | |
├─ patientId | String | |
├─ patientName | String | |
├─ deptId | int | |
├─ regItemId | int | |
├─ regItemAmount | int | |
├─ regNumber | int | |
├─ regStatus | String | |
├─ visitDate | String | |
├─ schedulingType | String | |
├─ subsectionType | String | |
├─ createTime | String | |
├─ updateTime | String | |
├─ createBy | String |
创建CareHistory、CareOrderDto、CareOrderItem
创建CareHistoryMapper、CareHistoryMapper.xml、CareOrderMapper、CareOrderMapper.xml、CareOrderItemMapper、CareOrderItemMapper.xml
创建CareOrderService
xxxxxxxxxx
package com.bjsxt.service;
import com.bjsxt.domain.CareHistory;
import java.util.List;
/**
*
* 就诊相关的接口
*/
public interface CareService {
/**
* 根据患者 ID 查询历史病历
* @param patientId
* @return
*/
List<CareHistory> queryCareHistoryByPatientId(String patientId);
}
xxxxxxxxxx
package com.bjsxt.service.impl;
import ...
/**
*
*/
public class CareServiceImpl implements CareService {
private CareHistoryMapper careHistoryMapper;
public List<CareHistory> queryCareHistoryByPatientId(String patientId) {
QueryWrapper<CareHistory> qw = new QueryWrapper<>();
qw.eq(CareHistory.COL_PATIENT_ID, patientId);
return this.careHistoryMapper.selectList(qw);
}
}
修改RegistrationService,增加按条件查询挂号单
xxxxxxxxxx
/**
* 根据条件查询挂号信息
* @param deptId 部门
* @param subsectionType 时段
* @param scheudlingType 类型 门诊 急诊
* @param regStatus 挂号单状态
* @param userId 医生ID
* @return
*/
public List<Registration> queryRegistration(Long deptId, String subsectionType, String scheudlingType, String regStatus, Long userId) {
QueryWrapper<Registration> qw=new QueryWrapper<>();
qw.eq(Registration.COL_DEPT_ID,deptId);
qw.eq(StringUtils.isNotBlank(subsectionType),
Registration.COL_SUBSECTION_TYPE,subsectionType);
qw.eq(Registration.COL_SCHEDULING_TYPE,scheudlingType);
qw.eq(Registration.COL_REG_STATUS,regStatus);
qw.eq(Registration.COL_VISIT_DATE,DateUtil.format(DateUtil.date(),"yyyy-MM-dd"));
qw.eq(null!=userId,Registration.COL_USER_ID,userId);
qw.orderByAsc(Registration.COL_REG_NUMBER);
return this.registrationMapper.selectList(qw);
}
xxxxxxxxxx
package com.bjsxt.controller.doctor;
import ...
/**
*
* @Description: 新开就诊控制器
*/
"doctor/care") (
public class CareController {
private RegistrationService registrationService;
private PatientService patientService;
private CareService careService;
private DeptService deptService;
/**
* 查询待就诊的挂号信息
* GET/doctor/care/queryToBeSeenRegistration/{scheudlingType}
*/
"queryToBeSeenRegistration/{scheudlingType}") (
public AjaxResult queryToBeSeenRegistration( String scheudlingType){
//得到当前用户的部门ID
Long deptId= ShiroSecurityUtils.getCurrentUser().getDeptId();
//设置要查询的状态 只能是挂号单的待就诊的挂号信息
String regStatus= Constants.REG_STATUS_1;
//计算时段
String subsectionType= HisDateUtils.getCurrentTimeType();
//查询
Long userId=null;
List<Registration> list=this.registrationService
.queryRegistration(deptId,subsectionType, scheudlingType,regStatus,userId);
return AjaxResult.success(list);
}
/**
* 查询就诊中的挂号信息
* GET/doctor/care/queryVisitingRegistration/{scheudlingType}
*/
"queryVisitingRegistration/{scheudlingType}") (
public AjaxResult queryVisitingRegistration( String scheudlingType){
//得到当前用户的部门ID
Long deptId= ShiroSecurityUtils.getCurrentUser().getDeptId();
//设置要查询的状态 只能是挂号单的待就诊的挂号信息
String regStatus= Constants.REG_STATUS_2;
//计算时段
// String subsectionType= HisDateUtils.getCurrentTimeType();
//查询
Long userId=ShiroSecurityUtils.getCurrentUser().getUserId();
List<Registration> list=
this.registrationService.queryRegistration(deptId,null, scheudlingType,regStatus,userId);
return AjaxResult.success(list);
}
/**
* 查询就诊完成的挂号信息
* GET/doctor/care/queryVisitCompletedRegistration/{scheudlingType}
*/
"queryVisitCompletedRegistration/{scheudlingType}") (
public AjaxResult queryVisitCompletedRegistration( String scheudlingType){
//得到当前用户的部门ID
Long deptId= ShiroSecurityUtils.getCurrentUser().getDeptId();
//设置要查询的状态 只能是挂号单的待就诊的挂号信息
String regStatus= Constants.REG_STATUS_3;
//计算时段
// String subsectionType= HisDateUtils.getCurrentTimeType();
//查询
Long userId=ShiroSecurityUtils.getCurrentUser().getUserId();
List<Registration> list=this.registrationService.queryRegistration(deptId,null,scheudlingType,regStatus,userId);
return AjaxResult.success(list);
}
}
查询就诊完成的挂号信息/doctor/care/queryVisitCompletedRegistration/{scheudlingType}
参数名称 | 备注 |
---|---|
regId |
返回JSON数据
名称 | 类型 | 其他信息 |
---|---|---|
msg | String | |
code | int |
创建CareHistory、CareOrderDto、CareOrderItem
创建CareHistoryMapper、CareHistoryMapper.xml、CareOrderMapper、CareOrderMapper.xml、CareOrderItemMapper、CareOrderItemMapper.xml
创建CareOrderService
xxxxxxxxxx
package com.bjsxt.service;
import com.bjsxt.domain.CareHistory;
import java.util.List;
/**
*
* 就诊相关的接口
*/
public interface CareService {
/**
* 根据患者 ID 查询历史病历
* @param patientId
* @return
*/
List<CareHistory> queryCareHistoryByPatientId(String patientId);
}
xxxxxxxxxx
package com.bjsxt.service.impl;
import ...
/**
*
*/
public class CareServiceImpl implements CareService {
private CareHistoryMapper careHistoryMapper;
public List<CareHistory> queryCareHistoryByPatientId(String patientId) {
QueryWrapper<CareHistory> qw = new QueryWrapper<>();
qw.eq(CareHistory.COL_PATIENT_ID, patientId);
return this.careHistoryMapper.selectList(qw);
}
}
修改RegistrationService,增加按条件查询挂号单
xxxxxxxxxx
/**
* 根据条件查询挂号信息
* @param deptId 部门
* @param subsectionType 时段
* @param scheudlingType 类型 门诊 急诊
* @param regStatus 挂号单状态
* @param userId 医生ID
* @return
*/
public List<Registration> queryRegistration(Long deptId, String subsectionType, String scheudlingType, String regStatus, Long userId) {
QueryWrapper<Registration> qw=new QueryWrapper<>();
qw.eq(Registration.COL_DEPT_ID,deptId);
qw.eq(StringUtils.isNotBlank(subsectionType),
Registration.COL_SUBSECTION_TYPE,subsectionType);
qw.eq(Registration.COL_SCHEDULING_TYPE,scheudlingType);
qw.eq(Registration.COL_REG_STATUS,regStatus);
qw.eq(Registration.COL_VISIT_DATE,DateUtil.format(DateUtil.date(),"yyyy-MM-dd"));
qw.eq(null!=userId,Registration.COL_USER_ID,userId);
qw.orderByAsc(Registration.COL_REG_NUMBER);
return this.registrationMapper.selectList(qw);
}
xxxxxxxxxx
package com.bjsxt.controller.doctor;
import ...
/**
*
* @Description: 新开就诊控制器
*/
"doctor/care") (
public class CareController {
private RegistrationService registrationService;
private PatientService patientService;
private CareService careService;
private DeptService deptService;
/**
* 查询待就诊的挂号信息
* GET/doctor/care/queryToBeSeenRegistration/{scheudlingType}
*/
"queryToBeSeenRegistration/{scheudlingType}") (
public AjaxResult queryToBeSeenRegistration( String scheudlingType){
//得到当前用户的部门ID
Long deptId= ShiroSecurityUtils.getCurrentUser().getDeptId();
//设置要查询的状态 只能是挂号单的待就诊的挂号信息
String regStatus= Constants.REG_STATUS_1;
//计算时段
String subsectionType= HisDateUtils.getCurrentTimeType();
//查询
Long userId=null;
List<Registration> list=this.registrationService
.queryRegistration(deptId,subsectionType, scheudlingType,regStatus,userId);
return AjaxResult.success(list);
}
/**
* 查询就诊中的挂号信息
* GET/doctor/care/queryVisitingRegistration/{scheudlingType}
*/
"queryVisitingRegistration/{scheudlingType}") (
public AjaxResult queryVisitingRegistration( String scheudlingType){
//得到当前用户的部门ID
Long deptId= ShiroSecurityUtils.getCurrentUser().getDeptId();
//设置要查询的状态 只能是挂号单的待就诊的挂号信息
String regStatus= Constants.REG_STATUS_2;
//计算时段
// String subsectionType= HisDateUtils.getCurrentTimeType();
//查询
Long userId=ShiroSecurityUtils.getCurrentUser().getUserId();
List<Registration> list=
this.registrationService.queryRegistration(deptId,null, scheudlingType,regStatus,userId);
return AjaxResult.success(list);
}
/**
* 查询就诊完成的挂号信息
* GET/doctor/care/queryVisitCompletedRegistration/{scheudlingType}
*/
"queryVisitCompletedRegistration/{scheudlingType}") (
public AjaxResult queryVisitCompletedRegistration( String scheudlingType){
//得到当前用户的部门ID
Long deptId= ShiroSecurityUtils.getCurrentUser().getDeptId();
//设置要查询的状态 只能是挂号单的待就诊的挂号信息
String regStatus= Constants.REG_STATUS_3;
//计算时段
// String subsectionType= HisDateUtils.getCurrentTimeType();
//查询
Long userId=ShiroSecurityUtils.getCurrentUser().getUserId();
List<Registration> list=this.registrationService.queryRegistration(deptId,null,scheudlingType,regStatus,userId);
return AjaxResult.success(list);
}
/**
* 接诊
* POST/doctor/care/receivePatient/{regId}
*/
"receivePatient/{regId}") (
public AjaxResult receivePatient( String regId){
synchronized (this){ //防止并发接诊的问题
//根据挂号单ID查询挂号信息
Registration registration=this.registrationService.queryRegistrationByRegId(regId);
if(null==registration){
return AjaxResult.fail("【"+regId+"】挂号单的不存在,不能接诊");
}
//只有当挂号单的状态 regStatus为 待就诊时可以接诊
if(registration.getRegStatus().equals(Constants.REG_STATUS_1)){
registration.setRegStatus(Constants.REG_STATUS_2);//就诊中
registration.setUserId(ShiroSecurityUtils.getCurrentUser().getUserId());
registration.setDoctorName(ShiroSecurityUtils.getCurrentUser().getUserName());
return AjaxResult.toAjax(this.registrationService.updateRegistrationByRegId(registration));
}else{
return AjaxResult.fail("【"+regId+"】挂号单的状态不是待就诊状态,不能接诊");
}
}
}
}
接诊/doctor/care/receivePatient/{regId}