web-core-tcm 0.0.25 → 0.0.27

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 (308) hide show
  1. package/dist/node_modules/@alova/shared/dist/alova-shared.esm.js +134 -0
  2. package/dist/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/boot.js +70 -0
  3. package/dist/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/file.js +14 -0
  4. package/dist/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/message.js +6 -0
  5. package/dist/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/restore-json-names.js +10 -0
  6. package/dist/node_modules/@bufbuild/protobuf/dist/esm/create.js +136 -0
  7. package/dist/node_modules/@bufbuild/protobuf/dist/esm/descriptors.js +7 -0
  8. package/dist/node_modules/@bufbuild/protobuf/dist/esm/from-binary.js +164 -0
  9. package/dist/node_modules/@bufbuild/protobuf/dist/esm/is-message.js +6 -0
  10. package/dist/node_modules/@bufbuild/protobuf/dist/esm/proto-int64.js +75 -0
  11. package/dist/node_modules/@bufbuild/protobuf/dist/esm/reflect/error.js +8 -0
  12. package/dist/node_modules/@bufbuild/protobuf/dist/esm/reflect/guard.js +35 -0
  13. package/dist/node_modules/@bufbuild/protobuf/dist/esm/reflect/names.js +42 -0
  14. package/dist/node_modules/@bufbuild/protobuf/dist/esm/reflect/nested-types.js +17 -0
  15. package/dist/node_modules/@bufbuild/protobuf/dist/esm/reflect/reflect-check.js +156 -0
  16. package/dist/node_modules/@bufbuild/protobuf/dist/esm/reflect/reflect.js +349 -0
  17. package/dist/node_modules/@bufbuild/protobuf/dist/esm/reflect/scalar.js +39 -0
  18. package/dist/node_modules/@bufbuild/protobuf/dist/esm/reflect/unsafe.js +72 -0
  19. package/dist/node_modules/@bufbuild/protobuf/dist/esm/registry.js +551 -0
  20. package/dist/node_modules/@bufbuild/protobuf/dist/esm/to-binary.js +159 -0
  21. package/dist/node_modules/@bufbuild/protobuf/dist/esm/wire/base64-encoding.js +58 -0
  22. package/dist/node_modules/@bufbuild/protobuf/dist/esm/wire/binary-encoding.js +350 -0
  23. package/dist/node_modules/@bufbuild/protobuf/dist/esm/wire/text-encoding.js +25 -0
  24. package/dist/node_modules/@bufbuild/protobuf/dist/esm/wire/text-format.js +145 -0
  25. package/dist/node_modules/@bufbuild/protobuf/dist/esm/wire/varint.js +110 -0
  26. package/dist/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/descriptor_pb.js +107 -0
  27. package/dist/node_modules/@bufbuild/protobuf/dist/esm/wkt/wrappers.js +24 -0
  28. package/dist/node_modules/@vue/reactivity/dist/reactivity.esm-bundler.js +556 -0
  29. package/dist/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js +36 -0
  30. package/dist/node_modules/@vue/shared/dist/shared.esm-bundler.js +26 -0
  31. package/dist/node_modules/alova/dist/adapter/fetch.esm.js +55 -0
  32. package/dist/node_modules/alova/dist/alova.esm.js +414 -0
  33. package/dist/node_modules/alova/dist/clienthook/index.esm.js +89 -0
  34. package/dist/node_modules/builder-pattern/dist/index.js +22 -0
  35. package/dist/node_modules/jwt-decode/build/esm/index.js +52 -0
  36. package/dist/node_modules/pinyin/lib/esm/pinyin.js +242260 -0
  37. package/dist/node_modules/punycode/punycode.es6.js +139 -0
  38. package/dist/node_modules/quasar/src/composables/use-quasar/use-quasar.js +8 -0
  39. package/dist/node_modules/quasar/src/utils/private.symbols/symbols.js +4 -0
  40. package/dist/src/api/algorithm/comprehensiveAlgorithm.d.ts +4 -0
  41. package/dist/src/api/algorithm/comprehensiveAlgorithm.js +16 -0
  42. package/dist/src/api/algorithm/index.d.ts +10 -0
  43. package/dist/src/api/algorithm/index.js +62 -0
  44. package/dist/src/api/algorithm/inquiriesAlgorithm.d.ts +13 -0
  45. package/dist/src/api/algorithm/inquiriesAlgorithm.js +9 -0
  46. package/dist/src/api/algorithm/inspectionsAlgorithm.d.ts +2 -0
  47. package/dist/src/api/algorithm/inspectionsAlgorithm.js +10 -0
  48. package/dist/src/api/algorithm/lisemsAlgorithm.d.ts +2 -0
  49. package/dist/src/api/algorithm/lisemsAlgorithm.js +15 -0
  50. package/dist/src/api/algorithm/pulsationsAlgorithm.d.ts +4 -0
  51. package/dist/src/api/algorithm/pulsationsAlgorithm.js +8 -0
  52. package/dist/src/api/authorization/alova/apiDefinitions.d.ts +21 -0
  53. package/dist/src/api/authorization/alova/apiDefinitions.js +9 -0
  54. package/dist/src/api/authorization/alova/createApis.d.ts +10 -0
  55. package/dist/src/api/authorization/alova/createApis.js +51 -0
  56. package/dist/src/api/authorization/alova/implement/authorization.d.ts +4 -0
  57. package/dist/src/api/authorization/alova/implement/authorization.js +15 -0
  58. package/dist/src/api/authorization/alova/index.d.ts +5 -0
  59. package/dist/src/api/authorization/alova/index.js +18 -0
  60. package/dist/src/api/authorization/authorization.d.ts +8 -0
  61. package/dist/src/api/authorization/authorization.js +16 -0
  62. package/dist/src/api/authorization/index.js +9 -0
  63. package/dist/src/api/check/alova/apiDefinitions.d.ts +28 -0
  64. package/dist/src/api/check/alova/apiDefinitions.js +16 -0
  65. package/dist/src/api/check/alova/createApis.d.ts +10 -0
  66. package/dist/src/api/check/alova/createApis.js +51 -0
  67. package/dist/src/api/check/alova/implement/check.d.ts +27 -0
  68. package/dist/src/api/check/alova/implement/check.js +119 -0
  69. package/dist/src/api/check/alova/index.d.ts +5 -0
  70. package/dist/src/api/check/alova/index.js +21 -0
  71. package/dist/src/api/check/check.d.ts +54 -0
  72. package/dist/src/api/check/check.js +131 -0
  73. package/dist/src/api/check/index.js +11 -0
  74. package/dist/src/api/config/alova/index.d.ts +5 -0
  75. package/dist/src/api/config/alova/index.js +55 -0
  76. package/dist/src/api/config/index.d.ts +23 -0
  77. package/dist/src/api/config/index.js +106 -0
  78. package/dist/src/api/device/device.d.ts +5 -0
  79. package/dist/src/api/device/device.js +46 -0
  80. package/dist/src/api/doctor/alova/apiDefinitions.d.ts +26 -0
  81. package/dist/src/api/doctor/alova/apiDefinitions.js +14 -0
  82. package/dist/src/api/doctor/alova/createApis.d.ts +10 -0
  83. package/dist/src/api/doctor/alova/createApis.js +51 -0
  84. package/dist/src/api/doctor/alova/implement/doctor.d.ts +7 -0
  85. package/dist/src/api/doctor/alova/implement/doctor.js +42 -0
  86. package/dist/src/api/doctor/alova/index.d.ts +5 -0
  87. package/dist/src/api/doctor/alova/index.js +20 -0
  88. package/dist/src/api/doctor/doctor.d.ts +22 -0
  89. package/dist/src/api/doctor/doctor.js +29 -0
  90. package/dist/src/api/doctor/index.js +9 -0
  91. package/dist/src/api/metric/implement/metric.d.ts +24 -0
  92. package/dist/src/api/metric/implement/metric.js +80 -0
  93. package/dist/src/api/metric/index.js +6 -0
  94. package/dist/src/api/metric/metric.d.ts +28 -0
  95. package/dist/src/api/metric/metric.js +75 -0
  96. package/dist/src/api/oauth/alova/apiDefinitions.d.ts +24 -0
  97. package/dist/src/api/oauth/alova/apiDefinitions.js +12 -0
  98. package/dist/src/api/oauth/alova/createApis.d.ts +10 -0
  99. package/dist/src/api/oauth/alova/createApis.js +51 -0
  100. package/dist/src/api/oauth/alova/implement/oauth.d.ts +4 -0
  101. package/dist/src/api/oauth/alova/implement/oauth.js +15 -0
  102. package/dist/src/api/oauth/alova/index.d.ts +5 -0
  103. package/dist/src/api/oauth/alova/index.js +17 -0
  104. package/dist/src/api/oauth/index.js +9 -0
  105. package/dist/src/api/oauth/oauth.d.ts +7 -0
  106. package/dist/src/api/oauth/oauth.js +16 -0
  107. package/dist/src/api/outpatient/alova/apiDefinitions.d.ts +25 -0
  108. package/dist/src/api/outpatient/alova/apiDefinitions.js +13 -0
  109. package/dist/src/api/outpatient/alova/createApis.d.ts +10 -0
  110. package/dist/src/api/outpatient/alova/createApis.js +51 -0
  111. package/dist/src/api/outpatient/alova/implement/outpatient.d.ts +10 -0
  112. package/dist/src/api/outpatient/alova/implement/outpatient.js +71 -0
  113. package/dist/src/api/outpatient/alova/index.d.ts +5 -0
  114. package/dist/src/api/outpatient/alova/index.js +21 -0
  115. package/dist/src/api/outpatient/index.js +11 -0
  116. package/dist/src/api/outpatient/outpatient.d.ts +39 -0
  117. package/dist/src/api/outpatient/outpatient.js +45 -0
  118. package/dist/src/api/patient/alova/apiDefinitions.d.ts +39 -0
  119. package/dist/src/api/patient/alova/apiDefinitions.js +27 -0
  120. package/dist/src/api/patient/alova/createApis.d.ts +10 -0
  121. package/dist/src/api/patient/alova/createApis.js +51 -0
  122. package/dist/src/api/patient/alova/implement/meta.d.ts +113 -0
  123. package/dist/src/api/patient/alova/implement/meta.js +404 -0
  124. package/dist/src/api/patient/alova/implement/patient.d.ts +22 -0
  125. package/dist/src/api/patient/alova/implement/patient.js +72 -0
  126. package/dist/src/api/patient/alova/index.d.ts +5 -0
  127. package/dist/src/api/patient/alova/index.js +22 -0
  128. package/dist/src/api/patient/core.d.ts +50 -0
  129. package/dist/src/api/patient/core.js +109 -0
  130. package/dist/src/api/patient/index.js +46 -0
  131. package/dist/src/api/patient/meta.d.ts +238 -0
  132. package/dist/src/api/patient/meta.js +454 -0
  133. package/dist/src/api/patient/patient.d.ts +43 -0
  134. package/dist/src/api/patient/patient.js +42 -0
  135. package/dist/src/api/prescription/alova/apiDefinitions.d.ts +27 -0
  136. package/dist/src/api/prescription/alova/apiDefinitions.js +15 -0
  137. package/dist/src/api/prescription/alova/createApis.d.ts +10 -0
  138. package/dist/src/api/prescription/alova/createApis.js +51 -0
  139. package/dist/src/api/prescription/alova/implement/herbal.d.ts +15 -0
  140. package/dist/src/api/prescription/alova/implement/herbal.js +54 -0
  141. package/dist/src/api/prescription/alova/implement/prescription.d.ts +15 -0
  142. package/dist/src/api/prescription/alova/implement/prescription.js +49 -0
  143. package/dist/src/api/prescription/alova/index.d.ts +5 -0
  144. package/dist/src/api/prescription/alova/index.js +20 -0
  145. package/dist/src/api/prescription/herbal.d.ts +19 -0
  146. package/dist/src/api/prescription/herbal.js +34 -0
  147. package/dist/src/api/prescription/index.js +13 -0
  148. package/dist/src/api/prescription/prescription.d.ts +26 -0
  149. package/dist/src/api/prescription/prescription.js +49 -0
  150. package/dist/src/api/scientist/alova/apiDefinitions.d.ts +25 -0
  151. package/dist/src/api/scientist/alova/apiDefinitions.js +13 -0
  152. package/dist/src/api/scientist/alova/createApis.d.ts +10 -0
  153. package/dist/src/api/scientist/alova/createApis.js +51 -0
  154. package/dist/src/api/scientist/alova/implement/scientist.d.ts +6 -0
  155. package/dist/src/api/scientist/alova/implement/scientist.js +35 -0
  156. package/dist/src/api/scientist/alova/index.d.ts +6 -0
  157. package/dist/src/api/scientist/alova/index.js +21 -0
  158. package/dist/src/api/scientist/index.js +9 -0
  159. package/dist/src/api/scientist/scientist.d.ts +20 -0
  160. package/dist/src/api/scientist/scientist.js +37 -0
  161. package/dist/src/components/models.d.ts +7 -0
  162. package/dist/src/index.js +36 -0
  163. package/dist/src/pages/LoginPage.vue.d.ts +2 -0
  164. package/dist/src/proto/types/Images_pb.d.ts +34 -0
  165. package/dist/src/proto/types/Images_pb.js +10 -0
  166. package/dist/src/proto/types/WaveMap_pb.d.ts +48 -0
  167. package/dist/src/proto/types/WaveMap_pb.js +10 -0
  168. package/dist/src/router/index.d.ts +2 -0
  169. package/dist/src/router/routes.d.ts +3 -0
  170. package/dist/src/util/RichTextUtil.d.ts +1 -0
  171. package/dist/src/util/RichTextUtil.js +6 -0
  172. package/dist/src/util/datetime.d.ts +5 -0
  173. package/dist/src/util/export.d.ts +4 -0
  174. package/dist/src/util/helper.d.ts +65 -0
  175. package/dist/src/util/helper.js +46 -0
  176. package/dist/src/util/image.d.ts +2 -0
  177. package/dist/src/util/image.js +17 -0
  178. package/dist/src/util/number.d.ts +12 -0
  179. package/dist/src/util/s256.d.ts +2 -0
  180. package/dist/src/util/secret.d.ts +10 -0
  181. package/dist/src/util/string.d.ts +21 -0
  182. package/dist/src/util/string.js +10 -0
  183. package/package.json +5 -2
  184. package/.editorconfig +0 -7
  185. package/.github/workflows/test.yml +0 -29
  186. package/.prettierrc.json +0 -5
  187. package/.vscode/extensions.json +0 -15
  188. package/.vscode/settings.json +0 -9
  189. package/eslint.config.js +0 -83
  190. package/index.html +0 -24
  191. package/postcss.config.js +0 -29
  192. package/quasar.config.ts +0 -233
  193. package/src/App.vue +0 -7
  194. package/src/api/algorithm/comprehensiveAlgorithm.ts +0 -20
  195. package/src/api/algorithm/index.ts +0 -50
  196. package/src/api/algorithm/inquiriesAlgorithm.ts +0 -16
  197. package/src/api/algorithm/inspectionsAlgorithm.ts +0 -11
  198. package/src/api/algorithm/lisemsAlgorithm.ts +0 -16
  199. package/src/api/algorithm/pulsationsAlgorithm.ts +0 -8
  200. package/src/api/authorization/alova/apiDefinitions.ts +0 -23
  201. package/src/api/authorization/alova/createApis.ts +0 -114
  202. package/src/api/authorization/alova/globals.d.ts +0 -394
  203. package/src/api/authorization/alova/implement/authorization.ts +0 -14
  204. package/src/api/authorization/alova/index.ts +0 -22
  205. package/src/api/authorization/authorization.ts +0 -16
  206. package/src/api/check/alova/apiDefinitions.ts +0 -30
  207. package/src/api/check/alova/createApis.ts +0 -114
  208. package/src/api/check/alova/globals.d.ts +0 -1257
  209. package/src/api/check/alova/implement/check.ts +0 -165
  210. package/src/api/check/alova/index.ts +0 -22
  211. package/src/api/check/check.ts +0 -217
  212. package/src/api/config/alova/index.ts +0 -71
  213. package/src/api/config/index.ts +0 -132
  214. package/src/api/device/device.js +0 -58
  215. package/src/api/doctor/alova/apiDefinitions.ts +0 -28
  216. package/src/api/doctor/alova/createApis.ts +0 -114
  217. package/src/api/doctor/alova/globals.d.ts +0 -559
  218. package/src/api/doctor/alova/implement/doctor.ts +0 -51
  219. package/src/api/doctor/alova/index.ts +0 -23
  220. package/src/api/doctor/doctor.ts +0 -53
  221. package/src/api/metric/implement/metric.ts +0 -108
  222. package/src/api/metric/metric.ts +0 -114
  223. package/src/api/oauth/alova/apiDefinitions.ts +0 -26
  224. package/src/api/oauth/alova/createApis.ts +0 -114
  225. package/src/api/oauth/alova/globals.d.ts +0 -460
  226. package/src/api/oauth/alova/implement/oauth.ts +0 -24
  227. package/src/api/oauth/alova/index.ts +0 -21
  228. package/src/api/oauth/oauth.ts +0 -19
  229. package/src/api/outpatient/alova/apiDefinitions.ts +0 -27
  230. package/src/api/outpatient/alova/createApis.ts +0 -114
  231. package/src/api/outpatient/alova/globals.d.ts +0 -685
  232. package/src/api/outpatient/alova/implement/outpatient.ts +0 -91
  233. package/src/api/outpatient/alova/index.ts +0 -22
  234. package/src/api/outpatient/outpatient.ts +0 -67
  235. package/src/api/patient/alova/apiDefinitions.ts +0 -41
  236. package/src/api/patient/alova/createApis.ts +0 -114
  237. package/src/api/patient/alova/globals.d.ts +0 -1690
  238. package/src/api/patient/alova/implement/meta.ts +0 -517
  239. package/src/api/patient/alova/implement/patient.ts +0 -99
  240. package/src/api/patient/alova/index.ts +0 -22
  241. package/src/api/patient/core.ts +0 -133
  242. package/src/api/patient/meta.ts +0 -570
  243. package/src/api/patient/patient.ts +0 -98
  244. package/src/api/prescription/alova/apiDefinitions.ts +0 -29
  245. package/src/api/prescription/alova/createApis.ts +0 -114
  246. package/src/api/prescription/alova/globals.d.ts +0 -968
  247. package/src/api/prescription/alova/implement/herbal.ts +0 -68
  248. package/src/api/prescription/alova/implement/prescription.ts +0 -62
  249. package/src/api/prescription/alova/index.ts +0 -22
  250. package/src/api/prescription/herbal.ts +0 -51
  251. package/src/api/prescription/prescription.ts +0 -76
  252. package/src/api/scientist/alova/apiDefinitions.ts +0 -27
  253. package/src/api/scientist/alova/createApis.ts +0 -114
  254. package/src/api/scientist/alova/globals.d.ts +0 -447
  255. package/src/api/scientist/alova/implement/scientist.ts +0 -40
  256. package/src/api/scientist/alova/index.ts +0 -24
  257. package/src/api/scientist/scientist.ts +0 -49
  258. package/src/assets/quasar-logo-vertical.svg +0 -15
  259. package/src/boot/.gitkeep +0 -0
  260. package/src/components/ExampleComponent.vue +0 -37
  261. package/src/components/models.ts +0 -8
  262. package/src/css/app.scss +0 -1
  263. package/src/css/quasar.variables.scss +0 -25
  264. package/src/env.d.ts +0 -7
  265. package/src/layouts/UserLayout.vue +0 -108
  266. package/src/pages/LoginPage.vue +0 -29
  267. package/src/proto/Images.proto +0 -7
  268. package/src/proto/WaveMap.proto +0 -10
  269. package/src/proto/types/Images_pb.ts +0 -48
  270. package/src/proto/types/WaveMap_pb.ts +0 -59
  271. package/src/router/index.ts +0 -37
  272. package/src/router/routes.ts +0 -14
  273. package/src/util/RichTextUtil.ts +0 -5
  274. package/src/util/datetime.ts +0 -43
  275. package/src/util/export.ts +0 -46
  276. package/src/util/helper.ts +0 -159
  277. package/src/util/image.ts +0 -28
  278. package/src/util/number.ts +0 -146
  279. package/src/util/s256.js +0 -27
  280. package/src/util/secret.ts +0 -60
  281. package/src/util/string.ts +0 -121
  282. package/tsconfig.json +0 -7
  283. /package/{public → dist}/favicon.ico +0 -0
  284. /package/{public → dist}/icons/favicon-128x128.png +0 -0
  285. /package/{public → dist}/icons/favicon-16x16.png +0 -0
  286. /package/{public → dist}/icons/favicon-32x32.png +0 -0
  287. /package/{public → dist}/icons/favicon-96x96.png +0 -0
  288. /package/{src/api/authorization/alova/implement/index.ts → dist/src/api/authorization/alova/implement/index.d.ts} +0 -0
  289. /package/{src/api/authorization/index.ts → dist/src/api/authorization/index.d.ts} +0 -0
  290. /package/{src/api/check/alova/implement/index.ts → dist/src/api/check/alova/implement/index.d.ts} +0 -0
  291. /package/{src/api/check/index.ts → dist/src/api/check/index.d.ts} +0 -0
  292. /package/{src/api/doctor/alova/implement/index.ts → dist/src/api/doctor/alova/implement/index.d.ts} +0 -0
  293. /package/{src/api/doctor/index.ts → dist/src/api/doctor/index.d.ts} +0 -0
  294. /package/{src/api/index.ts → dist/src/api/index.d.ts} +0 -0
  295. /package/{src/api/metric/implement/index.ts → dist/src/api/metric/implement/index.d.ts} +0 -0
  296. /package/{src/api/metric/index.ts → dist/src/api/metric/index.d.ts} +0 -0
  297. /package/{src/api/oauth/alova/implement/index.ts → dist/src/api/oauth/alova/implement/index.d.ts} +0 -0
  298. /package/{src/api/oauth/index.ts → dist/src/api/oauth/index.d.ts} +0 -0
  299. /package/{src/api/outpatient/alova/implement/index.ts → dist/src/api/outpatient/alova/implement/index.d.ts} +0 -0
  300. /package/{src/api/outpatient/index.ts → dist/src/api/outpatient/index.d.ts} +0 -0
  301. /package/{src/api/patient/alova/implement/index.ts → dist/src/api/patient/alova/implement/index.d.ts} +0 -0
  302. /package/{src/api/patient/index.ts → dist/src/api/patient/index.d.ts} +0 -0
  303. /package/{src/api/prescription/alova/implement/index.ts → dist/src/api/prescription/alova/implement/index.d.ts} +0 -0
  304. /package/{src/api/prescription/index.ts → dist/src/api/prescription/index.d.ts} +0 -0
  305. /package/{src/api/scientist/alova/implement/index.ts → dist/src/api/scientist/alova/implement/index.d.ts} +0 -0
  306. /package/{src/api/scientist/index.ts → dist/src/api/scientist/index.d.ts} +0 -0
  307. /package/{src/index.ts → dist/src/index.d.ts} +0 -0
  308. /package/{src/proto/index.ts → dist/src/proto/index.d.ts} +0 -0
@@ -1,133 +0,0 @@
1
- import type { AnnotationState, TagState } from 'src/api/patient/alova/globals';
2
- import type { IBuilder } from 'builder-pattern';
3
- import { Builder } from 'builder-pattern';
4
- export class Page<T> {
5
- data: T[] = [];
6
- total: number = 0;
7
- page: number = 0;
8
- pageSize: number = 0;
9
- pageCount: number = 0;
10
- isLastPage: boolean = false;
11
- }
12
- abstract class NetworkObject {
13
- static _default: typeof NetworkObject = NetworkObject;
14
- static builder(): IBuilder<unknown> {
15
- return Builder(this._default);
16
- }
17
- static default(): typeof NetworkObject {
18
- return NetworkObject;
19
- }
20
- abstract of(json: unknown): Promise<this>;
21
- abstract state(): unknown;
22
- }
23
-
24
- class Annotation extends NetworkObject {
25
- value: string = '';
26
- actor: string = '';
27
- timestamp: string = '';
28
- static override builder(): IBuilder<Annotation> {
29
- return Builder(Annotation) as unknown as IBuilder<Annotation>;
30
- }
31
- constructor(value: string = '', actor: string = '', timestamp: string = '') {
32
- super();
33
- this.value = value;
34
- this.actor = actor;
35
- this.timestamp = timestamp;
36
- }
37
- override of(json: AnnotationState) {
38
- this.value = json.value!;
39
- this.actor = json.actor!;
40
- this.timestamp = json.timestamp!;
41
- return Promise.resolve(this);
42
- }
43
- override state(): AnnotationState {
44
- return {
45
- value: this.value,
46
- actor: this.actor,
47
- timestamp: this.timestamp,
48
- };
49
- }
50
- }
51
-
52
- class Tag extends NetworkObject {
53
- static override builder(): IBuilder<Tag> {
54
- return Builder(Tag) as unknown as IBuilder<Tag>;
55
- }
56
- static override default(): typeof Tag {
57
- return Tag;
58
- }
59
- key: string = '';
60
- annotations: Annotation[] = [];
61
- constructor(key: string = '', annotations: Annotation[] = []) {
62
- super();
63
- this.key = key;
64
- this.annotations = annotations;
65
- }
66
- override async of(json: TagState): Promise<this> {
67
- this.key = json.key!;
68
- for (const item of json.annotationsState) {
69
- this.annotations.push(await new Annotation().of(item));
70
- }
71
- return this;
72
- }
73
- override state(): TagState {
74
- return {
75
- key: this.key,
76
- annotationsState: this.annotations.map((item) => item.state()),
77
- };
78
- }
79
- getLastValue(): string {
80
- return this.getLastAnnotation().value;
81
- }
82
- getLastAnnotation(): Annotation {
83
- return this.annotations[this.annotations.length - 1];
84
- }
85
- static getValueTagSet(tags: Tag[]): Tag[] {
86
- const filterTag = [] as Tag[];
87
- tags.forEach((tag) => {
88
- const key = tag.key;
89
- const value = tag.getLastAnnotation().value.slice(0, 10);
90
- if (
91
- filterTag.find(
92
- (tag) => tag.key == key && tag.getLastAnnotation().value.slice(0, 10) == value,
93
- )
94
- )
95
- return;
96
- filterTag.push(tag);
97
- });
98
- return filterTag;
99
- }
100
- assign(tag: Tag) {
101
- this.key = tag.key;
102
- this.annotations = tag.annotations;
103
- return this;
104
- }
105
- }
106
-
107
- class Sequence<T> {
108
- data: T[] = [];
109
- current: T = {} as T;
110
- showed: boolean = false;
111
- constructor(data: T[] = [], current: T = {} as T) {
112
- this.data = data;
113
- this.current = current;
114
- }
115
- delete(item: T): T {
116
- this.data.splice(this.data.indexOf(item), 1);
117
- return item;
118
- }
119
- choose(item: T): T {
120
- this.current = item;
121
- return item;
122
- }
123
- clear(): this {
124
- this.data.length = 0;
125
- this.current = {} as T;
126
- return this;
127
- }
128
- show(): Sequence<T> {
129
- this.showed = true;
130
- return this;
131
- }
132
- }
133
- export { NetworkObject, Tag, Sequence, Annotation };
@@ -1,570 +0,0 @@
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
- import { create, fromBinary, toBinary } from '@bufbuild/protobuf';
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
- import type { IBuilder } from 'builder-pattern';
13
- import { Builder } from 'builder-pattern';
14
- //Enum Type
15
- export enum MetaType {
16
- Pulsation = 'pulsation',
17
- Tongue = 'tongue',
18
- Appendix = 'appendix',
19
- PPG = 'ppg',
20
- PCG = 'pcg',
21
- ECG = 'ecg',
22
- Scene = 'scene',
23
- Face = 'face',
24
- Complaint = 'complaint',
25
- Meta = 'meta',
26
- }
27
- export abstract class Meta extends NetworkObject {
28
- static override builder(): IBuilder<unknown> {
29
- return Builder(this._default) as unknown as IBuilder<Meta>;
30
- }
31
- static override default(): typeof Meta {
32
- return this._default as unknown as typeof Meta;
33
- }
34
- id: string = '';
35
- owner: Patient = Patient.builder().build();
36
- type: MetaType = MetaType.Face;
37
- tags: Tag[] = [] as Tag[];
38
- createdTimestamp: string = '0';
39
- updatedTimestamp: string = '0';
40
-
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)
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;
51
- return Promise.resolve(this);
52
- }
53
- override state(): MetaState {
54
- return {
55
- id: this.id,
56
- ownerState: this.owner.state(),
57
- type: this.type,
58
- tagsState: this.tags.map((tag) => tag.state()),
59
- createdTimestamp: this.createdTimestamp,
60
- updatedTimestamp: this.updatedTimestamp,
61
- };
62
- }
63
- getTagValue(key: string): string | undefined {
64
- const annotation = this.tags.find((tag) => tag.key == key)?.getLastAnnotation();
65
- return annotation ? annotation.value : '';
66
- }
67
- putTags() {
68
- return patientApi.metaStateRestful.putMetaState({
69
- pathParams: {
70
- id: this.id,
71
- },
72
- data: {
73
- id: this.id,
74
- tagsState: this.tags.map((tag) => tag.state()),
75
- },
76
- });
77
- }
78
- addTag(tag: Tag) {
79
- this.tags.push(tag);
80
- return this.putTags();
81
- }
82
- removeTag(tag: Tag) {
83
- this.tags.splice(this.tags.indexOf(tag), 1);
84
- return this.putTags();
85
- }
86
- abstract analyze(): Promise<this>;
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
- );
157
- }
158
- }
159
- export abstract class ImageMeta extends Meta {
160
- image?: Image;
161
- base64Image: string = '';
162
- // 测试序列化往返
163
-
164
- override serialize(): ArrayBuffer {
165
- if (!this.image) throw new Error('not found');
166
- return toBinary(ImageSchema, this.image).buffer;
167
- }
168
- override deserialize(buffer: ArrayBuffer): string {
169
- this.image = fromBinary(ImageSchema, new Uint8Array(buffer));
170
- this.base64Image = arrayBufferToImageBase64(this.image.bytes);
171
- return this.base64Image;
172
- }
173
- override inject(buffer: ArrayBuffer): Promise<this> {
174
- if (buffer) {
175
- this.image = create(ImageSchema, {
176
- bytes: new Uint8Array(buffer),
177
- });
178
- this.base64Image = arrayBufferToImageBase64(new Uint8Array(buffer));
179
- }
180
- return Promise.resolve(this);
181
- }
182
- abstract override getObject(): Promise<string>;
183
- }
184
- export abstract class ImagesMeta extends Meta {
185
- images?: Images;
186
- base64Images: string[] = [];
187
- override serialize(): ArrayBuffer {
188
- if (!this.images) throw new Error('not found');
189
- return toBinary(ImagesSchema, this.images).buffer;
190
- }
191
- override deserialize(buffer: ArrayBuffer): string[] {
192
- this.images = fromBinary(ImagesSchema, new Uint8Array(buffer));
193
- this.base64Images = this.images.images.map((item) => arrayBufferToImageBase64(item.bytes));
194
- return this.base64Images;
195
- }
196
- override inject(buffers?: ArrayBuffer[]): Promise<this> {
197
- if (buffers) {
198
- this.images = create(ImagesSchema, {
199
- images: buffers.map((buffer) => {
200
- return create(ImageSchema, {
201
- bytes: new Uint8Array(buffer),
202
- });
203
- }),
204
- });
205
- this.base64Images = buffers.map((buffer) => {
206
- return arrayBufferToImageBase64(new Uint8Array(buffer));
207
- });
208
- }
209
- return Promise.resolve(this);
210
- }
211
- abstract override getObject(): Promise<string[]>;
212
- }
213
- export abstract class TextMeta extends Meta {
214
- text: string = '';
215
- constructor() {
216
- super();
217
- }
218
- override serialize(): ArrayBuffer {
219
- return new TextEncoder().encode(this.text).buffer;
220
- }
221
- override deserialize(buffer: ArrayBuffer): string {
222
- this.text = new TextDecoder().decode(buffer);
223
- return this.text;
224
- }
225
- override inject(text?: string): Promise<this> {
226
- if (text) {
227
- this.text = text;
228
- }
229
- return Promise.resolve(this);
230
- }
231
- abstract override getObject(): Promise<string>;
232
- }
233
- export abstract class WavesMeta extends Meta {
234
- waves: WaveMap | undefined;
235
- override serialize(): ArrayBuffer {
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');
241
- }
242
- if (!this.waves) throw new Error('not found');
243
- return toBinary(WaveMapSchema, this.waves).buffer;
244
- }
245
- override deserialize(buffer: ArrayBuffer): WaveMap {
246
- this.waves = fromBinary(WaveMapSchema, new Uint8Array(buffer));
247
- return this.waves;
248
- }
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);
256
- }
257
- console.log(origins, smooths);
258
- if (origins && smooths) {
259
- console.log(this.waves);
260
- this.waves = create(WaveMapSchema, {
261
- origin: Object.fromEntries(
262
- Object.entries(origins).map(([key, value]) => [
263
- key,
264
- create(WaveSchema, {
265
- values: value,
266
- }),
267
- ]),
268
- ),
269
- smooth: Object.fromEntries(
270
- Object.entries(smooths).map(([key, value]) => [
271
- key,
272
- create(WaveSchema, {
273
- values: value,
274
- }),
275
- ]),
276
- ),
277
- });
278
- console.log(this.waves);
279
- }
280
- return Promise.resolve(this);
281
- }
282
- abstract override getObject(): Promise<WaveMap>;
283
- }
284
- export abstract class TongueMeta extends ImageMeta {
285
- static override builder(): IBuilder<TongueMeta> {
286
- return Builder(this._default) as unknown as IBuilder<TongueMeta>;
287
- }
288
- static override default(): typeof TongueMeta {
289
- return this._default as unknown as typeof TongueMeta;
290
- }
291
- constructor() {
292
- super();
293
- this.type = MetaType.Tongue;
294
- }
295
- }
296
- export abstract class FaceMeta extends ImageMeta {
297
- static override builder(): IBuilder<FaceMeta> {
298
- return Builder(this._default) as unknown as IBuilder<FaceMeta>;
299
- }
300
- static override default(): typeof FaceMeta {
301
- return this._default as unknown as typeof FaceMeta;
302
- }
303
- constructor() {
304
- super();
305
- this.type = MetaType.Face;
306
- }
307
- }
308
- export abstract class SceneMeta extends ImageMeta {
309
- static override builder(): IBuilder<SceneMeta> {
310
- return Builder(this._default) as unknown as IBuilder<SceneMeta>;
311
- }
312
- static override default(): typeof SceneMeta {
313
- return this._default as unknown as typeof SceneMeta;
314
- }
315
- constructor() {
316
- super();
317
- this.type = MetaType.Scene;
318
- }
319
- }
320
- export abstract class PulsationMeta extends WavesMeta {
321
- static override builder(): IBuilder<PulsationMeta> {
322
- return Builder(this._default) as unknown as IBuilder<PulsationMeta>;
323
- }
324
- static override default(): typeof PulsationMeta {
325
- return this._default as unknown as typeof PulsationMeta;
326
- }
327
- constructor() {
328
- super();
329
- this.type = MetaType.Pulsation;
330
- }
331
- }
332
- export abstract class PPGMeta extends WavesMeta {
333
- static override builder(): IBuilder<PPGMeta> {
334
- return Builder(this._default) as unknown as IBuilder<PPGMeta>;
335
- }
336
- static override default(): typeof PPGMeta {
337
- return this._default as unknown as typeof PPGMeta;
338
- }
339
- constructor() {
340
- super();
341
- this.type = MetaType.PPG;
342
- }
343
- }
344
- export abstract class PCGMeta extends WavesMeta {
345
- static override builder(): IBuilder<PCGMeta> {
346
- return Builder(this._default) as unknown as IBuilder<PCGMeta>;
347
- }
348
- static override default(): typeof PCGMeta {
349
- return this._default as unknown as typeof PCGMeta;
350
- }
351
- constructor() {
352
- super();
353
- this.type = MetaType.PCG;
354
- }
355
- }
356
- export abstract class ECGMeta extends WavesMeta {
357
- static override builder(): IBuilder<ECGMeta> {
358
- return Builder(this._default) as unknown as IBuilder<ECGMeta>;
359
- }
360
- static override default(): typeof ECGMeta {
361
- return this._default as unknown as typeof ECGMeta;
362
- }
363
- constructor() {
364
- super();
365
- this.type = MetaType.ECG;
366
- }
367
- }
368
- export abstract class AppendixMeta extends ImagesMeta {
369
- static override builder(): IBuilder<AppendixMeta> {
370
- return Builder(this._default) as unknown as IBuilder<AppendixMeta>;
371
- }
372
- static override default(): typeof AppendixMeta {
373
- return this._default as unknown as typeof AppendixMeta;
374
- }
375
- constructor() {
376
- super();
377
- this.type = MetaType.Appendix;
378
- }
379
- }
380
- export abstract class ComplaintMeta extends TextMeta {
381
- static override builder(): IBuilder<ComplaintMeta> {
382
- return Builder(this._default) as unknown as IBuilder<ComplaintMeta>;
383
- }
384
- static override default(): typeof ComplaintMeta {
385
- return this._default as unknown as typeof ComplaintMeta;
386
- }
387
- constructor() {
388
- super();
389
- this.type = MetaType.Complaint;
390
- }
391
- }
392
-
393
- export class MetaSequence<T extends Meta> extends Sequence<T> {
394
- type: MetaType;
395
- owner?: Patient;
396
- expand: boolean = false;
397
- constructor(type: MetaType, owner?: Patient) {
398
- super();
399
- this.type = type;
400
- if (owner) this.owner = owner;
401
- }
402
- init(owner: Patient) {
403
- this.clear();
404
- this.owner = Patient.builder().id(owner.id).build();
405
- }
406
- async query(
407
- page: number,
408
- pageSize: number,
409
- startTime?: string,
410
- endTime?: string,
411
- sort?: string,
412
- ): Promise<Page<Meta>> {
413
- this.clear();
414
- return this.append(page, pageSize, startTime, endTime, sort);
415
- }
416
- async append(
417
- page: number,
418
- pageSize: number,
419
- startTime?: string,
420
- endTime?: string,
421
- sort?: string,
422
- ): Promise<Page<Meta>> {
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;
466
- }
467
- }
468
- export const MetaTypeConfig = {
469
- [MetaType.Face]: { type: FaceMeta, name: '面象', icon: 'face', color: '#FF6B6B' },
470
- [MetaType.Tongue]: { type: TongueMeta, name: '舌象', icon: 'face', color: '#4ECDC4' },
471
- [MetaType.Complaint]: { type: ComplaintMeta, name: '主诉', icon: 'message', color: '#FFD166' },
472
- [MetaType.Pulsation]: { type: PulsationMeta, name: '脉象', icon: 'ssid_chart', color: '#06D6A0' },
473
- [MetaType.ECG]: { type: ECGMeta, name: '心电', icon: 'ssid_chart', color: '#118AB2' },
474
- [MetaType.PCG]: { type: PCGMeta, name: '心音', icon: 'ssid_chart', color: '#073B4C' },
475
- [MetaType.PPG]: { type: PPGMeta, name: '心光', icon: 'ssid_chart', color: '#7209B7' },
476
- [MetaType.Scene]: { type: SceneMeta, name: '场景', icon: 'house', color: '#F72585' },
477
- [MetaType.Appendix]: { type: AppendixMeta, name: '附件', icon: 'folder_open', color: '#3A86FF' },
478
- [MetaType.Meta]: { type: Meta, name: '元', icon: 'tag', color: '#8338EC' },
479
- };
480
- export abstract class Metas {
481
- static _default: typeof Metas;
482
- static builder(): IBuilder<Metas> {
483
- return Builder(this._default) as unknown as IBuilder<Metas>;
484
- }
485
- static default(): typeof Metas {
486
- return this._default as unknown as typeof Metas;
487
- }
488
-
489
- [MetaType.Face] = new MetaSequence<FaceMeta>(MetaType.Face);
490
- [MetaType.Tongue] = new MetaSequence<TongueMeta>(MetaType.Tongue);
491
- [MetaType.Complaint] = new MetaSequence<ComplaintMeta>(MetaType.Complaint);
492
- [MetaType.Pulsation] = new MetaSequence<PulsationMeta>(MetaType.Pulsation);
493
- [MetaType.ECG] = new MetaSequence<ECGMeta>(MetaType.ECG);
494
- [MetaType.PCG] = new MetaSequence<PCGMeta>(MetaType.PCG);
495
- [MetaType.PPG] = new MetaSequence<PPGMeta>(MetaType.PPG);
496
- [MetaType.Scene] = new MetaSequence<SceneMeta>(MetaType.Scene);
497
- [MetaType.Appendix] = new MetaSequence<AppendixMeta>(MetaType.Appendix);
498
- [MetaType.Meta] = new MetaSequence<Meta>(MetaType.Meta);
499
- faces = this[MetaType.Face];
500
- tongues = this[MetaType.Tongue];
501
- complaints = this[MetaType.Complaint];
502
- pulsations = this[MetaType.Pulsation];
503
- ecgs = this[MetaType.ECG];
504
- pcgs = this[MetaType.PCG];
505
- ppgs = this[MetaType.PPG];
506
- scenes = this[MetaType.Scene];
507
- appendixes = this[MetaType.Appendix];
508
- metas = this[MetaType.Meta];
509
- constructor(metas?: Meta[]) {
510
- if (metas) this.addMetas(metas);
511
- }
512
- init(owner: Patient): this {
513
- for (const type of Object.values(MetaType)) {
514
- this[type].init(owner);
515
- }
516
- return this;
517
- }
518
- async query(
519
- page: number,
520
- pageSize: number,
521
- startTime?: string,
522
- endTime?: string,
523
- sort?: string,
524
- ): Promise<this> {
525
- for (const type of Object.values(MetaType)) {
526
- //print
527
- const metas = await this[type].query(page, pageSize, startTime, endTime, sort);
528
- for (const meta of metas.data) {
529
- (this[type].data as Meta[]).push(meta);
530
- }
531
- }
532
- return this;
533
- }
534
- addMetas(metas: Meta[]) {
535
- for (const meta of metas) {
536
- this.addMeta(meta);
537
- }
538
- return this;
539
- }
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;
545
- }
546
- clear() {
547
- for (const type of Object.values(MetaType)) {
548
- this[type].clear();
549
- }
550
- }
551
- static map(meta: MetaState): Promise<Meta> {
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
- ];
569
- }
570
- }