gdc-sdk-front-ts 2.2.1 → 2.3.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 (387) hide show
  1. package/dist/ProfileManager.js +6 -3
  2. package/dist/front-clinical-runtime-client.d.ts +69 -0
  3. package/dist/front-clinical-runtime-client.js +214 -0
  4. package/dist/index.d.ts +1 -0
  5. package/dist/index.js +1 -0
  6. package/dist/orchestration/client-port.d.ts +21 -3
  7. package/dist/orchestration/individual-member-sdk.d.ts +11 -1
  8. package/dist/orchestration/individual-member-sdk.js +12 -0
  9. package/dist/orchestration/professional-sdk.d.ts +7 -1
  10. package/dist/orchestration/professional-sdk.js +6 -0
  11. package/package.json +3 -3
  12. package/dist/discovery/HttpDataspaceDiscoveryClient.d.ts +0 -34
  13. package/dist/discovery/HttpDataspaceDiscoveryClient.js +0 -47
  14. package/dist/gdc-common-utils-ts/src/AesManager.d.ts +0 -27
  15. package/dist/gdc-common-utils-ts/src/AesManager.js +0 -64
  16. package/dist/gdc-common-utils-ts/src/CryptographyService.d.ts +0 -76
  17. package/dist/gdc-common-utils-ts/src/CryptographyService.js +0 -401
  18. package/dist/gdc-common-utils-ts/src/constants/actor-session.d.ts +0 -40
  19. package/dist/gdc-common-utils-ts/src/constants/actor-session.js +0 -40
  20. package/dist/gdc-common-utils-ts/src/constants/communication.d.ts +0 -28
  21. package/dist/gdc-common-utils-ts/src/constants/communication.js +0 -14
  22. package/dist/gdc-common-utils-ts/src/constants/cryptography.d.ts +0 -58
  23. package/dist/gdc-common-utils-ts/src/constants/cryptography.js +0 -49
  24. package/dist/gdc-common-utils-ts/src/constants/dataspace-discovery.d.ts +0 -11
  25. package/dist/gdc-common-utils-ts/src/constants/dataspace-discovery.js +0 -11
  26. package/dist/gdc-common-utils-ts/src/constants/dataspace-protocol.d.ts +0 -27
  27. package/dist/gdc-common-utils-ts/src/constants/dataspace-protocol.js +0 -27
  28. package/dist/gdc-common-utils-ts/src/constants/device.d.ts +0 -16
  29. package/dist/gdc-common-utils-ts/src/constants/device.js +0 -15
  30. package/dist/gdc-common-utils-ts/src/constants/did-services.d.ts +0 -42
  31. package/dist/gdc-common-utils-ts/src/constants/did-services.js +0 -40
  32. package/dist/gdc-common-utils-ts/src/constants/eu-countries.d.ts +0 -36
  33. package/dist/gdc-common-utils-ts/src/constants/eu-countries.js +0 -69
  34. package/dist/gdc-common-utils-ts/src/constants/fhir-code-systems.d.ts +0 -12
  35. package/dist/gdc-common-utils-ts/src/constants/fhir-code-systems.js +0 -12
  36. package/dist/gdc-common-utils-ts/src/constants/fhir-resource-types.d.ts +0 -52
  37. package/dist/gdc-common-utils-ts/src/constants/fhir-resource-types.js +0 -33
  38. package/dist/gdc-common-utils-ts/src/constants/fhir-versions.d.ts +0 -10
  39. package/dist/gdc-common-utils-ts/src/constants/fhir-versions.js +0 -10
  40. package/dist/gdc-common-utils-ts/src/constants/healthcare.d.ts +0 -496
  41. package/dist/gdc-common-utils-ts/src/constants/healthcare.js +0 -274
  42. package/dist/gdc-common-utils-ts/src/constants/hl7-roles.d.ts +0 -44
  43. package/dist/gdc-common-utils-ts/src/constants/hl7-roles.js +0 -208
  44. package/dist/gdc-common-utils-ts/src/constants/index.d.ts +0 -21
  45. package/dist/gdc-common-utils-ts/src/constants/index.js +0 -21
  46. package/dist/gdc-common-utils-ts/src/constants/network.d.ts +0 -25
  47. package/dist/gdc-common-utils-ts/src/constants/network.js +0 -17
  48. package/dist/gdc-common-utils-ts/src/constants/schemaorg.d.ts +0 -175
  49. package/dist/gdc-common-utils-ts/src/constants/schemaorg.js +0 -261
  50. package/dist/gdc-common-utils-ts/src/constants/sectors.d.ts +0 -24
  51. package/dist/gdc-common-utils-ts/src/constants/sectors.js +0 -24
  52. package/dist/gdc-common-utils-ts/src/constants/service-capabilities.d.ts +0 -82
  53. package/dist/gdc-common-utils-ts/src/constants/service-capabilities.js +0 -105
  54. package/dist/gdc-common-utils-ts/src/constants/smart.d.ts +0 -12
  55. package/dist/gdc-common-utils-ts/src/constants/smart.js +0 -12
  56. package/dist/gdc-common-utils-ts/src/constants/urn.d.ts +0 -11
  57. package/dist/gdc-common-utils-ts/src/constants/urn.js +0 -11
  58. package/dist/gdc-common-utils-ts/src/constants/verifiable-credentials.d.ts +0 -34
  59. package/dist/gdc-common-utils-ts/src/constants/verifiable-credentials.js +0 -42
  60. package/dist/gdc-common-utils-ts/src/constants/vital-signs.d.ts +0 -75
  61. package/dist/gdc-common-utils-ts/src/constants/vital-signs.js +0 -33
  62. package/dist/gdc-common-utils-ts/src/examples/api-flow-examples.d.ts +0 -15
  63. package/dist/gdc-common-utils-ts/src/examples/api-flow-examples.js +0 -16
  64. package/dist/gdc-common-utils-ts/src/examples/communication-bundle-session.d.ts +0 -22
  65. package/dist/gdc-common-utils-ts/src/examples/communication-bundle-session.js +0 -81
  66. package/dist/gdc-common-utils-ts/src/examples/consent-access.d.ts +0 -30
  67. package/dist/gdc-common-utils-ts/src/examples/consent-access.js +0 -121
  68. package/dist/gdc-common-utils-ts/src/examples/contract-examples.d.ts +0 -15
  69. package/dist/gdc-common-utils-ts/src/examples/contract-examples.js +0 -16
  70. package/dist/gdc-common-utils-ts/src/examples/dataspace-discovery.d.ts +0 -98
  71. package/dist/gdc-common-utils-ts/src/examples/dataspace-discovery.js +0 -141
  72. package/dist/gdc-common-utils-ts/src/examples/frontend-session.d.ts +0 -13
  73. package/dist/gdc-common-utils-ts/src/examples/frontend-session.js +0 -24
  74. package/dist/gdc-common-utils-ts/src/examples/ica-activation-proof.d.ts +0 -64
  75. package/dist/gdc-common-utils-ts/src/examples/ica-activation-proof.js +0 -77
  76. package/dist/gdc-common-utils-ts/src/examples/index.d.ts +0 -14
  77. package/dist/gdc-common-utils-ts/src/examples/index.js +0 -14
  78. package/dist/gdc-common-utils-ts/src/examples/individual-controller.d.ts +0 -100
  79. package/dist/gdc-common-utils-ts/src/examples/individual-controller.js +0 -71
  80. package/dist/gdc-common-utils-ts/src/examples/lifecycle.d.ts +0 -505
  81. package/dist/gdc-common-utils-ts/src/examples/lifecycle.js +0 -291
  82. package/dist/gdc-common-utils-ts/src/examples/organization-controller.d.ts +0 -163
  83. package/dist/gdc-common-utils-ts/src/examples/organization-controller.js +0 -93
  84. package/dist/gdc-common-utils-ts/src/examples/professional.d.ts +0 -228
  85. package/dist/gdc-common-utils-ts/src/examples/professional.js +0 -324
  86. package/dist/gdc-common-utils-ts/src/examples/related-person.d.ts +0 -10
  87. package/dist/gdc-common-utils-ts/src/examples/related-person.js +0 -13
  88. package/dist/gdc-common-utils-ts/src/examples/relationship-access.d.ts +0 -11
  89. package/dist/gdc-common-utils-ts/src/examples/relationship-access.js +0 -96
  90. package/dist/gdc-common-utils-ts/src/examples/shared.d.ts +0 -220
  91. package/dist/gdc-common-utils-ts/src/examples/shared.js +0 -191
  92. package/dist/gdc-common-utils-ts/src/hmac.d.ts +0 -14
  93. package/dist/gdc-common-utils-ts/src/hmac.js +0 -24
  94. package/dist/gdc-common-utils-ts/src/i18n/clinical-sections.i18n.d.ts +0 -6
  95. package/dist/gdc-common-utils-ts/src/i18n/clinical-sections.i18n.js +0 -15
  96. package/dist/gdc-common-utils-ts/src/i18n/role-codes.i18n.d.ts +0 -4
  97. package/dist/gdc-common-utils-ts/src/i18n/role-codes.i18n.js +0 -13
  98. package/dist/gdc-common-utils-ts/src/index.d.ts +0 -10
  99. package/dist/gdc-common-utils-ts/src/index.js +0 -10
  100. package/dist/gdc-common-utils-ts/src/interfaces/Cryptography.types.d.ts +0 -139
  101. package/dist/gdc-common-utils-ts/src/interfaces/Cryptography.types.js +0 -8
  102. package/dist/gdc-common-utils-ts/src/interfaces/ICryptoHelper.d.ts +0 -28
  103. package/dist/gdc-common-utils-ts/src/interfaces/ICryptoHelper.js +0 -3
  104. package/dist/gdc-common-utils-ts/src/interfaces/ICryptography.d.ts +0 -154
  105. package/dist/gdc-common-utils-ts/src/interfaces/ICryptography.js +0 -3
  106. package/dist/gdc-common-utils-ts/src/models/actor-session.d.ts +0 -9
  107. package/dist/gdc-common-utils-ts/src/models/actor-session.js +0 -3
  108. package/dist/gdc-common-utils-ts/src/models/aes.d.ts +0 -85
  109. package/dist/gdc-common-utils-ts/src/models/aes.js +0 -10
  110. package/dist/gdc-common-utils-ts/src/models/auth.d.ts +0 -35
  111. package/dist/gdc-common-utils-ts/src/models/auth.js +0 -3
  112. package/dist/gdc-common-utils-ts/src/models/bundle.d.ts +0 -153
  113. package/dist/gdc-common-utils-ts/src/models/bundle.js +0 -25
  114. package/dist/gdc-common-utils-ts/src/models/clinical-sections.d.ts +0 -36
  115. package/dist/gdc-common-utils-ts/src/models/clinical-sections.en.d.ts +0 -150
  116. package/dist/gdc-common-utils-ts/src/models/clinical-sections.en.js +0 -104
  117. package/dist/gdc-common-utils-ts/src/models/clinical-sections.js +0 -32
  118. package/dist/gdc-common-utils-ts/src/models/clinical-workbook-summary.d.ts +0 -126
  119. package/dist/gdc-common-utils-ts/src/models/clinical-workbook-summary.js +0 -67
  120. package/dist/gdc-common-utils-ts/src/models/comm.d.ts +0 -56
  121. package/dist/gdc-common-utils-ts/src/models/comm.js +0 -4
  122. package/dist/gdc-common-utils-ts/src/models/confidential-job.d.ts +0 -78
  123. package/dist/gdc-common-utils-ts/src/models/confidential-job.js +0 -20
  124. package/dist/gdc-common-utils-ts/src/models/confidential-message.d.ts +0 -97
  125. package/dist/gdc-common-utils-ts/src/models/confidential-message.js +0 -4
  126. package/dist/gdc-common-utils-ts/src/models/confidential-storage.d.ts +0 -134
  127. package/dist/gdc-common-utils-ts/src/models/confidential-storage.js +0 -3
  128. package/dist/gdc-common-utils-ts/src/models/consent-access.d.ts +0 -79
  129. package/dist/gdc-common-utils-ts/src/models/consent-access.js +0 -2
  130. package/dist/gdc-common-utils-ts/src/models/consent-rule.d.ts +0 -122
  131. package/dist/gdc-common-utils-ts/src/models/consent-rule.js +0 -22
  132. package/dist/gdc-common-utils-ts/src/models/crypto.d.ts +0 -35
  133. package/dist/gdc-common-utils-ts/src/models/crypto.js +0 -3
  134. package/dist/gdc-common-utils-ts/src/models/dataspace-discovery-defaults.d.ts +0 -79
  135. package/dist/gdc-common-utils-ts/src/models/dataspace-discovery-defaults.js +0 -2
  136. package/dist/gdc-common-utils-ts/src/models/dataspace-discovery.d.ts +0 -68
  137. package/dist/gdc-common-utils-ts/src/models/dataspace-discovery.js +0 -9
  138. package/dist/gdc-common-utils-ts/src/models/dataspace-protocol.d.ts +0 -14
  139. package/dist/gdc-common-utils-ts/src/models/dataspace-protocol.js +0 -2
  140. package/dist/gdc-common-utils-ts/src/models/device-license.d.ts +0 -134
  141. package/dist/gdc-common-utils-ts/src/models/device-license.js +0 -3
  142. package/dist/gdc-common-utils-ts/src/models/did.d.ts +0 -108
  143. package/dist/gdc-common-utils-ts/src/models/did.js +0 -3
  144. package/dist/gdc-common-utils-ts/src/models/fhir-documents.d.ts +0 -101
  145. package/dist/gdc-common-utils-ts/src/models/fhir-documents.js +0 -3
  146. package/dist/gdc-common-utils-ts/src/models/identity-bootstrap.d.ts +0 -104
  147. package/dist/gdc-common-utils-ts/src/models/identity-bootstrap.js +0 -2
  148. package/dist/gdc-common-utils-ts/src/models/index.d.ts +0 -42
  149. package/dist/gdc-common-utils-ts/src/models/index.js +0 -42
  150. package/dist/gdc-common-utils-ts/src/models/indexing.d.ts +0 -11
  151. package/dist/gdc-common-utils-ts/src/models/indexing.js +0 -18
  152. package/dist/gdc-common-utils-ts/src/models/interoperable-claims/allergy-intolerance-claims.d.ts +0 -24
  153. package/dist/gdc-common-utils-ts/src/models/interoperable-claims/allergy-intolerance-claims.js +0 -36
  154. package/dist/gdc-common-utils-ts/src/models/interoperable-claims/communication-claims.d.ts +0 -53
  155. package/dist/gdc-common-utils-ts/src/models/interoperable-claims/communication-claims.js +0 -55
  156. package/dist/gdc-common-utils-ts/src/models/interoperable-claims/condition-claims.d.ts +0 -14
  157. package/dist/gdc-common-utils-ts/src/models/interoperable-claims/condition-claims.js +0 -25
  158. package/dist/gdc-common-utils-ts/src/models/interoperable-claims/device-use-statement-claims.d.ts +0 -13
  159. package/dist/gdc-common-utils-ts/src/models/interoperable-claims/device-use-statement-claims.js +0 -23
  160. package/dist/gdc-common-utils-ts/src/models/interoperable-claims/document-reference-claims.d.ts +0 -36
  161. package/dist/gdc-common-utils-ts/src/models/interoperable-claims/document-reference-claims.js +0 -89
  162. package/dist/gdc-common-utils-ts/src/models/interoperable-claims/medication-statement-claims.d.ts +0 -341
  163. package/dist/gdc-common-utils-ts/src/models/interoperable-claims/medication-statement-claims.js +0 -204
  164. package/dist/gdc-common-utils-ts/src/models/interoperable-claims/types.d.ts +0 -9
  165. package/dist/gdc-common-utils-ts/src/models/interoperable-claims/types.js +0 -3
  166. package/dist/gdc-common-utils-ts/src/models/interoperable-claims.d.ts +0 -5
  167. package/dist/gdc-common-utils-ts/src/models/interoperable-claims.js +0 -7
  168. package/dist/gdc-common-utils-ts/src/models/issue.d.ts +0 -57
  169. package/dist/gdc-common-utils-ts/src/models/issue.js +0 -75
  170. package/dist/gdc-common-utils-ts/src/models/jsonapi.d.ts +0 -13
  171. package/dist/gdc-common-utils-ts/src/models/jsonapi.js +0 -3
  172. package/dist/gdc-common-utils-ts/src/models/jwe.d.ts +0 -120
  173. package/dist/gdc-common-utils-ts/src/models/jwe.js +0 -3
  174. package/dist/gdc-common-utils-ts/src/models/jwk.d.ts +0 -39
  175. package/dist/gdc-common-utils-ts/src/models/jwk.js +0 -3
  176. package/dist/gdc-common-utils-ts/src/models/jws.d.ts +0 -35
  177. package/dist/gdc-common-utils-ts/src/models/jws.js +0 -3
  178. package/dist/gdc-common-utils-ts/src/models/jwt.d.ts +0 -9
  179. package/dist/gdc-common-utils-ts/src/models/jwt.js +0 -3
  180. package/dist/gdc-common-utils-ts/src/models/loinc-document-ontology.d.ts +0 -55
  181. package/dist/gdc-common-utils-ts/src/models/loinc-document-ontology.js +0 -58
  182. package/dist/gdc-common-utils-ts/src/models/oidc4ida.common.model.d.ts +0 -33
  183. package/dist/gdc-common-utils-ts/src/models/oidc4ida.common.model.js +0 -3
  184. package/dist/gdc-common-utils-ts/src/models/oidc4ida.document.model.d.ts +0 -50
  185. package/dist/gdc-common-utils-ts/src/models/oidc4ida.document.model.js +0 -3
  186. package/dist/gdc-common-utils-ts/src/models/oidc4ida.electronicRecord.model.d.ts +0 -67
  187. package/dist/gdc-common-utils-ts/src/models/oidc4ida.electronicRecord.model.js +0 -3
  188. package/dist/gdc-common-utils-ts/src/models/oidc4ida.evidence.model.d.ts +0 -51
  189. package/dist/gdc-common-utils-ts/src/models/oidc4ida.evidence.model.js +0 -5
  190. package/dist/gdc-common-utils-ts/src/models/openid-device.d.ts +0 -119
  191. package/dist/gdc-common-utils-ts/src/models/openid-device.js +0 -3
  192. package/dist/gdc-common-utils-ts/src/models/operation-outcome.d.ts +0 -26
  193. package/dist/gdc-common-utils-ts/src/models/operation-outcome.js +0 -3
  194. package/dist/gdc-common-utils-ts/src/models/params.d.ts +0 -133
  195. package/dist/gdc-common-utils-ts/src/models/params.js +0 -3
  196. package/dist/gdc-common-utils-ts/src/models/relationship-access.d.ts +0 -160
  197. package/dist/gdc-common-utils-ts/src/models/relationship-access.js +0 -21
  198. package/dist/gdc-common-utils-ts/src/models/resource-document.d.ts +0 -14
  199. package/dist/gdc-common-utils-ts/src/models/resource-document.js +0 -3
  200. package/dist/gdc-common-utils-ts/src/models/response.d.ts +0 -1
  201. package/dist/gdc-common-utils-ts/src/models/response.js +0 -3
  202. package/dist/gdc-common-utils-ts/src/models/urlPath.d.ts +0 -58
  203. package/dist/gdc-common-utils-ts/src/models/urlPath.js +0 -76
  204. package/dist/gdc-common-utils-ts/src/models/verifiable-credential.d.ts +0 -45
  205. package/dist/gdc-common-utils-ts/src/models/verifiable-credential.js +0 -8
  206. package/dist/gdc-common-utils-ts/src/storage/IVaultRepository.d.ts +0 -53
  207. package/dist/gdc-common-utils-ts/src/storage/IVaultRepository.js +0 -25
  208. package/dist/gdc-common-utils-ts/src/storage/VaultMemRepository.d.ts +0 -30
  209. package/dist/gdc-common-utils-ts/src/storage/VaultMemRepository.js +0 -81
  210. package/dist/gdc-common-utils-ts/src/storage/index.d.ts +0 -3
  211. package/dist/gdc-common-utils-ts/src/storage/index.js +0 -4
  212. package/dist/gdc-common-utils-ts/src/utils/activation-policy.d.ts +0 -86
  213. package/dist/gdc-common-utils-ts/src/utils/activation-policy.js +0 -218
  214. package/dist/gdc-common-utils-ts/src/utils/activation-request.d.ts +0 -81
  215. package/dist/gdc-common-utils-ts/src/utils/activation-request.js +0 -99
  216. package/dist/gdc-common-utils-ts/src/utils/actor.d.ts +0 -18
  217. package/dist/gdc-common-utils-ts/src/utils/actor.js +0 -36
  218. package/dist/gdc-common-utils-ts/src/utils/base-convert.d.ts +0 -60
  219. package/dist/gdc-common-utils-ts/src/utils/base-convert.js +0 -104
  220. package/dist/gdc-common-utils-ts/src/utils/baseN.d.ts +0 -35
  221. package/dist/gdc-common-utils-ts/src/utils/baseN.js +0 -174
  222. package/dist/gdc-common-utils-ts/src/utils/bundle-query.d.ts +0 -35
  223. package/dist/gdc-common-utils-ts/src/utils/bundle-query.js +0 -177
  224. package/dist/gdc-common-utils-ts/src/utils/bundle.d.ts +0 -13
  225. package/dist/gdc-common-utils-ts/src/utils/bundle.js +0 -39
  226. package/dist/gdc-common-utils-ts/src/utils/clinical-resource-converters.d.ts +0 -64
  227. package/dist/gdc-common-utils-ts/src/utils/clinical-resource-converters.js +0 -279
  228. package/dist/gdc-common-utils-ts/src/utils/clinical-resource-view.d.ts +0 -55
  229. package/dist/gdc-common-utils-ts/src/utils/clinical-resource-view.js +0 -291
  230. package/dist/gdc-common-utils-ts/src/utils/communication-bundle-session.d.ts +0 -110
  231. package/dist/gdc-common-utils-ts/src/utils/communication-bundle-session.js +0 -326
  232. package/dist/gdc-common-utils-ts/src/utils/communication-document-reference.d.ts +0 -41
  233. package/dist/gdc-common-utils-ts/src/utils/communication-document-reference.js +0 -170
  234. package/dist/gdc-common-utils-ts/src/utils/communication-fhir-r4.d.ts +0 -41
  235. package/dist/gdc-common-utils-ts/src/utils/communication-fhir-r4.js +0 -215
  236. package/dist/gdc-common-utils-ts/src/utils/communication-identity.d.ts +0 -152
  237. package/dist/gdc-common-utils-ts/src/utils/communication-identity.js +0 -121
  238. package/dist/gdc-common-utils-ts/src/utils/consent-claim-helpers.d.ts +0 -79
  239. package/dist/gdc-common-utils-ts/src/utils/consent-claim-helpers.js +0 -213
  240. package/dist/gdc-common-utils-ts/src/utils/consent.d.ts +0 -218
  241. package/dist/gdc-common-utils-ts/src/utils/consent.js +0 -679
  242. package/dist/gdc-common-utils-ts/src/utils/content.d.ts +0 -55
  243. package/dist/gdc-common-utils-ts/src/utils/content.js +0 -60
  244. package/dist/gdc-common-utils-ts/src/utils/dataspace-discovery-defaults.d.ts +0 -130
  245. package/dist/gdc-common-utils-ts/src/utils/dataspace-discovery-defaults.js +0 -307
  246. package/dist/gdc-common-utils-ts/src/utils/dataspace-discovery.d.ts +0 -235
  247. package/dist/gdc-common-utils-ts/src/utils/dataspace-discovery.js +0 -482
  248. package/dist/gdc-common-utils-ts/src/utils/dataspace-protocol.d.ts +0 -66
  249. package/dist/gdc-common-utils-ts/src/utils/dataspace-protocol.js +0 -109
  250. package/dist/gdc-common-utils-ts/src/utils/did-resolution.d.ts +0 -60
  251. package/dist/gdc-common-utils-ts/src/utils/did-resolution.js +0 -173
  252. package/dist/gdc-common-utils-ts/src/utils/did.d.ts +0 -124
  253. package/dist/gdc-common-utils-ts/src/utils/did.js +0 -204
  254. package/dist/gdc-common-utils-ts/src/utils/didcomm-submit-policy.d.ts +0 -10
  255. package/dist/gdc-common-utils-ts/src/utils/didcomm-submit-policy.js +0 -15
  256. package/dist/gdc-common-utils-ts/src/utils/didcomm-submit.d.ts +0 -48
  257. package/dist/gdc-common-utils-ts/src/utils/didcomm-submit.js +0 -81
  258. package/dist/gdc-common-utils-ts/src/utils/didcomm.d.ts +0 -60
  259. package/dist/gdc-common-utils-ts/src/utils/didcomm.js +0 -78
  260. package/dist/gdc-common-utils-ts/src/utils/discovery-normalization.d.ts +0 -28
  261. package/dist/gdc-common-utils-ts/src/utils/discovery-normalization.js +0 -64
  262. package/dist/gdc-common-utils-ts/src/utils/fhir-cid.d.ts +0 -60
  263. package/dist/gdc-common-utils-ts/src/utils/fhir-cid.js +0 -152
  264. package/dist/gdc-common-utils-ts/src/utils/fhir-validator.d.ts +0 -61
  265. package/dist/gdc-common-utils-ts/src/utils/fhir-validator.js +0 -91
  266. package/dist/gdc-common-utils-ts/src/utils/format-converter.d.ts +0 -21
  267. package/dist/gdc-common-utils-ts/src/utils/format-converter.js +0 -109
  268. package/dist/gdc-common-utils-ts/src/utils/index.d.ts +0 -39
  269. package/dist/gdc-common-utils-ts/src/utils/index.js +0 -39
  270. package/dist/gdc-common-utils-ts/src/utils/individual-form-pdf.d.ts +0 -55
  271. package/dist/gdc-common-utils-ts/src/utils/individual-form-pdf.js +0 -191
  272. package/dist/gdc-common-utils-ts/src/utils/jwt.d.ts +0 -53
  273. package/dist/gdc-common-utils-ts/src/utils/jwt.js +0 -154
  274. package/dist/gdc-common-utils-ts/src/utils/manager-error.d.ts +0 -15
  275. package/dist/gdc-common-utils-ts/src/utils/manager-error.js +0 -21
  276. package/dist/gdc-common-utils-ts/src/utils/medication-claim-helpers.d.ts +0 -56
  277. package/dist/gdc-common-utils-ts/src/utils/medication-claim-helpers.js +0 -127
  278. package/dist/gdc-common-utils-ts/src/utils/multibase58.d.ts +0 -13
  279. package/dist/gdc-common-utils-ts/src/utils/multibase58.js +0 -40
  280. package/dist/gdc-common-utils-ts/src/utils/multibasehash.d.ts +0 -8
  281. package/dist/gdc-common-utils-ts/src/utils/multibasehash.js +0 -23
  282. package/dist/gdc-common-utils-ts/src/utils/normalize-uuid.d.ts +0 -1
  283. package/dist/gdc-common-utils-ts/src/utils/normalize-uuid.js +0 -35
  284. package/dist/gdc-common-utils-ts/src/utils/normalize.d.ts +0 -16
  285. package/dist/gdc-common-utils-ts/src/utils/normalize.js +0 -40
  286. package/dist/gdc-common-utils-ts/src/utils/object-convert.d.ts +0 -20
  287. package/dist/gdc-common-utils-ts/src/utils/object-convert.js +0 -51
  288. package/dist/gdc-common-utils-ts/src/utils/smart-scope.d.ts +0 -28
  289. package/dist/gdc-common-utils-ts/src/utils/smart-scope.js +0 -29
  290. package/dist/gdc-common-utils-ts/src/utils/string-convert.d.ts +0 -24
  291. package/dist/gdc-common-utils-ts/src/utils/string-convert.js +0 -62
  292. package/dist/gdc-common-utils-ts/src/utils/string-utils.d.ts +0 -25
  293. package/dist/gdc-common-utils-ts/src/utils/string-utils.js +0 -66
  294. package/dist/gdc-common-utils-ts/src/utils/url.d.ts +0 -26
  295. package/dist/gdc-common-utils-ts/src/utils/url.js +0 -44
  296. package/dist/gdc-common-utils-ts/src/utils/vp-token.d.ts +0 -139
  297. package/dist/gdc-common-utils-ts/src/utils/vp-token.js +0 -256
  298. package/dist/gdc-sdk-core-ts/src/actor-model.d.ts +0 -56
  299. package/dist/gdc-sdk-core-ts/src/actor-model.js +0 -112
  300. package/dist/gdc-sdk-core-ts/src/app-identity.d.ts +0 -80
  301. package/dist/gdc-sdk-core-ts/src/app-identity.js +0 -147
  302. package/dist/gdc-sdk-core-ts/src/bootstrap-facade.d.ts +0 -165
  303. package/dist/gdc-sdk-core-ts/src/bootstrap-facade.js +0 -191
  304. package/dist/gdc-sdk-core-ts/src/communication-bundle-contracts.d.ts +0 -112
  305. package/dist/gdc-sdk-core-ts/src/communication-bundle-contracts.js +0 -185
  306. package/dist/gdc-sdk-core-ts/src/communication-bundle-resources.d.ts +0 -32
  307. package/dist/gdc-sdk-core-ts/src/communication-bundle-resources.js +0 -215
  308. package/dist/gdc-sdk-core-ts/src/communication-consent-mutation-contract.d.ts +0 -55
  309. package/dist/gdc-sdk-core-ts/src/communication-consent-mutation-contract.js +0 -190
  310. package/dist/gdc-sdk-core-ts/src/communication-document-facade.d.ts +0 -55
  311. package/dist/gdc-sdk-core-ts/src/communication-document-facade.js +0 -194
  312. package/dist/gdc-sdk-core-ts/src/communication-draft.d.ts +0 -104
  313. package/dist/gdc-sdk-core-ts/src/communication-draft.js +0 -143
  314. package/dist/gdc-sdk-core-ts/src/communication-outbox.d.ts +0 -49
  315. package/dist/gdc-sdk-core-ts/src/communication-outbox.js +0 -62
  316. package/dist/gdc-sdk-core-ts/src/communication-resource-helpers.d.ts +0 -180
  317. package/dist/gdc-sdk-core-ts/src/communication-resource-helpers.js +0 -455
  318. package/dist/gdc-sdk-core-ts/src/consent-access.d.ts +0 -73
  319. package/dist/gdc-sdk-core-ts/src/consent-access.js +0 -109
  320. package/dist/gdc-sdk-core-ts/src/consent-claim-helpers.d.ts +0 -5
  321. package/dist/gdc-sdk-core-ts/src/consent-claim-helpers.js +0 -6
  322. package/dist/gdc-sdk-core-ts/src/consent-communication-operations.d.ts +0 -82
  323. package/dist/gdc-sdk-core-ts/src/consent-communication-operations.js +0 -135
  324. package/dist/gdc-sdk-core-ts/src/did-resolution-session.d.ts +0 -33
  325. package/dist/gdc-sdk-core-ts/src/did-resolution-session.js +0 -56
  326. package/dist/gdc-sdk-core-ts/src/discovery-facade.d.ts +0 -84
  327. package/dist/gdc-sdk-core-ts/src/discovery-facade.js +0 -24
  328. package/dist/gdc-sdk-core-ts/src/identity-model.d.ts +0 -46
  329. package/dist/gdc-sdk-core-ts/src/identity-model.js +0 -2
  330. package/dist/gdc-sdk-core-ts/src/identity-store.d.ts +0 -83
  331. package/dist/gdc-sdk-core-ts/src/identity-store.js +0 -51
  332. package/dist/gdc-sdk-core-ts/src/index.d.ts +0 -23
  333. package/dist/gdc-sdk-core-ts/src/index.js +0 -24
  334. package/dist/gdc-sdk-core-ts/src/medication-claim-helpers.d.ts +0 -5
  335. package/dist/gdc-sdk-core-ts/src/medication-claim-helpers.js +0 -6
  336. package/dist/gdc-sdk-core-ts/src/polling-model.d.ts +0 -35
  337. package/dist/gdc-sdk-core-ts/src/polling-model.js +0 -24
  338. package/dist/gdc-sdk-core-ts/src/relationship-access.d.ts +0 -40
  339. package/dist/gdc-sdk-core-ts/src/relationship-access.js +0 -150
  340. package/dist/gdc-sdk-core-ts/src/session-model.d.ts +0 -134
  341. package/dist/gdc-sdk-core-ts/src/session-model.js +0 -2
  342. package/dist/gdc-sdk-core-ts/src/smart-endpoint-resolver.d.ts +0 -19
  343. package/dist/gdc-sdk-core-ts/src/smart-endpoint-resolver.js +0 -19
  344. package/dist/gdc-sdk-core-ts/src/vital-signs.d.ts +0 -38
  345. package/dist/gdc-sdk-core-ts/src/vital-signs.js +0 -155
  346. package/dist/gdc-sdk-front-ts/src/ClientSDK.d.ts +0 -99
  347. package/dist/gdc-sdk-front-ts/src/ClientSDK.js +0 -177
  348. package/dist/gdc-sdk-front-ts/src/ProfileManager.d.ts +0 -140
  349. package/dist/gdc-sdk-front-ts/src/ProfileManager.js +0 -76
  350. package/dist/gdc-sdk-front-ts/src/ProfileRegistry.d.ts +0 -11
  351. package/dist/gdc-sdk-front-ts/src/ProfileRegistry.js +0 -26
  352. package/dist/gdc-sdk-front-ts/src/VerifierService.d.ts +0 -6
  353. package/dist/gdc-sdk-front-ts/src/VerifierService.js +0 -10
  354. package/dist/gdc-sdk-front-ts/src/actor-session.d.ts +0 -2
  355. package/dist/gdc-sdk-front-ts/src/actor-session.js +0 -2
  356. package/dist/gdc-sdk-front-ts/src/capabilityMapper.d.ts +0 -8
  357. package/dist/gdc-sdk-front-ts/src/capabilityMapper.js +0 -28
  358. package/dist/gdc-sdk-front-ts/src/consent-claim-helpers.d.ts +0 -4
  359. package/dist/gdc-sdk-front-ts/src/consent-claim-helpers.js +0 -5
  360. package/dist/gdc-sdk-front-ts/src/discovery/DataspaceDiscoveryClient.d.ts +0 -54
  361. package/dist/gdc-sdk-front-ts/src/discovery/DataspaceDiscoveryClient.js +0 -85
  362. package/dist/gdc-sdk-front-ts/src/discovery/index.d.ts +0 -3
  363. package/dist/gdc-sdk-front-ts/src/discovery/index.js +0 -4
  364. package/dist/gdc-sdk-front-ts/src/discovery/mappers.d.ts +0 -29
  365. package/dist/gdc-sdk-front-ts/src/discovery/mappers.js +0 -60
  366. package/dist/gdc-sdk-front-ts/src/discovery/types.d.ts +0 -83
  367. package/dist/gdc-sdk-front-ts/src/discovery/types.js +0 -2
  368. package/dist/gdc-sdk-front-ts/src/index.d.ts +0 -15
  369. package/dist/gdc-sdk-front-ts/src/index.js +0 -16
  370. package/dist/gdc-sdk-front-ts/src/medication-claim-helpers.d.ts +0 -4
  371. package/dist/gdc-sdk-front-ts/src/medication-claim-helpers.js +0 -5
  372. package/dist/gdc-sdk-front-ts/src/roleRegistry.d.ts +0 -19
  373. package/dist/gdc-sdk-front-ts/src/roleRegistry.js +0 -2
  374. package/dist/gdc-sdk-front-ts/src/runtime-contracts.d.ts +0 -22
  375. package/dist/gdc-sdk-front-ts/src/runtime-contracts.js +0 -7
  376. package/dist/gdc-sdk-front-ts/src/services.d.ts +0 -167
  377. package/dist/gdc-sdk-front-ts/src/services.js +0 -78
  378. package/dist/gdc-sdk-front-ts/src/session-descriptor.d.ts +0 -11
  379. package/dist/gdc-sdk-front-ts/src/session-descriptor.js +0 -8
  380. package/dist/gdc-sdk-front-ts/src/types.d.ts +0 -11
  381. package/dist/gdc-sdk-front-ts/src/types.js +0 -1
  382. package/dist/lifecycle-examples.d.ts +0 -6
  383. package/dist/lifecycle-examples.js +0 -7
  384. package/dist/medication-claim-helpers.d.ts +0 -4
  385. package/dist/medication-claim-helpers.js +0 -5
  386. package/dist/orchestration/facades.d.ts +0 -65
  387. package/dist/orchestration/facades.js +0 -142
@@ -1,455 +0,0 @@
1
- // Copyright 2026 Antifraud Services Inc. under the Apache License, Version 2.0.
2
- import { ResourceTypesFhirR4, } from 'gdc-common-utils-ts/constants/fhir-resource-types';
3
- import { FhirVersions, } from 'gdc-common-utils-ts/constants/fhir-versions';
4
- function cloneRecord(value) {
5
- return JSON.parse(JSON.stringify(value));
6
- }
7
- function isPlainObject(value) {
8
- return typeof value === 'object' && value !== null && !Array.isArray(value);
9
- }
10
- function toArray(value) {
11
- if (value === undefined)
12
- return [];
13
- return Array.isArray(value) ? [...value] : [value];
14
- }
15
- function encodeBase64Utf8(value) {
16
- const anyGlobal = globalThis;
17
- if (anyGlobal.Buffer) {
18
- return anyGlobal.Buffer.from(value, 'utf8').toString('base64');
19
- }
20
- if (typeof anyGlobal.btoa === 'function') {
21
- const utf8 = encodeURIComponent(value).replace(/%([0-9A-F]{2})/g, (_, hex) => String.fromCharCode(Number.parseInt(hex, 16)));
22
- return anyGlobal.btoa(utf8);
23
- }
24
- throw new Error('No base64 encoder available in this runtime.');
25
- }
26
- function decodeBase64Utf8(value) {
27
- const anyGlobal = globalThis;
28
- if (anyGlobal.Buffer) {
29
- return anyGlobal.Buffer.from(value, 'base64').toString('utf8');
30
- }
31
- if (typeof anyGlobal.atob === 'function') {
32
- const decoded = anyGlobal.atob(value);
33
- const percentEncoded = decoded
34
- .split('')
35
- .map((char) => `%${char.charCodeAt(0).toString(16).padStart(2, '0')}`)
36
- .join('');
37
- return decodeURIComponent(percentEncoded);
38
- }
39
- throw new Error('No base64 decoder available in this runtime.');
40
- }
41
- function extractCodingToken(coding) {
42
- if (!coding)
43
- return undefined;
44
- const system = typeof coding.system === 'string' ? coding.system.trim() : '';
45
- const code = typeof coding.code === 'string' ? coding.code.trim() : '';
46
- if (system && code)
47
- return `${system}|${code}`;
48
- return code || undefined;
49
- }
50
- function getFirstCodingToken(value) {
51
- const coding = (Array.isArray(value) ? value : [])
52
- .flatMap((item) => (isPlainObject(item) && Array.isArray(item.coding) ? item.coding : []))
53
- .find(isPlainObject);
54
- return extractCodingToken(coding);
55
- }
56
- function getCanonicalDate(resource) {
57
- const candidates = [
58
- resource.effectiveDateTime,
59
- resource.issued,
60
- resource.authoredOn,
61
- resource.performedDateTime,
62
- resource.recordedDate,
63
- resource.date,
64
- resource.sent,
65
- ];
66
- for (const candidate of candidates) {
67
- if (typeof candidate === 'string' && candidate.trim())
68
- return candidate.trim();
69
- }
70
- return undefined;
71
- }
72
- function buildAttachmentFromResource(resource, options = {}) {
73
- const attachment = {
74
- contentType: options.contentType || 'application/fhir+json',
75
- };
76
- if (options.title)
77
- attachment.title = options.title;
78
- if (options.url)
79
- attachment.url = options.url;
80
- if (options.dataBase64) {
81
- attachment.data = options.dataBase64;
82
- }
83
- else {
84
- attachment.data = encodeBase64Utf8(JSON.stringify(resource));
85
- }
86
- return attachment;
87
- }
88
- function parseAttachmentResource(attachment) {
89
- if (!attachment)
90
- return undefined;
91
- if (typeof attachment.data !== 'string' || !attachment.data.trim())
92
- return undefined;
93
- try {
94
- const parsed = JSON.parse(decodeBase64Utf8(attachment.data));
95
- return isPlainObject(parsed) ? parsed : undefined;
96
- }
97
- catch {
98
- return undefined;
99
- }
100
- }
101
- function getPayloadAttachment(payload) {
102
- const contentAttachment = payload.contentAttachment;
103
- return isPlainObject(contentAttachment) ? contentAttachment : undefined;
104
- }
105
- function getPayloadReference(payload) {
106
- const contentReference = payload.contentReference;
107
- if (!isPlainObject(contentReference))
108
- return undefined;
109
- return typeof contentReference.reference === 'string' ? contentReference.reference : undefined;
110
- }
111
- function getCommunicationNoteTexts(communication) {
112
- return Array.isArray(communication.note)
113
- ? communication.note
114
- .map((item) => (isPlainObject(item) && typeof item.text === 'string' ? item.text.trim() : ''))
115
- .filter(Boolean)
116
- : [];
117
- }
118
- function ensureCommunicationResource(communication) {
119
- if (communication.resourceType !== ResourceTypesFhirR4.Communication) {
120
- throw new TypeError('Expected a FHIR Communication resource.');
121
- }
122
- return communication;
123
- }
124
- function buildCategory(category) {
125
- if (!category || category.length === 0)
126
- return undefined;
127
- const categoryItems = [...category];
128
- const codings = categoryItems
129
- .map((item) => {
130
- if (typeof item === 'string') {
131
- const [system, code] = item.includes('|') ? item.split('|', 2) : ['', item];
132
- return code ? { system: system || undefined, code } : undefined;
133
- }
134
- if (item && typeof item.code === 'string' && item.code.trim()) {
135
- return { system: item.system, code: item.code };
136
- }
137
- return undefined;
138
- })
139
- .filter((item) => Boolean(item));
140
- return codings.length ? [{ coding: codings }] : undefined;
141
- }
142
- function resolveNoteText(options) {
143
- const value = typeof options.noteText === 'string' ? options.noteText.trim() : '';
144
- return value || undefined;
145
- }
146
- function appendNoteText(communication, noteText) {
147
- if (!noteText || !noteText.trim())
148
- return communication;
149
- const next = cloneRecord(communication);
150
- const notes = Array.isArray(next.note) ? [...next.note] : [];
151
- notes.push({ text: noteText.trim() });
152
- next.note = notes;
153
- return next;
154
- }
155
- function appendPayload(communication, payloadEntry) {
156
- const next = cloneRecord(communication);
157
- const payload = Array.isArray(next.payload) ? [...next.payload] : [];
158
- payload.push(payloadEntry);
159
- next.payload = payload;
160
- return next;
161
- }
162
- /**
163
- * Creates a minimal FHIR `Communication` resource ready to receive payloads.
164
- *
165
- * @param options.subject Subject reference carried by `Communication.subject.reference`.
166
- * @param options.sender Optional sender reference.
167
- * @param options.recipient Optional recipient reference or references.
168
- * @param options.sent Optional sent timestamp.
169
- * @param options.status Optional FHIR communication status. Defaults to `completed`.
170
- * @param options.category Optional coding tokens or coding descriptors.
171
- * @param options.noteText Optional message note text. FHIR allows markdown here.
172
- * @param options.claims Optional `resource.meta.claims` payload to preserve.
173
- */
174
- export function createCommunicationResource(options) {
175
- const communication = {
176
- resourceType: ResourceTypesFhirR4.Communication,
177
- status: options.status || 'completed',
178
- subject: { reference: options.subject },
179
- };
180
- if (options.sender)
181
- communication.sender = { reference: options.sender };
182
- if (options.recipient) {
183
- communication.recipient = toArray(options.recipient).map((reference) => ({ reference }));
184
- }
185
- if (options.sent)
186
- communication.sent = options.sent;
187
- const category = buildCategory(options.category);
188
- if (category)
189
- communication.category = category;
190
- const noteText = resolveNoteText(options);
191
- if (noteText) {
192
- communication.note = [{ text: noteText }];
193
- }
194
- if (options.claims) {
195
- communication.meta = { claims: cloneRecord(options.claims) };
196
- }
197
- return communication;
198
- }
199
- /**
200
- * Wraps a FHIR `Communication` into a batch message payload suitable for
201
- * the legacy/FHIR ingestion routes used by the GW.
202
- *
203
- * @param communication FHIR `Communication` resource to submit.
204
- * @param options.thid Optional thread id for the envelope.
205
- * @param options.jti Optional envelope id.
206
- * @param options.iss Optional issuer DID.
207
- * @param options.aud Optional audience DID.
208
- * @param options.requestUrl Optional FHIR batch request URL.
209
- * @param options.entryType Optional business type for the batch entry.
210
- * @param options.messageType Optional outer message MIME type.
211
- * @param options.fhirVersion Optional FHIR version parameter used in the MIME type.
212
- */
213
- export function buildCommunicationBatchMessage(communication, options = {}) {
214
- const communicationResource = ensureCommunicationResource(communication);
215
- const thid = options.thid || `communication-${Date.now()}`;
216
- const fhirVersion = options.fhirVersion || FhirVersions.R4;
217
- return {
218
- ...(options.jti ? { jti: options.jti } : {}),
219
- ...(options.iss ? { iss: options.iss } : {}),
220
- ...(options.aud ? { aud: options.aud } : {}),
221
- thid,
222
- type: options.messageType || `application/fhir+json; fhirVersion=${fhirVersion}`,
223
- body: {
224
- resourceType: ResourceTypesFhirR4.Bundle,
225
- type: 'batch',
226
- entry: [
227
- {
228
- request: {
229
- method: 'POST',
230
- url: options.requestUrl || `individual/org.hl7.fhir.r4/${ResourceTypesFhirR4.Communication}`,
231
- },
232
- type: options.entryType || 'Communication-ingestion-request-v1.0',
233
- resource: cloneRecord(communicationResource),
234
- },
235
- ],
236
- },
237
- };
238
- }
239
- /**
240
- * Adds a FHIR resource as a `Communication.payload` attachment.
241
- *
242
- * When `options.asDocumentReference` is enabled, the resource is first
243
- * wrapped into a FHIR `DocumentReference` whose `content.attachment`
244
- * contains the serialized resource.
245
- *
246
- * @param communication Target FHIR `Communication` resource.
247
- * @param resource FHIR resource to attach.
248
- * @param options.noteText Optional note text appended to `Communication.note`. FHIR allows markdown here.
249
- * @param options.asDocumentReference Whether to wrap the resource into `DocumentReference`.
250
- * @param options.documentReferenceIdentifier Optional `DocumentReference.identifier`.
251
- * @param options.attachmentTitle Optional attachment filename/title.
252
- * @param options.attachmentContentType Optional attachment MIME type.
253
- * @param options.documentDescription Optional `DocumentReference.description`.
254
- * @param options.documentDate Optional `DocumentReference.date`.
255
- * @param options.documentSubject Optional `DocumentReference.subject.reference`.
256
- */
257
- export function addFhirResourceToCommunication(communication, resource, options = {}) {
258
- const nextCommunication = ensureCommunicationResource(communication);
259
- const subjectReference = options.documentSubject
260
- || (typeof nextCommunication.subject?.reference === 'string'
261
- ? String(nextCommunication.subject.reference)
262
- : undefined);
263
- let payloadEntry;
264
- if (options.asDocumentReference) {
265
- const documentReference = {
266
- resourceType: ResourceTypesFhirR4.DocumentReference,
267
- content: [{
268
- attachment: buildAttachmentFromResource(resource, {
269
- contentType: options.attachmentContentType || 'application/fhir+json',
270
- title: options.attachmentTitle || `${String(resource.resourceType || 'resource').toLowerCase()}.json`,
271
- }),
272
- }],
273
- };
274
- if (subjectReference)
275
- documentReference.subject = { reference: subjectReference };
276
- if (options.documentDate || getCanonicalDate(resource)) {
277
- documentReference.date = options.documentDate || getCanonicalDate(resource);
278
- }
279
- if (options.documentDescription)
280
- documentReference.description = options.documentDescription;
281
- if (options.documentReferenceIdentifier) {
282
- documentReference.identifier = [{ value: options.documentReferenceIdentifier }];
283
- }
284
- payloadEntry = {
285
- contentAttachment: buildAttachmentFromResource(documentReference, {
286
- contentType: 'application/fhir+json',
287
- title: options.attachmentTitle || 'document-reference.json',
288
- }),
289
- };
290
- }
291
- else {
292
- payloadEntry = {
293
- contentAttachment: buildAttachmentFromResource(resource, {
294
- contentType: options.attachmentContentType || 'application/fhir+json',
295
- title: options.attachmentTitle || `${String(resource.resourceType || 'resource').toLowerCase()}.json`,
296
- }),
297
- };
298
- }
299
- return appendNoteText(appendPayload(nextCommunication, payloadEntry), resolveNoteText(options));
300
- }
301
- /**
302
- * Adds a claims-only pseudo-resource into `Communication.payload`.
303
- *
304
- * The resource is created with `resourceType` plus `resource.meta.claims`
305
- * and then attached using the same logic as `addFhirResourceToCommunication(...)`.
306
- *
307
- * @param communication Target FHIR `Communication` resource.
308
- * @param resourceType FHIR `resourceType` name to materialize.
309
- * @param claims Canonical interoperable claims to place under `meta.claims`.
310
- * @param options Attachment/document wrapping options.
311
- */
312
- export function addClaimsResourceToCommunication(communication, resourceType, claims, options = {}) {
313
- const resource = {
314
- resourceType,
315
- meta: {
316
- claims: cloneRecord(claims),
317
- },
318
- };
319
- return addFhirResourceToCommunication(communication, resource, options);
320
- }
321
- /**
322
- * Resolves every `Communication.payload[]` entry into a normalized shape.
323
- *
324
- * The resolver abstracts:
325
- * - direct resource attachment
326
- * - embedded `DocumentReference`
327
- * - embedded `Bundle document`
328
- * - best-effort note text associated to the payload slot
329
- *
330
- * @param communication FHIR `Communication` resource to inspect.
331
- */
332
- export function resolveCommunicationPayloads(communication) {
333
- const communicationResource = ensureCommunicationResource(communication);
334
- const payload = Array.isArray(communicationResource.payload) ? communicationResource.payload : [];
335
- const noteTexts = getCommunicationNoteTexts(communicationResource);
336
- return payload.map((item, index) => {
337
- const payloadEntry = isPlainObject(item) ? item : {};
338
- const attachment = getPayloadAttachment(payloadEntry);
339
- const directResource = parseAttachmentResource(attachment);
340
- if (directResource?.resourceType === ResourceTypesFhirR4.DocumentReference) {
341
- const documentReference = directResource;
342
- const contentEntries = Array.isArray(documentReference.content)
343
- ? documentReference.content
344
- : [];
345
- const innerAttachment = contentEntries.length
346
- ? contentEntries
347
- .map((contentItem) => (isPlainObject(contentItem) ? contentItem.attachment : undefined))
348
- .find(isPlainObject)
349
- : undefined;
350
- const innerResource = parseAttachmentResource(innerAttachment);
351
- return {
352
- payloadIndex: index,
353
- payloadType: attachment ? 'attachment' : 'reference',
354
- documentReference,
355
- bundle: innerResource?.resourceType === ResourceTypesFhirR4.Bundle ? innerResource : undefined,
356
- resource: innerResource,
357
- noteText: noteTexts[index] || noteTexts[0],
358
- };
359
- }
360
- return {
361
- payloadIndex: index,
362
- payloadType: attachment ? 'attachment' : 'reference',
363
- bundle: directResource?.resourceType === ResourceTypesFhirR4.Bundle ? directResource : undefined,
364
- resource: directResource,
365
- noteText: noteTexts[index] || noteTexts[0],
366
- ...(getPayloadReference(payloadEntry) ? { documentReference: { reference: getPayloadReference(payloadEntry) } } : {}),
367
- };
368
- });
369
- }
370
- /**
371
- * Returns the first FHIR `Bundle document` reachable from a `Communication`.
372
- *
373
- * It transparently supports direct bundle attachments and bundles wrapped
374
- * inside `DocumentReference.content.attachment`.
375
- *
376
- * @param communication FHIR `Communication` resource to inspect.
377
- */
378
- export function getFirstBundleDocumentFromCommunication(communication) {
379
- return resolveCommunicationPayloads(communication).find((entry) => entry.bundle)?.bundle;
380
- }
381
- /**
382
- * Extracts concrete FHIR resources from a `Bundle.entry[].resource` list.
383
- *
384
- * @param bundle FHIR `Bundle` document.
385
- */
386
- export function getBundleDocumentEntries(bundle) {
387
- if (!bundle || bundle.resourceType !== ResourceTypesFhirR4.Bundle || !Array.isArray(bundle.entry))
388
- return [];
389
- return bundle.entry
390
- .map((entry) => (isPlainObject(entry) && isPlainObject(entry.resource) ? entry.resource : undefined))
391
- .filter((resource) => Boolean(resource));
392
- }
393
- /**
394
- * Returns bundle resources filtered by `resourceType`.
395
- *
396
- * @param bundle FHIR `Bundle` document.
397
- * @param resourceType FHIR `resourceType` name to keep.
398
- */
399
- export function getBundleDocumentResourcesByType(bundle, resourceType) {
400
- return getBundleDocumentEntries(bundle).filter((resource) => resource.resourceType === resourceType);
401
- }
402
- /**
403
- * Extracts `MedicationStatement.meta.claims` rows from the first document
404
- * bundle found inside a `Communication`.
405
- *
406
- * @param communication FHIR `Communication` resource to inspect.
407
- */
408
- export function getMedicationClaimsFromCommunicationDocument(communication) {
409
- const bundle = getFirstBundleDocumentFromCommunication(communication);
410
- return getBundleDocumentResourcesByType(bundle, ResourceTypesFhirR4.MedicationStatement)
411
- .map((resource) => (isPlainObject(resource.meta) && isPlainObject(resource.meta.claims)
412
- ? cloneRecord(resource.meta.claims)
413
- : {}))
414
- .filter((claims) => Object.keys(claims).length > 0);
415
- }
416
- /**
417
- * Sorts FHIR resources by their first canonical clinical date descending.
418
- *
419
- * The helper inspects common date fields such as `effectiveDateTime`,
420
- * `issued`, `authoredOn`, `performedDateTime`, `recordedDate`, `date`, and `sent`.
421
- *
422
- * @param resources Resources to sort.
423
- */
424
- export function sortFhirResourcesByDateDescending(resources) {
425
- return [...resources].sort((left, right) => {
426
- const leftDate = getCanonicalDate(left) || '';
427
- const rightDate = getCanonicalDate(right) || '';
428
- return rightDate.localeCompare(leftDate);
429
- });
430
- }
431
- /**
432
- * Returns `Observation` resources from a communication document filtered by code.
433
- *
434
- * Accepted filter values may be bare codes or `<system>|<code>` tokens.
435
- *
436
- * @param communication FHIR `Communication` resource to inspect.
437
- * @param filter.code Optional single code filter.
438
- * @param filter.codes Optional list of accepted codes.
439
- */
440
- export function getObservationsByCodeFromCommunicationDocument(communication, filter) {
441
- const accepted = new Set([filter.code, ...(filter.codes || [])]
442
- .filter((value) => Boolean(value && value.trim()))
443
- .map((value) => value.trim()));
444
- const bundle = getFirstBundleDocumentFromCommunication(communication);
445
- const observations = getBundleDocumentResourcesByType(bundle, ResourceTypesFhirR4.Observation);
446
- if (!accepted.size)
447
- return observations;
448
- return observations.filter((resource) => {
449
- const codeToken = getFirstCodingToken(resource.code?.coding ? [{ coding: resource.code.coding }] : []);
450
- const categoryToken = getFirstCodingToken(resource.category);
451
- return Boolean((codeToken && accepted.has(codeToken))
452
- || (codeToken && accepted.has(codeToken.split('|').pop() || ''))
453
- || (categoryToken && accepted.has(categoryToken)));
454
- });
455
- }
@@ -1,73 +0,0 @@
1
- import type { ActiveConsentView, ConsentActorDescriptor, ConsentCoverageRequest, ConsentRuleMatch, EffectiveAccessEvaluation, MissingPermissionSet } from 'gdc-common-utils-ts/models/consent-access';
2
- import type { ConsentRule } from 'gdc-common-utils-ts/models/consent-rule';
3
- import type { BundleSearchQuery, CommunicationInput } from './communication-bundle-contracts.js';
4
- export type PermissionRequestCommunicationInput = Readonly<{
5
- subject: string;
6
- requester: ConsentActorDescriptor;
7
- requesterRole?: string;
8
- purpose?: string;
9
- missing: MissingPermissionSet;
10
- communicationIdentifier?: string;
11
- thid?: string;
12
- sender?: string;
13
- recipient?: string | string[];
14
- justification?: string;
15
- documentContentCid?: string;
16
- }>;
17
- export type PermissionRequestCommunicationLookup = Readonly<{
18
- subject: string;
19
- communicationIdentifier?: string;
20
- thid?: string;
21
- contentCid?: string;
22
- }>;
23
- /**
24
- * Runtime-neutral interface for subject consent providers.
25
- */
26
- export interface ActiveConsentProvider {
27
- getActiveConsentsForSubject(subject: string): Promise<ConsentRule[]>;
28
- }
29
- /**
30
- * Fetches active consent rules for a subject from an injected provider and
31
- * groups them by target family for controller-facing inspection.
32
- *
33
- * @param provider Consent provider abstraction.
34
- * @param subject Subject identifier whose active consents must be loaded.
35
- * @param now Optional evaluation timestamp.
36
- */
37
- export declare function groupConsentsForControllerView(provider: ActiveConsentProvider, subject: string, now?: string | Date): Promise<ActiveConsentView>;
38
- /**
39
- * Evaluates requested access against the full active consent set for a subject.
40
- *
41
- * @param provider Consent provider abstraction.
42
- * @param request Access request to evaluate.
43
- */
44
- export declare function evaluateRequestedAccess(provider: ActiveConsentProvider, request: ConsentCoverageRequest): Promise<EffectiveAccessEvaluation>;
45
- /**
46
- * Returns the missing-permission projection for a consent evaluation.
47
- *
48
- * @param evaluation Result returned by `evaluateRequestedAccess(...)` or `evaluateConsentCoverage(...)`.
49
- */
50
- export declare function getMissingPermissions(evaluation: EffectiveAccessEvaluation): MissingPermissionSet;
51
- /**
52
- * Builds the canonical `Communication` payload used to request additional
53
- * subject-controlled permissions when the current SMART request is not covered.
54
- *
55
- * Push/email/SMS remain notification channels around this canonical
56
- * `Communication`, not the primary contract.
57
- *
58
- * @param input Permission-request details to encode.
59
- */
60
- export declare function buildPermissionRequestCommunication(input: PermissionRequestCommunicationInput): CommunicationInput;
61
- /**
62
- * Builds a canonical subject-scoped `Bundle/_search` query for recovering a
63
- * permission-request `Communication` by stable identifiers.
64
- *
65
- * Retrieval keys supported by the current helper:
66
- * - `Communication.identifier`
67
- * - `thid`
68
- * - `DocumentReference.contenthash` (`z<base58>` CID)
69
- *
70
- * @param input Stable lookup keys for the permission request.
71
- */
72
- export declare function buildPermissionRequestCommunicationLookupQuery(input: PermissionRequestCommunicationLookup): BundleSearchQuery;
73
- export type { ActiveConsentView, ConsentActorDescriptor, ConsentCoverageRequest, ConsentRuleMatch, EffectiveAccessEvaluation, MissingPermissionSet, };
@@ -1,109 +0,0 @@
1
- // Copyright 2026 Antifraud Services Inc. under the Apache License, Version 2.0.
2
- import { evaluateConsentCoverage, groupActiveConsentsByTarget, } from 'gdc-common-utils-ts/utils/consent';
3
- import { ResourceTypesFhirR4 } from 'gdc-common-utils-ts/constants/fhir-resource-types';
4
- import { CommunicationClaim } from 'gdc-common-utils-ts/models/interoperable-claims/communication-claims';
5
- /**
6
- * Fetches active consent rules for a subject from an injected provider and
7
- * groups them by target family for controller-facing inspection.
8
- *
9
- * @param provider Consent provider abstraction.
10
- * @param subject Subject identifier whose active consents must be loaded.
11
- * @param now Optional evaluation timestamp.
12
- */
13
- export async function groupConsentsForControllerView(provider, subject, now) {
14
- const rules = await provider.getActiveConsentsForSubject(subject);
15
- return groupActiveConsentsByTarget(rules, { subject, now });
16
- }
17
- /**
18
- * Evaluates requested access against the full active consent set for a subject.
19
- *
20
- * @param provider Consent provider abstraction.
21
- * @param request Access request to evaluate.
22
- */
23
- export async function evaluateRequestedAccess(provider, request) {
24
- const rules = await provider.getActiveConsentsForSubject(String(request.subject || '').trim());
25
- return evaluateConsentCoverage(rules, request);
26
- }
27
- /**
28
- * Returns the missing-permission projection for a consent evaluation.
29
- *
30
- * @param evaluation Result returned by `evaluateRequestedAccess(...)` or `evaluateConsentCoverage(...)`.
31
- */
32
- export function getMissingPermissions(evaluation) {
33
- return evaluation.missing;
34
- }
35
- function compact(values) {
36
- return values.map((value) => String(value || '').trim()).filter(Boolean);
37
- }
38
- /**
39
- * Builds the canonical `Communication` payload used to request additional
40
- * subject-controlled permissions when the current SMART request is not covered.
41
- *
42
- * Push/email/SMS remain notification channels around this canonical
43
- * `Communication`, not the primary contract.
44
- *
45
- * @param input Permission-request details to encode.
46
- */
47
- export function buildPermissionRequestCommunication(input) {
48
- const requester = input.requester;
49
- const requesterTargets = compact([
50
- requester.did,
51
- requester.email,
52
- requester.phone,
53
- requester.organizationDid,
54
- requester.organizationUrl,
55
- requester.jurisdiction,
56
- ]);
57
- const text = input.justification
58
- || `Missing consent coverage for ${input.missing.sections.join(', ') || 'requested sections'}`
59
- + `${input.missing.resourceTypes.length ? ` and ${input.missing.resourceTypes.join(', ')}` : ''}.`;
60
- const claims = {
61
- '@context': 'org.hl7.fhir.r4',
62
- [CommunicationClaim.Identifier]: input.communicationIdentifier,
63
- [CommunicationClaim.Subject]: input.subject,
64
- [CommunicationClaim.Recipient]: input.recipient,
65
- [CommunicationClaim.Sender]: input.sender,
66
- 'AccessRequest.requester-target': requesterTargets.join(','),
67
- 'AccessRequest.requester-role': input.requesterRole,
68
- 'AccessRequest.purpose': input.purpose,
69
- 'AccessRequest.missing-sections': input.missing.sections.join(','),
70
- 'AccessRequest.missing-resource-types': input.missing.resourceTypes.join(','),
71
- 'AccessRequest.document-content-cid': input.documentContentCid,
72
- };
73
- return {
74
- thid: input.thid,
75
- subject: input.subject,
76
- sender: input.sender,
77
- recipient: input.recipient,
78
- category: ['permission-request'],
79
- text,
80
- claims,
81
- };
82
- }
83
- /**
84
- * Builds a canonical subject-scoped `Bundle/_search` query for recovering a
85
- * permission-request `Communication` by stable identifiers.
86
- *
87
- * Retrieval keys supported by the current helper:
88
- * - `Communication.identifier`
89
- * - `thid`
90
- * - `DocumentReference.contenthash` (`z<base58>` CID)
91
- *
92
- * @param input Stable lookup keys for the permission request.
93
- */
94
- export function buildPermissionRequestCommunicationLookupQuery(input) {
95
- const searchParams = {};
96
- if (input.communicationIdentifier)
97
- searchParams[CommunicationClaim.Identifier] = input.communicationIdentifier;
98
- if (input.contentCid)
99
- searchParams['DocumentReference.contenthash'] = input.contentCid;
100
- return {
101
- subject: input.subject,
102
- includedTypes: [
103
- ResourceTypesFhirR4.Communication,
104
- ResourceTypesFhirR4.DocumentReference,
105
- ],
106
- thid: input.thid,
107
- searchParams,
108
- };
109
- }
@@ -1,5 +0,0 @@
1
- /**
2
- * Re-export consent claim helpers from common-utils so SDK CORE consumers can
3
- * discover and use the canonical get/set/add consent claim APIs from one place.
4
- */
5
- export { addActorIdentifierList, addActorRoleList, addActors, addCategories, addCategoryList, addClaimValues, addPurposeList, addPurposes, addRoles, addSections, getActorIdentifierList, getActorRoleList, getActors, getCategories, getCategoryList, getClaimValues, getConsentDate, getConsentIdentifier, getConsentPeriodEnd, getConsentPeriodStart, getPurposeList, getPurposes, getRoles, getSections, removeActorIdentifierList, removeActorRoleList, removeActors, removeCategories, removeCategoryList, removeClaimValues, removePurposeList, removePurposes, removeRoles, removeSections, setActorIdentifierList, setActorRoleList, setActors, setCategories, setCategoryList, setClaimValues, setConsentDate, setConsentIdentifier, setConsentPeriodEnd, setConsentPeriodStart, setPurposeList, setPurposes, setRoles, setSections, type InteroperableClaims as ConsentInteroperableClaims, } from 'gdc-common-utils-ts';
@@ -1,6 +0,0 @@
1
- // Copyright 2026 Antifraud Services Inc. under the Apache License, Version 2.0.
2
- /**
3
- * Re-export consent claim helpers from common-utils so SDK CORE consumers can
4
- * discover and use the canonical get/set/add consent claim APIs from one place.
5
- */
6
- export { addActorIdentifierList, addActorRoleList, addActors, addCategories, addCategoryList, addClaimValues, addPurposeList, addPurposes, addRoles, addSections, getActorIdentifierList, getActorRoleList, getActors, getCategories, getCategoryList, getClaimValues, getConsentDate, getConsentIdentifier, getConsentPeriodEnd, getConsentPeriodStart, getPurposeList, getPurposes, getRoles, getSections, removeActorIdentifierList, removeActorRoleList, removeActors, removeCategories, removeCategoryList, removeClaimValues, removePurposeList, removePurposes, removeRoles, removeSections, setActorIdentifierList, setActorRoleList, setActors, setCategories, setCategoryList, setClaimValues, setConsentDate, setConsentIdentifier, setConsentPeriodEnd, setConsentPeriodStart, setPurposeList, setPurposes, setRoles, setSections, } from 'gdc-common-utils-ts';