phenoml 16.0.0 → 17.0.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 (421) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/api/resources/agent/client/Client.d.ts +3 -59
  3. package/dist/cjs/api/resources/agent/client/Client.js +7 -232
  4. package/dist/cjs/api/resources/agent/client/requests/index.d.ts +0 -3
  5. package/dist/cjs/api/resources/{fhir/errors/InternalServerError.d.ts → agent/errors/GatewayTimeoutError.d.ts} +1 -1
  6. package/dist/cjs/api/resources/{fhir/errors/BadGatewayError.js → agent/errors/GatewayTimeoutError.js} +5 -5
  7. package/dist/cjs/api/resources/agent/errors/index.d.ts +1 -0
  8. package/dist/cjs/api/resources/agent/errors/index.js +1 -0
  9. package/dist/cjs/api/resources/agent/resources/chat/client/Client.d.ts +79 -0
  10. package/dist/cjs/api/resources/agent/resources/chat/client/Client.js +305 -0
  11. package/dist/cjs/api/resources/agent/{client/requests/GetChatMessagesRequest.d.ts → resources/chat/client/requests/ListMessagesRequest.d.ts} +4 -4
  12. package/dist/cjs/api/resources/agent/resources/chat/client/requests/index.d.ts +3 -0
  13. package/dist/cjs/api/resources/agent/resources/chat/exports.d.ts +2 -0
  14. package/dist/cjs/api/resources/{tools/resources/mcpServer/resources/tools → agent/resources/chat}/exports.js +2 -2
  15. package/dist/cjs/api/resources/agent/resources/chat/index.d.ts +2 -0
  16. package/dist/cjs/api/resources/{tools/resources/mcpServer → agent/resources/chat}/index.js +1 -1
  17. package/dist/cjs/api/resources/agent/resources/chat/types/ListMessagesRequestOrder.d.ts +5 -0
  18. package/dist/cjs/api/resources/agent/{types/GetChatMessagesRequestOrder.js → resources/chat/types/ListMessagesRequestOrder.js} +2 -2
  19. package/dist/cjs/api/resources/agent/resources/chat/types/ListMessagesRequestRole.d.ts +7 -0
  20. package/dist/cjs/api/resources/agent/{types/GetChatMessagesRequestRole.js → resources/chat/types/ListMessagesRequestRole.js} +2 -2
  21. package/dist/cjs/api/resources/agent/{types/GetChatMessagesResponse.d.ts → resources/chat/types/ListMessagesResponse.d.ts} +2 -2
  22. package/dist/cjs/api/resources/agent/resources/chat/types/index.d.ts +3 -0
  23. package/dist/cjs/api/resources/agent/resources/chat/types/index.js +19 -0
  24. package/dist/cjs/api/resources/agent/resources/index.d.ts +3 -0
  25. package/dist/cjs/api/resources/agent/resources/index.js +4 -1
  26. package/dist/cjs/api/resources/agent/types/index.d.ts +0 -3
  27. package/dist/cjs/api/resources/agent/types/index.js +0 -3
  28. package/dist/cjs/api/resources/construe/client/Client.d.ts +6 -330
  29. package/dist/cjs/api/resources/construe/client/Client.js +8 -838
  30. package/dist/cjs/api/resources/construe/client/requests/index.d.ts +0 -9
  31. package/dist/cjs/api/resources/construe/client/requests/index.js +0 -3
  32. package/dist/cjs/api/resources/construe/exports.d.ts +1 -0
  33. package/dist/cjs/api/resources/construe/exports.js +1 -0
  34. package/dist/cjs/api/resources/construe/index.d.ts +1 -0
  35. package/dist/cjs/api/resources/construe/index.js +1 -0
  36. package/dist/cjs/api/resources/construe/resources/codeSystems/client/Client.d.ts +135 -0
  37. package/dist/cjs/api/resources/construe/resources/codeSystems/client/Client.js +433 -0
  38. package/dist/cjs/api/resources/construe/resources/codeSystems/client/index.d.ts +1 -0
  39. package/dist/cjs/api/resources/construe/resources/codeSystems/client/index.js +17 -0
  40. package/dist/{esm/api/resources/construe/client/requests/ExportCodeSystemRequest.d.mts → cjs/api/resources/construe/resources/codeSystems/client/requests/DeleteRequest.d.ts} +1 -1
  41. package/dist/cjs/api/resources/construe/{client/requests/DeleteCodeSystemRequest.d.ts → resources/codeSystems/client/requests/ExportRequest.d.ts} +1 -1
  42. package/dist/cjs/api/resources/construe/{client/requests/GetCodeSystemRequest.d.ts → resources/codeSystems/client/requests/FindRequest.d.ts} +1 -1
  43. package/dist/cjs/api/resources/construe/{client → resources/codeSystems/client}/requests/UploadRequest.d.ts +1 -1
  44. package/dist/cjs/api/resources/construe/resources/codeSystems/client/requests/index.d.ts +4 -0
  45. package/dist/cjs/api/resources/construe/resources/codeSystems/client/requests/index.js +5 -0
  46. package/dist/cjs/api/resources/construe/resources/codeSystems/exports.d.ts +2 -0
  47. package/dist/cjs/api/resources/{tools/resources/mcpServer → construe/resources/codeSystems}/exports.js +2 -3
  48. package/dist/cjs/api/resources/construe/resources/codeSystems/index.d.ts +2 -0
  49. package/dist/cjs/api/resources/construe/resources/codeSystems/index.js +18 -0
  50. package/dist/{esm/api/resources/construe/types/UploadCodeSystemResponse.d.mts → cjs/api/resources/construe/resources/codeSystems/types/UploadResponse.d.ts} +1 -1
  51. package/dist/cjs/api/resources/construe/resources/codeSystems/types/index.d.ts +1 -0
  52. package/dist/cjs/api/resources/construe/resources/codeSystems/types/index.js +17 -0
  53. package/dist/cjs/api/resources/construe/resources/codes/client/Client.d.ts +227 -0
  54. package/dist/cjs/api/resources/construe/resources/codes/client/Client.js +528 -0
  55. package/dist/cjs/api/resources/construe/resources/codes/client/index.d.ts +1 -0
  56. package/dist/cjs/api/resources/construe/resources/codes/client/index.js +17 -0
  57. package/dist/cjs/api/resources/construe/{client/requests/ListCodesRequest.d.ts → resources/codes/client/requests/CodesListRequest.d.ts} +1 -1
  58. package/dist/cjs/api/resources/construe/{client → resources/codes/client}/requests/ExtractRequest.d.ts +1 -1
  59. package/dist/{esm/api/resources/construe/client/requests/GetCodeRequest.d.mts → cjs/api/resources/construe/resources/codes/client/requests/LookupRequest.d.ts} +1 -1
  60. package/dist/cjs/api/resources/construe/resources/codes/client/requests/index.d.ts +5 -0
  61. package/dist/cjs/api/resources/construe/resources/codes/exports.d.ts +2 -0
  62. package/dist/cjs/api/resources/construe/resources/codes/exports.js +21 -0
  63. package/dist/cjs/api/resources/construe/resources/index.d.ts +5 -0
  64. package/dist/cjs/api/resources/construe/resources/index.js +44 -0
  65. package/dist/cjs/api/resources/construe/types/index.d.ts +0 -1
  66. package/dist/cjs/api/resources/construe/types/index.js +0 -1
  67. package/dist/cjs/api/resources/fhir/client/Client.d.ts +50 -75
  68. package/dist/cjs/api/resources/fhir/client/Client.js +75 -205
  69. package/dist/cjs/api/resources/fhir/client/requests/CreateRequest.d.ts +2 -3
  70. package/dist/cjs/api/resources/fhir/client/requests/ExecuteBundleRequest.d.ts +19 -16
  71. package/dist/cjs/api/resources/fhir/client/requests/SearchRequest.d.ts +0 -8
  72. package/dist/cjs/api/resources/fhir/client/requests/UpsertRequest.d.ts +3 -4
  73. package/dist/cjs/api/resources/fhir/index.d.ts +0 -1
  74. package/dist/cjs/api/resources/fhir/index.js +0 -1
  75. package/dist/cjs/api/resources/fhir/types/index.d.ts +0 -4
  76. package/dist/cjs/api/resources/fhir/types/index.js +0 -4
  77. package/dist/cjs/api/resources/fhirProvider/client/Client.d.ts +3 -74
  78. package/dist/cjs/api/resources/fhirProvider/client/Client.js +5 -221
  79. package/dist/cjs/api/resources/fhirProvider/client/requests/index.d.ts +0 -2
  80. package/dist/cjs/api/resources/fhirProvider/exports.d.ts +1 -0
  81. package/dist/cjs/api/resources/fhirProvider/exports.js +1 -0
  82. package/dist/cjs/api/resources/fhirProvider/index.d.ts +1 -0
  83. package/dist/cjs/api/resources/fhirProvider/index.js +1 -0
  84. package/dist/cjs/api/resources/fhirProvider/resources/authConfig/client/Client.d.ts +90 -0
  85. package/dist/cjs/api/resources/fhirProvider/resources/authConfig/client/Client.js +280 -0
  86. package/dist/cjs/api/resources/fhirProvider/resources/authConfig/client/index.d.ts +1 -0
  87. package/dist/cjs/api/resources/fhirProvider/resources/authConfig/client/index.js +17 -0
  88. package/dist/cjs/api/resources/fhirProvider/resources/authConfig/client/requests/index.d.ts +2 -0
  89. package/dist/cjs/api/resources/fhirProvider/resources/authConfig/client/requests/index.js +2 -0
  90. package/dist/cjs/api/resources/fhirProvider/resources/authConfig/exports.d.ts +2 -0
  91. package/dist/cjs/api/resources/fhirProvider/resources/authConfig/exports.js +21 -0
  92. package/dist/cjs/api/resources/fhirProvider/resources/authConfig/index.d.ts +2 -0
  93. package/dist/cjs/api/resources/fhirProvider/resources/authConfig/index.js +18 -0
  94. package/dist/cjs/api/resources/fhirProvider/{types/RemoveAuthConfigResponse.d.ts → resources/authConfig/types/RemoveResponse.d.ts} +2 -2
  95. package/dist/cjs/api/resources/fhirProvider/resources/authConfig/types/index.d.ts +1 -0
  96. package/dist/cjs/api/resources/fhirProvider/resources/authConfig/types/index.js +17 -0
  97. package/dist/cjs/api/resources/fhirProvider/resources/index.d.ts +3 -0
  98. package/dist/cjs/api/resources/{tools/resources/mcpServer → fhirProvider}/resources/index.js +7 -2
  99. package/dist/cjs/api/resources/fhirProvider/types/index.d.ts +0 -1
  100. package/dist/cjs/api/resources/fhirProvider/types/index.js +0 -1
  101. package/dist/cjs/api/resources/lang2Fhir/client/Client.d.ts +11 -1
  102. package/dist/cjs/api/resources/lang2Fhir/client/Client.js +33 -3
  103. package/dist/cjs/api/resources/{fhir/errors/ServiceUnavailableError.d.ts → lang2Fhir/errors/ClientClosedRequestError.d.ts} +1 -1
  104. package/dist/cjs/api/resources/lang2Fhir/errors/ClientClosedRequestError.js +54 -0
  105. package/dist/cjs/api/resources/{fhir/errors/UnauthorizedError.d.ts → lang2Fhir/errors/GatewayTimeoutError.d.ts} +1 -1
  106. package/dist/cjs/api/resources/{fhir/errors/InternalServerError.js → lang2Fhir/errors/GatewayTimeoutError.js} +5 -5
  107. package/dist/cjs/api/resources/lang2Fhir/errors/index.d.ts +3 -1
  108. package/dist/cjs/api/resources/lang2Fhir/errors/index.js +3 -1
  109. package/dist/cjs/api/resources/summary/resources/templates/client/Client.d.ts +7 -4
  110. package/dist/cjs/api/resources/summary/resources/templates/client/Client.js +6 -12
  111. package/dist/{esm/api/resources/summary/resources/templates/types/TemplatesDeleteResponse.d.mts → cjs/api/resources/summary/resources/templates/types/DeleteResponse.d.ts} +1 -1
  112. package/dist/cjs/api/resources/summary/resources/templates/types/{TemplatesGetResponse.d.ts → GetResponse.d.ts} +1 -1
  113. package/dist/cjs/api/resources/summary/resources/templates/types/{TemplatesListResponse.d.ts → ListResponse.d.ts} +1 -1
  114. package/dist/cjs/api/resources/summary/resources/templates/types/{TemplatesUpdateResponse.d.ts → UpdateResponse.d.ts} +1 -1
  115. package/dist/cjs/api/resources/summary/resources/templates/types/index.d.ts +4 -4
  116. package/dist/cjs/api/resources/summary/resources/templates/types/index.js +4 -4
  117. package/dist/cjs/api/resources/tools/client/Client.d.ts +6 -6
  118. package/dist/cjs/api/resources/tools/client/Client.js +8 -12
  119. package/dist/cjs/api/resources/{fhir/errors/BadRequestError.d.ts → tools/errors/NotFoundError.d.ts} +1 -1
  120. package/dist/cjs/api/resources/{fhir/errors/BadRequestError.js → tools/errors/NotFoundError.js} +5 -5
  121. package/dist/cjs/api/resources/tools/errors/index.d.ts +1 -1
  122. package/dist/cjs/api/resources/tools/errors/index.js +1 -1
  123. package/dist/cjs/api/resources/tools/resources/index.d.ts +3 -2
  124. package/dist/cjs/api/resources/tools/resources/index.js +4 -3
  125. package/dist/cjs/api/resources/tools/resources/{mcpServer → mcpServers}/client/Client.d.ts +21 -19
  126. package/dist/cjs/api/resources/tools/resources/{mcpServer → mcpServers}/client/Client.js +20 -16
  127. package/dist/cjs/api/resources/tools/resources/mcpServers/client/index.d.ts +1 -0
  128. package/dist/cjs/api/resources/tools/resources/mcpServers/client/index.js +17 -0
  129. package/dist/cjs/api/resources/tools/resources/mcpServers/client/requests/index.js +2 -0
  130. package/dist/cjs/api/resources/tools/resources/mcpServers/exports.d.ts +2 -0
  131. package/dist/cjs/api/resources/tools/resources/mcpServers/exports.js +21 -0
  132. package/dist/cjs/api/resources/tools/resources/mcpServers/index.d.ts +1 -0
  133. package/dist/cjs/api/resources/tools/resources/mcpServers/index.js +17 -0
  134. package/dist/cjs/api/resources/tools/resources/{mcpServer/resources/tools → mcpTools}/client/Client.d.ts +19 -17
  135. package/dist/cjs/api/resources/tools/resources/{mcpServer/resources/tools → mcpTools}/client/Client.js +22 -16
  136. package/dist/cjs/api/resources/tools/resources/mcpTools/client/index.js +2 -0
  137. package/dist/cjs/api/resources/tools/resources/mcpTools/exports.d.ts +2 -0
  138. package/dist/cjs/api/resources/tools/resources/mcpTools/exports.js +21 -0
  139. package/dist/cjs/api/resources/tools/resources/mcpTools/index.d.ts +1 -0
  140. package/dist/cjs/api/resources/tools/resources/mcpTools/index.js +17 -0
  141. package/dist/cjs/api/resources/workflows/client/Client.d.ts +3 -0
  142. package/dist/cjs/api/resources/workflows/client/Client.js +9 -0
  143. package/dist/cjs/version.d.ts +1 -1
  144. package/dist/cjs/version.js +1 -1
  145. package/dist/esm/BaseClient.mjs +2 -2
  146. package/dist/esm/api/resources/agent/client/Client.d.mts +3 -59
  147. package/dist/esm/api/resources/agent/client/Client.mjs +6 -231
  148. package/dist/esm/api/resources/agent/client/requests/index.d.mts +0 -3
  149. package/dist/esm/api/resources/{fhir/errors/InternalServerError.d.mts → agent/errors/GatewayTimeoutError.d.mts} +1 -1
  150. package/dist/esm/api/resources/{fhir/errors/InternalServerError.mjs → agent/errors/GatewayTimeoutError.mjs} +3 -3
  151. package/dist/esm/api/resources/agent/errors/index.d.mts +1 -0
  152. package/dist/esm/api/resources/agent/errors/index.mjs +1 -0
  153. package/dist/esm/api/resources/agent/resources/chat/client/Client.d.mts +79 -0
  154. package/dist/esm/api/resources/agent/resources/chat/client/Client.mjs +268 -0
  155. package/dist/esm/api/resources/agent/{client/requests/GetChatMessagesRequest.d.mts → resources/chat/client/requests/ListMessagesRequest.d.mts} +4 -4
  156. package/dist/esm/api/resources/agent/resources/chat/client/requests/index.d.mts +3 -0
  157. package/dist/esm/api/resources/agent/resources/chat/exports.d.mts +2 -0
  158. package/dist/esm/api/resources/{tools/resources/mcpServer/resources/tools → agent/resources/chat}/exports.mjs +1 -1
  159. package/dist/esm/api/resources/agent/resources/chat/index.d.mts +2 -0
  160. package/dist/esm/api/resources/agent/resources/chat/index.mjs +2 -0
  161. package/dist/esm/api/resources/agent/resources/chat/types/ListMessagesRequestOrder.d.mts +5 -0
  162. package/dist/esm/api/resources/agent/{types/GetChatMessagesRequestOrder.mjs → resources/chat/types/ListMessagesRequestOrder.mjs} +1 -1
  163. package/dist/esm/api/resources/agent/resources/chat/types/ListMessagesRequestRole.d.mts +7 -0
  164. package/dist/esm/api/resources/agent/{types/GetChatMessagesRequestRole.mjs → resources/chat/types/ListMessagesRequestRole.mjs} +1 -1
  165. package/dist/esm/api/resources/agent/{types/GetChatMessagesResponse.d.mts → resources/chat/types/ListMessagesResponse.d.mts} +2 -2
  166. package/dist/esm/api/resources/agent/resources/chat/types/index.d.mts +3 -0
  167. package/dist/esm/api/resources/agent/resources/chat/types/index.mjs +3 -0
  168. package/dist/esm/api/resources/agent/resources/index.d.mts +3 -0
  169. package/dist/esm/api/resources/agent/resources/index.mjs +3 -0
  170. package/dist/esm/api/resources/agent/types/index.d.mts +0 -3
  171. package/dist/esm/api/resources/agent/types/index.mjs +0 -3
  172. package/dist/esm/api/resources/construe/client/Client.d.mts +6 -330
  173. package/dist/esm/api/resources/construe/client/Client.mjs +8 -838
  174. package/dist/esm/api/resources/construe/client/requests/index.d.mts +0 -9
  175. package/dist/esm/api/resources/construe/client/requests/index.mjs +1 -1
  176. package/dist/esm/api/resources/construe/exports.d.mts +1 -0
  177. package/dist/esm/api/resources/construe/exports.mjs +1 -0
  178. package/dist/esm/api/resources/construe/index.d.mts +1 -0
  179. package/dist/esm/api/resources/construe/index.mjs +1 -0
  180. package/dist/esm/api/resources/construe/resources/codeSystems/client/Client.d.mts +135 -0
  181. package/dist/esm/api/resources/construe/resources/codeSystems/client/Client.mjs +396 -0
  182. package/dist/esm/api/resources/construe/resources/codeSystems/client/index.d.mts +1 -0
  183. package/dist/esm/api/resources/construe/resources/codeSystems/client/index.mjs +1 -0
  184. package/dist/{cjs/api/resources/construe/client/requests/ExportCodeSystemRequest.d.ts → esm/api/resources/construe/resources/codeSystems/client/requests/DeleteRequest.d.mts} +1 -1
  185. package/dist/esm/api/resources/construe/{client/requests/DeleteCodeSystemRequest.d.mts → resources/codeSystems/client/requests/ExportRequest.d.mts} +1 -1
  186. package/dist/esm/api/resources/construe/{client/requests/GetCodeSystemRequest.d.mts → resources/codeSystems/client/requests/FindRequest.d.mts} +1 -1
  187. package/dist/esm/api/resources/construe/{client → resources/codeSystems/client}/requests/UploadRequest.d.mts +1 -1
  188. package/dist/esm/api/resources/construe/resources/codeSystems/client/requests/index.d.mts +4 -0
  189. package/dist/esm/api/resources/construe/resources/codeSystems/client/requests/index.mjs +1 -0
  190. package/dist/esm/api/resources/construe/resources/codeSystems/exports.d.mts +2 -0
  191. package/dist/esm/api/resources/{tools/resources/mcpServer → construe/resources/codeSystems}/exports.mjs +1 -2
  192. package/dist/esm/api/resources/construe/resources/codeSystems/index.d.mts +2 -0
  193. package/dist/esm/api/resources/construe/resources/codeSystems/index.mjs +2 -0
  194. package/dist/{cjs/api/resources/construe/types/UploadCodeSystemResponse.d.ts → esm/api/resources/construe/resources/codeSystems/types/UploadResponse.d.mts} +1 -1
  195. package/dist/esm/api/resources/construe/resources/codeSystems/types/index.d.mts +1 -0
  196. package/dist/esm/api/resources/construe/resources/codeSystems/types/index.mjs +1 -0
  197. package/dist/esm/api/resources/construe/resources/codes/client/Client.d.mts +227 -0
  198. package/dist/esm/api/resources/construe/resources/codes/client/Client.mjs +491 -0
  199. package/dist/esm/api/resources/construe/resources/codes/client/index.d.mts +1 -0
  200. package/dist/esm/api/resources/construe/resources/codes/client/index.mjs +1 -0
  201. package/dist/esm/api/resources/construe/{client/requests/ListCodesRequest.d.mts → resources/codes/client/requests/CodesListRequest.d.mts} +1 -1
  202. package/dist/esm/api/resources/construe/{client → resources/codes/client}/requests/ExtractRequest.d.mts +1 -1
  203. package/dist/{cjs/api/resources/construe/client/requests/GetCodeRequest.d.ts → esm/api/resources/construe/resources/codes/client/requests/LookupRequest.d.mts} +1 -1
  204. package/dist/esm/api/resources/construe/resources/codes/client/requests/index.d.mts +5 -0
  205. package/dist/esm/api/resources/construe/resources/codes/exports.d.mts +2 -0
  206. package/dist/esm/api/resources/construe/resources/codes/exports.mjs +3 -0
  207. package/dist/esm/api/resources/construe/resources/index.d.mts +5 -0
  208. package/dist/esm/api/resources/construe/resources/index.mjs +5 -0
  209. package/dist/esm/api/resources/construe/types/index.d.mts +0 -1
  210. package/dist/esm/api/resources/construe/types/index.mjs +0 -1
  211. package/dist/esm/api/resources/fhir/client/Client.d.mts +50 -75
  212. package/dist/esm/api/resources/fhir/client/Client.mjs +75 -205
  213. package/dist/esm/api/resources/fhir/client/requests/CreateRequest.d.mts +2 -3
  214. package/dist/esm/api/resources/fhir/client/requests/ExecuteBundleRequest.d.mts +19 -16
  215. package/dist/esm/api/resources/fhir/client/requests/SearchRequest.d.mts +0 -8
  216. package/dist/esm/api/resources/fhir/client/requests/UpsertRequest.d.mts +3 -4
  217. package/dist/esm/api/resources/fhir/index.d.mts +0 -1
  218. package/dist/esm/api/resources/fhir/index.mjs +0 -1
  219. package/dist/esm/api/resources/fhir/types/index.d.mts +0 -4
  220. package/dist/esm/api/resources/fhir/types/index.mjs +0 -4
  221. package/dist/esm/api/resources/fhirProvider/client/Client.d.mts +3 -74
  222. package/dist/esm/api/resources/fhirProvider/client/Client.mjs +5 -221
  223. package/dist/esm/api/resources/fhirProvider/client/requests/index.d.mts +0 -2
  224. package/dist/esm/api/resources/fhirProvider/exports.d.mts +1 -0
  225. package/dist/esm/api/resources/fhirProvider/exports.mjs +1 -0
  226. package/dist/esm/api/resources/fhirProvider/index.d.mts +1 -0
  227. package/dist/esm/api/resources/fhirProvider/index.mjs +1 -0
  228. package/dist/esm/api/resources/fhirProvider/resources/authConfig/client/Client.d.mts +90 -0
  229. package/dist/esm/api/resources/fhirProvider/resources/authConfig/client/Client.mjs +243 -0
  230. package/dist/esm/api/resources/fhirProvider/resources/authConfig/client/index.d.mts +1 -0
  231. package/dist/esm/api/resources/fhirProvider/resources/authConfig/client/index.mjs +1 -0
  232. package/dist/esm/api/resources/fhirProvider/resources/authConfig/client/requests/index.d.mts +2 -0
  233. package/dist/esm/api/resources/fhirProvider/resources/authConfig/exports.d.mts +2 -0
  234. package/dist/esm/api/resources/fhirProvider/resources/authConfig/exports.mjs +3 -0
  235. package/dist/esm/api/resources/fhirProvider/resources/authConfig/index.d.mts +2 -0
  236. package/dist/esm/api/resources/fhirProvider/resources/authConfig/index.mjs +2 -0
  237. package/dist/esm/api/resources/fhirProvider/{types/RemoveAuthConfigResponse.d.mts → resources/authConfig/types/RemoveResponse.d.mts} +2 -2
  238. package/dist/esm/api/resources/fhirProvider/resources/authConfig/types/index.d.mts +1 -0
  239. package/dist/esm/api/resources/fhirProvider/resources/authConfig/types/index.mjs +1 -0
  240. package/dist/esm/api/resources/fhirProvider/resources/index.d.mts +3 -0
  241. package/dist/esm/api/resources/fhirProvider/resources/index.mjs +3 -0
  242. package/dist/esm/api/resources/fhirProvider/types/index.d.mts +0 -1
  243. package/dist/esm/api/resources/fhirProvider/types/index.mjs +0 -1
  244. package/dist/esm/api/resources/lang2Fhir/client/Client.d.mts +11 -1
  245. package/dist/esm/api/resources/lang2Fhir/client/Client.mjs +33 -3
  246. package/dist/esm/api/resources/{fhir/errors/ServiceUnavailableError.d.mts → lang2Fhir/errors/ClientClosedRequestError.d.mts} +1 -1
  247. package/dist/esm/api/resources/lang2Fhir/errors/ClientClosedRequestError.mjs +17 -0
  248. package/dist/esm/api/resources/{fhir/errors/UnauthorizedError.d.mts → lang2Fhir/errors/GatewayTimeoutError.d.mts} +1 -1
  249. package/dist/esm/api/resources/{fhir/errors/BadGatewayError.mjs → lang2Fhir/errors/GatewayTimeoutError.mjs} +3 -3
  250. package/dist/esm/api/resources/lang2Fhir/errors/index.d.mts +3 -1
  251. package/dist/esm/api/resources/lang2Fhir/errors/index.mjs +3 -1
  252. package/dist/esm/api/resources/summary/resources/templates/client/Client.d.mts +7 -4
  253. package/dist/esm/api/resources/summary/resources/templates/client/Client.mjs +6 -12
  254. package/dist/{cjs/api/resources/summary/resources/templates/types/TemplatesDeleteResponse.d.ts → esm/api/resources/summary/resources/templates/types/DeleteResponse.d.mts} +1 -1
  255. package/dist/esm/api/resources/summary/resources/templates/types/{TemplatesGetResponse.d.mts → GetResponse.d.mts} +1 -1
  256. package/dist/esm/api/resources/summary/resources/templates/types/{TemplatesListResponse.d.mts → ListResponse.d.mts} +1 -1
  257. package/dist/esm/api/resources/summary/resources/templates/types/{TemplatesUpdateResponse.d.mts → UpdateResponse.d.mts} +1 -1
  258. package/dist/esm/api/resources/summary/resources/templates/types/index.d.mts +4 -4
  259. package/dist/esm/api/resources/summary/resources/templates/types/index.mjs +4 -4
  260. package/dist/esm/api/resources/tools/client/Client.d.mts +6 -6
  261. package/dist/esm/api/resources/tools/client/Client.mjs +8 -12
  262. package/dist/esm/api/resources/{fhir/errors/BadRequestError.d.mts → tools/errors/NotFoundError.d.mts} +1 -1
  263. package/dist/esm/api/resources/{fhir/errors/BadRequestError.mjs → tools/errors/NotFoundError.mjs} +3 -3
  264. package/dist/esm/api/resources/tools/errors/index.d.mts +1 -1
  265. package/dist/esm/api/resources/tools/errors/index.mjs +1 -1
  266. package/dist/esm/api/resources/tools/resources/index.d.mts +3 -2
  267. package/dist/esm/api/resources/tools/resources/index.mjs +3 -2
  268. package/dist/esm/api/resources/tools/resources/{mcpServer → mcpServers}/client/Client.d.mts +21 -19
  269. package/dist/esm/api/resources/tools/resources/{mcpServer → mcpServers}/client/Client.mjs +18 -14
  270. package/dist/esm/api/resources/tools/resources/mcpServers/client/index.d.mts +1 -0
  271. package/dist/esm/api/resources/tools/resources/mcpServers/client/index.mjs +1 -0
  272. package/dist/esm/api/resources/tools/resources/mcpServers/client/requests/index.mjs +1 -0
  273. package/dist/esm/api/resources/tools/resources/mcpServers/exports.d.mts +2 -0
  274. package/dist/esm/api/resources/tools/resources/mcpServers/exports.mjs +3 -0
  275. package/dist/esm/api/resources/tools/resources/mcpServers/index.d.mts +1 -0
  276. package/dist/esm/api/resources/tools/resources/mcpServers/index.mjs +1 -0
  277. package/dist/esm/api/resources/tools/resources/{mcpServer/resources/tools → mcpTools}/client/Client.d.mts +19 -17
  278. package/dist/esm/api/resources/tools/resources/{mcpServer/resources/tools → mcpTools}/client/Client.mjs +20 -14
  279. package/dist/esm/api/resources/tools/resources/mcpTools/client/index.d.mts +1 -0
  280. package/dist/esm/api/resources/tools/resources/mcpTools/client/index.mjs +1 -0
  281. package/dist/esm/api/resources/tools/resources/mcpTools/exports.d.mts +2 -0
  282. package/dist/esm/api/resources/tools/resources/mcpTools/exports.mjs +3 -0
  283. package/dist/esm/api/resources/tools/resources/mcpTools/index.d.mts +1 -0
  284. package/dist/esm/api/resources/tools/resources/mcpTools/index.mjs +1 -0
  285. package/dist/esm/api/resources/workflows/client/Client.d.mts +3 -0
  286. package/dist/esm/api/resources/workflows/client/Client.mjs +9 -0
  287. package/dist/esm/version.d.mts +1 -1
  288. package/dist/esm/version.mjs +1 -1
  289. package/openapi/openapi.json +353 -660
  290. package/package.json +57 -13
  291. package/reference.md +235 -211
  292. package/dist/cjs/api/resources/agent/types/GetChatMessagesRequestOrder.d.ts +0 -5
  293. package/dist/cjs/api/resources/agent/types/GetChatMessagesRequestRole.d.ts +0 -7
  294. package/dist/cjs/api/resources/fhir/errors/BadGatewayError.d.ts +0 -6
  295. package/dist/cjs/api/resources/fhir/errors/ServiceUnavailableError.js +0 -54
  296. package/dist/cjs/api/resources/fhir/errors/TooManyRequestsError.d.ts +0 -6
  297. package/dist/cjs/api/resources/fhir/errors/TooManyRequestsError.js +0 -54
  298. package/dist/cjs/api/resources/fhir/errors/UnauthorizedError.js +0 -54
  299. package/dist/cjs/api/resources/fhir/errors/index.d.ts +0 -7
  300. package/dist/cjs/api/resources/fhir/errors/index.js +0 -23
  301. package/dist/cjs/api/resources/fhir/types/ErrorResponse.d.ts +0 -11
  302. package/dist/cjs/api/resources/fhir/types/FhirBundle.d.ts +0 -54
  303. package/dist/cjs/api/resources/fhir/types/FhirBundle.js +0 -23
  304. package/dist/cjs/api/resources/fhir/types/FhirResource.d.ts +0 -24
  305. package/dist/cjs/api/resources/fhir/types/SearchResponse.d.ts +0 -2
  306. package/dist/cjs/api/resources/lang2Fhir/errors/FailedDependencyError.d.ts +0 -5
  307. package/dist/cjs/api/resources/lang2Fhir/errors/FailedDependencyError.js +0 -54
  308. package/dist/cjs/api/resources/summary/resources/templates/types/TemplatesGetResponse.js +0 -3
  309. package/dist/cjs/api/resources/summary/resources/templates/types/TemplatesListResponse.js +0 -3
  310. package/dist/cjs/api/resources/summary/resources/templates/types/TemplatesUpdateResponse.js +0 -3
  311. package/dist/cjs/api/resources/tools/errors/FailedDependencyError.d.ts +0 -5
  312. package/dist/cjs/api/resources/tools/errors/FailedDependencyError.js +0 -54
  313. package/dist/cjs/api/resources/tools/resources/mcpServer/exports.d.ts +0 -3
  314. package/dist/cjs/api/resources/tools/resources/mcpServer/index.d.ts +0 -2
  315. package/dist/cjs/api/resources/tools/resources/mcpServer/resources/index.d.ts +0 -1
  316. package/dist/cjs/api/resources/tools/resources/mcpServer/resources/tools/exports.d.ts +0 -2
  317. package/dist/esm/api/resources/agent/types/GetChatMessagesRequestOrder.d.mts +0 -5
  318. package/dist/esm/api/resources/agent/types/GetChatMessagesRequestRole.d.mts +0 -7
  319. package/dist/esm/api/resources/fhir/errors/BadGatewayError.d.mts +0 -6
  320. package/dist/esm/api/resources/fhir/errors/ServiceUnavailableError.mjs +0 -17
  321. package/dist/esm/api/resources/fhir/errors/TooManyRequestsError.d.mts +0 -6
  322. package/dist/esm/api/resources/fhir/errors/TooManyRequestsError.mjs +0 -17
  323. package/dist/esm/api/resources/fhir/errors/UnauthorizedError.mjs +0 -17
  324. package/dist/esm/api/resources/fhir/errors/index.d.mts +0 -7
  325. package/dist/esm/api/resources/fhir/errors/index.mjs +0 -7
  326. package/dist/esm/api/resources/fhir/types/ErrorResponse.d.mts +0 -11
  327. package/dist/esm/api/resources/fhir/types/FhirBundle.d.mts +0 -54
  328. package/dist/esm/api/resources/fhir/types/FhirBundle.mjs +0 -20
  329. package/dist/esm/api/resources/fhir/types/FhirResource.d.mts +0 -24
  330. package/dist/esm/api/resources/fhir/types/SearchResponse.d.mts +0 -2
  331. package/dist/esm/api/resources/lang2Fhir/errors/FailedDependencyError.d.mts +0 -5
  332. package/dist/esm/api/resources/lang2Fhir/errors/FailedDependencyError.mjs +0 -17
  333. package/dist/esm/api/resources/summary/resources/templates/types/TemplatesGetResponse.mjs +0 -2
  334. package/dist/esm/api/resources/summary/resources/templates/types/TemplatesListResponse.mjs +0 -2
  335. package/dist/esm/api/resources/summary/resources/templates/types/TemplatesUpdateResponse.mjs +0 -2
  336. package/dist/esm/api/resources/tools/errors/FailedDependencyError.d.mts +0 -5
  337. package/dist/esm/api/resources/tools/errors/FailedDependencyError.mjs +0 -17
  338. package/dist/esm/api/resources/tools/resources/mcpServer/exports.d.mts +0 -3
  339. package/dist/esm/api/resources/tools/resources/mcpServer/index.d.mts +0 -2
  340. package/dist/esm/api/resources/tools/resources/mcpServer/index.mjs +0 -2
  341. package/dist/esm/api/resources/tools/resources/mcpServer/resources/index.d.mts +0 -1
  342. package/dist/esm/api/resources/tools/resources/mcpServer/resources/index.mjs +0 -1
  343. package/dist/esm/api/resources/tools/resources/mcpServer/resources/tools/exports.d.mts +0 -2
  344. /package/dist/cjs/api/resources/{tools/resources/mcpServer → agent/resources/chat}/client/index.d.ts +0 -0
  345. /package/dist/cjs/api/resources/{tools/resources/mcpServer → agent/resources/chat}/client/index.js +0 -0
  346. /package/dist/cjs/api/resources/agent/{client → resources/chat/client}/requests/AgentChatRequest.d.ts +0 -0
  347. /package/dist/cjs/api/resources/agent/{client → resources/chat/client}/requests/AgentChatRequest.js +0 -0
  348. /package/dist/cjs/api/resources/agent/{client → resources/chat/client}/requests/AgentStreamChatRequest.d.ts +0 -0
  349. /package/dist/cjs/api/resources/agent/{client → resources/chat/client}/requests/AgentStreamChatRequest.js +0 -0
  350. /package/dist/cjs/api/resources/agent/{client/requests/GetChatMessagesRequest.js → resources/chat/client/requests/ListMessagesRequest.js} +0 -0
  351. /package/dist/cjs/api/resources/{tools/resources/mcpServer → agent/resources/chat}/client/requests/index.js +0 -0
  352. /package/dist/cjs/api/resources/agent/{types/GetChatMessagesResponse.js → resources/chat/types/ListMessagesResponse.js} +0 -0
  353. /package/dist/cjs/api/resources/construe/{client/requests/DeleteCodeSystemRequest.js → resources/codeSystems/client/requests/DeleteRequest.js} +0 -0
  354. /package/dist/cjs/api/resources/construe/{client/requests/ExportCodeSystemRequest.js → resources/codeSystems/client/requests/ExportRequest.js} +0 -0
  355. /package/dist/cjs/api/resources/construe/{client/requests/ExtractRequest.js → resources/codeSystems/client/requests/FindRequest.js} +0 -0
  356. /package/dist/cjs/api/resources/construe/{client → resources/codeSystems/client}/requests/UploadRequest.js +0 -0
  357. /package/dist/cjs/api/resources/construe/{client/requests/GetCodeRequest.js → resources/codeSystems/types/UploadResponse.js} +0 -0
  358. /package/dist/cjs/api/resources/construe/{client/requests/GetCodeSystemRequest.js → resources/codes/client/requests/CodesListRequest.js} +0 -0
  359. /package/dist/cjs/api/resources/construe/{client/requests/ListCodesRequest.js → resources/codes/client/requests/ExtractRequest.js} +0 -0
  360. /package/dist/cjs/api/resources/construe/{client/requests/SearchSemanticRequest.js → resources/codes/client/requests/LookupRequest.js} +0 -0
  361. /package/dist/cjs/api/resources/construe/{client → resources/codes/client}/requests/SearchSemanticRequest.d.ts +0 -0
  362. /package/dist/cjs/api/resources/construe/{client/requests/SearchTextRequest.js → resources/codes/client/requests/SearchSemanticRequest.js} +0 -0
  363. /package/dist/cjs/api/resources/construe/{client → resources/codes/client}/requests/SearchTextRequest.d.ts +0 -0
  364. /package/dist/cjs/api/resources/construe/{types/UploadCodeSystemResponse.js → resources/codes/client/requests/SearchTextRequest.js} +0 -0
  365. /package/dist/cjs/api/resources/{tools/resources/mcpServer/resources/tools/client → construe/resources/codes/client/requests}/index.js +0 -0
  366. /package/dist/cjs/api/resources/{tools/resources/mcpServer/resources/tools → construe/resources/codes}/index.d.ts +0 -0
  367. /package/dist/cjs/api/resources/{tools/resources/mcpServer/resources/tools → construe/resources/codes}/index.js +0 -0
  368. /package/dist/cjs/api/resources/fhirProvider/{client → resources/authConfig/client}/requests/FhirProviderRemoveAuthConfigRequest.d.ts +0 -0
  369. /package/dist/cjs/api/resources/fhirProvider/{client → resources/authConfig/client}/requests/FhirProviderRemoveAuthConfigRequest.js +0 -0
  370. /package/dist/cjs/api/resources/fhirProvider/{client → resources/authConfig/client}/requests/FhirProviderSetActiveAuthConfigRequest.d.ts +0 -0
  371. /package/dist/cjs/api/resources/fhirProvider/{client → resources/authConfig/client}/requests/FhirProviderSetActiveAuthConfigRequest.js +0 -0
  372. /package/dist/cjs/api/resources/{fhir/types/ErrorResponse.js → fhirProvider/resources/authConfig/types/RemoveResponse.js} +0 -0
  373. /package/dist/cjs/api/resources/{fhir → lang2Fhir}/errors/NotFoundError.d.ts +0 -0
  374. /package/dist/cjs/api/resources/{fhir → lang2Fhir}/errors/NotFoundError.js +0 -0
  375. /package/dist/cjs/api/resources/{fhir/types/FhirResource.js → summary/resources/templates/types/DeleteResponse.js} +0 -0
  376. /package/dist/cjs/api/resources/{fhir/types/SearchResponse.js → summary/resources/templates/types/GetResponse.js} +0 -0
  377. /package/dist/cjs/api/resources/{fhirProvider/types/RemoveAuthConfigResponse.js → summary/resources/templates/types/ListResponse.js} +0 -0
  378. /package/dist/cjs/api/resources/summary/resources/templates/types/{TemplatesDeleteResponse.js → UpdateResponse.js} +0 -0
  379. /package/dist/cjs/api/resources/tools/resources/{mcpServer → mcpServers}/client/requests/McpServerCreateRequest.d.ts +0 -0
  380. /package/dist/cjs/api/resources/tools/resources/{mcpServer → mcpServers}/client/requests/McpServerCreateRequest.js +0 -0
  381. /package/dist/cjs/api/resources/tools/resources/{mcpServer → mcpServers}/client/requests/index.d.ts +0 -0
  382. /package/dist/cjs/api/resources/tools/resources/{mcpServer/resources/tools → mcpTools}/client/index.d.ts +0 -0
  383. /package/dist/esm/api/resources/{tools/resources/mcpServer → agent/resources/chat}/client/index.d.mts +0 -0
  384. /package/dist/esm/api/resources/{tools/resources/mcpServer → agent/resources/chat}/client/index.mjs +0 -0
  385. /package/dist/esm/api/resources/agent/{client → resources/chat/client}/requests/AgentChatRequest.d.mts +0 -0
  386. /package/dist/esm/api/resources/agent/{client → resources/chat/client}/requests/AgentChatRequest.mjs +0 -0
  387. /package/dist/esm/api/resources/agent/{client → resources/chat/client}/requests/AgentStreamChatRequest.d.mts +0 -0
  388. /package/dist/esm/api/resources/agent/{client → resources/chat/client}/requests/AgentStreamChatRequest.mjs +0 -0
  389. /package/dist/esm/api/resources/agent/{client/requests/GetChatMessagesRequest.mjs → resources/chat/client/requests/ListMessagesRequest.mjs} +0 -0
  390. /package/dist/esm/api/resources/{tools/resources/mcpServer → agent/resources/chat}/client/requests/index.mjs +0 -0
  391. /package/dist/esm/api/resources/agent/{types/GetChatMessagesResponse.mjs → resources/chat/types/ListMessagesResponse.mjs} +0 -0
  392. /package/dist/esm/api/resources/construe/{client/requests/DeleteCodeSystemRequest.mjs → resources/codeSystems/client/requests/DeleteRequest.mjs} +0 -0
  393. /package/dist/esm/api/resources/construe/{client/requests/ExportCodeSystemRequest.mjs → resources/codeSystems/client/requests/ExportRequest.mjs} +0 -0
  394. /package/dist/esm/api/resources/construe/{client/requests/ExtractRequest.mjs → resources/codeSystems/client/requests/FindRequest.mjs} +0 -0
  395. /package/dist/esm/api/resources/construe/{client → resources/codeSystems/client}/requests/UploadRequest.mjs +0 -0
  396. /package/dist/esm/api/resources/construe/{client/requests/GetCodeRequest.mjs → resources/codeSystems/types/UploadResponse.mjs} +0 -0
  397. /package/dist/esm/api/resources/construe/{client/requests/GetCodeSystemRequest.mjs → resources/codes/client/requests/CodesListRequest.mjs} +0 -0
  398. /package/dist/esm/api/resources/construe/{client/requests/ListCodesRequest.mjs → resources/codes/client/requests/ExtractRequest.mjs} +0 -0
  399. /package/dist/esm/api/resources/construe/{client/requests/SearchSemanticRequest.mjs → resources/codes/client/requests/LookupRequest.mjs} +0 -0
  400. /package/dist/esm/api/resources/construe/{client → resources/codes/client}/requests/SearchSemanticRequest.d.mts +0 -0
  401. /package/dist/esm/api/resources/construe/{client/requests/SearchTextRequest.mjs → resources/codes/client/requests/SearchSemanticRequest.mjs} +0 -0
  402. /package/dist/esm/api/resources/construe/{client → resources/codes/client}/requests/SearchTextRequest.d.mts +0 -0
  403. /package/dist/esm/api/resources/construe/{types/UploadCodeSystemResponse.mjs → resources/codes/client/requests/SearchTextRequest.mjs} +0 -0
  404. /package/dist/esm/api/resources/{tools/resources/mcpServer/resources/tools/client → construe/resources/codes/client/requests}/index.mjs +0 -0
  405. /package/dist/esm/api/resources/{tools/resources/mcpServer/resources/tools → construe/resources/codes}/index.d.mts +0 -0
  406. /package/dist/esm/api/resources/{tools/resources/mcpServer/resources/tools → construe/resources/codes}/index.mjs +0 -0
  407. /package/dist/esm/api/resources/fhirProvider/{client → resources/authConfig/client}/requests/FhirProviderRemoveAuthConfigRequest.d.mts +0 -0
  408. /package/dist/esm/api/resources/fhirProvider/{client → resources/authConfig/client}/requests/FhirProviderRemoveAuthConfigRequest.mjs +0 -0
  409. /package/dist/esm/api/resources/fhirProvider/{client → resources/authConfig/client}/requests/FhirProviderSetActiveAuthConfigRequest.d.mts +0 -0
  410. /package/dist/esm/api/resources/fhirProvider/{client → resources/authConfig/client}/requests/FhirProviderSetActiveAuthConfigRequest.mjs +0 -0
  411. /package/dist/esm/api/resources/{tools/resources/mcpServer/resources/tools/client/index.d.mts → fhirProvider/resources/authConfig/client/requests/index.mjs} +0 -0
  412. /package/dist/esm/api/resources/{fhir/types/ErrorResponse.mjs → fhirProvider/resources/authConfig/types/RemoveResponse.mjs} +0 -0
  413. /package/dist/esm/api/resources/{fhir → lang2Fhir}/errors/NotFoundError.d.mts +0 -0
  414. /package/dist/esm/api/resources/{fhir → lang2Fhir}/errors/NotFoundError.mjs +0 -0
  415. /package/dist/esm/api/resources/{fhir/types/FhirResource.mjs → summary/resources/templates/types/DeleteResponse.mjs} +0 -0
  416. /package/dist/esm/api/resources/{fhir/types/SearchResponse.mjs → summary/resources/templates/types/GetResponse.mjs} +0 -0
  417. /package/dist/esm/api/resources/{fhirProvider/types/RemoveAuthConfigResponse.mjs → summary/resources/templates/types/ListResponse.mjs} +0 -0
  418. /package/dist/esm/api/resources/summary/resources/templates/types/{TemplatesDeleteResponse.mjs → UpdateResponse.mjs} +0 -0
  419. /package/dist/esm/api/resources/tools/resources/{mcpServer → mcpServers}/client/requests/McpServerCreateRequest.d.mts +0 -0
  420. /package/dist/esm/api/resources/tools/resources/{mcpServer → mcpServers}/client/requests/McpServerCreateRequest.mjs +0 -0
  421. /package/dist/esm/api/resources/tools/resources/{mcpServer → mcpServers}/client/requests/index.d.mts +0 -0
@@ -51,751 +51,19 @@ const environments = __importStar(require("../../../../environments.js"));
51
51
  const handleNonStatusCodeError_js_1 = require("../../../../errors/handleNonStatusCodeError.js");
52
52
  const errors = __importStar(require("../../../../errors/index.js"));
53
53
  const phenoml = __importStar(require("../../../index.js"));
54
+ const Client_js_1 = require("../resources/codeSystems/client/Client.js");
55
+ const Client_js_2 = require("../resources/codes/client/Client.js");
54
56
  class ConstrueClient {
55
57
  constructor(options = {}) {
56
58
  this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
57
59
  }
58
- /**
59
- * Upload a custom medical code system with codes and descriptions for use in code extraction. Requires a paid plan.
60
- * Returns 202 immediately; embedding generation runs asynchronously. Poll
61
- * GET /construe/codes/systems/{codesystem}?version={version} to check when status
62
- * transitions from "processing" to "ready" or "failed".
63
- *
64
- * @param {phenoml.construe.UploadRequest} request
65
- * @param {ConstrueClient.RequestOptions} requestOptions - Request-specific configuration.
66
- *
67
- * @throws {@link phenoml.construe.BadRequestError}
68
- * @throws {@link phenoml.construe.UnauthorizedError}
69
- * @throws {@link phenoml.construe.ForbiddenError}
70
- * @throws {@link phenoml.construe.ConflictError}
71
- * @throws {@link phenoml.construe.FailedDependencyError}
72
- * @throws {@link phenoml.construe.InternalServerError}
73
- *
74
- * @example
75
- * await client.construe.uploadCodeSystem({
76
- * name: "CUSTOM_CODES",
77
- * version: "1.0",
78
- * format: "json",
79
- * codes: [{
80
- * code: "X001",
81
- * description: "Example custom code 1"
82
- * }, {
83
- * code: "X002",
84
- * description: "Example custom code 2"
85
- * }]
86
- * })
87
- *
88
- * @example
89
- * await client.construe.uploadCodeSystem({
90
- * name: "CUSTOM_CODES",
91
- * version: "1.0",
92
- * format: "csv",
93
- * file: "Y29kZSxkZXNjcmlwdGlvbgpYMDAxLEV4YW1wbGUgY3VzdG9tIGNvZGUgMQo=",
94
- * code_col: "code",
95
- * desc_col: "description"
96
- * })
97
- */
98
- uploadCodeSystem(request, requestOptions) {
99
- return core.HttpResponsePromise.fromPromise(this.__uploadCodeSystem(request, requestOptions));
100
- }
101
- __uploadCodeSystem(request, requestOptions) {
102
- return __awaiter(this, void 0, void 0, function* () {
103
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
104
- const _authRequest = yield this._options.authProvider.getAuthRequest();
105
- const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
106
- const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
107
- url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.phenomlEnvironment.Default, "construe/upload"),
108
- method: "POST",
109
- headers: _headers,
110
- contentType: "application/json",
111
- queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
112
- requestType: "json",
113
- body: request,
114
- timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
115
- maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
116
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
117
- fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
118
- logging: this._options.logging,
119
- });
120
- if (_response.ok) {
121
- return {
122
- data: _response.body,
123
- rawResponse: _response.rawResponse,
124
- };
125
- }
126
- if (_response.error.reason === "status-code") {
127
- switch (_response.error.statusCode) {
128
- case 400:
129
- throw new phenoml.construe.BadRequestError(_response.error.body, _response.rawResponse);
130
- case 401:
131
- throw new phenoml.construe.UnauthorizedError(_response.error.body, _response.rawResponse);
132
- case 403:
133
- throw new phenoml.construe.ForbiddenError(_response.error.body, _response.rawResponse);
134
- case 409:
135
- throw new phenoml.construe.ConflictError(_response.error.body, _response.rawResponse);
136
- case 424:
137
- throw new phenoml.construe.FailedDependencyError(_response.error.body, _response.rawResponse);
138
- case 500:
139
- throw new phenoml.construe.InternalServerError(_response.error.body, _response.rawResponse);
140
- default:
141
- throw new errors.phenomlError({
142
- statusCode: _response.error.statusCode,
143
- body: _response.error.body,
144
- rawResponse: _response.rawResponse,
145
- });
146
- }
147
- }
148
- return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/construe/upload");
149
- });
150
- }
151
- /**
152
- * Converts natural language text into structured medical codes.
153
- *
154
- * Usage of CPT is subject to AMA requirements: see PhenoML Terms of Service.
155
- *
156
- * @param {phenoml.construe.ExtractRequest} request
157
- * @param {ConstrueClient.RequestOptions} requestOptions - Request-specific configuration.
158
- *
159
- * @throws {@link phenoml.construe.BadRequestError}
160
- * @throws {@link phenoml.construe.UnauthorizedError}
161
- * @throws {@link phenoml.construe.NotFoundError}
162
- * @throws {@link phenoml.construe.InternalServerError}
163
- * @throws {@link phenoml.construe.ServiceUnavailableError}
164
- * @throws {@link phenoml.construe.GatewayTimeoutError}
165
- *
166
- * @example
167
- * await client.construe.extractCodes({
168
- * text: "Patient is a 14-year-old female, previously healthy, who is here for evaluation of abnormal renal ultrasound with atrophic right kidney.",
169
- * system: {
170
- * name: "ICD-10-CM",
171
- * version: "2025"
172
- * }
173
- * })
174
- *
175
- * @example
176
- * await client.construe.extractCodes({
177
- * text: "45-year-old male presents with chest pain radiating to left arm, shortness of breath, and diaphoresis. ECG shows ST elevation in leads II, III, and aVF.",
178
- * system: {
179
- * name: "SNOMED_CT_US_LITE",
180
- * version: "20240901"
181
- * },
182
- * config: {
183
- * chunking_method: "sentences",
184
- * validation_method: "simple",
185
- * include_rationale: true,
186
- * include_citations: true
187
- * }
188
- * })
189
- *
190
- * @example
191
- * await client.construe.extractCodes({
192
- * text: "Start Metformin 500mg twice daily for type 2 diabetes. Continue Lisinopril 10mg daily for hypertension. Add Atorvastatin 20mg at bedtime.",
193
- * system: {
194
- * name: "RXNORM",
195
- * version: "11042024"
196
- * },
197
- * config: {
198
- * validation_method: "medication_search",
199
- * include_rationale: true
200
- * }
201
- * })
202
- *
203
- * @example
204
- * await client.construe.extractCodes({
205
- * text: "Patient diagnosed with Type 2 diabetes mellitus with diabetic chronic kidney disease, stage 3.",
206
- * system: {
207
- * name: "ICD-10-CM",
208
- * version: "2025"
209
- * },
210
- * config: {
211
- * validation_method: "simple",
212
- * include_ancestors: true
213
- * }
214
- * })
215
- *
216
- * @example
217
- * await client.construe.extractCodes({
218
- * text: "5-year-old male with seizures, severe intellectual disability, microcephaly, and hypotonia.",
219
- * system: {
220
- * name: "HPO",
221
- * version: "2025"
222
- * },
223
- * config: {
224
- * chunking_method: "fasthpocr",
225
- * validation_method: "none",
226
- * include_rationale: false
227
- * }
228
- * })
229
- */
230
- extractCodes(request, requestOptions) {
231
- return core.HttpResponsePromise.fromPromise(this.__extractCodes(request, requestOptions));
232
- }
233
- __extractCodes(request, requestOptions) {
234
- return __awaiter(this, void 0, void 0, function* () {
235
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
236
- const _authRequest = yield this._options.authProvider.getAuthRequest();
237
- const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
238
- const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
239
- url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.phenomlEnvironment.Default, "construe/extract"),
240
- method: "POST",
241
- headers: _headers,
242
- contentType: "application/json",
243
- queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
244
- requestType: "json",
245
- body: request,
246
- timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
247
- maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
248
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
249
- fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
250
- logging: this._options.logging,
251
- });
252
- if (_response.ok) {
253
- return { data: _response.body, rawResponse: _response.rawResponse };
254
- }
255
- if (_response.error.reason === "status-code") {
256
- switch (_response.error.statusCode) {
257
- case 400:
258
- throw new phenoml.construe.BadRequestError(_response.error.body, _response.rawResponse);
259
- case 401:
260
- throw new phenoml.construe.UnauthorizedError(_response.error.body, _response.rawResponse);
261
- case 404:
262
- throw new phenoml.construe.NotFoundError(_response.error.body, _response.rawResponse);
263
- case 500:
264
- throw new phenoml.construe.InternalServerError(_response.error.body, _response.rawResponse);
265
- case 503:
266
- throw new phenoml.construe.ServiceUnavailableError(_response.error.body, _response.rawResponse);
267
- case 504:
268
- throw new phenoml.construe.GatewayTimeoutError(_response.error.body, _response.rawResponse);
269
- default:
270
- throw new errors.phenomlError({
271
- statusCode: _response.error.statusCode,
272
- body: _response.error.body,
273
- rawResponse: _response.rawResponse,
274
- });
275
- }
276
- }
277
- return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/construe/extract");
278
- });
279
- }
280
- /**
281
- * Returns the terminology server's catalog of available code systems, including both built-in standard terminologies and custom uploaded systems.
282
- *
283
- * @param {ConstrueClient.RequestOptions} requestOptions - Request-specific configuration.
284
- *
285
- * @throws {@link phenoml.construe.UnauthorizedError}
286
- * @throws {@link phenoml.construe.InternalServerError}
287
- *
288
- * @example
289
- * await client.construe.listCodeSystems()
290
- */
291
- listCodeSystems(requestOptions) {
292
- return core.HttpResponsePromise.fromPromise(this.__listCodeSystems(requestOptions));
293
- }
294
- __listCodeSystems(requestOptions) {
295
- return __awaiter(this, void 0, void 0, function* () {
296
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
297
- const _authRequest = yield this._options.authProvider.getAuthRequest();
298
- const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
299
- const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
300
- url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.phenomlEnvironment.Default, "construe/codes/systems"),
301
- method: "GET",
302
- headers: _headers,
303
- queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
304
- timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
305
- maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
306
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
307
- fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
308
- logging: this._options.logging,
309
- });
310
- if (_response.ok) {
311
- return {
312
- data: _response.body,
313
- rawResponse: _response.rawResponse,
314
- };
315
- }
316
- if (_response.error.reason === "status-code") {
317
- switch (_response.error.statusCode) {
318
- case 401:
319
- throw new phenoml.construe.UnauthorizedError(_response.error.body, _response.rawResponse);
320
- case 500:
321
- throw new phenoml.construe.InternalServerError(_response.error.body, _response.rawResponse);
322
- default:
323
- throw new errors.phenomlError({
324
- statusCode: _response.error.statusCode,
325
- body: _response.error.body,
326
- rawResponse: _response.rawResponse,
327
- });
328
- }
329
- }
330
- return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/construe/codes/systems");
331
- });
332
- }
333
- /**
334
- * Returns full metadata for a single code system, including timestamps and builtin status.
335
- *
336
- * @param {string} codesystem - Code system name (e.g., "ICD-10-CM", "SNOMED_CT_US_LITE")
337
- * @param {phenoml.construe.GetCodeSystemRequest} request
338
- * @param {ConstrueClient.RequestOptions} requestOptions - Request-specific configuration.
339
- *
340
- * @throws {@link phenoml.construe.BadRequestError}
341
- * @throws {@link phenoml.construe.UnauthorizedError}
342
- * @throws {@link phenoml.construe.NotFoundError}
343
- * @throws {@link phenoml.construe.InternalServerError}
344
- *
345
- * @example
346
- * await client.construe.getCodeSystem("ICD-10-CM", {
347
- * version: "2025"
348
- * })
349
- */
350
- getCodeSystem(codesystem, request = {}, requestOptions) {
351
- return core.HttpResponsePromise.fromPromise(this.__getCodeSystem(codesystem, request, requestOptions));
352
- }
353
- __getCodeSystem(codesystem_1) {
354
- return __awaiter(this, arguments, void 0, function* (codesystem, request = {}, requestOptions) {
355
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
356
- const { version } = request;
357
- const _queryParams = {
358
- version,
359
- };
360
- const _authRequest = yield this._options.authProvider.getAuthRequest();
361
- const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
362
- const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
363
- url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.phenomlEnvironment.Default, `construe/codes/systems/${core.url.encodePathParam(codesystem)}`),
364
- method: "GET",
365
- headers: _headers,
366
- queryString: core.url
367
- .queryBuilder()
368
- .addMany(_queryParams)
369
- .mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
370
- .build(),
371
- timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
372
- maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
373
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
374
- fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
375
- logging: this._options.logging,
376
- });
377
- if (_response.ok) {
378
- return {
379
- data: _response.body,
380
- rawResponse: _response.rawResponse,
381
- };
382
- }
383
- if (_response.error.reason === "status-code") {
384
- switch (_response.error.statusCode) {
385
- case 400:
386
- throw new phenoml.construe.BadRequestError(_response.error.body, _response.rawResponse);
387
- case 401:
388
- throw new phenoml.construe.UnauthorizedError(_response.error.body, _response.rawResponse);
389
- case 404:
390
- throw new phenoml.construe.NotFoundError(_response.error.body, _response.rawResponse);
391
- case 500:
392
- throw new phenoml.construe.InternalServerError(_response.error.body, _response.rawResponse);
393
- default:
394
- throw new errors.phenomlError({
395
- statusCode: _response.error.statusCode,
396
- body: _response.error.body,
397
- rawResponse: _response.rawResponse,
398
- });
399
- }
400
- }
401
- return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/construe/codes/systems/{codesystem}");
402
- });
403
- }
404
- /**
405
- * Deletes a custom (non-builtin) code system and all its codes. Builtin systems cannot be deleted.
406
- * Only available on dedicated instances. Large systems may take up to a minute to delete.
407
- *
408
- * @param {string} codesystem - Code system name
409
- * @param {phenoml.construe.DeleteCodeSystemRequest} request
410
- * @param {ConstrueClient.RequestOptions} requestOptions - Request-specific configuration.
411
- *
412
- * @throws {@link phenoml.construe.BadRequestError}
413
- * @throws {@link phenoml.construe.UnauthorizedError}
414
- * @throws {@link phenoml.construe.ForbiddenError}
415
- * @throws {@link phenoml.construe.NotFoundError}
416
- * @throws {@link phenoml.construe.InternalServerError}
417
- *
418
- * @example
419
- * await client.construe.deleteCodeSystem("CUSTOM_CODES", {
420
- * version: "version"
421
- * })
422
- */
423
- deleteCodeSystem(codesystem, request = {}, requestOptions) {
424
- return core.HttpResponsePromise.fromPromise(this.__deleteCodeSystem(codesystem, request, requestOptions));
425
- }
426
- __deleteCodeSystem(codesystem_1) {
427
- return __awaiter(this, arguments, void 0, function* (codesystem, request = {}, requestOptions) {
428
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
429
- const { version } = request;
430
- const _queryParams = {
431
- version,
432
- };
433
- const _authRequest = yield this._options.authProvider.getAuthRequest();
434
- const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
435
- const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
436
- url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.phenomlEnvironment.Default, `construe/codes/systems/${core.url.encodePathParam(codesystem)}`),
437
- method: "DELETE",
438
- headers: _headers,
439
- queryString: core.url
440
- .queryBuilder()
441
- .addMany(_queryParams)
442
- .mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
443
- .build(),
444
- timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
445
- maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
446
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
447
- fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
448
- logging: this._options.logging,
449
- });
450
- if (_response.ok) {
451
- return {
452
- data: _response.body,
453
- rawResponse: _response.rawResponse,
454
- };
455
- }
456
- if (_response.error.reason === "status-code") {
457
- switch (_response.error.statusCode) {
458
- case 400:
459
- throw new phenoml.construe.BadRequestError(_response.error.body, _response.rawResponse);
460
- case 401:
461
- throw new phenoml.construe.UnauthorizedError(_response.error.body, _response.rawResponse);
462
- case 403:
463
- throw new phenoml.construe.ForbiddenError(_response.error.body, _response.rawResponse);
464
- case 404:
465
- throw new phenoml.construe.NotFoundError(_response.error.body, _response.rawResponse);
466
- case 500:
467
- throw new phenoml.construe.InternalServerError(_response.error.body, _response.rawResponse);
468
- default:
469
- throw new errors.phenomlError({
470
- statusCode: _response.error.statusCode,
471
- body: _response.error.body,
472
- rawResponse: _response.rawResponse,
473
- });
474
- }
475
- }
476
- return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/construe/codes/systems/{codesystem}");
477
- });
60
+ get codeSystems() {
61
+ var _a;
62
+ return ((_a = this._codeSystems) !== null && _a !== void 0 ? _a : (this._codeSystems = new Client_js_1.CodeSystemsClient(this._options)));
478
63
  }
479
- /**
480
- * Exports a custom (non-builtin) code system as a JSON file compatible with the upload format.
481
- * The exported file can be re-uploaded directly via POST /construe/upload with format "json".
482
- * Only available on dedicated instances. Builtin systems cannot be exported.
483
- *
484
- * @param {string} codesystem - Code system name
485
- * @param {phenoml.construe.ExportCodeSystemRequest} request
486
- * @param {ConstrueClient.RequestOptions} requestOptions - Request-specific configuration.
487
- *
488
- * @throws {@link phenoml.construe.BadRequestError}
489
- * @throws {@link phenoml.construe.UnauthorizedError}
490
- * @throws {@link phenoml.construe.ForbiddenError}
491
- * @throws {@link phenoml.construe.NotFoundError}
492
- * @throws {@link phenoml.construe.ConflictError}
493
- * @throws {@link phenoml.construe.FailedDependencyError}
494
- * @throws {@link phenoml.construe.InternalServerError}
495
- *
496
- * @example
497
- * await client.construe.exportCodeSystem("CUSTOM_CODES", {
498
- * version: "version"
499
- * })
500
- */
501
- exportCodeSystem(codesystem, request = {}, requestOptions) {
502
- return core.HttpResponsePromise.fromPromise(this.__exportCodeSystem(codesystem, request, requestOptions));
503
- }
504
- __exportCodeSystem(codesystem_1) {
505
- return __awaiter(this, arguments, void 0, function* (codesystem, request = {}, requestOptions) {
506
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
507
- const { version } = request;
508
- const _queryParams = {
509
- version,
510
- };
511
- const _authRequest = yield this._options.authProvider.getAuthRequest();
512
- const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
513
- const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
514
- url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.phenomlEnvironment.Default, `construe/codes/systems/${core.url.encodePathParam(codesystem)}/export`),
515
- method: "GET",
516
- headers: _headers,
517
- queryString: core.url
518
- .queryBuilder()
519
- .addMany(_queryParams)
520
- .mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
521
- .build(),
522
- timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
523
- maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
524
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
525
- fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
526
- logging: this._options.logging,
527
- });
528
- if (_response.ok) {
529
- return {
530
- data: _response.body,
531
- rawResponse: _response.rawResponse,
532
- };
533
- }
534
- if (_response.error.reason === "status-code") {
535
- switch (_response.error.statusCode) {
536
- case 400:
537
- throw new phenoml.construe.BadRequestError(_response.error.body, _response.rawResponse);
538
- case 401:
539
- throw new phenoml.construe.UnauthorizedError(_response.error.body, _response.rawResponse);
540
- case 403:
541
- throw new phenoml.construe.ForbiddenError(_response.error.body, _response.rawResponse);
542
- case 404:
543
- throw new phenoml.construe.NotFoundError(_response.error.body, _response.rawResponse);
544
- case 409:
545
- throw new phenoml.construe.ConflictError(_response.error.body, _response.rawResponse);
546
- case 424:
547
- throw new phenoml.construe.FailedDependencyError(_response.error.body, _response.rawResponse);
548
- case 500:
549
- throw new phenoml.construe.InternalServerError(_response.error.body, _response.rawResponse);
550
- default:
551
- throw new errors.phenomlError({
552
- statusCode: _response.error.statusCode,
553
- body: _response.error.body,
554
- rawResponse: _response.rawResponse,
555
- });
556
- }
557
- }
558
- return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/construe/codes/systems/{codesystem}/export");
559
- });
560
- }
561
- /**
562
- * Returns a paginated list of all codes in the specified code system from the terminology server.
563
- *
564
- * Usage of CPT is subject to AMA requirements: see PhenoML Terms of Service.
565
- *
566
- * @param {string} codesystem - Code system name (e.g., "ICD-10-CM", "SNOMED_CT_US_LITE")
567
- * @param {phenoml.construe.ListCodesRequest} request
568
- * @param {ConstrueClient.RequestOptions} requestOptions - Request-specific configuration.
569
- *
570
- * @throws {@link phenoml.construe.BadRequestError}
571
- * @throws {@link phenoml.construe.UnauthorizedError}
572
- * @throws {@link phenoml.construe.NotFoundError}
573
- * @throws {@link phenoml.construe.InternalServerError}
574
- *
575
- * @example
576
- * await client.construe.listCodes("ICD-10-CM", {
577
- * version: "2025",
578
- * cursor: "cursor",
579
- * limit: 1
580
- * })
581
- */
582
- listCodes(codesystem, request = {}, requestOptions) {
583
- return core.HttpResponsePromise.fromPromise(this.__listCodes(codesystem, request, requestOptions));
584
- }
585
- __listCodes(codesystem_1) {
586
- return __awaiter(this, arguments, void 0, function* (codesystem, request = {}, requestOptions) {
587
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
588
- const { version, cursor, limit } = request;
589
- const _queryParams = {
590
- version,
591
- cursor,
592
- limit,
593
- };
594
- const _authRequest = yield this._options.authProvider.getAuthRequest();
595
- const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
596
- const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
597
- url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.phenomlEnvironment.Default, `construe/codes/${core.url.encodePathParam(codesystem)}`),
598
- method: "GET",
599
- headers: _headers,
600
- queryString: core.url
601
- .queryBuilder()
602
- .addMany(_queryParams)
603
- .mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
604
- .build(),
605
- timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
606
- maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
607
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
608
- fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
609
- logging: this._options.logging,
610
- });
611
- if (_response.ok) {
612
- return { data: _response.body, rawResponse: _response.rawResponse };
613
- }
614
- if (_response.error.reason === "status-code") {
615
- switch (_response.error.statusCode) {
616
- case 400:
617
- throw new phenoml.construe.BadRequestError(_response.error.body, _response.rawResponse);
618
- case 401:
619
- throw new phenoml.construe.UnauthorizedError(_response.error.body, _response.rawResponse);
620
- case 404:
621
- throw new phenoml.construe.NotFoundError(_response.error.body, _response.rawResponse);
622
- case 500:
623
- throw new phenoml.construe.InternalServerError(_response.error.body, _response.rawResponse);
624
- default:
625
- throw new errors.phenomlError({
626
- statusCode: _response.error.statusCode,
627
- body: _response.error.body,
628
- rawResponse: _response.rawResponse,
629
- });
630
- }
631
- }
632
- return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/construe/codes/{codesystem}");
633
- });
634
- }
635
- /**
636
- * Looks up a specific code in the terminology server and returns its details.
637
- *
638
- * Usage of CPT is subject to AMA requirements: see PhenoML Terms of Service.
639
- *
640
- * @param {string} codesystem - Code system name
641
- * @param {string} codeID - The code identifier. ICD-10-CM codes are stored without their
642
- * cosmetic dot (use "E1165", not "E11.65").
643
- * @param {phenoml.construe.GetCodeRequest} request
644
- * @param {ConstrueClient.RequestOptions} requestOptions - Request-specific configuration.
645
- *
646
- * @throws {@link phenoml.construe.BadRequestError}
647
- * @throws {@link phenoml.construe.UnauthorizedError}
648
- * @throws {@link phenoml.construe.NotFoundError}
649
- * @throws {@link phenoml.construe.InternalServerError}
650
- *
651
- * @example
652
- * await client.construe.getCode("ICD-10-CM", "E1165", {
653
- * version: "version"
654
- * })
655
- */
656
- getCode(codesystem, codeID, request = {}, requestOptions) {
657
- return core.HttpResponsePromise.fromPromise(this.__getCode(codesystem, codeID, request, requestOptions));
658
- }
659
- __getCode(codesystem_1, codeID_1) {
660
- return __awaiter(this, arguments, void 0, function* (codesystem, codeID, request = {}, requestOptions) {
661
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
662
- const { version } = request;
663
- const _queryParams = {
664
- version,
665
- };
666
- const _authRequest = yield this._options.authProvider.getAuthRequest();
667
- const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
668
- const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
669
- url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.phenomlEnvironment.Default, `construe/codes/${core.url.encodePathParam(codesystem)}/${core.url.encodePathParam(codeID)}`),
670
- method: "GET",
671
- headers: _headers,
672
- queryString: core.url
673
- .queryBuilder()
674
- .addMany(_queryParams)
675
- .mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
676
- .build(),
677
- timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
678
- maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
679
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
680
- fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
681
- logging: this._options.logging,
682
- });
683
- if (_response.ok) {
684
- return { data: _response.body, rawResponse: _response.rawResponse };
685
- }
686
- if (_response.error.reason === "status-code") {
687
- switch (_response.error.statusCode) {
688
- case 400:
689
- throw new phenoml.construe.BadRequestError(_response.error.body, _response.rawResponse);
690
- case 401:
691
- throw new phenoml.construe.UnauthorizedError(_response.error.body, _response.rawResponse);
692
- case 404:
693
- throw new phenoml.construe.NotFoundError(_response.error.body, _response.rawResponse);
694
- case 500:
695
- throw new phenoml.construe.InternalServerError(_response.error.body, _response.rawResponse);
696
- default:
697
- throw new errors.phenomlError({
698
- statusCode: _response.error.statusCode,
699
- body: _response.error.body,
700
- rawResponse: _response.rawResponse,
701
- });
702
- }
703
- }
704
- return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/construe/codes/{codesystem}/{codeID}");
705
- });
706
- }
707
- /**
708
- * Performs semantic similarity search using vector embeddings.
709
- *
710
- * **Availability**: This endpoint works for both **built-in and custom** code systems.
711
- *
712
- * **When to use**: Best for natural language queries where you want to find conceptually
713
- * related codes, even when different terminology is used. The search understands meaning,
714
- * not just keywords.
715
- *
716
- * **Examples**:
717
- * - Query "trouble breathing at night" finds codes like "Sleep apnea", "Orthopnea",
718
- * "Nocturnal dyspnea" — semantically related but no exact keyword matches
719
- * - Query "heart problems" finds "Myocardial infarction", "Cardiac arrest", "Arrhythmia"
720
- *
721
- * **Trade-offs**: Slower than text search (requires embedding generation), but finds
722
- * conceptually similar results that keyword search would miss.
723
- *
724
- * See also: `/search/text` for faster keyword-based lookup with typo tolerance.
725
- *
726
- * Usage of CPT is subject to AMA requirements: see PhenoML Terms of Service.
727
- *
728
- * @param {string} codesystem - Code system name
729
- * @param {phenoml.construe.SearchSemanticRequest} request
730
- * @param {ConstrueClient.RequestOptions} requestOptions - Request-specific configuration.
731
- *
732
- * @throws {@link phenoml.construe.BadRequestError}
733
- * @throws {@link phenoml.construe.UnauthorizedError}
734
- * @throws {@link phenoml.construe.NotFoundError}
735
- * @throws {@link phenoml.construe.InternalServerError}
736
- *
737
- * @example
738
- * await client.construe.searchSemantic("ICD-10-CM", {
739
- * text: "patient has trouble breathing at night and wakes up gasping",
740
- * version: "version",
741
- * limit: 1
742
- * })
743
- */
744
- searchSemantic(codesystem, request, requestOptions) {
745
- return core.HttpResponsePromise.fromPromise(this.__searchSemantic(codesystem, request, requestOptions));
746
- }
747
- __searchSemantic(codesystem, request, requestOptions) {
748
- return __awaiter(this, void 0, void 0, function* () {
749
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
750
- const { text, version, limit } = request;
751
- const _queryParams = {
752
- text,
753
- version,
754
- limit,
755
- };
756
- const _authRequest = yield this._options.authProvider.getAuthRequest();
757
- const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
758
- const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
759
- url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.phenomlEnvironment.Default, `construe/codes/${core.url.encodePathParam(codesystem)}/search/semantic`),
760
- method: "GET",
761
- headers: _headers,
762
- queryString: core.url
763
- .queryBuilder()
764
- .addMany(_queryParams)
765
- .mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
766
- .build(),
767
- timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
768
- maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
769
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
770
- fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
771
- logging: this._options.logging,
772
- });
773
- if (_response.ok) {
774
- return {
775
- data: _response.body,
776
- rawResponse: _response.rawResponse,
777
- };
778
- }
779
- if (_response.error.reason === "status-code") {
780
- switch (_response.error.statusCode) {
781
- case 400:
782
- throw new phenoml.construe.BadRequestError(_response.error.body, _response.rawResponse);
783
- case 401:
784
- throw new phenoml.construe.UnauthorizedError(_response.error.body, _response.rawResponse);
785
- case 404:
786
- throw new phenoml.construe.NotFoundError(_response.error.body, _response.rawResponse);
787
- case 500:
788
- throw new phenoml.construe.InternalServerError(_response.error.body, _response.rawResponse);
789
- default:
790
- throw new errors.phenomlError({
791
- statusCode: _response.error.statusCode,
792
- body: _response.error.body,
793
- rawResponse: _response.rawResponse,
794
- });
795
- }
796
- }
797
- return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/construe/codes/{codesystem}/search/semantic");
798
- });
64
+ get codes() {
65
+ var _a;
66
+ return ((_a = this._codes) !== null && _a !== void 0 ? _a : (this._codes = new Client_js_2.CodesClient(this._options)));
799
67
  }
800
68
  /**
801
69
  * Submits user feedback on results from the Construe extraction endpoint.
@@ -883,103 +151,5 @@ class ConstrueClient {
883
151
  return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/construe/feedback");
884
152
  });
885
153
  }
886
- /**
887
- * Performs fast full-text search over code IDs and descriptions.
888
- *
889
- * **Availability**: This endpoint is only available for **built-in code systems**.
890
- * Custom code systems uploaded via `/construe/upload` are not indexed for full-text search
891
- * and will return empty results. Use `/search/semantic` to search custom code systems.
892
- *
893
- * **When to use**: Best for autocomplete UIs, code lookup, or when users know part of
894
- * the code ID or specific keywords. Fast response times suitable for typeahead interfaces.
895
- *
896
- * **Features**:
897
- * - Substring matching on code IDs (e.g., "11.65" finds "E11.65")
898
- * - Typo tolerance on descriptions (not on code IDs)
899
- * - Fast response times (~10-50ms)
900
- *
901
- * **Examples**:
902
- * - Query "E11" finds all codes starting with E11 (diabetes codes)
903
- * - Query "diabtes" (typo) still finds "diabetes" codes
904
- *
905
- * **Trade-offs**: Faster than semantic search, but only matches keywords/substrings.
906
- * Won't find conceptually related codes with different terminology.
907
- *
908
- * See also: `/search/semantic` for finding conceptually similar codes.
909
- *
910
- * Usage of CPT is subject to AMA requirements: see PhenoML Terms of Service.
911
- *
912
- * @param {string} codesystem - Code system name
913
- * @param {phenoml.construe.SearchTextRequest} request
914
- * @param {ConstrueClient.RequestOptions} requestOptions - Request-specific configuration.
915
- *
916
- * @throws {@link phenoml.construe.BadRequestError}
917
- * @throws {@link phenoml.construe.UnauthorizedError}
918
- * @throws {@link phenoml.construe.NotFoundError}
919
- * @throws {@link phenoml.construe.InternalServerError}
920
- * @throws {@link phenoml.construe.NotImplementedError}
921
- *
922
- * @example
923
- * await client.construe.searchText("ICD-10-CM", {
924
- * q: "E11.65",
925
- * version: "version",
926
- * limit: 1
927
- * })
928
- */
929
- searchText(codesystem, request, requestOptions) {
930
- return core.HttpResponsePromise.fromPromise(this.__searchText(codesystem, request, requestOptions));
931
- }
932
- __searchText(codesystem, request, requestOptions) {
933
- return __awaiter(this, void 0, void 0, function* () {
934
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
935
- const { q, version, limit } = request;
936
- const _queryParams = {
937
- q,
938
- version,
939
- limit,
940
- };
941
- const _authRequest = yield this._options.authProvider.getAuthRequest();
942
- const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
943
- const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
944
- url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.phenomlEnvironment.Default, `construe/codes/${core.url.encodePathParam(codesystem)}/search/text`),
945
- method: "GET",
946
- headers: _headers,
947
- queryString: core.url
948
- .queryBuilder()
949
- .addMany(_queryParams)
950
- .mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
951
- .build(),
952
- timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
953
- maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
954
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
955
- fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
956
- logging: this._options.logging,
957
- });
958
- if (_response.ok) {
959
- return { data: _response.body, rawResponse: _response.rawResponse };
960
- }
961
- if (_response.error.reason === "status-code") {
962
- switch (_response.error.statusCode) {
963
- case 400:
964
- throw new phenoml.construe.BadRequestError(_response.error.body, _response.rawResponse);
965
- case 401:
966
- throw new phenoml.construe.UnauthorizedError(_response.error.body, _response.rawResponse);
967
- case 404:
968
- throw new phenoml.construe.NotFoundError(_response.error.body, _response.rawResponse);
969
- case 500:
970
- throw new phenoml.construe.InternalServerError(_response.error.body, _response.rawResponse);
971
- case 501:
972
- throw new phenoml.construe.NotImplementedError(_response.error.body, _response.rawResponse);
973
- default:
974
- throw new errors.phenomlError({
975
- statusCode: _response.error.statusCode,
976
- body: _response.error.body,
977
- rawResponse: _response.rawResponse,
978
- });
979
- }
980
- }
981
- return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/construe/codes/{codesystem}/search/text");
982
- });
983
- }
984
154
  }
985
155
  exports.ConstrueClient = ConstrueClient;