web-core-tcm 0.0.23 → 0.0.25

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.
Files changed (98) hide show
  1. package/package.json +38 -21
  2. package/quasar.config.ts +28 -15
  3. package/src/api/algorithm/comprehensiveAlgorithm.ts +1 -1
  4. package/src/api/algorithm/index.ts +7 -7
  5. package/src/api/algorithm/inquiriesAlgorithm.ts +4 -7
  6. package/src/api/algorithm/inspectionsAlgorithm.ts +1 -1
  7. package/src/api/algorithm/lisemsAlgorithm.ts +3 -3
  8. package/src/api/algorithm/pulsationsAlgorithm.ts +2 -3
  9. package/src/api/authorization/alova/apiDefinitions.ts +2 -2
  10. package/src/api/authorization/alova/createApis.ts +22 -7
  11. package/src/api/authorization/alova/globals.d.ts +35 -14
  12. package/src/api/authorization/alova/implement/authorization.ts +11 -9
  13. package/src/api/authorization/alova/implement/index.ts +1 -1
  14. package/src/api/authorization/alova/index.ts +4 -5
  15. package/src/api/authorization/authorization.ts +6 -6
  16. package/src/api/authorization/index.ts +1 -1
  17. package/src/api/check/alova/apiDefinitions.ts +2 -2
  18. package/src/api/check/alova/createApis.ts +22 -7
  19. package/src/api/check/alova/globals.d.ts +29 -20
  20. package/src/api/check/alova/implement/check.ts +145 -99
  21. package/src/api/check/alova/implement/index.ts +1 -1
  22. package/src/api/check/alova/index.ts +4 -5
  23. package/src/api/check/check.ts +116 -63
  24. package/src/api/check/index.ts +1 -1
  25. package/src/api/config/alova/index.ts +26 -27
  26. package/src/api/config/index.ts +59 -57
  27. package/src/api/doctor/alova/apiDefinitions.ts +2 -2
  28. package/src/api/doctor/alova/createApis.ts +22 -7
  29. package/src/api/doctor/alova/globals.d.ts +27 -18
  30. package/src/api/doctor/alova/implement/doctor.ts +38 -24
  31. package/src/api/doctor/alova/implement/index.ts +1 -1
  32. package/src/api/doctor/alova/index.ts +4 -4
  33. package/src/api/doctor/doctor.ts +18 -18
  34. package/src/api/doctor/index.ts +1 -1
  35. package/src/api/index.ts +12 -15
  36. package/src/api/metric/implement/index.ts +1 -1
  37. package/src/api/metric/implement/metric.ts +44 -34
  38. package/src/api/metric/index.ts +1 -1
  39. package/src/api/metric/metric.ts +36 -36
  40. package/src/api/oauth/alova/apiDefinitions.ts +2 -2
  41. package/src/api/oauth/alova/createApis.ts +22 -7
  42. package/src/api/oauth/alova/globals.d.ts +25 -16
  43. package/src/api/oauth/alova/implement/index.ts +1 -1
  44. package/src/api/oauth/alova/implement/oauth.ts +20 -15
  45. package/src/api/oauth/alova/index.ts +4 -5
  46. package/src/api/oauth/index.ts +1 -1
  47. package/src/api/oauth/oauth.ts +9 -5
  48. package/src/api/outpatient/alova/apiDefinitions.ts +2 -2
  49. package/src/api/outpatient/alova/createApis.ts +22 -7
  50. package/src/api/outpatient/alova/globals.d.ts +25 -16
  51. package/src/api/outpatient/alova/implement/index.ts +1 -1
  52. package/src/api/outpatient/alova/implement/outpatient.ts +76 -51
  53. package/src/api/outpatient/alova/index.ts +4 -5
  54. package/src/api/outpatient/index.ts +1 -1
  55. package/src/api/outpatient/outpatient.ts +29 -24
  56. package/src/api/patient/alova/apiDefinitions.ts +2 -2
  57. package/src/api/patient/alova/createApis.ts +22 -7
  58. package/src/api/patient/alova/globals.d.ts +56 -43
  59. package/src/api/patient/alova/implement/index.ts +1 -1
  60. package/src/api/patient/alova/implement/meta.ts +253 -224
  61. package/src/api/patient/alova/implement/patient.ts +79 -57
  62. package/src/api/patient/alova/index.ts +3 -5
  63. package/src/api/patient/core.ts +51 -49
  64. package/src/api/patient/index.ts +1 -1
  65. package/src/api/patient/meta.ts +244 -140
  66. package/src/api/patient/patient.ts +25 -25
  67. package/src/api/prescription/alova/apiDefinitions.ts +2 -2
  68. package/src/api/prescription/alova/createApis.ts +22 -7
  69. package/src/api/prescription/alova/globals.d.ts +32 -23
  70. package/src/api/prescription/alova/implement/herbal.ts +59 -39
  71. package/src/api/prescription/alova/implement/index.ts +1 -1
  72. package/src/api/prescription/alova/implement/prescription.ts +50 -33
  73. package/src/api/prescription/alova/index.ts +4 -5
  74. package/src/api/prescription/herbal.ts +17 -10
  75. package/src/api/prescription/index.ts +1 -1
  76. package/src/api/prescription/prescription.ts +35 -27
  77. package/src/api/scientist/alova/apiDefinitions.ts +2 -2
  78. package/src/api/scientist/alova/createApis.ts +22 -7
  79. package/src/api/scientist/alova/globals.d.ts +25 -16
  80. package/src/api/scientist/alova/implement/index.ts +1 -1
  81. package/src/api/scientist/alova/implement/scientist.ts +31 -20
  82. package/src/api/scientist/alova/index.ts +5 -4
  83. package/src/api/scientist/index.ts +1 -1
  84. package/src/api/scientist/scientist.ts +20 -20
  85. package/src/index.ts +3 -4
  86. package/src/layouts/UserLayout.vue +9 -7
  87. package/src/pages/LoginPage.vue +2 -5
  88. package/src/proto/types/Images_pb.ts +13 -13
  89. package/src/proto/types/WaveMap_pb.ts +13 -13
  90. package/src/router/routes.ts +2 -2
  91. package/src/util/export.ts +4 -4
  92. package/src/util/helper.ts +6 -6
  93. package/src/util/image.ts +1 -1
  94. package/src/util/number.ts +4 -4
  95. package/src/util/s256.js +1 -4
  96. package/src/util/secret.ts +1 -1
  97. package/src/util/string.ts +18 -18
  98. package/tsconfig.json +5 -1
@@ -1,18 +1,18 @@
1
- import type { Page} from '@core/api/patient/core';
2
- import { Sequence, Tag } from '@core/api/patient/core';
3
- import { NetworkObject } from '@core/api/patient/core';
4
- import { arrayBufferToImageBase64 } from '@core/util/image';
5
- import type { WaveMap} from '@core/proto/types/WaveMap_pb';
6
- import { WaveMapSchema, WaveSchema } from '@core/proto/types/WaveMap_pb';
1
+ import type { Page } from 'src/api/patient/core';
2
+ import { Sequence, Tag } from 'src/api/patient/core';
3
+ import { NetworkObject } from 'src/api/patient/core';
4
+ import { arrayBufferToImageBase64 } from 'src/util/image';
5
+ import type { WaveMap } from 'src/proto/types/WaveMap_pb';
6
+ import { WaveMapSchema, WaveSchema } from 'src/proto/types/WaveMap_pb';
7
7
  import { create, fromBinary, toBinary } from '@bufbuild/protobuf';
8
- import type { MetaState } from '@core/api/patient/alova/globals';
9
- import type { Image,Images} from '@core/proto/types/Images_pb';
10
- import { ImageSchema,ImagesSchema } from '@core/proto/types/Images_pb';
11
- import { Patient } from '@core/api/patient/patient';
8
+ import type { MetaState } from 'src/api/patient/alova/globals';
9
+ import type { Image, Images } from 'src/proto/types/Images_pb';
10
+ import { ImageSchema, ImagesSchema } from 'src/proto/types/Images_pb';
11
+ import { Patient } from 'src/api/patient/patient';
12
12
  import type { IBuilder } from 'builder-pattern';
13
13
  import { Builder } from 'builder-pattern';
14
14
  //Enum Type
15
- export enum MetaType{
15
+ export enum MetaType {
16
16
  Pulsation = 'pulsation',
17
17
  Tongue = 'tongue',
18
18
  Appendix = 'appendix',
@@ -22,10 +22,10 @@ export enum MetaType{
22
22
  Scene = 'scene',
23
23
  Face = 'face',
24
24
  Complaint = 'complaint',
25
- Meta = 'meta'
25
+ Meta = 'meta',
26
26
  }
27
- export abstract class Meta extends NetworkObject{
28
- static override builder(): IBuilder<unknown>{
27
+ export abstract class Meta extends NetworkObject {
28
+ static override builder(): IBuilder<unknown> {
29
29
  return Builder(this._default) as unknown as IBuilder<Meta>;
30
30
  }
31
31
  static override default(): typeof Meta {
@@ -39,28 +39,30 @@ export abstract class Meta extends NetworkObject{
39
39
  updatedTimestamp: string = '0';
40
40
 
41
41
  isSelected: boolean = false;
42
- override async of(json: MetaState): Promise<this>{
43
- if(json.id != undefined)this.id = json.id;
44
- if(json.ownerState != undefined)this.owner = await Patient.builder().build().of(json.ownerState);
45
- if(json.tagsState != undefined)this.tags = await Promise.all(json.tagsState.map(tag => Tag.builder().build().of(tag)));
46
- if(json.createdTimestamp != undefined)this.createdTimestamp = json.createdTimestamp;
47
- if(json.updatedTimestamp != undefined)this.updatedTimestamp = json.updatedTimestamp;
48
- if(json.type != undefined)this.type = json.type as MetaType;
42
+ override async of(json: MetaState): Promise<this> {
43
+ if (json.id != undefined) this.id = json.id;
44
+ if (json.ownerState != undefined)
45
+ this.owner = await Patient.builder().build().of(json.ownerState);
46
+ if (json.tagsState != undefined)
47
+ this.tags = await Promise.all(json.tagsState.map((tag) => Tag.builder().build().of(tag)));
48
+ if (json.createdTimestamp != undefined) this.createdTimestamp = json.createdTimestamp;
49
+ if (json.updatedTimestamp != undefined) this.updatedTimestamp = json.updatedTimestamp;
50
+ if (json.type != undefined) this.type = json.type as MetaType;
49
51
  return Promise.resolve(this);
50
52
  }
51
- override state(): MetaState{
53
+ override state(): MetaState {
52
54
  return {
53
55
  id: this.id,
54
56
  ownerState: this.owner.state(),
55
57
  type: this.type,
56
- tagsState: this.tags.map(tag => tag.state()),
58
+ tagsState: this.tags.map((tag) => tag.state()),
57
59
  createdTimestamp: this.createdTimestamp,
58
60
  updatedTimestamp: this.updatedTimestamp,
59
- }
61
+ };
60
62
  }
61
- getTagValue(key: string): string|undefined {
62
- const annotation = this.tags.find((tag) => tag.key == key)?.getLastAnnotation()
63
- return annotation?annotation.value: '';
63
+ getTagValue(key: string): string | undefined {
64
+ const annotation = this.tags.find((tag) => tag.key == key)?.getLastAnnotation();
65
+ return annotation ? annotation.value : '';
64
66
  }
65
67
  putTags() {
66
68
  return patientApi.metaStateRestful.putMetaState({
@@ -69,35 +71,89 @@ export abstract class Meta extends NetworkObject{
69
71
  },
70
72
  data: {
71
73
  id: this.id,
72
- tagsState: this.tags.map(tag => tag.state()),
73
- }
74
- })
74
+ tagsState: this.tags.map((tag) => tag.state()),
75
+ },
76
+ });
75
77
  }
76
- addTag(tag: Tag){
77
- this.tags.push(tag)
78
- return this.putTags()
78
+ addTag(tag: Tag) {
79
+ this.tags.push(tag);
80
+ return this.putTags();
79
81
  }
80
- removeTag(tag: Tag){
82
+ removeTag(tag: Tag) {
81
83
  this.tags.splice(this.tags.indexOf(tag), 1);
82
- return this.putTags()
84
+ return this.putTags();
83
85
  }
84
86
  abstract analyze(): Promise<this>;
85
- abstract getObject():Promise<unknown>
86
- abstract get():Promise<this>
87
- abstract put():Promise<this>
88
- abstract post():Promise<this>
89
- abstract delete():Promise<this>
90
- abstract serialize(object: unknown):ArrayBuffer
91
- abstract deserialize(buffer: ArrayBuffer): unknown
92
- abstract inject(object: unknown): Promise<this>
93
- static 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>>{
94
- return this.default().queryMetaWithPatient(page, pageSize,owner, type, startTime, endTime,sort, patientName, patientPhoneNumber, patientStartBirthdate, patientEndBirthdate, patientGender, tags)
95
- }
96
- static query(page: number, pageSize: number,owner?: Patient, type?: string, startTime?: string, endTime?: string,sort="createdTimestamp:asc"): Promise<Page<Meta>>{
97
- return this.default().query(page, pageSize,owner, type, startTime, endTime,sort)
98
- }
99
- static queryMetaStateByExactMatch(id?: string[], owner?: Patient[], type?: string[], pageSize?: number, page?: number, startTime?: string, endTime?: string, sort?: string): Promise<Page<Meta>>{
100
- return this.default().queryMetaStateByExactMatch(id, owner, type, pageSize, page, startTime, endTime, sort)
87
+ abstract getObject(): Promise<unknown>;
88
+ abstract get(): Promise<this>;
89
+ abstract put(): Promise<this>;
90
+ abstract post(): Promise<this>;
91
+ abstract delete(): Promise<this>;
92
+ abstract serialize(object: unknown): ArrayBuffer;
93
+ abstract deserialize(buffer: ArrayBuffer): unknown;
94
+ abstract inject(object: unknown): Promise<this>;
95
+ static queryMetaWithPatient(
96
+ page: number,
97
+ pageSize: number,
98
+ owner?: Patient,
99
+ type?: string,
100
+ startTime?: string,
101
+ endTime?: string,
102
+ sort?: string,
103
+ patientName?: string,
104
+ patientPhoneNumber?: string,
105
+ patientStartBirthdate?: string,
106
+ patientEndBirthdate?: string,
107
+ patientGender?: string,
108
+ tags?: Tag[],
109
+ ): Promise<Page<Meta>> {
110
+ return this.default().queryMetaWithPatient(
111
+ page,
112
+ pageSize,
113
+ owner,
114
+ type,
115
+ startTime,
116
+ endTime,
117
+ sort,
118
+ patientName,
119
+ patientPhoneNumber,
120
+ patientStartBirthdate,
121
+ patientEndBirthdate,
122
+ patientGender,
123
+ tags,
124
+ );
125
+ }
126
+ static query(
127
+ page: number,
128
+ pageSize: number,
129
+ owner?: Patient,
130
+ type?: string,
131
+ startTime?: string,
132
+ endTime?: string,
133
+ sort = 'createdTimestamp:asc',
134
+ ): Promise<Page<Meta>> {
135
+ return this.default().query(page, pageSize, owner, type, startTime, endTime, sort);
136
+ }
137
+ static queryMetaStateByExactMatch(
138
+ id?: string[],
139
+ owner?: Patient[],
140
+ type?: string[],
141
+ pageSize?: number,
142
+ page?: number,
143
+ startTime?: string,
144
+ endTime?: string,
145
+ sort?: string,
146
+ ): Promise<Page<Meta>> {
147
+ return this.default().queryMetaStateByExactMatch(
148
+ id,
149
+ owner,
150
+ type,
151
+ pageSize,
152
+ page,
153
+ startTime,
154
+ endTime,
155
+ sort,
156
+ );
101
157
  }
102
158
  }
103
159
  export abstract class ImageMeta extends Meta {
@@ -106,53 +162,53 @@ export abstract class ImageMeta extends Meta {
106
162
  // 测试序列化往返
107
163
 
108
164
  override serialize(): ArrayBuffer {
109
- if (!this.image)throw new Error("not found")
110
- return toBinary(ImageSchema, this.image).buffer
165
+ if (!this.image) throw new Error('not found');
166
+ return toBinary(ImageSchema, this.image).buffer;
111
167
  }
112
168
  override deserialize(buffer: ArrayBuffer): string {
113
- this.image = fromBinary(ImageSchema, new Uint8Array(buffer))
169
+ this.image = fromBinary(ImageSchema, new Uint8Array(buffer));
114
170
  this.base64Image = arrayBufferToImageBase64(this.image.bytes);
115
- return this.base64Image
171
+ return this.base64Image;
116
172
  }
117
173
  override inject(buffer: ArrayBuffer): Promise<this> {
118
174
  if (buffer) {
119
175
  this.image = create(ImageSchema, {
120
- bytes: new Uint8Array(buffer)
176
+ bytes: new Uint8Array(buffer),
121
177
  });
122
178
  this.base64Image = arrayBufferToImageBase64(new Uint8Array(buffer));
123
179
  }
124
- return Promise.resolve(this)
180
+ return Promise.resolve(this);
125
181
  }
126
- abstract override getObject():Promise<string>
182
+ abstract override getObject(): Promise<string>;
127
183
  }
128
- export abstract class ImagesMeta extends Meta{
184
+ export abstract class ImagesMeta extends Meta {
129
185
  images?: Images;
130
186
  base64Images: string[] = [];
131
187
  override serialize(): ArrayBuffer {
132
- if (!this.images)throw new Error("not found")
133
- return toBinary(ImagesSchema, this.images).buffer
188
+ if (!this.images) throw new Error('not found');
189
+ return toBinary(ImagesSchema, this.images).buffer;
134
190
  }
135
191
  override deserialize(buffer: ArrayBuffer): string[] {
136
192
  this.images = fromBinary(ImagesSchema, new Uint8Array(buffer));
137
- this.base64Images = this.images.images.map(item=> arrayBufferToImageBase64(item.bytes))
138
- return this.base64Images
193
+ this.base64Images = this.images.images.map((item) => arrayBufferToImageBase64(item.bytes));
194
+ return this.base64Images;
139
195
  }
140
196
  override inject(buffers?: ArrayBuffer[]): Promise<this> {
141
197
  if (buffers) {
142
198
  this.images = create(ImagesSchema, {
143
- images: buffers.map(buffer => {
199
+ images: buffers.map((buffer) => {
144
200
  return create(ImageSchema, {
145
- bytes: new Uint8Array(buffer)
201
+ bytes: new Uint8Array(buffer),
146
202
  });
147
- })
203
+ }),
148
204
  });
149
- this.base64Images = buffers.map(buffer => {
205
+ this.base64Images = buffers.map((buffer) => {
150
206
  return arrayBufferToImageBase64(new Uint8Array(buffer));
151
207
  });
152
208
  }
153
- return Promise.resolve(this)
209
+ return Promise.resolve(this);
154
210
  }
155
- abstract override getObject():Promise<string[]>
211
+ abstract override getObject(): Promise<string[]>;
156
212
  }
157
213
  export abstract class TextMeta extends Meta {
158
214
  text: string = '';
@@ -160,44 +216,47 @@ export abstract class TextMeta extends Meta {
160
216
  super();
161
217
  }
162
218
  override serialize(): ArrayBuffer {
163
- return new TextEncoder().encode(this.text).buffer
219
+ return new TextEncoder().encode(this.text).buffer;
164
220
  }
165
221
  override deserialize(buffer: ArrayBuffer): string {
166
222
  this.text = new TextDecoder().decode(buffer);
167
- return this.text
223
+ return this.text;
168
224
  }
169
225
  override inject(text?: string): Promise<this> {
170
226
  if (text) {
171
227
  this.text = text;
172
228
  }
173
- return Promise.resolve(this)
229
+ return Promise.resolve(this);
174
230
  }
175
- abstract override getObject():Promise<string>
231
+ abstract override getObject(): Promise<string>;
176
232
  }
177
- export abstract class WavesMeta extends Meta{
178
- waves: WaveMap|undefined;
233
+ export abstract class WavesMeta extends Meta {
234
+ waves: WaveMap | undefined;
179
235
  override serialize(): ArrayBuffer {
180
- console.log('serialize',this.waves)
181
- if(this.waves){
182
- console.log('seruia')
183
- console.log(toBinary(WaveMapSchema, this.waves),toBinary(WaveMapSchema, this.waves).buffer)
184
- console.log('sss')
236
+ console.log('serialize', this.waves);
237
+ if (this.waves) {
238
+ console.log('seruia');
239
+ console.log(toBinary(WaveMapSchema, this.waves), toBinary(WaveMapSchema, this.waves).buffer);
240
+ console.log('sss');
185
241
  }
186
- if(!this.waves)throw new Error("not found")
187
- return toBinary(WaveMapSchema, this.waves).buffer
242
+ if (!this.waves) throw new Error('not found');
243
+ return toBinary(WaveMapSchema, this.waves).buffer;
188
244
  }
189
245
  override deserialize(buffer: ArrayBuffer): WaveMap {
190
246
  this.waves = fromBinary(WaveMapSchema, new Uint8Array(buffer));
191
- return this.waves
247
+ return this.waves;
192
248
  }
193
- abstract preprocess(origins: { [key: string]: number[] }): Promise<{ [key: string]: number[] }>
194
- override async inject(origins?: { [key: string]: number[] },smooths?: { [key: string]: number[] }): Promise<this> {
195
- if(!smooths && origins){
196
- smooths = await this.preprocess(origins)
249
+ abstract preprocess(origins: { [key: string]: number[] }): Promise<{ [key: string]: number[] }>;
250
+ override async inject(
251
+ origins?: { [key: string]: number[] },
252
+ smooths?: { [key: string]: number[] },
253
+ ): Promise<this> {
254
+ if (!smooths && origins) {
255
+ smooths = await this.preprocess(origins);
197
256
  }
198
- console.log(origins,smooths)
199
- if (origins && smooths){
200
- console.log(this.waves)
257
+ console.log(origins, smooths);
258
+ if (origins && smooths) {
259
+ console.log(this.waves);
201
260
  this.waves = create(WaveMapSchema, {
202
261
  origin: Object.fromEntries(
203
262
  Object.entries(origins).map(([key, value]) => [
@@ -205,7 +264,7 @@ export abstract class WavesMeta extends Meta{
205
264
  create(WaveSchema, {
206
265
  values: value,
207
266
  }),
208
- ])
267
+ ]),
209
268
  ),
210
269
  smooth: Object.fromEntries(
211
270
  Object.entries(smooths).map(([key, value]) => [
@@ -213,29 +272,29 @@ export abstract class WavesMeta extends Meta{
213
272
  create(WaveSchema, {
214
273
  values: value,
215
274
  }),
216
- ])
275
+ ]),
217
276
  ),
218
277
  });
219
- console.log(this.waves)
278
+ console.log(this.waves);
220
279
  }
221
- return Promise.resolve(this)
280
+ return Promise.resolve(this);
222
281
  }
223
- abstract override getObject():Promise<WaveMap>
282
+ abstract override getObject(): Promise<WaveMap>;
224
283
  }
225
284
  export abstract class TongueMeta extends ImageMeta {
226
- static override builder(): IBuilder<TongueMeta>{
285
+ static override builder(): IBuilder<TongueMeta> {
227
286
  return Builder(this._default) as unknown as IBuilder<TongueMeta>;
228
287
  }
229
288
  static override default(): typeof TongueMeta {
230
289
  return this._default as unknown as typeof TongueMeta;
231
290
  }
232
- constructor(){
291
+ constructor() {
233
292
  super();
234
293
  this.type = MetaType.Tongue;
235
294
  }
236
295
  }
237
296
  export abstract class FaceMeta extends ImageMeta {
238
- static override builder(): IBuilder<FaceMeta>{
297
+ static override builder(): IBuilder<FaceMeta> {
239
298
  return Builder(this._default) as unknown as IBuilder<FaceMeta>;
240
299
  }
241
300
  static override default(): typeof FaceMeta {
@@ -247,7 +306,7 @@ export abstract class FaceMeta extends ImageMeta {
247
306
  }
248
307
  }
249
308
  export abstract class SceneMeta extends ImageMeta {
250
- static override builder(): IBuilder<SceneMeta>{
309
+ static override builder(): IBuilder<SceneMeta> {
251
310
  return Builder(this._default) as unknown as IBuilder<SceneMeta>;
252
311
  }
253
312
  static override default(): typeof SceneMeta {
@@ -259,7 +318,7 @@ export abstract class SceneMeta extends ImageMeta {
259
318
  }
260
319
  }
261
320
  export abstract class PulsationMeta extends WavesMeta {
262
- static override builder(): IBuilder<PulsationMeta>{
321
+ static override builder(): IBuilder<PulsationMeta> {
263
322
  return Builder(this._default) as unknown as IBuilder<PulsationMeta>;
264
323
  }
265
324
  static override default(): typeof PulsationMeta {
@@ -271,7 +330,7 @@ export abstract class PulsationMeta extends WavesMeta {
271
330
  }
272
331
  }
273
332
  export abstract class PPGMeta extends WavesMeta {
274
- static override builder(): IBuilder<PPGMeta>{
333
+ static override builder(): IBuilder<PPGMeta> {
275
334
  return Builder(this._default) as unknown as IBuilder<PPGMeta>;
276
335
  }
277
336
  static override default(): typeof PPGMeta {
@@ -283,7 +342,7 @@ export abstract class PPGMeta extends WavesMeta {
283
342
  }
284
343
  }
285
344
  export abstract class PCGMeta extends WavesMeta {
286
- static override builder(): IBuilder<PCGMeta>{
345
+ static override builder(): IBuilder<PCGMeta> {
287
346
  return Builder(this._default) as unknown as IBuilder<PCGMeta>;
288
347
  }
289
348
  static override default(): typeof PCGMeta {
@@ -295,7 +354,7 @@ export abstract class PCGMeta extends WavesMeta {
295
354
  }
296
355
  }
297
356
  export abstract class ECGMeta extends WavesMeta {
298
- static override builder(): IBuilder<ECGMeta>{
357
+ static override builder(): IBuilder<ECGMeta> {
299
358
  return Builder(this._default) as unknown as IBuilder<ECGMeta>;
300
359
  }
301
360
  static override default(): typeof ECGMeta {
@@ -307,7 +366,7 @@ export abstract class ECGMeta extends WavesMeta {
307
366
  }
308
367
  }
309
368
  export abstract class AppendixMeta extends ImagesMeta {
310
- static override builder(): IBuilder<AppendixMeta>{
369
+ static override builder(): IBuilder<AppendixMeta> {
311
370
  return Builder(this._default) as unknown as IBuilder<AppendixMeta>;
312
371
  }
313
372
  static override default(): typeof AppendixMeta {
@@ -319,7 +378,7 @@ export abstract class AppendixMeta extends ImagesMeta {
319
378
  }
320
379
  }
321
380
  export abstract class ComplaintMeta extends TextMeta {
322
- static override builder(): IBuilder<ComplaintMeta>{
381
+ static override builder(): IBuilder<ComplaintMeta> {
323
382
  return Builder(this._default) as unknown as IBuilder<ComplaintMeta>;
324
383
  }
325
384
  static override default(): typeof ComplaintMeta {
@@ -340,7 +399,7 @@ export class MetaSequence<T extends Meta> extends Sequence<T> {
340
399
  this.type = type;
341
400
  if (owner) this.owner = owner;
342
401
  }
343
- init(owner: Patient){
402
+ init(owner: Patient) {
344
403
  this.clear();
345
404
  this.owner = Patient.builder().id(owner.id).build();
346
405
  }
@@ -361,14 +420,49 @@ export class MetaSequence<T extends Meta> extends Sequence<T> {
361
420
  endTime?: string,
362
421
  sort?: string,
363
422
  ): Promise<Page<Meta>> {
364
- const pageable = (await Meta.query(page, pageSize, this.owner, this.type, startTime, endTime, sort))
365
- this.data.unshift(...pageable.data.reverse() as T[]);
366
- return pageable
367
- }
368
- async appendMetaWithPatient(page: number, pageSize: number, type?: string, startTime?: string, endTime?: string,sort?: string, name?: string, phoneNumber?: string, startBirthdate?: string, endBirthdate?: string, gender?: string, tags?: Tag[]): Promise<Page<Meta>> {
369
- const pageable = (await Meta.queryMetaWithPatient(page, pageSize,this.owner, type, startTime, endTime,sort, name, phoneNumber, startBirthdate, endBirthdate, gender,tags))
370
- this.data.unshift(...pageable.data.reverse() as T[]);
371
- return pageable
423
+ const pageable = await Meta.query(
424
+ page,
425
+ pageSize,
426
+ this.owner,
427
+ this.type,
428
+ startTime,
429
+ endTime,
430
+ sort,
431
+ );
432
+ this.data.unshift(...(pageable.data.reverse() as T[]));
433
+ return pageable;
434
+ }
435
+ async appendMetaWithPatient(
436
+ page: number,
437
+ pageSize: number,
438
+ type?: string,
439
+ startTime?: string,
440
+ endTime?: string,
441
+ sort?: string,
442
+ name?: string,
443
+ phoneNumber?: string,
444
+ startBirthdate?: string,
445
+ endBirthdate?: string,
446
+ gender?: string,
447
+ tags?: Tag[],
448
+ ): Promise<Page<Meta>> {
449
+ const pageable = await Meta.queryMetaWithPatient(
450
+ page,
451
+ pageSize,
452
+ this.owner,
453
+ type,
454
+ startTime,
455
+ endTime,
456
+ sort,
457
+ name,
458
+ phoneNumber,
459
+ startBirthdate,
460
+ endBirthdate,
461
+ gender,
462
+ tags,
463
+ );
464
+ this.data.unshift(...(pageable.data.reverse() as T[]));
465
+ return pageable;
372
466
  }
373
467
  }
374
468
  export const MetaTypeConfig = {
@@ -381,11 +475,11 @@ export const MetaTypeConfig = {
381
475
  [MetaType.PPG]: { type: PPGMeta, name: '心光', icon: 'ssid_chart', color: '#7209B7' },
382
476
  [MetaType.Scene]: { type: SceneMeta, name: '场景', icon: 'house', color: '#F72585' },
383
477
  [MetaType.Appendix]: { type: AppendixMeta, name: '附件', icon: 'folder_open', color: '#3A86FF' },
384
- [MetaType.Meta]: { type: Meta, name: '元', icon: 'tag', color: '#8338EC' }
478
+ [MetaType.Meta]: { type: Meta, name: '元', icon: 'tag', color: '#8338EC' },
385
479
  };
386
- export abstract class Metas{
387
- static _default: typeof Metas
388
- static builder(): IBuilder<Metas>{
480
+ export abstract class Metas {
481
+ static _default: typeof Metas;
482
+ static builder(): IBuilder<Metas> {
389
483
  return Builder(this._default) as unknown as IBuilder<Metas>;
390
484
  }
391
485
  static default(): typeof Metas {
@@ -413,13 +507,13 @@ export abstract class Metas{
413
507
  appendixes = this[MetaType.Appendix];
414
508
  metas = this[MetaType.Meta];
415
509
  constructor(metas?: Meta[]) {
416
- if(metas)this.addMetas(metas)
510
+ if (metas) this.addMetas(metas);
417
511
  }
418
- init(owner: Patient): this{
512
+ init(owner: Patient): this {
419
513
  for (const type of Object.values(MetaType)) {
420
514
  this[type].init(owner);
421
515
  }
422
- return this
516
+ return this;
423
517
  }
424
518
  async query(
425
519
  page: number,
@@ -431,36 +525,46 @@ export abstract class Metas{
431
525
  for (const type of Object.values(MetaType)) {
432
526
  //print
433
527
  const metas = await this[type].query(page, pageSize, startTime, endTime, sort);
434
- for(const meta of metas.data){
528
+ for (const meta of metas.data) {
435
529
  (this[type].data as Meta[]).push(meta);
436
530
  }
437
531
  }
438
- return this
532
+ return this;
439
533
  }
440
- addMetas(metas: Meta[]){
441
- for(const meta of metas){
442
- this.addMeta(meta)
534
+ addMetas(metas: Meta[]) {
535
+ for (const meta of metas) {
536
+ this.addMeta(meta);
443
537
  }
444
- return this
538
+ return this;
445
539
  }
446
- addMeta(meta: Meta){
447
- const exist = this[meta.type].data.find(item => item.id == meta.id)
448
- if(!exist)(this[meta.type].data as Meta[]).unshift(meta)
449
- else void exist.of(meta)
450
- return this
540
+ addMeta(meta: Meta) {
541
+ const exist = this[meta.type].data.find((item) => item.id == meta.id);
542
+ if (!exist) (this[meta.type].data as Meta[]).unshift(meta);
543
+ else void exist.of(meta);
544
+ return this;
451
545
  }
452
- clear(){
546
+ clear() {
453
547
  for (const type of Object.values(MetaType)) {
454
548
  this[type].clear();
455
549
  }
456
550
  }
457
551
  static map(meta: MetaState): Promise<Meta> {
458
- return Metas.default().map(meta)
459
- }
460
- static mapText(type: MetaType){
461
- return MetaTypeConfig[type].name
462
- }
463
- static standards(): MetaType[]{
464
- return [MetaType.Face, MetaType.Tongue, MetaType.Complaint, MetaType.Pulsation, MetaType.ECG, MetaType.PCG, MetaType.PPG, MetaType.Scene, MetaType.Appendix]
552
+ return Metas.default().map(meta);
553
+ }
554
+ static mapText(type: MetaType) {
555
+ return MetaTypeConfig[type].name;
556
+ }
557
+ static standards(): MetaType[] {
558
+ return [
559
+ MetaType.Face,
560
+ MetaType.Tongue,
561
+ MetaType.Complaint,
562
+ MetaType.Pulsation,
563
+ MetaType.ECG,
564
+ MetaType.PCG,
565
+ MetaType.PPG,
566
+ MetaType.Scene,
567
+ MetaType.Appendix,
568
+ ];
465
569
  }
466
570
  }