@icure/api 8.0.8 → 8.0.10

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 (270) hide show
  1. package/icc-api/model/models.d.ts +1 -0
  2. package/icc-api/model/models.js +1 -0
  3. package/icc-api/model/models.js.map +1 -1
  4. package/icc-x-api/crypto/BaseExchangeDataManager.js +1 -1
  5. package/icc-x-api/crypto/BaseExchangeDataManager.js.map +1 -1
  6. package/icc-x-api/crypto/BaseExchangeKeysManager.js +7 -3
  7. package/icc-x-api/crypto/BaseExchangeKeysManager.js.map +1 -1
  8. package/icc-x-api/crypto/ExchangeDataManager.js +3 -2
  9. package/icc-x-api/crypto/ExchangeDataManager.js.map +1 -1
  10. package/icc-x-api/crypto/KeyRecovery.js +6 -5
  11. package/icc-x-api/crypto/KeyRecovery.js.map +1 -1
  12. package/icc-x-api/crypto/RSA.d.ts +4 -1
  13. package/icc-x-api/crypto/RSA.js +6 -1
  14. package/icc-x-api/crypto/RSA.js.map +1 -1
  15. package/icc-x-api/crypto/SecureDelegationsManager.js +2 -1
  16. package/icc-x-api/crypto/SecureDelegationsManager.js.map +1 -1
  17. package/icc-x-api/crypto/ShamirKeysManager.js +8 -9
  18. package/icc-x-api/crypto/ShamirKeysManager.js.map +1 -1
  19. package/icc-x-api/crypto/TransferKeysManager.js +4 -3
  20. package/icc-x-api/crypto/TransferKeysManager.js.map +1 -1
  21. package/icc-x-api/crypto/UserEncryptionKeysManager.js +4 -4
  22. package/icc-x-api/crypto/UserEncryptionKeysManager.js.map +1 -1
  23. package/icc-x-api/crypto/UserSignatureKeysManager.js +9 -5
  24. package/icc-x-api/crypto/UserSignatureKeysManager.js.map +1 -1
  25. package/icc-x-api/crypto/utils.d.ts +13 -4
  26. package/icc-x-api/crypto/utils.js +27 -9
  27. package/icc-x-api/crypto/utils.js.map +1 -1
  28. package/icc-x-api/icc-accesslog-x-api.js +16 -14
  29. package/icc-x-api/icc-accesslog-x-api.js.map +1 -1
  30. package/icc-x-api/icc-calendar-item-x-api.d.ts +2 -2
  31. package/icc-x-api/icc-calendar-item-x-api.js +17 -17
  32. package/icc-x-api/icc-calendar-item-x-api.js.map +1 -1
  33. package/icc-x-api/icc-classification-x-api.js +12 -11
  34. package/icc-x-api/icc-classification-x-api.js.map +1 -1
  35. package/icc-x-api/icc-contact-x-api.d.ts +2 -2
  36. package/icc-x-api/icc-contact-x-api.js +23 -20
  37. package/icc-x-api/icc-contact-x-api.js.map +1 -1
  38. package/icc-x-api/icc-data-owner-x-api.js +1 -1
  39. package/icc-x-api/icc-data-owner-x-api.js.map +1 -1
  40. package/icc-x-api/icc-document-x-api.js +17 -16
  41. package/icc-x-api/icc-document-x-api.js.map +1 -1
  42. package/icc-x-api/icc-form-x-api.js +13 -12
  43. package/icc-x-api/icc-form-x-api.js.map +1 -1
  44. package/icc-x-api/icc-helement-x-api.js +18 -16
  45. package/icc-x-api/icc-helement-x-api.js.map +1 -1
  46. package/icc-x-api/icc-icure-maintenance-x-api.js +4 -3
  47. package/icc-x-api/icc-icure-maintenance-x-api.js.map +1 -1
  48. package/icc-x-api/icc-invoice-x-api.js +12 -11
  49. package/icc-x-api/icc-invoice-x-api.js.map +1 -1
  50. package/icc-x-api/icc-maintenance-task-x-api.js +11 -11
  51. package/icc-x-api/icc-maintenance-task-x-api.js.map +1 -1
  52. package/icc-x-api/icc-message-x-api.js +14 -14
  53. package/icc-x-api/icc-message-x-api.js.map +1 -1
  54. package/icc-x-api/icc-patient-x-api.js +28 -27
  55. package/icc-x-api/icc-patient-x-api.js.map +1 -1
  56. package/icc-x-api/icc-receipt-x-api.js +11 -10
  57. package/icc-x-api/icc-receipt-x-api.js.map +1 -1
  58. package/icc-x-api/icc-recovery-x-api.js +3 -2
  59. package/icc-x-api/icc-recovery-x-api.js.map +1 -1
  60. package/icc-x-api/icc-time-table-x-api.js +9 -8
  61. package/icc-x-api/icc-time-table-x-api.js.map +1 -1
  62. package/icc-x-api/icc-topic-x-api.js +13 -13
  63. package/icc-x-api/icc-topic-x-api.js.map +1 -1
  64. package/icc-x-api/storage/IcureStorageFacade.js +4 -1
  65. package/icc-x-api/storage/IcureStorageFacade.js.map +1 -1
  66. package/icc-x-api/utils/EntityWithDelegationTypeName.d.ts +17 -1
  67. package/icc-x-api/utils/EntityWithDelegationTypeName.js +33 -15
  68. package/icc-x-api/utils/EntityWithDelegationTypeName.js.map +1 -1
  69. package/package.json +1 -1
  70. package/test/icc-api/api/IccAnonymousAccessApi.d.ts +1 -0
  71. package/test/icc-api/api/IccAnonymousAccessApi.js +58 -0
  72. package/test/icc-api/api/IccAnonymousAccessApi.js.map +1 -0
  73. package/test/icc-api/api/IccDocumentApi.d.ts +1 -0
  74. package/test/icc-api/api/IccDocumentApi.js +208 -0
  75. package/test/icc-api/api/IccDocumentApi.js.map +1 -0
  76. package/test/icc-api/api/IccGroupApi.d.ts +1 -0
  77. package/test/icc-api/api/IccGroupApi.js +50 -0
  78. package/test/icc-api/api/IccGroupApi.js.map +1 -0
  79. package/test/icc-api/api/IccRecoveryDataApi.d.ts +1 -0
  80. package/test/icc-api/api/IccRecoveryDataApi.js +95 -0
  81. package/test/icc-api/api/IccRecoveryDataApi.js.map +1 -0
  82. package/test/icc-api/api/IccRoleApi.d.ts +1 -0
  83. package/test/icc-api/api/IccRoleApi.js +34 -0
  84. package/test/icc-api/api/IccRoleApi.js.map +1 -0
  85. package/test/icc-api/api/IccUserApi.d.ts +1 -0
  86. package/test/icc-api/api/IccUserApi.js +96 -0
  87. package/test/icc-api/api/IccUserApi.js.map +1 -0
  88. package/test/icc-api/e2e/IccCalendarItemApi.d.ts +1 -0
  89. package/test/icc-api/e2e/IccCalendarItemApi.js +46 -0
  90. package/test/icc-api/e2e/IccCalendarItemApi.js.map +1 -0
  91. package/test/icc-api/model/modelHelpersTest.d.ts +1 -0
  92. package/test/icc-api/model/modelHelpersTest.js +45 -0
  93. package/test/icc-api/model/modelHelpersTest.js.map +1 -0
  94. package/test/icc-x-api/auth/group-switch-test.d.ts +1 -0
  95. package/test/icc-x-api/auth/group-switch-test.js +81 -0
  96. package/test/icc-x-api/auth/group-switch-test.js.map +1 -0
  97. package/test/icc-x-api/auth/jwt-concurrency-test.d.ts +2 -0
  98. package/test/icc-x-api/auth/jwt-concurrency-test.js +113 -0
  99. package/test/icc-x-api/auth/jwt-concurrency-test.js.map +1 -0
  100. package/test/icc-x-api/auth/smart-auth-provider-test.d.ts +1 -0
  101. package/test/icc-x-api/auth/smart-auth-provider-test.js +224 -0
  102. package/test/icc-x-api/auth/smart-auth-provider-test.js.map +1 -0
  103. package/test/icc-x-api/autofix-anonymity-test.d.ts +1 -0
  104. package/test/icc-x-api/autofix-anonymity-test.js +108 -0
  105. package/test/icc-x-api/autofix-anonymity-test.js.map +1 -0
  106. package/test/icc-x-api/confidential-entities-test.d.ts +1 -0
  107. package/test/icc-x-api/confidential-entities-test.js +110 -0
  108. package/test/icc-x-api/confidential-entities-test.js.map +1 -0
  109. package/test/icc-x-api/crud/comprehensive-crud-test.d.ts +1 -0
  110. package/test/icc-x-api/crud/comprehensive-crud-test.js +276 -0
  111. package/test/icc-x-api/crud/comprehensive-crud-test.js.map +1 -0
  112. package/test/icc-x-api/crud/entities-crud-test-interface.d.ts +16 -0
  113. package/test/icc-x-api/crud/entities-crud-test-interface.js +422 -0
  114. package/test/icc-x-api/crud/entities-crud-test-interface.js.map +1 -0
  115. package/test/icc-x-api/crypto/anonymous-delegations-test.d.ts +1 -0
  116. package/test/icc-x-api/crypto/anonymous-delegations-test.js +588 -0
  117. package/test/icc-x-api/crypto/anonymous-delegations-test.js.map +1 -0
  118. package/test/icc-x-api/crypto/concurrency.d.ts +1 -0
  119. package/test/icc-x-api/crypto/concurrency.js +35 -0
  120. package/test/icc-x-api/crypto/concurrency.js.map +1 -0
  121. package/test/icc-x-api/crypto/crypto-utils.d.ts +1 -0
  122. package/test/icc-x-api/crypto/crypto-utils.js +80 -0
  123. package/test/icc-x-api/crypto/crypto-utils.js.map +1 -0
  124. package/test/icc-x-api/crypto/cryptoTest.d.ts +2 -0
  125. package/test/icc-x-api/crypto/cryptoTest.js +302 -0
  126. package/test/icc-x-api/crypto/cryptoTest.js.map +1 -0
  127. package/test/icc-x-api/crypto/delegate-ci-to-patient-with-missing-keys-test.d.ts +1 -0
  128. package/test/icc-x-api/crypto/delegate-ci-to-patient-with-missing-keys-test.js +166 -0
  129. package/test/icc-x-api/crypto/delegate-ci-to-patient-with-missing-keys-test.js.map +1 -0
  130. package/test/icc-x-api/crypto/exchange-data-manager-test.d.ts +1 -0
  131. package/test/icc-x-api/crypto/exchange-data-manager-test.js +690 -0
  132. package/test/icc-x-api/crypto/exchange-data-manager-test.js.map +1 -0
  133. package/test/icc-x-api/crypto/full-crypto-test.d.ts +1 -0
  134. package/test/icc-x-api/crypto/full-crypto-test.js +457 -0
  135. package/test/icc-x-api/crypto/full-crypto-test.js.map +1 -0
  136. package/test/icc-x-api/crypto/secure-delegations-manager-test.d.ts +1 -0
  137. package/test/icc-x-api/crypto/secure-delegations-manager-test.js +266 -0
  138. package/test/icc-x-api/crypto/secure-delegations-manager-test.js.map +1 -0
  139. package/test/icc-x-api/crypto/secure-delegations-metadata-decryptor-test.d.ts +1 -0
  140. package/test/icc-x-api/crypto/secure-delegations-metadata-decryptor-test.js +393 -0
  141. package/test/icc-x-api/crypto/secure-delegations-metadata-decryptor-test.js.map +1 -0
  142. package/test/icc-x-api/crypto/security-metadata-decryptor-chain-test.d.ts +1 -0
  143. package/test/icc-x-api/crypto/security-metadata-decryptor-chain-test.js +213 -0
  144. package/test/icc-x-api/crypto/security-metadata-decryptor-chain-test.js.map +1 -0
  145. package/test/icc-x-api/crypto/shamir.d.ts +2 -0
  146. package/test/icc-x-api/crypto/shamir.js +166 -0
  147. package/test/icc-x-api/crypto/shamir.js.map +1 -0
  148. package/test/icc-x-api/crypto/share-to-newly-created-patient-from-hcp.d.ts +1 -0
  149. package/test/icc-x-api/crypto/share-to-newly-created-patient-from-hcp.js +71 -0
  150. package/test/icc-x-api/crypto/share-to-newly-created-patient-from-hcp.js.map +1 -0
  151. package/test/icc-x-api/crypto/signature-keys-manager-test.d.ts +1 -0
  152. package/test/icc-x-api/crypto/signature-keys-manager-test.js +44 -0
  153. package/test/icc-x-api/crypto/signature-keys-manager-test.js.map +1 -0
  154. package/test/icc-x-api/crypto/user-encryption-keys-manager-test.d.ts +1 -0
  155. package/test/icc-x-api/crypto/user-encryption-keys-manager-test.js +246 -0
  156. package/test/icc-x-api/crypto/user-encryption-keys-manager-test.js.map +1 -0
  157. package/test/icc-x-api/entity-with-attachments-api-test.d.ts +1 -0
  158. package/test/icc-x-api/entity-with-attachments-api-test.js +142 -0
  159. package/test/icc-x-api/entity-with-attachments-api-test.js.map +1 -0
  160. package/test/icc-x-api/filters/filters.d.ts +1 -0
  161. package/test/icc-x-api/filters/filters.js +49 -0
  162. package/test/icc-x-api/filters/filters.js.map +1 -0
  163. package/test/icc-x-api/icc-accesslog-x-api.d.ts +1 -0
  164. package/test/icc-x-api/icc-accesslog-x-api.js +106 -0
  165. package/test/icc-x-api/icc-accesslog-x-api.js.map +1 -0
  166. package/test/icc-x-api/icc-auth-api.d.ts +1 -0
  167. package/test/icc-x-api/icc-auth-api.js +47 -0
  168. package/test/icc-x-api/icc-auth-api.js.map +1 -0
  169. package/test/icc-x-api/icc-calendar-item-x-api.d.ts +1 -0
  170. package/test/icc-x-api/icc-calendar-item-x-api.js +150 -0
  171. package/test/icc-x-api/icc-calendar-item-x-api.js.map +1 -0
  172. package/test/icc-x-api/icc-contact-x-api.d.ts +1 -0
  173. package/test/icc-x-api/icc-contact-x-api.js +279 -0
  174. package/test/icc-x-api/icc-contact-x-api.js.map +1 -0
  175. package/test/icc-x-api/icc-form-x-api.d.ts +1 -0
  176. package/test/icc-x-api/icc-form-x-api.js +98 -0
  177. package/test/icc-x-api/icc-form-x-api.js.map +1 -0
  178. package/test/icc-x-api/icc-helement-x-api-test.d.ts +1 -0
  179. package/test/icc-x-api/icc-helement-x-api-test.js +153 -0
  180. package/test/icc-x-api/icc-helement-x-api-test.js.map +1 -0
  181. package/test/icc-x-api/icc-invoice-x-api.d.ts +1 -0
  182. package/test/icc-x-api/icc-invoice-x-api.js +99 -0
  183. package/test/icc-x-api/icc-invoice-x-api.js.map +1 -0
  184. package/test/icc-x-api/icc-maintenance-task-x-api-test.d.ts +1 -0
  185. package/test/icc-x-api/icc-maintenance-task-x-api-test.js +221 -0
  186. package/test/icc-x-api/icc-maintenance-task-x-api-test.js.map +1 -0
  187. package/test/icc-x-api/icc-message-x-api.d.ts +1 -0
  188. package/test/icc-x-api/icc-message-x-api.js +328 -0
  189. package/test/icc-x-api/icc-message-x-api.js.map +1 -0
  190. package/test/icc-x-api/icc-patient-x-api-test.d.ts +1 -0
  191. package/test/icc-x-api/icc-patient-x-api-test.js +158 -0
  192. package/test/icc-x-api/icc-patient-x-api-test.js.map +1 -0
  193. package/test/icc-x-api/icc-recovery-x-api.d.ts +1 -0
  194. package/test/icc-x-api/icc-recovery-x-api.js +170 -0
  195. package/test/icc-x-api/icc-recovery-x-api.js.map +1 -0
  196. package/test/icc-x-api/icc-time-table-x-api.d.ts +1 -0
  197. package/test/icc-x-api/icc-time-table-x-api.js +100 -0
  198. package/test/icc-x-api/icc-time-table-x-api.js.map +1 -0
  199. package/test/icc-x-api/icc-topic-x-api.d.ts +1 -0
  200. package/test/icc-x-api/icc-topic-x-api.js +269 -0
  201. package/test/icc-x-api/icc-topic-x-api.js.map +1 -0
  202. package/test/icc-x-api/icc-user-x-api-test.d.ts +1 -0
  203. package/test/icc-x-api/icc-user-x-api-test.js +99 -0
  204. package/test/icc-x-api/icc-user-x-api-test.js.map +1 -0
  205. package/test/icc-x-api/patient-user.d.ts +2 -0
  206. package/test/icc-x-api/patient-user.js +104 -0
  207. package/test/icc-x-api/patient-user.js.map +1 -0
  208. package/test/icc-x-api/storage/storage.d.ts +1 -0
  209. package/test/icc-x-api/storage/storage.js +48 -0
  210. package/test/icc-x-api/storage/storage.js.map +1 -0
  211. package/test/icc-x-api/test-api-no-parent.d.ts +1 -0
  212. package/test/icc-x-api/test-api-no-parent.js +79 -0
  213. package/test/icc-x-api/test-api-no-parent.js.map +1 -0
  214. package/test/icc-x-api/test-legacy-data-support.d.ts +1 -0
  215. package/test/icc-x-api/test-legacy-data-support.js +376 -0
  216. package/test/icc-x-api/test-legacy-data-support.js.map +1 -0
  217. package/test/icc-x-api/utils/graph-test.d.ts +1 -0
  218. package/test/icc-x-api/utils/graph-test.js +54 -0
  219. package/test/icc-x-api/utils/graph-test.js.map +1 -0
  220. package/test/icc-x-api/utils/lru-temporised-async-cache-test.d.ts +1 -0
  221. package/test/icc-x-api/utils/lru-temporised-async-cache-test.js +364 -0
  222. package/test/icc-x-api/utils/lru-temporised-async-cache-test.js.map +1 -0
  223. package/test/support/CSM-185.d.ts +1 -0
  224. package/test/support/CSM-185.js +124 -0
  225. package/test/support/CSM-185.js.map +1 -0
  226. package/test/support/CSM-243.d.ts +1 -0
  227. package/test/support/CSM-243.js +120 -0
  228. package/test/support/CSM-243.js.map +1 -0
  229. package/test/support/CSM-87.d.ts +0 -0
  230. package/test/support/CSM-87.js +21 -0
  231. package/test/support/CSM-87.js.map +1 -0
  232. package/test/support/CSM-93.d.ts +1 -0
  233. package/test/support/CSM-93.js +112 -0
  234. package/test/support/CSM-93.js.map +1 -0
  235. package/test/utils/FakeDataOwnerApi.d.ts +32 -0
  236. package/test/utils/FakeDataOwnerApi.js +136 -0
  237. package/test/utils/FakeDataOwnerApi.js.map +1 -0
  238. package/test/utils/FakeEncryptionKeysManager.d.ts +35 -0
  239. package/test/utils/FakeEncryptionKeysManager.js +87 -0
  240. package/test/utils/FakeEncryptionKeysManager.js.map +1 -0
  241. package/test/utils/FakeExchangeDataApi.d.ts +30 -0
  242. package/test/utils/FakeExchangeDataApi.js +74 -0
  243. package/test/utils/FakeExchangeDataApi.js.map +1 -0
  244. package/test/utils/FakeExchangeDataManager.d.ts +40 -0
  245. package/test/utils/FakeExchangeDataManager.js +89 -0
  246. package/test/utils/FakeExchangeDataManager.js.map +1 -0
  247. package/test/utils/FakeExchangeDataMapManager.d.ts +12 -0
  248. package/test/utils/FakeExchangeDataMapManager.js +38 -0
  249. package/test/utils/FakeExchangeDataMapManager.js.map +1 -0
  250. package/test/utils/FakeGenericApi.d.ts +16 -0
  251. package/test/utils/FakeGenericApi.js +65 -0
  252. package/test/utils/FakeGenericApi.js.map +1 -0
  253. package/test/utils/FakeSignatureKeysManager.d.ts +16 -0
  254. package/test/utils/FakeSignatureKeysManager.js +54 -0
  255. package/test/utils/FakeSignatureKeysManager.js.map +1 -0
  256. package/test/utils/TestApi.d.ts +3 -0
  257. package/test/utils/TestApi.js +30 -0
  258. package/test/utils/TestApi.js.map +1 -0
  259. package/test/utils/TestCollectionUtils.d.ts +1 -0
  260. package/test/utils/TestCollectionUtils.js +109 -0
  261. package/test/utils/TestCollectionUtils.js.map +1 -0
  262. package/test/utils/TestCryptoStrategies.d.ts +42 -0
  263. package/test/utils/TestCryptoStrategies.js +80 -0
  264. package/test/utils/TestCryptoStrategies.js.map +1 -0
  265. package/test/utils/TestStorage.d.ts +23 -0
  266. package/test/utils/TestStorage.js +61 -0
  267. package/test/utils/TestStorage.js.map +1 -0
  268. package/test/utils/test_utils.d.ts +76 -0
  269. package/test/utils/test_utils.js +419 -0
  270. package/test/utils/test_utils.js.map +1 -0
@@ -0,0 +1,422 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.entities = void 0;
13
+ const crypto_1 = require("crypto");
14
+ const ListOfIds_1 = require("../../../icc-api/model/ListOfIds");
15
+ const Agenda_1 = require("../../../icc-api/model/Agenda");
16
+ const Article_1 = require("../../../icc-api/model/Article");
17
+ const CalendarItemType_1 = require("../../../icc-api/model/CalendarItemType");
18
+ const ClassificationTemplate_1 = require("../../../icc-api/model/ClassificationTemplate");
19
+ const Device_1 = require("../../../icc-api/model/Device");
20
+ const HealthcareParty_1 = require("../../../icc-api/model/HealthcareParty");
21
+ const Insurance_1 = require("../../../icc-api/model/Insurance");
22
+ const Invoice_1 = require("../../../icc-api/model/Invoice");
23
+ const Keyword_1 = require("../../../icc-api/model/Keyword");
24
+ const MedicalLocation_1 = require("../../../icc-api/model/MedicalLocation");
25
+ const Place_1 = require("../../../icc-api/model/Place");
26
+ exports.entities = {
27
+ AccessLog: {
28
+ encryptable: true,
29
+ create: (api, patient) => __awaiter(void 0, void 0, void 0, function* () {
30
+ const currentUser = yield api.userApi.getCurrentUser();
31
+ const accessLog = yield api.accessLogApi.newInstance(currentUser, patient, { detail: (0, crypto_1.randomUUID)() });
32
+ return api.accessLogApi.createAccessLogWithUser(currentUser, accessLog);
33
+ }),
34
+ share: (delegatorApi, delegateApi, entity) => __awaiter(void 0, void 0, void 0, function* () {
35
+ var _a, _b;
36
+ const delegateUser = yield delegateApi.userApi.getCurrentUser();
37
+ const delegateId = (_b = (_a = delegateUser.healthcarePartyId) !== null && _a !== void 0 ? _a : delegateUser.patientId) !== null && _b !== void 0 ? _b : delegateUser.deviceId;
38
+ if (!delegateId) {
39
+ throw new Error('Cannot share with non data owner user');
40
+ }
41
+ return delegatorApi.accessLogApi.shareWith(delegateId, entity);
42
+ }),
43
+ deleteMany: (api, ids) => __awaiter(void 0, void 0, void 0, function* () { return api.accessLogApi.deleteAccessLogs(new ListOfIds_1.ListOfIds({ ids: ids.map((it) => it.id) })); }),
44
+ delete: (api, id) => __awaiter(void 0, void 0, void 0, function* () { return api.accessLogApi.deleteAccessLog(id.id); }),
45
+ },
46
+ Agenda: {
47
+ skipDenied: true,
48
+ encryptable: false,
49
+ create: (api, _) => __awaiter(void 0, void 0, void 0, function* () { return api.agendaApi.createAgenda(new Agenda_1.Agenda({ id: (0, crypto_1.randomUUID)(), name: (0, crypto_1.randomUUID)() })); }),
50
+ share: (_, __, entity) => __awaiter(void 0, void 0, void 0, function* () { return entity; }),
51
+ deleteMany: (api, ids) => __awaiter(void 0, void 0, void 0, function* () { return api.agendaApi.deleteAgendas(new ListOfIds_1.ListOfIds({ ids: ids.map((it) => it.id) })); }),
52
+ delete: (api, id) => __awaiter(void 0, void 0, void 0, function* () { return api.agendaApi.deleteAgenda(id.id); }),
53
+ },
54
+ Article: {
55
+ encryptable: false,
56
+ create: (api, _) => __awaiter(void 0, void 0, void 0, function* () { return api.articleApi.createArticle(new Article_1.Article({ id: (0, crypto_1.randomUUID)(), name: (0, crypto_1.randomUUID)() })); }),
57
+ share: (_, __, entity) => __awaiter(void 0, void 0, void 0, function* () { return entity; }),
58
+ deleteMany: (api, ids) => __awaiter(void 0, void 0, void 0, function* () { return api.articleApi.deleteArticles(new ListOfIds_1.ListOfIds({ ids: ids.map((it) => it.id) })); }),
59
+ delete: (api, id) => __awaiter(void 0, void 0, void 0, function* () { return api.articleApi.deleteArticle(id.id); }),
60
+ },
61
+ CalendarItem: {
62
+ encryptable: true,
63
+ create: (api, _) => __awaiter(void 0, void 0, void 0, function* () {
64
+ const currentUser = yield api.userApi.getCurrentUser();
65
+ const item = yield api.calendarItemApi.newInstance(currentUser, { title: (0, crypto_1.randomUUID)() });
66
+ return api.calendarItemApi.createCalendarItemWithHcParty(currentUser, item);
67
+ }),
68
+ share: (delegatorApi, delegateApi, entity) => __awaiter(void 0, void 0, void 0, function* () {
69
+ var _c, _d;
70
+ const delegateUser = yield delegateApi.userApi.getCurrentUser();
71
+ const delegateId = (_d = (_c = delegateUser.healthcarePartyId) !== null && _c !== void 0 ? _c : delegateUser.patientId) !== null && _d !== void 0 ? _d : delegateUser.deviceId;
72
+ if (!delegateId) {
73
+ throw new Error('Cannot share with non data owner user');
74
+ }
75
+ return delegatorApi.calendarItemApi.shareWith(delegateId, entity);
76
+ }),
77
+ deleteMany: (api, ids) => __awaiter(void 0, void 0, void 0, function* () { return api.calendarItemApi.deleteCalendarItems(new ListOfIds_1.ListOfIds({ ids: ids.map((it) => it.id) })); }),
78
+ delete: (api, id) => __awaiter(void 0, void 0, void 0, function* () { return api.calendarItemApi.deleteCalendarItem(id.id); }),
79
+ },
80
+ CalendarItemType: {
81
+ skipDenied: true,
82
+ encryptable: false,
83
+ create: (api, _) => __awaiter(void 0, void 0, void 0, function* () { return api.calendarItemTypeApi.createCalendarItemType(new CalendarItemType_1.CalendarItemType({ id: (0, crypto_1.randomUUID)(), color: (0, crypto_1.randomUUID)() })); }),
84
+ share: (_, __, entity) => __awaiter(void 0, void 0, void 0, function* () { return entity; }),
85
+ deleteMany: (api, ids) => __awaiter(void 0, void 0, void 0, function* () { return api.calendarItemTypeApi.deleteCalendarItemTypes(new ListOfIds_1.ListOfIds({ ids: ids.map((it) => it.id) })); }),
86
+ delete: (api, id) => __awaiter(void 0, void 0, void 0, function* () {
87
+ return api.calendarItemTypeApi.deleteCalendarItemTypes(new ListOfIds_1.ListOfIds({ ids: [id.id] })).then((r) => {
88
+ if (r.length === 0)
89
+ throw Error('No element deleted');
90
+ else
91
+ return r[0];
92
+ });
93
+ }),
94
+ },
95
+ Classification: {
96
+ encryptable: true,
97
+ create: (api, patient) => __awaiter(void 0, void 0, void 0, function* () {
98
+ const currentUser = yield api.userApi.getCurrentUser();
99
+ const item = yield api.classificationApi.newInstance(currentUser, patient, { label: (0, crypto_1.randomUUID)() });
100
+ return api.classificationApi.createClassification(item);
101
+ }),
102
+ share: (delegatorApi, delegateApi, entity) => __awaiter(void 0, void 0, void 0, function* () {
103
+ var _e, _f;
104
+ const delegateUser = yield delegateApi.userApi.getCurrentUser();
105
+ const delegateId = (_f = (_e = delegateUser.healthcarePartyId) !== null && _e !== void 0 ? _e : delegateUser.patientId) !== null && _f !== void 0 ? _f : delegateUser.deviceId;
106
+ if (!delegateId) {
107
+ throw new Error('Cannot share with non data owner user');
108
+ }
109
+ return delegatorApi.classificationApi.shareWith(delegateId, entity);
110
+ }),
111
+ deleteMany: (api, ids) => __awaiter(void 0, void 0, void 0, function* () { return api.classificationApi.deleteClassifications(new ListOfIds_1.ListOfIds({ ids: ids.map((it) => it.id) })); }),
112
+ delete: (api, id) => __awaiter(void 0, void 0, void 0, function* () { return api.classificationApi.deleteClassification(id.id); }),
113
+ },
114
+ ClassificationTemplate: {
115
+ encryptable: false,
116
+ create: (api, _) => __awaiter(void 0, void 0, void 0, function* () { return api.classificationTemplateApi.createClassificationTemplate(new ClassificationTemplate_1.ClassificationTemplate({ id: (0, crypto_1.randomUUID)(), label: (0, crypto_1.randomUUID)() })); }),
117
+ share: (_, __, entity) => __awaiter(void 0, void 0, void 0, function* () { return entity; }),
118
+ deleteMany: (api, ids) => __awaiter(void 0, void 0, void 0, function* () { return api.classificationTemplateApi.deleteClassificationTemplates(new ListOfIds_1.ListOfIds({ ids: ids.map((it) => it.id) })); }),
119
+ delete: (api, id) => __awaiter(void 0, void 0, void 0, function* () { return api.classificationTemplateApi.deleteClassificationTemplate(id.id); }),
120
+ },
121
+ Contact: {
122
+ encryptable: true,
123
+ create: (api, patient) => __awaiter(void 0, void 0, void 0, function* () {
124
+ const currentUser = yield api.userApi.getCurrentUser();
125
+ const item = yield api.contactApi.newInstance(currentUser, patient, { descr: (0, crypto_1.randomUUID)() });
126
+ return (yield api.contactApi.createContactWithUser(currentUser, item));
127
+ }),
128
+ share: (delegatorApi, delegateApi, entity) => __awaiter(void 0, void 0, void 0, function* () {
129
+ var _g, _h;
130
+ const delegateUser = yield delegateApi.userApi.getCurrentUser();
131
+ const delegateId = (_h = (_g = delegateUser.healthcarePartyId) !== null && _g !== void 0 ? _g : delegateUser.patientId) !== null && _h !== void 0 ? _h : delegateUser.deviceId;
132
+ if (!delegateId) {
133
+ throw new Error('Cannot share with non data owner user');
134
+ }
135
+ return delegatorApi.contactApi.shareWith(delegateId, entity);
136
+ }),
137
+ deleteMany: (api, ids) => __awaiter(void 0, void 0, void 0, function* () { return api.contactApi.deleteContacts(new ListOfIds_1.ListOfIds({ ids: ids.map((it) => it.id) })); }),
138
+ delete: (api, id) => __awaiter(void 0, void 0, void 0, function* () { return api.contactApi.deleteContact(id.id); }),
139
+ },
140
+ Device: {
141
+ encryptable: false,
142
+ create: (api, _) => __awaiter(void 0, void 0, void 0, function* () { return api.deviceApi.createDevice(new Device_1.Device({ id: (0, crypto_1.randomUUID)(), name: (0, crypto_1.randomUUID)() })); }),
143
+ share: (_, __, entity) => __awaiter(void 0, void 0, void 0, function* () { return entity; }),
144
+ deleteMany: (api, ids) => __awaiter(void 0, void 0, void 0, function* () { return api.deviceApi.deleteDevices(new ListOfIds_1.ListOfIds({ ids: ids.map((it) => it.id) })); }),
145
+ delete: (api, id) => __awaiter(void 0, void 0, void 0, function* () { return api.deviceApi.deleteDevice(id.id); }),
146
+ },
147
+ Document: {
148
+ encryptable: true,
149
+ create: (api, patient) => __awaiter(void 0, void 0, void 0, function* () {
150
+ const currentUser = yield api.userApi.getCurrentUser();
151
+ const item = yield api.documentApi.newInstance(currentUser, patient, { name: (0, crypto_1.randomUUID)() });
152
+ return api.documentApi.createDocument(item);
153
+ }),
154
+ share: (delegatorApi, delegateApi, entity) => __awaiter(void 0, void 0, void 0, function* () {
155
+ var _j, _k;
156
+ const delegateUser = yield delegateApi.userApi.getCurrentUser();
157
+ const delegateId = (_k = (_j = delegateUser.healthcarePartyId) !== null && _j !== void 0 ? _j : delegateUser.patientId) !== null && _k !== void 0 ? _k : delegateUser.deviceId;
158
+ if (!delegateId) {
159
+ throw new Error('Cannot share with non data owner user');
160
+ }
161
+ return delegatorApi.documentApi.shareWith(delegateId, entity);
162
+ }),
163
+ deleteMany: (api, ids) => __awaiter(void 0, void 0, void 0, function* () { return api.documentApi.deleteDocuments(new ListOfIds_1.ListOfIds({ ids: ids.map((it) => it.id) })); }),
164
+ delete: (api, id) => __awaiter(void 0, void 0, void 0, function* () { return api.documentApi.deleteDocument(id.id); }),
165
+ },
166
+ Form: {
167
+ encryptable: true,
168
+ create: (api, patient) => __awaiter(void 0, void 0, void 0, function* () {
169
+ const currentUser = yield api.userApi.getCurrentUser();
170
+ const item = yield api.formApi.newInstance(currentUser, patient, { uniqueId: (0, crypto_1.randomUUID)() });
171
+ return api.formApi.createForm(item);
172
+ }),
173
+ share: (delegatorApi, delegateApi, entity) => __awaiter(void 0, void 0, void 0, function* () {
174
+ var _l, _m;
175
+ const delegateUser = yield delegateApi.userApi.getCurrentUser();
176
+ const delegateId = (_m = (_l = delegateUser.healthcarePartyId) !== null && _l !== void 0 ? _l : delegateUser.patientId) !== null && _m !== void 0 ? _m : delegateUser.deviceId;
177
+ if (!delegateId) {
178
+ throw new Error('Cannot share with non data owner user');
179
+ }
180
+ return delegatorApi.formApi.shareWith(delegateId, entity);
181
+ }),
182
+ deleteMany: (api, ids) => __awaiter(void 0, void 0, void 0, function* () { return api.formApi.deleteForms(new ListOfIds_1.ListOfIds({ ids: ids.map((it) => it.id) })); }),
183
+ delete: (api, id) => __awaiter(void 0, void 0, void 0, function* () { return api.formApi.deleteForm(id.id); }),
184
+ },
185
+ HealthcareParty: {
186
+ encryptable: false,
187
+ create: (api, _) => __awaiter(void 0, void 0, void 0, function* () { return api.healthcarePartyApi.createHealthcareParty(new HealthcareParty_1.HealthcareParty({ id: (0, crypto_1.randomUUID)(), name: (0, crypto_1.randomUUID)() })); }),
188
+ share: (_, __, entity) => __awaiter(void 0, void 0, void 0, function* () { return entity; }),
189
+ deleteMany: (api, ids) => __awaiter(void 0, void 0, void 0, function* () { return api.healthcarePartyApi.deleteHealthcareParties(new ListOfIds_1.ListOfIds({ ids: ids.map((it) => it.id) })); }),
190
+ delete: (api, id) => __awaiter(void 0, void 0, void 0, function* () { return api.healthcarePartyApi.deleteHealthcareParty(id.id); }),
191
+ },
192
+ HealthcarePartyInGroup: {
193
+ encryptable: false,
194
+ cloudOnly: true,
195
+ create: (api, _) => __awaiter(void 0, void 0, void 0, function* () { return api.healthcarePartyApi.createHealthcareParty(new HealthcareParty_1.HealthcareParty({ id: (0, crypto_1.randomUUID)(), name: (0, crypto_1.randomUUID)() })); }),
196
+ share: (_, __, entity) => __awaiter(void 0, void 0, void 0, function* () { return entity; }),
197
+ deleteMany: (api, ids) => __awaiter(void 0, void 0, void 0, function* () {
198
+ const currentUser = yield api.userApi.getCurrentUser();
199
+ return api.healthcarePartyApi.deleteHealthcarePartiesInGroup(currentUser.groupId, new ListOfIds_1.ListOfIds({ ids: ids.map((it) => it.id) }));
200
+ }),
201
+ delete: (api, id) => __awaiter(void 0, void 0, void 0, function* () {
202
+ const currentUser = yield api.userApi.getCurrentUser();
203
+ return api.healthcarePartyApi.deleteHealthcarePartyInGroup(currentUser.groupId, id.id);
204
+ }),
205
+ },
206
+ HealthcareElement: {
207
+ encryptable: true,
208
+ create: (api, patient) => __awaiter(void 0, void 0, void 0, function* () {
209
+ const currentUser = yield api.userApi.getCurrentUser();
210
+ const item = yield api.healthcareElementApi.newInstance(currentUser, patient, { descr: (0, crypto_1.randomUUID)() });
211
+ return api.healthcareElementApi.createHealthElementWithUser(currentUser, item);
212
+ }),
213
+ share: (delegatorApi, delegateApi, entity) => __awaiter(void 0, void 0, void 0, function* () {
214
+ var _o, _p;
215
+ const delegateUser = yield delegateApi.userApi.getCurrentUser();
216
+ const delegateId = (_p = (_o = delegateUser.healthcarePartyId) !== null && _o !== void 0 ? _o : delegateUser.patientId) !== null && _p !== void 0 ? _p : delegateUser.deviceId;
217
+ if (!delegateId) {
218
+ throw new Error('Cannot share with non data owner user');
219
+ }
220
+ return delegatorApi.healthcareElementApi.shareWith(delegateId, entity);
221
+ }),
222
+ deleteMany: (api, ids) => __awaiter(void 0, void 0, void 0, function* () { return api.healthcareElementApi.deleteHealthElements(new ListOfIds_1.ListOfIds({ ids: ids.map((it) => it.id) })); }),
223
+ delete: (api, id) => __awaiter(void 0, void 0, void 0, function* () { return api.healthcareElementApi.deleteHealthElement(id.id); }),
224
+ },
225
+ Insurance: {
226
+ encryptable: false,
227
+ skipDenied: true,
228
+ create: (api, _) => __awaiter(void 0, void 0, void 0, function* () { return api.insuranceApi.createInsurance(new Insurance_1.Insurance({ id: (0, crypto_1.randomUUID)(), code: (0, crypto_1.randomUUID)() })); }),
229
+ share: (_, __, entity) => __awaiter(void 0, void 0, void 0, function* () { return entity; }),
230
+ deleteMany: (api, ids) => __awaiter(void 0, void 0, void 0, function* () {
231
+ const ret = [];
232
+ for (const id of ids) {
233
+ const result = yield api.insuranceApi.deleteInsurance(id.id);
234
+ ret.push(result);
235
+ }
236
+ return ret;
237
+ }),
238
+ delete: (api, id) => __awaiter(void 0, void 0, void 0, function* () { return api.insuranceApi.deleteInsurance(id.id); }),
239
+ },
240
+ Invoice: {
241
+ encryptable: false,
242
+ skipDenied: true,
243
+ create: (api, _) => __awaiter(void 0, void 0, void 0, function* () { return api.invoiceApi.createInvoice(new Invoice_1.Invoice({ id: (0, crypto_1.randomUUID)(), recipientId: (0, crypto_1.randomUUID)() })); }),
244
+ share: (_, __, entity) => __awaiter(void 0, void 0, void 0, function* () { return entity; }),
245
+ deleteMany: (api, ids) => __awaiter(void 0, void 0, void 0, function* () {
246
+ const ret = [];
247
+ for (const id of ids) {
248
+ const result = yield api.invoiceApi.deleteInvoice(id.id);
249
+ ret.push(result);
250
+ }
251
+ return ret;
252
+ }),
253
+ delete: (api, id) => __awaiter(void 0, void 0, void 0, function* () { return api.invoiceApi.deleteInvoice(id.id); }),
254
+ },
255
+ Keyword: {
256
+ encryptable: false,
257
+ skipDenied: true,
258
+ create: (api, _) => __awaiter(void 0, void 0, void 0, function* () { return api.keywordApi.createKeyword(new Keyword_1.Keyword({ id: (0, crypto_1.randomUUID)(), value: (0, crypto_1.randomUUID)() })); }),
259
+ share: (_, __, entity) => __awaiter(void 0, void 0, void 0, function* () { return entity; }),
260
+ deleteMany: (api, ids) => __awaiter(void 0, void 0, void 0, function* () { return api.keywordApi.deleteKeywords(new ListOfIds_1.ListOfIds({ ids: ids.map((it) => it.id) })); }),
261
+ delete: (api, id) => __awaiter(void 0, void 0, void 0, function* () {
262
+ return api.keywordApi.deleteKeywords(new ListOfIds_1.ListOfIds({ ids: [id.id] })).then((r) => {
263
+ if (r.length === 0)
264
+ throw new Error('No keyword deleted');
265
+ else
266
+ return r[0];
267
+ });
268
+ }),
269
+ },
270
+ MaintenanceTask: {
271
+ encryptable: true,
272
+ create: (api, _) => __awaiter(void 0, void 0, void 0, function* () {
273
+ const currentUser = yield api.userApi.getCurrentUser();
274
+ const item = yield api.maintenanceTaskApi.newInstance(currentUser, {});
275
+ return (yield api.maintenanceTaskApi.createMaintenanceTaskWithUser(currentUser, item));
276
+ }),
277
+ share: (delegatorApi, delegateApi, entity) => __awaiter(void 0, void 0, void 0, function* () {
278
+ var _q, _r;
279
+ const delegateUser = yield delegateApi.userApi.getCurrentUser();
280
+ const delegateId = (_r = (_q = delegateUser.healthcarePartyId) !== null && _q !== void 0 ? _q : delegateUser.patientId) !== null && _r !== void 0 ? _r : delegateUser.deviceId;
281
+ if (!delegateId) {
282
+ throw new Error('Cannot share with non data owner user');
283
+ }
284
+ return delegatorApi.maintenanceTaskApi.shareWith(delegateId, entity);
285
+ }),
286
+ deleteMany: (api, ids) => __awaiter(void 0, void 0, void 0, function* () {
287
+ const currentUser = yield api.userApi.getCurrentUser();
288
+ return api.maintenanceTaskApi.deleteMaintenanceTasksWithUser(currentUser, new ListOfIds_1.ListOfIds({ ids: ids.map((it) => it.id) }));
289
+ }),
290
+ delete: (api, id) => __awaiter(void 0, void 0, void 0, function* () {
291
+ const currentUser = yield api.userApi.getCurrentUser();
292
+ return api.maintenanceTaskApi.deleteMaintenanceTaskWithUser(currentUser, id.id);
293
+ }),
294
+ },
295
+ MedicalLocation: {
296
+ encryptable: false,
297
+ skipDenied: true,
298
+ create: (api, _) => __awaiter(void 0, void 0, void 0, function* () { return api.medicalLocationApi.createMedicalLocation(new MedicalLocation_1.MedicalLocation({ id: (0, crypto_1.randomUUID)(), nihii: (0, crypto_1.randomUUID)() })); }),
299
+ share: (_, __, entity) => __awaiter(void 0, void 0, void 0, function* () { return entity; }),
300
+ deleteMany: (api, ids) => __awaiter(void 0, void 0, void 0, function* () { return api.medicalLocationApi.deleteMedicalLocations(new ListOfIds_1.ListOfIds({ ids: ids.map((it) => it.id) })); }),
301
+ delete: (api, id) => __awaiter(void 0, void 0, void 0, function* () {
302
+ return api.medicalLocationApi.deleteMedicalLocations(new ListOfIds_1.ListOfIds({ ids: [id.id] })).then((r) => {
303
+ if (r.length === 0)
304
+ throw new Error('No medical location deleted');
305
+ else
306
+ return r[0];
307
+ });
308
+ }),
309
+ },
310
+ Message: {
311
+ encryptable: true,
312
+ create: (api, _) => __awaiter(void 0, void 0, void 0, function* () {
313
+ const currentUser = yield api.userApi.getCurrentUser();
314
+ const item = yield api.messageApi.newInstance(currentUser, {});
315
+ return api.messageApi.createMessage(item);
316
+ }),
317
+ share: (delegatorApi, delegateApi, entity) => __awaiter(void 0, void 0, void 0, function* () {
318
+ var _s, _t;
319
+ const delegateUser = yield delegateApi.userApi.getCurrentUser();
320
+ const delegateId = (_t = (_s = delegateUser.healthcarePartyId) !== null && _s !== void 0 ? _s : delegateUser.patientId) !== null && _t !== void 0 ? _t : delegateUser.deviceId;
321
+ if (!delegateId) {
322
+ throw new Error('Cannot share with non data owner user');
323
+ }
324
+ return delegatorApi.messageApi.shareWith(delegateId, entity, []);
325
+ }),
326
+ deleteMany: (api, ids) => __awaiter(void 0, void 0, void 0, function* () { return api.messageApi.deleteMessages(new ListOfIds_1.ListOfIds({ ids: ids.map((it) => it.id) })); }),
327
+ delete: (api, id) => __awaiter(void 0, void 0, void 0, function* () { return api.messageApi.deleteMessage(id.id); }),
328
+ },
329
+ Patient: {
330
+ encryptable: true,
331
+ create: (api, _) => __awaiter(void 0, void 0, void 0, function* () {
332
+ const currentUser = yield api.userApi.getCurrentUser();
333
+ const item = yield api.patientApi.newInstance(currentUser, {});
334
+ return api.patientApi.createPatientWithUser(currentUser, item);
335
+ }),
336
+ share: (delegatorApi, delegateApi, entity) => __awaiter(void 0, void 0, void 0, function* () {
337
+ var _u, _v;
338
+ const delegateUser = yield delegateApi.userApi.getCurrentUser();
339
+ const delegateId = (_v = (_u = delegateUser.healthcarePartyId) !== null && _u !== void 0 ? _u : delegateUser.patientId) !== null && _v !== void 0 ? _v : delegateUser.deviceId;
340
+ if (!delegateId) {
341
+ throw new Error('Cannot share with non data owner user');
342
+ }
343
+ return delegatorApi.patientApi.shareWith(delegateId, entity, []);
344
+ }),
345
+ deleteMany: (api, ids) => __awaiter(void 0, void 0, void 0, function* () { return api.patientApi.deletePatients(new ListOfIds_1.ListOfIds({ ids: ids.map((it) => it.id) })); }),
346
+ delete: (api, id) => __awaiter(void 0, void 0, void 0, function* () { return api.patientApi.deletePatient(id.id); }),
347
+ },
348
+ Place: {
349
+ encryptable: false,
350
+ skipDenied: true,
351
+ create: (api, _) => __awaiter(void 0, void 0, void 0, function* () { return api.placeApi.createPlace(new Place_1.Place({ id: (0, crypto_1.randomUUID)(), name: (0, crypto_1.randomUUID)() })); }),
352
+ share: (_, __, entity) => __awaiter(void 0, void 0, void 0, function* () { return entity; }),
353
+ deleteMany: (api, ids) => __awaiter(void 0, void 0, void 0, function* () { return api.placeApi.deletePlaces(new ListOfIds_1.ListOfIds({ ids: ids.map((it) => it.id) })); }),
354
+ delete: (api, id) => __awaiter(void 0, void 0, void 0, function* () {
355
+ return api.placeApi.deletePlaces(new ListOfIds_1.ListOfIds({ ids: [id.id] })).then((r) => {
356
+ if (r.length === 0)
357
+ throw new Error('No place deleted');
358
+ else
359
+ return r[0];
360
+ });
361
+ }),
362
+ },
363
+ Receipt: {
364
+ encryptable: true,
365
+ create: (api, _) => __awaiter(void 0, void 0, void 0, function* () {
366
+ const currentUser = yield api.userApi.getCurrentUser();
367
+ const item = yield api.receiptApi.newInstance(currentUser, {});
368
+ return api.receiptApi.createReceipt(item);
369
+ }),
370
+ share: (delegatorApi, delegateApi, entity) => __awaiter(void 0, void 0, void 0, function* () {
371
+ var _w, _x;
372
+ const delegateUser = yield delegateApi.userApi.getCurrentUser();
373
+ const delegateId = (_x = (_w = delegateUser.healthcarePartyId) !== null && _w !== void 0 ? _w : delegateUser.patientId) !== null && _x !== void 0 ? _x : delegateUser.deviceId;
374
+ if (!delegateId) {
375
+ throw new Error('Cannot share with non data owner user');
376
+ }
377
+ return delegatorApi.receiptApi.shareWith(delegateId, entity);
378
+ }),
379
+ deleteMany: (api, ids) => __awaiter(void 0, void 0, void 0, function* () { return api.receiptApi.deleteReceipts(new ListOfIds_1.ListOfIds({ ids: ids.map((it) => it.id) })); }),
380
+ delete: (api, id) => __awaiter(void 0, void 0, void 0, function* () { return api.receiptApi.deleteReceipt(id.id); }),
381
+ },
382
+ TimeTable: {
383
+ encryptable: true,
384
+ create: (api, _) => __awaiter(void 0, void 0, void 0, function* () {
385
+ const currentUser = yield api.userApi.getCurrentUser();
386
+ const item = yield api.timetableApi.newInstance(currentUser, {});
387
+ return api.timetableApi.createTimeTable(item);
388
+ }),
389
+ share: (delegatorApi, delegateApi, entity) => __awaiter(void 0, void 0, void 0, function* () {
390
+ var _y, _z;
391
+ const delegateUser = yield delegateApi.userApi.getCurrentUser();
392
+ const delegateId = (_z = (_y = delegateUser.healthcarePartyId) !== null && _y !== void 0 ? _y : delegateUser.patientId) !== null && _z !== void 0 ? _z : delegateUser.deviceId;
393
+ if (!delegateId) {
394
+ throw new Error('Cannot share with non data owner user');
395
+ }
396
+ return delegatorApi.timetableApi.shareWith(delegateId, entity);
397
+ }),
398
+ deleteMany: (api, ids) => __awaiter(void 0, void 0, void 0, function* () { return api.timetableApi.deleteTimeTables(new ListOfIds_1.ListOfIds({ ids: ids.map((it) => it.id) })); }),
399
+ delete: (api, id) => __awaiter(void 0, void 0, void 0, function* () { return api.timetableApi.deleteTimeTable(id.id); }),
400
+ },
401
+ Topic: {
402
+ encryptable: true,
403
+ cloudOnly: true,
404
+ create: (api, patient) => __awaiter(void 0, void 0, void 0, function* () {
405
+ const currentUser = yield api.userApi.getCurrentUser();
406
+ const item = yield api.topicApi.newInstance(currentUser, patient);
407
+ return api.topicApi.createTopic(item);
408
+ }),
409
+ share: (delegatorApi, delegateApi, entity) => __awaiter(void 0, void 0, void 0, function* () {
410
+ var _0, _1;
411
+ const delegateUser = yield delegateApi.userApi.getCurrentUser();
412
+ const delegateId = (_1 = (_0 = delegateUser.healthcarePartyId) !== null && _0 !== void 0 ? _0 : delegateUser.patientId) !== null && _1 !== void 0 ? _1 : delegateUser.deviceId;
413
+ if (!delegateId) {
414
+ throw new Error('Cannot share with non data owner user');
415
+ }
416
+ return delegatorApi.topicApi.shareWith(delegateId, entity);
417
+ }),
418
+ deleteMany: (api, ids) => __awaiter(void 0, void 0, void 0, function* () { return api.topicApi.deleteTopics(new ListOfIds_1.ListOfIds({ ids: ids.map((it) => it.id) })); }),
419
+ delete: (api, id) => __awaiter(void 0, void 0, void 0, function* () { return api.topicApi.deleteTopic(id.id); }),
420
+ },
421
+ };
422
+ //# sourceMappingURL=entities-crud-test-interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entities-crud-test-interface.js","sourceRoot":"","sources":["../../../../test/icc-x-api/crud/entities-crud-test-interface.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,mCAAmC;AAInC,gEAA4D;AAE5D,0DAAsD;AACtD,4DAAwD;AAExD,8EAA0E;AAE1E,0FAAsF;AAEtF,0DAAsD;AAGtD,4EAAwE;AAExE,gEAA4D;AAC5D,4DAAwD;AACxD,4DAAwD;AAExD,4EAAwE;AAExE,wDAAoD;AAevC,QAAA,QAAQ,GAAqC;IACxD,SAAS,EAAE;QACT,WAAW,EAAE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AAE,EAAE;YAChD,MAAM,WAAW,GAAG,MAAM,GAAG,CAAC,OAAO,CAAC,cAAc,EAAE,CAAA;YACtD,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,QAAQ,CAAC,WAAW,CAAC,WAAW,EAAE,OAAO,CAAC,CAAA;YACjE,OAAO,GAAG,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,CAAA;QACvC,CAAC,CAAA;QACD,KAAK,EAAE,CAAO,YAAsB,EAAE,WAAqB,EAAE,MAAW,EAAE,EAAE;;YAC1E,MAAM,YAAY,GAAG,MAAM,WAAW,CAAC,OAAO,CAAC,cAAc,EAAE,CAAA;YAC/D,MAAM,UAAU,GAAG,MAAA,MAAA,YAAY,CAAC,iBAAiB,mCAAI,YAAY,CAAC,SAAS,mCAAI,YAAY,CAAC,QAAQ,CAAA;YACpG,IAAI,CAAC,UAAU,EAAE;gBACf,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAA;aACzD;YACD,OAAO,YAAY,CAAC,QAAQ,CAAC,SAAS,CAAC,UAAU,EAAE,MAAe,CAAC,CAAA;QACrE,CAAC,CAAA;QACD,UAAU,EAAE,CAAO,GAAa,EAAE,GAAgB,EAAE,EAAE,kDAAC,OAAA,GAAG,CAAC,QAAQ,CAAC,YAAY,CAAC,IAAI,qBAAS,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAG,CAAC,EAAE,CAAC,CAAC,CAAA,GAAA;QACjI,MAAM,EAAE,CAAO,GAAa,EAAE,EAAa,EAAE,EAAE,kDAAC,OAAA,GAAG,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC,EAAG,CAAC,CAAA,GAAA;KACjF;CACF,CAAA","sourcesContent":["import { IcureApi } from '../../../icc-x-api'\nimport { randomUUID } from 'crypto'\nimport { Patient } from '../../../icc-api/model/Patient'\nimport { IdWithRev } from '../../../icc-api/model/IdWithRev'\nimport { AccessLog } from '../../../icc-api/model/AccessLog'\nimport { ListOfIds } from '../../../icc-api/model/ListOfIds'\nimport { DocIdentifier } from '../../../icc-api/model/DocIdentifier'\nimport { Agenda } from '../../../icc-api/model/Agenda'\nimport { Article } from '../../../icc-api/model/Article'\nimport { CalendarItem } from '../../../icc-api/model/CalendarItem'\nimport { CalendarItemType } from '../../../icc-api/model/CalendarItemType'\nimport { Classification } from '../../../icc-api/model/Classification'\nimport { ClassificationTemplate } from '../../../icc-api/model/ClassificationTemplate'\nimport { Contact } from '../../../icc-api/model/Contact'\nimport { Device } from '../../../icc-api/model/Device'\nimport { Document } from '../../../icc-api/model/Document'\nimport { Form } from '../../../icc-api/model/Form'\nimport { HealthcareParty } from '../../../icc-api/model/HealthcareParty'\nimport { HealthElement } from '../../../icc-api/model/HealthElement'\nimport { Insurance } from '../../../icc-api/model/Insurance'\nimport { Invoice } from '../../../icc-api/model/Invoice'\nimport { Keyword } from '../../../icc-api/model/Keyword'\nimport { MaintenanceTask } from '../../../icc-api/model/MaintenanceTask'\nimport { MedicalLocation } from '../../../icc-api/model/MedicalLocation'\nimport { Message } from '../../../icc-api/model/Message'\nimport { Place } from '../../../icc-api/model/Place'\nimport { Receipt } from '../../../icc-api/model/Receipt'\nimport { TimeTable } from '../../../icc-api/model/TimeTable'\nimport { Topic } from '../../../icc-api/model/Topic'\n\nexport interface CRUDInterface {\n encryptable: boolean\n skipDenied?: boolean\n cloudOnly?: boolean\n create(api: IcureApi, patient: Patient): Promise<IdWithRev>\n share(delegatorApi: IcureApi, delegateApi: IcureApi, entity: any): Promise<IdWithRev>\n deleteMany(api: IcureApi, ids: IdWithRev[]): Promise<Array<DocIdentifier>>\n delete(api: IcureApi, id: IdWithRev): Promise<DocIdentifier>\n}\n\nexport const entities: { [key: string]: CRUDInterface } = {\n AccessLog: {\n encryptable: true,\n create: async (api: IcureApi, patient: Patient) => {\n const currentUser = await api.userApi.getCurrentUser()\n const accessLog = await api.accessLogApi.newInstance(currentUser, patient, { detail: randomUUID() })\n return api.accessLogApi.createAccessLogWithUser(currentUser, accessLog)\n },\n share: async (delegatorApi: IcureApi, delegateApi: IcureApi, entity: any) => {\n const delegateUser = await delegateApi.userApi.getCurrentUser()\n const delegateId = delegateUser.healthcarePartyId ?? delegateUser.patientId ?? delegateUser.deviceId\n if (!delegateId) {\n throw new Error('Cannot share with non data owner user')\n }\n return delegatorApi.accessLogApi.shareWith(delegateId, entity as AccessLog)\n },\n deleteMany: async (api: IcureApi, ids: IdWithRev[]) => api.accessLogApi.deleteAccessLogs(new ListOfIds({ ids: ids.map((it) => it.id!) })),\n delete: async (api: IcureApi, id: IdWithRev) => api.accessLogApi.deleteAccessLog(id.id!),\n },\n Agenda: {\n skipDenied: true,\n encryptable: false,\n create: async (api: IcureApi, _: Patient) => api.agendaApi.createAgenda(new Agenda({ id: randomUUID(), name: randomUUID() })),\n share: async (_: IcureApi, __: IcureApi, entity: any) => entity,\n deleteMany: async (api: IcureApi, ids: IdWithRev[]) => api.agendaApi.deleteAgendas(new ListOfIds({ ids: ids.map((it) => it.id!) })),\n delete: async (api: IcureApi, id: IdWithRev) => api.agendaApi.deleteAgenda(id.id!),\n },\n Article: {\n encryptable: false,\n create: async (api: IcureApi, _: Patient) => api.articleApi.createArticle(new Article({ id: randomUUID(), name: randomUUID() })),\n share: async (_: IcureApi, __: IcureApi, entity: any) => entity,\n deleteMany: async (api: IcureApi, ids: IdWithRev[]) => api.articleApi.deleteArticles(new ListOfIds({ ids: ids.map((it) => it.id!) })),\n delete: async (api: IcureApi, id: IdWithRev) => api.articleApi.deleteArticle(id.id!),\n },\n CalendarItem: {\n encryptable: true,\n create: async (api: IcureApi, _: Patient) => {\n const currentUser = await api.userApi.getCurrentUser()\n const item = await api.calendarItemApi.newInstance(currentUser, { title: randomUUID() })\n return api.calendarItemApi.createCalendarItemWithHcParty(currentUser, item)\n },\n share: async (delegatorApi: IcureApi, delegateApi: IcureApi, entity: any) => {\n const delegateUser = await delegateApi.userApi.getCurrentUser()\n const delegateId = delegateUser.healthcarePartyId ?? delegateUser.patientId ?? delegateUser.deviceId\n if (!delegateId) {\n throw new Error('Cannot share with non data owner user')\n }\n return delegatorApi.calendarItemApi.shareWith(delegateId, entity as CalendarItem)\n },\n deleteMany: async (api: IcureApi, ids: IdWithRev[]) => api.calendarItemApi.deleteCalendarItems(new ListOfIds({ ids: ids.map((it) => it.id!) })),\n delete: async (api: IcureApi, id: IdWithRev) => api.calendarItemApi.deleteCalendarItem(id.id!),\n },\n CalendarItemType: {\n skipDenied: true,\n encryptable: false,\n create: async (api: IcureApi, _: Patient) =>\n api.calendarItemTypeApi.createCalendarItemType(new CalendarItemType({ id: randomUUID(), color: randomUUID() })),\n share: async (_: IcureApi, __: IcureApi, entity: any) => entity,\n deleteMany: async (api: IcureApi, ids: IdWithRev[]) =>\n api.calendarItemTypeApi.deleteCalendarItemTypes(new ListOfIds({ ids: ids.map((it) => it.id!) })),\n delete: async (api: IcureApi, id: IdWithRev) =>\n api.calendarItemTypeApi.deleteCalendarItemTypes(new ListOfIds({ ids: [id.id!] })).then((r) => {\n if (r.length === 0) throw Error('No element deleted')\n else return r[0]\n }),\n },\n Classification: {\n encryptable: true,\n create: async (api: IcureApi, patient: Patient) => {\n const currentUser = await api.userApi.getCurrentUser()\n const item = await api.classificationApi.newInstance(currentUser, patient, { label: randomUUID() })\n return api.classificationApi.createClassification(item)\n },\n share: async (delegatorApi: IcureApi, delegateApi: IcureApi, entity: any) => {\n const delegateUser = await delegateApi.userApi.getCurrentUser()\n const delegateId = delegateUser.healthcarePartyId ?? delegateUser.patientId ?? delegateUser.deviceId\n if (!delegateId) {\n throw new Error('Cannot share with non data owner user')\n }\n return delegatorApi.classificationApi.shareWith(delegateId, entity as Classification)\n },\n deleteMany: async (api: IcureApi, ids: IdWithRev[]) =>\n api.classificationApi.deleteClassifications(new ListOfIds({ ids: ids.map((it) => it.id!) })),\n delete: async (api: IcureApi, id: IdWithRev) => api.classificationApi.deleteClassification(id.id!),\n },\n ClassificationTemplate: {\n encryptable: false,\n create: async (api: IcureApi, _: Patient) =>\n api.classificationTemplateApi.createClassificationTemplate(new ClassificationTemplate({ id: randomUUID(), label: randomUUID() })),\n share: async (_: IcureApi, __: IcureApi, entity: any) => entity,\n deleteMany: async (api: IcureApi, ids: IdWithRev[]) =>\n api.classificationTemplateApi.deleteClassificationTemplates(new ListOfIds({ ids: ids.map((it) => it.id!) })),\n delete: async (api: IcureApi, id: IdWithRev) => api.classificationTemplateApi.deleteClassificationTemplate(id.id!),\n },\n Contact: {\n encryptable: true,\n create: async (api: IcureApi, patient: Patient) => {\n const currentUser = await api.userApi.getCurrentUser()\n const item = await api.contactApi.newInstance(currentUser, patient, { descr: randomUUID() })\n return (await api.contactApi.createContactWithUser(currentUser, item))!\n },\n share: async (delegatorApi: IcureApi, delegateApi: IcureApi, entity: any) => {\n const delegateUser = await delegateApi.userApi.getCurrentUser()\n const delegateId = delegateUser.healthcarePartyId ?? delegateUser.patientId ?? delegateUser.deviceId\n if (!delegateId) {\n throw new Error('Cannot share with non data owner user')\n }\n return delegatorApi.contactApi.shareWith(delegateId, entity as Contact)\n },\n deleteMany: async (api: IcureApi, ids: IdWithRev[]) => api.contactApi.deleteContacts(new ListOfIds({ ids: ids.map((it) => it.id!) })),\n delete: async (api: IcureApi, id: IdWithRev) => api.contactApi.deleteContact(id.id!),\n },\n Device: {\n encryptable: false,\n create: async (api: IcureApi, _: Patient) => api.deviceApi.createDevice(new Device({ id: randomUUID(), name: randomUUID() })),\n share: async (_: IcureApi, __: IcureApi, entity: any) => entity,\n deleteMany: async (api: IcureApi, ids: IdWithRev[]) => api.deviceApi.deleteDevices(new ListOfIds({ ids: ids.map((it) => it.id!) })),\n delete: async (api: IcureApi, id: IdWithRev) => api.deviceApi.deleteDevice(id.id!),\n },\n Document: {\n encryptable: true,\n create: async (api: IcureApi, patient: Patient) => {\n const currentUser = await api.userApi.getCurrentUser()\n const item = await api.documentApi.newInstance(currentUser, patient, { name: randomUUID() })\n return api.documentApi.createDocument(item)\n },\n share: async (delegatorApi: IcureApi, delegateApi: IcureApi, entity: any) => {\n const delegateUser = await delegateApi.userApi.getCurrentUser()\n const delegateId = delegateUser.healthcarePartyId ?? delegateUser.patientId ?? delegateUser.deviceId\n if (!delegateId) {\n throw new Error('Cannot share with non data owner user')\n }\n return delegatorApi.documentApi.shareWith(delegateId, entity as Document)\n },\n deleteMany: async (api: IcureApi, ids: IdWithRev[]) => api.documentApi.deleteDocuments(new ListOfIds({ ids: ids.map((it) => it.id!) })),\n delete: async (api: IcureApi, id: IdWithRev) => api.documentApi.deleteDocument(id.id!),\n },\n Form: {\n encryptable: true,\n create: async (api: IcureApi, patient: Patient) => {\n const currentUser = await api.userApi.getCurrentUser()\n const item = await api.formApi.newInstance(currentUser, patient, { uniqueId: randomUUID() })\n return api.formApi.createForm(item)\n },\n share: async (delegatorApi: IcureApi, delegateApi: IcureApi, entity: any) => {\n const delegateUser = await delegateApi.userApi.getCurrentUser()\n const delegateId = delegateUser.healthcarePartyId ?? delegateUser.patientId ?? delegateUser.deviceId\n if (!delegateId) {\n throw new Error('Cannot share with non data owner user')\n }\n return delegatorApi.formApi.shareWith(delegateId, entity as Form)\n },\n deleteMany: async (api: IcureApi, ids: IdWithRev[]) => api.formApi.deleteForms(new ListOfIds({ ids: ids.map((it) => it.id!) })),\n delete: async (api: IcureApi, id: IdWithRev) => api.formApi.deleteForm(id.id!),\n },\n HealthcareParty: {\n encryptable: false,\n create: async (api: IcureApi, _: Patient) =>\n api.healthcarePartyApi.createHealthcareParty(new HealthcareParty({ id: randomUUID(), name: randomUUID() })),\n share: async (_: IcureApi, __: IcureApi, entity: any) => entity,\n deleteMany: async (api: IcureApi, ids: IdWithRev[]) =>\n api.healthcarePartyApi.deleteHealthcareParties(new ListOfIds({ ids: ids.map((it) => it.id!) })),\n delete: async (api: IcureApi, id: IdWithRev) => api.healthcarePartyApi.deleteHealthcareParty(id.id!),\n },\n HealthcarePartyInGroup: {\n encryptable: false,\n cloudOnly: true,\n create: async (api: IcureApi, _: Patient) =>\n api.healthcarePartyApi.createHealthcareParty(new HealthcareParty({ id: randomUUID(), name: randomUUID() })),\n share: async (_: IcureApi, __: IcureApi, entity: any) => entity,\n deleteMany: async (api: IcureApi, ids: IdWithRev[]) => {\n const currentUser = await api.userApi.getCurrentUser()\n return api.healthcarePartyApi.deleteHealthcarePartiesInGroup(currentUser.groupId!, new ListOfIds({ ids: ids.map((it) => it.id!) }))\n },\n delete: async (api: IcureApi, id: IdWithRev) => {\n const currentUser = await api.userApi.getCurrentUser()\n return api.healthcarePartyApi.deleteHealthcarePartyInGroup(currentUser.groupId!, id.id!)\n },\n },\n HealthcareElement: {\n encryptable: true,\n create: async (api: IcureApi, patient: Patient) => {\n const currentUser = await api.userApi.getCurrentUser()\n const item = await api.healthcareElementApi.newInstance(currentUser, patient, { descr: randomUUID() })\n return api.healthcareElementApi.createHealthElementWithUser(currentUser, item)\n },\n share: async (delegatorApi: IcureApi, delegateApi: IcureApi, entity: any) => {\n const delegateUser = await delegateApi.userApi.getCurrentUser()\n const delegateId = delegateUser.healthcarePartyId ?? delegateUser.patientId ?? delegateUser.deviceId\n if (!delegateId) {\n throw new Error('Cannot share with non data owner user')\n }\n return delegatorApi.healthcareElementApi.shareWith(delegateId, entity as HealthElement)\n },\n deleteMany: async (api: IcureApi, ids: IdWithRev[]) =>\n api.healthcareElementApi.deleteHealthElements(new ListOfIds({ ids: ids.map((it) => it.id!) })),\n delete: async (api: IcureApi, id: IdWithRev) => api.healthcareElementApi.deleteHealthElement(id.id!),\n },\n Insurance: {\n encryptable: false,\n skipDenied: true,\n create: async (api: IcureApi, _: Patient) => api.insuranceApi.createInsurance(new Insurance({ id: randomUUID(), code: randomUUID() })),\n share: async (_: IcureApi, __: IcureApi, entity: any) => entity,\n deleteMany: async (api: IcureApi, ids: IdWithRev[]) => {\n const ret: DocIdentifier[] = []\n for (const id of ids) {\n const result = await api.insuranceApi.deleteInsurance(id.id!)\n ret.push(result)\n }\n return ret\n },\n delete: async (api: IcureApi, id: IdWithRev) => api.insuranceApi.deleteInsurance(id.id!),\n },\n Invoice: {\n encryptable: false,\n skipDenied: true,\n create: async (api: IcureApi, _: Patient) => api.invoiceApi.createInvoice(new Invoice({ id: randomUUID(), recipientId: randomUUID() })),\n share: async (_: IcureApi, __: IcureApi, entity: any) => entity,\n deleteMany: async (api: IcureApi, ids: IdWithRev[]) => {\n const ret: DocIdentifier[] = []\n for (const id of ids) {\n const result = await api.invoiceApi.deleteInvoice(id.id!)\n ret.push(result)\n }\n return ret\n },\n delete: async (api: IcureApi, id: IdWithRev) => api.invoiceApi.deleteInvoice(id.id!),\n },\n Keyword: {\n encryptable: false,\n skipDenied: true,\n create: async (api: IcureApi, _: Patient) => api.keywordApi.createKeyword(new Keyword({ id: randomUUID(), value: randomUUID() })),\n share: async (_: IcureApi, __: IcureApi, entity: any) => entity,\n deleteMany: async (api: IcureApi, ids: IdWithRev[]) => api.keywordApi.deleteKeywords(new ListOfIds({ ids: ids.map((it) => it.id!) })),\n delete: async (api: IcureApi, id: IdWithRev) =>\n api.keywordApi.deleteKeywords(new ListOfIds({ ids: [id.id!] })).then((r) => {\n if (r.length === 0) throw new Error('No keyword deleted')\n else return r[0]\n }),\n },\n MaintenanceTask: {\n encryptable: true,\n create: async (api: IcureApi, _: Patient) => {\n const currentUser = await api.userApi.getCurrentUser()\n const item = await api.maintenanceTaskApi.newInstance(currentUser, {})\n return (await api.maintenanceTaskApi.createMaintenanceTaskWithUser(currentUser, item))!\n },\n share: async (delegatorApi: IcureApi, delegateApi: IcureApi, entity: any) => {\n const delegateUser = await delegateApi.userApi.getCurrentUser()\n const delegateId = delegateUser.healthcarePartyId ?? delegateUser.patientId ?? delegateUser.deviceId\n if (!delegateId) {\n throw new Error('Cannot share with non data owner user')\n }\n return delegatorApi.maintenanceTaskApi.shareWith(delegateId, entity as MaintenanceTask)\n },\n deleteMany: async (api: IcureApi, ids: IdWithRev[]) => {\n const currentUser = await api.userApi.getCurrentUser()\n return api.maintenanceTaskApi.deleteMaintenanceTasksWithUser(currentUser, new ListOfIds({ ids: ids.map((it) => it.id!) }))\n },\n delete: async (api: IcureApi, id: IdWithRev) => {\n const currentUser = await api.userApi.getCurrentUser()\n return api.maintenanceTaskApi.deleteMaintenanceTaskWithUser(currentUser, id.id!)\n },\n },\n MedicalLocation: {\n encryptable: false,\n skipDenied: true,\n create: async (api: IcureApi, _: Patient) =>\n api.medicalLocationApi.createMedicalLocation(new MedicalLocation({ id: randomUUID(), nihii: randomUUID() })),\n share: async (_: IcureApi, __: IcureApi, entity: any) => entity,\n deleteMany: async (api: IcureApi, ids: IdWithRev[]) =>\n api.medicalLocationApi.deleteMedicalLocations(new ListOfIds({ ids: ids.map((it) => it.id!) })),\n delete: async (api: IcureApi, id: IdWithRev) =>\n api.medicalLocationApi.deleteMedicalLocations(new ListOfIds({ ids: [id.id!] })).then((r) => {\n if (r.length === 0) throw new Error('No medical location deleted')\n else return r[0]\n }),\n },\n Message: {\n encryptable: true,\n create: async (api: IcureApi, _: Patient) => {\n const currentUser = await api.userApi.getCurrentUser()\n const item = await api.messageApi.newInstance(currentUser, {})\n return api.messageApi.createMessage(item)\n },\n share: async (delegatorApi: IcureApi, delegateApi: IcureApi, entity: any) => {\n const delegateUser = await delegateApi.userApi.getCurrentUser()\n const delegateId = delegateUser.healthcarePartyId ?? delegateUser.patientId ?? delegateUser.deviceId\n if (!delegateId) {\n throw new Error('Cannot share with non data owner user')\n }\n return delegatorApi.messageApi.shareWith(delegateId, entity as Message, [])\n },\n deleteMany: async (api: IcureApi, ids: IdWithRev[]) => api.messageApi.deleteMessages(new ListOfIds({ ids: ids.map((it) => it.id!) })),\n delete: async (api: IcureApi, id: IdWithRev) => api.messageApi.deleteMessage(id.id!),\n },\n Patient: {\n encryptable: true,\n create: async (api: IcureApi, _: Patient) => {\n const currentUser = await api.userApi.getCurrentUser()\n const item = await api.patientApi.newInstance(currentUser, {})\n return api.patientApi.createPatientWithUser(currentUser, item)\n },\n share: async (delegatorApi: IcureApi, delegateApi: IcureApi, entity: any) => {\n const delegateUser = await delegateApi.userApi.getCurrentUser()\n const delegateId = delegateUser.healthcarePartyId ?? delegateUser.patientId ?? delegateUser.deviceId\n if (!delegateId) {\n throw new Error('Cannot share with non data owner user')\n }\n return delegatorApi.patientApi.shareWith(delegateId, entity as Patient, [])\n },\n deleteMany: async (api: IcureApi, ids: IdWithRev[]) => api.patientApi.deletePatients(new ListOfIds({ ids: ids.map((it) => it.id!) })),\n delete: async (api: IcureApi, id: IdWithRev) => api.patientApi.deletePatient(id.id!),\n },\n Place: {\n encryptable: false,\n skipDenied: true,\n create: async (api: IcureApi, _: Patient) => api.placeApi.createPlace(new Place({ id: randomUUID(), name: randomUUID() })),\n share: async (_: IcureApi, __: IcureApi, entity: any) => entity,\n deleteMany: async (api: IcureApi, ids: IdWithRev[]) => api.placeApi.deletePlaces(new ListOfIds({ ids: ids.map((it) => it.id!) })),\n delete: async (api: IcureApi, id: IdWithRev) =>\n api.placeApi.deletePlaces(new ListOfIds({ ids: [id.id!] })).then((r) => {\n if (r.length === 0) throw new Error('No place deleted')\n else return r[0]\n }),\n },\n Receipt: {\n encryptable: true,\n create: async (api: IcureApi, _: Patient) => {\n const currentUser = await api.userApi.getCurrentUser()\n const item = await api.receiptApi.newInstance(currentUser, {})\n return api.receiptApi.createReceipt(item)\n },\n share: async (delegatorApi: IcureApi, delegateApi: IcureApi, entity: any) => {\n const delegateUser = await delegateApi.userApi.getCurrentUser()\n const delegateId = delegateUser.healthcarePartyId ?? delegateUser.patientId ?? delegateUser.deviceId\n if (!delegateId) {\n throw new Error('Cannot share with non data owner user')\n }\n return delegatorApi.receiptApi.shareWith(delegateId, entity as Receipt)\n },\n deleteMany: async (api: IcureApi, ids: IdWithRev[]) => api.receiptApi.deleteReceipts(new ListOfIds({ ids: ids.map((it) => it.id!) })),\n delete: async (api: IcureApi, id: IdWithRev) => api.receiptApi.deleteReceipt(id.id!),\n },\n TimeTable: {\n encryptable: true,\n create: async (api: IcureApi, _: Patient) => {\n const currentUser = await api.userApi.getCurrentUser()\n const item = await api.timetableApi.newInstance(currentUser, {})\n return api.timetableApi.createTimeTable(item)\n },\n share: async (delegatorApi: IcureApi, delegateApi: IcureApi, entity: any) => {\n const delegateUser = await delegateApi.userApi.getCurrentUser()\n const delegateId = delegateUser.healthcarePartyId ?? delegateUser.patientId ?? delegateUser.deviceId\n if (!delegateId) {\n throw new Error('Cannot share with non data owner user')\n }\n return delegatorApi.timetableApi.shareWith(delegateId, entity as TimeTable)\n },\n deleteMany: async (api: IcureApi, ids: IdWithRev[]) => api.timetableApi.deleteTimeTables(new ListOfIds({ ids: ids.map((it) => it.id!) })),\n delete: async (api: IcureApi, id: IdWithRev) => api.timetableApi.deleteTimeTable(id.id!),\n },\n Topic: {\n encryptable: true,\n cloudOnly: true,\n create: async (api: IcureApi, patient: Patient) => {\n const currentUser = await api.userApi.getCurrentUser()\n const item = await api.topicApi.newInstance(currentUser, patient)\n return api.topicApi.createTopic(item)\n },\n share: async (delegatorApi: IcureApi, delegateApi: IcureApi, entity: any) => {\n const delegateUser = await delegateApi.userApi.getCurrentUser()\n const delegateId = delegateUser.healthcarePartyId ?? delegateUser.patientId ?? delegateUser.deviceId\n if (!delegateId) {\n throw new Error('Cannot share with non data owner user')\n }\n return delegatorApi.topicApi.shareWith(delegateId, entity as Topic)\n },\n deleteMany: async (api: IcureApi, ids: IdWithRev[]) => api.topicApi.deleteTopics(new ListOfIds({ ids: ids.map((it) => it.id!) })),\n delete: async (api: IcureApi, id: IdWithRev) => api.topicApi.deleteTopic(id.id!),\n },\n}\n"]}
@@ -0,0 +1 @@
1
+ import 'isomorphic-fetch';