hh-doctor-sdk 0.3.2 → 0.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/consultation/detail/behaviors/consultation-behaviors.js +0 -2
- package/components/consultation/detail/behaviors/consultation-header-media-behaviors.js +5 -64
- package/components/consultation/detail/widget/chat-bottom/chat-menu-builder.js +4 -4
- package/components/hh-navigation.js +3 -2
- package/components/pathology/pathology-page.js +70 -27
- package/components/pathology/pathology-page.json +1 -0
- package/components/pathology/pathology-page.wxml +4 -1
- package/components/pathology/pathology-page.wxss +6 -0
- package/components/video-chat-page/behaviors/chat-files-behaviors.js +26 -58
- package/components/video-chat-page/video-chat-page.js +5 -0
- package/package.json +1 -1
|
@@ -30,7 +30,6 @@ module.exports = Behavior({
|
|
|
30
30
|
headerTexts: [], // 头部文字部分
|
|
31
31
|
mediaInfo: [], // 头部媒体数据部分
|
|
32
32
|
_mediaFiles: [],
|
|
33
|
-
dicoms: [], // DICOM数据
|
|
34
33
|
messageDatas: [], // 原始信息流数据
|
|
35
34
|
messages: [], // 构建信息流数据
|
|
36
35
|
messageMediaFiles: [], // 图片和视频数据
|
|
@@ -45,7 +44,6 @@ module.exports = Behavior({
|
|
|
45
44
|
})
|
|
46
45
|
wx.stopPullDownRefresh()
|
|
47
46
|
this.buildOrderInfo()
|
|
48
|
-
this.loadDicom()
|
|
49
47
|
this.selectComponent('#chat-bottom').initMenuData()
|
|
50
48
|
})
|
|
51
49
|
},
|
|
@@ -11,23 +11,6 @@ module.exports = Behavior({
|
|
|
11
11
|
},
|
|
12
12
|
|
|
13
13
|
methods: {
|
|
14
|
-
/**
|
|
15
|
-
* 加载DICOM数据
|
|
16
|
-
*/
|
|
17
|
-
loadDicom() {
|
|
18
|
-
wx.statLog.sendStatLog(this.data.orderId, '获取订单中的DICOM数据')
|
|
19
|
-
dicomApi.getDicom(this.data.orderId).then((res) => {
|
|
20
|
-
wx.statLog.sendStatLog(this.data.orderId, '获取订单中的DICOM数据完成')
|
|
21
|
-
if (res.status == 200 && res.data && res.data.list && res.data.list.length > 0) {
|
|
22
|
-
this.setData({
|
|
23
|
-
dicoms: res.data.list
|
|
24
|
-
})
|
|
25
|
-
}
|
|
26
|
-
}).catch((err) => {
|
|
27
|
-
wx.statLog.sendStatLog(this.data.orderId, `获取订单中的DICOM数据失败(${JSON.stringify(err)})`)
|
|
28
|
-
})
|
|
29
|
-
},
|
|
30
|
-
|
|
31
14
|
/**
|
|
32
15
|
* 构建多媒体文件数据
|
|
33
16
|
* @param {*} index 分组下标
|
|
@@ -100,7 +83,7 @@ module.exports = Behavior({
|
|
|
100
83
|
groupIndex++
|
|
101
84
|
}
|
|
102
85
|
if (order.patient.patientBingli && order.patient.patientBingli.length > 0) {
|
|
103
|
-
mediaGroups.push(this.mediaItem(groupIndex, 6, '病理', [], '
|
|
86
|
+
mediaGroups.push(this.mediaItem(groupIndex, 6, '病理', [], 'https://image.hh-medic.com/icon/pacs/hh_icon_bingli.png', '点击查看'))
|
|
104
87
|
groupIndex++
|
|
105
88
|
}
|
|
106
89
|
this.setData({
|
|
@@ -146,59 +129,17 @@ module.exports = Behavior({
|
|
|
146
129
|
} else if (media.type == 1) { // PDF
|
|
147
130
|
const files = media.files
|
|
148
131
|
pdfViewer.viewPdfs(files)
|
|
149
|
-
} else if (media.type == 2) {
|
|
150
|
-
this.
|
|
132
|
+
} else if (media.type == 2) { // dicom
|
|
133
|
+
hhNavigation.pathology(this.data.orderId, null, null, true)
|
|
151
134
|
} else if (media.type == 5) {
|
|
152
135
|
if (media.files && media.files.length > 0) {
|
|
153
136
|
const url = media.files[0].url
|
|
154
137
|
hhNavigation.webPage(url)
|
|
155
138
|
}
|
|
156
|
-
} else if (media.type == 6) {
|
|
139
|
+
} else if (media.type == 6) { // 病理
|
|
157
140
|
let hospitalId = this.data.order.doctor.hospitalid
|
|
158
|
-
hhNavigation.pathology(this.data.orderId, hospitalId)
|
|
159
|
-
}
|
|
160
|
-
},
|
|
161
|
-
|
|
162
|
-
/**
|
|
163
|
-
* 存在多个DICOM需要显示列表选择点击后查看单个DICOM
|
|
164
|
-
*/
|
|
165
|
-
viewDicoms() {
|
|
166
|
-
if (this.data.dicoms.length == 0) {
|
|
167
|
-
wx.showToast({
|
|
168
|
-
icon: 'none',
|
|
169
|
-
title: '无DICOM可查看',
|
|
170
|
-
})
|
|
171
|
-
return
|
|
141
|
+
hhNavigation.pathology(this.data.orderId, hospitalId, null, false)
|
|
172
142
|
}
|
|
173
|
-
const dicoms = this.data.dicoms
|
|
174
|
-
if (dicoms.length == 1) {
|
|
175
|
-
this.viewDicom(dicoms[0].id)
|
|
176
|
-
} else {
|
|
177
|
-
const items = dicoms.filter((dicom) => {
|
|
178
|
-
return dicom.related == 1
|
|
179
|
-
}).map((file) => {
|
|
180
|
-
return file.name
|
|
181
|
-
})
|
|
182
|
-
wx.showActionSheet({
|
|
183
|
-
itemList: items,
|
|
184
|
-
success: (res) => {
|
|
185
|
-
const id = dicoms[res.tapIndex].id
|
|
186
|
-
this.viewDicom(id)
|
|
187
|
-
},
|
|
188
|
-
fail: function (ers) {
|
|
189
|
-
|
|
190
|
-
}
|
|
191
|
-
})
|
|
192
|
-
}
|
|
193
|
-
},
|
|
194
|
-
|
|
195
|
-
/**
|
|
196
|
-
* 查看单个DICOM数据
|
|
197
|
-
* @param {*} id dicom的ID
|
|
198
|
-
*/
|
|
199
|
-
viewDicom(id) {
|
|
200
|
-
const url = dicomApi.dicomUrl(id)
|
|
201
|
-
hhNavigation.webPage(url)
|
|
202
143
|
},
|
|
203
144
|
}
|
|
204
145
|
})
|
|
@@ -55,6 +55,7 @@ function _videoMenus(order) {
|
|
|
55
55
|
var menus = []
|
|
56
56
|
const state = order.state
|
|
57
57
|
if (state == OrderState.rejected) {
|
|
58
|
+
menus.push(_menu(ChatEventType.reply, '回复意见', 1))
|
|
58
59
|
return menus
|
|
59
60
|
}
|
|
60
61
|
const isSetTime = order.provideTime || 0 > 10000
|
|
@@ -67,8 +68,8 @@ function _videoMenus(order) {
|
|
|
67
68
|
menus.push(_menu(ChatEventType.reply, '回复意见', 1))
|
|
68
69
|
} else {
|
|
69
70
|
menus.push(_menu(ChatEventType.refuse, '拒绝'))
|
|
71
|
+
menus.push(_menu(ChatEventType.reply, '回复意见', 1))
|
|
70
72
|
menus.push(_menu(ChatEventType.setTime, '设置时间'))
|
|
71
|
-
// menus.push(_menu(ChatEventType.videoMore, '更多'))
|
|
72
73
|
}
|
|
73
74
|
return menus
|
|
74
75
|
}
|
|
@@ -92,6 +93,7 @@ function _feidaoMenus(order) {
|
|
|
92
93
|
// }
|
|
93
94
|
menus.push(_menu(ChatEventType.visitConfirm, '可行手术'))
|
|
94
95
|
menus.push(_menu(ChatEventType.visitReject, '无法手术', 1))
|
|
96
|
+
menus.push(_menu(ChatEventType.reply, '回复意见', 1))
|
|
95
97
|
return menus
|
|
96
98
|
}
|
|
97
99
|
|
|
@@ -122,10 +124,8 @@ function _normalMenus(order) {
|
|
|
122
124
|
case OrderState.finished:
|
|
123
125
|
if (haveInvite) {
|
|
124
126
|
menus.push(_menu(ChatEventType.discuss, '内部讨论'))
|
|
125
|
-
menus.push(_menu(ChatEventType.reply, '回复意见', 1))
|
|
126
|
-
} else {
|
|
127
|
-
menus.push(_menu(ChatEventType.reply, '回复意见', 1))
|
|
128
127
|
}
|
|
128
|
+
menus.push(_menu(ChatEventType.reply, '回复意见', 1))
|
|
129
129
|
break
|
|
130
130
|
default:
|
|
131
131
|
menus.push(_menu(ChatEventType.reply, '回复意见', 1))
|
|
@@ -77,10 +77,11 @@ function videoChat(orderId, doctorId, isTest, callback) {
|
|
|
77
77
|
})
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
-
function pathology(orderId, hospitalId, path) {
|
|
80
|
+
function pathology(orderId, hospitalId, path, forDicom) {
|
|
81
81
|
let params = {
|
|
82
82
|
'orderId': orderId,
|
|
83
|
-
'hospitalId': hospitalId
|
|
83
|
+
'hospitalId': hospitalId,
|
|
84
|
+
'forDicom': forDicom || false
|
|
84
85
|
}
|
|
85
86
|
if (path) {
|
|
86
87
|
params['path'] = path
|
|
@@ -13,6 +13,7 @@ Page({
|
|
|
13
13
|
orderId: null,
|
|
14
14
|
hospitalId: null,
|
|
15
15
|
path: null,
|
|
16
|
+
forDicom: false,
|
|
16
17
|
list: [],
|
|
17
18
|
},
|
|
18
19
|
|
|
@@ -23,6 +24,7 @@ Page({
|
|
|
23
24
|
const orderId = options.orderId
|
|
24
25
|
const hospitalId = options.hospitalId
|
|
25
26
|
let path = options.path || null
|
|
27
|
+
let forDicom = options.forDicom || false
|
|
26
28
|
if (path != null) {
|
|
27
29
|
path = decodeURIComponent(path)
|
|
28
30
|
}
|
|
@@ -35,6 +37,7 @@ Page({
|
|
|
35
37
|
orderId: orderId,
|
|
36
38
|
hospitalId: hospitalId,
|
|
37
39
|
path: path,
|
|
40
|
+
forDicom: forDicom,
|
|
38
41
|
})
|
|
39
42
|
},
|
|
40
43
|
|
|
@@ -88,43 +91,83 @@ Page({
|
|
|
88
91
|
},
|
|
89
92
|
|
|
90
93
|
clickCell: function (event) {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
+
if (this.data.forDicom) {
|
|
95
|
+
const id = event.currentTarget.dataset.id
|
|
96
|
+
const url = dicomApi.dicomUrl(id)
|
|
97
|
+
hhNavigation.webPage(url)
|
|
94
98
|
} else {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
99
|
+
const name = event.currentTarget.dataset.name
|
|
100
|
+
if (this.data.path == null) {
|
|
101
|
+
hhNavigation.pathology(this.data.orderId, this.data.hospitalId, name, false)
|
|
102
|
+
} else {
|
|
103
|
+
dicomApi.getPatholotyDetail(this.data.hospitalId, this.data.orderId, name).then((res) => {
|
|
104
|
+
const dataEncode = encodeURIComponent(JSON.stringify(res.data))
|
|
105
|
+
const base64Params = base64Utils.base64Encode(dataEncode)
|
|
106
|
+
const url = `${basePathologyUrl}?para=${base64Params}`
|
|
107
|
+
hhNavigation.webPage(url)
|
|
108
|
+
})
|
|
109
|
+
}
|
|
101
110
|
}
|
|
102
111
|
},
|
|
103
112
|
|
|
104
113
|
_loadList() {
|
|
105
|
-
wx.
|
|
106
|
-
|
|
114
|
+
wx.setNavigationBarTitle({
|
|
115
|
+
title: '加载中...',
|
|
116
|
+
})
|
|
117
|
+
this._loading(true)
|
|
107
118
|
const orderId = this.data.orderId
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
this.setData({
|
|
114
|
-
list: res.data.list,
|
|
115
|
-
})
|
|
116
|
-
if (!path || path == null) {
|
|
119
|
+
if (this.data.forDicom) {
|
|
120
|
+
dicomApi.getDicom(this.data.orderId).then((res) => {
|
|
121
|
+
wx.statLog.sendStatLog(this.data.orderId, '获取订单中的DICOM数据完成')
|
|
122
|
+
this._loading(false)
|
|
123
|
+
if (res.status == 200 && res.data && res.data.list && res.data.list.length > 0) {
|
|
117
124
|
wx.setNavigationBarTitle({
|
|
118
125
|
title: res.data.hospital,
|
|
119
126
|
})
|
|
127
|
+
let list = res.data.list.filter((item) => item.related == 1)
|
|
128
|
+
this.setData({
|
|
129
|
+
list: list
|
|
130
|
+
})
|
|
120
131
|
}
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
wx.stopPullDownRefresh()
|
|
125
|
-
wx.showToast({
|
|
126
|
-
title: '加载出错了',
|
|
132
|
+
}).catch((err) => {
|
|
133
|
+
this._loading(false)
|
|
134
|
+
wx.statLog.sendStatLog(this.data.orderId, `获取订单中的DICOM数据失败(${JSON.stringify(err)})`)
|
|
127
135
|
})
|
|
128
|
-
}
|
|
136
|
+
} else {
|
|
137
|
+
const hospitalId = this.data.hospitalId
|
|
138
|
+
const path = this.data.path
|
|
139
|
+
dicomApi.getPatholoty(hospitalId, orderId, path).then(res => {
|
|
140
|
+
wx.statLog.sendStatLog(this.data.orderId, '获取订单中的病理数据完成')
|
|
141
|
+
this._loading(false)
|
|
142
|
+
if (res.data && res.data.list) {
|
|
143
|
+
this.setData({
|
|
144
|
+
list: res.data.list,
|
|
145
|
+
})
|
|
146
|
+
if (!path || path == null) {
|
|
147
|
+
wx.setNavigationBarTitle({
|
|
148
|
+
title: res.data.hospital,
|
|
149
|
+
})
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}).catch((e) => {
|
|
153
|
+
wx.statLog.sendStatLog(this.data.orderId, `获取订单中的DICOM数据失败(${JSON.stringify(e)})`)
|
|
154
|
+
this._loading(false)
|
|
155
|
+
wx.showToast({
|
|
156
|
+
title: '加载出错了',
|
|
157
|
+
})
|
|
158
|
+
})
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
|
|
162
|
+
_loading(loading) {
|
|
163
|
+
if (loading) {
|
|
164
|
+
wx.showNavigationBarLoading()
|
|
165
|
+
wx.setNavigationBarTitle({
|
|
166
|
+
title: '加载中...',
|
|
167
|
+
})
|
|
168
|
+
} else {
|
|
169
|
+
wx.stopPullDownRefresh()
|
|
170
|
+
wx.hideNavigationBarLoading()
|
|
171
|
+
}
|
|
129
172
|
}
|
|
130
173
|
})
|
|
@@ -5,11 +5,14 @@
|
|
|
5
5
|
wx:for="{{list}}"
|
|
6
6
|
wx:key="item"
|
|
7
7
|
data-name="{{item.name}}"
|
|
8
|
+
data-id="{{item.id}}"
|
|
8
9
|
bind:tap="clickCell"
|
|
9
10
|
>
|
|
10
11
|
<view class="tui-col-3-image-container">
|
|
11
12
|
<image class="tui-col-3-image" src="{{item.url}}"></image>
|
|
12
|
-
<view class="tui-col-3-count"
|
|
13
|
+
<view wx:if="{{item.count > 0}}" class="tui-col-3-count"
|
|
14
|
+
>共{{item.count}}张</view
|
|
15
|
+
>
|
|
13
16
|
</view>
|
|
14
17
|
<view class="tui-col-3-name">{{item.name}}</view>
|
|
15
18
|
</view>
|
|
@@ -18,8 +18,8 @@ module.exports = Behavior({
|
|
|
18
18
|
try {
|
|
19
19
|
let orderMediaPromise = new Promise((resolve, reject) => {
|
|
20
20
|
let mediaFiles = []
|
|
21
|
+
let groups = []
|
|
21
22
|
if (order && order.orderComponent && order.orderComponent.componentBaseList) {
|
|
22
|
-
let groups = []
|
|
23
23
|
for (let component of order.orderComponent.componentBaseList) {
|
|
24
24
|
const type = component.type
|
|
25
25
|
const fileList = component.contentCaseImageList
|
|
@@ -83,12 +83,33 @@ module.exports = Behavior({
|
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
86
|
+
}
|
|
87
|
+
let otherFiles = []
|
|
88
|
+
if (order.patient.patientdirs && order.patient.patientdirs.length > 0) {
|
|
89
|
+
otherFiles.push({
|
|
90
|
+
thumb: 'https://imgs.hh-medic.com/icon/hh_consulation_dicom_icon.png',
|
|
91
|
+
type: 'dicom',
|
|
92
|
+
desc: 'DICOM'
|
|
93
|
+
})
|
|
94
|
+
}
|
|
95
|
+
if (order.patient.patientBingli && order.patient.patientBingli.length > 0) {
|
|
96
|
+
otherFiles.push({
|
|
97
|
+
thumb: 'https://image.hh-medic.com/icon/pacs/hh_icon_bingli.png',
|
|
98
|
+
type: 'bingli',
|
|
99
|
+
desc: '病理'
|
|
100
|
+
})
|
|
101
|
+
}
|
|
102
|
+
if (otherFiles.length > 0) {
|
|
103
|
+
groups.push({
|
|
104
|
+
title: 'DICOM影像和病理',
|
|
105
|
+
files: otherFiles
|
|
90
106
|
})
|
|
91
107
|
}
|
|
108
|
+
resolve({
|
|
109
|
+
isNew: false,
|
|
110
|
+
caseGroups: groups,
|
|
111
|
+
mediaFiles: mediaFiles
|
|
112
|
+
})
|
|
92
113
|
})
|
|
93
114
|
|
|
94
115
|
let promises = [orderMediaPromise]
|
|
@@ -171,58 +192,5 @@ module.exports = Behavior({
|
|
|
171
192
|
})
|
|
172
193
|
} catch (e) {}
|
|
173
194
|
},
|
|
174
|
-
|
|
175
|
-
viewOrderCase() {
|
|
176
|
-
wx.previewMedia({
|
|
177
|
-
sources: this.data._mediaFiles,
|
|
178
|
-
})
|
|
179
|
-
},
|
|
180
|
-
|
|
181
|
-
viewPdfFiles() {
|
|
182
|
-
if (this.data.pdfFiles.length == 0) {
|
|
183
|
-
wx.showToast({
|
|
184
|
-
icon: 'none',
|
|
185
|
-
title: '无PDF文件可查看',
|
|
186
|
-
})
|
|
187
|
-
return
|
|
188
|
-
}
|
|
189
|
-
const files = this.data.pdfFiles
|
|
190
|
-
pdfViewer.viewPdfs(files)
|
|
191
|
-
},
|
|
192
|
-
|
|
193
|
-
viewDicoms() {
|
|
194
|
-
if (this.data.dicoms.length == 0) {
|
|
195
|
-
wx.showToast({
|
|
196
|
-
icon: 'none',
|
|
197
|
-
title: '无DICOM可查看',
|
|
198
|
-
})
|
|
199
|
-
return
|
|
200
|
-
}
|
|
201
|
-
const dicoms = this.data.dicoms
|
|
202
|
-
if (dicoms.length == 1) {
|
|
203
|
-
this.viewDicom(dicoms[0].id)
|
|
204
|
-
} else {
|
|
205
|
-
const items = dicoms.filter((dicom) => {
|
|
206
|
-
return dicom.related == 1
|
|
207
|
-
}).map((file) => {
|
|
208
|
-
return file.name
|
|
209
|
-
})
|
|
210
|
-
wx.showActionSheet({
|
|
211
|
-
itemList: items,
|
|
212
|
-
success: (res) => {
|
|
213
|
-
const id = dicoms[res.tapIndex].id
|
|
214
|
-
this.viewDicom(id)
|
|
215
|
-
},
|
|
216
|
-
fail: function (ers) {
|
|
217
|
-
|
|
218
|
-
}
|
|
219
|
-
})
|
|
220
|
-
}
|
|
221
|
-
},
|
|
222
|
-
|
|
223
|
-
viewDicom(id) {
|
|
224
|
-
const url = dicomApi.dicomUrl(id)
|
|
225
|
-
hhNavigation.webPage(url)
|
|
226
|
-
},
|
|
227
195
|
}
|
|
228
196
|
})
|
|
@@ -215,6 +215,11 @@ Page({
|
|
|
215
215
|
pdfViewer.viewPdf(url)
|
|
216
216
|
} else if (type === 'url') {
|
|
217
217
|
hhNavigation.webPage(url)
|
|
218
|
+
} else if (type === 'dicom') {
|
|
219
|
+
hhNavigation.pathology(this.data.orderId, null, null, true)
|
|
220
|
+
} else if (type === 'bingli') {
|
|
221
|
+
let hospitalId = this.data.order.doctor.hospitalid
|
|
222
|
+
hhNavigation.pathology(this.data.orderId, hospitalId, null, false)
|
|
218
223
|
}
|
|
219
224
|
},
|
|
220
225
|
|