hh-doctor-sdk 0.3.1 → 0.3.3

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.
@@ -8,6 +8,10 @@ const apiPaths = {
8
8
  hostType: hostDefine.hostTypes.dicom,
9
9
  path: '/service/querydicom'
10
10
  },
11
+ getPathology: {
12
+ hostType: hostDefine.hostTypes.dicom,
13
+ path: '/api/pathology',
14
+ }
11
15
  }
12
16
 
13
17
  function getDicom(orderId) {
@@ -18,6 +22,30 @@ function getDicom(orderId) {
18
22
  return httpUtils.get(apiPaths.getDicom, params, {})
19
23
  }
20
24
 
25
+ function getPatholoty(hospitalId, orderId, path) {
26
+ let params = {
27
+ 'action': 'listmenu',
28
+ 'hospitalid': hospitalId,
29
+ 'orderid': orderId
30
+ }
31
+ if (path) {
32
+ params['path'] = path
33
+ }
34
+ return httpUtils.get(apiPaths.getPathology, params, {})
35
+ }
36
+
37
+ function getPatholotyDetail(hospitalId, orderId, path) {
38
+ let params = {
39
+ 'action': 'listall',
40
+ 'hospitalid': hospitalId,
41
+ 'orderid': orderId
42
+ }
43
+ if (path) {
44
+ params['path'] = path
45
+ }
46
+ return httpUtils.get(apiPaths.getPathology, params, {})
47
+ }
48
+
21
49
  function dicomUrl(id) {
22
50
  const baseUrl = cache.isTest() ? 'https://test.hh-medic.com/dicom/dicomviewer/viewer.html' : 'https://dicom.hh-medic.com/dicomviewer/viewer.html'
23
51
  const timestamp = new Date().getTime()
@@ -27,5 +55,7 @@ function dicomUrl(id) {
27
55
 
28
56
  module.exports = {
29
57
  getDicom,
30
- dicomUrl
58
+ dicomUrl,
59
+ getPatholoty,
60
+ getPatholotyDetail
31
61
  }
@@ -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
  },
@@ -81,12 +81,14 @@ module.exports = Behavior({
81
81
  messages: list,
82
82
  isRequest: isRequest,
83
83
  }, () => {
84
- wx.createSelectorQuery().select('#scroll-body').boundingClientRect(res => {
85
- wx.pageScrollTo({
86
- scrollTop: res.bottom,
87
- duration: 200
88
- })
89
- }).exec()
84
+ setTimeout(() => {
85
+ wx.createSelectorQuery().select('#scroll-body').boundingClientRect(res => {
86
+ wx.pageScrollTo({
87
+ scrollTop: res.bottom,
88
+ duration: 200
89
+ })
90
+ }).exec()
91
+ }, 500);
90
92
  })
91
93
  }
92
94
  },
@@ -2,6 +2,7 @@ const pdfViewer = require('../../../public/pdf-viewer')
2
2
  const dicomApi = require('../../../apis/dicom-api')
3
3
  const caseImageFilter = require('../widget/case-image-filter')
4
4
  const hhNavigation = require('../../../hh-navigation')
5
+ const cache = require('../../../public/cache-data')
5
6
 
6
7
  module.exports = Behavior({
7
8
 
@@ -10,27 +11,10 @@ module.exports = Behavior({
10
11
  },
11
12
 
12
13
  methods: {
13
- /**
14
- * 加载DICOM数据
15
- */
16
- loadDicom() {
17
- wx.statLog.sendStatLog(this.data.orderId, '获取订单中的DICOM数据')
18
- dicomApi.getDicom(this.data.orderId).then((res) => {
19
- wx.statLog.sendStatLog(this.data.orderId, '获取订单中的DICOM数据完成')
20
- if (res.status == 200 && res.data && res.data.list && res.data.list.length > 0) {
21
- this.setData({
22
- dicoms: res.data.list
23
- })
24
- }
25
- }).catch((err) => {
26
- wx.statLog.sendStatLog(this.data.orderId, `获取订单中的DICOM数据失败(${JSON.stringify(err)})`)
27
- })
28
- },
29
-
30
14
  /**
31
15
  * 构建多媒体文件数据
32
16
  * @param {*} index 分组下标
33
- * @param {*} type 类型 0.图片 1.pdf 2.DICOM 4.视频 5.URL DICOM
17
+ * @param {*} type 类型 0.图片 1.pdf 2.DICOM 4.视频 5.URL DICOM 6.病理
34
18
  * @param {*} label 显示标题
35
19
  * @param {*} files 文件列表
36
20
  */
@@ -98,6 +82,10 @@ module.exports = Behavior({
98
82
  mediaGroups.push(this.mediaItem(groupIndex, 2, 'DICOM', [], 'https://imgs.hh-medic.com/icon/hh_consulation_dicom_icon.png', '点击查看'))
99
83
  groupIndex++
100
84
  }
85
+ if (order.patient.patientBingli && order.patient.patientBingli.length > 0) {
86
+ mediaGroups.push(this.mediaItem(groupIndex, 6, '病理', [], 'https://image.hh-medic.com/icon/pacs/hh_icon_bingli.png', '点击查看'))
87
+ groupIndex++
88
+ }
101
89
  this.setData({
102
90
  mediaInfo: mediaGroups
103
91
  })
@@ -141,56 +129,17 @@ module.exports = Behavior({
141
129
  } else if (media.type == 1) { // PDF
142
130
  const files = media.files
143
131
  pdfViewer.viewPdfs(files)
144
- } else if (media.type == 2) {
145
- this.viewDicoms()
132
+ } else if (media.type == 2) { // dicom
133
+ hhNavigation.pathology(this.data.orderId, null, null, true)
146
134
  } else if (media.type == 5) {
147
135
  if (media.files && media.files.length > 0) {
148
136
  const url = media.files[0].url
149
137
  hhNavigation.webPage(url)
150
138
  }
139
+ } else if (media.type == 6) { // 病理
140
+ let hospitalId = this.data.order.doctor.hospitalid
141
+ hhNavigation.pathology(this.data.orderId, hospitalId, null, false)
151
142
  }
152
143
  },
153
-
154
- /**
155
- * 存在多个DICOM需要显示列表选择点击后查看单个DICOM
156
- */
157
- viewDicoms() {
158
- if (this.data.dicoms.length == 0) {
159
- wx.showToast({
160
- icon: 'none',
161
- title: '无DICOM可查看',
162
- })
163
- return
164
- }
165
- const dicoms = this.data.dicoms
166
- if (dicoms.length == 1) {
167
- this.viewDicom(dicoms[0].id)
168
- } else {
169
- const items = dicoms.filter((dicom) => {
170
- return dicom.related == 1
171
- }).map((file) => {
172
- return file.name
173
- })
174
- wx.showActionSheet({
175
- itemList: items,
176
- success: (res) => {
177
- const id = dicoms[res.tapIndex].id
178
- this.viewDicom(id)
179
- },
180
- fail: function (ers) {
181
-
182
- }
183
- })
184
- }
185
- },
186
-
187
- /**
188
- * 查看单个DICOM数据
189
- * @param {*} id dicom的ID
190
- */
191
- viewDicom(id) {
192
- const url = dicomApi.dicomUrl(id)
193
- hhNavigation.webPage(url)
194
- },
195
144
  }
196
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,11 +124,11 @@ 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
127
  }
128
+ menus.push(_menu(ChatEventType.reply, '回复意见', 1))
127
129
  break
128
130
  default:
129
- // menus.push(_menu(ChatEventType.reply, '回复意见', 1))
131
+ menus.push(_menu(ChatEventType.reply, '回复意见', 1))
130
132
  break;
131
133
  }
132
134
  return menus
@@ -139,7 +141,6 @@ function _normalMenus(order) {
139
141
  function _doctorNormalMenu(order) {
140
142
  var menus = []
141
143
  const state = order.state
142
- console.error(`order state => ${state}`)
143
144
  const isPaySuccess = (order.needPayMoney || 0) <= 0
144
145
  const canFeedback = order.orderMessage && (order.orderMessage.needDoctorFeedback || false)
145
146
  const canAsk = (order.isask || 0) == 1
@@ -145,9 +145,6 @@ module.exports = Behavior({
145
145
  wx.showLoading({
146
146
  title: '保存中...',
147
147
  })
148
-
149
- console.error(JSON.stringify(body))
150
-
151
148
  api.requestReply(type, params, body).then((res) => {
152
149
  wx.hideLoading()
153
150
  if (res.status == 200 && res.data) {
@@ -5,6 +5,7 @@ const pages = {
5
5
  webPage: 'uikit/web-view-page/web-view-page',
6
6
  evaluate: 'consultation/evaluate/evaluate-page',
7
7
  videoChat: 'video-chat-page/video-chat-page',
8
+ pathology: 'pathology/pathology-page'
8
9
  }
9
10
 
10
11
 
@@ -76,6 +77,21 @@ function videoChat(orderId, doctorId, isTest, callback) {
76
77
  })
77
78
  }
78
79
 
80
+ function pathology(orderId, hospitalId, path, forDicom) {
81
+ let params = {
82
+ 'orderId': orderId,
83
+ 'hospitalId': hospitalId,
84
+ 'forDicom': forDicom || false
85
+ }
86
+ if (path) {
87
+ params['path'] = path
88
+ }
89
+ navigateTo(
90
+ pages.pathology,
91
+ params
92
+ )
93
+ }
94
+
79
95
  module.exports = {
80
96
  navigateTo,
81
97
  orderList,
@@ -84,4 +100,5 @@ module.exports = {
84
100
  webPage,
85
101
  evaluate,
86
102
  videoChat,
103
+ pathology,
87
104
  }
@@ -0,0 +1,173 @@
1
+ const dicomApi = require('../apis/dicom-api')
2
+ const hhNavigation = require('../hh-navigation')
3
+ const base64Utils = require('../utils/base64')
4
+
5
+ const basePathologyUrl = 'https://dicom.hh-medic.com/pathology/viewer'
6
+
7
+ Page({
8
+
9
+ /**
10
+ * 页面的初始数据
11
+ */
12
+ data: {
13
+ orderId: null,
14
+ hospitalId: null,
15
+ path: null,
16
+ forDicom: false,
17
+ list: [],
18
+ },
19
+
20
+ /**
21
+ * 生命周期函数--监听页面加载
22
+ */
23
+ onLoad(options) {
24
+ const orderId = options.orderId
25
+ const hospitalId = options.hospitalId
26
+ let path = options.path || null
27
+ let forDicom = options.forDicom || false
28
+ if (path != null) {
29
+ path = decodeURIComponent(path)
30
+ }
31
+ if (path != null) {
32
+ wx.setNavigationBarTitle({
33
+ title: path,
34
+ })
35
+ }
36
+ this.setData({
37
+ orderId: orderId,
38
+ hospitalId: hospitalId,
39
+ path: path,
40
+ forDicom: forDicom,
41
+ })
42
+ },
43
+
44
+ /**
45
+ * 生命周期函数--监听页面初次渲染完成
46
+ */
47
+ onReady() {
48
+ wx.startPullDownRefresh()
49
+ },
50
+
51
+ /**
52
+ * 生命周期函数--监听页面显示
53
+ */
54
+ onShow() {
55
+
56
+ },
57
+
58
+ /**
59
+ * 生命周期函数--监听页面隐藏
60
+ */
61
+ onHide() {
62
+
63
+ },
64
+
65
+ /**
66
+ * 生命周期函数--监听页面卸载
67
+ */
68
+ onUnload() {
69
+
70
+ },
71
+
72
+ /**
73
+ * 页面相关事件处理函数--监听用户下拉动作
74
+ */
75
+ onPullDownRefresh() {
76
+ this._loadList()
77
+ },
78
+
79
+ /**
80
+ * 页面上拉触底事件的处理函数
81
+ */
82
+ onReachBottom() {
83
+
84
+ },
85
+
86
+ /**
87
+ * 用户点击右上角分享
88
+ */
89
+ onShareAppMessage() {
90
+
91
+ },
92
+
93
+ clickCell: function (event) {
94
+ if (this.data.forDicom) {
95
+ const id = event.currentTarget.dataset.id
96
+ const url = dicomApi.dicomUrl(id)
97
+ hhNavigation.webPage(url)
98
+ } else {
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
+ }
110
+ }
111
+ },
112
+
113
+ _loadList() {
114
+ wx.setNavigationBarTitle({
115
+ title: '加载中...',
116
+ })
117
+ this._loading(true)
118
+ const orderId = this.data.orderId
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) {
124
+ wx.setNavigationBarTitle({
125
+ title: res.data.hospital,
126
+ })
127
+ let list = res.data.list.filter((item) => item.related == 1)
128
+ this.setData({
129
+ list: list
130
+ })
131
+ }
132
+ }).catch((err) => {
133
+ this._loading(false)
134
+ wx.statLog.sendStatLog(this.data.orderId, `获取订单中的DICOM数据失败(${JSON.stringify(err)})`)
135
+ })
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
+ }
172
+ }
173
+ })
@@ -0,0 +1,5 @@
1
+ {
2
+ "usingComponents": {},
3
+ "backgroundColor": "#f3f5fb",
4
+ "enablePullDownRefresh": true
5
+ }
@@ -0,0 +1,20 @@
1
+ <view>
2
+ <view class="tui-table-view">
3
+ <view
4
+ class="tui-col-3"
5
+ wx:for="{{list}}"
6
+ wx:key="item"
7
+ data-name="{{item.name}}"
8
+ data-id="{{item.id}}"
9
+ bind:tap="clickCell"
10
+ >
11
+ <view class="tui-col-3-image-container">
12
+ <image class="tui-col-3-image" src="{{item.url}}"></image>
13
+ <view wx:if="{{item.count > 0}}" class="tui-col-3-count"
14
+ >共{{item.count}}张</view
15
+ >
16
+ </view>
17
+ <view class="tui-col-3-name">{{item.name}}</view>
18
+ </view>
19
+ </view>
20
+ </view>
@@ -0,0 +1,58 @@
1
+ page {
2
+ background-color: #f3f5fb;
3
+ width: 100%;
4
+ height: 100%;
5
+ }
6
+
7
+ .tui-table-view {
8
+ display: -webkit-flex;
9
+ display: flex;
10
+ align-items: center;
11
+ justify-content: space-between;
12
+ flex-wrap: wrap;
13
+ width: 90%;
14
+ margin: 0 5%;
15
+ }
16
+ .tui-col-3 {
17
+ width: 47%;
18
+ text-align: center;
19
+ color: #797979;
20
+ padding-top: 20rpx;
21
+ font-size: 30rpx;
22
+ margin-bottom: 20rpx;
23
+ }
24
+
25
+ .tui-col-3-image-container {
26
+ position: relative;
27
+ height: 240rpx;
28
+ border-radius: 6rpx;
29
+ overflow: hidden;
30
+ }
31
+
32
+ .tui-col-3-image {
33
+ width: 100%;
34
+ height: 100%;
35
+ }
36
+
37
+ .tui-col-3-count {
38
+ background-color: rgba(0, 0, 0, 0.3);
39
+ position: absolute;
40
+ right: 0;
41
+ bottom: 0;
42
+ color: white;
43
+ font-size: 32rpx;
44
+ padding: 4rpx 10rpx;
45
+ border-radius: 6rpx;
46
+ }
47
+
48
+ .tui-col-3-name {
49
+ font-size: 32rpx;
50
+ margin-top: 20rpx;
51
+ color: #333333;
52
+ -webkit-line-clamp: 1;
53
+ overflow: hidden;
54
+ text-overflow: ellipsis;
55
+ text-align: start;
56
+ white-space: nowrap;
57
+ -webkit-box-orient: vertical;
58
+ }
@@ -84,6 +84,14 @@ function uuid() {
84
84
  return null
85
85
  }
86
86
 
87
+ function userToken() {
88
+ const doctorInfo = doctor()
89
+ if (doctorInfo) {
90
+ return doctorInfo.userToken
91
+ }
92
+ return null
93
+ }
94
+
87
95
  function videoToken() {
88
96
  const doctorInfo = doctor()
89
97
  if (doctorInfo) {
@@ -130,5 +138,6 @@ module.exports = {
130
138
  getSessionId,
131
139
  getLogId,
132
140
  clearLogId,
133
- isRequest
141
+ isRequest,
142
+ userToken,
134
143
  }
@@ -0,0 +1,67 @@
1
+ // 实现Base64加密
2
+ function base64Encode(str) {
3
+ let base64 = new Base64();
4
+ return base64.encode(str);
5
+ }
6
+
7
+ // 实现Base64解密
8
+ function base64Decode(str) {
9
+ let base64 = new Base64();
10
+ return base64.decode(str);
11
+ }
12
+
13
+ // 定义Base64对象
14
+ function Base64() {
15
+
16
+ // Base64字符集
17
+ const base64Chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
18
+
19
+ // 编码函数
20
+ this.encode = function (str) {
21
+ let result = '';
22
+ for (let i = 0; i < str.length; i += 3) {
23
+ let a = str.charCodeAt(i);
24
+ let b = i + 1 < str.length ? str.charCodeAt(i + 1) : 0;
25
+ let c = i + 2 < str.length ? str.charCodeAt(i + 2) : 0;
26
+
27
+ let a1 = a >> 2,
28
+ a2 = ((a & 3) << 4) | (b >> 4),
29
+ a3 = ((b & 15) << 2) | (c >> 6),
30
+ a4 = c & 63;
31
+
32
+ result += base64Chars[a1] + base64Chars[a2] + (i + 1 < str.length ? base64Chars[a3] : '=') + (i + 2 < str.length ? base64Chars[a4] : '=');
33
+ }
34
+ return result;
35
+ }
36
+
37
+ // 解码函数
38
+ this.decode = function (str) {
39
+ let result = '';
40
+ let i = 0;
41
+ while (i < str.length) {
42
+ let a = base64Chars.indexOf(str.charAt(i++));
43
+ let b = base64Chars.indexOf(str.charAt(i++));
44
+ let c = base64Chars.indexOf(str.charAt(i++));
45
+ let d = base64Chars.indexOf(str.charAt(i++));
46
+
47
+ let a1 = (a << 2) | (b >> 4);
48
+ let a2 = ((b & 15) << 4) | (c >> 2);
49
+ let a3 = ((c & 3) << 6) | d;
50
+
51
+ result += String.fromCharCode(a1);
52
+ if (c != 64) {
53
+ result += String.fromCharCode(a2);
54
+ }
55
+ if (d != 64) {
56
+ result += String.fromCharCode(a3);
57
+ }
58
+ }
59
+ return result;
60
+ }
61
+ }
62
+
63
+ // 向外暴露方法
64
+ module.exports = {
65
+ base64Encode: base64Encode,
66
+ base64Decode: base64Decode
67
+ }
@@ -61,7 +61,7 @@ function _request(request, method, params, data) {
61
61
  const header = {
62
62
  'Accept': 'application/json',
63
63
  'content-type': 'application/json',
64
- 'cookie': cookie,
64
+ // 'cookie': cookie,
65
65
  'APPTYPE': 'pc',
66
66
  'AppKey': appConfig.appKey,
67
67
  'Nonce': nonce,
@@ -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
- resolve({
87
- isNew: false,
88
- caseGroups: groups,
89
- mediaFiles: mediaFiles
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
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hh-doctor-sdk",
3
- "version": "0.3.1",
3
+ "version": "0.3.3",
4
4
  "description": "和缓名医小程序SDK",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"