Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hphy
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
向怀芳
hphy
Commits
fedf2d0d
Commit
fedf2d0d
authored
Jan 29, 2021
by
向怀芳
🎱
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调整导医参数
调整导医返回结构
parent
b7414e6a
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
103 additions
and
18 deletions
+103
-18
HphyEvaController.java
.../stc/sict/theme/hphy/controller/mp/HphyEvaController.java
+14
-9
WDController.java
...cn/sh/stc/sict/theme/hphy/controller/mp/WDController.java
+8
-2
HpDocInfoService.java
...a/cn/sh/stc/sict/theme/hphy/service/HpDocInfoService.java
+6
-0
HphyGuideMatchService.java
...sh/stc/sict/theme/hphy/service/HphyGuideMatchService.java
+3
-0
HpDocInfoServiceImpl.java
...tc/sict/theme/hphy/service/impl/HpDocInfoServiceImpl.java
+51
-0
HphyGuideMatchServiceImpl.java
...ct/theme/hphy/service/impl/HphyGuideMatchServiceImpl.java
+9
-0
HphyGuideRecordServiceImpl.java
...t/theme/hphy/service/impl/HphyGuideRecordServiceImpl.java
+4
-1
PythonUtil.java
.../main/java/cn/sh/stc/sict/theme/hphy/util/PythonUtil.java
+2
-3
DoctorMatchVO.java
...main/java/cn/sh/stc/sict/theme/hphy/vo/DoctorMatchVO.java
+2
-0
DoctorPatientMatchVO.java
...va/cn/sh/stc/sict/theme/hphy/vo/DoctorPatientMatchVO.java
+4
-3
No files found.
smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/controller/mp/HphyEvaController.java
View file @
fedf2d0d
...
...
@@ -2,6 +2,7 @@ package cn.sh.stc.sict.theme.hphy.controller.mp;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.json.JSONArray
;
import
cn.hutool.json.JSONObject
;
import
cn.hutool.json.JSONUtil
;
import
cn.sh.stc.sict.cloud.common.core.constant.Constant
;
import
cn.sh.stc.sict.cloud.common.core.util.NumberUtil
;
...
...
@@ -10,10 +11,7 @@ import cn.sh.stc.sict.cloud.common.security.util.SecurityUtils;
import
cn.sh.stc.sict.theme.common.dto.SocketMsg
;
import
cn.sh.stc.sict.theme.handler.WebSocketServer
;
import
cn.sh.stc.sict.theme.hphy.constant.PatientConstant
;
import
cn.sh.stc.sict.theme.hphy.model.HphyDoctor
;
import
cn.sh.stc.sict.theme.hphy.model.HphyGuideQuestion
;
import
cn.sh.stc.sict.theme.hphy.model.HphyGuideRecord
;
import
cn.sh.stc.sict.theme.hphy.model.HphyPatientBase
;
import
cn.sh.stc.sict.theme.hphy.model.*
;
import
cn.sh.stc.sict.theme.hphy.service.*
;
import
cn.sh.stc.sict.theme.hphy.util.GuideUtil
;
import
cn.sh.stc.sict.theme.hphy.util.PythonCompareParam
;
...
...
@@ -54,7 +52,8 @@ public class HphyEvaController {
private
final
HphyGuideRecordService
hphyGuideRecordService
;
private
final
HphyQuestionService
hphyQuestionService
;
private
final
HphyGuideQuestionService
hphyGuideQuestionService
;
private
final
HphyDoctorService
hphyDoctorService
;
// private final HphyDoctorService hphyDoctorService;
private
final
HpDocInfoService
hpDocInfoService
;
/**
...
...
@@ -171,18 +170,24 @@ public class HphyEvaController {
* 年龄,地址,disease
*/
HphyPatientBase
patient
=
hphyPatientBaseService
.
getById
(
patientId
);
HphyDoctor
doctor
=
hphyDoctorService
.
getById
(
doctorId
);
// HphyDoctor doctor = hphyDoctorService.getById(doctorId);
HpDocInfo
doctor
=
hpDocInfoService
.
getById
(
doctorId
);
HphyGuideRecord
guide
=
hphyGuideRecordService
.
getById
(
guideId
);
List
<
LabelVO
>
patientList
=
GuideUtil
.
getPatientList
(
patient
,
guide
);
List
<
String
>
disease
=
GuideUtil
.
getPatientDisease
(
guide
);
PythonCompareParam
param
=
new
PythonCompareParam
(
patient
.
getCertId
(),
doctorId
,
patient
.
getAge
(),
disease
);
JSONArray
doctorList
=
PythonUtil
.
getMatchLabel
(
JSONUtil
.
toJsonStr
(
param
));
PythonCompareParam
param
=
new
PythonCompareParam
(
patient
.
getCertId
(),
doctor
.
getPersonId
(),
patient
.
getAge
(),
disease
);
JSONObject
object
=
PythonUtil
.
getMatchLabel
(
JSONUtil
.
toJsonStr
(
param
));
JSONArray
doctorList
=
(
JSONArray
)
object
.
getByPath
(
"doctor.list"
);
JSONArray
patientJList
=
(
JSONArray
)
object
.
getByPath
(
"patient.list"
);
DoctorPatientMatchVO
vo
=
DoctorPatientMatchVO
.
builder
()
.
patient
(
patient
)
.
patientLabelList
(
patientList
)
.
patientLabelList1
(
patientList
)
.
patientLabelList2
(
patientJList
)
.
doctor
(
doctor
)
.
doctorLabelList
(
doctorList
)
.
build
();
return
new
R
(
vo
);
}
...
...
smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/controller/mp/WDController.java
View file @
fedf2d0d
package
cn
.
sh
.
stc
.
sict
.
theme
.
hphy
.
controller
.
mp
;
import
cn.sh.stc.sict.cloud.common.core.util.R
;
import
cn.sh.stc.sict.theme.hphy.wd.NumSourceInfo
;
import
cn.sh.stc.sict.theme.hphy.wd.WanDaHttpUtil
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
...
...
@@ -9,6 +10,8 @@ import org.springframework.web.bind.annotation.GetMapping;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.List
;
/**
* @author F_xh
*/
...
...
@@ -28,7 +31,10 @@ public class WDController {
@ApiOperation
(
"获取号源信息"
)
@GetMapping
(
"/num/info"
)
public
R
getOrderNumberInfo
()
{
return
new
R
();
public
R
getOrderNumberInfo
(
NumSourceInfo
numSourceInfo
)
{
List
<
NumSourceInfo
>
list
=
WanDaHttpUtil
.
getOrderNumInfo
(
numSourceInfo
);
return
new
R
(
list
);
}
}
smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/service/HpDocInfoService.java
View file @
fedf2d0d
package
cn
.
sh
.
stc
.
sict
.
theme
.
hphy
.
service
;
import
cn.sh.stc.sict.theme.hphy.model.HpDocInfo
;
import
cn.sh.stc.sict.theme.hphy.model.HphyGuideRecord
;
import
cn.sh.stc.sict.theme.hphy.vo.DoctorMatchVO
;
import
cn.sh.stc.sict.theme.hphy.vo.PythonResult
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
java.util.List
;
/**
* (HpDocInfo)表服务接口
*
...
...
@@ -18,4 +23,5 @@ public interface HpDocInfoService extends IService<HpDocInfo> {
*/
boolean
doctorExist
(
String
resourceCode
);
List
<
DoctorMatchVO
>
getRecommendList
(
HphyGuideRecord
guide
,
List
<
PythonResult
>
pythonList
);
}
\ No newline at end of file
smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/service/HphyGuideMatchService.java
View file @
fedf2d0d
...
...
@@ -4,6 +4,8 @@ package cn.sh.stc.sict.theme.hphy.service;
import
cn.sh.stc.sict.theme.hphy.model.HphyGuideMatch
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
java.util.List
;
/**
* 导医推荐记录
*
...
...
@@ -11,5 +13,6 @@ import com.baomidou.mybatisplus.extension.service.IService;
* @date 2021-01-04 13:52:44
*/
public
interface
HphyGuideMatchService
extends
IService
<
HphyGuideMatch
>
{
void
asyncSaveBatch
(
List
<
HphyGuideMatch
>
matchList
);
}
smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/service/impl/HpDocInfoServiceImpl.java
View file @
fedf2d0d
...
...
@@ -2,10 +2,23 @@ package cn.sh.stc.sict.theme.hphy.service.impl;
import
cn.sh.stc.sict.theme.hphy.dao.HpDocInfoMapper
;
import
cn.sh.stc.sict.theme.hphy.model.HpDocInfo
;
import
cn.sh.stc.sict.theme.hphy.model.HphyGuideMatch
;
import
cn.sh.stc.sict.theme.hphy.model.HphyGuideRecord
;
import
cn.sh.stc.sict.theme.hphy.service.HpDocInfoService
;
import
cn.sh.stc.sict.theme.hphy.service.HphyGuideMatchService
;
import
cn.sh.stc.sict.theme.hphy.vo.DoctorMatchVO
;
import
cn.sh.stc.sict.theme.hphy.vo.PythonResult
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
lombok.AllArgsConstructor
;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
import
java.util.Comparator
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
/**
* (HpDocInfo)表服务实现类
*
...
...
@@ -13,10 +26,48 @@ import org.springframework.stereotype.Service;
* @since 2021-01-28 10:35:59
*/
@Service
(
"hpDocInfoService"
)
@AllArgsConstructor
public
class
HpDocInfoServiceImpl
extends
ServiceImpl
<
HpDocInfoMapper
,
HpDocInfo
>
implements
HpDocInfoService
{
private
HphyGuideMatchService
hphyGuideMatchService
;
@Override
public
boolean
doctorExist
(
String
resourceCode
)
{
return
this
.
getById
(
resourceCode
)
!=
null
;
}
@Override
public
List
<
DoctorMatchVO
>
getRecommendList
(
HphyGuideRecord
guide
,
List
<
PythonResult
>
pythonList
)
{
List
<
DoctorMatchVO
>
result
=
new
ArrayList
<>();
Map
<
String
,
Double
>
matchMap
=
pythonList
.
stream
().
collect
(
Collectors
.
toMap
(
PythonResult:
:
getDoctorId
,
PythonResult:
:
getMatchScore
));
List
<
String
>
doctorIdList
=
pythonList
.
stream
().
map
(
PythonResult:
:
getDoctorId
).
collect
(
Collectors
.
toList
());
LambdaQueryWrapper
<
HpDocInfo
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
in
(
HpDocInfo:
:
getPersonId
,
doctorIdList
);
List
<
HpDocInfo
>
list
=
this
.
list
(
wrapper
);
List
<
HphyGuideMatch
>
matchList
=
new
ArrayList
<>();
list
.
forEach
(
doctor
->
{
DoctorMatchVO
vo
=
new
DoctorMatchVO
();
vo
.
setDocInfo
(
doctor
);
vo
.
setMatchScore
(
matchMap
.
getOrDefault
(
doctor
.
getPersonId
(),
85.0
));
result
.
add
(
vo
);
HphyGuideMatch
match
=
new
HphyGuideMatch
();
match
.
setDeptId
(
doctor
.
getDeptCode
());
match
.
setDeptName
(
doctor
.
getDeptName
());
match
.
setDoctorId
(
doctor
.
getResourceCode
());
match
.
setDoctorName
(
doctor
.
getResourceName
());
match
.
setGuideId
(
guide
.
getId
());
match
.
setHospId
(
doctor
.
getHosOrgCode
());
match
.
setHospName
(
doctor
.
getHosName
());
match
.
setMatchScore
(
vo
.
getMatchScore
().
toString
());
match
.
setPatientId
(
guide
.
getPatientId
());
match
.
setPatientName
(
guide
.
getPatientName
());
matchList
.
add
(
match
);
});
// 保存医生推荐记录
hphyGuideMatchService
.
asyncSaveBatch
(
matchList
);
return
result
.
stream
()
.
sorted
(
Comparator
.
comparing
(
DoctorMatchVO:
:
getMatchScore
).
reversed
())
.
collect
(
Collectors
.
toList
());
}
}
\ No newline at end of file
smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/service/impl/HphyGuideMatchServiceImpl.java
View file @
fedf2d0d
...
...
@@ -6,11 +6,20 @@ import cn.sh.stc.sict.theme.hphy.model.HphyGuideMatch;
import
cn.sh.stc.sict.theme.hphy.service.HphyGuideMatchService
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
lombok.AllArgsConstructor
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
@Service
(
"hphyGuideMatchService"
)
@AllArgsConstructor
public
class
HphyGuideMatchServiceImpl
extends
ServiceImpl
<
HphyGuideMatchMapper
,
HphyGuideMatch
>
implements
HphyGuideMatchService
{
private
final
HphyGuideMatchMapper
hphyGuideMatchMapper
;
@Override
@Async
public
void
asyncSaveBatch
(
List
<
HphyGuideMatch
>
matchList
)
{
this
.
saveBatch
(
matchList
);
}
}
smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/service/impl/HphyGuideRecordServiceImpl.java
View file @
fedf2d0d
...
...
@@ -14,6 +14,7 @@ import cn.sh.stc.sict.theme.hphy.constant.PatientConstant;
import
cn.sh.stc.sict.theme.hphy.dao.HphyGuideRecordMapper
;
import
cn.sh.stc.sict.theme.hphy.model.HphyGuideRecord
;
import
cn.sh.stc.sict.theme.hphy.model.HphyPatientBase
;
import
cn.sh.stc.sict.theme.hphy.service.HpDocInfoService
;
import
cn.sh.stc.sict.theme.hphy.service.HphyDoctorService
;
import
cn.sh.stc.sict.theme.hphy.service.HphyGuideRecordService
;
import
cn.sh.stc.sict.theme.hphy.service.HphyPatientBaseService
;
...
...
@@ -43,6 +44,7 @@ public class HphyGuideRecordServiceImpl extends ServiceImpl<HphyGuideRecordMappe
private
final
HphyDoctorService
hphyDoctorService
;
private
final
HphyPatientBaseService
hphyPatientBaseService
;
private
final
HphyArticleService
hphyArticleService
;
private
final
HpDocInfoService
hpDocInfoService
;
/**
* 初始化导医记录
...
...
@@ -290,7 +292,8 @@ public class HphyGuideRecordServiceImpl extends ServiceImpl<HphyGuideRecordMappe
// indicator 0-字符串 1-json
if
(
Constant
.
STRING_YES
.
equals
(
obj
.
getStr
(
"indicator"
)))
{
List
<
PythonResult
>
pythonList
=
JSON
.
parseArray
(
obj
.
getStr
(
"data"
),
PythonResult
.
class
);
List
<
DoctorMatchVO
>
resultList
=
hphyDoctorService
.
getRecommendList
(
guide
,
pythonList
);
// List<DoctorMatchVO> resultList = hphyDoctorService.getRecommendList(guide, pythonList);
List
<
DoctorMatchVO
>
resultList
=
hpDocInfoService
.
getRecommendList
(
guide
,
pythonList
);
result
.
put
(
"doctorList"
,
resultList
);
return
new
R
(
result
).
setBizCode
(
200
);
}
else
{
...
...
smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/util/PythonUtil.java
View file @
fedf2d0d
...
...
@@ -37,7 +37,7 @@ public class PythonUtil {
* @param params
* @return
*/
public
static
JSON
Array
getMatchLabel
(
String
params
)
{
public
static
JSON
Object
getMatchLabel
(
String
params
)
{
log
.
error
(
"getMatchLabel->params--->{}"
,
params
);
String
url
=
"http://173.18.1.63:9004/hello?aa="
+
params
;
...
...
@@ -48,8 +48,7 @@ public class PythonUtil {
log
.
error
(
"getMatchLabel->pyresult-------------> {}"
,
body
);
if
(
JSONUtil
.
isJsonObj
(
body
)){
JSONObject
obj
=
JSONUtil
.
parseObj
(
body
);
JSONArray
list
=
obj
.
getJSONArray
(
"list"
);
return
list
;
return
obj
;
}
return
null
;
}
...
...
smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/vo/DoctorMatchVO.java
View file @
fedf2d0d
package
cn
.
sh
.
stc
.
sict
.
theme
.
hphy
.
vo
;
import
cn.sh.stc.sict.theme.hphy.model.HpDocInfo
;
import
cn.sh.stc.sict.theme.hphy.model.HphyDoctor
;
import
lombok.Data
;
@Data
public
class
DoctorMatchVO
{
private
HphyDoctor
doctor
;
private
HpDocInfo
docInfo
;
private
Double
matchScore
;
}
smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/vo/DoctorPatientMatchVO.java
View file @
fedf2d0d
package
cn
.
sh
.
stc
.
sict
.
theme
.
hphy
.
vo
;
import
cn.hutool.json.JSONArray
;
import
cn.sh.stc.sict.theme.hphy.model.Hp
hyDoctor
;
import
cn.sh.stc.sict.theme.hphy.model.Hp
DocInfo
;
import
cn.sh.stc.sict.theme.hphy.model.HphyPatientBase
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
...
...
@@ -18,9 +18,10 @@ public class DoctorPatientMatchVO {
// 患者信息
private
HphyPatientBase
patient
;
// 患者标签
private
List
<
LabelVO
>
patientLabelList
;
private
List
<
LabelVO
>
patientLabelList1
;
private
JSONArray
patientLabelList2
;
// 医生信息
private
Hp
hyDoctor
doctor
;
private
Hp
DocInfo
doctor
;
// 医生标签
private
JSONArray
doctorLabelList
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment