Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
B
byh-family-doctor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
包
包
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
杨凯
byh-family-doctor
Commits
5b871dc8
提交
5b871dc8
authored
5月 27, 2024
作者:
luzhangjian
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat:对接云his+1
上级
6733af3d
显示空白字符变更
内嵌
并排
正在显示
13 个修改的文件
包含
590 行增加
和
39 行删除
+590
-39
PatientSignInfo.java
...om/ebaiyihui/family/doctor/common/bo/PatientSignInfo.java
+5
-0
BaseInfoByAdmIdVO.java
.../ebaiyihui/family/doctor/common/vo/BaseInfoByAdmIdVO.java
+14
-0
ICDSearchNameReqVO.java
.../family/doctor/common/vo/cloudHis/ICDSearchNameReqVO.java
+29
-0
ICDSearchNameResVO.java
.../family/doctor/common/vo/cloudHis/ICDSearchNameResVO.java
+27
-0
ProjProperties.java
...family/doctor/server/common/constants/ProjProperties.java
+1
-0
AdmissionStatusEnum.java
...amily/doctor/server/common/enums/AdmissionStatusEnum.java
+184
-0
CloudHisAdmissionStatusEnum.java
...ctor/server/common/enums/CloudHisAdmissionStatusEnum.java
+90
-0
PatientSignEntity.java
...iyihui/family/doctor/server/entity/PatientSignEntity.java
+3
-0
HisTemplateService.java
...ihui/family/doctor/server/service/HisTemplateService.java
+16
-6
HisTemplateServiceImpl.java
...ly/doctor/server/service/impl/HisTemplateServiceImpl.java
+97
-8
PatientMedicalRecordServiceImpl.java
.../server/service/impl/PatientMedicalRecordServiceImpl.java
+111
-18
PatientServiceImpl.java
...family/doctor/server/service/impl/PatientServiceImpl.java
+11
-6
application-test.yml
family-doctor-server/src/main/resources/application-test.yml
+2
-1
没有找到文件。
family-doctor-common/src/main/java/com/ebaiyihui/family/doctor/common/bo/PatientSignInfo.java
浏览文件 @
5b871dc8
...
...
@@ -79,4 +79,9 @@ public class PatientSignInfo {
* 签约id
*/
private
Long
signedId
;
/**
* 云his挂号编号
*/
private
String
clinicCode
;
}
family-doctor-common/src/main/java/com/ebaiyihui/family/doctor/common/vo/BaseInfoByAdmIdVO.java
浏览文件 @
5b871dc8
...
...
@@ -82,4 +82,18 @@ public class BaseInfoByAdmIdVO {
* 主诉
*/
private
String
mainSuit
;
/**
* 主诉
*/
private
String
clinicCode
;
/**
* his相关
*/
private
String
hisDeptCode
;
private
String
hisDoctorCode
;
private
String
hisDeptName
;
private
String
hisDoctorName
;
}
family-doctor-common/src/main/java/com/ebaiyihui/family/doctor/common/vo/cloudHis/ICDSearchNameReqVO.java
0 → 100644
浏览文件 @
5b871dc8
package
com
.
ebaiyihui
.
family
.
doctor
.
common
.
vo
.
cloudHis
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotNull
;
/**
* @Author: shenshanshan
* @Date: 16:09 2020-02-21
*/
@Data
public
class
ICDSearchNameReqVO
{
@ApiModelProperty
(
value
=
"诊断名称【必填】"
)
@NotBlank
(
message
=
"关键字不能为空"
)
private
String
keyword
;
@ApiModelProperty
(
value
=
"页数【必填】"
)
@NotNull
(
message
=
"页数不能为空"
)
private
Integer
pageNum
;
@ApiModelProperty
(
value
=
"记录数【必填】"
)
@NotNull
(
message
=
"记录数不能为空"
)
private
Integer
pageSize
;
}
family-doctor-common/src/main/java/com/ebaiyihui/family/doctor/common/vo/cloudHis/ICDSearchNameResVO.java
0 → 100644
浏览文件 @
5b871dc8
package
com
.
ebaiyihui
.
family
.
doctor
.
common
.
vo
.
cloudHis
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
/**
* @Author: shenshanshan
* @Date: 16:09 2020-02-21
*/
@Data
public
class
ICDSearchNameResVO
{
@ApiModelProperty
(
value
=
"ID"
)
private
String
id
;
@ApiModelProperty
(
value
=
"ICD诊断编码"
)
private
String
code
;
@ApiModelProperty
(
value
=
"ICD诊断副编码"
)
private
String
encode
;
@ApiModelProperty
(
value
=
"ICD诊断名称"
)
private
String
name
;
@ApiModelProperty
(
value
=
"ICD助记码"
)
private
String
mnemonic
;
}
family-doctor-server/src/main/java/com/ebaiyihui/family/doctor/server/common/constants/ProjProperties.java
浏览文件 @
5b871dc8
...
...
@@ -40,5 +40,6 @@ public class ProjProperties {
private
String
archiving
;
private
String
refund
;
private
String
checkDocAndDeptAndRegFeeInfo
;
private
String
icdSearchName
;
}
family-doctor-server/src/main/java/com/ebaiyihui/family/doctor/server/common/enums/AdmissionStatusEnum.java
0 → 100644
浏览文件 @
5b871dc8
package
com
.
ebaiyihui
.
family
.
doctor
.
server
.
common
.
enums
;
/**
* @Author:yanliang
* @Date:2019/6/12 16:00
* @Description 在线咨询订单状态枚举
*
*/
public
enum
AdmissionStatusEnum
{
/**
* 已取消:用户未支付
*/
CANCEL
(
"已取消"
,
0
,
"患者未支付订单"
),
/**
* 待接待:请尽快与处理咨询
*/
TO_BE_RECEIVED
(
"待接诊"
,
1
,
"医生未接诊"
),
/**
* 咨询中:距离咨询结束还有[25:00]小时
*/
IN_CONSULTATION
(
"进行中"
,
2
,
"就诊正在进行中"
),
/**
* 已退款(拒绝):您已拒绝申请
*/
REFUNDED_REFUSE
(
"已退款"
,
4
,
"已退款,医生拒绝接诊"
),
/**
* 已退款(超时):有效期内未处理咨询已退款`
*/
NOT_RECEIVED_TIME_OUT
(
"已退款"
,
5
,
"已退款,医生超时未接诊"
),
/**
* 已退款(申请):您申请的退款已处理成功
*/
REFUNDED_APPLY
(
"已退款"
,
6
,
"已退款,医生主动取消"
),
/**
* 已结束(主动):您主动结束了咨询
*/
FINISH_APPLY
(
"已完成"
,
7
,
"已结束就诊,患者未评价"
),
/**
* 已结束(超时):咨询超时结束
*/
FINISH_TIME_OUT
(
"已完成"
,
8
,
"已结束就诊,患者未评价"
),
/**
* 已结束(已评价)
*/
FINISH_APPLY_REVIEWED
(
"已完成"
,
9
,
"已结束就诊,患者已评价"
),
/**
* 已退号(已退款)
*/
RETIRED
(
"已退款"
,
111
,
"已退款,等待问诊患者主动取消"
),
/**
* 待接诊医生停诊
*/
DOCTOR_CLOSED_SCHEDULE
(
"已退款"
,
112
,
"已退款,医生停诊"
),
/**
* 待候诊医生停诊
*/
DOCTOR_CLOSED_WATING_SCHEDULE
(
"已退款"
,
113
,
"已退款,医生停诊"
),
/**
* 状态 : 0 元已拒绝
* 订单已完成
* 就诊 咨询超时/主动结束
*/
REFUNDED_REFUSE_ZERO
(
"已拒绝"
,
30
,
"医生超时未接诊"
),
WAIT_ADMISSION
(
"待问诊"
,
20
,
"等待到达预约问诊时间"
),
EXPIRED
(
"已过期"
,
10
,
"已退款,患者超时未进入问诊"
),
TO_BE_RECEIVED_REFUND
(
"已退款"
,
15
,
"已退款,等待接诊患者主动取消"
),
REFERRAL
(
"已完成"
,
40
,
"已转诊,医生已转诊"
),
REFERRAL_MANAGER
(
"已完成"
,
41
,
"已转诊,管理员转诊"
),
PASSNUMBER
(
"已过号"
,
50
,
"患者已过号"
),
PASSNUMBER_REFUND_ZERO
(
"已退款"
,
114
,
"患者过号"
),
PASSNUMBER_REFUND
(
"已退款"
,
115
,
"已退款,患者过号"
),
/**
* 已退款,管理员取消
*/
ADMIN_REFUNDED
(
"已失效"
,
45
,
"已退款,管理员取消"
),
/**
* 已退款,管理员取消(待候诊)
*/
ADMIN_REFUNDED_ADMISSION
(
"已失效"
,
46
,
"已退款,管理员取消"
),
/**
* 旧转诊单状态
*/
REFERRAL_MANAGER_FINISH
(
"已完成"
,
42
,
"医生已转诊"
),
/**
* 管理端审核
*/
OFFICE_REVIEW
(
"退款审核中"
,
98
,
"退款审核中"
),
/**
*互联网办公室审核通过
*/
INTERNET_OFFICE_REVIEW
(
"退款审核中"
,
99
,
"退款审核中"
);
private
String
desc
;
private
Integer
value
;
private
String
display
;
/**
* @param desc
*/
private
AdmissionStatusEnum
(
String
desc
,
Integer
value
,
String
display
)
{
this
.
desc
=
desc
;
this
.
value
=
value
;
this
.
display
=
display
;
}
public
String
getDesc
()
{
return
desc
;
}
public
void
setDesc
(
String
desc
)
{
this
.
desc
=
desc
;
}
public
Integer
getValue
()
{
return
value
;
}
public
void
setValue
(
Integer
value
)
{
this
.
value
=
value
;
}
public
String
getDisplay
(){
return
display
;
}
public
void
setDisplay
(
String
display
){
this
.
display
=
display
;
}
public
static
String
getDesc
(
Integer
value
)
{
if
(
value
==
null
||
value
<
0
)
{
return
null
;
}
for
(
AdmissionStatusEnum
admissionStatusEnum
:
AdmissionStatusEnum
.
values
())
{
if
(
value
.
equals
(
admissionStatusEnum
.
getValue
()))
{
return
admissionStatusEnum
.
getDesc
();
}
}
return
null
;
}
public
static
String
getDisplay
(
Integer
value
)
{
if
(
value
==
null
||
value
<
0
)
{
return
null
;
}
for
(
AdmissionStatusEnum
admissionStatusEnum
:
AdmissionStatusEnum
.
values
())
{
if
(
value
.
equals
(
admissionStatusEnum
.
getValue
()))
{
return
admissionStatusEnum
.
getDisplay
();
}
}
return
null
;
}
public
static
AdmissionStatusEnum
getEnum
(
Integer
value
)
{
if
(
value
==
null
||
value
<
0
)
{
return
null
;
}
for
(
AdmissionStatusEnum
admissionStatusEnum
:
AdmissionStatusEnum
.
values
())
{
if
(
value
.
equals
(
admissionStatusEnum
.
getValue
()))
{
return
admissionStatusEnum
;
}
}
return
null
;
}
}
family-doctor-server/src/main/java/com/ebaiyihui/family/doctor/server/common/enums/CloudHisAdmissionStatusEnum.java
0 → 100644
浏览文件 @
5b871dc8
package
com
.
ebaiyihui
.
family
.
doctor
.
server
.
common
.
enums
;
public
enum
CloudHisAdmissionStatusEnum
{
/**
* 待接待:请尽快与处理咨询
*/
TO_BE_RECEIVED
(
"待接诊"
,
1
,
"医生待接诊"
),
TREATNENTED
(
"就诊中"
,
20
,
"医生已接诊"
),
FINISH
(
"已完成"
,
30
,
"医生已完成问诊"
),
DOCTOR_CANCEL
(
"已取消"
,
40
,
"医生已取消问诊"
),
PATIENT_CANCEL
(
"已取消"
,
45
,
"患者已取消问诊"
),
OTHER_CANCEL
(
"已取消"
,
46
,
"其他操作已取消问诊"
),
RETIRMENT
(
"就诊中"
,
50
,
"退诊"
),
ARCHIVED
(
"已归档"
,
99
,
"归档"
);
private
String
desc
;
private
Integer
value
;
private
String
display
;
/**
* @param desc
*/
private
CloudHisAdmissionStatusEnum
(
String
desc
,
Integer
value
,
String
display
)
{
this
.
desc
=
desc
;
this
.
value
=
value
;
this
.
display
=
display
;
}
public
String
getDesc
()
{
return
desc
;
}
public
void
setDesc
(
String
desc
)
{
this
.
desc
=
desc
;
}
public
Integer
getValue
()
{
return
value
;
}
public
void
setValue
(
Integer
value
)
{
this
.
value
=
value
;
}
public
String
getDisplay
(){
return
display
;
}
public
void
setDisplay
(
String
display
){
this
.
display
=
display
;
}
public
static
String
getDesc
(
Integer
value
)
{
if
(
value
==
null
||
value
<
0
)
{
return
null
;
}
for
(
AdmissionStatusEnum
admissionStatusEnum
:
AdmissionStatusEnum
.
values
())
{
if
(
value
.
equals
(
admissionStatusEnum
.
getValue
()))
{
return
admissionStatusEnum
.
getDesc
();
}
}
return
null
;
}
public
static
String
getDisplay
(
Integer
value
)
{
if
(
value
==
null
||
value
<
0
)
{
return
null
;
}
for
(
AdmissionStatusEnum
admissionStatusEnum
:
AdmissionStatusEnum
.
values
())
{
if
(
value
.
equals
(
admissionStatusEnum
.
getValue
()))
{
return
admissionStatusEnum
.
getDisplay
();
}
}
return
null
;
}
public
static
AdmissionStatusEnum
getEnum
(
Integer
value
)
{
if
(
value
==
null
||
value
<
0
)
{
return
null
;
}
for
(
AdmissionStatusEnum
admissionStatusEnum
:
AdmissionStatusEnum
.
values
())
{
if
(
value
.
equals
(
admissionStatusEnum
.
getValue
()))
{
return
admissionStatusEnum
;
}
}
return
null
;
}
}
family-doctor-server/src/main/java/com/ebaiyihui/family/doctor/server/entity/PatientSignEntity.java
浏览文件 @
5b871dc8
...
...
@@ -83,4 +83,7 @@ public class PatientSignEntity {
@ApiModelProperty
(
"签约关联id"
)
private
Long
signId
;
@ApiModelProperty
(
"云his挂号编号"
)
private
String
clinicCode
;
}
family-doctor-server/src/main/java/com/ebaiyihui/family/doctor/server/service/HisTemplateService.java
浏览文件 @
5b871dc8
...
...
@@ -2,17 +2,19 @@ package com.ebaiyihui.family.doctor.server.service;
import
com.ebaiyihui.family.doctor.common.vo.cloudHis.*
;
import
com.ebaiyihui.family.doctor.server.entity.PatientSignEntity
;
import
com.ebaiyihui.framework.response.BaseResponse
;
import
com.ebaiyihui.his.pojo.vo.base.FrontResponse
;
public
interface
HisTemplateService
{
//
/**
// * 手动在h
云his挂个号
// * @param appPointRequestDTO
//
* @return
//
*/
// void registrationAndTreatment(
);
/**
* 手动在
云his挂个号
*
* @return
*/
BaseResponse
<
Object
>
registrationAndTreatment
(
PatientSignEntity
patientEntity
);
/**
...
...
@@ -34,6 +36,14 @@ public interface HisTemplateService {
*/
FrontResponse
<
String
>
saveDiagnostic
(
DiagnosticReqDTO
diagnosticReqDTO
);
/**
* 查询his医生科室信息
* @param deptId
* @param doctorId
* @return
*/
HisDeptAndDocCodeVo
getHisDeptAndDocCode
(
String
deptId
,
String
doctorId
);
/**
* Description: 南昌众康医院 -订单预支付
*
...
...
family-doctor-server/src/main/java/com/ebaiyihui/family/doctor/server/service/impl/HisTemplateServiceImpl.java
浏览文件 @
5b871dc8
...
...
@@ -2,16 +2,29 @@ package com.ebaiyihui.family.doctor.server.service.impl;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.doctor.basedata.api.vo.DepartmentDetailVo
;
import
com.doctoruser.api.pojo.base.dto.doctor.QueryPersonnelInfoReq
;
import
com.doctoruser.api.pojo.base.vo.doctor.PersonnelInfo
;
import
com.ebaiyihui.family.doctor.common.vo.cloudHis.*
;
import
com.ebaiyihui.family.doctor.server.common.constants.ProjProperties
;
import
com.ebaiyihui.family.doctor.server.common.enums.CloudHisAdmissionStatusEnum
;
import
com.ebaiyihui.family.doctor.server.entity.PatientEntity
;
import
com.ebaiyihui.family.doctor.server.entity.PatientSignEntity
;
import
com.ebaiyihui.family.doctor.server.feign.DepartmentFeignClient
;
import
com.ebaiyihui.family.doctor.server.feign.DoctorInfofeignClient
;
import
com.ebaiyihui.family.doctor.server.mapper.PatientMapper
;
import
com.ebaiyihui.family.doctor.server.service.HisTemplateService
;
import
com.ebaiyihui.family.doctor.server.util.HttpKit
;
import
com.ebaiyihui.framework.response.BaseResponse
;
import
com.ebaiyihui.his.pojo.vo.base.FrontRequest
;
import
com.ebaiyihui.his.pojo.vo.base.FrontResponse
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.Objects
;
@Service
@Slf4j
...
...
@@ -20,14 +33,44 @@ public class HisTemplateServiceImpl implements HisTemplateService {
@Autowired
private
ProjProperties
projProperties
;
@Autowired
private
DepartmentFeignClient
departmentInfoApi
;
@Autowired
private
DoctorInfofeignClient
doctorClient
;
/**
* 手动在云his挂号并接诊
* @param appPointRequestDTO
* @return
*/
@Autowired
private
PatientMapper
patientMapper
;
@Override
public
BaseResponse
<
Object
>
registrationAndTreatment
(
PatientSignEntity
patientSign
)
{
HisDeptAndDocCodeVo
hisDeptAndDocCode
=
getHisDeptAndDocCode
(
patientSign
.
getDeptId
().
toString
(),
String
.
valueOf
(
patientSign
.
getDoctorId
()));
//挂号
AppPointRequestDTO
appPointRequestDTO
=
this
.
buildAppointmentParam
(
patientSign
,
hisDeptAndDocCode
);
log
.
info
(
"0元复诊挂号入参:{}"
,
JSON
.
toJSONString
(
appPointRequestDTO
));
MakeAnAppointmentRequestVO
makeAnAppointmentRequestVO
=
admissionRegistration
(
appPointRequestDTO
);
if
(
Objects
.
isNull
(
makeAnAppointmentRequestVO
)
||
StringUtils
.
isEmpty
(
makeAnAppointmentRequestVO
.
getOutpatientNo
()))
{
return
BaseResponse
.
error
(
"云his挂号失败"
);
}
// 接诊
log
.
info
(
"南昌众康医生接诊======"
);
if
(
StringUtils
.
isEmpty
(
makeAnAppointmentRequestVO
.
getOutpatientNo
()))
{
return
BaseResponse
.
error
(
"挂号失败,不能接诊"
);
}
AppPointRequestDTO
receive
=
new
AppPointRequestDTO
();
receive
.
setOutpatientNo
(
makeAnAppointmentRequestVO
.
getOutpatientNo
());
receive
.
setStatus
(
CloudHisAdmissionStatusEnum
.
TREATNENTED
.
getValue
());
log
.
info
(
"复诊接诊入参:{}"
,
JSON
.
toJSONString
(
appPointRequestDTO
));
FrontResponse
<
String
>
hisResponse
=
updateAppointment
(
appPointRequestDTO
);
if
(
FrontResponse
.
FAILED_CODE
.
equals
(
hisResponse
.
getCode
()))
{
return
BaseResponse
.
error
(
"挂号失败,无法接诊"
);
}
return
BaseResponse
.
success
(
makeAnAppointmentRequestVO
.
getOutpatientNo
());
}
@Override
public
MakeAnAppointmentRequestVO
admissionRegistration
(
AppPointRequestDTO
appPointRequestDTO
)
{
String
url
=
projProperties
.
getAdmissionRegistration
();
...
...
@@ -37,10 +80,10 @@ public class HisTemplateServiceImpl implements HisTemplateService {
log
.
info
(
"云his=>>新增就诊信息请求url:{},param:{}"
,
url
,
JSON
.
toJSONString
(
request
));
String
result
=
HttpKit
.
jsonPost
(
url
,
JSON
.
toJSONString
(
request
));
FrontResponse
<
MakeAnAppointmentRequestVO
>
frontResponse
=
JSONObject
.
toJavaObject
(
JSONObject
.
parseObject
(
result
),
FrontResponse
.
class
);
log
.
info
(
"云his=>新增就诊信息返回值:{}"
,
JSONObject
.
toJSONString
(
frontResponse
));
log
.
info
(
"云his=>新增就诊信息返回值:{}"
,
JSONObject
.
toJSONString
(
frontResponse
));
MakeAnAppointmentRequestVO
makeAnAppointmentRequestVO
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
frontResponse
.
getBody
()),
MakeAnAppointmentRequestVO
.
class
);
log
.
info
(
"云his=>新增就诊记录返回值:{}"
,
JSONObject
.
toJSONString
(
makeAnAppointmentRequestVO
));
log
.
info
(
"云his=>新增就诊记录返回值:{}"
,
JSONObject
.
toJSONString
(
makeAnAppointmentRequestVO
));
return
makeAnAppointmentRequestVO
;
}
catch
(
Exception
e
)
{
log
.
error
(
"新增预约信息异常:{}"
,
e
.
getMessage
());
...
...
@@ -188,7 +231,7 @@ public class HisTemplateServiceImpl implements HisTemplateService {
log
.
info
(
"云his=>复诊挂号类型医生部门校验请求url:{},param:{}"
,
url
,
JSON
.
toJSONString
(
request
));
String
result
=
HttpKit
.
jsonPost
(
url
,
JSON
.
toJSONString
(
request
));
FrontResponse
frontResponse
=
JSONObject
.
toJavaObject
(
JSONObject
.
parseObject
(
result
),
FrontResponse
.
class
);
log
.
info
(
"云his=>复诊挂号类型医生部门校验返回值:{}"
,
JSONObject
.
toJSONString
(
frontResponse
));
log
.
info
(
"云his=>复诊挂号类型医生部门校验返回值:{}"
,
JSONObject
.
toJSONString
(
frontResponse
));
if
(!
FrontResponse
.
SUCCESS_CODE
.
equals
(
frontResponse
.
getCode
()))
{
return
FrontResponse
.
error
(
null
,
FrontResponse
.
FAILED_CODE
,
frontResponse
.
getMessage
());
}
...
...
@@ -200,4 +243,50 @@ public class HisTemplateServiceImpl implements HisTemplateService {
return
FrontResponse
.
error
(
null
,
FrontResponse
.
FAILED_CODE
,
"复诊挂号类型医生部门校验异常"
);
}
}
@Override
public
HisDeptAndDocCodeVo
getHisDeptAndDocCode
(
String
deptId
,
String
doctorId
)
{
HisDeptAndDocCodeVo
hisDeptAndDocCodeVo
=
new
HisDeptAndDocCodeVo
();
QueryPersonnelInfoReq
queryPersonnelInfoReq
=
new
QueryPersonnelInfoReq
();
queryPersonnelInfoReq
.
setDoctorId
(
doctorId
);
BaseResponse
<
PersonnelInfo
>
personnelInfoBaseResponse
=
doctorClient
.
queryPersonnelInfo
(
queryPersonnelInfoReq
);
if
(
personnelInfoBaseResponse
.
isSuccess
()
&&
null
!=
personnelInfoBaseResponse
.
getData
())
{
log
.
info
(
"his医生code:"
+
JSON
.
toJSONString
(
personnelInfoBaseResponse
));
String
emplCode
=
personnelInfoBaseResponse
.
getData
().
getEmplCode
();
hisDeptAndDocCodeVo
.
setDoctorCode
(
emplCode
);
hisDeptAndDocCodeVo
.
setDoctorName
(
personnelInfoBaseResponse
.
getData
().
getDoctorName
());
}
Long
deptIdL
=
Long
.
valueOf
(
deptId
);
BaseResponse
<
DepartmentDetailVo
>
departmentDetail
=
departmentInfoApi
.
getDepartmentDetail
(
deptIdL
);
if
(
departmentDetail
.
isSuccess
()
&&
null
!=
departmentDetail
.
getData
())
{
log
.
info
(
"his科室code:"
+
JSON
.
toJSONString
(
departmentDetail
));
String
deptCode
=
departmentDetail
.
getData
().
getDeptCode
();
hisDeptAndDocCodeVo
.
setDeptCode
(
deptCode
);
hisDeptAndDocCodeVo
.
setDeptName
(
departmentDetail
.
getData
().
getDeptName
());
}
return
hisDeptAndDocCodeVo
;
}
private
AppPointRequestDTO
buildAppointmentParam
(
PatientSignEntity
patientEntity
,
HisDeptAndDocCodeVo
hisDeptAndDocCode
)
{
// 查询患者信息
String
patientId
=
patientEntity
.
getPatientId
();
PatientEntity
patientInfo
=
patientMapper
.
selectById
(
patientId
);
AppPointRequestDTO
appPointRequestDTO
=
new
AppPointRequestDTO
();
appPointRequestDTO
.
setCardType
(
"01"
);
appPointRequestDTO
.
setName
(
patientEntity
.
getPatientName
());
appPointRequestDTO
.
setOutpatientType
(
"1"
);
appPointRequestDTO
.
setDeptId
(
Integer
.
valueOf
(
hisDeptAndDocCode
.
getDeptCode
()));
appPointRequestDTO
.
setSex
(
patientInfo
.
getGender
()
+
""
);
appPointRequestDTO
.
setCardNo
(
patientInfo
.
getCredNo
());
appPointRequestDTO
.
setPhone
(
patientInfo
.
getPhone
());
appPointRequestDTO
.
setDoctorName
(
hisDeptAndDocCode
.
getDoctorName
());
appPointRequestDTO
.
setMedicalType
(
"1"
);
appPointRequestDTO
.
setDoctorId
(
Integer
.
valueOf
(
hisDeptAndDocCode
.
getDoctorCode
()));
appPointRequestDTO
.
setDeptName
(
hisDeptAndDocCode
.
getDeptName
());
appPointRequestDTO
.
setHospitalName
(
"众康家庭医生"
);
return
appPointRequestDTO
;
}
}
family-doctor-server/src/main/java/com/ebaiyihui/family/doctor/server/service/impl/PatientMedicalRecordServiceImpl.java
浏览文件 @
5b871dc8
...
...
@@ -2,6 +2,7 @@ package com.ebaiyihui.family.doctor.server.service.impl;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.TypeReference
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.doctoruser.api.pojo.base.dto.doctor.QueryPersonnelInfoReq
;
import
com.doctoruser.api.pojo.base.vo.doctor.PersonnelInfo
;
...
...
@@ -12,6 +13,7 @@ import com.ebaiyihui.family.doctor.common.bo.MessageInfo;
import
com.ebaiyihui.family.doctor.common.bo.PatientSignInfo
;
import
com.ebaiyihui.family.doctor.common.bo.PersonImInformReq
;
import
com.ebaiyihui.family.doctor.common.vo.*
;
import
com.ebaiyihui.family.doctor.common.vo.cloudHis.*
;
import
com.ebaiyihui.family.doctor.server.common.constants.IMInformConstants
;
import
com.ebaiyihui.family.doctor.server.common.constants.ProjProperties
;
import
com.ebaiyihui.family.doctor.server.entity.PatientEntity
;
...
...
@@ -22,10 +24,12 @@ import com.ebaiyihui.family.doctor.server.feign.IMPushMsgFeignClient;
import
com.ebaiyihui.family.doctor.server.feign.UserApiFeignClient
;
import
com.ebaiyihui.family.doctor.server.mapper.PatientMapper
;
import
com.ebaiyihui.family.doctor.server.mapper.PatientSignMapper
;
import
com.ebaiyihui.family.doctor.server.service.HisTemplateService
;
import
com.ebaiyihui.family.doctor.server.service.PatientMedicalRecordService
;
import
com.ebaiyihui.family.doctor.server.util.JsonUtil
;
import
com.ebaiyihui.framework.response.BaseResponse
;
import
com.ebaiyihui.framework.utils.HttpKit
;
import
com.ebaiyihui.his.pojo.vo.base.FrontResponse
;
import
com.ebaiyihui.imforward.client.vo.AccountVO
;
import
com.ebaiyihui.imforward.client.vo.PushSingleMsgDataVO
;
import
com.ebaiyihui.imforward.client.vo.PushSingleMsgReqVO
;
...
...
@@ -42,6 +46,7 @@ import org.springframework.util.CollectionUtils;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Objects
;
@Service
...
...
@@ -66,6 +71,9 @@ public class PatientMedicalRecordServiceImpl implements PatientMedicalRecordServ
@Autowired
private
ProjProperties
projProperties
;
@Autowired
private
HisTemplateService
hisTemplateService
;
@Override
public
PatientCaseDetail
getMedicalInfoByAdmId
(
String
admId
)
{
log
.
info
(
"根据就诊id查病例详情入参:{} "
,
admId
);
...
...
@@ -98,22 +106,100 @@ public class PatientMedicalRecordServiceImpl implements PatientMedicalRecordServ
List
<
MessageInfo
>
messageInfos
=
new
ArrayList
<>();
//自定义-病历
messageInfos
.
add
(
getInformCustomPersonDocParam
(
patientSignInfo
,
getTreatmentCard
(
admissionId
),
IMInformConstants
.
CASE_DOCTOR_TYPE
));
messageInfos
.
add
(
getInformCustomPersonDocParam
(
patientSignInfo
,
getTreatmentCard
(
admissionId
),
IMInformConstants
.
CASE_DOCTOR_TYPE
));
//患者
//自定义-病历
messageInfos
.
add
(
getInformCustomPerPatientParam
(
patientSignInfo
,
getTreatmentCard
(
admissionId
),
IMInformConstants
.
CASE_DOCTOR_TYPE
));
// PersonImInformReq parameter = new PersonImInformReq();
// parameter.setMessageInfos(messageInfos);
// parameter.setAdmissionId(admissionId);
// parameter.setBusiCode(IMInformConstants.IM_SYSTEM_BUSINESS_CODE);
messageInfos
.
add
(
getInformCustomPerPatientParam
(
patientSignInfo
,
getTreatmentCard
(
admissionId
),
IMInformConstants
.
CASE_DOCTOR_TYPE
));
if
(
pushImInform
(
messageInfos
,
admissionId
))
{
log
.
info
(
"IM INFORM COMPLETE 医生开具复诊病例推送卡片,admissionId:{}"
,
admissionId
);
}
nczkSaveDiagnosToHis
(
patientSignInfo
,
admissionId
);
return
BaseResponse
.
success
();
}
private
String
[]
primaryDiagnoToArray
(
String
primaryDiagno
)
{
if
(
StringUtils
.
isEmpty
(
primaryDiagno
))
{
return
null
;
}
primaryDiagno
=
primaryDiagno
.
replaceAll
(
"\\\\"
,
""
);
return
primaryDiagno
.
split
(
";"
);
}
private
List
<
ICDSearchNameResVO
>
icdSearchName
(
ICDSearchNameReqVO
reqVo
)
{
List
<
ICDSearchNameResVO
>
icdNames
=
new
ArrayList
<>();
try
{
log
.
info
(
"查询诊断名称URL:{},入参{}, "
,
projProperties
.
getIcdSearchName
(),
JSON
.
toJSONString
(
reqVo
));
String
body
=
HttpKit
.
jsonPost
(
projProperties
.
getIcdSearchName
(),
JSON
.
toJSONString
(
reqVo
));
BaseResponse
<
ICDSearchNameResVO
>
baseResponse
=
JSON
.
parseObject
(
body
,
BaseResponse
.
class
);
if
(
baseResponse
.
getData
()
==
null
)
{
return
null
;
}
icdNames
=
JSON
.
parseObject
(
JSONObject
.
toJSONString
(
baseResponse
.
getData
()),
new
TypeReference
<
List
<
ICDSearchNameResVO
>>(){});
log
.
info
(
"查询诊断名称返回值:{} "
,
icdNames
);
return
icdNames
;
}
catch
(
Exception
e
)
{
log
.
error
(
"查询诊断名称返调用失败{}"
,
e
.
getMessage
());
}
return
null
;
}
private
void
nczkSaveDiagnosToHis
(
PatientSignInfo
orderEntity
,
String
admissionId
)
{
log
.
info
(
"南昌众康诊断信息入参数:orderEntity:{},admissionInfo:{}"
,
orderEntity
,
admissionId
);
DiagnosticReqDTO
diagnosticReqDTO
=
new
DiagnosticReqDTO
();
PatientDynamicMedicalEntityVo
entityVo
=
getMedicalInfoByAdmId
(
admissionId
);
if
(
Objects
.
isNull
(
entityVo
))
{
log
.
error
(
"未查询到病历信息"
);
return
;
}
PatientDynamicMedicalVo
medicalDetailVo
=
new
PatientDynamicMedicalVo
();
if
(
StringUtils
.
isNotEmpty
(
entityVo
.
getMedicalDetail
()))
{
medicalDetailVo
=
JSON
.
parseObject
(
entityVo
.
getMedicalDetail
(),
PatientDynamicMedicalVo
.
class
);
}
diagnosticReqDTO
.
setChiefComplaint
(
entityVo
.
getMainSuit
());
diagnosticReqDTO
.
setPresentMedicalHistory
(
medicalDetailVo
.
getPresentHistory
());
diagnosticReqDTO
.
setHandleOpinion
(
medicalDetailVo
.
getHandle
());
diagnosticReqDTO
.
setOutpatientNo
(
orderEntity
.
getClinicCode
());
diagnosticReqDTO
.
setPhysicalExam
(
medicalDetailVo
.
getPhysicalExamination
());
diagnosticReqDTO
.
setAuxiliaryInspection
(
medicalDetailVo
.
getAuxiliaryExamination
());
log
.
info
(
"entityVo.getPrimaryDiagno:{}"
,
entityVo
.
getPrimaryDiagno
());
String
primaryDiagno
=
entityVo
.
getPrimaryDiagno
();
String
[]
primaryDiagnoArray
=
primaryDiagnoToArray
(
primaryDiagno
);
log
.
info
(
"primaryDiagno:{},primaryDiagnoArray:{}"
,
primaryDiagno
,
primaryDiagnoArray
);
if
(
Objects
.
isNull
(
primaryDiagnoArray
))
{
log
.
error
(
"未查询到诊断信息"
);
return
;
}
List
<
DiagnosticDetailReqDTO
>
detailReqDTOList
=
new
ArrayList
<
DiagnosticDetailReqDTO
>(
primaryDiagno
.
length
());
for
(
String
diagno
:
primaryDiagnoArray
)
{
ICDSearchNameReqVO
reVo
=
new
ICDSearchNameReqVO
();
reVo
.
setKeyword
(
diagno
);
List
<
ICDSearchNameResVO
>
icdNames
=
icdSearchName
(
reVo
);
if
(
CollectionUtils
.
isEmpty
(
icdNames
))
{
continue
;
}
DiagnosticDetailReqDTO
detailReqDTO
=
new
DiagnosticDetailReqDTO
();
detailReqDTO
.
setDiagnosis
(
diagno
);
detailReqDTO
.
setIcdCode
(
icdNames
.
get
(
0
).
getCode
());
log
.
info
(
"icd信息:param:{},result:{}"
,
diagno
,
JSON
.
toJSONString
(
icdNames
));
detailReqDTOList
.
add
(
detailReqDTO
);
}
diagnosticReqDTO
.
setDiagnosis
(
detailReqDTOList
);
try
{
log
.
info
(
"南昌众康诊断保存入参:{}"
,
JSON
.
toJSONString
(
diagnosticReqDTO
));
FrontResponse
<
String
>
response
=
hisTemplateService
.
saveDiagnostic
(
diagnosticReqDTO
);
log
.
info
(
"南昌众断保存返回值:{}"
,
JSONObject
.
toJSONString
(
response
));
}
catch
(
Exception
e
)
{
log
.
error
(
"南昌众康诊断保存返回值:{}"
,
e
.
getMessage
());
}
}
@Override
public
BaseResponse
<
Object
>
getBaseInfoByAdmId
(
String
admId
)
{
log
.
info
(
"根据就诊id查询患者医生基础信息入参admId:{}"
,
admId
);
...
...
@@ -126,20 +212,31 @@ public class PatientMedicalRecordServiceImpl implements PatientMedicalRecordServ
log
.
info
(
"patientSignMapper.queryByAdmId返回值:{} "
,
JSON
.
toJSONString
(
patientSignEntity
));
PatientSignInfo
patientSignInfo
=
getPatientSignInfo
(
admId
);
log
.
info
(
"getPatientSignInfo返回值:{} "
,
JSON
.
toJSONString
(
patientSignInfo
));
BeanUtils
.
copyProperties
(
patientSignInfo
,
baseInfoByAdmIdVO
);
if
(
patientSignEntity
!=
null
)
{
BeanUtils
.
copyProperties
(
patientSignEntity
,
baseInfoByAdmIdVO
);
baseInfoByAdmIdVO
.
setDoctorId
(
String
.
valueOf
(
patientSignEntity
.
getDoctorId
()));
baseInfoByAdmIdVO
.
setDeptId
(
String
.
valueOf
(
patientSignEntity
.
getDeptId
()));
baseInfoByAdmIdVO
.
setOrderId
(
String
.
valueOf
(
patientSignEntity
.
getId
()));
baseInfoByAdmIdVO
.
setClinicCode
(
patientSignEntity
.
getClinicCode
());
HisDeptAndDocCodeVo
hisDeptAndDocCode
=
hisTemplateService
.
getHisDeptAndDocCode
(
String
.
valueOf
(
patientSignEntity
.
getDoctorId
()),
String
.
valueOf
(
patientSignEntity
.
getDeptId
()));
if
(
hisDeptAndDocCode
!=
null
){
baseInfoByAdmIdVO
.
setHisDeptCode
(
hisDeptAndDocCode
.
getDeptCode
());
baseInfoByAdmIdVO
.
setHisDeptName
(
hisDeptAndDocCode
.
getDeptName
());
baseInfoByAdmIdVO
.
setHisDoctorCode
(
hisDeptAndDocCode
.
getDoctorCode
());
baseInfoByAdmIdVO
.
setHisDoctorName
(
hisDeptAndDocCode
.
getDoctorName
());
}
PatientEntity
patientEntity
=
patientMapper
.
selectById
(
patientSignEntity
.
getPatientId
());
if
(
patientEntity
!=
null
)
{
if
(
patientEntity
!=
null
)
{
BeanUtils
.
copyProperties
(
patientEntity
,
baseInfoByAdmIdVO
);
baseInfoByAdmIdVO
.
setPatientGender
(
String
.
valueOf
(
patientEntity
.
getGender
()));
}
}
PatientCaseDetail
medicalInfoByAdmId
=
getMedicalInfoByAdmId
(
admId
);
if
(
medicalInfoByAdmId
!=
null
&&
medicalInfoByAdmId
.
getPrimaryDiagno
()!=
null
)
{
if
(
medicalInfoByAdmId
!=
null
&&
medicalInfoByAdmId
.
getPrimaryDiagno
()
!=
null
)
{
baseInfoByAdmIdVO
.
setIcdNames
(
medicalInfoByAdmId
.
getPrimaryDiagno
());
baseInfoByAdmIdVO
.
setMainSuit
(
medicalInfoByAdmId
.
getMainSuit
());
}
...
...
@@ -155,8 +252,7 @@ public class PatientMedicalRecordServiceImpl implements PatientMedicalRecordServ
* @param <T>
* @return 不会返回空
*/
private
<
T
>
MessageInfo
getInformCustomPersonDocParam
(
PatientSignInfo
admissionInfo
,
T
content
,
String
businessCode
)
{
private
<
T
>
MessageInfo
getInformCustomPersonDocParam
(
PatientSignInfo
admissionInfo
,
T
content
,
String
businessCode
)
{
String
doctorUserId
=
admissionInfo
.
getDoctorUserId
();
if
(
StringUtils
.
isEmpty
(
doctorUserId
))
{
log
.
error
(
"IM INFORM ERROR : 无法查询到接收人信息"
);
...
...
@@ -174,8 +270,7 @@ public class PatientMedicalRecordServiceImpl implements PatientMedicalRecordServ
// 医生账号
messageInfo
.
setSingleAccount
(
newAccount
(
IMInformConstants
.
DOCTOR_APPLICATION_CODE
,
doctorUserId
));
// 患者账号
messageInfo
.
setSelfAccount
(
newAccount
(
IMInformConstants
.
PATIENT_APPLICATION_CODE
,
admissionInfo
.
getPatientUserId
()));
messageInfo
.
setSelfAccount
(
newAccount
(
IMInformConstants
.
PATIENT_APPLICATION_CODE
,
admissionInfo
.
getPatientUserId
()));
messageInfo
.
setMessage
(
message
);
return
messageInfo
;
}
...
...
@@ -195,8 +290,7 @@ public class PatientMedicalRecordServiceImpl implements PatientMedicalRecordServ
* @param <T>
* @return 不会返回空
*/
private
<
T
>
MessageInfo
getInformCustomPerPatientParam
(
PatientSignInfo
admissionInfo
,
T
content
,
String
businessCode
)
{
private
<
T
>
MessageInfo
getInformCustomPerPatientParam
(
PatientSignInfo
admissionInfo
,
T
content
,
String
businessCode
)
{
String
patientUserId
=
admissionInfo
.
getPatientUserId
();
if
(
StringUtils
.
isEmpty
(
patientUserId
))
{
log
.
error
(
"IM INFORM ERROR : 无法查询到接收人信息"
);
...
...
@@ -211,8 +305,7 @@ public class PatientMedicalRecordServiceImpl implements PatientMedicalRecordServ
message
.
setData
(
content
);
message
.
setApplicationCode
(
IMInformConstants
.
IM_SYSTEM_BUSINESS_CODE
);
messageInfo
.
setSingleAccount
(
newAccount
(
IMInformConstants
.
PATIENT_APPLICATION_CODE
,
patientUserId
));
messageInfo
.
setSelfAccount
(
newAccount
(
IMInformConstants
.
DOCTOR_APPLICATION_CODE
,
admissionInfo
.
getDoctorUserId
()));
messageInfo
.
setSelfAccount
(
newAccount
(
IMInformConstants
.
DOCTOR_APPLICATION_CODE
,
admissionInfo
.
getDoctorUserId
()));
messageInfo
.
setMessage
(
message
);
return
messageInfo
;
}
...
...
family-doctor-server/src/main/java/com/ebaiyihui/family/doctor/server/service/impl/PatientServiceImpl.java
浏览文件 @
5b871dc8
...
...
@@ -20,10 +20,7 @@ import com.ebaiyihui.family.doctor.server.mapper.PatientSignMapper;
import
com.ebaiyihui.family.doctor.server.mapper.ScheduleRecordMapper
;
import
com.ebaiyihui.family.doctor.server.mapper.ServiceConfigMapper
;
import
com.ebaiyihui.family.doctor.server.rabbitmq.RabbitProduct
;
import
com.ebaiyihui.family.doctor.server.service.GoEasyPushService
;
import
com.ebaiyihui.family.doctor.server.service.ImChatTemplate
;
import
com.ebaiyihui.family.doctor.server.service.ImMsgTemplateService
;
import
com.ebaiyihui.family.doctor.server.service.PatientService
;
import
com.ebaiyihui.family.doctor.server.service.*
;
import
com.ebaiyihui.family.doctor.server.util.DateUtils
;
import
com.ebaiyihui.family.doctor.server.util.ThirdOrderPushUtil
;
import
com.ebaiyihui.family.doctor.server.util.UUIDUtil
;
...
...
@@ -77,6 +74,9 @@ public class PatientServiceImpl implements PatientService {
@Autowired
private
RabbitProduct
rabbitProduct
;
@Autowired
private
HisTemplateService
hisTemplateService
;
@Override
public
BaseResponse
<
String
>
signedDoctor
(
SignedDoctorDTO
reqVo
)
{
...
...
@@ -202,9 +202,14 @@ public class PatientServiceImpl implements PatientService {
if
(
Objects
.
nonNull
(
oldPatientSignEntity
))
{
patientSignEntity
.
setSignId
(
oldPatientSignEntity
.
getId
());
}
// 云his挂号
BaseResponse
<
Object
>
response
=
hisTemplateService
.
registrationAndTreatment
(
patientSignEntity
);
if
(
response
.
isSuccess
()){
patientSignEntity
.
setClinicCode
(
response
.
getData
().
toString
());
}
else
{
throw
new
BusinessException
(
"his挂号失败"
);
}
patientSignMapper
.
insert
(
patientSignEntity
);
//创建IM
BaseResponse
createImResponse
=
imChatTemplate
.
createImSession
(
patientSignEntity
);
if
(!
createImResponse
.
isSuccess
())
{
...
...
family-doctor-server/src/main/resources/application-test.yml
浏览文件 @
5b871dc8
...
...
@@ -83,3 +83,4 @@ projprops:
archiving
:
https://his-dev.chinachdu.com/basic-api/sdk-service/appoint/register/archiving
refund
:
https://his-dev.chinachdu.com/basic-api/sdk-service/order/refund
checkDocAndDeptAndRegFeeInfo
:
https://his-dev.chinachdu.com/basic-api/sdk-service/appoint/checkDocAndDeptAndRegFeeInfo
icdSearchName
:
https://testapi.chinachdu.com/NCZK/medicalcloud//api/icd/v1/search/name
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论