@icure/api 7.1.14 → 8.0.0-RC.1

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 (322) hide show
  1. package/icc-api/api/IccAccesslogApi.d.ts +12 -1
  2. package/icc-api/api/IccAccesslogApi.js +142 -98
  3. package/icc-api/api/IccAccesslogApi.js.map +1 -1
  4. package/icc-api/api/IccBemikronoApi.d.ts +81 -0
  5. package/icc-api/api/IccBemikronoApi.js +163 -0
  6. package/icc-api/api/IccBemikronoApi.js.map +1 -0
  7. package/icc-api/api/IccCalendarItemApi.d.ts +21 -1
  8. package/icc-api/api/IccCalendarItemApi.js +183 -117
  9. package/icc-api/api/IccCalendarItemApi.js.map +1 -1
  10. package/icc-api/api/IccClassificationApi.d.ts +21 -1
  11. package/icc-api/api/IccClassificationApi.js +119 -63
  12. package/icc-api/api/IccClassificationApi.js.map +1 -1
  13. package/icc-api/api/IccContactApi.d.ts +21 -1
  14. package/icc-api/api/IccContactApi.js +385 -294
  15. package/icc-api/api/IccContactApi.js.map +1 -1
  16. package/icc-api/api/IccDocumentApi.d.ts +32 -25
  17. package/icc-api/api/IccDocumentApi.js +264 -212
  18. package/icc-api/api/IccDocumentApi.js.map +1 -1
  19. package/icc-api/api/IccExchangeDataApi.d.ts +19 -0
  20. package/icc-api/api/IccExchangeDataApi.js +85 -0
  21. package/icc-api/api/IccExchangeDataApi.js.map +1 -0
  22. package/icc-api/api/IccExchangeDataMapApi.d.ts +18 -0
  23. package/icc-api/api/IccExchangeDataMapApi.js +65 -0
  24. package/icc-api/api/IccExchangeDataMapApi.js.map +1 -0
  25. package/icc-api/api/IccFormApi.d.ts +21 -1
  26. package/icc-api/api/IccFormApi.js +321 -229
  27. package/icc-api/api/IccFormApi.js.map +1 -1
  28. package/icc-api/api/IccHelementApi.d.ts +21 -1
  29. package/icc-api/api/IccHelementApi.js +207 -137
  30. package/icc-api/api/IccHelementApi.js.map +1 -1
  31. package/icc-api/api/IccInvoiceApi.d.ts +21 -1
  32. package/icc-api/api/IccInvoiceApi.js +404 -298
  33. package/icc-api/api/IccInvoiceApi.js.map +1 -1
  34. package/icc-api/api/IccMaintenanceTaskApi.d.ts +12 -1
  35. package/icc-api/api/IccMaintenanceTaskApi.js +79 -43
  36. package/icc-api/api/IccMaintenanceTaskApi.js.map +1 -1
  37. package/icc-api/api/IccMessageApi.d.ts +12 -1
  38. package/icc-api/api/IccMessageApi.js +257 -191
  39. package/icc-api/api/IccMessageApi.js.map +1 -1
  40. package/icc-api/api/IccPatientApi.d.ts +12 -1
  41. package/icc-api/api/IccPatientApi.js +447 -351
  42. package/icc-api/api/IccPatientApi.js.map +1 -1
  43. package/icc-api/api/IccReceiptApi.d.ts +22 -8
  44. package/icc-api/api/IccReceiptApi.js +121 -64
  45. package/icc-api/api/IccReceiptApi.js.map +1 -1
  46. package/icc-api/api/IccRestApiPath.js +1 -1
  47. package/icc-api/api/IccRestApiPath.js.map +1 -1
  48. package/icc-api/api/IccTimeTableApi.d.ts +12 -1
  49. package/icc-api/api/IccTimeTableApi.js +86 -48
  50. package/icc-api/api/IccTimeTableApi.js.map +1 -1
  51. package/icc-api/index.d.ts +1 -0
  52. package/icc-api/index.js +1 -0
  53. package/icc-api/index.js.map +1 -1
  54. package/icc-api/model/AccessLog.d.ts +4 -0
  55. package/icc-api/model/AccessLog.js +1 -0
  56. package/icc-api/model/AccessLog.js.map +1 -1
  57. package/icc-api/model/Article.d.ts +4 -0
  58. package/icc-api/model/Article.js +1 -0
  59. package/icc-api/model/Article.js.map +1 -1
  60. package/icc-api/model/CalendarItem.d.ts +4 -0
  61. package/icc-api/model/CalendarItem.js +1 -0
  62. package/icc-api/model/CalendarItem.js.map +1 -1
  63. package/icc-api/model/Classification.d.ts +4 -0
  64. package/icc-api/model/Classification.js +1 -0
  65. package/icc-api/model/Classification.js.map +1 -1
  66. package/icc-api/model/ClassificationTemplate.d.ts +2 -0
  67. package/icc-api/model/ClassificationTemplate.js.map +1 -1
  68. package/icc-api/model/Contact.d.ts +4 -0
  69. package/icc-api/model/Contact.js +1 -0
  70. package/icc-api/model/Contact.js.map +1 -1
  71. package/icc-api/model/Device.d.ts +4 -4
  72. package/icc-api/model/Device.js.map +1 -1
  73. package/icc-api/model/Document.d.ts +4 -0
  74. package/icc-api/model/Document.js +1 -0
  75. package/icc-api/model/Document.js.map +1 -1
  76. package/icc-api/model/ExchangeData.d.ts +61 -0
  77. package/icc-api/model/ExchangeData.js +12 -0
  78. package/icc-api/model/ExchangeData.js.map +1 -0
  79. package/icc-api/model/ExchangeDataMap.d.ts +21 -0
  80. package/icc-api/model/ExchangeDataMap.js +10 -0
  81. package/icc-api/model/ExchangeDataMap.js.map +1 -0
  82. package/icc-api/model/ExchangeDataMapCreationBatch.d.ts +13 -0
  83. package/icc-api/model/ExchangeDataMapCreationBatch.js +10 -0
  84. package/icc-api/model/ExchangeDataMapCreationBatch.js.map +1 -0
  85. package/icc-api/model/Form.d.ts +4 -0
  86. package/icc-api/model/Form.js +1 -0
  87. package/icc-api/model/Form.js.map +1 -1
  88. package/icc-api/model/HealthElement.d.ts +4 -0
  89. package/icc-api/model/HealthElement.js +1 -0
  90. package/icc-api/model/HealthElement.js.map +1 -1
  91. package/icc-api/model/HealthcareParty.d.ts +2 -2
  92. package/icc-api/model/HealthcareParty.js.map +1 -1
  93. package/icc-api/model/IcureStub.d.ts +2 -0
  94. package/icc-api/model/IcureStub.js.map +1 -1
  95. package/icc-api/model/Invoice.d.ts +4 -0
  96. package/icc-api/model/Invoice.js +1 -0
  97. package/icc-api/model/Invoice.js.map +1 -1
  98. package/icc-api/model/MaintenanceTask.d.ts +4 -0
  99. package/icc-api/model/MaintenanceTask.js +1 -0
  100. package/icc-api/model/MaintenanceTask.js.map +1 -1
  101. package/icc-api/model/Message.d.ts +4 -0
  102. package/icc-api/model/Message.js +1 -0
  103. package/icc-api/model/Message.js.map +1 -1
  104. package/icc-api/model/PaginatedListExchangeData.d.ts +9 -0
  105. package/icc-api/model/PaginatedListExchangeData.js +10 -0
  106. package/icc-api/model/PaginatedListExchangeData.js.map +1 -0
  107. package/icc-api/model/Patient.d.ts +6 -2
  108. package/icc-api/model/Patient.js +1 -0
  109. package/icc-api/model/Patient.js.map +1 -1
  110. package/icc-api/model/PatientByHcPartyGenderEducationProfession.d.ts +31 -0
  111. package/icc-api/model/PatientByHcPartyGenderEducationProfession.js +32 -0
  112. package/icc-api/model/PatientByHcPartyGenderEducationProfession.js.map +1 -0
  113. package/icc-api/model/Receipt.d.ts +4 -0
  114. package/icc-api/model/Receipt.js +1 -0
  115. package/icc-api/model/Receipt.js.map +1 -1
  116. package/icc-api/model/SecureDelegation.d.ts +52 -0
  117. package/icc-api/model/SecureDelegation.js +16 -0
  118. package/icc-api/model/SecureDelegation.js.map +1 -0
  119. package/icc-api/model/SecurityMetadata.d.ts +33 -0
  120. package/icc-api/model/SecurityMetadata.js +13 -0
  121. package/icc-api/model/SecurityMetadata.js.map +1 -0
  122. package/icc-api/model/Service.d.ts +2 -0
  123. package/icc-api/model/Service.js.map +1 -1
  124. package/icc-api/model/TimeTable.d.ts +4 -0
  125. package/icc-api/model/TimeTable.js +1 -0
  126. package/icc-api/model/TimeTable.js.map +1 -1
  127. package/icc-api/model/models.d.ts +20 -39
  128. package/icc-api/model/models.js +15 -37
  129. package/icc-api/model/models.js.map +1 -1
  130. package/icc-api/model/requests/EntityBulkShareResult.d.ts +28 -0
  131. package/icc-api/model/requests/EntityBulkShareResult.js +16 -0
  132. package/icc-api/model/requests/EntityBulkShareResult.js.map +1 -0
  133. package/icc-api/model/requests/EntityShareOrMetadataUpdateRequest.d.ts +10 -0
  134. package/icc-api/model/requests/EntityShareOrMetadataUpdateRequest.js +17 -0
  135. package/icc-api/model/requests/EntityShareOrMetadataUpdateRequest.js.map +1 -0
  136. package/icc-api/model/requests/EntityShareRequest.d.ts +110 -0
  137. package/icc-api/model/requests/EntityShareRequest.js +63 -0
  138. package/icc-api/model/requests/EntityShareRequest.js.map +1 -0
  139. package/icc-api/model/requests/EntitySharedMetadataUpdateRequest.d.ts +54 -0
  140. package/icc-api/model/requests/EntitySharedMetadataUpdateRequest.js +24 -0
  141. package/icc-api/model/requests/EntitySharedMetadataUpdateRequest.js.map +1 -0
  142. package/icc-api/model/requests/MinimalEntityBulkShareResult.d.ts +23 -0
  143. package/icc-api/model/requests/MinimalEntityBulkShareResult.js +13 -0
  144. package/icc-api/model/requests/MinimalEntityBulkShareResult.js.map +1 -0
  145. package/icc-api/model/requests/RejectedShareOrMetadataUpdateRequest.d.ts +21 -0
  146. package/icc-api/model/requests/RejectedShareOrMetadataUpdateRequest.js +14 -0
  147. package/icc-api/model/requests/RejectedShareOrMetadataUpdateRequest.js.map +1 -0
  148. package/icc-x-api/basexapi/EncryptedEntityXApi.d.ts +3 -2
  149. package/icc-x-api/basexapi/EncryptedEntityXApi.js.map +1 -1
  150. package/icc-x-api/crypto/AES.js +1 -1
  151. package/icc-x-api/crypto/AES.js.map +1 -1
  152. package/icc-x-api/crypto/AccessControlKeysHeadersProvider.d.ts +16 -0
  153. package/icc-x-api/crypto/AccessControlKeysHeadersProvider.js +41 -0
  154. package/icc-x-api/crypto/AccessControlKeysHeadersProvider.js.map +1 -0
  155. package/icc-x-api/crypto/AccessControlSecretUtils.d.ts +42 -0
  156. package/icc-x-api/crypto/AccessControlSecretUtils.js +86 -0
  157. package/icc-x-api/crypto/AccessControlSecretUtils.js.map +1 -0
  158. package/icc-x-api/crypto/BaseExchangeDataManager.d.ts +146 -0
  159. package/icc-x-api/crypto/BaseExchangeDataManager.js +342 -0
  160. package/icc-x-api/crypto/BaseExchangeDataManager.js.map +1 -0
  161. package/icc-x-api/crypto/BaseExchangeKeysManager.d.ts +0 -18
  162. package/icc-x-api/crypto/BaseExchangeKeysManager.js +11 -85
  163. package/icc-x-api/crypto/BaseExchangeKeysManager.js.map +1 -1
  164. package/icc-x-api/crypto/ConfidentialEntities.d.ts +26 -16
  165. package/icc-x-api/crypto/ConfidentialEntities.js +30 -17
  166. package/icc-x-api/crypto/ConfidentialEntities.js.map +1 -1
  167. package/icc-x-api/crypto/CryptoStrategies.d.ts +8 -1
  168. package/icc-x-api/crypto/CryptoStrategies.js.map +1 -1
  169. package/icc-x-api/crypto/ExchangeDataManager.d.ts +95 -0
  170. package/icc-x-api/crypto/ExchangeDataManager.js +493 -0
  171. package/icc-x-api/crypto/ExchangeDataManager.js.map +1 -0
  172. package/icc-x-api/crypto/ExchangeDataMapManager.d.ts +32 -0
  173. package/icc-x-api/crypto/ExchangeDataMapManager.js +70 -0
  174. package/icc-x-api/crypto/ExchangeDataMapManager.js.map +1 -0
  175. package/icc-x-api/crypto/ExchangeKeysManager.d.ts +4 -16
  176. package/icc-x-api/crypto/ExchangeKeysManager.js +4 -62
  177. package/icc-x-api/crypto/ExchangeKeysManager.js.map +1 -1
  178. package/icc-x-api/crypto/ExtendedApisUtils.d.ts +336 -0
  179. package/icc-x-api/crypto/ExtendedApisUtils.js +3 -0
  180. package/icc-x-api/crypto/ExtendedApisUtils.js.map +1 -0
  181. package/icc-x-api/crypto/ExtendedApisUtilsImpl.d.ts +181 -0
  182. package/icc-x-api/crypto/ExtendedApisUtilsImpl.js +562 -0
  183. package/icc-x-api/crypto/ExtendedApisUtilsImpl.js.map +1 -0
  184. package/icc-x-api/crypto/KeyRecovery.d.ts +5 -2
  185. package/icc-x-api/crypto/KeyRecovery.js +59 -29
  186. package/icc-x-api/crypto/KeyRecovery.js.map +1 -1
  187. package/icc-x-api/crypto/LegacyCryptoStrategies.d.ts +7 -2
  188. package/icc-x-api/crypto/LegacyCryptoStrategies.js +8 -1
  189. package/icc-x-api/crypto/LegacyCryptoStrategies.js.map +1 -1
  190. package/icc-x-api/crypto/LegacyDelegationSecurityMetadataDecryptor.d.ts +39 -0
  191. package/icc-x-api/crypto/LegacyDelegationSecurityMetadataDecryptor.js +150 -0
  192. package/icc-x-api/crypto/LegacyDelegationSecurityMetadataDecryptor.js.map +1 -0
  193. package/icc-x-api/crypto/RSA.d.ts +34 -8
  194. package/icc-x-api/crypto/RSA.js +80 -13
  195. package/icc-x-api/crypto/RSA.js.map +1 -1
  196. package/icc-x-api/crypto/SecureDelegationsEncryption.d.ts +54 -0
  197. package/icc-x-api/crypto/SecureDelegationsEncryption.js +178 -0
  198. package/icc-x-api/crypto/SecureDelegationsEncryption.js.map +1 -0
  199. package/icc-x-api/crypto/SecureDelegationsManager.d.ts +66 -0
  200. package/icc-x-api/crypto/SecureDelegationsManager.js +261 -0
  201. package/icc-x-api/crypto/SecureDelegationsManager.js.map +1 -0
  202. package/icc-x-api/crypto/SecureDelegationsSecurityMetadataDecryptor.d.ts +37 -0
  203. package/icc-x-api/crypto/SecureDelegationsSecurityMetadataDecryptor.js +294 -0
  204. package/icc-x-api/crypto/SecureDelegationsSecurityMetadataDecryptor.js.map +1 -0
  205. package/icc-x-api/crypto/SecurityMetadataDecryptor.d.ts +114 -0
  206. package/icc-x-api/crypto/SecurityMetadataDecryptor.js +98 -0
  207. package/icc-x-api/crypto/SecurityMetadataDecryptor.js.map +1 -0
  208. package/icc-x-api/crypto/ShamirKeysManager.d.ts +5 -5
  209. package/icc-x-api/crypto/ShamirKeysManager.js +6 -9
  210. package/icc-x-api/crypto/ShamirKeysManager.js.map +1 -1
  211. package/icc-x-api/crypto/TransferKeysManager.d.ts +8 -6
  212. package/icc-x-api/crypto/TransferKeysManager.js +75 -52
  213. package/icc-x-api/crypto/TransferKeysManager.js.map +1 -1
  214. package/icc-x-api/crypto/{KeyManager.d.ts → UserEncryptionKeysManager.d.ts} +4 -6
  215. package/icc-x-api/crypto/{KeyManager.js → UserEncryptionKeysManager.js} +43 -23
  216. package/icc-x-api/crypto/UserEncryptionKeysManager.js.map +1 -0
  217. package/icc-x-api/crypto/UserSignatureKeysManager.d.ts +26 -0
  218. package/icc-x-api/crypto/UserSignatureKeysManager.js +74 -0
  219. package/icc-x-api/crypto/UserSignatureKeysManager.js.map +1 -0
  220. package/icc-x-api/crypto/utils.d.ts +61 -11
  221. package/icc-x-api/crypto/utils.js +113 -44
  222. package/icc-x-api/crypto/utils.js.map +1 -1
  223. package/icc-x-api/filters/filters.js.map +1 -1
  224. package/icc-x-api/icc-accesslog-x-api.d.ts +46 -11
  225. package/icc-x-api/icc-accesslog-x-api.js +75 -42
  226. package/icc-x-api/icc-accesslog-x-api.js.map +1 -1
  227. package/icc-x-api/icc-calendar-item-x-api.d.ts +50 -14
  228. package/icc-x-api/icc-calendar-item-x-api.js +99 -49
  229. package/icc-x-api/icc-calendar-item-x-api.js.map +1 -1
  230. package/icc-x-api/icc-classification-x-api.d.ts +44 -9
  231. package/icc-x-api/icc-classification-x-api.js +56 -31
  232. package/icc-x-api/icc-classification-x-api.js.map +1 -1
  233. package/icc-x-api/icc-contact-x-api.d.ts +56 -32
  234. package/icc-x-api/icc-contact-x-api.js +95 -64
  235. package/icc-x-api/icc-contact-x-api.js.map +1 -1
  236. package/icc-x-api/icc-crypto-x-api.d.ts +28 -334
  237. package/icc-x-api/icc-crypto-x-api.js +41 -765
  238. package/icc-x-api/icc-crypto-x-api.js.map +1 -1
  239. package/icc-x-api/icc-data-owner-x-api.d.ts +20 -8
  240. package/icc-x-api/icc-data-owner-x-api.js +31 -10
  241. package/icc-x-api/icc-data-owner-x-api.js.map +1 -1
  242. package/icc-x-api/icc-document-x-api.d.ts +48 -11
  243. package/icc-x-api/icc-document-x-api.js +111 -64
  244. package/icc-x-api/icc-document-x-api.js.map +1 -1
  245. package/icc-x-api/icc-form-x-api.d.ts +45 -10
  246. package/icc-x-api/icc-form-x-api.js +65 -35
  247. package/icc-x-api/icc-form-x-api.js.map +1 -1
  248. package/icc-x-api/icc-hcparty-x-api.d.ts +2 -2
  249. package/icc-x-api/icc-hcparty-x-api.js +3 -3
  250. package/icc-x-api/icc-hcparty-x-api.js.map +1 -1
  251. package/icc-x-api/icc-helement-x-api.d.ts +55 -18
  252. package/icc-x-api/icc-helement-x-api.js +76 -41
  253. package/icc-x-api/icc-helement-x-api.js.map +1 -1
  254. package/icc-x-api/icc-icure-maintenance-x-api.d.ts +7 -2
  255. package/icc-x-api/icc-icure-maintenance-x-api.js +38 -27
  256. package/icc-x-api/icc-icure-maintenance-x-api.js.map +1 -1
  257. package/icc-x-api/icc-invoice-x-api.d.ts +50 -15
  258. package/icc-x-api/icc-invoice-x-api.js +63 -33
  259. package/icc-x-api/icc-invoice-x-api.js.map +1 -1
  260. package/icc-x-api/icc-maintenance-task-x-api.d.ts +53 -21
  261. package/icc-x-api/icc-maintenance-task-x-api.js +72 -35
  262. package/icc-x-api/icc-maintenance-task-x-api.js.map +1 -1
  263. package/icc-x-api/icc-message-x-api.d.ts +53 -15
  264. package/icc-x-api/icc-message-x-api.js +65 -36
  265. package/icc-x-api/icc-message-x-api.js.map +1 -1
  266. package/icc-x-api/icc-patient-x-api.d.ts +84 -29
  267. package/icc-x-api/icc-patient-x-api.js +313 -378
  268. package/icc-x-api/icc-patient-x-api.js.map +1 -1
  269. package/icc-x-api/icc-receipt-x-api.d.ts +44 -12
  270. package/icc-x-api/icc-receipt-x-api.js +67 -35
  271. package/icc-x-api/icc-receipt-x-api.js.map +1 -1
  272. package/icc-x-api/icc-time-table-x-api.d.ts +43 -12
  273. package/icc-x-api/icc-time-table-x-api.js +56 -26
  274. package/icc-x-api/icc-time-table-x-api.js.map +1 -1
  275. package/icc-x-api/icc-user-x-api.d.ts +2 -2
  276. package/icc-x-api/icc-user-x-api.js +3 -3
  277. package/icc-x-api/icc-user-x-api.js.map +1 -1
  278. package/icc-x-api/index.d.ts +4 -2
  279. package/icc-x-api/index.js +154 -135
  280. package/icc-x-api/index.js.map +1 -1
  281. package/icc-x-api/storage/DefaultStorageEntryKeysFactory.d.ts +2 -0
  282. package/icc-x-api/storage/DefaultStorageEntryKeysFactory.js +9 -2
  283. package/icc-x-api/storage/DefaultStorageEntryKeysFactory.js.map +1 -1
  284. package/icc-x-api/storage/IcureStorageFacade.d.ts +23 -2
  285. package/icc-x-api/storage/IcureStorageFacade.js +36 -2
  286. package/icc-x-api/storage/IcureStorageFacade.js.map +1 -1
  287. package/icc-x-api/storage/KeyStorageFacade.d.ts +12 -0
  288. package/icc-x-api/storage/KeyStorageFacade.js.map +1 -1
  289. package/icc-x-api/storage/KeyStorageImpl.d.ts +2 -0
  290. package/icc-x-api/storage/KeyStorageImpl.js +10 -0
  291. package/icc-x-api/storage/KeyStorageImpl.js.map +1 -1
  292. package/icc-x-api/storage/StorageEntryKeysFactory.d.ts +14 -1
  293. package/icc-x-api/storage/StorageEntryKeysFactory.js.map +1 -1
  294. package/icc-x-api/utils/EntityWithDelegationTypeName.d.ts +32 -0
  295. package/icc-x-api/utils/EntityWithDelegationTypeName.js +75 -0
  296. package/icc-x-api/utils/EntityWithDelegationTypeName.js.map +1 -0
  297. package/icc-x-api/utils/ShareResult.d.ts +74 -0
  298. package/icc-x-api/utils/ShareResult.js +61 -0
  299. package/icc-x-api/utils/ShareResult.js.map +1 -0
  300. package/icc-x-api/utils/binary-utils.d.ts +1 -0
  301. package/icc-x-api/utils/binary-utils.js +8 -1
  302. package/icc-x-api/utils/binary-utils.js.map +1 -1
  303. package/icc-x-api/utils/collection-utils.d.ts +5 -0
  304. package/icc-x-api/utils/collection-utils.js +26 -1
  305. package/icc-x-api/utils/collection-utils.js.map +1 -1
  306. package/icc-x-api/utils/crypto-utils.d.ts +4 -3
  307. package/icc-x-api/utils/crypto-utils.js +5 -4
  308. package/icc-x-api/utils/crypto-utils.js.map +1 -1
  309. package/icc-x-api/utils/lru-temporised-async-cache.d.ts +26 -3
  310. package/icc-x-api/utils/lru-temporised-async-cache.js +75 -15
  311. package/icc-x-api/utils/lru-temporised-async-cache.js.map +1 -1
  312. package/icc-x-api/utils/websocket.d.ts +10 -10
  313. package/icc-x-api/utils/websocket.js +18 -9
  314. package/icc-x-api/utils/websocket.js.map +1 -1
  315. package/index.d.ts +1 -1
  316. package/index.js +3 -1
  317. package/index.js.map +1 -1
  318. package/package.json +2 -3
  319. package/icc-x-api/crypto/EntitiesEncryption.d.ts +0 -275
  320. package/icc-x-api/crypto/EntitiesEncryption.js +0 -734
  321. package/icc-x-api/crypto/EntitiesEncryption.js.map +0 -1
  322. package/icc-x-api/crypto/KeyManager.js.map +0 -1
@@ -1,4 +1,13 @@
1
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
+ };
2
11
  Object.defineProperty(exports, "__esModule", { value: true });
3
12
  exports.IccPatientApi = void 0;
4
13
  /**
@@ -22,15 +31,19 @@ const PaginatedListString_1 = require("../model/PaginatedListString");
22
31
  const Patient_1 = require("../model/Patient");
23
32
  const AuthenticationProvider_1 = require("../../icc-x-api/auth/AuthenticationProvider");
24
33
  const IccRestApiPath_1 = require("./IccRestApiPath");
34
+ const EntityBulkShareResult_1 = require("../model/requests/EntityBulkShareResult");
25
35
  class IccPatientApi {
36
+ get headers() {
37
+ return Promise.resolve(this._headers);
38
+ }
26
39
  constructor(host, headers, authenticationProvider, fetchImpl) {
27
40
  this.host = (0, IccRestApiPath_1.iccRestApiPath)(host);
28
- this.headers = Object.keys(headers).map((k) => new XHR_1.XHR.Header(k, headers[k]));
41
+ this._headers = Object.keys(headers).map((k) => new XHR_1.XHR.Header(k, headers[k]));
29
42
  this.authenticationProvider = !!authenticationProvider ? authenticationProvider : new AuthenticationProvider_1.NoAuthenticationProvider();
30
43
  this.fetchImpl = fetchImpl;
31
44
  }
32
45
  setHeaders(h) {
33
- this.headers = h;
46
+ this._headers = h;
34
47
  }
35
48
  handleError(e) {
36
49
  throw e;
@@ -41,14 +54,16 @@ class IccPatientApi {
41
54
  * @param body
42
55
  */
43
56
  bulkCreatePatients(body) {
44
- let _body = null;
45
- _body = body;
46
- const _url = this.host + `/patient/batch` + '?ts=' + new Date().getTime();
47
- let headers = this.headers;
48
- headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
49
- return XHR_1.XHR.sendCommand('POST', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
50
- .then((doc) => doc.body.map((it) => new IdWithRev_1.IdWithRev(it)))
51
- .catch((err) => this.handleError(err));
57
+ return __awaiter(this, void 0, void 0, function* () {
58
+ let _body = null;
59
+ _body = body;
60
+ const _url = this.host + `/patient/batch` + '?ts=' + new Date().getTime();
61
+ let headers = yield this.headers;
62
+ headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
63
+ return XHR_1.XHR.sendCommand('POST', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
64
+ .then((doc) => doc.body.map((it) => new IdWithRev_1.IdWithRev(it)))
65
+ .catch((err) => this.handleError(err));
66
+ });
52
67
  }
53
68
  /**
54
69
  * Returns the id and _rev of created patients
@@ -56,14 +71,16 @@ class IccPatientApi {
56
71
  * @param body
57
72
  */
58
73
  bulkCreatePatients1(body) {
59
- let _body = null;
60
- _body = body;
61
- const _url = this.host + `/patient/bulk` + '?ts=' + new Date().getTime();
62
- let headers = this.headers;
63
- headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
64
- return XHR_1.XHR.sendCommand('POST', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
65
- .then((doc) => doc.body.map((it) => new IdWithRev_1.IdWithRev(it)))
66
- .catch((err) => this.handleError(err));
74
+ return __awaiter(this, void 0, void 0, function* () {
75
+ let _body = null;
76
+ _body = body;
77
+ const _url = this.host + `/patient/bulk` + '?ts=' + new Date().getTime();
78
+ let headers = yield this.headers;
79
+ headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
80
+ return XHR_1.XHR.sendCommand('POST', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
81
+ .then((doc) => doc.body.map((it) => new IdWithRev_1.IdWithRev(it)))
82
+ .catch((err) => this.handleError(err));
83
+ });
67
84
  }
68
85
  /**
69
86
  * Returns the id and _rev of modified patients
@@ -71,14 +88,16 @@ class IccPatientApi {
71
88
  * @param body
72
89
  */
73
90
  bulkUpdatePatients(body) {
74
- let _body = null;
75
- _body = body;
76
- const _url = this.host + `/patient/batch` + '?ts=' + new Date().getTime();
77
- let headers = this.headers;
78
- headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
79
- return XHR_1.XHR.sendCommand('PUT', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
80
- .then((doc) => doc.body.map((it) => new IdWithRev_1.IdWithRev(it)))
81
- .catch((err) => this.handleError(err));
91
+ return __awaiter(this, void 0, void 0, function* () {
92
+ let _body = null;
93
+ _body = body;
94
+ const _url = this.host + `/patient/batch` + '?ts=' + new Date().getTime();
95
+ let headers = yield this.headers;
96
+ headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
97
+ return XHR_1.XHR.sendCommand('PUT', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
98
+ .then((doc) => doc.body.map((it) => new IdWithRev_1.IdWithRev(it)))
99
+ .catch((err) => this.handleError(err));
100
+ });
82
101
  }
83
102
  /**
84
103
  * Returns the id and _rev of modified patients
@@ -86,14 +105,16 @@ class IccPatientApi {
86
105
  * @param body
87
106
  */
88
107
  bulkUpdatePatients1(body) {
89
- let _body = null;
90
- _body = body;
91
- const _url = this.host + `/patient/bulk` + '?ts=' + new Date().getTime();
92
- let headers = this.headers;
93
- headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
94
- return XHR_1.XHR.sendCommand('PUT', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
95
- .then((doc) => doc.body.map((it) => new IdWithRev_1.IdWithRev(it)))
96
- .catch((err) => this.handleError(err));
108
+ return __awaiter(this, void 0, void 0, function* () {
109
+ let _body = null;
110
+ _body = body;
111
+ const _url = this.host + `/patient/bulk` + '?ts=' + new Date().getTime();
112
+ let headers = yield this.headers;
113
+ headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
114
+ return XHR_1.XHR.sendCommand('PUT', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
115
+ .then((doc) => doc.body.map((it) => new IdWithRev_1.IdWithRev(it)))
116
+ .catch((err) => this.handleError(err));
117
+ });
97
118
  }
98
119
  /**
99
120
  * Returns the count of patients
@@ -101,12 +122,14 @@ class IccPatientApi {
101
122
  * @param hcPartyId Healthcare party id
102
123
  */
103
124
  countOfPatients(hcPartyId) {
104
- let _body = null;
105
- const _url = this.host + `/patient/hcParty/${encodeURIComponent(String(hcPartyId))}/count` + '?ts=' + new Date().getTime();
106
- let headers = this.headers;
107
- return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
108
- .then((doc) => new Content_1.Content(doc.body))
109
- .catch((err) => this.handleError(err));
125
+ return __awaiter(this, void 0, void 0, function* () {
126
+ let _body = null;
127
+ const _url = this.host + `/patient/hcParty/${encodeURIComponent(String(hcPartyId))}/count` + '?ts=' + new Date().getTime();
128
+ let headers = yield this.headers;
129
+ return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
130
+ .then((doc) => new Content_1.Content(doc.body))
131
+ .catch((err) => this.handleError(err));
132
+ });
110
133
  }
111
134
  /**
112
135
  * Name, last name, date of birth, and gender are required. After creation of the patient and obtaining the ID, you need to create an initial delegation.
@@ -114,14 +137,16 @@ class IccPatientApi {
114
137
  * @param body
115
138
  */
116
139
  createPatient(body) {
117
- let _body = null;
118
- _body = body;
119
- const _url = this.host + `/patient` + '?ts=' + new Date().getTime();
120
- let headers = this.headers;
121
- headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
122
- return XHR_1.XHR.sendCommand('POST', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
123
- .then((doc) => new Patient_1.Patient(doc.body))
124
- .catch((err) => this.handleError(err));
140
+ return __awaiter(this, void 0, void 0, function* () {
141
+ let _body = null;
142
+ _body = body;
143
+ const _url = this.host + `/patient` + '?ts=' + new Date().getTime();
144
+ let headers = yield this.headers;
145
+ headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
146
+ return XHR_1.XHR.sendCommand('POST', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
147
+ .then((doc) => new Patient_1.Patient(doc.body))
148
+ .catch((err) => this.handleError(err));
149
+ });
125
150
  }
126
151
  /**
127
152
  * Response is an array containing the ID of deleted patient..
@@ -129,12 +154,14 @@ class IccPatientApi {
129
154
  * @param patientIds
130
155
  */
131
156
  deletePatient(patientIds) {
132
- let _body = null;
133
- const _url = this.host + `/patient/${encodeURIComponent(String(patientIds))}` + '?ts=' + new Date().getTime();
134
- let headers = this.headers;
135
- return XHR_1.XHR.sendCommand('DELETE', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
136
- .then((doc) => doc.body.map((it) => new DocIdentifier_1.DocIdentifier(it)))
137
- .catch((err) => this.handleError(err));
157
+ return __awaiter(this, void 0, void 0, function* () {
158
+ let _body = null;
159
+ const _url = this.host + `/patient/${encodeURIComponent(String(patientIds))}` + '?ts=' + new Date().getTime();
160
+ let headers = yield this.headers;
161
+ return XHR_1.XHR.sendCommand('DELETE', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
162
+ .then((doc) => doc.body.map((it) => new DocIdentifier_1.DocIdentifier(it)))
163
+ .catch((err) => this.handleError(err));
164
+ });
138
165
  }
139
166
  /**
140
167
  * Returns a list of patients along with next start keys and Document ID. If the nextStartKey is Null it means that this is the last page.
@@ -148,23 +175,25 @@ class IccPatientApi {
148
175
  * @param desc Descending
149
176
  */
150
177
  filterPatientsBy(startKey, startDocumentId, limit, skip, sort, desc, body) {
151
- let _body = null;
152
- _body = body;
153
- const _url = this.host +
154
- `/patient/filter` +
155
- '?ts=' +
156
- new Date().getTime() +
157
- (startKey ? '&startKey=' + encodeURIComponent(String(startKey)) : '') +
158
- (startDocumentId ? '&startDocumentId=' + encodeURIComponent(String(startDocumentId)) : '') +
159
- (limit ? '&limit=' + encodeURIComponent(String(limit)) : '') +
160
- (skip ? '&skip=' + encodeURIComponent(String(skip)) : '') +
161
- (sort ? '&sort=' + encodeURIComponent(String(sort)) : '') +
162
- (desc ? '&desc=' + encodeURIComponent(String(desc)) : '');
163
- let headers = this.headers;
164
- headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
165
- return XHR_1.XHR.sendCommand('POST', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
166
- .then((doc) => new PaginatedListPatient_1.PaginatedListPatient(doc.body))
167
- .catch((err) => this.handleError(err));
178
+ return __awaiter(this, void 0, void 0, function* () {
179
+ let _body = null;
180
+ _body = body;
181
+ const _url = this.host +
182
+ `/patient/filter` +
183
+ '?ts=' +
184
+ new Date().getTime() +
185
+ (startKey ? '&startKey=' + encodeURIComponent(String(startKey)) : '') +
186
+ (startDocumentId ? '&startDocumentId=' + encodeURIComponent(String(startDocumentId)) : '') +
187
+ (limit ? '&limit=' + encodeURIComponent(String(limit)) : '') +
188
+ (skip ? '&skip=' + encodeURIComponent(String(skip)) : '') +
189
+ (sort ? '&sort=' + encodeURIComponent(String(sort)) : '') +
190
+ (desc ? '&desc=' + encodeURIComponent(String(desc)) : '');
191
+ let headers = yield this.headers;
192
+ headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
193
+ return XHR_1.XHR.sendCommand('POST', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
194
+ .then((doc) => new PaginatedListPatient_1.PaginatedListPatient(doc.body))
195
+ .catch((err) => this.handleError(err));
196
+ });
168
197
  }
169
198
  /**
170
199
  *
@@ -177,20 +206,22 @@ class IccPatientApi {
177
206
  * @param limit Number of rows
178
207
  */
179
208
  findByAccessLogUserAfterDate(userId, accessType, startDate, startKey, startDocumentId, limit) {
180
- let _body = null;
181
- const _url = this.host +
182
- `/patient/byAccess/${encodeURIComponent(String(userId))}` +
183
- '?ts=' +
184
- new Date().getTime() +
185
- (accessType ? '&accessType=' + encodeURIComponent(String(accessType)) : '') +
186
- (startDate ? '&startDate=' + encodeURIComponent(String(startDate)) : '') +
187
- (startKey ? '&startKey=' + encodeURIComponent(String(startKey)) : '') +
188
- (startDocumentId ? '&startDocumentId=' + encodeURIComponent(String(startDocumentId)) : '') +
189
- (limit ? '&limit=' + encodeURIComponent(String(limit)) : '');
190
- let headers = this.headers;
191
- return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
192
- .then((doc) => new PaginatedListPatient_1.PaginatedListPatient(doc.body))
193
- .catch((err) => this.handleError(err));
209
+ return __awaiter(this, void 0, void 0, function* () {
210
+ let _body = null;
211
+ const _url = this.host +
212
+ `/patient/byAccess/${encodeURIComponent(String(userId))}` +
213
+ '?ts=' +
214
+ new Date().getTime() +
215
+ (accessType ? '&accessType=' + encodeURIComponent(String(accessType)) : '') +
216
+ (startDate ? '&startDate=' + encodeURIComponent(String(startDate)) : '') +
217
+ (startKey ? '&startKey=' + encodeURIComponent(String(startKey)) : '') +
218
+ (startDocumentId ? '&startDocumentId=' + encodeURIComponent(String(startDocumentId)) : '') +
219
+ (limit ? '&limit=' + encodeURIComponent(String(limit)) : '');
220
+ let headers = yield this.headers;
221
+ return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
222
+ .then((doc) => new PaginatedListPatient_1.PaginatedListPatient(doc.body))
223
+ .catch((err) => this.handleError(err));
224
+ });
194
225
  }
195
226
  /**
196
227
  *
@@ -198,12 +229,14 @@ class IccPatientApi {
198
229
  * @param externalId A external ID
199
230
  */
200
231
  findByExternalId(externalId) {
201
- let _body = null;
202
- const _url = this.host + `/patient/byExternalId/${encodeURIComponent(String(externalId))}` + '?ts=' + new Date().getTime();
203
- let headers = this.headers;
204
- return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
205
- .then((doc) => new Patient_1.Patient(doc.body))
206
- .catch((err) => this.handleError(err));
232
+ return __awaiter(this, void 0, void 0, function* () {
233
+ let _body = null;
234
+ const _url = this.host + `/patient/byExternalId/${encodeURIComponent(String(externalId))}` + '?ts=' + new Date().getTime();
235
+ let headers = yield this.headers;
236
+ return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
237
+ .then((doc) => new Patient_1.Patient(doc.body))
238
+ .catch((err) => this.handleError(err));
239
+ });
207
240
  }
208
241
  /**
209
242
  * Returns a list of patients along with next start keys and Document ID. If the nextStartKey is Null it means that this is the last page.
@@ -216,21 +249,23 @@ class IccPatientApi {
216
249
  * @param sortDirection Optional value for providing a sorting direction ('asc', 'desc'). Set to 'asc' by default.
217
250
  */
218
251
  findByNameBirthSsinAuto(healthcarePartyId, filterValue, startKey, startDocumentId, limit, sortDirection) {
219
- let _body = null;
220
- const _url = this.host +
221
- `/patient/byNameBirthSsinAuto` +
222
- '?ts=' +
223
- new Date().getTime() +
224
- (healthcarePartyId ? '&healthcarePartyId=' + encodeURIComponent(String(healthcarePartyId)) : '') +
225
- (filterValue ? '&filterValue=' + encodeURIComponent(String(filterValue)) : '') +
226
- (startKey ? '&startKey=' + encodeURIComponent(String(startKey)) : '') +
227
- (startDocumentId ? '&startDocumentId=' + encodeURIComponent(String(startDocumentId)) : '') +
228
- (limit ? '&limit=' + encodeURIComponent(String(limit)) : '') +
229
- (sortDirection ? '&sortDirection=' + encodeURIComponent(String(sortDirection)) : '');
230
- let headers = this.headers;
231
- return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
232
- .then((doc) => new PaginatedListPatient_1.PaginatedListPatient(doc.body))
233
- .catch((err) => this.handleError(err));
252
+ return __awaiter(this, void 0, void 0, function* () {
253
+ let _body = null;
254
+ const _url = this.host +
255
+ `/patient/byNameBirthSsinAuto` +
256
+ '?ts=' +
257
+ new Date().getTime() +
258
+ (healthcarePartyId ? '&healthcarePartyId=' + encodeURIComponent(String(healthcarePartyId)) : '') +
259
+ (filterValue ? '&filterValue=' + encodeURIComponent(String(filterValue)) : '') +
260
+ (startKey ? '&startKey=' + encodeURIComponent(String(startKey)) : '') +
261
+ (startDocumentId ? '&startDocumentId=' + encodeURIComponent(String(startDocumentId)) : '') +
262
+ (limit ? '&limit=' + encodeURIComponent(String(limit)) : '') +
263
+ (sortDirection ? '&sortDirection=' + encodeURIComponent(String(sortDirection)) : '');
264
+ let headers = yield this.headers;
265
+ return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
266
+ .then((doc) => new PaginatedListPatient_1.PaginatedListPatient(doc.body))
267
+ .catch((err) => this.handleError(err));
268
+ });
234
269
  }
235
270
  /**
236
271
  *
@@ -241,19 +276,21 @@ class IccPatientApi {
241
276
  * @param limit Number of rows
242
277
  */
243
278
  findDuplicatesByName(hcPartyId, startKey, startDocumentId, limit) {
244
- let _body = null;
245
- const _url = this.host +
246
- `/patient/duplicates/name` +
247
- '?ts=' +
248
- new Date().getTime() +
249
- (hcPartyId ? '&hcPartyId=' + encodeURIComponent(String(hcPartyId)) : '') +
250
- (startKey ? '&startKey=' + encodeURIComponent(String(startKey)) : '') +
251
- (startDocumentId ? '&startDocumentId=' + encodeURIComponent(String(startDocumentId)) : '') +
252
- (limit ? '&limit=' + encodeURIComponent(String(limit)) : '');
253
- let headers = this.headers;
254
- return XHR_1.XHR.sendCommand('POST', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
255
- .then((doc) => new PaginatedListPatient_1.PaginatedListPatient(doc.body))
256
- .catch((err) => this.handleError(err));
279
+ return __awaiter(this, void 0, void 0, function* () {
280
+ let _body = null;
281
+ const _url = this.host +
282
+ `/patient/duplicates/name` +
283
+ '?ts=' +
284
+ new Date().getTime() +
285
+ (hcPartyId ? '&hcPartyId=' + encodeURIComponent(String(hcPartyId)) : '') +
286
+ (startKey ? '&startKey=' + encodeURIComponent(String(startKey)) : '') +
287
+ (startDocumentId ? '&startDocumentId=' + encodeURIComponent(String(startDocumentId)) : '') +
288
+ (limit ? '&limit=' + encodeURIComponent(String(limit)) : '');
289
+ let headers = yield this.headers;
290
+ return XHR_1.XHR.sendCommand('POST', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
291
+ .then((doc) => new PaginatedListPatient_1.PaginatedListPatient(doc.body))
292
+ .catch((err) => this.handleError(err));
293
+ });
257
294
  }
258
295
  /**
259
296
  *
@@ -264,19 +301,21 @@ class IccPatientApi {
264
301
  * @param limit Number of rows
265
302
  */
266
303
  findDuplicatesBySsin(hcPartyId, startKey, startDocumentId, limit) {
267
- let _body = null;
268
- const _url = this.host +
269
- `/patient/duplicates/ssin` +
270
- '?ts=' +
271
- new Date().getTime() +
272
- (hcPartyId ? '&hcPartyId=' + encodeURIComponent(String(hcPartyId)) : '') +
273
- (startKey ? '&startKey=' + encodeURIComponent(String(startKey)) : '') +
274
- (startDocumentId ? '&startDocumentId=' + encodeURIComponent(String(startDocumentId)) : '') +
275
- (limit ? '&limit=' + encodeURIComponent(String(limit)) : '');
276
- let headers = this.headers;
277
- return XHR_1.XHR.sendCommand('POST', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
278
- .then((doc) => new PaginatedListPatient_1.PaginatedListPatient(doc.body))
279
- .catch((err) => this.handleError(err));
304
+ return __awaiter(this, void 0, void 0, function* () {
305
+ let _body = null;
306
+ const _url = this.host +
307
+ `/patient/duplicates/ssin` +
308
+ '?ts=' +
309
+ new Date().getTime() +
310
+ (hcPartyId ? '&hcPartyId=' + encodeURIComponent(String(hcPartyId)) : '') +
311
+ (startKey ? '&startKey=' + encodeURIComponent(String(startKey)) : '') +
312
+ (startDocumentId ? '&startDocumentId=' + encodeURIComponent(String(startDocumentId)) : '') +
313
+ (limit ? '&limit=' + encodeURIComponent(String(limit)) : '');
314
+ let headers = yield this.headers;
315
+ return XHR_1.XHR.sendCommand('POST', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
316
+ .then((doc) => new PaginatedListPatient_1.PaginatedListPatient(doc.body))
317
+ .catch((err) => this.handleError(err));
318
+ });
280
319
  }
281
320
  /**
282
321
  * Returns a list of patients
@@ -286,18 +325,20 @@ class IccPatientApi {
286
325
  * @param dateOfBirth The date of birth
287
326
  */
288
327
  fuzzySearch(firstName, lastName, dateOfBirth) {
289
- let _body = null;
290
- const _url = this.host +
291
- `/patient/fuzzy` +
292
- '?ts=' +
293
- new Date().getTime() +
294
- (firstName ? '&firstName=' + encodeURIComponent(String(firstName)) : '') +
295
- (lastName ? '&lastName=' + encodeURIComponent(String(lastName)) : '') +
296
- (dateOfBirth ? '&dateOfBirth=' + encodeURIComponent(String(dateOfBirth)) : '');
297
- let headers = this.headers;
298
- return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
299
- .then((doc) => doc.body.map((it) => new Patient_1.Patient(it)))
300
- .catch((err) => this.handleError(err));
328
+ return __awaiter(this, void 0, void 0, function* () {
329
+ let _body = null;
330
+ const _url = this.host +
331
+ `/patient/fuzzy` +
332
+ '?ts=' +
333
+ new Date().getTime() +
334
+ (firstName ? '&firstName=' + encodeURIComponent(String(firstName)) : '') +
335
+ (lastName ? '&lastName=' + encodeURIComponent(String(lastName)) : '') +
336
+ (dateOfBirth ? '&dateOfBirth=' + encodeURIComponent(String(dateOfBirth)) : '');
337
+ let headers = yield this.headers;
338
+ return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
339
+ .then((doc) => doc.body.map((it) => new Patient_1.Patient(it)))
340
+ .catch((err) => this.handleError(err));
341
+ });
301
342
  }
302
343
  /**
303
344
  * It gets patient administrative data.
@@ -305,12 +346,14 @@ class IccPatientApi {
305
346
  * @param patientId
306
347
  */
307
348
  getPatient(patientId) {
308
- let _body = null;
309
- const _url = this.host + `/patient/${encodeURIComponent(String(patientId))}` + '?ts=' + new Date().getTime();
310
- let headers = this.headers;
311
- return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
312
- .then((doc) => new Patient_1.Patient(doc.body))
313
- .catch((err) => this.handleError(err));
349
+ return __awaiter(this, void 0, void 0, function* () {
350
+ let _body = null;
351
+ const _url = this.host + `/patient/${encodeURIComponent(String(patientId))}` + '?ts=' + new Date().getTime();
352
+ let headers = yield this.headers;
353
+ return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
354
+ .then((doc) => new Patient_1.Patient(doc.body))
355
+ .catch((err) => this.handleError(err));
356
+ });
314
357
  }
315
358
  /**
316
359
  * (key, value) of the map is as follows: (ID of the owner of the encrypted AES key, encrypted AES keys)
@@ -318,12 +361,14 @@ class IccPatientApi {
318
361
  * @param patientId
319
362
  */
320
363
  getPatientAesExchangeKeysForDelegate(patientId) {
321
- let _body = null;
322
- const _url = this.host + `/patient/${encodeURIComponent(String(patientId))}/aesExchangeKeys` + '?ts=' + new Date().getTime();
323
- let headers = this.headers;
324
- return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
325
- .then((doc) => JSON.parse(JSON.stringify(doc.body)))
326
- .catch((err) => this.handleError(err));
364
+ return __awaiter(this, void 0, void 0, function* () {
365
+ let _body = null;
366
+ const _url = this.host + `/patient/${encodeURIComponent(String(patientId))}/aesExchangeKeys` + '?ts=' + new Date().getTime();
367
+ let headers = yield this.headers;
368
+ return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
369
+ .then((doc) => JSON.parse(JSON.stringify(doc.body)))
370
+ .catch((err) => this.handleError(err));
371
+ });
327
372
  }
328
373
  /**
329
374
  * It gets patient administrative data based on the identifier (root & extension) parameters.
@@ -333,16 +378,18 @@ class IccPatientApi {
333
378
  * @param system
334
379
  */
335
380
  getPatientByHealthcarepartyAndIdentifier(hcPartyId, id, system) {
336
- let _body = null;
337
- const _url = this.host +
338
- `/patient/${encodeURIComponent(String(hcPartyId))}/${encodeURIComponent(String(id))}` +
339
- '?ts=' +
340
- new Date().getTime() +
341
- (system ? '&system=' + encodeURIComponent(String(system)) : '');
342
- let headers = this.headers;
343
- return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
344
- .then((doc) => new Patient_1.Patient(doc.body))
345
- .catch((err) => this.handleError(err));
381
+ return __awaiter(this, void 0, void 0, function* () {
382
+ let _body = null;
383
+ const _url = this.host +
384
+ `/patient/${encodeURIComponent(String(hcPartyId))}/${encodeURIComponent(String(id))}` +
385
+ '?ts=' +
386
+ new Date().getTime() +
387
+ (system ? '&system=' + encodeURIComponent(String(system)) : '');
388
+ let headers = yield this.headers;
389
+ return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
390
+ .then((doc) => new Patient_1.Patient(doc.body))
391
+ .catch((err) => this.handleError(err));
392
+ });
346
393
  }
347
394
  /**
348
395
  * This endpoint is used to recover all keys that have already been created and that can be used to share information with this patient. It returns a map with the following structure: ID of the owner of the encrypted AES key -> encrypted AES key. The returned encrypted AES keys will have to be decrypted using the patient's private key. { \"hcparty 1 delegator ID\": \"AES hcparty key (encrypted using patient public RSA key)\" \"hcparty 2 delegator ID\": \"other AES hcparty key (encrypted using patient public RSA key)\" }
@@ -350,12 +397,14 @@ class IccPatientApi {
350
397
  * @param patientId The patient Id for which information is shared
351
398
  */
352
399
  getPatientHcPartyKeysForDelegate(patientId) {
353
- let _body = null;
354
- const _url = this.host + `/patient/${encodeURIComponent(String(patientId))}/keys` + '?ts=' + new Date().getTime();
355
- let headers = this.headers;
356
- return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
357
- .then((doc) => JSON.parse(JSON.stringify(doc.body)))
358
- .catch((err) => this.handleError(err));
400
+ return __awaiter(this, void 0, void 0, function* () {
401
+ let _body = null;
402
+ const _url = this.host + `/patient/${encodeURIComponent(String(patientId))}/keys` + '?ts=' + new Date().getTime();
403
+ let headers = yield this.headers;
404
+ return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
405
+ .then((doc) => JSON.parse(JSON.stringify(doc.body)))
406
+ .catch((err) => this.handleError(err));
407
+ });
359
408
  }
360
409
  /**
361
410
  * It gets patient administrative data.
@@ -363,14 +412,16 @@ class IccPatientApi {
363
412
  * @param body
364
413
  */
365
414
  getPatients(body) {
366
- let _body = null;
367
- _body = body;
368
- const _url = this.host + `/patient/byIds` + '?ts=' + new Date().getTime();
369
- let headers = this.headers;
370
- headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
371
- return XHR_1.XHR.sendCommand('POST', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
372
- .then((doc) => doc.body.map((it) => new Patient_1.Patient(it)))
373
- .catch((err) => this.handleError(err));
415
+ return __awaiter(this, void 0, void 0, function* () {
416
+ let _body = null;
417
+ _body = body;
418
+ const _url = this.host + `/patient/byIds` + '?ts=' + new Date().getTime();
419
+ let headers = yield this.headers;
420
+ headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
421
+ return XHR_1.XHR.sendCommand('POST', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
422
+ .then((doc) => doc.body.map((it) => new Patient_1.Patient(it)))
423
+ .catch((err) => this.handleError(err));
424
+ });
374
425
  }
375
426
  /**
376
427
  * Returns a list of deleted patients, within the specified time period, if any.
@@ -382,20 +433,22 @@ class IccPatientApi {
382
433
  * @param limit Number of rows
383
434
  */
384
435
  listDeletedPatients(startDate, endDate, desc, startDocumentId, limit) {
385
- let _body = null;
386
- const _url = this.host +
387
- `/patient/deleted/by_date` +
388
- '?ts=' +
389
- new Date().getTime() +
390
- (startDate ? '&startDate=' + encodeURIComponent(String(startDate)) : '') +
391
- (endDate ? '&endDate=' + encodeURIComponent(String(endDate)) : '') +
392
- (desc ? '&desc=' + encodeURIComponent(String(desc)) : '') +
393
- (startDocumentId ? '&startDocumentId=' + encodeURIComponent(String(startDocumentId)) : '') +
394
- (limit ? '&limit=' + encodeURIComponent(String(limit)) : '');
395
- let headers = this.headers;
396
- return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
397
- .then((doc) => new PaginatedListPatient_1.PaginatedListPatient(doc.body))
398
- .catch((err) => this.handleError(err));
436
+ return __awaiter(this, void 0, void 0, function* () {
437
+ let _body = null;
438
+ const _url = this.host +
439
+ `/patient/deleted/by_date` +
440
+ '?ts=' +
441
+ new Date().getTime() +
442
+ (startDate ? '&startDate=' + encodeURIComponent(String(startDate)) : '') +
443
+ (endDate ? '&endDate=' + encodeURIComponent(String(endDate)) : '') +
444
+ (desc ? '&desc=' + encodeURIComponent(String(desc)) : '') +
445
+ (startDocumentId ? '&startDocumentId=' + encodeURIComponent(String(startDocumentId)) : '') +
446
+ (limit ? '&limit=' + encodeURIComponent(String(limit)) : '');
447
+ let headers = yield this.headers;
448
+ return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
449
+ .then((doc) => new PaginatedListPatient_1.PaginatedListPatient(doc.body))
450
+ .catch((err) => this.handleError(err));
451
+ });
399
452
  }
400
453
  /**
401
454
  * Returns a list of deleted patients, by name and/or firstname prefix, if any.
@@ -404,17 +457,19 @@ class IccPatientApi {
404
457
  * @param lastName Last name prefix
405
458
  */
406
459
  listDeletedPatientsByName(firstName, lastName) {
407
- let _body = null;
408
- const _url = this.host +
409
- `/patient/deleted/by_name` +
410
- '?ts=' +
411
- new Date().getTime() +
412
- (firstName ? '&firstName=' + encodeURIComponent(String(firstName)) : '') +
413
- (lastName ? '&lastName=' + encodeURIComponent(String(lastName)) : '');
414
- let headers = this.headers;
415
- return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
416
- .then((doc) => doc.body.map((it) => new Patient_1.Patient(it)))
417
- .catch((err) => this.handleError(err));
460
+ return __awaiter(this, void 0, void 0, function* () {
461
+ let _body = null;
462
+ const _url = this.host +
463
+ `/patient/deleted/by_name` +
464
+ '?ts=' +
465
+ new Date().getTime() +
466
+ (firstName ? '&firstName=' + encodeURIComponent(String(firstName)) : '') +
467
+ (lastName ? '&lastName=' + encodeURIComponent(String(lastName)) : '');
468
+ let headers = yield this.headers;
469
+ return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
470
+ .then((doc) => doc.body.map((it) => new Patient_1.Patient(it)))
471
+ .catch((err) => this.handleError(err));
472
+ });
418
473
  }
419
474
  /**
420
475
  * Returns a list of patients that have been merged after the provided date
@@ -422,12 +477,14 @@ class IccPatientApi {
422
477
  * @param date
423
478
  */
424
479
  listOfMergesAfter(date) {
425
- let _body = null;
426
- const _url = this.host + `/patient/merges/${encodeURIComponent(String(date))}` + '?ts=' + new Date().getTime();
427
- let headers = this.headers;
428
- return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
429
- .then((doc) => doc.body.map((it) => new Patient_1.Patient(it)))
430
- .catch((err) => this.handleError(err));
480
+ return __awaiter(this, void 0, void 0, function* () {
481
+ let _body = null;
482
+ const _url = this.host + `/patient/merges/${encodeURIComponent(String(date))}` + '?ts=' + new Date().getTime();
483
+ let headers = yield this.headers;
484
+ return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
485
+ .then((doc) => doc.body.map((it) => new Patient_1.Patient(it)))
486
+ .catch((err) => this.handleError(err));
487
+ });
431
488
  }
432
489
  /**
433
490
  * Returns a list of patients that have been modified after the provided date
@@ -438,18 +495,20 @@ class IccPatientApi {
438
495
  * @param limit Number of rows
439
496
  */
440
497
  listOfPatientsModifiedAfter(date, startKey, startDocumentId, limit) {
441
- let _body = null;
442
- const _url = this.host +
443
- `/patient/modifiedAfter/${encodeURIComponent(String(date))}` +
444
- '?ts=' +
445
- new Date().getTime() +
446
- (startKey ? '&startKey=' + encodeURIComponent(String(startKey)) : '') +
447
- (startDocumentId ? '&startDocumentId=' + encodeURIComponent(String(startDocumentId)) : '') +
448
- (limit ? '&limit=' + encodeURIComponent(String(limit)) : '');
449
- let headers = this.headers;
450
- return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
451
- .then((doc) => new PaginatedListPatient_1.PaginatedListPatient(doc.body))
452
- .catch((err) => this.handleError(err));
498
+ return __awaiter(this, void 0, void 0, function* () {
499
+ let _body = null;
500
+ const _url = this.host +
501
+ `/patient/modifiedAfter/${encodeURIComponent(String(date))}` +
502
+ '?ts=' +
503
+ new Date().getTime() +
504
+ (startKey ? '&startKey=' + encodeURIComponent(String(startKey)) : '') +
505
+ (startDocumentId ? '&startDocumentId=' + encodeURIComponent(String(startDocumentId)) : '') +
506
+ (limit ? '&limit=' + encodeURIComponent(String(limit)) : '');
507
+ let headers = yield this.headers;
508
+ return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
509
+ .then((doc) => new PaginatedListPatient_1.PaginatedListPatient(doc.body))
510
+ .catch((err) => this.handleError(err));
511
+ });
453
512
  }
454
513
  /**
455
514
  * Returns a list of patients along with next start keys and Document ID. If the nextStartKey is Null it means that this is the last page.
@@ -462,21 +521,23 @@ class IccPatientApi {
462
521
  * @param sortDirection Optional value for providing a sorting direction ('asc', 'desc'). Set to 'asc' by default.
463
522
  */
464
523
  listPatients(hcPartyId, sortField, startKey, startDocumentId, limit, sortDirection) {
465
- let _body = null;
466
- const _url = this.host +
467
- `/patient` +
468
- '?ts=' +
469
- new Date().getTime() +
470
- (hcPartyId ? '&hcPartyId=' + encodeURIComponent(String(hcPartyId)) : '') +
471
- (sortField ? '&sortField=' + encodeURIComponent(String(sortField)) : '') +
472
- (startKey ? '&startKey=' + encodeURIComponent(String(startKey)) : '') +
473
- (startDocumentId ? '&startDocumentId=' + encodeURIComponent(String(startDocumentId)) : '') +
474
- (limit ? '&limit=' + encodeURIComponent(String(limit)) : '') +
475
- (sortDirection ? '&sortDirection=' + encodeURIComponent(String(sortDirection)) : '');
476
- let headers = this.headers;
477
- return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
478
- .then((doc) => new PaginatedListPatient_1.PaginatedListPatient(doc.body))
479
- .catch((err) => this.handleError(err));
524
+ return __awaiter(this, void 0, void 0, function* () {
525
+ let _body = null;
526
+ const _url = this.host +
527
+ `/patient` +
528
+ '?ts=' +
529
+ new Date().getTime() +
530
+ (hcPartyId ? '&hcPartyId=' + encodeURIComponent(String(hcPartyId)) : '') +
531
+ (sortField ? '&sortField=' + encodeURIComponent(String(sortField)) : '') +
532
+ (startKey ? '&startKey=' + encodeURIComponent(String(startKey)) : '') +
533
+ (startDocumentId ? '&startDocumentId=' + encodeURIComponent(String(startDocumentId)) : '') +
534
+ (limit ? '&limit=' + encodeURIComponent(String(limit)) : '') +
535
+ (sortDirection ? '&sortDirection=' + encodeURIComponent(String(sortDirection)) : '');
536
+ let headers = yield this.headers;
537
+ return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
538
+ .then((doc) => new PaginatedListPatient_1.PaginatedListPatient(doc.body))
539
+ .catch((err) => this.handleError(err));
540
+ });
480
541
  }
481
542
  /**
482
543
  * Returns a list of patients along with next start keys and Document ID. If the nextStartKey is Null it means that this is the last page.
@@ -489,20 +550,22 @@ class IccPatientApi {
489
550
  * @param sortDirection Optional value for providing a sorting direction ('asc', 'desc'). Set to 'asc' by default.
490
551
  */
491
552
  listPatientsByHcParty(hcPartyId, sortField, startKey, startDocumentId, limit, sortDirection) {
492
- let _body = null;
493
- const _url = this.host +
494
- `/patient/hcParty/${encodeURIComponent(String(hcPartyId))}` +
495
- '?ts=' +
496
- new Date().getTime() +
497
- (sortField ? '&sortField=' + encodeURIComponent(String(sortField)) : '') +
498
- (startKey ? '&startKey=' + encodeURIComponent(String(startKey)) : '') +
499
- (startDocumentId ? '&startDocumentId=' + encodeURIComponent(String(startDocumentId)) : '') +
500
- (limit ? '&limit=' + encodeURIComponent(String(limit)) : '') +
501
- (sortDirection ? '&sortDirection=' + encodeURIComponent(String(sortDirection)) : '');
502
- let headers = this.headers;
503
- return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
504
- .then((doc) => new PaginatedListPatient_1.PaginatedListPatient(doc.body))
505
- .catch((err) => this.handleError(err));
553
+ return __awaiter(this, void 0, void 0, function* () {
554
+ let _body = null;
555
+ const _url = this.host +
556
+ `/patient/hcParty/${encodeURIComponent(String(hcPartyId))}` +
557
+ '?ts=' +
558
+ new Date().getTime() +
559
+ (sortField ? '&sortField=' + encodeURIComponent(String(sortField)) : '') +
560
+ (startKey ? '&startKey=' + encodeURIComponent(String(startKey)) : '') +
561
+ (startDocumentId ? '&startDocumentId=' + encodeURIComponent(String(startDocumentId)) : '') +
562
+ (limit ? '&limit=' + encodeURIComponent(String(limit)) : '') +
563
+ (sortDirection ? '&sortDirection=' + encodeURIComponent(String(sortDirection)) : '');
564
+ let headers = yield this.headers;
565
+ return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
566
+ .then((doc) => new PaginatedListPatient_1.PaginatedListPatient(doc.body))
567
+ .catch((err) => this.handleError(err));
568
+ });
506
569
  }
507
570
  /**
508
571
  * Returns a list of patients along with next start keys and Document ID. If the nextStartKey is Null it means that this is the last page.
@@ -513,19 +576,21 @@ class IccPatientApi {
513
576
  * @param limit Page size
514
577
  */
515
578
  listPatientsIds(hcPartyId, startKey, startDocumentId, limit) {
516
- let _body = null;
517
- const _url = this.host +
518
- `/patient/idsPages` +
519
- '?ts=' +
520
- new Date().getTime() +
521
- (hcPartyId ? '&hcPartyId=' + encodeURIComponent(String(hcPartyId)) : '') +
522
- (startKey ? '&startKey=' + encodeURIComponent(String(startKey)) : '') +
523
- (startDocumentId ? '&startDocumentId=' + encodeURIComponent(String(startDocumentId)) : '') +
524
- (limit ? '&limit=' + encodeURIComponent(String(limit)) : '');
525
- let headers = this.headers;
526
- return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
527
- .then((doc) => new PaginatedListString_1.PaginatedListString(doc.body))
528
- .catch((err) => this.handleError(err));
579
+ return __awaiter(this, void 0, void 0, function* () {
580
+ let _body = null;
581
+ const _url = this.host +
582
+ `/patient/idsPages` +
583
+ '?ts=' +
584
+ new Date().getTime() +
585
+ (hcPartyId ? '&hcPartyId=' + encodeURIComponent(String(hcPartyId)) : '') +
586
+ (startKey ? '&startKey=' + encodeURIComponent(String(startKey)) : '') +
587
+ (startDocumentId ? '&startDocumentId=' + encodeURIComponent(String(startDocumentId)) : '') +
588
+ (limit ? '&limit=' + encodeURIComponent(String(limit)) : '');
589
+ let headers = yield this.headers;
590
+ return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
591
+ .then((doc) => new PaginatedListString_1.PaginatedListString(doc.body))
592
+ .catch((err) => this.handleError(err));
593
+ });
529
594
  }
530
595
  /**
531
596
  * Returns a list of patients along with next start keys and Document ID. If the nextStartKey is Null it means that this is the last page.
@@ -538,20 +603,22 @@ class IccPatientApi {
538
603
  * @param sortDirection Optional value for providing a sorting direction ('asc', 'desc'). Set to 'asc' by default.
539
604
  */
540
605
  listPatientsOfHcParty(hcPartyId, sortField, startKey, startDocumentId, limit, sortDirection) {
541
- let _body = null;
542
- const _url = this.host +
543
- `/patient/ofHcParty/${encodeURIComponent(String(hcPartyId))}` +
544
- '?ts=' +
545
- new Date().getTime() +
546
- (sortField ? '&sortField=' + encodeURIComponent(String(sortField)) : '') +
547
- (startKey ? '&startKey=' + encodeURIComponent(String(startKey)) : '') +
548
- (startDocumentId ? '&startDocumentId=' + encodeURIComponent(String(startDocumentId)) : '') +
549
- (limit ? '&limit=' + encodeURIComponent(String(limit)) : '') +
550
- (sortDirection ? '&sortDirection=' + encodeURIComponent(String(sortDirection)) : '');
551
- let headers = this.headers;
552
- return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
553
- .then((doc) => new PaginatedListPatient_1.PaginatedListPatient(doc.body))
554
- .catch((err) => this.handleError(err));
606
+ return __awaiter(this, void 0, void 0, function* () {
607
+ let _body = null;
608
+ const _url = this.host +
609
+ `/patient/ofHcParty/${encodeURIComponent(String(hcPartyId))}` +
610
+ '?ts=' +
611
+ new Date().getTime() +
612
+ (sortField ? '&sortField=' + encodeURIComponent(String(sortField)) : '') +
613
+ (startKey ? '&startKey=' + encodeURIComponent(String(startKey)) : '') +
614
+ (startDocumentId ? '&startDocumentId=' + encodeURIComponent(String(startDocumentId)) : '') +
615
+ (limit ? '&limit=' + encodeURIComponent(String(limit)) : '') +
616
+ (sortDirection ? '&sortDirection=' + encodeURIComponent(String(sortDirection)) : '');
617
+ let headers = yield this.headers;
618
+ return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
619
+ .then((doc) => new PaginatedListPatient_1.PaginatedListPatient(doc.body))
620
+ .catch((err) => this.handleError(err));
621
+ });
555
622
  }
556
623
  /**
557
624
  *
@@ -559,14 +626,16 @@ class IccPatientApi {
559
626
  * @param body
560
627
  */
561
628
  matchPatientsBy(body) {
562
- let _body = null;
563
- _body = body;
564
- const _url = this.host + `/patient/match` + '?ts=' + new Date().getTime();
565
- let headers = this.headers;
566
- headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
567
- return XHR_1.XHR.sendCommand('POST', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
568
- .then((doc) => doc.body.map((it) => JSON.parse(JSON.stringify(it))))
569
- .catch((err) => this.handleError(err));
629
+ return __awaiter(this, void 0, void 0, function* () {
630
+ let _body = null;
631
+ _body = body;
632
+ const _url = this.host + `/patient/match` + '?ts=' + new Date().getTime();
633
+ let headers = yield this.headers;
634
+ headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
635
+ return XHR_1.XHR.sendCommand('POST', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
636
+ .then((doc) => doc.body.map((it) => JSON.parse(JSON.stringify(it))))
637
+ .catch((err) => this.handleError(err));
638
+ });
570
639
  }
571
640
  /**
572
641
  *
@@ -575,12 +644,14 @@ class IccPatientApi {
575
644
  * @param fromIds
576
645
  */
577
646
  mergeInto(toId, fromIds) {
578
- let _body = null;
579
- const _url = this.host + `/patient/mergeInto/${encodeURIComponent(String(toId))}/from/${encodeURIComponent(String(fromIds))}` + '?ts=' + new Date().getTime();
580
- let headers = this.headers;
581
- return XHR_1.XHR.sendCommand('PUT', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
582
- .then((doc) => new Patient_1.Patient(doc.body))
583
- .catch((err) => this.handleError(err));
647
+ return __awaiter(this, void 0, void 0, function* () {
648
+ let _body = null;
649
+ const _url = this.host + `/patient/mergeInto/${encodeURIComponent(String(toId))}/from/${encodeURIComponent(String(fromIds))}` + '?ts=' + new Date().getTime();
650
+ let headers = yield this.headers;
651
+ return XHR_1.XHR.sendCommand('PUT', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
652
+ .then((doc) => new Patient_1.Patient(doc.body))
653
+ .catch((err) => this.handleError(err));
654
+ });
584
655
  }
585
656
  /**
586
657
  * No particular return value. It's just a message.
@@ -588,14 +659,16 @@ class IccPatientApi {
588
659
  * @param body
589
660
  */
590
661
  modifyPatient(body) {
591
- let _body = null;
592
- _body = body;
593
- const _url = this.host + `/patient` + '?ts=' + new Date().getTime();
594
- let headers = this.headers;
595
- headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
596
- return XHR_1.XHR.sendCommand('PUT', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
597
- .then((doc) => new Patient_1.Patient(doc.body))
598
- .catch((err) => this.handleError(err));
662
+ return __awaiter(this, void 0, void 0, function* () {
663
+ let _body = null;
664
+ _body = body;
665
+ const _url = this.host + `/patient` + '?ts=' + new Date().getTime();
666
+ let headers = yield this.headers;
667
+ headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
668
+ return XHR_1.XHR.sendCommand('PUT', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
669
+ .then((doc) => new Patient_1.Patient(doc.body))
670
+ .catch((err) => this.handleError(err));
671
+ });
599
672
  }
600
673
  /**
601
674
  *
@@ -606,17 +679,19 @@ class IccPatientApi {
606
679
  * @param end Optional value for end of referral
607
680
  */
608
681
  modifyPatientReferral(patientId, referralId, start, end) {
609
- let _body = null;
610
- const _url = this.host +
611
- `/patient/${encodeURIComponent(String(patientId))}/referral/${encodeURIComponent(String(referralId))}` +
612
- '?ts=' +
613
- new Date().getTime() +
614
- (start ? '&start=' + encodeURIComponent(String(start)) : '') +
615
- (end ? '&end=' + encodeURIComponent(String(end)) : '');
616
- let headers = this.headers;
617
- return XHR_1.XHR.sendCommand('PUT', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
618
- .then((doc) => new Patient_1.Patient(doc.body))
619
- .catch((err) => this.handleError(err));
682
+ return __awaiter(this, void 0, void 0, function* () {
683
+ let _body = null;
684
+ const _url = this.host +
685
+ `/patient/${encodeURIComponent(String(patientId))}/referral/${encodeURIComponent(String(referralId))}` +
686
+ '?ts=' +
687
+ new Date().getTime() +
688
+ (start ? '&start=' + encodeURIComponent(String(start)) : '') +
689
+ (end ? '&end=' + encodeURIComponent(String(end)) : '');
690
+ let headers = yield this.headers;
691
+ return XHR_1.XHR.sendCommand('PUT', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
692
+ .then((doc) => new Patient_1.Patient(doc.body))
693
+ .catch((err) => this.handleError(err));
694
+ });
620
695
  }
621
696
  /**
622
697
  * It delegates a patient to a healthcare party (By current healthcare party). A modified patient with new delegation gets returned.
@@ -625,14 +700,16 @@ class IccPatientApi {
625
700
  * @param patientId
626
701
  */
627
702
  newPatientDelegations(patientId, body) {
628
- let _body = null;
629
- _body = body;
630
- const _url = this.host + `/patient/${encodeURIComponent(String(patientId))}/delegate` + '?ts=' + new Date().getTime();
631
- let headers = this.headers;
632
- headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
633
- return XHR_1.XHR.sendCommand('POST', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
634
- .then((doc) => new Patient_1.Patient(doc.body))
635
- .catch((err) => this.handleError(err));
703
+ return __awaiter(this, void 0, void 0, function* () {
704
+ let _body = null;
705
+ _body = body;
706
+ const _url = this.host + `/patient/${encodeURIComponent(String(patientId))}/delegate` + '?ts=' + new Date().getTime();
707
+ let headers = yield this.headers;
708
+ headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
709
+ return XHR_1.XHR.sendCommand('POST', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
710
+ .then((doc) => new Patient_1.Patient(doc.body))
711
+ .catch((err) => this.handleError(err));
712
+ });
636
713
  }
637
714
  /**
638
715
  * Register a new patient into the system
@@ -644,19 +721,21 @@ class IccPatientApi {
644
721
  * @param useShortToken
645
722
  */
646
723
  registerPatient(hcPartyId, groupId, token, useShortToken, body) {
647
- let _body = null;
648
- _body = body;
649
- const _url = this.host +
650
- `/patient/register/forHcp/${encodeURIComponent(String(hcPartyId))}/inGroup/${encodeURIComponent(String(groupId))}` +
651
- '?ts=' +
652
- new Date().getTime() +
653
- (token ? '&token=' + encodeURIComponent(String(token)) : '') +
654
- (useShortToken ? '&useShortToken=' + encodeURIComponent(String(useShortToken)) : '');
655
- let headers = this.headers;
656
- headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
657
- return XHR_1.XHR.sendCommand('POST', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
658
- .then((doc) => new DataOwnerRegistrationSuccess_1.DataOwnerRegistrationSuccess(doc.body))
659
- .catch((err) => this.handleError(err));
724
+ return __awaiter(this, void 0, void 0, function* () {
725
+ let _body = null;
726
+ _body = body;
727
+ const _url = this.host +
728
+ `/patient/register/forHcp/${encodeURIComponent(String(hcPartyId))}/inGroup/${encodeURIComponent(String(groupId))}` +
729
+ '?ts=' +
730
+ new Date().getTime() +
731
+ (token ? '&token=' + encodeURIComponent(String(token)) : '') +
732
+ (useShortToken ? '&useShortToken=' + encodeURIComponent(String(useShortToken)) : '');
733
+ let headers = yield this.headers;
734
+ headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
735
+ return XHR_1.XHR.sendCommand('POST', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
736
+ .then((doc) => new DataOwnerRegistrationSuccess_1.DataOwnerRegistrationSuccess(doc.body))
737
+ .catch((err) => this.handleError(err));
738
+ });
660
739
  }
661
740
  /**
662
741
  * Response is an array containing the ID of undeleted patient..
@@ -664,29 +743,46 @@ class IccPatientApi {
664
743
  * @param patientIds
665
744
  */
666
745
  undeletePatient(patientIds) {
667
- let _body = null;
668
- const _url = this.host + `/patient/undelete/${encodeURIComponent(String(patientIds))}` + '?ts=' + new Date().getTime();
669
- let headers = this.headers;
670
- return XHR_1.XHR.sendCommand('PUT', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
671
- .then((doc) => doc.body.map((it) => new DocIdentifier_1.DocIdentifier(it)))
672
- .catch((err) => this.handleError(err));
746
+ return __awaiter(this, void 0, void 0, function* () {
747
+ let _body = null;
748
+ const _url = this.host + `/patient/undelete/${encodeURIComponent(String(patientIds))}` + '?ts=' + new Date().getTime();
749
+ let headers = yield this.headers;
750
+ return XHR_1.XHR.sendCommand('PUT', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
751
+ .then((doc) => doc.body.map((it) => new DocIdentifier_1.DocIdentifier(it)))
752
+ .catch((err) => this.handleError(err));
753
+ });
754
+ }
755
+ /**
756
+ * @internal this method is for internal use only and may be changed without notice
757
+ */
758
+ bulkSharePatients(request) {
759
+ return __awaiter(this, void 0, void 0, function* () {
760
+ const _url = this.host + '/patient/bulkSharedMetadataUpdate' + '?ts=' + new Date().getTime();
761
+ let headers = yield this.headers;
762
+ headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
763
+ return XHR_1.XHR.sendCommand('PUT', _url, headers, request, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
764
+ .then((doc) => doc.body.map((x) => new EntityBulkShareResult_1.EntityBulkShareResult(x, Patient_1.Patient)))
765
+ .catch((err) => this.handleError(err));
766
+ });
673
767
  }
674
768
  /**
675
769
  * @internal use mergePatients from the extended api instead
676
770
  */
677
771
  baseMergePatients(fromId, expectedFromRev, updatedInto) {
678
- let _body = updatedInto;
679
- const _url = this.host +
680
- `/patient/mergeInto/${encodeURIComponent(String(updatedInto.id))}/from/${encodeURIComponent(String(fromId))}` +
681
- '?ts=' +
682
- new Date().getTime() +
683
- '&expectedFromRev=' +
684
- encodeURIComponent(String(expectedFromRev));
685
- let headers = this.headers;
686
- headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
687
- return XHR_1.XHR.sendCommand('PUT', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
688
- .then((doc) => new Patient_1.Patient(doc.body))
689
- .catch((err) => this.handleError(err));
772
+ return __awaiter(this, void 0, void 0, function* () {
773
+ let _body = updatedInto;
774
+ const _url = this.host +
775
+ `/patient/mergeInto/${encodeURIComponent(String(updatedInto.id))}/from/${encodeURIComponent(String(fromId))}` +
776
+ '?ts=' +
777
+ new Date().getTime() +
778
+ '&expectedFromRev=' +
779
+ encodeURIComponent(String(expectedFromRev));
780
+ let headers = yield this.headers;
781
+ headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
782
+ return XHR_1.XHR.sendCommand('PUT', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
783
+ .then((doc) => new Patient_1.Patient(doc.body))
784
+ .catch((err) => this.handleError(err));
785
+ });
690
786
  }
691
787
  }
692
788
  exports.IccPatientApi = IccPatientApi;