@ovok/core 0.4.49-dev.503 → 0.4.49-dev.513

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 (394) hide show
  1. package/README.md +23 -666
  2. package/dist/client/ai-fhir/methods/AIFhirResources.d.ts +3 -1
  3. package/dist/client/ai-fhir/methods/AIFhirResources.js +3 -1
  4. package/dist/client/ai-fhir/types/AIFhirPlan.d.ts +8 -0
  5. package/dist/client/ai-fhir/types/AIFhirPlanRequest.d.ts +8 -0
  6. package/dist/client/ai-fhir/types/AIFhirRequest.d.ts +5 -0
  7. package/dist/client/ai-fhir/types/AIFhirResponse.d.ts +6 -0
  8. package/dist/client/auth/errors.d.ts +15 -2
  9. package/dist/client/auth/errors.js +12 -2
  10. package/dist/client/auth/methods/appleLogin.d.ts +1 -0
  11. package/dist/client/auth/methods/appleLogin.js +1 -0
  12. package/dist/client/auth/methods/changePassword.d.ts +1 -0
  13. package/dist/client/auth/methods/changePassword.js +1 -0
  14. package/dist/client/auth/methods/googleLogin.d.ts +1 -0
  15. package/dist/client/auth/methods/googleLogin.js +1 -0
  16. package/dist/client/auth/methods/login.d.ts +6 -0
  17. package/dist/client/auth/methods/login.js +6 -0
  18. package/dist/client/auth/methods/register.d.ts +5 -0
  19. package/dist/client/auth/methods/register.js +5 -0
  20. package/dist/client/auth/methods/registerPractitioner.d.ts +5 -0
  21. package/dist/client/auth/methods/registerPractitioner.js +5 -0
  22. package/dist/client/auth/methods/reloadSession.d.ts +3 -0
  23. package/dist/client/auth/methods/requestDeleteUser.d.ts +4 -5
  24. package/dist/client/auth/methods/requestDeleteUser.js +4 -5
  25. package/dist/client/auth/methods/setPasswordFromReset.d.ts +1 -0
  26. package/dist/client/auth/methods/setPasswordFromReset.js +1 -0
  27. package/dist/client/auth/session-fetch.d.ts +11 -0
  28. package/dist/client/auth/types/Account.d.ts +8 -1
  29. package/dist/client/auth/types/AppleLoginBody.d.ts +16 -0
  30. package/dist/client/auth/types/AppleLoginBody.js +5 -0
  31. package/dist/client/auth/types/AuthResponse.d.ts +12 -0
  32. package/dist/client/auth/types/ChangePasswordBody.d.ts +7 -0
  33. package/dist/client/auth/types/ChangePasswordResponse.d.ts +5 -0
  34. package/dist/client/auth/types/CompletePasswordResetBody.d.ts +8 -0
  35. package/dist/client/auth/types/GoogleLoginBody.d.ts +5 -0
  36. package/dist/client/auth/types/LoginBody.d.ts +15 -1
  37. package/dist/client/auth/types/LoginError.d.ts +21 -2
  38. package/dist/client/auth/types/LoginError.js +8 -2
  39. package/dist/client/auth/types/LoginResponse.d.ts +8 -1
  40. package/dist/client/auth/types/RegisterBody.d.ts +12 -0
  41. package/dist/client/auth/types/RegisterPractitionerBody.d.ts +5 -0
  42. package/dist/client/auth/types/RegisterResponse.d.ts +7 -0
  43. package/dist/client/auth/types/RequestDeleteUserBody.d.ts +7 -7
  44. package/dist/client/auth/types/RequestDeleteUserResponse.d.ts +14 -0
  45. package/dist/client/auth/types/ResetPasswordBody.d.ts +5 -0
  46. package/dist/client/auth/types/Session.d.ts +14 -2
  47. package/dist/client/change-history/methods.d.ts +6 -0
  48. package/dist/client/change-history/methods.js +6 -0
  49. package/dist/client/change-history/types.d.ts +82 -0
  50. package/dist/client/chat/ai/methods/createAiSession.d.ts +6 -0
  51. package/dist/client/chat/ai/methods/createAiSession.js +6 -0
  52. package/dist/client/chat/ai/types/CreateAiSessionResponse.d.ts +17 -0
  53. package/dist/client/chat/ai/types/SessionMessagesResponse.d.ts +9 -0
  54. package/dist/client/cms/locale.d.ts +12 -2
  55. package/dist/client/cms/locale.js +9 -2
  56. package/dist/client/cms/methods.d.ts +6 -2
  57. package/dist/client/cms/methods.js +7 -3
  58. package/dist/client/cms/types.d.ts +44 -4
  59. package/dist/client/consent/methods.d.ts +16 -0
  60. package/dist/client/consent/methods.js +16 -0
  61. package/dist/client/consent/types.d.ts +53 -1
  62. package/dist/client/consent/types.js +10 -1
  63. package/dist/client/email/methods.d.ts +3 -0
  64. package/dist/client/email/methods.js +3 -0
  65. package/dist/client/email/types.d.ts +33 -0
  66. package/dist/client/errors/field-errors.d.ts +3 -0
  67. package/dist/client/errors/field-errors.js +3 -0
  68. package/dist/client/errors/ovok-error-utils.d.ts +6 -0
  69. package/dist/client/errors/ovok-error-utils.js +6 -0
  70. package/dist/client/errors/ovok-error.d.ts +36 -4
  71. package/dist/client/errors/ovok-error.js +15 -4
  72. package/dist/client/errors/rate-limit-error.d.ts +11 -2
  73. package/dist/client/errors/rate-limit-error.js +10 -2
  74. package/dist/client/errors/sign-in-required-error.d.ts +5 -2
  75. package/dist/client/errors/sign-in-required-error.js +5 -2
  76. package/dist/client/experience/methods.d.ts +38 -0
  77. package/dist/client/experience/methods.js +35 -0
  78. package/dist/client/experience/types.d.ts +316 -0
  79. package/dist/client/experience/types.js +1 -0
  80. package/dist/client/invites/methods.d.ts +27 -9
  81. package/dist/client/invites/methods.js +27 -9
  82. package/dist/client/invites/parse-accept-invite-link.d.ts +3 -1
  83. package/dist/client/invites/parse-accept-invite-link.js +3 -1
  84. package/dist/client/invites/types.d.ts +55 -0
  85. package/dist/client/invites/types.js +12 -0
  86. package/dist/client/notifications/methods.d.ts +15 -0
  87. package/dist/client/notifications/methods.js +15 -0
  88. package/dist/client/notifications/types.d.ts +249 -2
  89. package/dist/client/observation/methods/generateObservationBodiesByMeasurement.d.ts +3 -0
  90. package/dist/client/observation/methods/generateObservationBodiesByMeasurement.js +3 -0
  91. package/dist/client/observation/methods/getLatestObservationsByCodes.d.ts +3 -0
  92. package/dist/client/observation/methods/getLatestObservationsByCodes.js +3 -0
  93. package/dist/client/observation/methods/observationsToMeasurements.d.ts +23 -1
  94. package/dist/client/observation/methods/observationsToMeasurements.js +8 -1
  95. package/dist/client/observation/methods/saveMeasurement.d.ts +3 -1
  96. package/dist/client/observation/methods/saveMeasurement.js +3 -1
  97. package/dist/client/observation/observation-bundle-utils.d.ts +6 -0
  98. package/dist/client/observation/observation-bundle-utils.js +6 -0
  99. package/dist/client/observation/series.d.ts +25 -3
  100. package/dist/client/observation/series.js +6 -2
  101. package/dist/client/observation/services/creator.d.ts +5 -0
  102. package/dist/client/observation/services/creator.js +5 -0
  103. package/dist/client/observation/services/uric-acid-service.js +0 -1
  104. package/dist/client/observation/types/GetLatestObservationsByCodeParams.d.ts +10 -0
  105. package/dist/client/observation/types/MeasurementTypeKey.d.ts +26 -0
  106. package/dist/client/observation/types/MeasurementTypeKey.js +26 -0
  107. package/dist/client/observation/types/ObservationCode.d.ts +64 -1
  108. package/dist/client/observation/types/ObservationCode.js +64 -1
  109. package/dist/client/observation/types/UrineAnalytes.d.ts +14 -0
  110. package/dist/client/observation/types/UrineAnalytes.js +1 -0
  111. package/dist/client/observation/types/generate-measurement/Sample.d.ts +33 -0
  112. package/dist/client/observation/types/generate-observation-body/GenerateObservationBodyParams.d.ts +9 -0
  113. package/dist/client/observation/types/measurement/BabySleepMeasurement.d.ts +3 -0
  114. package/dist/client/observation/types/measurement/BloodGlucoseMeasurement.d.ts +7 -0
  115. package/dist/client/observation/types/measurement/BloodPressureMeasurement.d.ts +10 -0
  116. package/dist/client/observation/types/measurement/BloodPressureStates.d.ts +10 -0
  117. package/dist/client/observation/types/measurement/BloodPressureStates.js +10 -0
  118. package/dist/client/observation/types/measurement/BodyTemperatureMeasurement.d.ts +7 -0
  119. package/dist/client/observation/types/measurement/BodyWeightMeasurmement.d.ts +8 -0
  120. package/dist/client/observation/types/measurement/EcgDiagnosticFlag.d.ts +18 -0
  121. package/dist/client/observation/types/measurement/EcgDiagnosticFlag.js +18 -0
  122. package/dist/client/observation/types/measurement/EcgMeasurement.d.ts +9 -0
  123. package/dist/client/observation/types/measurement/HeartRateMeasurement.d.ts +7 -0
  124. package/dist/client/observation/types/measurement/HeartRateVariabilityMeasurement.d.ts +7 -0
  125. package/dist/client/observation/types/measurement/LipidPanelMeasurement.d.ts +12 -0
  126. package/dist/client/observation/types/measurement/Measurement.d.ts +9 -0
  127. package/dist/client/observation/types/measurement/MeasurementDevice.d.ts +10 -0
  128. package/dist/client/observation/types/measurement/MeasurementSeries.d.ts +2 -0
  129. package/dist/client/observation/types/measurement/PulseOximeterMeasurement.d.ts +10 -0
  130. package/dist/client/observation/types/measurement/RespiratoryRateMeasurement.d.ts +7 -0
  131. package/dist/client/observation/types/measurement/RespiratoryTherapyMeasurement.d.ts +3 -0
  132. package/dist/client/observation/types/measurement/RestingHeartRateMeasurement.d.ts +7 -0
  133. package/dist/client/observation/types/measurement/SpirometryMeasurement.d.ts +23 -0
  134. package/dist/client/observation/types/measurement/StepCountMeasurement.d.ts +9 -0
  135. package/dist/client/observation/types/measurement/UrineAnalyzeMeasurement.d.ts +29 -0
  136. package/dist/client/observation/types/measurement/Vo2MaxMeasurement.d.ts +7 -0
  137. package/dist/client/observation/types/measurement/WalkingHeartRateAverageMeasurement.d.ts +7 -0
  138. package/dist/client/observation/types/service/MeasurementField.d.ts +5 -1
  139. package/dist/client/observation/utils/getObservationValueDisplay.d.ts +2 -0
  140. package/dist/client/offline/offline-measurement-queue.d.ts +56 -1
  141. package/dist/client/offline/offline-measurement-queue.js +21 -0
  142. package/dist/client/offline/shared-measurement-queue.d.ts +16 -1
  143. package/dist/client/offline/shared-measurement-queue.js +3 -1
  144. package/dist/client/ovok-client.d.ts +27 -6
  145. package/dist/client/ovok-client.js +8 -5
  146. package/dist/client/patient/methods.d.ts +21 -0
  147. package/dist/client/patient/methods.js +21 -0
  148. package/dist/client/patient/types.d.ts +131 -0
  149. package/dist/client/patient-sharing/methods.d.ts +18 -0
  150. package/dist/client/patient-sharing/methods.js +18 -0
  151. package/dist/client/patient-sharing/types.d.ts +89 -1
  152. package/dist/client/platform/methods.d.ts +22 -0
  153. package/dist/client/platform/methods.js +20 -0
  154. package/dist/client/platform/types.d.ts +194 -1
  155. package/dist/client/platform/types.js +24 -0
  156. package/dist/client/questionnaire-response/methods/createQuestionnaireResponseWithObservations.d.ts +3 -0
  157. package/dist/client/questionnaire-response/methods/createQuestionnaireResponseWithObservations.js +3 -0
  158. package/dist/client/questionnaire-response/methods/extractQuestionnaireObservations.d.ts +3 -0
  159. package/dist/client/questionnaire-response/methods/extractQuestionnaireObservations.js +3 -0
  160. package/dist/client/questionnaire-response/methods/populateQuestionnaire.d.ts +3 -0
  161. package/dist/client/questionnaire-response/methods/populateQuestionnaire.js +3 -0
  162. package/dist/client/questionnaire-response/methods/submitQuestionnaireResponse.d.ts +3 -0
  163. package/dist/client/questionnaire-response/methods/submitQuestionnaireResponse.js +3 -0
  164. package/dist/client/questionnaire-response/types.d.ts +6 -0
  165. package/dist/client/signals/errors.d.ts +13 -2
  166. package/dist/client/signals/errors.js +9 -2
  167. package/dist/client/signals/methods.d.ts +9 -0
  168. package/dist/client/signals/methods.js +9 -0
  169. package/dist/client/signals/types.d.ts +31 -0
  170. package/dist/client/slim/methods.d.ts +268 -21
  171. package/dist/client/slim/methods.js +264 -21
  172. package/dist/client/slim/paging.d.ts +22 -2
  173. package/dist/client/slim/paging.js +6 -2
  174. package/dist/client/slim/types.d.ts +920 -1
  175. package/dist/client/storage.d.ts +15 -1
  176. package/dist/client/storage.js +7 -1
  177. package/dist/client/wearables/methods.d.ts +24 -0
  178. package/dist/client/wearables/methods.js +24 -0
  179. package/dist/client/wearables/types.d.ts +74 -0
  180. package/dist/conformance/api-requirements.d.ts +31 -5
  181. package/dist/conformance/api-requirements.js +47 -10
  182. package/dist/conformance/capability-requirements.d.ts +4 -26
  183. package/dist/conformance/capability-requirements.js +5 -27
  184. package/dist/conformance/capability.d.ts +9 -1
  185. package/dist/conformance/capability.js +3 -1
  186. package/dist/hooks/account-hooks.d.ts +35 -0
  187. package/dist/hooks/account-hooks.js +33 -0
  188. package/dist/hooks/api-hooks.d.ts +74 -4
  189. package/dist/hooks/api-hooks.js +56 -4
  190. package/dist/hooks/cms-hooks.d.ts +9 -3
  191. package/dist/hooks/cms-hooks.js +9 -3
  192. package/dist/hooks/email-hooks.d.ts +3 -0
  193. package/dist/hooks/email-hooks.js +3 -0
  194. package/dist/hooks/experience-hooks.d.ts +26 -0
  195. package/dist/hooks/experience-hooks.js +24 -0
  196. package/dist/hooks/index.d.ts +18 -0
  197. package/dist/hooks/index.js +18 -0
  198. package/dist/hooks/invites-hooks.d.ts +21 -2
  199. package/dist/hooks/invites-hooks.js +21 -2
  200. package/dist/hooks/notification-ack-hooks.d.ts +6 -2
  201. package/dist/hooks/notification-ack-hooks.js +6 -2
  202. package/dist/hooks/notification-hooks.d.ts +27 -3
  203. package/dist/hooks/notification-hooks.js +27 -3
  204. package/dist/hooks/notification-note-hooks.d.ts +41 -0
  205. package/dist/hooks/notification-note-hooks.js +33 -0
  206. package/dist/hooks/observation-hooks.d.ts +29 -0
  207. package/dist/hooks/observation-hooks.js +23 -1
  208. package/dist/hooks/patient-hooks.d.ts +53 -0
  209. package/dist/hooks/patient-hooks.js +48 -0
  210. package/dist/hooks/patient-sharing-hooks.d.ts +18 -0
  211. package/dist/hooks/patient-sharing-hooks.js +18 -0
  212. package/dist/hooks/platform-hooks.d.ts +32 -0
  213. package/dist/hooks/platform-hooks.js +23 -0
  214. package/dist/hooks/poll-hooks.d.ts +17 -1
  215. package/dist/hooks/poll-hooks.js +3 -1
  216. package/dist/hooks/signals-hooks.d.ts +3 -0
  217. package/dist/hooks/signals-hooks.js +3 -0
  218. package/dist/hooks/wearables-hooks.d.ts +23 -0
  219. package/dist/hooks/wearables-hooks.js +21 -0
  220. package/dist/index.d.ts +1 -965
  221. package/dist/index.js +1 -71
  222. package/dist/next/auth/saved-accounts-store.d.ts +10 -0
  223. package/dist/next/auth/session.d.ts +17 -0
  224. package/dist/next/auth/user-session.d.ts +5 -0
  225. package/dist/next/config/ovok-config.d.ts +45 -0
  226. package/dist/next/errors/ovok-account-error.d.ts +14 -1
  227. package/dist/next/errors/ovok-account-error.js +8 -1
  228. package/dist/next/errors/ovok-errors.d.ts +88 -0
  229. package/dist/next/errors/ovok-errors.js +67 -0
  230. package/dist/next/http/http-client.d.ts +5 -0
  231. package/dist/next/http/transmit.d.ts +7 -0
  232. package/dist/next/http/url.d.ts +10 -0
  233. package/dist/next/ovok.d.ts +31 -1
  234. package/dist/next/ovok.js +5 -1
  235. package/dist/next/paging/page.d.ts +13 -1
  236. package/dist/next/react/context.d.ts +7 -0
  237. package/dist/next/react/context.js +7 -0
  238. package/dist/next/react/index.d.ts +24 -0
  239. package/dist/next/react/index.js +18 -0
  240. package/dist/next/react/query-hooks.d.ts +69 -0
  241. package/dist/next/react/query-hooks.js +31 -0
  242. package/dist/next/resources/accounts/accounts-resource.d.ts +6 -0
  243. package/dist/next/resources/accounts/accounts-resource.js +6 -0
  244. package/dist/next/resources/ai/ai-chat-resource.d.ts +7 -0
  245. package/dist/next/resources/ai/ai-chat-resource.js +5 -0
  246. package/dist/next/resources/ai/ai-resource.d.ts +13 -0
  247. package/dist/next/resources/ai/ai-resource.js +6 -0
  248. package/dist/next/resources/ai/chat-messages-resource.d.ts +7 -0
  249. package/dist/next/resources/ai/chat-messages-resource.js +7 -0
  250. package/dist/next/resources/ai/chat-sessions-resource.d.ts +14 -0
  251. package/dist/next/resources/ai/chat-sessions-resource.js +8 -0
  252. package/dist/next/resources/auth/auth-sessions-resource.d.ts +6 -1
  253. package/dist/next/resources/auth/auth-sessions-resource.js +6 -1
  254. package/dist/next/resources/auth/registration.d.ts +18 -1
  255. package/dist/next/resources/auth/social-login.d.ts +12 -0
  256. package/dist/next/resources/auth-resource.d.ts +54 -1
  257. package/dist/next/resources/auth-resource.js +23 -0
  258. package/dist/next/resources/bots/bots-resource.d.ts +15 -0
  259. package/dist/next/resources/bots/bots-resource.js +5 -0
  260. package/dist/next/resources/cms/cms-delivery.d.ts +14 -2
  261. package/dist/next/resources/cms/cms-documents-resource.d.ts +7 -1
  262. package/dist/next/resources/cms/cms-documents-resource.js +7 -1
  263. package/dist/next/resources/cms/cms-resource.d.ts +7 -0
  264. package/dist/next/resources/cms/cms-resource.js +5 -0
  265. package/dist/next/resources/cms/release-notes-resource.d.ts +6 -0
  266. package/dist/next/resources/cms/release-notes-resource.js +6 -0
  267. package/dist/next/resources/consent/consent-resource.d.ts +22 -0
  268. package/dist/next/resources/consent/consent-resource.js +20 -0
  269. package/dist/next/resources/content/content-resource.d.ts +18 -0
  270. package/dist/next/resources/content/content-resource.js +12 -0
  271. package/dist/next/resources/documents/documents-resource.d.ts +24 -0
  272. package/dist/next/resources/documents/documents-resource.js +10 -0
  273. package/dist/next/resources/email/email-resource.d.ts +6 -0
  274. package/dist/next/resources/email/email-resource.js +5 -0
  275. package/dist/next/resources/email/email-templates-resource.d.ts +6 -0
  276. package/dist/next/resources/email/email-templates-resource.js +6 -0
  277. package/dist/next/resources/fhir-resource.d.ts +36 -0
  278. package/dist/next/resources/fhir-resource.js +21 -0
  279. package/dist/next/resources/health-resource.d.ts +16 -0
  280. package/dist/next/resources/health-resource.js +5 -0
  281. package/dist/next/resources/invites/invite-flow-resource.d.ts +7 -1
  282. package/dist/next/resources/invites/invite-flow-resource.js +7 -1
  283. package/dist/next/resources/invites/invites-resource.d.ts +15 -0
  284. package/dist/next/resources/invites/invites-resource.js +5 -0
  285. package/dist/next/resources/localization/i18next-resource.d.ts +6 -0
  286. package/dist/next/resources/localization/i18next-resource.js +6 -0
  287. package/dist/next/resources/localization/locales-resource.d.ts +7 -0
  288. package/dist/next/resources/localization/locales-resource.js +7 -0
  289. package/dist/next/resources/localization/localizations-resource.d.ts +17 -0
  290. package/dist/next/resources/localization/localizations-resource.js +9 -0
  291. package/dist/next/resources/measurements/measurements-resource.d.ts +53 -1
  292. package/dist/next/resources/measurements/measurements-resource.js +14 -0
  293. package/dist/next/resources/measurements/observation-builder.d.ts +5 -0
  294. package/dist/next/resources/measurements/offline-measurement-queue-types.d.ts +32 -0
  295. package/dist/next/resources/patient/fhir-records.d.ts +19 -1
  296. package/dist/next/resources/patient/fhir-records.js +19 -1
  297. package/dist/next/resources/patient/patient-resource.d.ts +15 -0
  298. package/dist/next/resources/patient/patient-resource.js +6 -0
  299. package/dist/next/resources/projects/project-features-resource.d.ts +7 -0
  300. package/dist/next/resources/projects/project-features-resource.js +7 -0
  301. package/dist/next/resources/projects/project-members-resource.d.ts +19 -0
  302. package/dist/next/resources/projects/project-members-resource.js +9 -0
  303. package/dist/next/resources/projects/project-settings-resource.d.ts +8 -0
  304. package/dist/next/resources/projects/project-settings-resource.js +8 -0
  305. package/dist/next/resources/projects/projects-resource.d.ts +15 -0
  306. package/dist/next/resources/projects/projects-resource.js +5 -0
  307. package/dist/next/resources/questionnaires/questionnaires-resource.d.ts +13 -0
  308. package/dist/next/resources/questionnaires/questionnaires-resource.js +13 -0
  309. package/dist/next/resources/realtime/realtime-resource.d.ts +11 -0
  310. package/dist/next/resources/realtime/realtime-resource.js +11 -0
  311. package/dist/next/resources/realtime/realtime-types.d.ts +16 -0
  312. package/dist/next/resources/session/saved-accounts-resource.d.ts +16 -0
  313. package/dist/next/resources/session/saved-accounts-resource.js +16 -0
  314. package/dist/next/resources/session/session-resource.d.ts +8 -0
  315. package/dist/next/resources/session/session-resource.js +7 -0
  316. package/dist/next/resources/sharing/sharing-invites-resource.d.ts +7 -0
  317. package/dist/next/resources/sharing/sharing-invites-resource.js +7 -0
  318. package/dist/next/resources/sharing/sharing-resource.d.ts +8 -0
  319. package/dist/next/resources/sharing/sharing-resource.js +5 -0
  320. package/dist/next/resources/sharing/sharing-settings-resource.d.ts +7 -0
  321. package/dist/next/resources/sharing/sharing-settings-resource.js +7 -0
  322. package/dist/next/resources/sharing/sharing-shares-resource.d.ts +7 -0
  323. package/dist/next/resources/sharing/sharing-shares-resource.js +7 -0
  324. package/dist/next/resources/signals/signals-gateway-resource.d.ts +15 -0
  325. package/dist/next/resources/signals/signals-gateway-resource.js +6 -0
  326. package/dist/next/resources/signals/signals-resource.d.ts +7 -0
  327. package/dist/next/resources/signals/signals-resource.js +5 -0
  328. package/dist/next/resources/signals/undeliverable-resource.d.ts +35 -0
  329. package/dist/next/resources/signals/undeliverable-resource.js +6 -0
  330. package/dist/next/resources/slim/slim-alarms-resource.d.ts +7 -0
  331. package/dist/next/resources/slim/slim-alarms-resource.js +7 -0
  332. package/dist/next/resources/slim/slim-change-history-resource.d.ts +6 -0
  333. package/dist/next/resources/slim/slim-change-history-resource.js +6 -0
  334. package/dist/next/resources/slim/slim-child-projects-resource.d.ts +21 -0
  335. package/dist/next/resources/slim/slim-child-projects-resource.js +8 -0
  336. package/dist/next/resources/slim/slim-devices-resource.d.ts +31 -0
  337. package/dist/next/resources/slim/slim-devices-resource.js +16 -0
  338. package/dist/next/resources/slim/slim-exports-resource.d.ts +6 -0
  339. package/dist/next/resources/slim/slim-exports-resource.js +6 -0
  340. package/dist/next/resources/slim/slim-locations-resource.d.ts +9 -0
  341. package/dist/next/resources/slim/slim-locations-resource.js +9 -0
  342. package/dist/next/resources/slim/slim-medical-notifications-resource.d.ts +6 -0
  343. package/dist/next/resources/slim/slim-medical-notifications-resource.js +6 -0
  344. package/dist/next/resources/slim/slim-notification-notes-resource.d.ts +10 -0
  345. package/dist/next/resources/slim/slim-notification-notes-resource.js +10 -0
  346. package/dist/next/resources/slim/slim-notifications-resource.d.ts +10 -0
  347. package/dist/next/resources/slim/slim-notifications-resource.js +6 -0
  348. package/dist/next/resources/slim/slim-organizations-resource.d.ts +9 -0
  349. package/dist/next/resources/slim/slim-organizations-resource.js +9 -0
  350. package/dist/next/resources/slim/slim-out-of-bed-resource.d.ts +12 -0
  351. package/dist/next/resources/slim/slim-out-of-bed-resource.js +7 -0
  352. package/dist/next/resources/slim/slim-patient-thresholds-resource.d.ts +6 -0
  353. package/dist/next/resources/slim/slim-patient-thresholds-resource.js +6 -0
  354. package/dist/next/resources/slim/slim-patients-resource.d.ts +11 -0
  355. package/dist/next/resources/slim/slim-patients-resource.js +10 -0
  356. package/dist/next/resources/slim/slim-policies-resource.d.ts +10 -0
  357. package/dist/next/resources/slim/slim-policies-resource.js +10 -0
  358. package/dist/next/resources/slim/slim-practitioners-resource.d.ts +6 -0
  359. package/dist/next/resources/slim/slim-practitioners-resource.js +6 -0
  360. package/dist/next/resources/slim/slim-projects-resource.d.ts +12 -0
  361. package/dist/next/resources/slim/slim-projects-resource.js +11 -0
  362. package/dist/next/resources/slim/slim-queries.d.ts +51 -0
  363. package/dist/next/resources/slim/slim-resource.d.ts +21 -0
  364. package/dist/next/resources/slim/slim-resource.js +6 -0
  365. package/dist/next/resources/slim/slim-sleep-resource.d.ts +6 -0
  366. package/dist/next/resources/slim/slim-sleep-resource.js +6 -0
  367. package/dist/next/resources/slim/slim-thresholds-resource.d.ts +5 -0
  368. package/dist/next/resources/slim/slim-thresholds-resource.js +5 -0
  369. package/dist/next/resources/slim/slim-trends-resource.d.ts +6 -0
  370. package/dist/next/resources/slim/slim-trends-resource.js +6 -0
  371. package/dist/next/resources/slim/slim-users-resource.d.ts +12 -0
  372. package/dist/next/resources/slim/slim-users-resource.js +6 -0
  373. package/dist/next/resources/slim/slim-zones-resource.d.ts +8 -0
  374. package/dist/next/resources/slim/slim-zones-resource.js +8 -0
  375. package/dist/next/resources/video-calls/video-call-access-resource.d.ts +13 -0
  376. package/dist/next/resources/video-calls/video-call-access-resource.js +8 -0
  377. package/dist/next/resources/video-calls/video-call-appointments-resource.d.ts +8 -0
  378. package/dist/next/resources/video-calls/video-call-appointments-resource.js +8 -0
  379. package/dist/next/resources/video-calls/video-call-emails-resource.d.ts +8 -0
  380. package/dist/next/resources/video-calls/video-call-emails-resource.js +8 -0
  381. package/dist/next/resources/video-calls/video-calls-resource.d.ts +14 -0
  382. package/dist/next/resources/video-calls/video-calls-resource.js +6 -0
  383. package/dist/next/resources/wearables/wearable-connections-resource.d.ts +8 -0
  384. package/dist/next/resources/wearables/wearable-connections-resource.js +8 -0
  385. package/dist/next/resources/wearables/wearable-providers-resource.d.ts +10 -0
  386. package/dist/next/resources/wearables/wearable-providers-resource.js +10 -0
  387. package/dist/next/resources/wearables/wearables-resource.d.ts +7 -0
  388. package/dist/next/resources/wearables/wearables-resource.js +5 -0
  389. package/dist/next/storage/ovok-storage.d.ts +16 -0
  390. package/dist/next/storage/ovok-storage.js +8 -0
  391. package/dist/types/ValidationError.d.ts +9 -0
  392. package/dist/utils/patch/getPatchOperationType.d.ts +3 -0
  393. package/dist/utils/patch/getPatchOperationType.js +3 -0
  394. package/package.json +51 -12
@@ -9,16 +9,29 @@ const FHIR_JSON = "application/fhir+json";
9
9
  const READ_HEADERS = { Accept: FHIR_JSON };
10
10
  const WRITE_HEADERS = { Accept: FHIR_JSON, "Content-Type": FHIR_JSON };
11
11
  const PATCH_HEADERS = { Accept: FHIR_JSON, "Content-Type": "application/json-patch+json" };
12
+ /**
13
+ * Reads and writes FHIR resources through the Ovok API.
14
+ *
15
+ * @category fhir
16
+ */
12
17
  class FhirResource {
13
18
  constructor(http) {
14
19
  this.http = http;
15
20
  }
21
+ /** Reads a resource by id. Calls `GET {type}/{id}`. */
16
22
  read(type, id, options) {
17
23
  return this.http.send({ method: "GET", path: resourcePath(type, id), headers: READ_HEADERS }, options);
18
24
  }
25
+ /**
26
+ * Searches a resource type; the result pages lazily. Calls `GET {type}?...`.
27
+ *
28
+ * @example
29
+ * const page = await ovok.fhir.search("Patient", { family: "Smith" });
30
+ */
19
31
  search(type, params = {}, options) {
20
32
  return (0, page_1.pagePromise)(() => this.searchPage(type, (0, url_1.toSearchQuery)(params), options));
21
33
  }
34
+ /** Returns the first match of a search, or null when there is none. */
22
35
  async searchOne(type, params = {}, options) {
23
36
  var _a;
24
37
  const page = await this.search(type, { ...params, _count: 1 }, options);
@@ -36,16 +49,24 @@ class FhirResource {
36
49
  idempotent: ifNoneExist !== undefined,
37
50
  }, requestOptions);
38
51
  }
52
+ /**
53
+ * Replaces a resource, which must have an `id`. Calls `PUT {type}/{id}`.
54
+ *
55
+ * @throws OvokValidationError when the resource has no `id`.
56
+ */
39
57
  update(resource, options) {
40
58
  const path = resourcePath(resource.resourceType, requireId(resource));
41
59
  return this.http.send({ method: "PUT", path, body: resource, headers: WRITE_HEADERS }, options);
42
60
  }
61
+ /** Applies JSON Patch operations to a resource. Calls `PATCH {type}/{id}`. */
43
62
  patch(type, id, operations, options) {
44
63
  return this.http.send({ method: "PATCH", path: resourcePath(type, id), body: operations, headers: PATCH_HEADERS }, options);
45
64
  }
65
+ /** Deletes a resource. Calls `DELETE {type}/{id}`. */
46
66
  delete(type, id, options) {
47
67
  return this.http.send({ method: "DELETE", path: resourcePath(type, id), headers: READ_HEADERS }, options);
48
68
  }
69
+ /** Submits a batch or transaction bundle. Calls `POST` on the FHIR base path. */
49
70
  batch(bundle, options) {
50
71
  return this.http.send({ method: "POST", path: "", body: bundle, headers: WRITE_HEADERS }, options);
51
72
  }
@@ -1,14 +1,30 @@
1
1
  import { HttpClient } from "../http/http-client";
2
2
  import { RequestOptions } from "../http/transmit";
3
+ /**
4
+ * Result of the health check.
5
+ *
6
+ * @category health
7
+ */
3
8
  export type HealthCheck = {
9
+ /** Whether the service and its dependencies are healthy. */
4
10
  ok: boolean;
11
+ /** Health of each dependency, by name. */
5
12
  dependencies: Record<string, {
13
+ /** Whether this dependency is healthy. */
6
14
  ok: boolean;
7
15
  }>;
16
+ /** Deployed version, when reported. */
8
17
  version?: string | null;
18
+ /** Build environment, when reported. */
9
19
  buildEnv?: string | null;
20
+ /** Git commit of the deployed build, when reported. */
10
21
  commitHash?: string | null;
11
22
  };
23
+ /**
24
+ * API health. Calls `GET healthcheck`.
25
+ *
26
+ * @category health
27
+ */
12
28
  export declare class HealthResource {
13
29
  private readonly http;
14
30
  constructor(http: HttpClient);
@@ -2,6 +2,11 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.HealthResource = void 0;
4
4
  const HEALTHCHECK_PATH = "healthcheck";
5
+ /**
6
+ * API health. Calls `GET healthcheck`.
7
+ *
8
+ * @category health
9
+ */
5
10
  class HealthResource {
6
11
  constructor(http) {
7
12
  this.http = http;
@@ -1,12 +1,18 @@
1
1
  import type { InviteSent } from "../../../client/invites/types";
2
2
  import { HttpClient } from "../../http/http-client";
3
3
  import { RequestOptions } from "../../http/transmit";
4
- /** One invite kind: `create` sends it to `path`, `accept` redeems it at `path/accept`. */
4
+ /**
5
+ * One invite kind: `create` sends it to `path`, `accept` redeems it at `path/accept`.
6
+ *
7
+ * @category invites
8
+ */
5
9
  export declare class InviteFlowResource<Invite, Acceptance, Accepted> {
6
10
  private readonly http;
7
11
  private readonly path;
8
12
  private readonly acceptPath;
9
13
  constructor(http: HttpClient, path: string);
14
+ /** Sends an invite. */
10
15
  create(body: Invite, options?: RequestOptions): Promise<InviteSent>;
16
+ /** Redeems an invite. */
11
17
  accept(body: Acceptance, options?: RequestOptions): Promise<Accepted>;
12
18
  }
@@ -2,16 +2,22 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.InviteFlowResource = void 0;
4
4
  const ACCEPT_SEGMENT = "accept";
5
- /** One invite kind: `create` sends it to `path`, `accept` redeems it at `path/accept`. */
5
+ /**
6
+ * One invite kind: `create` sends it to `path`, `accept` redeems it at `path/accept`.
7
+ *
8
+ * @category invites
9
+ */
6
10
  class InviteFlowResource {
7
11
  constructor(http, path) {
8
12
  this.http = http;
9
13
  this.path = path;
10
14
  this.acceptPath = `${path}/${ACCEPT_SEGMENT}`;
11
15
  }
16
+ /** Sends an invite. */
12
17
  create(body, options) {
13
18
  return this.http.post(this.path, body, options);
14
19
  }
20
+ /** Redeems an invite. */
15
21
  accept(body, options) {
16
22
  return this.http.post(this.acceptPath, body, options);
17
23
  }
@@ -4,8 +4,23 @@ import type { UserSession } from "../../auth/user-session";
4
4
  import { HttpClient } from "../../http/http-client";
5
5
  import { RequestOptions } from "../../http/transmit";
6
6
  import { InviteFlowResource } from "./invite-flow-resource";
7
+ /**
8
+ * The invite flow for sharing a record with a practitioner or carer.
9
+ *
10
+ * @category invites
11
+ */
7
12
  export type RecordShareFlow = InviteFlowResource<RecordShareBody, AcceptRecordShareBody, RecordShareAccepted>;
13
+ /**
14
+ * The invite flow between a practitioner and a patient.
15
+ *
16
+ * @category invites
17
+ */
8
18
  export type PersonInviteFlow = InviteFlowResource<InviteBody, AcceptInviteBody, PatientSharingPractitionerShare>;
19
+ /**
20
+ * Invitations to share a record or enter a care relationship. Calls routes under `v1/invites`.
21
+ *
22
+ * @category invites
23
+ */
9
24
  export declare class InvitesResource {
10
25
  private readonly session;
11
26
  /** A patient shares their record with a practitioner, or some codes with a carer. */
@@ -4,6 +4,11 @@ exports.InvitesResource = void 0;
4
4
  const ovok_errors_1 = require("../../errors/ovok-errors");
5
5
  const invite_flow_resource_1 = require("./invite-flow-resource");
6
6
  const INVITES_PATH = "v1/invites";
7
+ /**
8
+ * Invitations to share a record or enter a care relationship. Calls routes under `v1/invites`.
9
+ *
10
+ * @category invites
11
+ */
7
12
  class InvitesResource {
8
13
  constructor(http, session = null) {
9
14
  this.session = session;
@@ -1,9 +1,15 @@
1
1
  import type { OvokI18nDocument, OvokI18nValue } from "../../../client/platform/types";
2
2
  import { HttpClient } from "../../http/http-client";
3
3
  import { RequestOptions } from "../../http/transmit";
4
+ /**
5
+ * Translation documents in i18next format.
6
+ *
7
+ * @category localization
8
+ */
4
9
  export declare class I18nextResource {
5
10
  private readonly http;
6
11
  constructor(http: HttpClient);
12
+ /** Fetches the i18next translations of a language. Calls `GET localization/i18next/{language}`. */
7
13
  retrieve(language: string, options?: RequestOptions): Promise<OvokI18nDocument>;
8
14
  /** The server queues the write (202), so a read right after may not show it yet. */
9
15
  update(language: string, document: Record<string, OvokI18nValue>, options?: RequestOptions): Promise<void>;
@@ -3,10 +3,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.I18nextResource = void 0;
4
4
  const url_1 = require("../../http/url");
5
5
  const i18nextPath = (language) => `localization/i18next/${(0, url_1.pathSegment)(language)}`;
6
+ /**
7
+ * Translation documents in i18next format.
8
+ *
9
+ * @category localization
10
+ */
6
11
  class I18nextResource {
7
12
  constructor(http) {
8
13
  this.http = http;
9
14
  }
15
+ /** Fetches the i18next translations of a language. Calls `GET localization/i18next/{language}`. */
10
16
  retrieve(language, options) {
11
17
  return this.http.get(i18nextPath(language), options);
12
18
  }
@@ -1,9 +1,16 @@
1
1
  import type { OvokLocales } from "../../../client/platform/types";
2
2
  import { HttpClient } from "../../http/http-client";
3
3
  import { RequestOptions } from "../../http/transmit";
4
+ /**
5
+ * The languages the project supports. Calls routes under `locales`.
6
+ *
7
+ * @category localization
8
+ */
4
9
  export declare class LocalesResource {
5
10
  private readonly http;
6
11
  constructor(http: HttpClient);
12
+ /** Reads the supported languages. Calls `GET locales`. */
7
13
  retrieve(options?: RequestOptions): Promise<OvokLocales>;
14
+ /** Updates the supported languages. Calls `PATCH locales`. */
8
15
  update(locales: OvokLocales, options?: RequestOptions): Promise<OvokLocales>;
9
16
  }
@@ -2,13 +2,20 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.LocalesResource = void 0;
4
4
  const LOCALES_PATH = "locales";
5
+ /**
6
+ * The languages the project supports. Calls routes under `locales`.
7
+ *
8
+ * @category localization
9
+ */
5
10
  class LocalesResource {
6
11
  constructor(http) {
7
12
  this.http = http;
8
13
  }
14
+ /** Reads the supported languages. Calls `GET locales`. */
9
15
  retrieve(options) {
10
16
  return this.http.get(LOCALES_PATH, options);
11
17
  }
18
+ /** Updates the supported languages. Calls `PATCH locales`. */
12
19
  update(locales, options) {
13
20
  return this.http.patch(LOCALES_PATH, locales, options);
14
21
  }
@@ -2,16 +2,33 @@ import type { OvokLocalization, OvokLocalizationQuery, OvokLocalizationUpdate }
2
2
  import { HttpClient } from "../../http/http-client";
3
3
  import { RequestOptions } from "../../http/transmit";
4
4
  import { I18nextResource } from "./i18next-resource";
5
+ /**
6
+ * A list of localization entries.
7
+ *
8
+ * @category localization
9
+ */
5
10
  export type LocalizationList = {
11
+ /** Total entries matching the query. */
6
12
  total: number;
13
+ /** The entries returned. */
7
14
  resources: OvokLocalization[];
8
15
  };
16
+ /**
17
+ * Translation entries per language. Calls routes under `localization`.
18
+ *
19
+ * @category localization
20
+ */
9
21
  export declare class LocalizationsResource {
10
22
  private readonly http;
23
+ /** Translations in i18next format. */
11
24
  readonly i18next: I18nextResource;
12
25
  constructor(http: HttpClient);
26
+ /** Lists entries of a language. Calls `GET localization/{language}`. */
13
27
  list(language: string, query?: OvokLocalizationQuery, options?: RequestOptions): Promise<LocalizationList>;
28
+ /** Reads one entry. Calls `GET localization/{language}/{key}`. */
14
29
  retrieve(language: string, key: string, options?: RequestOptions): Promise<OvokLocalization>;
30
+ /** Sets an entry. Calls `PUT localization/{language}/{key}`. */
15
31
  update(language: string, key: string, body: OvokLocalizationUpdate, options?: RequestOptions): Promise<OvokLocalization>;
32
+ /** Deletes an entry. Calls `DELETE localization/{language}/{key}`. */
16
33
  delete(language: string, key: string, options?: RequestOptions): Promise<void>;
17
34
  }
@@ -6,20 +6,29 @@ const url_1 = require("../../http/url");
6
6
  const i18next_resource_1 = require("./i18next-resource");
7
7
  const languagePath = (language) => `localization/${(0, url_1.pathSegment)(language)}`;
8
8
  const entryPath = (language, key) => `${languagePath(language)}/${(0, url_1.pathSegment)(key)}`;
9
+ /**
10
+ * Translation entries per language. Calls routes under `localization`.
11
+ *
12
+ * @category localization
13
+ */
9
14
  class LocalizationsResource {
10
15
  constructor(http) {
11
16
  this.http = http;
12
17
  this.i18next = new i18next_resource_1.I18nextResource(http);
13
18
  }
19
+ /** Lists entries of a language. Calls `GET localization/{language}`. */
14
20
  list(language, query = {}, options) {
15
21
  return this.http.get(`${languagePath(language)}${(0, query_string_1.toQueryString)(query)}`, options);
16
22
  }
23
+ /** Reads one entry. Calls `GET localization/{language}/{key}`. */
17
24
  retrieve(language, key, options) {
18
25
  return this.http.get(entryPath(language, key), options);
19
26
  }
27
+ /** Sets an entry. Calls `PUT localization/{language}/{key}`. */
20
28
  update(language, key, body, options) {
21
29
  return this.http.put(entryPath(language, key), body, options);
22
30
  }
31
+ /** Deletes an entry. Calls `DELETE localization/{language}/{key}`. */
23
32
  delete(language, key, options) {
24
33
  return this.http.delete(entryPath(language, key), options);
25
34
  }
@@ -9,17 +9,31 @@ import { QueryParams } from "../../http/url";
9
9
  import { FhirResource } from "../fhir-resource";
10
10
  import { BuildObservationsParams } from "./observation-builder";
11
11
  import { SessionSource } from "./signed-in-account";
12
+ /**
13
+ * Request options plus how to identify and write the readings.
14
+ *
15
+ * @category measurements
16
+ */
12
17
  export type SaveObservationsOptions = RequestOptions & {
13
18
  /** Identifier systems that name a reading for good; the SDK's device-reading id always counts. */
14
19
  identifierSystems?: readonly string[];
15
20
  /** Write over the observation saved under the same reading identifiers, for a value that changes. */
16
21
  replace?: boolean;
17
22
  };
23
+ /**
24
+ * Either the saved bundle, or the queue id of a reading kept for a later retry.
25
+ *
26
+ * @category measurements
27
+ */
18
28
  export type SaveObservationsResult = {
29
+ /** The server accepted the reading. */
19
30
  status: "saved";
31
+ /** The server's response bundle. */
20
32
  response: Bundle;
21
33
  } | {
34
+ /** The reading is stored offline and will be retried. */
22
35
  status: "queued";
36
+ /** Id of the queued reading, as used in a flush result. */
23
37
  queueId: string;
24
38
  };
25
39
  type MeasurementStorage = {
@@ -27,17 +41,45 @@ type MeasurementStorage = {
27
41
  queueKey: string;
28
42
  machineClientId: string | null;
29
43
  };
44
+ /**
45
+ * Which patient and codes to read the latest observations for.
46
+ *
47
+ * @category measurements
48
+ */
30
49
  export type LatestObservationsParams = GetLatestObservationsByCodeParams;
50
+ /**
51
+ * Codes and an optional per-code limit for a patient's recent observations.
52
+ *
53
+ * @category measurements
54
+ */
31
55
  export type LastObservationsQuery = {
56
+ /** Comma-joined observation codes. */
32
57
  code: string;
58
+ /** Most observations to return per code. */
33
59
  max?: number;
34
60
  };
35
- /** `$lastn` search parameters: the comma-joined codes, how many of each, and any others such as `_elements`. */
61
+ /**
62
+ * `$lastn` search parameters: the comma-joined codes, how many of each, and any others such as `_elements`.
63
+ *
64
+ * @category measurements
65
+ */
36
66
  export type LastnQuery = QueryParams & {
67
+ /** Comma-joined observation codes. */
37
68
  code: string;
69
+ /** Most observations to return per code. */
38
70
  max?: number;
39
71
  };
72
+ /**
73
+ * The measurement types to resolve to observation codes.
74
+ *
75
+ * @category measurements
76
+ */
40
77
  export type MeasurementCodeTypes = Parameters<typeof observationCodesForTypes>[0];
78
+ /**
79
+ * Builds, saves and reads measurements as FHIR Observations, with an offline queue.
80
+ *
81
+ * @category measurements
82
+ */
41
83
  export declare class MeasurementsResource {
42
84
  private readonly http;
43
85
  private readonly fhir;
@@ -45,17 +87,27 @@ export declare class MeasurementsResource {
45
87
  private readonly offlineMeasurementQueue;
46
88
  private readonly machineClientId;
47
89
  private readonly session;
90
+ /** The offline queue of measurements waiting to be sent. */
48
91
  readonly offlineQueue: OfflineMeasurementQueueApi;
49
92
  constructor(http: HttpClient, fhir: FhirResource, session: SessionSource | null, storageOptions: MeasurementStorage);
93
+ /**
94
+ * Builds Observations from a measurement and saves them; queued offline when they cannot be sent.
95
+ *
96
+ * @example
97
+ * const result = await ovok.measurements.save({ measurement, device });
98
+ */
50
99
  save(params: BuildObservationsParams, options?: SaveObservationsOptions): Promise<SaveObservationsResult>;
51
100
  /** One reading, main observation first, created conditionally so a retry cannot duplicate it. */
52
101
  saveObservations(observations: Observation[], options?: SaveObservationsOptions): Promise<SaveObservationsResult>;
53
102
  /** Many readings, each main observation first, in as few requests as fit; a reading alone stays atomic. */
54
103
  saveObservationGroups(groups: Observation[][], options?: SaveObservationsOptions): Promise<Bundle>;
104
+ /** Builds the Observations for a measurement without saving them. */
55
105
  build(params: BuildObservationsParams): Promise<Observation[]>;
106
+ /** Reads the latest observation of each code for a patient. Calls `GET fhir/Observation/$lastn`. */
56
107
  latest(params: LatestObservationsParams, options?: RequestOptions): Promise<Bundle<Observation>>;
57
108
  /** The patient's newest `max` observations of each code, in one request. */
58
109
  lastn(patientId: string, query: LastnQuery, options?: RequestOptions): Promise<Bundle<Observation>>;
110
+ /** Reads a patient's recent observations. Calls `GET patient/{patientId}/observation`. */
59
111
  lastForPatient(patientId: string, query: LastObservationsQuery, options?: RequestOptions): Promise<Bundle<Observation>>;
60
112
  /** The comma-joined codes the types are saved under, as `latest` and FHIR `code` searches take them. */
61
113
  codesFor(types: MeasurementCodeTypes): string;
@@ -13,6 +13,11 @@ const save_error_1 = require("./save-error");
13
13
  const signed_in_account_1 = require("./signed-in-account");
14
14
  const LATEST_OBSERVATIONS_PATH = "fhir/Observation/$lastn";
15
15
  const LATEST_PER_CODE = 1;
16
+ /**
17
+ * Builds, saves and reads measurements as FHIR Observations, with an offline queue.
18
+ *
19
+ * @category measurements
20
+ */
16
21
  class MeasurementsResource {
17
22
  constructor(http, fhir, session, storageOptions) {
18
23
  this.http = http;
@@ -25,6 +30,12 @@ class MeasurementsResource {
25
30
  flush: (options, requestOptions) => this.offlineMeasurementQueue.flush(options, requestOptions),
26
31
  };
27
32
  }
33
+ /**
34
+ * Builds Observations from a measurement and saves them; queued offline when they cannot be sent.
35
+ *
36
+ * @example
37
+ * const result = await ovok.measurements.save({ measurement, device });
38
+ */
28
39
  async save(params, options) {
29
40
  return this.saveObservations(await this.build(params), options);
30
41
  }
@@ -57,10 +68,12 @@ class MeasurementsResource {
57
68
  }
58
69
  return { resourceType: "Bundle", type: "batch-response", entry: responses.flatMap((response) => { var _a; return (_a = response.entry) !== null && _a !== void 0 ? _a : []; }) };
59
70
  }
71
+ /** Builds the Observations for a measurement without saving them. */
60
72
  async build(params) {
61
73
  const subject = params.patientId ? `Patient/${params.patientId}` : await this.account.profileReference();
62
74
  return (0, observation_builder_1.buildObservations)(params, subject);
63
75
  }
76
+ /** Reads the latest observation of each code for a patient. Calls `GET fhir/Observation/$lastn`. */
64
77
  async latest(params, options) {
65
78
  const query = (0, query_string_1.toQueryString)({
66
79
  max: LATEST_PER_CODE,
@@ -74,6 +87,7 @@ class MeasurementsResource {
74
87
  lastn(patientId, query, options) {
75
88
  return this.http.get(`${LATEST_OBSERVATIONS_PATH}${(0, query_string_1.toQueryString)({ ...query, patient: `Patient/${patientId}` })}`, options);
76
89
  }
90
+ /** Reads a patient's recent observations. Calls `GET patient/{patientId}/observation`. */
77
91
  lastForPatient(patientId, query, options) {
78
92
  return this.http.get(`patient/${(0, url_1.pathSegment)(patientId)}/observation${(0, query_string_1.toQueryString)(query)}`, options);
79
93
  }
@@ -1,5 +1,10 @@
1
1
  import type { GenerateObservationBodyParams } from "../../../client/observation/types/generate-observation-body/GenerateObservationBodyParams";
2
2
  import type { Observation } from "@medplum/fhirtypes";
3
+ /**
4
+ * Describes one measurement to turn into Observations: its type, values, device and time.
5
+ *
6
+ * @category measurements
7
+ */
3
8
  export type BuildObservationsParams = GenerateObservationBodyParams;
4
9
  /** One measurement's Observations about `subject`, a reference such as `Patient/1`. */
5
10
  export declare function buildObservations(params: BuildObservationsParams, subject: string): Observation[];
@@ -1,22 +1,54 @@
1
1
  import type { RequestOptions } from "../../http/transmit";
2
2
  import type { Bundle } from "@medplum/fhirtypes";
3
+ /**
4
+ * Options for retrying queued measurements.
5
+ *
6
+ * @category measurements
7
+ */
3
8
  export type OfflineMeasurementFlushOptions = {
9
+ /** Also retry measurements that ran out of retries. */
4
10
  includeExhausted?: boolean;
11
+ /** Give exhausted measurements a fresh set of retries before flushing. */
5
12
  resetExhausted?: boolean;
6
13
  };
14
+ /**
15
+ * A summary of why the last attempt to send a measurement failed.
16
+ *
17
+ * @category measurements
18
+ */
7
19
  export type OfflineMeasurementFailure = {
20
+ /** Error name. */
8
21
  name: string;
22
+ /** Error code, when it has one. */
9
23
  code?: string;
24
+ /** HTTP status, when the failure was a response. */
10
25
  status?: number;
11
26
  };
27
+ /**
28
+ * The outcome of a flush, with counts and per-measurement responses.
29
+ *
30
+ * @category measurements
31
+ */
12
32
  export type OfflineMeasurementFlushResult = {
33
+ /** Measurements a send was tried for. */
13
34
  attempted: number;
35
+ /** Measurements sent and removed from the queue. */
14
36
  saved: number;
37
+ /** Measurements still waiting to be retried. */
15
38
  queued: number;
39
+ /** Measurements that ran out of retries and are held back. */
16
40
  exhausted: number;
41
+ /** The server response for each saved measurement, by queue id. */
17
42
  responses: Record<string, Bundle>;
43
+ /** The last failure for each measurement that has one, by queue id. */
18
44
  failures: Record<string, OfflineMeasurementFailure>;
19
45
  };
46
+ /**
47
+ * Controls for the offline measurement queue.
48
+ *
49
+ * @category measurements
50
+ */
20
51
  export type OfflineMeasurementQueueApi = {
52
+ /** Sends queued measurements that are due and the signed-in account owns. */
21
53
  flush: (options?: OfflineMeasurementFlushOptions, requestOptions?: RequestOptions) => Promise<OfflineMeasurementFlushResult>;
22
54
  };
@@ -2,18 +2,36 @@ import type { Appointment, ExtractResource, ResourceType } from "@medplum/fhirty
2
2
  import { RequestOptions } from "../../http/transmit";
3
3
  import { QueryParams } from "../../http/url";
4
4
  import { FhirResource } from "../fhir-resource";
5
- /** Lists resolve to the first page's resources, as the Medplum client's `searchResources` did. */
5
+ /**
6
+ * FHIR resources of one type that can be listed; a list resolves to the first page's resources.
7
+ *
8
+ * @category patient
9
+ */
6
10
  export declare class FhirListResource<K extends ResourceType> {
7
11
  protected readonly fhir: FhirResource;
8
12
  protected readonly type: K;
9
13
  constructor(fhir: FhirResource, type: K);
14
+ /** Lists the first page of matching resources. */
10
15
  list(params?: QueryParams, options?: RequestOptions): Promise<ExtractResource<K>[]>;
11
16
  }
17
+ /**
18
+ * FHIR resources of one type that can be read by ID.
19
+ *
20
+ * @category patient
21
+ */
12
22
  export declare class FhirRecordsResource<K extends ResourceType> extends FhirListResource<K> {
23
+ /** Reads one resource by ID. */
13
24
  retrieve(id: string, options?: RequestOptions): Promise<ExtractResource<K>>;
14
25
  }
26
+ /**
27
+ * Appointments of the patient.
28
+ *
29
+ * @category patient
30
+ */
15
31
  export declare class AppointmentsResource extends FhirRecordsResource<"Appointment"> {
16
32
  constructor(fhir: FhirResource);
33
+ /** Creates an appointment. */
17
34
  create(appointment: Appointment, options?: RequestOptions): Promise<Appointment>;
35
+ /** Replaces the appointment with the given ID. */
18
36
  update(id: string, appointment: Appointment, options?: RequestOptions): Promise<Appointment>;
19
37
  }
@@ -1,31 +1,49 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AppointmentsResource = exports.FhirRecordsResource = exports.FhirListResource = void 0;
4
- /** Lists resolve to the first page's resources, as the Medplum client's `searchResources` did. */
4
+ /**
5
+ * FHIR resources of one type that can be listed; a list resolves to the first page's resources.
6
+ *
7
+ * @category patient
8
+ */
5
9
  class FhirListResource {
6
10
  constructor(fhir, type) {
7
11
  this.fhir = fhir;
8
12
  this.type = type;
9
13
  }
14
+ /** Lists the first page of matching resources. */
10
15
  async list(params = {}, options) {
11
16
  const page = await this.fhir.search(this.type, params, options);
12
17
  return page.data;
13
18
  }
14
19
  }
15
20
  exports.FhirListResource = FhirListResource;
21
+ /**
22
+ * FHIR resources of one type that can be read by ID.
23
+ *
24
+ * @category patient
25
+ */
16
26
  class FhirRecordsResource extends FhirListResource {
27
+ /** Reads one resource by ID. */
17
28
  retrieve(id, options) {
18
29
  return this.fhir.read(this.type, id, options);
19
30
  }
20
31
  }
21
32
  exports.FhirRecordsResource = FhirRecordsResource;
33
+ /**
34
+ * Appointments of the patient.
35
+ *
36
+ * @category patient
37
+ */
22
38
  class AppointmentsResource extends FhirRecordsResource {
23
39
  constructor(fhir) {
24
40
  super(fhir, "Appointment");
25
41
  }
42
+ /** Creates an appointment. */
26
43
  create(appointment, options) {
27
44
  return this.fhir.create(appointment, options);
28
45
  }
46
+ /** Replaces the appointment with the given ID. */
29
47
  update(id, appointment, options) {
30
48
  return this.fhir.update({ ...appointment, id }, options);
31
49
  }
@@ -3,18 +3,33 @@ import { HttpClient } from "../../http/http-client";
3
3
  import { RequestOptions } from "../../http/transmit";
4
4
  import { FhirResource } from "../fhir-resource";
5
5
  import { AppointmentsResource, FhirListResource, FhirRecordsResource } from "./fhir-records";
6
+ /**
7
+ * The signed-in patient's own records.
8
+ *
9
+ * @category patient
10
+ */
6
11
  export declare class PatientResource {
7
12
  private readonly http;
13
+ /** Appointments. */
8
14
  readonly appointments: AppointmentsResource;
15
+ /** Schedules. */
9
16
  readonly schedules: FhirListResource<"Schedule">;
17
+ /** Bookable slots. */
10
18
  readonly slots: FhirListResource<"Slot">;
19
+ /** Measurements, stored as Observations. */
11
20
  readonly measurements: FhirRecordsResource<"Observation">;
21
+ /** Care plans. */
12
22
  readonly carePlans: FhirRecordsResource<"CarePlan">;
23
+ /** Questionnaires. */
13
24
  readonly questionnaires: FhirRecordsResource<"Questionnaire">;
25
+ /** Questionnaire responses. */
14
26
  readonly questionnaireResponses: FhirRecordsResource<"QuestionnaireResponse">;
27
+ /** Devices. */
15
28
  readonly devices: FhirRecordsResource<"Device">;
29
+ /** Notifications, stored as CommunicationRequests. */
16
30
  readonly notifications: FhirRecordsResource<"CommunicationRequest">;
17
31
  constructor(http: HttpClient, fhir: FhirResource);
32
+ /** Reads the latest observations. Calls `GET fhir/Observation/$lastn`. */
18
33
  latestObservations(params?: OvokPatientLatestObservationsQuery, options?: RequestOptions): Promise<OvokPatientObservationBundle>;
19
34
  /** Every read is scoped to the signed-in patient unless its query names another. */
20
35
  dashboard(params?: OvokPatientDashboardQuery, options?: RequestOptions): Promise<OvokPatientDashboard>;