@icure/api 8.6.19 → 8.7.0

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 (326) hide show
  1. package/icc-api/api/IccDocumentApi.d.ts +10 -2
  2. package/icc-api/api/IccDocumentApi.js +22 -4
  3. package/icc-api/api/IccDocumentApi.js.map +1 -1
  4. package/icc-api/api/IccReceiptApi.d.ts +17 -0
  5. package/icc-api/api/IccReceiptApi.js +52 -0
  6. package/icc-api/api/IccReceiptApi.js.map +1 -1
  7. package/icc-api/model/DataAttachment.d.ts +22 -0
  8. package/icc-api/model/DataAttachment.js.map +1 -1
  9. package/icc-api/model/Document.d.ts +6 -0
  10. package/icc-api/model/Document.js.map +1 -1
  11. package/icc-api/model/Receipt.d.ts +6 -0
  12. package/icc-api/model/Receipt.js.map +1 -1
  13. package/icc-x-api/crypto/BaseExchangeDataManager.js +2 -2
  14. package/icc-x-api/crypto/BaseExchangeDataManager.js.map +1 -1
  15. package/icc-x-api/crypto/ExchangeDataManager.js +3 -3
  16. package/icc-x-api/crypto/ExchangeDataManager.js.map +1 -1
  17. package/icc-x-api/crypto/ExtendedApisUtils.d.ts +1 -1
  18. package/icc-x-api/crypto/ExtendedApisUtils.js.map +1 -1
  19. package/icc-x-api/crypto/ExtendedApisUtilsImpl.d.ts +1 -1
  20. package/icc-x-api/crypto/ExtendedApisUtilsImpl.js +8 -2
  21. package/icc-x-api/crypto/ExtendedApisUtilsImpl.js.map +1 -1
  22. package/icc-x-api/crypto/RecoveryDataEncryption.js.map +1 -1
  23. package/icc-x-api/icc-accesslog-x-api.js +7 -7
  24. package/icc-x-api/icc-accesslog-x-api.js.map +1 -1
  25. package/icc-x-api/icc-calendar-item-x-api.js +7 -7
  26. package/icc-x-api/icc-calendar-item-x-api.js.map +1 -1
  27. package/icc-x-api/icc-classification-x-api.js +4 -5
  28. package/icc-x-api/icc-classification-x-api.js.map +1 -1
  29. package/icc-x-api/icc-code-x-api.d.ts +2 -2
  30. package/icc-x-api/icc-code-x-api.js +3 -33
  31. package/icc-x-api/icc-code-x-api.js.map +1 -1
  32. package/icc-x-api/icc-contact-x-api.js +20 -33
  33. package/icc-x-api/icc-contact-x-api.js.map +1 -1
  34. package/icc-x-api/icc-doctemplate-x-api.js.map +1 -1
  35. package/icc-x-api/icc-document-x-api.d.ts +8 -7
  36. package/icc-x-api/icc-document-x-api.js +64 -22
  37. package/icc-x-api/icc-document-x-api.js.map +1 -1
  38. package/icc-x-api/icc-form-x-api.js +3 -4
  39. package/icc-x-api/icc-form-x-api.js.map +1 -1
  40. package/icc-x-api/icc-helement-x-api.js +11 -11
  41. package/icc-x-api/icc-helement-x-api.js.map +1 -1
  42. package/icc-x-api/icc-invoice-x-api.js +3 -4
  43. package/icc-x-api/icc-invoice-x-api.js.map +1 -1
  44. package/icc-x-api/icc-maintenance-task-x-api.js +3 -3
  45. package/icc-x-api/icc-maintenance-task-x-api.js.map +1 -1
  46. package/icc-x-api/icc-patient-x-api.js +29 -29
  47. package/icc-x-api/icc-patient-x-api.js.map +1 -1
  48. package/icc-x-api/icc-receipt-x-api.d.ts +40 -0
  49. package/icc-x-api/icc-receipt-x-api.js +79 -1
  50. package/icc-x-api/icc-receipt-x-api.js.map +1 -1
  51. package/icc-x-api/icc-topic-x-api.js.map +1 -1
  52. package/icc-x-api/utils/code-util.d.ts +23 -0
  53. package/icc-x-api/utils/code-util.js +39 -2
  54. package/icc-x-api/utils/code-util.js.map +1 -1
  55. package/icc-x-api/utils/collection-utils.d.ts +13 -0
  56. package/icc-x-api/utils/collection-utils.js +69 -0
  57. package/icc-x-api/utils/collection-utils.js.map +1 -1
  58. package/icc-x-api/utils/compression-utils.d.ts +28 -0
  59. package/icc-x-api/utils/compression-utils.js +106 -0
  60. package/icc-x-api/utils/compression-utils.js.map +1 -0
  61. package/icc-x-api/utils/crypto-utils.js +7 -7
  62. package/icc-x-api/utils/crypto-utils.js.map +1 -1
  63. package/icc-x-api/utils/formatting-util.d.ts +1 -3
  64. package/icc-x-api/utils/formatting-util.js +15 -17
  65. package/icc-x-api/utils/formatting-util.js.map +1 -1
  66. package/icc-x-api/utils/hcp-util.js +2 -3
  67. package/icc-x-api/utils/hcp-util.js.map +1 -1
  68. package/icc-x-api/utils/insurability-util.js +10 -8
  69. package/icc-x-api/utils/insurability-util.js.map +1 -1
  70. package/icc-x-api/utils/lzma-wasm.d.ts +6 -0
  71. package/icc-x-api/utils/lzma-wasm.js +81 -0
  72. package/icc-x-api/utils/lzma-wasm.js.map +1 -0
  73. package/icc-x-api/utils/mutex.d.ts +12 -0
  74. package/icc-x-api/utils/mutex.js +26 -0
  75. package/icc-x-api/utils/mutex.js.map +1 -0
  76. package/icc-x-api/utils/websocket.js +7 -7
  77. package/icc-x-api/utils/websocket.js.map +1 -1
  78. package/icc-x-api/wasm/lzma/lzma.js +2 -0
  79. package/icc-x-api/wasm/lzma/lzma.wasm +0 -0
  80. package/package.json +2 -11
  81. package/icc-x-api/utils/uuid-encoder.d.ts +0 -44
  82. package/icc-x-api/utils/uuid-encoder.js +0 -114
  83. package/icc-x-api/utils/uuid-encoder.js.map +0 -1
  84. package/test/icc-api/api/IccAgendaApi.d.ts +0 -1
  85. package/test/icc-api/api/IccAgendaApi.js +0 -64
  86. package/test/icc-api/api/IccAgendaApi.js.map +0 -1
  87. package/test/icc-api/api/IccAnonymousAccessApi.d.ts +0 -1
  88. package/test/icc-api/api/IccAnonymousAccessApi.js +0 -58
  89. package/test/icc-api/api/IccAnonymousAccessApi.js.map +0 -1
  90. package/test/icc-api/api/IccCalendarItemApi.d.ts +0 -1
  91. package/test/icc-api/api/IccCalendarItemApi.js +0 -67
  92. package/test/icc-api/api/IccCalendarItemApi.js.map +0 -1
  93. package/test/icc-api/api/IccCalendarItemTypeApi.d.ts +0 -1
  94. package/test/icc-api/api/IccCalendarItemTypeApi.js +0 -96
  95. package/test/icc-api/api/IccCalendarItemTypeApi.js.map +0 -1
  96. package/test/icc-api/api/IccCodeApi.d.ts +0 -1
  97. package/test/icc-api/api/IccCodeApi.js +0 -38
  98. package/test/icc-api/api/IccCodeApi.js.map +0 -1
  99. package/test/icc-api/api/IccDocumentApi.d.ts +0 -1
  100. package/test/icc-api/api/IccDocumentApi.js +0 -199
  101. package/test/icc-api/api/IccDocumentApi.js.map +0 -1
  102. package/test/icc-api/api/IccGroupApi.d.ts +0 -1
  103. package/test/icc-api/api/IccGroupApi.js +0 -50
  104. package/test/icc-api/api/IccGroupApi.js.map +0 -1
  105. package/test/icc-api/api/IccKeywordApi.d.ts +0 -1
  106. package/test/icc-api/api/IccKeywordApi.js +0 -64
  107. package/test/icc-api/api/IccKeywordApi.js.map +0 -1
  108. package/test/icc-api/api/IccMedicalLocationApi.d.ts +0 -1
  109. package/test/icc-api/api/IccMedicalLocationApi.js +0 -64
  110. package/test/icc-api/api/IccMedicalLocationApi.js.map +0 -1
  111. package/test/icc-api/api/IccPlaceApi.d.ts +0 -1
  112. package/test/icc-api/api/IccPlaceApi.js +0 -64
  113. package/test/icc-api/api/IccPlaceApi.js.map +0 -1
  114. package/test/icc-api/api/IccRecoveryDataApi.d.ts +0 -1
  115. package/test/icc-api/api/IccRecoveryDataApi.js +0 -95
  116. package/test/icc-api/api/IccRecoveryDataApi.js.map +0 -1
  117. package/test/icc-api/api/IccRoleApi.d.ts +0 -1
  118. package/test/icc-api/api/IccRoleApi.js +0 -34
  119. package/test/icc-api/api/IccRoleApi.js.map +0 -1
  120. package/test/icc-api/api/IccUserApi.d.ts +0 -1
  121. package/test/icc-api/api/IccUserApi.js +0 -96
  122. package/test/icc-api/api/IccUserApi.js.map +0 -1
  123. package/test/icc-api/e2e/IccCalendarItemApi.d.ts +0 -1
  124. package/test/icc-api/e2e/IccCalendarItemApi.js +0 -46
  125. package/test/icc-api/e2e/IccCalendarItemApi.js.map +0 -1
  126. package/test/icc-api/model/modelHelpersTest.d.ts +0 -1
  127. package/test/icc-api/model/modelHelpersTest.js +0 -45
  128. package/test/icc-api/model/modelHelpersTest.js.map +0 -1
  129. package/test/icc-x-api/auth/group-switch-test.d.ts +0 -1
  130. package/test/icc-x-api/auth/group-switch-test.js +0 -81
  131. package/test/icc-x-api/auth/group-switch-test.js.map +0 -1
  132. package/test/icc-x-api/auth/jwt-concurrency-test.d.ts +0 -2
  133. package/test/icc-x-api/auth/jwt-concurrency-test.js +0 -112
  134. package/test/icc-x-api/auth/jwt-concurrency-test.js.map +0 -1
  135. package/test/icc-x-api/auth/jwt-provider-test.d.ts +0 -1
  136. package/test/icc-x-api/auth/jwt-provider-test.js +0 -197
  137. package/test/icc-x-api/auth/jwt-provider-test.js.map +0 -1
  138. package/test/icc-x-api/auth/smart-auth-provider-test.d.ts +0 -1
  139. package/test/icc-x-api/auth/smart-auth-provider-test.js +0 -224
  140. package/test/icc-x-api/auth/smart-auth-provider-test.js.map +0 -1
  141. package/test/icc-x-api/autofix-anonymity-test.d.ts +0 -1
  142. package/test/icc-x-api/autofix-anonymity-test.js +0 -122
  143. package/test/icc-x-api/autofix-anonymity-test.js.map +0 -1
  144. package/test/icc-x-api/confidential-entities-test.d.ts +0 -1
  145. package/test/icc-x-api/confidential-entities-test.js +0 -168
  146. package/test/icc-x-api/confidential-entities-test.js.map +0 -1
  147. package/test/icc-x-api/crud/comprehensive-crud-test.d.ts +0 -1
  148. package/test/icc-x-api/crud/comprehensive-crud-test.js +0 -276
  149. package/test/icc-x-api/crud/comprehensive-crud-test.js.map +0 -1
  150. package/test/icc-x-api/crud/entities-crud-test-interface.d.ts +0 -16
  151. package/test/icc-x-api/crud/entities-crud-test-interface.js +0 -408
  152. package/test/icc-x-api/crud/entities-crud-test-interface.js.map +0 -1
  153. package/test/icc-x-api/crypto/anonymous-delegations-test.d.ts +0 -1
  154. package/test/icc-x-api/crypto/anonymous-delegations-test.js +0 -587
  155. package/test/icc-x-api/crypto/anonymous-delegations-test.js.map +0 -1
  156. package/test/icc-x-api/crypto/concurrency.d.ts +0 -1
  157. package/test/icc-x-api/crypto/concurrency.js +0 -35
  158. package/test/icc-x-api/crypto/concurrency.js.map +0 -1
  159. package/test/icc-x-api/crypto/crypto-utils.d.ts +0 -1
  160. package/test/icc-x-api/crypto/crypto-utils.js +0 -79
  161. package/test/icc-x-api/crypto/crypto-utils.js.map +0 -1
  162. package/test/icc-x-api/crypto/cryptoTest.d.ts +0 -2
  163. package/test/icc-x-api/crypto/cryptoTest.js +0 -402
  164. package/test/icc-x-api/crypto/cryptoTest.js.map +0 -1
  165. package/test/icc-x-api/crypto/delegate-ci-to-patient-with-missing-keys-test.d.ts +0 -1
  166. package/test/icc-x-api/crypto/delegate-ci-to-patient-with-missing-keys-test.js +0 -166
  167. package/test/icc-x-api/crypto/delegate-ci-to-patient-with-missing-keys-test.js.map +0 -1
  168. package/test/icc-x-api/crypto/exchange-data-manager-test.d.ts +0 -1
  169. package/test/icc-x-api/crypto/exchange-data-manager-test.js +0 -674
  170. package/test/icc-x-api/crypto/exchange-data-manager-test.js.map +0 -1
  171. package/test/icc-x-api/crypto/full-crypto-test.d.ts +0 -1
  172. package/test/icc-x-api/crypto/full-crypto-test.js +0 -454
  173. package/test/icc-x-api/crypto/full-crypto-test.js.map +0 -1
  174. package/test/icc-x-api/crypto/legacy-metadata-migration-test.d.ts +0 -1
  175. package/test/icc-x-api/crypto/legacy-metadata-migration-test.js +0 -379
  176. package/test/icc-x-api/crypto/legacy-metadata-migration-test.js.map +0 -1
  177. package/test/icc-x-api/crypto/secure-delegations-manager-test.d.ts +0 -1
  178. package/test/icc-x-api/crypto/secure-delegations-manager-test.js +0 -278
  179. package/test/icc-x-api/crypto/secure-delegations-manager-test.js.map +0 -1
  180. package/test/icc-x-api/crypto/shamir.d.ts +0 -2
  181. package/test/icc-x-api/crypto/shamir.js +0 -167
  182. package/test/icc-x-api/crypto/shamir.js.map +0 -1
  183. package/test/icc-x-api/crypto/share-to-newly-created-patient-from-hcp.d.ts +0 -1
  184. package/test/icc-x-api/crypto/share-to-newly-created-patient-from-hcp.js +0 -71
  185. package/test/icc-x-api/crypto/share-to-newly-created-patient-from-hcp.js.map +0 -1
  186. package/test/icc-x-api/crypto/soft-deleted-data-owners.d.ts +0 -2
  187. package/test/icc-x-api/crypto/soft-deleted-data-owners.js +0 -113
  188. package/test/icc-x-api/crypto/soft-deleted-data-owners.js.map +0 -1
  189. package/test/icc-x-api/crypto/user-encryption-keys-manager-test.d.ts +0 -1
  190. package/test/icc-x-api/crypto/user-encryption-keys-manager-test.js +0 -246
  191. package/test/icc-x-api/crypto/user-encryption-keys-manager-test.js.map +0 -1
  192. package/test/icc-x-api/entity-with-attachments-api-test.d.ts +0 -1
  193. package/test/icc-x-api/entity-with-attachments-api-test.js +0 -142
  194. package/test/icc-x-api/entity-with-attachments-api-test.js.map +0 -1
  195. package/test/icc-x-api/filters/filters.d.ts +0 -1
  196. package/test/icc-x-api/filters/filters.js +0 -49
  197. package/test/icc-x-api/filters/filters.js.map +0 -1
  198. package/test/icc-x-api/filters/healthelement.d.ts +0 -1
  199. package/test/icc-x-api/filters/healthelement.js +0 -333
  200. package/test/icc-x-api/filters/healthelement.js.map +0 -1
  201. package/test/icc-x-api/icc-accesslog-x-api.d.ts +0 -1
  202. package/test/icc-x-api/icc-accesslog-x-api.js +0 -106
  203. package/test/icc-x-api/icc-accesslog-x-api.js.map +0 -1
  204. package/test/icc-x-api/icc-application-settings-x-api.d.ts +0 -1
  205. package/test/icc-x-api/icc-application-settings-x-api.js +0 -91
  206. package/test/icc-x-api/icc-application-settings-x-api.js.map +0 -1
  207. package/test/icc-x-api/icc-auth-api.d.ts +0 -1
  208. package/test/icc-x-api/icc-auth-api.js +0 -47
  209. package/test/icc-x-api/icc-auth-api.js.map +0 -1
  210. package/test/icc-x-api/icc-calendar-item-x-api.d.ts +0 -1
  211. package/test/icc-x-api/icc-calendar-item-x-api.js +0 -150
  212. package/test/icc-x-api/icc-calendar-item-x-api.js.map +0 -1
  213. package/test/icc-x-api/icc-contact-x-api.d.ts +0 -1
  214. package/test/icc-x-api/icc-contact-x-api.js +0 -355
  215. package/test/icc-x-api/icc-contact-x-api.js.map +0 -1
  216. package/test/icc-x-api/icc-document-x-api.d.ts +0 -1
  217. package/test/icc-x-api/icc-document-x-api.js +0 -76
  218. package/test/icc-x-api/icc-document-x-api.js.map +0 -1
  219. package/test/icc-x-api/icc-form-x-api.d.ts +0 -1
  220. package/test/icc-x-api/icc-form-x-api.js +0 -413
  221. package/test/icc-x-api/icc-form-x-api.js.map +0 -1
  222. package/test/icc-x-api/icc-hcparty-x-api-test.d.ts +0 -1
  223. package/test/icc-x-api/icc-hcparty-x-api-test.js +0 -43
  224. package/test/icc-x-api/icc-hcparty-x-api-test.js.map +0 -1
  225. package/test/icc-x-api/icc-helement-x-api-test.d.ts +0 -1
  226. package/test/icc-x-api/icc-helement-x-api-test.js +0 -155
  227. package/test/icc-x-api/icc-helement-x-api-test.js.map +0 -1
  228. package/test/icc-x-api/icc-invoice-x-api.d.ts +0 -1
  229. package/test/icc-x-api/icc-invoice-x-api.js +0 -99
  230. package/test/icc-x-api/icc-invoice-x-api.js.map +0 -1
  231. package/test/icc-x-api/icc-maintenance-task-x-api-test.d.ts +0 -1
  232. package/test/icc-x-api/icc-maintenance-task-x-api-test.js +0 -222
  233. package/test/icc-x-api/icc-maintenance-task-x-api-test.js.map +0 -1
  234. package/test/icc-x-api/icc-message-x-api.d.ts +0 -1
  235. package/test/icc-x-api/icc-message-x-api.js +0 -54
  236. package/test/icc-x-api/icc-message-x-api.js.map +0 -1
  237. package/test/icc-x-api/icc-patient-x-api-test.d.ts +0 -1
  238. package/test/icc-x-api/icc-patient-x-api-test.js +0 -165
  239. package/test/icc-x-api/icc-patient-x-api-test.js.map +0 -1
  240. package/test/icc-x-api/icc-recovery-x-api.d.ts +0 -1
  241. package/test/icc-x-api/icc-recovery-x-api.js +0 -175
  242. package/test/icc-x-api/icc-recovery-x-api.js.map +0 -1
  243. package/test/icc-x-api/icc-topic-x-api.d.ts +0 -1
  244. package/test/icc-x-api/icc-topic-x-api.js +0 -269
  245. package/test/icc-x-api/icc-topic-x-api.js.map +0 -1
  246. package/test/icc-x-api/icc-user-x-api-test.d.ts +0 -1
  247. package/test/icc-x-api/icc-user-x-api-test.js +0 -99
  248. package/test/icc-x-api/icc-user-x-api-test.js.map +0 -1
  249. package/test/icc-x-api/keyless-api.d.ts +0 -1
  250. package/test/icc-x-api/keyless-api.js +0 -125
  251. package/test/icc-x-api/keyless-api.js.map +0 -1
  252. package/test/icc-x-api/patient-user.d.ts +0 -2
  253. package/test/icc-x-api/patient-user.js +0 -103
  254. package/test/icc-x-api/patient-user.js.map +0 -1
  255. package/test/icc-x-api/storage/storage.d.ts +0 -1
  256. package/test/icc-x-api/storage/storage.js +0 -48
  257. package/test/icc-x-api/storage/storage.js.map +0 -1
  258. package/test/icc-x-api/test-api-no-parent.d.ts +0 -1
  259. package/test/icc-x-api/test-api-no-parent.js +0 -79
  260. package/test/icc-x-api/test-api-no-parent.js.map +0 -1
  261. package/test/icc-x-api/test-legacy-data-support.d.ts +0 -1
  262. package/test/icc-x-api/test-legacy-data-support.js +0 -375
  263. package/test/icc-x-api/test-legacy-data-support.js.map +0 -1
  264. package/test/icc-x-api/utils/graph-test.d.ts +0 -1
  265. package/test/icc-x-api/utils/graph-test.js +0 -54
  266. package/test/icc-x-api/utils/graph-test.js.map +0 -1
  267. package/test/icc-x-api/utils/lru-temporised-async-cache-test.d.ts +0 -1
  268. package/test/icc-x-api/utils/lru-temporised-async-cache-test.js +0 -364
  269. package/test/icc-x-api/utils/lru-temporised-async-cache-test.js.map +0 -1
  270. package/test/support/CSM-185.d.ts +0 -1
  271. package/test/support/CSM-185.js +0 -124
  272. package/test/support/CSM-185.js.map +0 -1
  273. package/test/support/CSM-243.d.ts +0 -1
  274. package/test/support/CSM-243.js +0 -120
  275. package/test/support/CSM-243.js.map +0 -1
  276. package/test/support/CSM-543.d.ts +0 -1
  277. package/test/support/CSM-543.js +0 -164
  278. package/test/support/CSM-543.js.map +0 -1
  279. package/test/support/CSM-729.d.ts +0 -1
  280. package/test/support/CSM-729.js +0 -225
  281. package/test/support/CSM-729.js.map +0 -1
  282. package/test/support/CSM-87.d.ts +0 -0
  283. package/test/support/CSM-87.js +0 -21
  284. package/test/support/CSM-87.js.map +0 -1
  285. package/test/support/CSM-93.d.ts +0 -1
  286. package/test/support/CSM-93.js +0 -112
  287. package/test/support/CSM-93.js.map +0 -1
  288. package/test/utils/FakeDataOwnerApi.d.ts +0 -32
  289. package/test/utils/FakeDataOwnerApi.js +0 -136
  290. package/test/utils/FakeDataOwnerApi.js.map +0 -1
  291. package/test/utils/FakeEncryptionKeysManager.d.ts +0 -36
  292. package/test/utils/FakeEncryptionKeysManager.js +0 -98
  293. package/test/utils/FakeEncryptionKeysManager.js.map +0 -1
  294. package/test/utils/FakeExchangeDataApi.d.ts +0 -32
  295. package/test/utils/FakeExchangeDataApi.js +0 -92
  296. package/test/utils/FakeExchangeDataApi.js.map +0 -1
  297. package/test/utils/FakeExchangeDataManager.d.ts +0 -48
  298. package/test/utils/FakeExchangeDataManager.js +0 -82
  299. package/test/utils/FakeExchangeDataManager.js.map +0 -1
  300. package/test/utils/FakeExchangeDataMapManager.d.ts +0 -12
  301. package/test/utils/FakeExchangeDataMapManager.js +0 -38
  302. package/test/utils/FakeExchangeDataMapManager.js.map +0 -1
  303. package/test/utils/FakeGenericApi.d.ts +0 -16
  304. package/test/utils/FakeGenericApi.js +0 -65
  305. package/test/utils/FakeGenericApi.js.map +0 -1
  306. package/test/utils/KeylessCryptoStrategies.d.ts +0 -23
  307. package/test/utils/KeylessCryptoStrategies.js +0 -26
  308. package/test/utils/KeylessCryptoStrategies.js.map +0 -1
  309. package/test/utils/TestApi.d.ts +0 -3
  310. package/test/utils/TestApi.js +0 -30
  311. package/test/utils/TestApi.js.map +0 -1
  312. package/test/utils/TestCollectionUtils.d.ts +0 -1
  313. package/test/utils/TestCollectionUtils.js +0 -109
  314. package/test/utils/TestCollectionUtils.js.map +0 -1
  315. package/test/utils/TestCryptoStrategies.d.ts +0 -42
  316. package/test/utils/TestCryptoStrategies.js +0 -80
  317. package/test/utils/TestCryptoStrategies.js.map +0 -1
  318. package/test/utils/TestStorage.d.ts +0 -23
  319. package/test/utils/TestStorage.js +0 -61
  320. package/test/utils/TestStorage.js.map +0 -1
  321. package/test/utils/roles.d.ts +0 -14
  322. package/test/utils/roles.js +0 -345
  323. package/test/utils/roles.js.map +0 -1
  324. package/test/utils/test_utils.d.ts +0 -87
  325. package/test/utils/test_utils.js +0 -452
  326. package/test/utils/test_utils.js.map +0 -1
@@ -1,355 +0,0 @@
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
- const mocha_1 = require("mocha");
13
- require("isomorphic-fetch");
14
- const icc_x_api_1 = require("../../icc-x-api");
15
- const Patient_1 = require("../../icc-api/model/Patient");
16
- const chai_1 = require("chai");
17
- const crypto_1 = require("crypto");
18
- const test_utils_1 = require("../utils/test_utils");
19
- const Code_1 = require("../../icc-api/model/Code");
20
- const Contact_1 = require("../../icc-api/model/Contact");
21
- const Service_1 = require("../../icc-api/model/Service");
22
- const Content_1 = require("../../icc-api/model/Content");
23
- const HealthElement_1 = require("../../icc-api/model/HealthElement");
24
- const SubContact_1 = require("../../icc-api/model/SubContact");
25
- const ServiceLink_1 = require("../../icc-api/model/ServiceLink");
26
- const FilterChainService_1 = require("../../icc-api/model/FilterChainService");
27
- const ServiceByHcPartyHealthElementIdsFilter_1 = require("../../icc-x-api/filters/ServiceByHcPartyHealthElementIdsFilter");
28
- const types_1 = require("@icure/test-setup/types");
29
- const Measure_1 = require("../../icc-api/model/Measure");
30
- var initApi = test_utils_1.TestUtils.initApi;
31
- const SecretIdUseOption_1 = require("../../icc-x-api/crypto/SecretIdUseOption");
32
- var UseAnyConfidential = SecretIdUseOption_1.SecretIdUseOption.UseAnyConfidential;
33
- const ServiceByHcPartyMonthTagPrefixFilter_1 = require("../../icc-x-api/filters/ServiceByHcPartyMonthTagPrefixFilter");
34
- const ServiceByHcPartyMonthCodePrefixFilter_1 = require("../../icc-x-api/filters/ServiceByHcPartyMonthCodePrefixFilter");
35
- const ServiceByHcPartyPatientCodePrefixFilter_1 = require("../../icc-x-api/filters/ServiceByHcPartyPatientCodePrefixFilter");
36
- const ServiceByHcPartyPatientTagPrefixFilter_1 = require("../../icc-x-api/filters/ServiceByHcPartyPatientTagPrefixFilter");
37
- (0, test_utils_1.setLocalStorage)(fetch);
38
- let env;
39
- (0, mocha_1.before)(function () {
40
- return __awaiter(this, void 0, void 0, function* () {
41
- this.timeout(600000);
42
- const initializer = yield (0, test_utils_1.getEnvironmentInitializer)();
43
- env = yield initializer.execute((0, types_1.getEnvVariables)());
44
- });
45
- });
46
- function createPatient(patientApiForHcp, hcpUser) {
47
- return __awaiter(this, void 0, void 0, function* () {
48
- return patientApiForHcp.createPatientWithUser(hcpUser, yield patientApiForHcp.newInstance(hcpUser, new Patient_1.Patient({
49
- id: (0, crypto_1.randomUUID)(),
50
- firstName: 'John',
51
- lastName: 'Snow',
52
- note: 'Winter is coming',
53
- })));
54
- });
55
- }
56
- function createHealthElement(healthElementApi, hcpUser, patient) {
57
- return __awaiter(this, void 0, void 0, function* () {
58
- return healthElementApi.createHealthElementWithUser(hcpUser, yield healthElementApi.newInstance(hcpUser, patient, new HealthElement_1.HealthElement({
59
- id: (0, crypto_1.randomUUID)(),
60
- note: 'My secret note',
61
- tags: [
62
- new Code_1.Code({
63
- id: 'ICURE|MY-CODE|1',
64
- code: 'MY-CODE',
65
- type: 'ICURE',
66
- version: '1',
67
- }),
68
- ],
69
- }), { sfkOption: UseAnyConfidential, ignoreAutoDelegations: true }));
70
- });
71
- }
72
- function createBasicContact(contactApiForHcp, hcpUser, patient) {
73
- return contactApiForHcp.newInstance(hcpUser, patient, new Contact_1.Contact({
74
- id: (0, crypto_1.randomUUID)(),
75
- services: [
76
- contactApiForHcp.service().newInstance(hcpUser, new Service_1.Service({
77
- id: (0, crypto_1.randomUUID)(),
78
- valueDate: 20220203111034,
79
- content: { en: new Content_1.Content({ numberValue: 53.5 }) },
80
- tags: [
81
- new Code_1.Code({
82
- id: 'LOINC|29463-7|2',
83
- code: '29463-7',
84
- type: 'LOINC',
85
- version: '2',
86
- }),
87
- ],
88
- })),
89
- ],
90
- descr: 'Weight value',
91
- }), { sfkOption: UseAnyConfidential, ignoreAutoDelegations: true });
92
- }
93
- describe('icc-x-contact-api Tests', () => {
94
- it('CreateContactWithUser Success for HCP', () => __awaiter(void 0, void 0, void 0, function* () {
95
- // Given
96
- const { userApi: userApiForHcp, patientApi: patientApiForHcp, contactApi: contactApiForHcp, cryptoApi } = yield initApi(env, test_utils_1.hcp1Username);
97
- const hcpUser = yield userApiForHcp.getCurrentUser();
98
- const patient = yield createPatient(patientApiForHcp, hcpUser);
99
- const contactToCreate = yield createBasicContact(contactApiForHcp, hcpUser, patient);
100
- // When
101
- const createdContact = (yield contactApiForHcp.createContactWithUser(hcpUser, contactToCreate));
102
- // Then
103
- const readContact = yield contactApiForHcp.getContactWithUser(hcpUser, createdContact.id);
104
- (0, chai_1.expect)(readContact).to.not.be.undefined;
105
- (0, chai_1.expect)(readContact).to.not.be.null;
106
- (0, chai_1.expect)(readContact.openingDate).to.not.be.undefined;
107
- (0, chai_1.expect)(readContact.openingDate).to.not.be.null;
108
- (0, chai_1.expect)(readContact.groupId).to.not.be.undefined;
109
- (0, chai_1.expect)(readContact.groupId).to.not.be.null;
110
- (0, chai_1.expect)(readContact.responsible).to.be.equal(hcpUser.healthcarePartyId);
111
- (0, chai_1.expect)(readContact.id).to.be.equal(contactToCreate.id);
112
- (0, chai_1.expect)(readContact.descr).to.be.equal(contactToCreate.descr);
113
- (0, chai_1.expect)(readContact.services[0].responsible).to.be.equal(hcpUser.healthcarePartyId);
114
- (0, chai_1.expect)(readContact.services[0].id).to.be.equal(contactToCreate.services[0].id);
115
- (0, chai_1.expect)(readContact.services[0].valueDate).to.be.equal(contactToCreate.services[0].valueDate);
116
- (0, chai_1.expect)(readContact.services[0].tags[0].id).to.be.equal(contactToCreate.services[0].tags[0].id);
117
- (0, chai_1.expect)(yield cryptoApi.xapi.encryptionKeysOf({ entity: readContact, type: icc_x_api_1.EntityWithDelegationTypeName.Contact }, undefined)).to.have.length(1);
118
- const decryptedPatientIds = yield contactApiForHcp.decryptPatientIdOf(readContact);
119
- (0, chai_1.expect)(decryptedPatientIds).to.have.length(1);
120
- (0, chai_1.expect)(decryptedPatientIds[0]).to.equal(patient.id);
121
- }));
122
- it('Filter Services By HealthElementId - Success', () => __awaiter(void 0, void 0, void 0, function* () {
123
- // Given
124
- const { userApi: userApiForHcp, patientApi: patientApiForHcp, contactApi: contactApiForHcp, healthcareElementApi: hElementApiForHcp, } = yield initApi(env, test_utils_1.hcp1Username);
125
- const hcpUser = yield userApiForHcp.getCurrentUser();
126
- const patient = yield createPatient(patientApiForHcp, hcpUser);
127
- const healthElement = yield createHealthElement(hElementApiForHcp, hcpUser, patient);
128
- const contactToCreate = yield createBasicContact(contactApiForHcp, hcpUser, patient).then((contact) => {
129
- return Object.assign(Object.assign({}, contact), { subContacts: [
130
- new SubContact_1.SubContact({
131
- id: (0, crypto_1.randomUUID)(),
132
- healthElementId: healthElement.id,
133
- services: [new ServiceLink_1.ServiceLink({ serviceId: contact.services[0].id })],
134
- }),
135
- ] });
136
- });
137
- const createdContact = (yield contactApiForHcp.createContactWithUser(hcpUser, new Contact_1.Contact(contactToCreate)));
138
- (0, chai_1.assert)(createdContact != null);
139
- // When
140
- const foundServices = yield contactApiForHcp.filterServicesBy(undefined, undefined, new FilterChainService_1.FilterChainService({
141
- filter: new ServiceByHcPartyHealthElementIdsFilter_1.ServiceByHcPartyHealthElementIdsFilter({
142
- healthcarePartyId: hcpUser.healthcarePartyId,
143
- healthElementIds: [healthElement.id],
144
- }),
145
- }));
146
- // Then
147
- (0, chai_1.assert)(foundServices.rows.length == 1);
148
- (0, chai_1.assert)(foundServices.rows[0].id == createdContact.services[0].id);
149
- (0, chai_1.assert)(foundServices.rows[0].healthElementsIds.find((heId) => heId == healthElement.id) != undefined);
150
- }));
151
- it('contacts findBy for HCP GET and POSt', () => __awaiter(void 0, void 0, void 0, function* () {
152
- // Given
153
- const { userApi: userApiForHcp, dataOwnerApi: dataOwnerApiForHcp, patientApi: patientApiForHcp, contactApi: contactApiForHcp, healthcareElementApi: hElementApiForHcp, cryptoApi: cryptoApiForHcp, } = yield initApi(env, test_utils_1.hcp1Username);
154
- const hcpUser = yield userApiForHcp.getCurrentUser();
155
- const patient = (yield createPatient(patientApiForHcp, hcpUser));
156
- const healthElement = yield createHealthElement(hElementApiForHcp, hcpUser, patient);
157
- const contactToCreate = yield createBasicContact(contactApiForHcp, hcpUser, patient).then((contact) => {
158
- return Object.assign(Object.assign({}, contact), { subContacts: [
159
- new SubContact_1.SubContact({
160
- id: (0, crypto_1.randomUUID)(),
161
- healthElementId: healthElement.id,
162
- services: [new ServiceLink_1.ServiceLink({ serviceId: contact.services[0].id })],
163
- }),
164
- ] });
165
- });
166
- const createdContact = (yield contactApiForHcp.createContactWithUser(hcpUser, contactToCreate));
167
- // When
168
- const foundContats = yield contactApiForHcp.findBy(hcpUser.healthcarePartyId, patient, false);
169
- const foundContatsUsingPost = yield contactApiForHcp.findBy(hcpUser.healthcarePartyId, patient, true);
170
- // Then
171
- (0, chai_1.assert)(foundContats.length == 1, 'Found items should be 1');
172
- (0, chai_1.assert)(foundContats[0].id == contactToCreate.id, 'Found item should be the same as the created one');
173
- (0, chai_1.assert)(foundContatsUsingPost.length == 1, 'Found items using post should be 1');
174
- (0, chai_1.assert)(foundContatsUsingPost[0].id == createdContact.id, 'Found item using post should be the same as the created one');
175
- }));
176
- it('Share with should work as expected', () => __awaiter(void 0, void 0, void 0, function* () {
177
- const api1 = yield initApi(env, test_utils_1.hcp1Username);
178
- const user1 = yield api1.userApi.getCurrentUser();
179
- const api2 = yield initApi(env, test_utils_1.hcp2Username);
180
- const user2 = yield api2.userApi.getCurrentUser();
181
- const samplePatient = yield api1.patientApi.createPatientWithUser(user1, yield api1.patientApi.newInstance(user1, { firstName: 'Gigio', lastName: 'Bagigio' }));
182
- const encryptedField = 'Something encrypted';
183
- const entity = yield api1.calendarItemApi.createCalendarItemWithHcParty(user1, yield api1.calendarItemApi.newInstancePatient(user1, samplePatient, { details: encryptedField }));
184
- (0, chai_1.expect)(entity.details).to.be.equal(encryptedField);
185
- yield api2.calendarItemApi
186
- .getCalendarItemWithUser(user2, entity.id)
187
- .then(() => {
188
- throw new Error('Should not be able to get the entity');
189
- })
190
- .catch(() => {
191
- /* expected */
192
- });
193
- yield api1.calendarItemApi.shareWith(user2.healthcarePartyId, entity);
194
- const retrieved = yield api2.calendarItemApi.getCalendarItemWithUser(user2, entity.id);
195
- (0, chai_1.expect)(retrieved.details).to.be.equal(encryptedField);
196
- (0, chai_1.expect)((yield api2.calendarItemApi.decryptPatientIdOf(retrieved))[0]).to.equal(samplePatient.id);
197
- }));
198
- it('Instanciation of old Measure should be mapped to new Measure with referenceRanges', () => {
199
- const oldMeasure = {
200
- min: 0,
201
- max: 10,
202
- };
203
- const newMeasure = new Measure_1.Measure(Object.assign({}, oldMeasure));
204
- (0, chai_1.expect)(newMeasure.referenceRanges).to.not.be.undefined;
205
- (0, chai_1.expect)(newMeasure.referenceRanges).to.not.undefined;
206
- (0, chai_1.expect)(newMeasure.referenceRanges).to.have.length(1);
207
- (0, chai_1.expect)(newMeasure.referenceRanges[0].low).to.be.equal(oldMeasure.min);
208
- (0, chai_1.expect)(newMeasure.referenceRanges[0].high).to.be.equal(oldMeasure.max);
209
- (0, chai_1.expect)(Object.keys(newMeasure)).to.not.contain('min');
210
- (0, chai_1.expect)(Object.keys(newMeasure)).to.not.contain('max');
211
- });
212
- it('Instanciation of Service with old Measure should be mapped to new Measure with referenceRanges', () => {
213
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
214
- const serviceJson = {
215
- id: 'serviceId',
216
- valueDate: 20220203111034,
217
- content: {
218
- en: {
219
- numberValue: 53.5,
220
- measureValue: {
221
- min: 0,
222
- max: 10,
223
- },
224
- },
225
- },
226
- tags: [
227
- {
228
- id: 'LOINC|29463-7|2',
229
- code: '29463-7',
230
- type: 'LOINC',
231
- version: '2',
232
- },
233
- ],
234
- };
235
- const service = new Service_1.Service(JSON.parse(JSON.stringify(serviceJson)));
236
- (0, chai_1.expect)((_b = (_a = service.content) === null || _a === void 0 ? void 0 : _a.en) === null || _b === void 0 ? void 0 : _b.measureValue).to.not.be.undefined;
237
- (0, chai_1.expect)((_e = (_d = (_c = service.content) === null || _c === void 0 ? void 0 : _c.en) === null || _d === void 0 ? void 0 : _d.measureValue) === null || _e === void 0 ? void 0 : _e.referenceRanges).to.not.be.undefined;
238
- (0, chai_1.expect)((_h = (_g = (_f = service.content) === null || _f === void 0 ? void 0 : _f.en) === null || _g === void 0 ? void 0 : _g.measureValue) === null || _h === void 0 ? void 0 : _h.referenceRanges).to.have.length(1);
239
- (0, chai_1.expect)((_l = (_k = (_j = service.content) === null || _j === void 0 ? void 0 : _j.en) === null || _k === void 0 ? void 0 : _k.measureValue) === null || _l === void 0 ? void 0 : _l.referenceRanges[0].low).to.be.equal(serviceJson.content.en.measureValue.min);
240
- (0, chai_1.expect)((_p = (_o = (_m = service.content) === null || _m === void 0 ? void 0 : _m.en) === null || _o === void 0 ? void 0 : _o.measureValue) === null || _p === void 0 ? void 0 : _p.referenceRanges[0].high).to.be.equal(serviceJson.content.en.measureValue.max);
241
- (0, chai_1.expect)(Object.keys((_r = (_q = service.content) === null || _q === void 0 ? void 0 : _q.en) === null || _r === void 0 ? void 0 : _r.measureValue)).to.not.contain('min');
242
- (0, chai_1.expect)(Object.keys((_t = (_s = service.content) === null || _s === void 0 ? void 0 : _s.en) === null || _t === void 0 ? void 0 : _t.measureValue)).to.not.contain('max');
243
- });
244
- it('Instanciation of Contact with old Measure should be mapped to new Measure with referenceRanges', () => {
245
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
246
- const contactJson = {
247
- id: 'contactId',
248
- services: [
249
- {
250
- id: 'serviceId',
251
- valueDate: 20220203111034,
252
- content: {
253
- en: {
254
- numberValue: 53.5,
255
- measureValue: {
256
- min: 0,
257
- max: 10,
258
- },
259
- },
260
- },
261
- tags: [
262
- {
263
- id: 'LOINC|29463-7|2',
264
- code: '29463-7',
265
- type: 'LOINC',
266
- version: '2',
267
- },
268
- ],
269
- },
270
- ],
271
- descr: 'Weight value',
272
- };
273
- const contact = new Contact_1.Contact(JSON.parse(JSON.stringify(contactJson)));
274
- (0, chai_1.expect)(contact.services).to.not.be.undefined;
275
- (0, chai_1.expect)(contact.services).to.have.length(1);
276
- (0, chai_1.expect)((_b = (_a = contact.services[0].content) === null || _a === void 0 ? void 0 : _a.en) === null || _b === void 0 ? void 0 : _b.measureValue).to.not.be.undefined;
277
- (0, chai_1.expect)((_e = (_d = (_c = contact.services[0].content) === null || _c === void 0 ? void 0 : _c.en) === null || _d === void 0 ? void 0 : _d.measureValue) === null || _e === void 0 ? void 0 : _e.referenceRanges).to.not.be.undefined;
278
- (0, chai_1.expect)((_h = (_g = (_f = contact.services[0].content) === null || _f === void 0 ? void 0 : _f.en) === null || _g === void 0 ? void 0 : _g.measureValue) === null || _h === void 0 ? void 0 : _h.referenceRanges).to.have.length(1);
279
- (0, chai_1.expect)((_l = (_k = (_j = contact.services[0].content) === null || _j === void 0 ? void 0 : _j.en) === null || _k === void 0 ? void 0 : _k.measureValue) === null || _l === void 0 ? void 0 : _l.referenceRanges[0].low).to.be.equal(contactJson.services[0].content.en.measureValue.min);
280
- (0, chai_1.expect)((_p = (_o = (_m = contact.services[0].content) === null || _m === void 0 ? void 0 : _m.en) === null || _o === void 0 ? void 0 : _o.measureValue) === null || _p === void 0 ? void 0 : _p.referenceRanges[0].high).to.be.equal(contactJson.services[0].content.en.measureValue.max);
281
- (0, chai_1.expect)(Object.keys((_r = (_q = contact.services[0].content) === null || _q === void 0 ? void 0 : _q.en) === null || _r === void 0 ? void 0 : _r.measureValue)).to.not.contain('min');
282
- (0, chai_1.expect)(Object.keys((_t = (_s = contact.services[0].content) === null || _s === void 0 ? void 0 : _s.en) === null || _t === void 0 ? void 0 : _t.measureValue)).to.not.contain('max');
283
- });
284
- it('Service filters by prefix should work', () => __awaiter(void 0, void 0, void 0, function* () {
285
- const codeType = `DEMO-${(0, crypto_1.randomUUID)()}`;
286
- const codeStub = {
287
- id: `${codeType}|PREFIXED|1`,
288
- code: 'PREFIXED',
289
- type: codeType,
290
- version: '1',
291
- };
292
- const serviceByTagMonth = {
293
- id: (0, crypto_1.randomUUID)(),
294
- valueDate: 20250101123000,
295
- tags: [codeStub],
296
- };
297
- const serviceByCodeMonth = {
298
- id: (0, crypto_1.randomUUID)(),
299
- valueDate: 20250101123000,
300
- codes: [codeStub],
301
- };
302
- const serviceByTagPatient = {
303
- id: (0, crypto_1.randomUUID)(),
304
- valueDate: 20250201123000,
305
- tags: [codeStub],
306
- };
307
- const serviceByCodePatient = {
308
- id: (0, crypto_1.randomUUID)(),
309
- valueDate: 20250201123000,
310
- codes: [codeStub],
311
- };
312
- const api = yield initApi(env);
313
- const user = yield api.userApi.getCurrentUser();
314
- const patient1 = yield createPatient(api.patientApi, user);
315
- const patient2 = yield createPatient(api.patientApi, user);
316
- yield api.contactApi.createContactsWithUser(user, [
317
- yield api.contactApi.newInstance(user, patient1, {
318
- id: (0, crypto_1.randomUUID)(),
319
- services: [serviceByCodeMonth, serviceByTagMonth],
320
- }),
321
- yield api.contactApi.newInstance(user, patient2, {
322
- id: (0, crypto_1.randomUUID)(),
323
- services: [serviceByCodePatient, serviceByTagPatient],
324
- }),
325
- ]);
326
- (0, chai_1.expect)(yield api.contactApi.matchServicesBy(new ServiceByHcPartyMonthTagPrefixFilter_1.ServiceByHcPartyMonthTagPrefixFilter({
327
- healthcarePartyId: user.healthcarePartyId,
328
- year: 2025,
329
- month: 1,
330
- tagType: codeType,
331
- tagCodePrefix: 'PREFIX',
332
- }))).to.have.members([serviceByTagMonth.id]);
333
- (0, chai_1.expect)(yield api.contactApi.matchServicesBy(new ServiceByHcPartyMonthCodePrefixFilter_1.ServiceByHcPartyMonthCodePrefixFilter({
334
- healthcarePartyId: user.healthcarePartyId,
335
- year: 2025,
336
- month: 1,
337
- codeType: codeType,
338
- codeCodePrefix: 'PREFIX',
339
- }))).to.have.members([serviceByCodeMonth.id]);
340
- const patientSfks = yield api.patientApi.decryptSecretIdsOf(patient2);
341
- (0, chai_1.expect)(yield api.contactApi.matchServicesBy(new ServiceByHcPartyPatientTagPrefixFilter_1.ServiceByHcPartyPatientTagPrefixFilter({
342
- healthcarePartyId: user.healthcarePartyId,
343
- patientSecretForeignKeys: patientSfks,
344
- tagType: codeType,
345
- tagCodePrefix: 'PREFIX',
346
- }))).to.have.members([serviceByTagPatient.id]);
347
- (0, chai_1.expect)(yield api.contactApi.matchServicesBy(new ServiceByHcPartyPatientCodePrefixFilter_1.ServiceByHcPartyPatientCodePrefixFilter({
348
- healthcarePartyId: user.healthcarePartyId,
349
- patientSecretForeignKeys: patientSfks,
350
- codeType: codeType,
351
- codeCodePrefix: 'PREFIX',
352
- }))).to.have.members([serviceByCodePatient.id]);
353
- }));
354
- });
355
- //# sourceMappingURL=icc-contact-x-api.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"icc-contact-x-api.js","sourceRoot":"","sources":["../../../test/icc-x-api/icc-contact-x-api.ts"],"names":[],"mappings":";;;;;;;;;;;AAA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AAC,CAAA;QAC3C,IAAA,aAAM,EACJ,MAAM,GAAG,CAAC,UAAU,CAAC,eAAe,CAClC,IAAI,iFAAuC,CAAC;YAC1C,iBAAiB,EAAE,IAAI,CAAC,iBAAkB;YAC1C,wBAAwB,EAAE,WAAW;YACrC,QAAQ,EAAE,QAAQ;YAClB,cAAc,EAAE,QAAQ;SACzB,CAAC,CACH,CACF,CAAC,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,oBAAoB,CAAC,EAAE,CAAC,CAAC,CAAA;IAC9C,CAAC,CAAA,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA","sourcesContent":["import { before } from 'mocha'\n\nimport 'isomorphic-fetch'\n\nimport { EntityWithDelegationTypeName, IccContactXApi, IccHelementXApi, IccPatientXApi } from '../../icc-x-api'\nimport { Patient } from '../../icc-api/model/Patient'\nimport { assert, expect } from 'chai'\nimport { randomUUID } from 'crypto'\nimport { getEnvironmentInitializer, hcp1Username, hcp2Username, setLocalStorage, TestUtils } from '../utils/test_utils'\nimport { Code } from '../../icc-api/model/Code'\nimport { Contact } from '../../icc-api/model/Contact'\nimport { Service } from '../../icc-api/model/Service'\nimport { Content } from '../../icc-api/model/Content'\nimport { User } from '../../icc-api/model/User'\nimport { HealthElement } from '../../icc-api/model/HealthElement'\nimport { SubContact } from '../../icc-api/model/SubContact'\nimport { ServiceLink } from '../../icc-api/model/ServiceLink'\nimport { FilterChainService } from '../../icc-api/model/FilterChainService'\nimport { ServiceByHcPartyHealthElementIdsFilter } from '../../icc-x-api/filters/ServiceByHcPartyHealthElementIdsFilter'\nimport { getEnvVariables, TestVars } from '@icure/test-setup/types'\nimport { Measure } from '../../icc-api/model/Measure'\nimport initApi = TestUtils.initApi\nimport { SecretIdUseOption } from '../../icc-x-api/crypto/SecretIdUseOption'\nimport UseAnyConfidential = SecretIdUseOption.UseAnyConfidential\nimport { random } from 'lodash'\nimport { ServiceByHcPartyMonthTagPrefixFilter } from '../../icc-x-api/filters/ServiceByHcPartyMonthTagPrefixFilter'\nimport { ServiceByHcPartyMonthCodePrefixFilter } from '../../icc-x-api/filters/ServiceByHcPartyMonthCodePrefixFilter'\nimport { ServiceByHcPartyPatientCodePrefixFilter } from '../../icc-x-api/filters/ServiceByHcPartyPatientCodePrefixFilter'\nimport { ServiceByHcPartyPatientTagPrefixFilter } from '../../icc-x-api/filters/ServiceByHcPartyPatientTagPrefixFilter'\n\nsetLocalStorage(fetch)\nlet env: TestVars\n\nbefore(async function () {\n this.timeout(600000)\n const initializer = await getEnvironmentInitializer()\n env = await initializer.execute(getEnvVariables())\n})\n\nasync function createPatient(patientApiForHcp: IccPatientXApi, hcpUser: User): Promise<Patient> {\n return patientApiForHcp.createPatientWithUser(\n hcpUser,\n await patientApiForHcp.newInstance(\n hcpUser,\n new Patient({\n id: randomUUID(),\n firstName: 'John',\n lastName: 'Snow',\n note: 'Winter is coming',\n })\n )\n )\n}\n\nasync function createHealthElement(healthElementApi: IccHelementXApi, hcpUser: User, patient: Patient) {\n return healthElementApi.createHealthElementWithUser(\n hcpUser,\n await healthElementApi.newInstance(\n hcpUser,\n patient,\n new HealthElement({\n id: randomUUID(),\n note: 'My secret note',\n tags: [\n new Code({\n id: 'ICURE|MY-CODE|1',\n code: 'MY-CODE',\n type: 'ICURE',\n version: '1',\n }),\n ],\n }),\n { sfkOption: UseAnyConfidential, ignoreAutoDelegations: true }\n )\n )\n}\n\nfunction createBasicContact(contactApiForHcp: IccContactXApi, hcpUser: User, patient: Patient) {\n return contactApiForHcp.newInstance(\n hcpUser,\n patient,\n new Contact({\n id: randomUUID(),\n services: [\n contactApiForHcp.service().newInstance(\n hcpUser,\n new Service({\n id: randomUUID(),\n valueDate: 20220203111034,\n content: { en: new Content({ numberValue: 53.5 }) },\n tags: [\n new Code({\n id: 'LOINC|29463-7|2',\n code: '29463-7',\n type: 'LOINC',\n version: '2',\n }),\n ],\n })\n ),\n ],\n descr: 'Weight value',\n }),\n { sfkOption: UseAnyConfidential, ignoreAutoDelegations: true }\n )\n}\n\ndescribe('icc-x-contact-api Tests', () => {\n it('CreateContactWithUser Success for HCP', async () => {\n // Given\n const { userApi: userApiForHcp, patientApi: patientApiForHcp, contactApi: contactApiForHcp, cryptoApi } = await initApi(env!, hcp1Username)\n\n const hcpUser = await userApiForHcp.getCurrentUser()\n\n const patient = await createPatient(patientApiForHcp, hcpUser)\n const contactToCreate = await createBasicContact(contactApiForHcp, hcpUser, patient)\n\n // When\n const createdContact = (await contactApiForHcp.createContactWithUser(hcpUser, contactToCreate)) as Contact\n\n // Then\n const readContact = await contactApiForHcp.getContactWithUser(hcpUser, createdContact.id!)\n expect(readContact).to.not.be.undefined\n expect(readContact).to.not.be.null\n expect(readContact.openingDate).to.not.be.undefined\n expect(readContact.openingDate).to.not.be.null\n expect(readContact.groupId).to.not.be.undefined\n expect(readContact.groupId).to.not.be.null\n expect(readContact.responsible).to.be.equal(hcpUser.healthcarePartyId)\n expect(readContact.id).to.be.equal(contactToCreate.id)\n expect(readContact.descr).to.be.equal(contactToCreate.descr)\n expect(readContact.services![0].responsible).to.be.equal(hcpUser.healthcarePartyId)\n expect(readContact.services![0].id).to.be.equal(contactToCreate.services![0].id)\n expect(readContact.services![0].valueDate).to.be.equal(contactToCreate.services![0].valueDate)\n expect(readContact.services![0].tags![0].id).to.be.equal(contactToCreate.services![0].tags![0].id!)\n expect(await cryptoApi.xapi.encryptionKeysOf({ entity: readContact, type: EntityWithDelegationTypeName.Contact }, undefined)).to.have.length(1)\n const decryptedPatientIds = await contactApiForHcp.decryptPatientIdOf(readContact)\n expect(decryptedPatientIds).to.have.length(1)\n expect(decryptedPatientIds[0]).to.equal(patient.id)\n })\n\n it('Filter Services By HealthElementId - Success', async () => {\n // Given\n const {\n userApi: userApiForHcp,\n patientApi: patientApiForHcp,\n contactApi: contactApiForHcp,\n healthcareElementApi: hElementApiForHcp,\n } = await initApi(env!, hcp1Username)\n\n const hcpUser = await userApiForHcp.getCurrentUser()\n\n const patient = await createPatient(patientApiForHcp, hcpUser)\n const healthElement = await createHealthElement(hElementApiForHcp, hcpUser, patient)\n const contactToCreate = await createBasicContact(contactApiForHcp, hcpUser, patient).then((contact) => {\n return {\n ...contact,\n subContacts: [\n new SubContact({\n id: randomUUID(),\n healthElementId: healthElement!.id!,\n services: [new ServiceLink({ serviceId: contact.services![0].id })],\n }),\n ],\n }\n })\n\n const createdContact = (await contactApiForHcp.createContactWithUser(hcpUser, new Contact(contactToCreate))) as Contact\n assert(createdContact != null)\n\n // When\n const foundServices = await contactApiForHcp.filterServicesBy(\n undefined,\n undefined,\n new FilterChainService({\n filter: new ServiceByHcPartyHealthElementIdsFilter({\n healthcarePartyId: hcpUser.healthcarePartyId!,\n healthElementIds: [healthElement!.id!],\n }),\n })\n )\n\n // Then\n assert(foundServices.rows!.length == 1)\n assert(foundServices.rows![0].id == createdContact.services![0].id)\n assert(foundServices.rows![0].healthElementsIds!.find((heId) => heId == healthElement!.id!) != undefined)\n })\n\n it('contacts findBy for HCP GET and POSt', async () => {\n // Given\n const {\n userApi: userApiForHcp,\n dataOwnerApi: dataOwnerApiForHcp,\n patientApi: patientApiForHcp,\n contactApi: contactApiForHcp,\n healthcareElementApi: hElementApiForHcp,\n cryptoApi: cryptoApiForHcp,\n } = await initApi(env, hcp1Username)\n const hcpUser = await userApiForHcp.getCurrentUser()\n\n const patient = (await createPatient(patientApiForHcp, hcpUser)) as Patient\n const healthElement = await createHealthElement(hElementApiForHcp, hcpUser, patient)\n const contactToCreate = await createBasicContact(contactApiForHcp, hcpUser, patient).then((contact) => {\n return {\n ...contact,\n subContacts: [\n new SubContact({\n id: randomUUID(),\n healthElementId: healthElement!.id!,\n services: [new ServiceLink({ serviceId: contact.services![0].id })],\n }),\n ],\n }\n })\n\n const createdContact = (await contactApiForHcp.createContactWithUser(hcpUser, contactToCreate)) as Contact\n\n // When\n const foundContats = await contactApiForHcp.findBy(hcpUser.healthcarePartyId!, patient, false)\n const foundContatsUsingPost = await contactApiForHcp.findBy(hcpUser.healthcarePartyId!, patient, true)\n\n // Then\n assert(foundContats.length == 1, 'Found items should be 1')\n assert(foundContats[0].id == contactToCreate.id, 'Found item should be the same as the created one')\n\n assert(foundContatsUsingPost.length == 1, 'Found items using post should be 1')\n assert(foundContatsUsingPost[0].id == createdContact.id, 'Found item using post should be the same as the created one')\n })\n\n it('Share with should work as expected', async () => {\n const api1 = await initApi(env!, hcp1Username)\n const user1 = await api1.userApi.getCurrentUser()\n const api2 = await initApi(env!, hcp2Username)\n const user2 = await api2.userApi.getCurrentUser()\n const samplePatient = await api1.patientApi.createPatientWithUser(\n user1,\n await api1.patientApi.newInstance(user1, { firstName: 'Gigio', lastName: 'Bagigio' })\n )\n const encryptedField = 'Something encrypted'\n const entity = await api1.calendarItemApi.createCalendarItemWithHcParty(\n user1,\n await api1.calendarItemApi.newInstancePatient(user1, samplePatient, { details: encryptedField })\n )\n expect(entity.details).to.be.equal(encryptedField)\n await api2.calendarItemApi\n .getCalendarItemWithUser(user2, entity.id)\n .then(() => {\n throw new Error('Should not be able to get the entity')\n })\n .catch(() => {\n /* expected */\n })\n await api1.calendarItemApi.shareWith(user2.healthcarePartyId!, entity)\n const retrieved = await api2.calendarItemApi.getCalendarItemWithUser(user2, entity.id)\n expect(retrieved.details).to.be.equal(encryptedField)\n expect((await api2.calendarItemApi.decryptPatientIdOf(retrieved))[0]).to.equal(samplePatient.id)\n })\n\n it('Instanciation of old Measure should be mapped to new Measure with referenceRanges', () => {\n const oldMeasure = {\n min: 0,\n max: 10,\n }\n\n const newMeasure = new Measure({ ...oldMeasure })\n\n expect(newMeasure.referenceRanges).to.not.be.undefined\n expect(newMeasure.referenceRanges).to.not.undefined\n expect(newMeasure.referenceRanges).to.have.length(1)\n expect(newMeasure.referenceRanges![0].low).to.be.equal(oldMeasure.min)\n expect(newMeasure.referenceRanges![0].high).to.be.equal(oldMeasure.max)\n\n expect(Object.keys(newMeasure)).to.not.contain('min')\n expect(Object.keys(newMeasure)).to.not.contain('max')\n })\n\n it('Instanciation of Service with old Measure should be mapped to new Measure with referenceRanges', () => {\n const serviceJson = {\n id: 'serviceId',\n valueDate: 20220203111034,\n content: {\n en: {\n numberValue: 53.5,\n measureValue: {\n min: 0,\n max: 10,\n },\n },\n },\n tags: [\n {\n id: 'LOINC|29463-7|2',\n code: '29463-7',\n type: 'LOINC',\n version: '2',\n },\n ],\n }\n\n const service = new Service(JSON.parse(JSON.stringify(serviceJson)))\n\n expect(service.content?.en?.measureValue).to.not.be.undefined\n expect(service.content?.en?.measureValue?.referenceRanges).to.not.be.undefined\n expect(service.content?.en?.measureValue?.referenceRanges).to.have.length(1)\n expect(service.content?.en?.measureValue?.referenceRanges![0].low).to.be.equal(serviceJson.content.en.measureValue.min)\n expect(service.content?.en?.measureValue?.referenceRanges![0].high).to.be.equal(serviceJson.content.en.measureValue.max)\n\n expect(Object.keys(service.content?.en?.measureValue!)).to.not.contain('min')\n expect(Object.keys(service.content?.en?.measureValue!)).to.not.contain('max')\n })\n\n it('Instanciation of Contact with old Measure should be mapped to new Measure with referenceRanges', () => {\n const contactJson = {\n id: 'contactId',\n services: [\n {\n id: 'serviceId',\n valueDate: 20220203111034,\n content: {\n en: {\n numberValue: 53.5,\n measureValue: {\n min: 0,\n max: 10,\n },\n },\n },\n tags: [\n {\n id: 'LOINC|29463-7|2',\n code: '29463-7',\n type: 'LOINC',\n version: '2',\n },\n ],\n },\n ],\n descr: 'Weight value',\n }\n\n const contact = new Contact(JSON.parse(JSON.stringify(contactJson)))\n\n expect(contact.services).to.not.be.undefined\n expect(contact.services).to.have.length(1)\n expect(contact.services![0].content?.en?.measureValue).to.not.be.undefined\n expect(contact.services![0].content?.en?.measureValue?.referenceRanges).to.not.be.undefined\n expect(contact.services![0].content?.en?.measureValue?.referenceRanges).to.have.length(1)\n expect(contact.services![0].content?.en?.measureValue?.referenceRanges![0].low).to.be.equal(contactJson.services[0].content.en.measureValue.min)\n expect(contact.services![0].content?.en?.measureValue?.referenceRanges![0].high).to.be.equal(contactJson.services[0].content.en.measureValue.max)\n\n expect(Object.keys(contact.services![0].content?.en?.measureValue!)).to.not.contain('min')\n expect(Object.keys(contact.services![0].content?.en?.measureValue!)).to.not.contain('max')\n })\n\n it('Service filters by prefix should work', async () => {\n const codeType = `DEMO-${randomUUID()}`\n const codeStub = {\n id: `${codeType}|PREFIXED|1`,\n code: 'PREFIXED',\n type: codeType,\n version: '1',\n }\n const serviceByTagMonth = {\n id: randomUUID(),\n valueDate: 20250101123000,\n tags: [codeStub],\n }\n const serviceByCodeMonth = {\n id: randomUUID(),\n valueDate: 20250101123000,\n codes: [codeStub],\n }\n const serviceByTagPatient = {\n id: randomUUID(),\n valueDate: 20250201123000,\n tags: [codeStub],\n }\n const serviceByCodePatient = {\n id: randomUUID(),\n valueDate: 20250201123000,\n codes: [codeStub],\n }\n const api = await initApi(env)\n const user = await api.userApi.getCurrentUser()\n const patient1 = await createPatient(api.patientApi, user)\n const patient2 = await createPatient(api.patientApi, user)\n await api.contactApi.createContactsWithUser(user, [\n await api.contactApi.newInstance(user, patient1, {\n id: randomUUID(),\n services: [serviceByCodeMonth, serviceByTagMonth],\n }),\n await api.contactApi.newInstance(user, patient2, {\n id: randomUUID(),\n services: [serviceByCodePatient, serviceByTagPatient],\n }),\n ])\n expect(\n await api.contactApi.matchServicesBy(\n new ServiceByHcPartyMonthTagPrefixFilter({\n healthcarePartyId: user.healthcarePartyId!,\n year: 2025,\n month: 1,\n tagType: codeType,\n tagCodePrefix: 'PREFIX',\n })\n )\n ).to.have.members([serviceByTagMonth.id])\n expect(\n await api.contactApi.matchServicesBy(\n new ServiceByHcPartyMonthCodePrefixFilter({\n healthcarePartyId: user.healthcarePartyId!,\n year: 2025,\n month: 1,\n codeType: codeType,\n codeCodePrefix: 'PREFIX',\n })\n )\n ).to.have.members([serviceByCodeMonth.id])\n const patientSfks = await api.patientApi.decryptSecretIdsOf(patient2)\n expect(\n await api.contactApi.matchServicesBy(\n new ServiceByHcPartyPatientTagPrefixFilter({\n healthcarePartyId: user.healthcarePartyId!,\n patientSecretForeignKeys: patientSfks,\n tagType: codeType,\n tagCodePrefix: 'PREFIX',\n })\n )\n ).to.have.members([serviceByTagPatient.id])\n expect(\n await api.contactApi.matchServicesBy(\n new ServiceByHcPartyPatientCodePrefixFilter({\n healthcarePartyId: user.healthcarePartyId!,\n patientSecretForeignKeys: patientSfks,\n codeType: codeType,\n codeCodePrefix: 'PREFIX',\n })\n )\n ).to.have.members([serviceByCodePatient.id])\n })\n})\n"]}
@@ -1 +0,0 @@
1
- import 'isomorphic-fetch';
@@ -1,76 +0,0 @@
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
- const mocha_1 = require("mocha");
13
- require("isomorphic-fetch");
14
- const icc_x_api_1 = require("../../icc-x-api");
15
- const chai_1 = require("chai");
16
- const crypto_1 = require("crypto");
17
- const test_utils_1 = require("../utils/test_utils");
18
- const types_1 = require("@icure/test-setup/types");
19
- var initApi = test_utils_1.TestUtils.initApi;
20
- const icc_api_1 = require("../../icc-api");
21
- (0, test_utils_1.setLocalStorage)(fetch);
22
- let env;
23
- (0, mocha_1.before)(function () {
24
- return __awaiter(this, void 0, void 0, function* () {
25
- this.timeout(600000);
26
- const initializer = yield (0, test_utils_1.getEnvironmentInitializer)();
27
- env = yield initializer.execute((0, types_1.getEnvVariables)());
28
- });
29
- });
30
- describe('icc-x-document-api Tests', () => {
31
- (0, mocha_1.it)('Get and decrypt as json should work', () => __awaiter(void 0, void 0, void 0, function* () {
32
- // Given
33
- const { documentApi, userApi } = yield initApi(env, test_utils_1.hcp1Username);
34
- const currUser = yield userApi.getCurrentUser();
35
- const document = yield documentApi.createDocumentWithUser(undefined, yield documentApi.newInstance(currUser, undefined, {}));
36
- const obj = { test: 'test' };
37
- yield documentApi.encryptAndSetDocumentAttachment(document, (0, icc_x_api_1.utf8_2ua)(JSON.stringify(obj)));
38
- const decrypted = yield documentApi.getAndTryDecryptMainAttachmentAs(document, 'application/json');
39
- (0, chai_1.expect)(decrypted).to.deep.equal(obj);
40
- }));
41
- (0, mocha_1.it)('Get and decrypt as string should work', () => __awaiter(void 0, void 0, void 0, function* () {
42
- // Given
43
- const { documentApi, userApi } = yield initApi(env, test_utils_1.hcp1Username);
44
- const currUser = yield userApi.getCurrentUser();
45
- const document = yield documentApi.createDocumentWithUser(undefined, yield documentApi.newInstance(currUser, undefined, {}));
46
- const obj = 'Test';
47
- yield documentApi.encryptAndSetDocumentAttachment(document, (0, icc_x_api_1.utf8_2ua)(obj));
48
- const decrypted = yield documentApi.getAndTryDecryptMainAttachmentAs(document, 'text/plain');
49
- (0, chai_1.expect)(decrypted).to.deep.equal(obj);
50
- const decryptedAsJson = yield documentApi.getAndTryDecryptMainAttachmentAs(document, 'application/json');
51
- (0, chai_1.expect)(decryptedAsJson).to.be.undefined;
52
- }));
53
- (0, mocha_1.it)('Should be encrypted', () => __awaiter(void 0, void 0, void 0, function* () {
54
- const hcp = yield (0, test_utils_1.createNewHcpApi)(env, {
55
- encryptedFieldsConfig: {
56
- document: ['name'],
57
- },
58
- });
59
- const name = 'Private.txt';
60
- const externalUuid = (0, crypto_1.randomUUID)();
61
- const created = yield hcp.api.documentApi.createDocumentWithUser(undefined, yield hcp.api.documentApi.newInstance(hcp.user, undefined, {
62
- id: (0, crypto_1.randomUUID)(),
63
- name,
64
- externalUuid,
65
- }));
66
- (0, chai_1.expect)(created.name).to.eq(name);
67
- (0, chai_1.expect)(created.externalUuid).to.eq(externalUuid);
68
- const retrieved = yield hcp.api.documentApi.getDocumentWithUser(undefined, created.id);
69
- (0, chai_1.expect)(retrieved.name).to.eq(name);
70
- (0, chai_1.expect)(retrieved.externalUuid).to.eq(externalUuid);
71
- const encrypted = yield new icc_api_1.IccDocumentApi(env.iCureUrl, {}, hcp.api.authApi.authenticationProvider, fetch).getDocument(created.id);
72
- (0, chai_1.expect)(encrypted.name).to.be.undefined;
73
- (0, chai_1.expect)(encrypted.externalUuid).to.eq(externalUuid);
74
- }));
75
- });
76
- //# sourceMappingURL=icc-document-x-api.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"icc-document-x-api.js","sourceRoot":"","sources":["../../../test/icc-x-api/icc-document-x-api.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,iCAAkC;AAElC,4BAAyB;AAEzB,+CAAyH;AAEzH,+BAAqC;AACrC,mCAAmC;AACnC,oDAAwI;AAWxI,mDAAmE;AAEnE,IAAO,OAAO,GAAG,sBAAS,CAAC,OAAO,CAAA;AAClC,2CAA6D;AAE7D,IAAA,4BAAe,EAAC,KAAK,CAAC,CAAA;AACtB,IAAI,GAAa,CAAA;AAEjB,IAAA,cAAM,EAAC;;QACL,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;QACpB,MAAM,WAAW,GAAG,MAAM,IAAA,sCAAyB,GAAE,CAAA;QACrD,GAAG,GAAG,MAAM,WAAW,CAAC,OAAO,CAAC,IAAA,uBAAe,GAAE,CAAC,CAAA;IACpD,CAAC;CAAA,CAAC,CAAA;AAEF,QAAQ,CAAC,0BAA0B,EAAE,GAAG,EAAE;IACxC,IAAA,UAAE,EAAC,qCAAqC,EAAE,GAAS,EAAE;QACnD,QAAQ;QACR,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,GAAG,MAAM,OAAO,CAAC,GAAI,EAAE,yBAAY,CAAC,CAAA;QAElE,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,cAAc,EAAE,CAAA;QAC/C,MAAM,QAAQ,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Y,CAAC,CAAA;QAClD,MAAM,SAAS,GAAG,MAAM,IAAI,wBAAc,CAAC,GAAG,CAAC,QAAQ,EAAE,EAAE,EAAE,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,sBAAsB,EAAE,KAAK,CAAC,CAAC,WAAW,CAAC,OAAO,CAAC,EAAG,CAAC,CAAA;QACpI,IAAA,aAAM,EAAC,SAAS,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,SAAS,CAAA;QACtC,IAAA,aAAM,EAAC,SAAS,CAAC,YAAY,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,YAAY,CAAC,CAAA;IACpD,CAAC,CAAA,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA","sourcesContent":["import { before, it } from 'mocha'\n\nimport 'isomorphic-fetch'\n\nimport { EntityWithDelegationTypeName, IccContactXApi, IccHelementXApi, IccPatientXApi, utf8_2ua } from '../../icc-x-api'\nimport { Patient } from '../../icc-api/model/Patient'\nimport { assert, expect } from 'chai'\nimport { randomUUID } from 'crypto'\nimport { createNewHcpApi, getEnvironmentInitializer, hcp1Username, hcp2Username, setLocalStorage, TestUtils } from '../utils/test_utils'\nimport { Code } from '../../icc-api/model/Code'\nimport { Contact } from '../../icc-api/model/Contact'\nimport { Service } from '../../icc-api/model/Service'\nimport { Content } from '../../icc-api/model/Content'\nimport { User } from '../../icc-api/model/User'\nimport { HealthElement } from '../../icc-api/model/HealthElement'\nimport { SubContact } from '../../icc-api/model/SubContact'\nimport { ServiceLink } from '../../icc-api/model/ServiceLink'\nimport { FilterChainService } from '../../icc-api/model/FilterChainService'\nimport { ServiceByHcPartyHealthElementIdsFilter } from '../../icc-x-api/filters/ServiceByHcPartyHealthElementIdsFilter'\nimport { getEnvVariables, TestVars } from '@icure/test-setup/types'\nimport { Measure } from '../../icc-api/model/Measure'\nimport initApi = TestUtils.initApi\nimport { IccDocumentApi, IccMessageApi } from '../../icc-api'\n\nsetLocalStorage(fetch)\nlet env: TestVars\n\nbefore(async function () {\n this.timeout(600000)\n const initializer = await getEnvironmentInitializer()\n env = await initializer.execute(getEnvVariables())\n})\n\ndescribe('icc-x-document-api Tests', () => {\n it('Get and decrypt as json should work', async () => {\n // Given\n const { documentApi, userApi } = await initApi(env!, hcp1Username)\n\n const currUser = await userApi.getCurrentUser()\n const document = await documentApi.createDocumentWithUser(undefined, await documentApi.newInstance(currUser, undefined, {}))\n const obj = { test: 'test' }\n await documentApi.encryptAndSetDocumentAttachment(document, utf8_2ua(JSON.stringify(obj)))\n const decrypted = await documentApi.getAndTryDecryptMainAttachmentAs(document, 'application/json')\n expect(decrypted).to.deep.equal(obj)\n })\n\n it('Get and decrypt as string should work', async () => {\n // Given\n const { documentApi, userApi } = await initApi(env!, hcp1Username)\n\n const currUser = await userApi.getCurrentUser()\n const document = await documentApi.createDocumentWithUser(undefined, await documentApi.newInstance(currUser, undefined, {}))\n const obj = 'Test'\n await documentApi.encryptAndSetDocumentAttachment(document, utf8_2ua(obj))\n const decrypted = await documentApi.getAndTryDecryptMainAttachmentAs(document, 'text/plain')\n expect(decrypted).to.deep.equal(obj)\n const decryptedAsJson = await documentApi.getAndTryDecryptMainAttachmentAs(document, 'application/json')\n expect(decryptedAsJson).to.be.undefined\n })\n\n it('Should be encrypted', async () => {\n const hcp = await createNewHcpApi(env, {\n encryptedFieldsConfig: {\n document: ['name'],\n },\n })\n const name = 'Private.txt'\n const externalUuid = randomUUID()\n const created = await hcp.api.documentApi.createDocumentWithUser(\n undefined,\n await hcp.api.documentApi.newInstance(hcp.user, undefined, {\n id: randomUUID(),\n name,\n externalUuid,\n })\n )\n expect(created.name).to.eq(name)\n expect(created.externalUuid).to.eq(externalUuid)\n const retrieved = await hcp.api.documentApi.getDocumentWithUser(undefined, created.id!)\n expect(retrieved.name).to.eq(name)\n expect(retrieved.externalUuid).to.eq(externalUuid)\n const encrypted = await new IccDocumentApi(env.iCureUrl, {}, hcp.api.authApi.authenticationProvider, fetch).getDocument(created.id!)\n expect(encrypted.name).to.be.undefined\n expect(encrypted.externalUuid).to.eq(externalUuid)\n })\n})\n"]}
@@ -1 +0,0 @@
1
- import 'isomorphic-fetch';