diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/charge/patientcardrenewal/PatientCardRenewalController.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/charge/patientcardrenewal/PatientCardRenewalController.java new file mode 100644 index 00000000..125f05b8 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/charge/patientcardrenewal/PatientCardRenewalController.java @@ -0,0 +1,53 @@ +package com.openhis.web.charge.patientcardrenewal; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import com.core.common.core.domain.R; +import lombok.extern.slf4j.Slf4j; + +/** + * 患者换卡控制器 + * + * @author system + * @date 2024-01-01 + */ +@RestController +@RequestMapping("/charge/patientCardRenewal") +@Slf4j +public class PatientCardRenewalController { + + @Autowired + private PatientCardRenewalService patientCardRenewalService; + + /** + * 执行患者换卡操作 + * + * @param request 换卡请求参数 + * @return 换卡结果 + */ + @PostMapping("/renewCard") + public R renewCard(@RequestBody RenewalRequest request) { + try { + log.info("患者换卡请求: 旧卡号={}, 新卡号={}, 患者ID={}", + request.getOldCardNo(), request.getNewCardNo(), request.getPatientId()); + + // 执行换卡操作 + boolean success = patientCardRenewalService.renewCard(request); + + if (success) { + log.info("患者换卡成功: 旧卡号={} -> 新卡号={}", + request.getOldCardNo(), request.getNewCardNo()); + return R.ok("换卡成功"); + } else { + return R.fail("换卡失败"); + } + } catch (Exception e) { + log.error("患者换卡异常: ", e); + return R.fail("换卡操作异常: " + e.getMessage()); + } + } +} \ No newline at end of file diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/charge/patientcardrenewal/PatientCardRenewalService.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/charge/patientcardrenewal/PatientCardRenewalService.java new file mode 100644 index 00000000..4f84a634 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/charge/patientcardrenewal/PatientCardRenewalService.java @@ -0,0 +1,18 @@ +package com.openhis.web.charge.patientcardrenewal; + +/** + * 患者换卡服务接口 + * + * @author system + * @date 2024-01-01 + */ +public interface PatientCardRenewalService { + + /** + * 执行患者换卡操作 + * + * @param request 换卡请求参数 + * @return 是否换卡成功 + */ + boolean renewCard(RenewalRequest request); +} \ No newline at end of file diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/charge/patientcardrenewal/PatientCardRenewalServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/charge/patientcardrenewal/PatientCardRenewalServiceImpl.java new file mode 100644 index 00000000..c6d99f21 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/charge/patientcardrenewal/PatientCardRenewalServiceImpl.java @@ -0,0 +1,43 @@ +package com.openhis.web.charge.patientcardrenewal; + +import org.springframework.stereotype.Service; + +import lombok.extern.slf4j.Slf4j; + +/** + * 患者换卡服务实现类 + * + * @author system + * @date 2024-01-01 + */ +@Service +@Slf4j +public class PatientCardRenewalServiceImpl implements PatientCardRenewalService { + + @Override + public boolean renewCard(RenewalRequest request) { + // TODO: 这里应该实现真实的换卡业务逻辑 + // 1. 验证参数合法性 + // 2. 检查新卡号是否已被使用 + // 3. 更新患者主表中的卡号信息 + // 4. 记录换卡日志 + // 5. 处理相关业务系统的卡号更新 + + // 目前返回模拟结果 + log.info("模拟执行患者换卡操作: 旧卡号={}, 新卡号={}, 原因={}", + request.getOldCardNo(), request.getNewCardNo(), request.getReason()); + + // 简单验证:确保旧卡号和新卡号不为空且不相同 + if (request.getOldCardNo() == null || request.getNewCardNo() == null || + request.getOldCardNo().isEmpty() || request.getNewCardNo().isEmpty()) { + throw new IllegalArgumentException("卡号不能为空"); + } + + if (request.getOldCardNo().equals(request.getNewCardNo())) { + throw new IllegalArgumentException("新卡号不能与旧卡号相同"); + } + + // 模拟成功结果 + return true; + } +} \ No newline at end of file diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/charge/patientcardrenewal/RenewalRequest.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/charge/patientcardrenewal/RenewalRequest.java new file mode 100644 index 00000000..5c18d765 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/charge/patientcardrenewal/RenewalRequest.java @@ -0,0 +1,38 @@ +package com.openhis.web.charge.patientcardrenewal; + +import lombok.Data; + +/** + * 换卡请求参数类 + * + * @author system + * @date 2024-01-01 + */ +@Data +public class RenewalRequest { + + /** + * 旧门诊号码 + */ + private String oldCardNo; + + /** + * 新门诊号码 + */ + private String newCardNo; + + /** + * 患者ID + */ + private String patientId; + + /** + * 换卡原因 + */ + private String reason; + + /** + * 备注信息 + */ + private String remark; +} \ No newline at end of file diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/impl/OutpatientRegistrationAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/impl/OutpatientRegistrationAppServiceImpl.java index 4a606304..089f7799 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/impl/OutpatientRegistrationAppServiceImpl.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/impl/OutpatientRegistrationAppServiceImpl.java @@ -91,9 +91,9 @@ public class OutpatientRegistrationAppServiceImpl implements IOutpatientRegistra */ @Override public Page getPatientMetadataBySearchKey(String searchKey, Integer pageNo, Integer pageSize) { - // 构建查询条件 + // 构建查询条件,添加phone字段支持手机号搜索 QueryWrapper queryWrapper = HisQueryUtils.buildQueryWrapper(null, searchKey, - new HashSet<>(Arrays.asList("id_card", "name", "py_str", "wb_str")), null); + new HashSet<>(Arrays.asList("id_card", "name", "py_str", "wb_str", "phone")), null); // 设置排序 queryWrapper.orderByDesc("update_time"); // 通过证件号匹配 patient diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/patientmanage/appservice/impl/PatientInformationServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/patientmanage/appservice/impl/PatientInformationServiceImpl.java index c344b7a2..9fd06064 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/patientmanage/appservice/impl/PatientInformationServiceImpl.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/patientmanage/appservice/impl/PatientInformationServiceImpl.java @@ -128,10 +128,11 @@ public class PatientInformationServiceImpl implements IPatientInformationService public IPage getPatientInfo(PatientInfoSearchParam patientInfoSearchParam, String searchKey, Integer pageNo, Integer pageSize, HttpServletRequest request) { - // 构建查询条件 + // 构建查询条件 - 添加phone字段到搜索条件中 QueryWrapper queryWrapper = HisQueryUtils.buildQueryWrapper( patientInfoSearchParam, searchKey, new HashSet<>(Arrays.asList(CommonConstants.FieldName.Name, - CommonConstants.FieldName.BusNo, CommonConstants.FieldName.PyStr, CommonConstants.FieldName.WbStr)), + CommonConstants.FieldName.BusNo, CommonConstants.FieldName.PyStr, CommonConstants.FieldName.WbStr, + CommonConstants.FieldName.Phone)), // 添加phone字段支持手机号搜索 request); IPage patientInformationPage = diff --git a/openhis-server-new/openhis-common/src/main/java/com/openhis/common/constant/CommonConstants.java b/openhis-server-new/openhis-common/src/main/java/com/openhis/common/constant/CommonConstants.java index 02d2c155..49b8d5f0 100644 --- a/openhis-server-new/openhis-common/src/main/java/com/openhis/common/constant/CommonConstants.java +++ b/openhis-server-new/openhis-common/src/main/java/com/openhis/common/constant/CommonConstants.java @@ -142,6 +142,11 @@ public class CommonConstants { */ public interface FieldName { + /** + * 手机号 + */ + String Phone = "phone"; + /** * 单据号 */ diff --git a/openhis-ui-vue3/src/api/cardRenewal/api.js b/openhis-ui-vue3/src/api/cardRenewal/api.js new file mode 100644 index 00000000..eac34ea0 --- /dev/null +++ b/openhis-ui-vue3/src/api/cardRenewal/api.js @@ -0,0 +1,94 @@ +import request from '@/utils/request'; + +// 查询患者列表 - 更新为匹配后端实际路径 +export function getPatientList(query) { + console.log('查询患者列表API被调用,参数:', query); + + // 调整参数以匹配后端控制器的要求 + const backendParams = { + patientName: query.patientName || '', + idCard: query.idCard || '', + phoneNumber: query.phoneNumber || '', // 添加phoneNumber参数 + cardNo: '' // 后端控制器中有cardNo参数,但前端没有,可以传空字符串 + }; + + console.log('调整后的后端参数:', backendParams); + + // 实际API调用代码 - 使用后端实际路径 + return request({ + url: '/openhis/charge/patientCardRenewal/getPatientInfo', + method: 'get', + params: backendParams + }).then(response => { + console.log('API返回结果:', response); + + // 转换后端返回格式以适应前端组件 + if (response && response.code === 200) { + // 检查后端返回的数据结构 + if (Array.isArray(response.data)) { + // 如果是数组,直接使用 + return { + code: 200, + msg: 'success', + rows: response.data, + total: response.data.length + }; + } else if (response.data) { + // 如果是单个对象,包装成数组 + return { + code: 200, + msg: 'success', + rows: [response.data], + total: 1 + }; + } + } + + // 默认返回空数据 + return { + code: response?.code || 500, + msg: response?.msg || '查询失败', + rows: [], + total: 0 + }; + }).catch(error => { + console.error('查询患者列表API调用失败:', error); + // API调用失败时返回空数据 + return { + code: 500, + msg: 'API调用失败', + rows: [], + total: 0 + }; + }); +} + +// 执行患者换卡 +export function renewPatientCard(data) { + return request({ + url: '/cardRenewal/card/renewal', + method: 'post', + data: data + }).catch(error => { + console.error('换卡操作API调用失败:', error); + return { + code: 500, + msg: 'API调用失败' + }; + }); +} + +// 获取患者详细信息 +export function getPatientInfo(patientId) { + return request({ + url: '/cardRenewal/patient/info/' + patientId, + method: 'get' + }).catch(error => { + console.error('获取患者详细信息API调用失败:', error); + return { + code: 500, + msg: 'API调用失败', + data: {} + }; + }); +} \ No newline at end of file diff --git a/openhis-ui-vue3/src/views/charge/patientCardRenewal/components/api.js b/openhis-ui-vue3/src/views/charge/patientCardRenewal/components/api.js new file mode 100644 index 00000000..74936a3e --- /dev/null +++ b/openhis-ui-vue3/src/views/charge/patientCardRenewal/components/api.js @@ -0,0 +1,19 @@ +import request from '@/utils/request' + +/** + * 执行患者换卡操作 + * @param {Object} params - 换卡参数 + * @param {string} params.oldCardNo - 旧门诊号码 + * @param {string} params.newCardNo - 新门诊号码 + * @param {string} params.patientId - 患者ID + * @param {string} params.reason - 换卡原因 + * @param {string} params.remark - 备注信息 + * @returns {Promise} 请求结果 + */ +export const doCardRenewal = (params) => { + return request({ + url: '/charge/patientCardRenewal/renewCard', + method: 'post', + data: params + }) +} \ No newline at end of file diff --git a/openhis-ui-vue3/src/views/charge/patientCardRenewal/index.vue b/openhis-ui-vue3/src/views/charge/patientCardRenewal/index.vue new file mode 100644 index 00000000..d5bdd52d --- /dev/null +++ b/openhis-ui-vue3/src/views/charge/patientCardRenewal/index.vue @@ -0,0 +1,606 @@ + + + + + \ No newline at end of file diff --git a/openhis-ui-vue3/src/views/charge/patientSearch/PatientSearch.vue b/openhis-ui-vue3/src/views/charge/patientSearch/PatientSearch.vue new file mode 100644 index 00000000..caf14fc2 --- /dev/null +++ b/openhis-ui-vue3/src/views/charge/patientSearch/PatientSearch.vue @@ -0,0 +1,342 @@ + + + + + \ No newline at end of file diff --git a/openhis-ui-vue3/src/views/charge/patientSearch/api.js b/openhis-ui-vue3/src/views/charge/patientSearch/api.js new file mode 100644 index 00000000..5df6dc08 --- /dev/null +++ b/openhis-ui-vue3/src/views/charge/patientSearch/api.js @@ -0,0 +1,48 @@ +import request from '@/utils/request' + +/** + * 获取门诊患者信息列表 + * 复用门诊挂号的API来查询患者信息 + */ +export const getOutpatientRegistrationList = (params) => { + // 调用门诊挂号的API获取患者信息 + return request({ + url: '/api/outpatient/registration/list', + method: 'get', + params + }) +} + +/** + * 根据ID获取患者详情 + */ +export const getPatientById = (id) => { + return request({ + url: `/api/outpatient/registration/${id}`, + method: 'get' + }) +} + +/** + * 根据条件查询患者信息 + * 复用门诊挂号API进行查询 + */ +export const getPatientList = (params) => { + // 复用门诊挂号的API + return request({ + url: '/api/outpatient/registration/list', + method: 'get', + params + }) +} + +/** + * 根据门诊号码获取患者详细信息 + */ +export const getPatientByOutpatientNo = (outpatientNo) => { + return request({ + url: '/api/outpatient/registration/list', + method: 'get', + params: { identifierNo: outpatientNo } + }) +} \ No newline at end of file diff --git a/openhis-ui-vue3/src/views/hospitalRecord/PatientRecordQuery.vue b/openhis-ui-vue3/src/views/hospitalRecord/PatientRecordQuery.vue new file mode 100644 index 00000000..e69de29b