web-core-tcm 0.0.23 → 0.0.24
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/package.json +41 -21
- package/.editorconfig +0 -7
- package/.github/workflows/test.yml +0 -29
- package/.prettierrc.json +0 -5
- package/.vscode/extensions.json +0 -15
- package/.vscode/settings.json +0 -9
- package/eslint.config.js +0 -83
- package/index.html +0 -24
- package/postcss.config.js +0 -29
- package/public/favicon.ico +0 -0
- package/public/icons/favicon-128x128.png +0 -0
- package/public/icons/favicon-16x16.png +0 -0
- package/public/icons/favicon-32x32.png +0 -0
- package/public/icons/favicon-96x96.png +0 -0
- package/quasar.config.ts +0 -220
- package/src/App.vue +0 -7
- package/src/api/algorithm/comprehensiveAlgorithm.ts +0 -20
- package/src/api/algorithm/index.ts +0 -50
- package/src/api/algorithm/inquiriesAlgorithm.ts +0 -19
- package/src/api/algorithm/inspectionsAlgorithm.ts +0 -11
- package/src/api/algorithm/lisemsAlgorithm.ts +0 -16
- package/src/api/algorithm/pulsationsAlgorithm.ts +0 -9
- package/src/api/authorization/alova/apiDefinitions.ts +0 -23
- package/src/api/authorization/alova/createApis.ts +0 -99
- package/src/api/authorization/alova/globals.d.ts +0 -373
- package/src/api/authorization/alova/implement/authorization.ts +0 -12
- package/src/api/authorization/alova/implement/index.ts +0 -1
- package/src/api/authorization/alova/index.ts +0 -23
- package/src/api/authorization/authorization.ts +0 -16
- package/src/api/authorization/index.ts +0 -2
- package/src/api/check/alova/apiDefinitions.ts +0 -30
- package/src/api/check/alova/createApis.ts +0 -99
- package/src/api/check/alova/globals.d.ts +0 -1248
- package/src/api/check/alova/implement/check.ts +0 -119
- package/src/api/check/alova/implement/index.ts +0 -1
- package/src/api/check/alova/index.ts +0 -23
- package/src/api/check/check.ts +0 -164
- package/src/api/check/index.ts +0 -2
- package/src/api/config/alova/index.ts +0 -72
- package/src/api/config/index.ts +0 -130
- package/src/api/device/device.js +0 -58
- package/src/api/doctor/alova/apiDefinitions.ts +0 -28
- package/src/api/doctor/alova/createApis.ts +0 -99
- package/src/api/doctor/alova/globals.d.ts +0 -550
- package/src/api/doctor/alova/implement/doctor.ts +0 -37
- package/src/api/doctor/alova/implement/index.ts +0 -1
- package/src/api/doctor/alova/index.ts +0 -23
- package/src/api/doctor/doctor.ts +0 -53
- package/src/api/doctor/index.ts +0 -2
- package/src/api/index.ts +0 -15
- package/src/api/metric/implement/index.ts +0 -1
- package/src/api/metric/implement/metric.ts +0 -98
- package/src/api/metric/index.ts +0 -2
- package/src/api/metric/metric.ts +0 -114
- package/src/api/oauth/alova/apiDefinitions.ts +0 -26
- package/src/api/oauth/alova/createApis.ts +0 -99
- package/src/api/oauth/alova/globals.d.ts +0 -451
- package/src/api/oauth/alova/implement/index.ts +0 -1
- package/src/api/oauth/alova/implement/oauth.ts +0 -19
- package/src/api/oauth/alova/index.ts +0 -22
- package/src/api/oauth/index.ts +0 -2
- package/src/api/oauth/oauth.ts +0 -15
- package/src/api/outpatient/alova/apiDefinitions.ts +0 -27
- package/src/api/outpatient/alova/createApis.ts +0 -99
- package/src/api/outpatient/alova/globals.d.ts +0 -676
- package/src/api/outpatient/alova/implement/index.ts +0 -1
- package/src/api/outpatient/alova/implement/outpatient.ts +0 -66
- package/src/api/outpatient/alova/index.ts +0 -23
- package/src/api/outpatient/index.ts +0 -2
- package/src/api/outpatient/outpatient.ts +0 -62
- package/src/api/patient/alova/apiDefinitions.ts +0 -41
- package/src/api/patient/alova/createApis.ts +0 -99
- package/src/api/patient/alova/globals.d.ts +0 -1677
- package/src/api/patient/alova/implement/index.ts +0 -2
- package/src/api/patient/alova/implement/meta.ts +0 -488
- package/src/api/patient/alova/implement/patient.ts +0 -77
- package/src/api/patient/alova/index.ts +0 -24
- package/src/api/patient/core.ts +0 -131
- package/src/api/patient/index.ts +0 -4
- package/src/api/patient/meta.ts +0 -466
- package/src/api/patient/patient.ts +0 -98
- package/src/api/prescription/alova/apiDefinitions.ts +0 -29
- package/src/api/prescription/alova/createApis.ts +0 -99
- package/src/api/prescription/alova/globals.d.ts +0 -959
- package/src/api/prescription/alova/implement/herbal.ts +0 -48
- package/src/api/prescription/alova/implement/index.ts +0 -2
- package/src/api/prescription/alova/implement/prescription.ts +0 -45
- package/src/api/prescription/alova/index.ts +0 -23
- package/src/api/prescription/herbal.ts +0 -44
- package/src/api/prescription/index.ts +0 -3
- package/src/api/prescription/prescription.ts +0 -68
- package/src/api/scientist/alova/apiDefinitions.ts +0 -27
- package/src/api/scientist/alova/createApis.ts +0 -99
- package/src/api/scientist/alova/globals.d.ts +0 -438
- package/src/api/scientist/alova/implement/index.ts +0 -1
- package/src/api/scientist/alova/implement/scientist.ts +0 -29
- package/src/api/scientist/alova/index.ts +0 -23
- package/src/api/scientist/index.ts +0 -2
- package/src/api/scientist/scientist.ts +0 -49
- package/src/assets/quasar-logo-vertical.svg +0 -15
- package/src/boot/.gitkeep +0 -0
- package/src/components/ExampleComponent.vue +0 -37
- package/src/components/models.ts +0 -8
- package/src/css/app.scss +0 -1
- package/src/css/quasar.variables.scss +0 -25
- package/src/env.d.ts +0 -7
- package/src/index.ts +0 -4
- package/src/layouts/UserLayout.vue +0 -106
- package/src/pages/LoginPage.vue +0 -32
- package/src/proto/Images.proto +0 -7
- package/src/proto/WaveMap.proto +0 -10
- package/src/proto/index.ts +0 -2
- package/src/proto/types/Images_pb.ts +0 -48
- package/src/proto/types/WaveMap_pb.ts +0 -59
- package/src/router/index.ts +0 -37
- package/src/router/routes.ts +0 -14
- package/src/util/RichTextUtil.ts +0 -5
- package/src/util/datetime.ts +0 -43
- package/src/util/export.ts +0 -46
- package/src/util/helper.ts +0 -159
- package/src/util/image.ts +0 -28
- package/src/util/number.ts +0 -146
- package/src/util/s256.js +0 -30
- package/src/util/secret.ts +0 -60
- package/src/util/string.ts +0 -121
- package/tsconfig.json +0 -3
|
@@ -1,488 +0,0 @@
|
|
|
1
|
-
import type { MetaState } from '@core/api/patient/alova/globals';
|
|
2
|
-
import {
|
|
3
|
-
AppendixMeta,
|
|
4
|
-
ComplaintMeta,
|
|
5
|
-
ECGMeta,
|
|
6
|
-
FaceMeta,
|
|
7
|
-
Meta,
|
|
8
|
-
Metas,
|
|
9
|
-
MetaType,
|
|
10
|
-
PCGMeta,
|
|
11
|
-
PPGMeta,
|
|
12
|
-
PulsationMeta,
|
|
13
|
-
SceneMeta,
|
|
14
|
-
TongueMeta,
|
|
15
|
-
} from '@core/api/patient/meta';
|
|
16
|
-
import type { Page} from '@core/api/patient/core';
|
|
17
|
-
import { Annotation, Tag } from '@core/api/patient/core';
|
|
18
|
-
import { faceAnalyze, tongueAnalyze } from '@core/api/algorithm/inspectionsAlgorithm';
|
|
19
|
-
import { base64ToArrayBuffer } from '@core/util/image';
|
|
20
|
-
import { pulsationAnalysis, pulsationPreprocessing } from '@core/api/algorithm/pulsationsAlgorithm';
|
|
21
|
-
import { analysisLisems } from '@core/api/algorithm/lisemsAlgorithm';
|
|
22
|
-
import type { Patient } from '@core/api/patient/patient';
|
|
23
|
-
|
|
24
|
-
export class AlovaMeta extends Meta {
|
|
25
|
-
override deserialize(): Promise<this> {
|
|
26
|
-
return Promise.resolve(this);
|
|
27
|
-
}
|
|
28
|
-
override inject(): Promise<this> {
|
|
29
|
-
return Promise.resolve(this);
|
|
30
|
-
}
|
|
31
|
-
override serialize(): ArrayBuffer {
|
|
32
|
-
return new ArrayBuffer(0);
|
|
33
|
-
}
|
|
34
|
-
override getObject(): Promise<string> {
|
|
35
|
-
return Promise.resolve('')
|
|
36
|
-
}
|
|
37
|
-
override async get(): Promise<this> {
|
|
38
|
-
return this.of(await getState(this.id));
|
|
39
|
-
}
|
|
40
|
-
override async put(): Promise<this> {
|
|
41
|
-
return this.of(await putState(this.id, this.type, this.state()));
|
|
42
|
-
}
|
|
43
|
-
override post(): Promise<this> {
|
|
44
|
-
throw new Error('Method not implemented.');
|
|
45
|
-
}
|
|
46
|
-
override async delete(): Promise<this> {
|
|
47
|
-
await deleteState(this.id);
|
|
48
|
-
return this;
|
|
49
|
-
}
|
|
50
|
-
override analyze(): Promise<this> {
|
|
51
|
-
throw new Error('Method not implemented.');
|
|
52
|
-
}
|
|
53
|
-
static override queryMetaWithPatient(page: number, pageSize: number, owner?: Patient, type?: string, startTime?: string, endTime?: string, sort?: string, patientName?: string, patientPhoneNumber?: string, patientStartBirthdate?: string, patientEndBirthdate?: string, patientGender?: string, tags?: Tag[]): Promise<Page<Meta>> {
|
|
54
|
-
const tagsState = tags?.map(tag => tag.state())
|
|
55
|
-
const ownerState = owner?.state()
|
|
56
|
-
return patientApi.metaStateRestful
|
|
57
|
-
.queryMetaAndPatientState({
|
|
58
|
-
data: {
|
|
59
|
-
...(ownerState && { ownerState }),
|
|
60
|
-
...(type && { type }),
|
|
61
|
-
page: page,
|
|
62
|
-
pageSize: pageSize,
|
|
63
|
-
...(startTime && { startTime }),
|
|
64
|
-
...(endTime && { endTime }),
|
|
65
|
-
...(sort && { sort }),
|
|
66
|
-
...(patientName && { patientName }),
|
|
67
|
-
...(patientPhoneNumber && { patientPhoneNumber }),
|
|
68
|
-
...(patientStartBirthdate && { patientStartBirthdate }),
|
|
69
|
-
...(patientEndBirthdate && { patientEndBirthdate }),
|
|
70
|
-
...(patientGender && { patientGender }),
|
|
71
|
-
...(tagsState && { tagsState }),
|
|
72
|
-
},
|
|
73
|
-
async transform(json) {
|
|
74
|
-
const data = [] as Meta[];
|
|
75
|
-
for (const item of json.content!) {
|
|
76
|
-
data.push(await AlovaMetas.map(item));
|
|
77
|
-
}
|
|
78
|
-
return {
|
|
79
|
-
data: data,
|
|
80
|
-
total: json.totalElements!,
|
|
81
|
-
page: json.number!,
|
|
82
|
-
pageSize: json.size!,
|
|
83
|
-
pageCount: json.totalPages!,
|
|
84
|
-
isLastPage: json.last!,
|
|
85
|
-
} as Page<Meta>;
|
|
86
|
-
},
|
|
87
|
-
})
|
|
88
|
-
.send();
|
|
89
|
-
}
|
|
90
|
-
static override query(
|
|
91
|
-
page: number,
|
|
92
|
-
pageSize: number,
|
|
93
|
-
owner?: Patient,
|
|
94
|
-
type?: string,
|
|
95
|
-
startTime?: string,
|
|
96
|
-
endTime?: string,
|
|
97
|
-
sort?: string,
|
|
98
|
-
): Promise<Page<Meta>> {
|
|
99
|
-
const ownerState = owner?.state()
|
|
100
|
-
return patientApi.metaStateRestful
|
|
101
|
-
.queryMetaState({
|
|
102
|
-
data: {
|
|
103
|
-
...(ownerState && { ownerState }),
|
|
104
|
-
...(type && { type }),
|
|
105
|
-
...(startTime && { startTime }),
|
|
106
|
-
...(endTime && { endTime }),
|
|
107
|
-
...(sort && { sort }),
|
|
108
|
-
page: page,
|
|
109
|
-
pageSize: pageSize,
|
|
110
|
-
},
|
|
111
|
-
async transform(json) {
|
|
112
|
-
const data = [];
|
|
113
|
-
for (const item of json.content!) {
|
|
114
|
-
data.push(await AlovaMetas.map(item));
|
|
115
|
-
}
|
|
116
|
-
return {
|
|
117
|
-
data: data,
|
|
118
|
-
total: json.totalElements!,
|
|
119
|
-
page: json.number!,
|
|
120
|
-
pageSize: json.size!,
|
|
121
|
-
pageCount: json.totalPages!,
|
|
122
|
-
isLastPage: json.last!,
|
|
123
|
-
};
|
|
124
|
-
},
|
|
125
|
-
})
|
|
126
|
-
.send();
|
|
127
|
-
}
|
|
128
|
-
static override queryMetaStateByExactMatch(
|
|
129
|
-
id?: string[],
|
|
130
|
-
owner?: Patient[],
|
|
131
|
-
type?: string[],
|
|
132
|
-
pageSize?: number,
|
|
133
|
-
page?: number,
|
|
134
|
-
startTime?: string,
|
|
135
|
-
endTime?: string,
|
|
136
|
-
sort?: string,
|
|
137
|
-
): Promise<Page<Meta>> {
|
|
138
|
-
const ownerState = owner?.map(item => item.state())
|
|
139
|
-
return patientApi.metaStateRestful
|
|
140
|
-
.queryMetaStateByExactMatch({
|
|
141
|
-
data: {
|
|
142
|
-
...{ ...(id && { id }) },
|
|
143
|
-
...{ ...(ownerState && { ownerState }) },
|
|
144
|
-
...{ ...(type && { type }) },
|
|
145
|
-
...{ ...(pageSize && { pageSize }) },
|
|
146
|
-
...{ ...(page && { page }) },
|
|
147
|
-
...{ ...(startTime && { startTime }) },
|
|
148
|
-
...{ ...(endTime && { endTime }) },
|
|
149
|
-
...{ ...(sort && { sort }) },
|
|
150
|
-
},
|
|
151
|
-
async transform(json) {
|
|
152
|
-
const data = [];
|
|
153
|
-
for (const item of json.content!) {
|
|
154
|
-
data.push(await AlovaMetas.map(item));
|
|
155
|
-
}
|
|
156
|
-
return {
|
|
157
|
-
data: data,
|
|
158
|
-
total: json.totalElements!,
|
|
159
|
-
page: json.number!,
|
|
160
|
-
pageSize: json.size!,
|
|
161
|
-
pageCount: json.totalPages!,
|
|
162
|
-
isLastPage: json.last!,
|
|
163
|
-
};
|
|
164
|
-
},
|
|
165
|
-
})
|
|
166
|
-
.send();
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
const postState = (id: string,type: string, buffer: ArrayBuffer): Promise<MetaState> => {
|
|
170
|
-
return patientApi.metaStateRestful.postMetaState({
|
|
171
|
-
params: {
|
|
172
|
-
ownerId: id,
|
|
173
|
-
type: type
|
|
174
|
-
},
|
|
175
|
-
headers: {
|
|
176
|
-
'Content-Type': 'application/octet-stream'
|
|
177
|
-
},
|
|
178
|
-
duplex: 'half',
|
|
179
|
-
data: new Blob([buffer])
|
|
180
|
-
}).send()
|
|
181
|
-
}
|
|
182
|
-
const putState = (id: string,type: string, state: MetaState): Promise<MetaState> => {
|
|
183
|
-
return patientApi.metaStateRestful.putMetaState({
|
|
184
|
-
pathParams: {
|
|
185
|
-
id: id,
|
|
186
|
-
type: type
|
|
187
|
-
},
|
|
188
|
-
data: state
|
|
189
|
-
}).send()
|
|
190
|
-
}
|
|
191
|
-
const deleteState = (id: string): Promise<void> => {
|
|
192
|
-
void patientApi.metaStateRestful.deleteMetaState({
|
|
193
|
-
pathParams: {
|
|
194
|
-
id: id
|
|
195
|
-
}
|
|
196
|
-
}).send()
|
|
197
|
-
return Promise.resolve()
|
|
198
|
-
}
|
|
199
|
-
const getState = (id: string): Promise<MetaState> => {
|
|
200
|
-
return patientApi.metaStateRestful.getMetaState({
|
|
201
|
-
pathParams: {
|
|
202
|
-
id: id
|
|
203
|
-
}
|
|
204
|
-
}).send()
|
|
205
|
-
}
|
|
206
|
-
const getMetaObject = async (id: string): Promise<ArrayBuffer> => {
|
|
207
|
-
return patientApi.metaStateRestful.getMetaObject({
|
|
208
|
-
pathParams: {
|
|
209
|
-
id: id
|
|
210
|
-
},
|
|
211
|
-
priority: 'low',
|
|
212
|
-
transform(data: unknown) {
|
|
213
|
-
return (data as Response).arrayBuffer();
|
|
214
|
-
},
|
|
215
|
-
}).send()
|
|
216
|
-
}
|
|
217
|
-
const convertTags = (features: JSON,actor: string): Tag[] => {
|
|
218
|
-
//上传照片
|
|
219
|
-
const tags = [] as Tag[];
|
|
220
|
-
const timestamp = Date.now().toString();
|
|
221
|
-
Object.entries(features as object).forEach(([key, value]) => {
|
|
222
|
-
tags.push(
|
|
223
|
-
Tag.builder().key(key).annotations([Annotation.builder().value(value).actor(actor).timestamp(timestamp).build()]).build()
|
|
224
|
-
);
|
|
225
|
-
});
|
|
226
|
-
return tags
|
|
227
|
-
}
|
|
228
|
-
export class AlovaTongueMeta extends TongueMeta {
|
|
229
|
-
override async getObject(){
|
|
230
|
-
if(this.base64Image)return Promise.resolve(this.base64Image)
|
|
231
|
-
return this.deserialize(await getMetaObject(this.id))
|
|
232
|
-
}
|
|
233
|
-
override async get():Promise<this>{
|
|
234
|
-
return this.of(await getState(this.id))
|
|
235
|
-
}
|
|
236
|
-
override async put():Promise<this>{
|
|
237
|
-
return this.of(await putState(this.id,this.type,this.state()))
|
|
238
|
-
}
|
|
239
|
-
override async post():Promise<this>{
|
|
240
|
-
return this.of(await postState(this.owner.id,this.type,this.serialize()))
|
|
241
|
-
}
|
|
242
|
-
override async delete():Promise<this>{
|
|
243
|
-
await deleteState(this.id)
|
|
244
|
-
return this;
|
|
245
|
-
}
|
|
246
|
-
override async analyze(overwrite=false):Promise<this>{
|
|
247
|
-
if(overwrite)this.tags = []
|
|
248
|
-
const formData = new FormData();
|
|
249
|
-
formData.append('files', new Blob([base64ToArrayBuffer(this.base64Image)]));
|
|
250
|
-
this.tags.push(...convertTags((await tongueAnalyze(formData).send()),'算法'))
|
|
251
|
-
return Promise.resolve(this)
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
export class AlovaFaceMeta extends FaceMeta {
|
|
255
|
-
override async getObject() {
|
|
256
|
-
if(this.base64Image)return Promise.resolve(this.base64Image)
|
|
257
|
-
return this.deserialize(await getMetaObject(this.id))
|
|
258
|
-
}
|
|
259
|
-
override async post(){
|
|
260
|
-
return this.of(await postState(this.owner.id,this.type,this.serialize()))
|
|
261
|
-
}
|
|
262
|
-
override async get(){
|
|
263
|
-
return this.of(await getState(this.id))
|
|
264
|
-
}
|
|
265
|
-
override async put(){
|
|
266
|
-
return this.of(await putState(this.id,this.type,this.state()))
|
|
267
|
-
}
|
|
268
|
-
override async delete(){
|
|
269
|
-
await deleteState(this.id)
|
|
270
|
-
return this;
|
|
271
|
-
}
|
|
272
|
-
override async analyze(overwrite=false):Promise<this>{
|
|
273
|
-
if(overwrite)this.tags = []
|
|
274
|
-
const formData = new FormData();
|
|
275
|
-
formData.append('files', new Blob([base64ToArrayBuffer(this.base64Image)]));
|
|
276
|
-
this.tags.push(...convertTags((await faceAnalyze(formData).send()),'算法'))
|
|
277
|
-
return Promise.resolve(this)
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
export class AlovaSceneMeta extends SceneMeta{
|
|
281
|
-
override async getObject() {
|
|
282
|
-
if(this.base64Image)return Promise.resolve(this.base64Image)
|
|
283
|
-
return this.deserialize(await getMetaObject(this.id))
|
|
284
|
-
}
|
|
285
|
-
override async post(){
|
|
286
|
-
return this.of(await postState(this.owner.id,this.type,this.serialize()))
|
|
287
|
-
}
|
|
288
|
-
override async get(){
|
|
289
|
-
return this.of(await getState(this.id))
|
|
290
|
-
}
|
|
291
|
-
override async put(){
|
|
292
|
-
return this.of(await putState(this.id,this.type,this.state()))
|
|
293
|
-
}
|
|
294
|
-
override async delete(){
|
|
295
|
-
await deleteState(this.id)
|
|
296
|
-
return this;
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
override async analyze(overwrite=false):Promise<this>{
|
|
300
|
-
if(overwrite)this.tags = []
|
|
301
|
-
return Promise.resolve(this)
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
export class AlovaPulsationMeta extends PulsationMeta {
|
|
305
|
-
override async getObject() {
|
|
306
|
-
if(this.waves)return Promise.resolve(this.waves)
|
|
307
|
-
return this.deserialize(await getMetaObject(this.id))
|
|
308
|
-
}
|
|
309
|
-
override async post(){
|
|
310
|
-
return this.of(await postState(this.owner.id,this.type,this.serialize()))
|
|
311
|
-
}
|
|
312
|
-
override async get(){
|
|
313
|
-
return this.of(await getState(this.id))
|
|
314
|
-
}
|
|
315
|
-
override async put(){
|
|
316
|
-
return this.of(await putState(this.id,this.type,this.state()))
|
|
317
|
-
}
|
|
318
|
-
override async delete(){
|
|
319
|
-
await deleteState(this.id)
|
|
320
|
-
return this;
|
|
321
|
-
}
|
|
322
|
-
override async analyze(overwrite=false) : Promise<this>{
|
|
323
|
-
if(overwrite)this.tags = []
|
|
324
|
-
const pulsation = {} as {[key: string]:number[]}
|
|
325
|
-
for (const key in this.waves?.origin){
|
|
326
|
-
pulsation[key] = this.waves.origin[key]!.values
|
|
327
|
-
}
|
|
328
|
-
this.tags.push(...convertTags((await pulsationAnalysis(pulsation).send()),'算法'))
|
|
329
|
-
return Promise.resolve(this)
|
|
330
|
-
}
|
|
331
|
-
override preprocess(origins: { [key: string]: number[] }): Promise<{ [key: string]: number[] }> {
|
|
332
|
-
return pulsationPreprocessing(origins)
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
export class AlovaPPGMeta extends PPGMeta {
|
|
336
|
-
override async getObject() {
|
|
337
|
-
if(this.waves)return Promise.resolve(this.waves)
|
|
338
|
-
return this.deserialize(await getMetaObject(this.id))
|
|
339
|
-
}
|
|
340
|
-
override async post(){
|
|
341
|
-
return this.of(await postState(this.owner.id,this.type,this.serialize()))
|
|
342
|
-
}
|
|
343
|
-
override async get(){
|
|
344
|
-
return this.of(await getState(this.id))
|
|
345
|
-
}
|
|
346
|
-
override async put(){
|
|
347
|
-
return this.of(await putState(this.id,this.type,this.state()))
|
|
348
|
-
}
|
|
349
|
-
override async delete(){
|
|
350
|
-
await deleteState(this.id)
|
|
351
|
-
return this;
|
|
352
|
-
}
|
|
353
|
-
override async analyze(overwrite=false):Promise<this>{
|
|
354
|
-
if(overwrite)this.tags = []
|
|
355
|
-
const waves = {} as {[key: string]:number[]}
|
|
356
|
-
for (const key in this.waves?.origin){
|
|
357
|
-
waves[key] = this.waves.origin[key]!.values
|
|
358
|
-
}
|
|
359
|
-
this.tags.push(...convertTags((await analysisLisems(waves).send()),'算法'))
|
|
360
|
-
return Promise.resolve(this)
|
|
361
|
-
}
|
|
362
|
-
override preprocess(origins: { [key: string]: number[] }): Promise<{ [key: string]: number[] }> {
|
|
363
|
-
return Promise.resolve(origins)
|
|
364
|
-
}
|
|
365
|
-
}
|
|
366
|
-
export class AlovaPCGMeta extends PCGMeta {
|
|
367
|
-
override async getObject() {
|
|
368
|
-
if(this.waves)return Promise.resolve(this.waves)
|
|
369
|
-
return this.deserialize(await getMetaObject(this.id))
|
|
370
|
-
}
|
|
371
|
-
override async post(){
|
|
372
|
-
return this.of(await postState(this.owner.id,this.type,this.serialize()))
|
|
373
|
-
}
|
|
374
|
-
override async get(){
|
|
375
|
-
return this.of(await getState(this.id))
|
|
376
|
-
}
|
|
377
|
-
override async put(){
|
|
378
|
-
return this.of(await putState(this.id,this.type,this.state()))
|
|
379
|
-
}
|
|
380
|
-
override async delete(){
|
|
381
|
-
await deleteState(this.id)
|
|
382
|
-
return this;
|
|
383
|
-
}
|
|
384
|
-
override async analyze(overwrite=false):Promise<this>{
|
|
385
|
-
if(overwrite)this.tags = []
|
|
386
|
-
const waves = {} as {[key: string]:number[]}
|
|
387
|
-
for (const key in this.waves?.origin){
|
|
388
|
-
waves[key] = this.waves.origin[key]!.values
|
|
389
|
-
}
|
|
390
|
-
this.tags.push(...convertTags((await analysisLisems(waves).send()),'算法'))
|
|
391
|
-
return Promise.resolve(this)
|
|
392
|
-
}
|
|
393
|
-
override preprocess(origins: { [key: string]: number[] }): Promise<{ [key: string]: number[] }> {
|
|
394
|
-
return Promise.resolve(origins)
|
|
395
|
-
}
|
|
396
|
-
}
|
|
397
|
-
export class AlovaECGMeta extends ECGMeta {
|
|
398
|
-
override async getObject() {
|
|
399
|
-
if(this.waves)return Promise.resolve(this.waves)
|
|
400
|
-
return this.deserialize(await getMetaObject(this.id))
|
|
401
|
-
}
|
|
402
|
-
override async post(){
|
|
403
|
-
return this.of(await postState(this.owner.id,this.type,this.serialize()))
|
|
404
|
-
}
|
|
405
|
-
override async get(){
|
|
406
|
-
return this.of(await getState(this.id))
|
|
407
|
-
}
|
|
408
|
-
override async put(){
|
|
409
|
-
return this.of(await putState(this.id,this.type,this.state()))
|
|
410
|
-
}
|
|
411
|
-
override async delete(){
|
|
412
|
-
await deleteState(this.id)
|
|
413
|
-
return this;
|
|
414
|
-
}
|
|
415
|
-
override async analyze(overwrite=false):Promise<this>{
|
|
416
|
-
if(overwrite)this.tags = []
|
|
417
|
-
const waves = {} as {[key: string]:number[]}
|
|
418
|
-
for (const key in this.waves?.origin){
|
|
419
|
-
waves[key] = this.waves.origin[key]!.values
|
|
420
|
-
}
|
|
421
|
-
this.tags.push(...convertTags((await analysisLisems(waves).send()),'算法'))
|
|
422
|
-
return Promise.resolve(this)
|
|
423
|
-
}
|
|
424
|
-
override preprocess(origins: { [key: string]: number[] }): Promise<{ [key: string]: number[] }> {
|
|
425
|
-
return Promise.resolve(origins)
|
|
426
|
-
}
|
|
427
|
-
}
|
|
428
|
-
export class AlovaAppendixMeta extends AppendixMeta {
|
|
429
|
-
override async getObject() {
|
|
430
|
-
if(this.base64Images.length)return Promise.resolve(this.base64Images)
|
|
431
|
-
return this.deserialize(await getMetaObject(this.id))
|
|
432
|
-
}
|
|
433
|
-
override async post(){
|
|
434
|
-
return this.of(await postState(this.owner.id,this.type,this.serialize()))
|
|
435
|
-
}
|
|
436
|
-
override async get(){
|
|
437
|
-
return this.of(await getState(this.id))
|
|
438
|
-
}
|
|
439
|
-
override async put(){
|
|
440
|
-
return this.of(await putState(this.id,this.type,this.state()))
|
|
441
|
-
}
|
|
442
|
-
override async delete(){
|
|
443
|
-
await deleteState(this.id)
|
|
444
|
-
return this;
|
|
445
|
-
}
|
|
446
|
-
override async analyze(overwrite=false):Promise<this>{
|
|
447
|
-
if(overwrite)this.tags = []
|
|
448
|
-
return Promise.resolve(this)
|
|
449
|
-
}
|
|
450
|
-
}
|
|
451
|
-
export class AlovaComplaintMeta extends ComplaintMeta {
|
|
452
|
-
override async getObject() {
|
|
453
|
-
if (this.text) return Promise.resolve(this.text);
|
|
454
|
-
return this.deserialize(await getMetaObject(this.id));
|
|
455
|
-
}
|
|
456
|
-
override async post() {
|
|
457
|
-
return this.of(await postState(this.owner.id, this.type, this.serialize()));
|
|
458
|
-
}
|
|
459
|
-
override async get() {
|
|
460
|
-
return this.of(await getState(this.id));
|
|
461
|
-
}
|
|
462
|
-
override async put() {
|
|
463
|
-
return this.of(await putState(this.id, this.type, this.state()));
|
|
464
|
-
}
|
|
465
|
-
override async delete() {
|
|
466
|
-
await deleteState(this.id);
|
|
467
|
-
return this;
|
|
468
|
-
}
|
|
469
|
-
override async analyze(overwrite=false):Promise<this>{
|
|
470
|
-
if(overwrite)this.tags = []
|
|
471
|
-
return Promise.resolve(this)
|
|
472
|
-
}
|
|
473
|
-
}
|
|
474
|
-
export class AlovaMetas extends Metas{
|
|
475
|
-
static override map(meta: MetaState) {
|
|
476
|
-
if (meta.type == MetaType.Pulsation)return new AlovaPulsationMeta().of(meta);
|
|
477
|
-
else if(meta.type == MetaType.Tongue)return new AlovaTongueMeta().of(meta);
|
|
478
|
-
else if(meta.type == MetaType.Complaint)return new AlovaComplaintMeta().of(meta);
|
|
479
|
-
else if(meta.type == MetaType.Face)return new AlovaFaceMeta().of(meta);
|
|
480
|
-
else if(meta.type == MetaType.Appendix)return new AlovaAppendixMeta().of(meta);
|
|
481
|
-
else if(meta.type == MetaType.ECG)return new AlovaECGMeta().of(meta);
|
|
482
|
-
else if(meta.type == MetaType.PCG)return new AlovaPCGMeta().of(meta);
|
|
483
|
-
else if(meta.type == MetaType.Scene)return new AlovaSceneMeta().of(meta);
|
|
484
|
-
else if(meta.type == MetaType.PPG)return new AlovaPPGMeta().of(meta);
|
|
485
|
-
else if(meta.type == MetaType.Meta)return new AlovaMeta().of(meta);
|
|
486
|
-
else throw new Error('未知的Meta类型');
|
|
487
|
-
}
|
|
488
|
-
}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { Patient } from '@core/api/patient/patient';
|
|
2
|
-
import type { Page } from '@core/api/patient/core';
|
|
3
|
-
|
|
4
|
-
export class AlovaPatient extends Patient{
|
|
5
|
-
override async get() {
|
|
6
|
-
return this.of(await patientApi.patientStateRestful.getPatientState({
|
|
7
|
-
pathParams: {
|
|
8
|
-
id: this.id,
|
|
9
|
-
},
|
|
10
|
-
priority: 'high',
|
|
11
|
-
async transform(json) {
|
|
12
|
-
return new AlovaPatient().of(json);
|
|
13
|
-
}
|
|
14
|
-
}).send())
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
override async put() {
|
|
18
|
-
return this.of(await patientApi.patientStateRestful.putPatientState({
|
|
19
|
-
pathParams: {
|
|
20
|
-
id: this.id,
|
|
21
|
-
},
|
|
22
|
-
data: this.state()
|
|
23
|
-
}).send(true));
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
override async post() {
|
|
27
|
-
return this.of(await patientApi.patientStateRestful.postPatientState({
|
|
28
|
-
data: this.state()
|
|
29
|
-
}).send(true))
|
|
30
|
-
}
|
|
31
|
-
override delete() {
|
|
32
|
-
void patientApi.patientStateRestful.deletePatientState({
|
|
33
|
-
pathParams: {
|
|
34
|
-
id: this.id,
|
|
35
|
-
}
|
|
36
|
-
}).send();
|
|
37
|
-
return Promise.resolve(this);
|
|
38
|
-
}
|
|
39
|
-
override async putRemarks(){
|
|
40
|
-
return this.of(await patientApi.patientStateRestful.putPatientState({
|
|
41
|
-
pathParams: {
|
|
42
|
-
id: this.id,
|
|
43
|
-
},
|
|
44
|
-
data: {
|
|
45
|
-
remarks: this.remarks,
|
|
46
|
-
}
|
|
47
|
-
}).send(true));
|
|
48
|
-
}
|
|
49
|
-
static override query(params: {
|
|
50
|
-
id?: string;
|
|
51
|
-
doctorId?: string;
|
|
52
|
-
name?: string;
|
|
53
|
-
gender?: string;
|
|
54
|
-
identity?: string;
|
|
55
|
-
pageSize: number;
|
|
56
|
-
page: number;
|
|
57
|
-
phoneNumber?: string;
|
|
58
|
-
startTime?: string;
|
|
59
|
-
endTime?: string;
|
|
60
|
-
sort?: string;
|
|
61
|
-
}): Promise<Page<Patient>> {
|
|
62
|
-
return patientApi.patientStateRestful.queryPatientState({
|
|
63
|
-
params: params,
|
|
64
|
-
async transform(json): Promise<Page<Patient>> {
|
|
65
|
-
const patient = await Promise.all(json.content!.map(item => new AlovaPatient().of(item)));
|
|
66
|
-
return {
|
|
67
|
-
data: patient,
|
|
68
|
-
total: json.totalElements!,
|
|
69
|
-
page: json.number!,
|
|
70
|
-
pageCount: json.totalPages!,
|
|
71
|
-
pageSize: json.size!,
|
|
72
|
-
isLastPage: json.last!,
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}).send();
|
|
76
|
-
}
|
|
77
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { createAlova } from 'alova';
|
|
2
|
-
import fetchAdapter from 'alova/fetch';
|
|
3
|
-
import { createApis, mountApis, withConfigType } from './createApis';
|
|
4
|
-
import { onAuthRequired, responded } from '@core/api/config/alova';
|
|
5
|
-
import { getServiceEndpoint, ServiceType } from '@core/api/config';
|
|
6
|
-
|
|
7
|
-
export const alovaInstance = createAlova({
|
|
8
|
-
baseURL: getServiceEndpoint(ServiceType.Patient),
|
|
9
|
-
requestAdapter: fetchAdapter(),
|
|
10
|
-
beforeRequest: onAuthRequired(() => {}),
|
|
11
|
-
cacheFor: null,
|
|
12
|
-
responded: responded,
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
export const $$userConfigMap = withConfigType({});
|
|
16
|
-
|
|
17
|
-
const Apis = createApis(alovaInstance, $$userConfigMap);
|
|
18
|
-
|
|
19
|
-
mountApis(Apis);
|
|
20
|
-
|
|
21
|
-
export default Apis;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|