@ovok/core 0.4.49-dev.504 → 0.4.49-dev.515

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 (391) hide show
  1. package/dist/client/ai-fhir/methods/AIFhirResources.d.ts +3 -1
  2. package/dist/client/ai-fhir/methods/AIFhirResources.js +3 -1
  3. package/dist/client/ai-fhir/types/AIFhirPlan.d.ts +8 -0
  4. package/dist/client/ai-fhir/types/AIFhirPlanRequest.d.ts +8 -0
  5. package/dist/client/ai-fhir/types/AIFhirRequest.d.ts +5 -0
  6. package/dist/client/ai-fhir/types/AIFhirResponse.d.ts +6 -0
  7. package/dist/client/auth/errors.d.ts +15 -2
  8. package/dist/client/auth/errors.js +12 -2
  9. package/dist/client/auth/methods/appleLogin.d.ts +1 -0
  10. package/dist/client/auth/methods/appleLogin.js +1 -0
  11. package/dist/client/auth/methods/changePassword.d.ts +1 -0
  12. package/dist/client/auth/methods/changePassword.js +1 -0
  13. package/dist/client/auth/methods/googleLogin.d.ts +1 -0
  14. package/dist/client/auth/methods/googleLogin.js +1 -0
  15. package/dist/client/auth/methods/login.d.ts +6 -0
  16. package/dist/client/auth/methods/login.js +6 -0
  17. package/dist/client/auth/methods/register.d.ts +5 -0
  18. package/dist/client/auth/methods/register.js +5 -0
  19. package/dist/client/auth/methods/registerPractitioner.d.ts +5 -0
  20. package/dist/client/auth/methods/registerPractitioner.js +5 -0
  21. package/dist/client/auth/methods/reloadSession.d.ts +3 -0
  22. package/dist/client/auth/methods/requestDeleteUser.d.ts +4 -5
  23. package/dist/client/auth/methods/requestDeleteUser.js +4 -5
  24. package/dist/client/auth/methods/setPasswordFromReset.d.ts +1 -0
  25. package/dist/client/auth/methods/setPasswordFromReset.js +1 -0
  26. package/dist/client/auth/session-fetch.d.ts +11 -0
  27. package/dist/client/auth/types/Account.d.ts +8 -1
  28. package/dist/client/auth/types/AppleLoginBody.d.ts +16 -0
  29. package/dist/client/auth/types/AppleLoginBody.js +5 -0
  30. package/dist/client/auth/types/AuthResponse.d.ts +12 -0
  31. package/dist/client/auth/types/ChangePasswordBody.d.ts +7 -0
  32. package/dist/client/auth/types/ChangePasswordResponse.d.ts +5 -0
  33. package/dist/client/auth/types/CompletePasswordResetBody.d.ts +8 -0
  34. package/dist/client/auth/types/GoogleLoginBody.d.ts +5 -0
  35. package/dist/client/auth/types/LoginBody.d.ts +15 -1
  36. package/dist/client/auth/types/LoginError.d.ts +21 -2
  37. package/dist/client/auth/types/LoginError.js +8 -2
  38. package/dist/client/auth/types/LoginResponse.d.ts +8 -1
  39. package/dist/client/auth/types/RegisterBody.d.ts +12 -0
  40. package/dist/client/auth/types/RegisterPractitionerBody.d.ts +5 -0
  41. package/dist/client/auth/types/RegisterResponse.d.ts +7 -0
  42. package/dist/client/auth/types/RequestDeleteUserBody.d.ts +7 -7
  43. package/dist/client/auth/types/RequestDeleteUserResponse.d.ts +14 -0
  44. package/dist/client/auth/types/ResetPasswordBody.d.ts +5 -0
  45. package/dist/client/auth/types/Session.d.ts +14 -2
  46. package/dist/client/change-history/methods.d.ts +6 -0
  47. package/dist/client/change-history/methods.js +6 -0
  48. package/dist/client/change-history/types.d.ts +82 -0
  49. package/dist/client/chat/ai/methods/createAiSession.d.ts +6 -0
  50. package/dist/client/chat/ai/methods/createAiSession.js +6 -0
  51. package/dist/client/chat/ai/types/CreateAiSessionResponse.d.ts +17 -0
  52. package/dist/client/chat/ai/types/SessionMessagesResponse.d.ts +9 -0
  53. package/dist/client/cms/locale.d.ts +12 -2
  54. package/dist/client/cms/locale.js +9 -2
  55. package/dist/client/cms/methods.d.ts +6 -2
  56. package/dist/client/cms/methods.js +7 -3
  57. package/dist/client/cms/types.d.ts +44 -4
  58. package/dist/client/consent/methods.d.ts +16 -0
  59. package/dist/client/consent/methods.js +16 -0
  60. package/dist/client/consent/types.d.ts +53 -1
  61. package/dist/client/consent/types.js +10 -1
  62. package/dist/client/email/methods.d.ts +3 -0
  63. package/dist/client/email/methods.js +3 -0
  64. package/dist/client/email/types.d.ts +33 -0
  65. package/dist/client/errors/field-errors.d.ts +3 -0
  66. package/dist/client/errors/field-errors.js +3 -0
  67. package/dist/client/errors/ovok-error-utils.d.ts +6 -0
  68. package/dist/client/errors/ovok-error-utils.js +6 -0
  69. package/dist/client/errors/ovok-error.d.ts +36 -4
  70. package/dist/client/errors/ovok-error.js +15 -4
  71. package/dist/client/errors/rate-limit-error.d.ts +11 -2
  72. package/dist/client/errors/rate-limit-error.js +10 -2
  73. package/dist/client/errors/sign-in-required-error.d.ts +5 -2
  74. package/dist/client/errors/sign-in-required-error.js +5 -2
  75. package/dist/client/experience/methods.d.ts +38 -0
  76. package/dist/client/experience/methods.js +35 -0
  77. package/dist/client/experience/types.d.ts +316 -0
  78. package/dist/client/experience/types.js +1 -0
  79. package/dist/client/invites/methods.d.ts +27 -9
  80. package/dist/client/invites/methods.js +27 -9
  81. package/dist/client/invites/parse-accept-invite-link.d.ts +3 -1
  82. package/dist/client/invites/parse-accept-invite-link.js +3 -1
  83. package/dist/client/invites/types.d.ts +55 -0
  84. package/dist/client/invites/types.js +12 -0
  85. package/dist/client/notifications/methods.d.ts +15 -0
  86. package/dist/client/notifications/methods.js +15 -0
  87. package/dist/client/notifications/types.d.ts +249 -2
  88. package/dist/client/observation/methods/generateObservationBodiesByMeasurement.d.ts +3 -0
  89. package/dist/client/observation/methods/generateObservationBodiesByMeasurement.js +3 -0
  90. package/dist/client/observation/methods/getLatestObservationsByCodes.d.ts +3 -0
  91. package/dist/client/observation/methods/getLatestObservationsByCodes.js +3 -0
  92. package/dist/client/observation/methods/observationsToMeasurements.d.ts +23 -1
  93. package/dist/client/observation/methods/observationsToMeasurements.js +8 -1
  94. package/dist/client/observation/methods/saveMeasurement.d.ts +3 -1
  95. package/dist/client/observation/methods/saveMeasurement.js +3 -1
  96. package/dist/client/observation/observation-bundle-utils.d.ts +6 -0
  97. package/dist/client/observation/observation-bundle-utils.js +6 -0
  98. package/dist/client/observation/series.d.ts +25 -3
  99. package/dist/client/observation/series.js +6 -2
  100. package/dist/client/observation/services/creator.d.ts +5 -0
  101. package/dist/client/observation/services/creator.js +5 -0
  102. package/dist/client/observation/services/uric-acid-service.js +0 -1
  103. package/dist/client/observation/types/GetLatestObservationsByCodeParams.d.ts +10 -0
  104. package/dist/client/observation/types/MeasurementTypeKey.d.ts +26 -0
  105. package/dist/client/observation/types/MeasurementTypeKey.js +26 -0
  106. package/dist/client/observation/types/ObservationCode.d.ts +64 -1
  107. package/dist/client/observation/types/ObservationCode.js +64 -1
  108. package/dist/client/observation/types/UrineAnalytes.d.ts +14 -0
  109. package/dist/client/observation/types/UrineAnalytes.js +1 -0
  110. package/dist/client/observation/types/generate-measurement/Sample.d.ts +33 -0
  111. package/dist/client/observation/types/generate-observation-body/GenerateObservationBodyParams.d.ts +9 -0
  112. package/dist/client/observation/types/measurement/BabySleepMeasurement.d.ts +3 -0
  113. package/dist/client/observation/types/measurement/BloodGlucoseMeasurement.d.ts +7 -0
  114. package/dist/client/observation/types/measurement/BloodPressureMeasurement.d.ts +10 -0
  115. package/dist/client/observation/types/measurement/BloodPressureStates.d.ts +10 -0
  116. package/dist/client/observation/types/measurement/BloodPressureStates.js +10 -0
  117. package/dist/client/observation/types/measurement/BodyTemperatureMeasurement.d.ts +7 -0
  118. package/dist/client/observation/types/measurement/BodyWeightMeasurmement.d.ts +8 -0
  119. package/dist/client/observation/types/measurement/EcgDiagnosticFlag.d.ts +18 -0
  120. package/dist/client/observation/types/measurement/EcgDiagnosticFlag.js +18 -0
  121. package/dist/client/observation/types/measurement/EcgMeasurement.d.ts +9 -0
  122. package/dist/client/observation/types/measurement/HeartRateMeasurement.d.ts +7 -0
  123. package/dist/client/observation/types/measurement/HeartRateVariabilityMeasurement.d.ts +7 -0
  124. package/dist/client/observation/types/measurement/LipidPanelMeasurement.d.ts +12 -0
  125. package/dist/client/observation/types/measurement/Measurement.d.ts +9 -0
  126. package/dist/client/observation/types/measurement/MeasurementDevice.d.ts +10 -0
  127. package/dist/client/observation/types/measurement/MeasurementSeries.d.ts +2 -0
  128. package/dist/client/observation/types/measurement/PulseOximeterMeasurement.d.ts +10 -0
  129. package/dist/client/observation/types/measurement/RespiratoryRateMeasurement.d.ts +7 -0
  130. package/dist/client/observation/types/measurement/RespiratoryTherapyMeasurement.d.ts +3 -0
  131. package/dist/client/observation/types/measurement/RestingHeartRateMeasurement.d.ts +7 -0
  132. package/dist/client/observation/types/measurement/SpirometryMeasurement.d.ts +23 -0
  133. package/dist/client/observation/types/measurement/StepCountMeasurement.d.ts +9 -0
  134. package/dist/client/observation/types/measurement/UrineAnalyzeMeasurement.d.ts +29 -0
  135. package/dist/client/observation/types/measurement/Vo2MaxMeasurement.d.ts +7 -0
  136. package/dist/client/observation/types/measurement/WalkingHeartRateAverageMeasurement.d.ts +7 -0
  137. package/dist/client/observation/types/service/MeasurementField.d.ts +5 -1
  138. package/dist/client/observation/utils/getObservationValueDisplay.d.ts +2 -0
  139. package/dist/client/offline/offline-measurement-queue.d.ts +56 -1
  140. package/dist/client/offline/offline-measurement-queue.js +21 -0
  141. package/dist/client/offline/shared-measurement-queue.d.ts +16 -1
  142. package/dist/client/offline/shared-measurement-queue.js +3 -1
  143. package/dist/client/ovok-client.d.ts +27 -6
  144. package/dist/client/ovok-client.js +8 -5
  145. package/dist/client/patient/methods.d.ts +21 -0
  146. package/dist/client/patient/methods.js +21 -0
  147. package/dist/client/patient/types.d.ts +131 -0
  148. package/dist/client/patient-sharing/methods.d.ts +18 -0
  149. package/dist/client/patient-sharing/methods.js +18 -0
  150. package/dist/client/patient-sharing/types.d.ts +89 -1
  151. package/dist/client/platform/methods.d.ts +22 -0
  152. package/dist/client/platform/methods.js +20 -0
  153. package/dist/client/platform/types.d.ts +194 -1
  154. package/dist/client/platform/types.js +24 -0
  155. package/dist/client/questionnaire-response/methods/createQuestionnaireResponseWithObservations.d.ts +3 -0
  156. package/dist/client/questionnaire-response/methods/createQuestionnaireResponseWithObservations.js +3 -0
  157. package/dist/client/questionnaire-response/methods/extractQuestionnaireObservations.d.ts +3 -0
  158. package/dist/client/questionnaire-response/methods/extractQuestionnaireObservations.js +3 -0
  159. package/dist/client/questionnaire-response/methods/populateQuestionnaire.d.ts +3 -0
  160. package/dist/client/questionnaire-response/methods/populateQuestionnaire.js +3 -0
  161. package/dist/client/questionnaire-response/methods/submitQuestionnaireResponse.d.ts +3 -0
  162. package/dist/client/questionnaire-response/methods/submitQuestionnaireResponse.js +3 -0
  163. package/dist/client/questionnaire-response/types.d.ts +6 -0
  164. package/dist/client/signals/errors.d.ts +13 -2
  165. package/dist/client/signals/errors.js +9 -2
  166. package/dist/client/signals/methods.d.ts +9 -0
  167. package/dist/client/signals/methods.js +9 -0
  168. package/dist/client/signals/types.d.ts +31 -0
  169. package/dist/client/slim/methods.d.ts +268 -21
  170. package/dist/client/slim/methods.js +264 -21
  171. package/dist/client/slim/paging.d.ts +22 -2
  172. package/dist/client/slim/paging.js +6 -2
  173. package/dist/client/slim/types.d.ts +920 -1
  174. package/dist/client/storage.d.ts +15 -1
  175. package/dist/client/storage.js +7 -1
  176. package/dist/client/wearables/methods.d.ts +24 -0
  177. package/dist/client/wearables/methods.js +24 -0
  178. package/dist/client/wearables/types.d.ts +74 -0
  179. package/dist/conformance/api-requirements.d.ts +31 -5
  180. package/dist/conformance/api-requirements.js +47 -10
  181. package/dist/conformance/capability-requirements.d.ts +4 -26
  182. package/dist/conformance/capability-requirements.js +5 -27
  183. package/dist/conformance/capability.d.ts +9 -1
  184. package/dist/conformance/capability.js +3 -1
  185. package/dist/hooks/account-hooks.d.ts +35 -0
  186. package/dist/hooks/account-hooks.js +33 -0
  187. package/dist/hooks/api-hooks.d.ts +74 -4
  188. package/dist/hooks/api-hooks.js +56 -4
  189. package/dist/hooks/cms-hooks.d.ts +9 -3
  190. package/dist/hooks/cms-hooks.js +9 -3
  191. package/dist/hooks/email-hooks.d.ts +3 -0
  192. package/dist/hooks/email-hooks.js +3 -0
  193. package/dist/hooks/experience-hooks.d.ts +26 -0
  194. package/dist/hooks/experience-hooks.js +24 -0
  195. package/dist/hooks/index.d.ts +18 -0
  196. package/dist/hooks/index.js +18 -0
  197. package/dist/hooks/invites-hooks.d.ts +21 -2
  198. package/dist/hooks/invites-hooks.js +21 -2
  199. package/dist/hooks/notification-ack-hooks.d.ts +6 -2
  200. package/dist/hooks/notification-ack-hooks.js +6 -2
  201. package/dist/hooks/notification-hooks.d.ts +27 -3
  202. package/dist/hooks/notification-hooks.js +27 -3
  203. package/dist/hooks/notification-note-hooks.d.ts +41 -0
  204. package/dist/hooks/notification-note-hooks.js +33 -0
  205. package/dist/hooks/observation-hooks.d.ts +29 -0
  206. package/dist/hooks/observation-hooks.js +23 -1
  207. package/dist/hooks/patient-hooks.d.ts +53 -0
  208. package/dist/hooks/patient-hooks.js +48 -0
  209. package/dist/hooks/patient-sharing-hooks.d.ts +18 -0
  210. package/dist/hooks/patient-sharing-hooks.js +18 -0
  211. package/dist/hooks/platform-hooks.d.ts +32 -0
  212. package/dist/hooks/platform-hooks.js +23 -0
  213. package/dist/hooks/poll-hooks.d.ts +17 -1
  214. package/dist/hooks/poll-hooks.js +3 -1
  215. package/dist/hooks/signals-hooks.d.ts +3 -0
  216. package/dist/hooks/signals-hooks.js +3 -0
  217. package/dist/hooks/wearables-hooks.d.ts +23 -0
  218. package/dist/hooks/wearables-hooks.js +21 -0
  219. package/dist/next/auth/saved-accounts-store.d.ts +10 -0
  220. package/dist/next/auth/session.d.ts +17 -0
  221. package/dist/next/auth/user-session.d.ts +5 -0
  222. package/dist/next/config/ovok-config.d.ts +45 -0
  223. package/dist/next/errors/ovok-account-error.d.ts +14 -1
  224. package/dist/next/errors/ovok-account-error.js +8 -1
  225. package/dist/next/errors/ovok-errors.d.ts +88 -0
  226. package/dist/next/errors/ovok-errors.js +67 -0
  227. package/dist/next/http/http-client.d.ts +5 -0
  228. package/dist/next/http/transmit.d.ts +7 -0
  229. package/dist/next/http/url.d.ts +10 -0
  230. package/dist/next/ovok.d.ts +31 -1
  231. package/dist/next/ovok.js +5 -1
  232. package/dist/next/paging/page.d.ts +13 -1
  233. package/dist/next/react/context.d.ts +7 -0
  234. package/dist/next/react/context.js +7 -0
  235. package/dist/next/react/index.d.ts +24 -0
  236. package/dist/next/react/index.js +18 -0
  237. package/dist/next/react/query-hooks.d.ts +69 -0
  238. package/dist/next/react/query-hooks.js +31 -0
  239. package/dist/next/resources/accounts/accounts-resource.d.ts +6 -0
  240. package/dist/next/resources/accounts/accounts-resource.js +6 -0
  241. package/dist/next/resources/ai/ai-chat-resource.d.ts +7 -0
  242. package/dist/next/resources/ai/ai-chat-resource.js +5 -0
  243. package/dist/next/resources/ai/ai-resource.d.ts +13 -0
  244. package/dist/next/resources/ai/ai-resource.js +6 -0
  245. package/dist/next/resources/ai/chat-messages-resource.d.ts +7 -0
  246. package/dist/next/resources/ai/chat-messages-resource.js +7 -0
  247. package/dist/next/resources/ai/chat-sessions-resource.d.ts +14 -0
  248. package/dist/next/resources/ai/chat-sessions-resource.js +8 -0
  249. package/dist/next/resources/auth/auth-sessions-resource.d.ts +6 -1
  250. package/dist/next/resources/auth/auth-sessions-resource.js +6 -1
  251. package/dist/next/resources/auth/registration.d.ts +18 -1
  252. package/dist/next/resources/auth/social-login.d.ts +12 -0
  253. package/dist/next/resources/auth-resource.d.ts +54 -1
  254. package/dist/next/resources/auth-resource.js +23 -0
  255. package/dist/next/resources/bots/bots-resource.d.ts +15 -0
  256. package/dist/next/resources/bots/bots-resource.js +5 -0
  257. package/dist/next/resources/cms/cms-delivery.d.ts +14 -2
  258. package/dist/next/resources/cms/cms-documents-resource.d.ts +7 -1
  259. package/dist/next/resources/cms/cms-documents-resource.js +7 -1
  260. package/dist/next/resources/cms/cms-resource.d.ts +7 -0
  261. package/dist/next/resources/cms/cms-resource.js +5 -0
  262. package/dist/next/resources/cms/release-notes-resource.d.ts +6 -0
  263. package/dist/next/resources/cms/release-notes-resource.js +6 -0
  264. package/dist/next/resources/consent/consent-resource.d.ts +22 -0
  265. package/dist/next/resources/consent/consent-resource.js +20 -0
  266. package/dist/next/resources/content/content-resource.d.ts +18 -0
  267. package/dist/next/resources/content/content-resource.js +12 -0
  268. package/dist/next/resources/documents/documents-resource.d.ts +24 -0
  269. package/dist/next/resources/documents/documents-resource.js +10 -0
  270. package/dist/next/resources/email/email-resource.d.ts +6 -0
  271. package/dist/next/resources/email/email-resource.js +5 -0
  272. package/dist/next/resources/email/email-templates-resource.d.ts +6 -0
  273. package/dist/next/resources/email/email-templates-resource.js +6 -0
  274. package/dist/next/resources/fhir-resource.d.ts +36 -0
  275. package/dist/next/resources/fhir-resource.js +21 -0
  276. package/dist/next/resources/health-resource.d.ts +16 -0
  277. package/dist/next/resources/health-resource.js +5 -0
  278. package/dist/next/resources/invites/invite-flow-resource.d.ts +7 -1
  279. package/dist/next/resources/invites/invite-flow-resource.js +7 -1
  280. package/dist/next/resources/invites/invites-resource.d.ts +15 -0
  281. package/dist/next/resources/invites/invites-resource.js +5 -0
  282. package/dist/next/resources/localization/i18next-resource.d.ts +6 -0
  283. package/dist/next/resources/localization/i18next-resource.js +6 -0
  284. package/dist/next/resources/localization/locales-resource.d.ts +7 -0
  285. package/dist/next/resources/localization/locales-resource.js +7 -0
  286. package/dist/next/resources/localization/localizations-resource.d.ts +17 -0
  287. package/dist/next/resources/localization/localizations-resource.js +9 -0
  288. package/dist/next/resources/measurements/measurements-resource.d.ts +53 -1
  289. package/dist/next/resources/measurements/measurements-resource.js +14 -0
  290. package/dist/next/resources/measurements/observation-builder.d.ts +5 -0
  291. package/dist/next/resources/measurements/offline-measurement-queue-types.d.ts +32 -0
  292. package/dist/next/resources/patient/fhir-records.d.ts +19 -1
  293. package/dist/next/resources/patient/fhir-records.js +19 -1
  294. package/dist/next/resources/patient/patient-resource.d.ts +15 -0
  295. package/dist/next/resources/patient/patient-resource.js +6 -0
  296. package/dist/next/resources/projects/project-features-resource.d.ts +7 -0
  297. package/dist/next/resources/projects/project-features-resource.js +7 -0
  298. package/dist/next/resources/projects/project-members-resource.d.ts +19 -0
  299. package/dist/next/resources/projects/project-members-resource.js +9 -0
  300. package/dist/next/resources/projects/project-settings-resource.d.ts +8 -0
  301. package/dist/next/resources/projects/project-settings-resource.js +8 -0
  302. package/dist/next/resources/projects/projects-resource.d.ts +15 -0
  303. package/dist/next/resources/projects/projects-resource.js +5 -0
  304. package/dist/next/resources/questionnaires/questionnaires-resource.d.ts +13 -0
  305. package/dist/next/resources/questionnaires/questionnaires-resource.js +13 -0
  306. package/dist/next/resources/realtime/realtime-resource.d.ts +11 -0
  307. package/dist/next/resources/realtime/realtime-resource.js +11 -0
  308. package/dist/next/resources/realtime/realtime-types.d.ts +16 -0
  309. package/dist/next/resources/session/saved-accounts-resource.d.ts +16 -0
  310. package/dist/next/resources/session/saved-accounts-resource.js +16 -0
  311. package/dist/next/resources/session/session-resource.d.ts +8 -0
  312. package/dist/next/resources/session/session-resource.js +7 -0
  313. package/dist/next/resources/sharing/sharing-invites-resource.d.ts +7 -0
  314. package/dist/next/resources/sharing/sharing-invites-resource.js +7 -0
  315. package/dist/next/resources/sharing/sharing-resource.d.ts +8 -0
  316. package/dist/next/resources/sharing/sharing-resource.js +5 -0
  317. package/dist/next/resources/sharing/sharing-settings-resource.d.ts +7 -0
  318. package/dist/next/resources/sharing/sharing-settings-resource.js +7 -0
  319. package/dist/next/resources/sharing/sharing-shares-resource.d.ts +7 -0
  320. package/dist/next/resources/sharing/sharing-shares-resource.js +7 -0
  321. package/dist/next/resources/signals/signals-gateway-resource.d.ts +15 -0
  322. package/dist/next/resources/signals/signals-gateway-resource.js +6 -0
  323. package/dist/next/resources/signals/signals-resource.d.ts +7 -0
  324. package/dist/next/resources/signals/signals-resource.js +5 -0
  325. package/dist/next/resources/signals/undeliverable-resource.d.ts +35 -0
  326. package/dist/next/resources/signals/undeliverable-resource.js +6 -0
  327. package/dist/next/resources/slim/slim-alarms-resource.d.ts +7 -0
  328. package/dist/next/resources/slim/slim-alarms-resource.js +7 -0
  329. package/dist/next/resources/slim/slim-change-history-resource.d.ts +6 -0
  330. package/dist/next/resources/slim/slim-change-history-resource.js +6 -0
  331. package/dist/next/resources/slim/slim-child-projects-resource.d.ts +21 -0
  332. package/dist/next/resources/slim/slim-child-projects-resource.js +8 -0
  333. package/dist/next/resources/slim/slim-devices-resource.d.ts +31 -0
  334. package/dist/next/resources/slim/slim-devices-resource.js +16 -0
  335. package/dist/next/resources/slim/slim-exports-resource.d.ts +6 -0
  336. package/dist/next/resources/slim/slim-exports-resource.js +6 -0
  337. package/dist/next/resources/slim/slim-locations-resource.d.ts +9 -0
  338. package/dist/next/resources/slim/slim-locations-resource.js +9 -0
  339. package/dist/next/resources/slim/slim-medical-notifications-resource.d.ts +6 -0
  340. package/dist/next/resources/slim/slim-medical-notifications-resource.js +6 -0
  341. package/dist/next/resources/slim/slim-notification-notes-resource.d.ts +10 -0
  342. package/dist/next/resources/slim/slim-notification-notes-resource.js +10 -0
  343. package/dist/next/resources/slim/slim-notifications-resource.d.ts +10 -0
  344. package/dist/next/resources/slim/slim-notifications-resource.js +6 -0
  345. package/dist/next/resources/slim/slim-organizations-resource.d.ts +9 -0
  346. package/dist/next/resources/slim/slim-organizations-resource.js +9 -0
  347. package/dist/next/resources/slim/slim-out-of-bed-resource.d.ts +12 -0
  348. package/dist/next/resources/slim/slim-out-of-bed-resource.js +7 -0
  349. package/dist/next/resources/slim/slim-patient-thresholds-resource.d.ts +6 -0
  350. package/dist/next/resources/slim/slim-patient-thresholds-resource.js +6 -0
  351. package/dist/next/resources/slim/slim-patients-resource.d.ts +11 -0
  352. package/dist/next/resources/slim/slim-patients-resource.js +10 -0
  353. package/dist/next/resources/slim/slim-policies-resource.d.ts +10 -0
  354. package/dist/next/resources/slim/slim-policies-resource.js +10 -0
  355. package/dist/next/resources/slim/slim-practitioners-resource.d.ts +6 -0
  356. package/dist/next/resources/slim/slim-practitioners-resource.js +6 -0
  357. package/dist/next/resources/slim/slim-projects-resource.d.ts +12 -0
  358. package/dist/next/resources/slim/slim-projects-resource.js +11 -0
  359. package/dist/next/resources/slim/slim-queries.d.ts +51 -0
  360. package/dist/next/resources/slim/slim-resource.d.ts +21 -0
  361. package/dist/next/resources/slim/slim-resource.js +6 -0
  362. package/dist/next/resources/slim/slim-sleep-resource.d.ts +6 -0
  363. package/dist/next/resources/slim/slim-sleep-resource.js +6 -0
  364. package/dist/next/resources/slim/slim-thresholds-resource.d.ts +5 -0
  365. package/dist/next/resources/slim/slim-thresholds-resource.js +5 -0
  366. package/dist/next/resources/slim/slim-trends-resource.d.ts +6 -0
  367. package/dist/next/resources/slim/slim-trends-resource.js +6 -0
  368. package/dist/next/resources/slim/slim-users-resource.d.ts +12 -0
  369. package/dist/next/resources/slim/slim-users-resource.js +6 -0
  370. package/dist/next/resources/slim/slim-zones-resource.d.ts +8 -0
  371. package/dist/next/resources/slim/slim-zones-resource.js +8 -0
  372. package/dist/next/resources/video-calls/video-call-access-resource.d.ts +13 -0
  373. package/dist/next/resources/video-calls/video-call-access-resource.js +8 -0
  374. package/dist/next/resources/video-calls/video-call-appointments-resource.d.ts +8 -0
  375. package/dist/next/resources/video-calls/video-call-appointments-resource.js +8 -0
  376. package/dist/next/resources/video-calls/video-call-emails-resource.d.ts +8 -0
  377. package/dist/next/resources/video-calls/video-call-emails-resource.js +8 -0
  378. package/dist/next/resources/video-calls/video-calls-resource.d.ts +14 -0
  379. package/dist/next/resources/video-calls/video-calls-resource.js +6 -0
  380. package/dist/next/resources/wearables/wearable-connections-resource.d.ts +8 -0
  381. package/dist/next/resources/wearables/wearable-connections-resource.js +8 -0
  382. package/dist/next/resources/wearables/wearable-providers-resource.d.ts +10 -0
  383. package/dist/next/resources/wearables/wearable-providers-resource.js +10 -0
  384. package/dist/next/resources/wearables/wearables-resource.d.ts +7 -0
  385. package/dist/next/resources/wearables/wearables-resource.js +5 -0
  386. package/dist/next/storage/ovok-storage.d.ts +16 -0
  387. package/dist/next/storage/ovok-storage.js +8 -0
  388. package/dist/types/ValidationError.d.ts +9 -0
  389. package/dist/utils/patch/getPatchOperationType.d.ts +3 -0
  390. package/dist/utils/patch/getPatchOperationType.js +3 -0
  391. package/package.json +5 -2
@@ -1,15 +1,33 @@
1
+ /**
2
+ * Diagnostic result reported by an ECG device.
3
+ *
4
+ * @category measurements
5
+ */
1
6
  export declare enum EcgDiagnosticFlag {
7
+ /** Regular rhythm. */
2
8
  REGULAR = "Regular",
9
+ /** Waveform quality too poor to evaluate. */
3
10
  POOR_WAVEFORM = "Poor Waveform",
11
+ /** Electrode lead disconnected. */
4
12
  LEAD_OFF = "Lead Off",
13
+ /** High heart rate. */
5
14
  HIGH_HR = "High HR",
15
+ /** Low heart rate. */
6
16
  LOW_HR = "Low HR",
17
+ /** Irregular RR intervals. */
7
18
  RR_IRREGULAR = "Irregular RR",
19
+ /** Premature ventricular contraction. */
8
20
  PVC = "PVC",
21
+ /** Cardiac arrest. */
9
22
  CARDIAC_ARREST = "Cardiac Arrest",
23
+ /** Atrial fibrillation. */
10
24
  ATRIAL_FIBRILLATION = "AFIB",
25
+ /** Wide QRS complex. */
11
26
  QRS_WIDE = "QRS Wide",
27
+ /** Long QT interval, as reported by the device. */
12
28
  QTC_LONG = "QRS Long",
29
+ /** Short QT interval, as reported by the device. */
13
30
  QTC_SHORT = "QRS Short",
31
+ /** Device reported an error. */
14
32
  ERROR = "ERROR"
15
33
  }
@@ -1,19 +1,37 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.EcgDiagnosticFlag = void 0;
4
+ /**
5
+ * Diagnostic result reported by an ECG device.
6
+ *
7
+ * @category measurements
8
+ */
4
9
  var EcgDiagnosticFlag;
5
10
  (function (EcgDiagnosticFlag) {
11
+ /** Regular rhythm. */
6
12
  EcgDiagnosticFlag["REGULAR"] = "Regular";
13
+ /** Waveform quality too poor to evaluate. */
7
14
  EcgDiagnosticFlag["POOR_WAVEFORM"] = "Poor Waveform";
15
+ /** Electrode lead disconnected. */
8
16
  EcgDiagnosticFlag["LEAD_OFF"] = "Lead Off";
17
+ /** High heart rate. */
9
18
  EcgDiagnosticFlag["HIGH_HR"] = "High HR";
19
+ /** Low heart rate. */
10
20
  EcgDiagnosticFlag["LOW_HR"] = "Low HR";
21
+ /** Irregular RR intervals. */
11
22
  EcgDiagnosticFlag["RR_IRREGULAR"] = "Irregular RR";
23
+ /** Premature ventricular contraction. */
12
24
  EcgDiagnosticFlag["PVC"] = "PVC";
25
+ /** Cardiac arrest. */
13
26
  EcgDiagnosticFlag["CARDIAC_ARREST"] = "Cardiac Arrest";
27
+ /** Atrial fibrillation. */
14
28
  EcgDiagnosticFlag["ATRIAL_FIBRILLATION"] = "AFIB";
29
+ /** Wide QRS complex. */
15
30
  EcgDiagnosticFlag["QRS_WIDE"] = "QRS Wide";
31
+ /** Long QT interval, as reported by the device. */
16
32
  EcgDiagnosticFlag["QTC_LONG"] = "QRS Long";
33
+ /** Short QT interval, as reported by the device. */
17
34
  EcgDiagnosticFlag["QTC_SHORT"] = "QRS Short";
35
+ /** Device reported an error. */
18
36
  EcgDiagnosticFlag["ERROR"] = "ERROR";
19
37
  })(EcgDiagnosticFlag || (exports.EcgDiagnosticFlag = EcgDiagnosticFlag = {}));
@@ -1,10 +1,19 @@
1
1
  import { MeasurementTypeKey } from "../MeasurementTypeKey";
2
2
  import { EcgDiagnosticFlag } from "./EcgDiagnosticFlag";
3
3
  import { Measurement } from "./Measurement";
4
+ /**
5
+ * ECG measurement.
6
+ *
7
+ * @category measurements
8
+ */
4
9
  export type EcgMeasurement = Measurement & {
10
+ /** Always `ecg`. */
5
11
  measurementTypeKey: MeasurementTypeKey.ecg;
12
+ /** Heart rate, in beats per minute. */
6
13
  heartRate?: number;
14
+ /** Waveform sample points. */
7
15
  diagramPoints?: number[];
16
+ /** Diagnostic result reported by the device. */
8
17
  diagnosticResult?: EcgDiagnosticFlag;
9
18
  /**
10
19
  * Duration of the ECG in seconds
@@ -1,6 +1,13 @@
1
1
  import { MeasurementTypeKey } from "../MeasurementTypeKey";
2
2
  import { Measurement } from "./Measurement";
3
+ /**
4
+ * Heart rate measurement.
5
+ *
6
+ * @category measurements
7
+ */
3
8
  export type HeartRateMeasurement = Measurement & {
9
+ /** Always `heartRate`. */
4
10
  measurementTypeKey: MeasurementTypeKey.heartRate;
11
+ /** Heart rate, in beats per minute. */
5
12
  heartRate?: number;
6
13
  };
@@ -1,6 +1,13 @@
1
1
  import { MeasurementTypeKey } from "../MeasurementTypeKey";
2
2
  import { Measurement } from "./Measurement";
3
+ /**
4
+ * Heart rate variability measurement.
5
+ *
6
+ * @category measurements
7
+ */
3
8
  export type HeartRateVariabilityMeasurement = Measurement & {
9
+ /** Always `heartRateVariability`. */
4
10
  measurementTypeKey: MeasurementTypeKey.heartRateVariability;
11
+ /** Heart rate variability value as reported by the device. */
5
12
  heartRateVariability?: number;
6
13
  };
@@ -1,11 +1,23 @@
1
1
  import { MeasurementTypeKey } from "../MeasurementTypeKey";
2
2
  import { Measurement } from "./Measurement";
3
+ /**
4
+ * Lipid panel measurement.
5
+ *
6
+ * @category measurements
7
+ */
3
8
  export type LipidPanelMeasurement = Measurement & {
9
+ /** Always `lipidPanel`. */
4
10
  measurementTypeKey: MeasurementTypeKey.lipidPanel;
11
+ /** Total cholesterol, in `unit`. */
5
12
  totalCholesterol?: number;
13
+ /** HDL cholesterol, in `unit`. */
6
14
  hdlCholesterol?: number;
15
+ /** LDL cholesterol, in `unit`. */
7
16
  ldlCholesterol?: number;
17
+ /** Triglycerides, in `unit`. */
8
18
  triglycerides?: number;
19
+ /** Ratio of total to HDL cholesterol. */
9
20
  totalCholesterolHdlRatio?: number;
21
+ /** Concentration unit of the lipid values. */
10
22
  unit: "mg/dL" | "mmol/L";
11
23
  };
@@ -1,8 +1,17 @@
1
1
  import { Reference } from "@medplum/fhirtypes";
2
2
  import { MeasurementTypeKey } from "../MeasurementTypeKey";
3
+ /**
4
+ * Fields shared by every measurement.
5
+ *
6
+ * @category measurements
7
+ */
3
8
  export type Measurement = {
9
+ /** Kind of measurement. */
4
10
  measurementTypeKey: MeasurementTypeKey;
11
+ /** Observation ID, when the measurement is stored. */
5
12
  id?: string;
13
+ /** Reference to the device that took the reading. */
6
14
  device?: Reference;
15
+ /** Time the reading was recorded. */
7
16
  recordedAt?: Date;
8
17
  };
@@ -6,13 +6,21 @@
6
6
  * platform (for example, a Bluetooth address on Android and a local UUID on iOS).
7
7
  * The manufacturer-reported serial number (`sn`) is used for that FHIR identifier
8
8
  * when available; otherwise, the identifier is omitted.
9
+ *
10
+ * @category measurements
9
11
  */
10
12
  export type MeasurementDevice = {
13
+ /** Advertised device name. */
11
14
  name: string;
15
+ /** Local name the device advertises. */
12
16
  localName: string;
17
+ /** Raw manufacturer data advertised by the device. */
13
18
  manufacturerData: string;
19
+ /** Manufacturer name reported by the device. */
14
20
  manufacturerName?: string;
21
+ /** Model reported by the device. */
15
22
  model?: string;
23
+ /** Manufacturer-reported serial number. */
16
24
  sn: string;
17
25
  /** Runtime association key; not written to the FHIR device identifier. */
18
26
  id: string;
@@ -22,7 +30,9 @@ export type MeasurementDevice = {
22
30
  * `model`, which often describe the Bluetooth module rather than the product.
23
31
  */
24
32
  variant?: {
33
+ /** Brand of the identified product. */
25
34
  manufacturer: string;
35
+ /** Model of the identified product. */
26
36
  model: string;
27
37
  };
28
38
  /**
@@ -2,8 +2,10 @@ import { MeasurementTypeKey } from "../MeasurementTypeKey";
2
2
  /**
3
3
  * One kind of measurement taken at a fixed interval, such as the heart rate a strap sends every second: one value
4
4
  * per slot for each measured property, and `null` for a slot nothing arrived in.
5
+ * @category measurements
5
6
  */
6
7
  export type MeasurementSeries = {
8
+ /** Kind of measurement the series holds. */
7
9
  measurementTypeKey: MeasurementTypeKey;
8
10
  /** When the first slot starts. */
9
11
  start: Date;
@@ -1,9 +1,19 @@
1
1
  import { MeasurementTypeKey } from "../MeasurementTypeKey";
2
2
  import { Measurement } from "./Measurement";
3
+ /**
4
+ * Pulse oximeter measurement.
5
+ *
6
+ * @category measurements
7
+ */
3
8
  export type PulseOximeterMeasurement = Measurement & {
9
+ /** Always `bloodOxygenPulseRate`. */
4
10
  measurementTypeKey: MeasurementTypeKey.bloodOxygenPulseRate;
11
+ /** Pulse rate, in beats per minute. */
5
12
  pulseRate?: number;
13
+ /** Interval between consecutive heartbeats. */
6
14
  rrInterval?: number;
15
+ /** Blood oxygen saturation (SpO2), in percent. */
7
16
  bloodOxygen?: number;
17
+ /** Perfusion index. */
8
18
  perfusionIndex?: number;
9
19
  };
@@ -1,6 +1,13 @@
1
1
  import { MeasurementTypeKey } from "../MeasurementTypeKey";
2
2
  import { Measurement } from "./Measurement";
3
+ /**
4
+ * Respiratory rate measurement.
5
+ *
6
+ * @category measurements
7
+ */
3
8
  export type RespiratoryRateMeasurement = Measurement & {
9
+ /** Always `respiratoryRate`. */
4
10
  measurementTypeKey: MeasurementTypeKey.respiratoryRate;
11
+ /** Respiratory rate, in breaths per minute. */
5
12
  respiratoryRate?: number;
6
13
  };
@@ -5,8 +5,11 @@ import { Measurement } from "./Measurement";
5
5
  * A coded set of respiratory-therapy observations. Keeping the values as FHIR components
6
6
  * lets devices and consuming applications add their own metrics without Core assigning
7
7
  * device-specific meaning to them.
8
+ * @category measurements
8
9
  */
9
10
  export type RespiratoryTherapyMeasurement = Measurement & {
11
+ /** Always `respiratoryTherapy`. */
10
12
  measurementTypeKey: MeasurementTypeKey.respiratoryTherapy;
13
+ /** Coded observation values. */
11
14
  components: ObservationComponent[];
12
15
  };
@@ -1,6 +1,13 @@
1
1
  import { MeasurementTypeKey } from "../MeasurementTypeKey";
2
2
  import { Measurement } from "./Measurement";
3
+ /**
4
+ * Resting heart rate measurement.
5
+ *
6
+ * @category measurements
7
+ */
3
8
  export type RestingHeartRateMeasurement = Measurement & {
9
+ /** Always `restingHeartRate`. */
4
10
  measurementTypeKey: MeasurementTypeKey.restingHeartRate;
11
+ /** Resting heart rate, in beats per minute. */
5
12
  restingHeartRate?: number;
6
13
  };
@@ -1,20 +1,43 @@
1
1
  import { CodeableConcept } from "@medplum/fhirtypes";
2
2
  import { Measurement } from "./Measurement";
3
+ /**
4
+ * Spirometry measurement.
5
+ *
6
+ * @category measurements
7
+ */
3
8
  export type SpirometryMeasurement = Measurement & {
9
+ /** Forced vital capacity. */
4
10
  fvc?: string;
11
+ /** Forced expiratory volume in 1 second. */
5
12
  fev1?: string;
13
+ /** Forced expiratory volume in 0.5 seconds. */
6
14
  "fev0.5"?: string;
15
+ /** FEV1 to FVC ratio. */
7
16
  "fev1/fvc"?: string;
17
+ /** Peak expiratory flow. */
8
18
  pef?: string;
19
+ /** Forced expiratory flow at 25% of FVC. */
9
20
  fef25?: string;
21
+ /** Forced expiratory flow at 50% of FVC. */
10
22
  fef50?: string;
23
+ /** Forced expiratory flow at 75% of FVC. */
11
24
  fef75?: string;
25
+ /** Forced expiratory flow between 25% and 75% of FVC. */
12
26
  fef2575?: string;
27
+ /** Coded spirometry values. */
13
28
  spirometryValues: SpirometerValue[];
14
29
  };
30
+ /**
31
+ * One coded spirometer value.
32
+ *
33
+ * @category measurements
34
+ */
15
35
  type SpirometerValue = {
36
+ /** Code identifying the value. */
16
37
  code: CodeableConcept;
38
+ /** The value. */
17
39
  value?: {
40
+ /** Value as a string. */
18
41
  string: string;
19
42
  };
20
43
  };
@@ -1,8 +1,17 @@
1
1
  import { MeasurementTypeKey } from "../MeasurementTypeKey";
2
2
  import { Measurement } from "./Measurement";
3
+ /**
4
+ * Step count measurement.
5
+ *
6
+ * @category measurements
7
+ */
3
8
  export type StepCountMeasurement = Measurement & {
9
+ /** Always `stepCount`. */
4
10
  measurementTypeKey: MeasurementTypeKey.stepCount;
11
+ /** Number of steps. */
5
12
  stepCount?: number;
13
+ /** Start of the counted period. */
6
14
  start?: Date;
15
+ /** End of the counted period. */
7
16
  end?: Date;
8
17
  };
@@ -1,29 +1,58 @@
1
1
  import { CodeableConcept } from "@medplum/fhirtypes";
2
2
  import { MeasurementTypeKey } from "../MeasurementTypeKey";
3
3
  import { Measurement } from "./Measurement";
4
+ /**
5
+ * Urine test strip measurement.
6
+ *
7
+ * @category measurements
8
+ */
4
9
  export type UrineAnalyzeMeasurement = Measurement & {
10
+ /** `urineAnalysis` or the deprecated `uricAcid`. */
5
11
  measurementTypeKey: MeasurementTypeKey.urineAnalysis | MeasurementTypeKey.uricAcid;
12
+ /** Urobilinogen. */
6
13
  uro?: number;
14
+ /** Bilirubin. */
7
15
  bil?: number;
16
+ /** Ketones. */
8
17
  ket?: number;
18
+ /** Glucose. */
9
19
  glu?: number;
20
+ /** Protein. */
10
21
  pro?: number;
22
+ /** Urine pH. */
11
23
  ph?: number;
24
+ /** Blood (hemoglobin). */
12
25
  bld?: number;
26
+ /** Nitrite. */
13
27
  nit?: number;
28
+ /** Leukocyte esterase. */
14
29
  leu?: number;
30
+ /** Specific gravity. */
15
31
  sg?: number;
32
+ /** Ascorbate (vitamin C). */
16
33
  vc?: number;
34
+ /** Microalbumin. */
17
35
  mal?: number;
36
+ /** Creatinine. */
18
37
  cr?: number;
38
+ /** Urate. */
19
39
  uca?: number;
40
+ /** Coded analyte values. */
20
41
  urineValues: UrineAnalysisValue[];
21
42
  /** Time at which the analyzer recorded the strip. */
22
43
  recordedAt?: Date;
23
44
  };
45
+ /**
46
+ * One coded urine analysis value.
47
+ *
48
+ * @category measurements
49
+ */
24
50
  type UrineAnalysisValue = {
51
+ /** Code identifying the value. */
25
52
  code: CodeableConcept;
53
+ /** The value. */
26
54
  value?: {
55
+ /** Value as a string. */
27
56
  string: string;
28
57
  };
29
58
  };
@@ -1,6 +1,13 @@
1
1
  import { MeasurementTypeKey } from "../MeasurementTypeKey";
2
2
  import { Measurement } from "./Measurement";
3
+ /**
4
+ * VO2 max measurement.
5
+ *
6
+ * @category measurements
7
+ */
3
8
  export type Vo2MaxMeasurement = Measurement & {
9
+ /** Always `vo2Max`. */
4
10
  measurementTypeKey: MeasurementTypeKey.vo2Max;
11
+ /** VO2 max value as reported by the device. */
5
12
  vo2Max?: number;
6
13
  };
@@ -1,6 +1,13 @@
1
1
  import { MeasurementTypeKey } from "../MeasurementTypeKey";
2
2
  import { Measurement } from "./Measurement";
3
+ /**
4
+ * Average walking heart rate measurement.
5
+ *
6
+ * @category measurements
7
+ */
3
8
  export type WalkingHeartRateAverageMeasurement = Measurement & {
9
+ /** Always `walkingHeartRateAverage`. */
4
10
  measurementTypeKey: MeasurementTypeKey.walkingHeartRateAverage;
11
+ /** Average heart rate while walking, in beats per minute. */
5
12
  walkingHeartRateAverage?: number;
6
13
  };
@@ -1,11 +1,15 @@
1
- /** One property of a measurement, as its Observation stores it. */
1
+ /**
2
+ * One property of a measurement, as its Observation stores it.
3
+ */
2
4
  export type MeasurementField = {
3
5
  /** The property on the measurement: `systolic`, `bloodGlucose`, … */
4
6
  key: string;
5
7
  /** The code (LOINC) of the Observation that carries it. */
6
8
  code: string;
9
+ /** Unit the value is stored in. */
7
10
  unit: string;
8
11
  /** The decimal places the SDK keeps when it writes the value. */
9
12
  decimals: number;
13
+ /** Display name of the Observation code. */
10
14
  display: string;
11
15
  };
@@ -9,7 +9,9 @@ type Value = Observation[Field];
9
9
  * @returns An object containing the field name and its value or null if none exist.
10
10
  */
11
11
  export declare function getObservationValueDisplay(observation: Observation): {
12
+ /** Name of the observation field holding the value. */
12
13
  field: Field;
14
+ /** The value held in `field`. */
13
15
  value: Value;
14
16
  } | null;
15
17
  export {};
@@ -1,38 +1,81 @@
1
1
  import { Bundle, BundleEntry, Observation } from "@medplum/fhirtypes";
2
2
  import type { IClientStorage, MedplumRequestOptions } from "@medplum/core";
3
+ /**
4
+ * Default client-storage key under which queued measurements are kept.
5
+ */
3
6
  export declare const OFFLINE_MEASUREMENT_QUEUE_STORAGE_KEY = "ovok.core.offline-measurements";
7
+ /**
8
+ * Identifier system that marks an Observation with its offline measurement id.
9
+ */
4
10
  declare const IDENTIFIER_SYSTEM = "https://api.ovok.com/fhir/StructureDefinition/offline-measurement-id";
11
+ /**
12
+ * Settings of the opt-in offline measurement queue.
13
+ */
5
14
  export type OfflineMeasurementQueueOptions = {
15
+ /** Turns the queue on; only `true` enables it. */
6
16
  enabled?: boolean;
17
+ /** Client-storage key for queued measurements; defaults to `OFFLINE_MEASUREMENT_QUEUE_STORAGE_KEY`. */
7
18
  storageKey?: string;
19
+ /** Delivery attempts before an item counts as exhausted; defaults to 8, minimum 1. */
8
20
  maxRetries?: number;
21
+ /** Wait in ms after the first failed attempt, doubled per attempt; defaults to 5000. */
9
22
  retryBackoffMs?: number;
23
+ /** Upper bound in ms for the wait between attempts; defaults to one hour. */
10
24
  maxRetryBackoffMs?: number;
11
25
  /** Returns the active account key. Queue items are delivered only to their owner. */
12
26
  getOwnerKey?: () => string | undefined;
13
27
  };
28
+ /**
29
+ * Options for a queue flush.
30
+ */
14
31
  export type OfflineMeasurementFlushOptions = {
32
+ /** Also retry items that ran out of attempts. */
15
33
  includeExhausted?: boolean;
34
+ /** Give exhausted items a fresh set of attempts, and retry them now. */
16
35
  resetExhausted?: boolean;
17
36
  };
37
+ /**
38
+ * Outcome of a queue flush.
39
+ */
18
40
  export type OfflineMeasurementFlushResult = {
41
+ /** Items sent in this flush. */
19
42
  attempted: number;
43
+ /** Items delivered and removed from the queue. */
20
44
  saved: number;
45
+ /** Items still waiting for a retry, or for their owner to sign in. */
21
46
  queued: number;
47
+ /** Items that ran out of attempts and stay in the queue. */
22
48
  exhausted: number;
49
+ /** Server response per delivered item, keyed by queue id. */
23
50
  responses: Record<string, Bundle>;
51
+ /** Last failure per item still queued, keyed by queue id. */
24
52
  failures: Record<string, OfflineMeasurementFailure>;
25
53
  };
54
+ /**
55
+ * Safe summary of a failed delivery; it never holds the message or payload.
56
+ */
26
57
  export type OfflineMeasurementFailure = {
58
+ /** Error name, `Error` when unknown. */
27
59
  name: string;
60
+ /** Error code, when the error had one. */
28
61
  code?: string;
62
+ /** HTTP status, when the error had one. */
29
63
  status?: number;
30
64
  };
31
65
  type MeasurementTransport = (bundle: Bundle, requestOptions?: MedplumRequestOptions) => Promise<Bundle>;
66
+ /**
67
+ * Deterministic UUID for an observation, ignoring its device-reading identifier.
68
+ *
69
+ * @param observation - Observation to derive the id from.
70
+ */
32
71
  declare const stableMeasurementId: (observation: Observation) => string;
33
- /** How a save names and writes each observation; `SaveObservationsOptions` describes both. */
72
+ /**
73
+ * How a save names and writes each observation; `SaveObservationsOptions` describes both.
74
+ */
34
75
  type ObservationEntryOptions = {
76
+ /** Identifier systems that name a reading, so a repeated save creates it once. */
35
77
  identifierSystems?: readonly string[];
78
+ /** Write over the observation saved under the same reading identifier instead of keeping it. */
36
79
  replace?: boolean;
37
80
  };
38
81
  /**
@@ -40,6 +83,10 @@ type ObservationEntryOptions = {
40
83
  * or one of its reading identifiers, or with `replace`, written over the one saved under its reading identifiers.
41
84
  */
42
85
  declare const entryForObservation: (observation: Observation, { identifierSystems, replace }?: ObservationEntryOptions) => BundleEntry<Observation>;
86
+ /**
87
+ * Durable queue that stores observation bundles in client storage and retries delivery with exponential backoff.
88
+ * Items are delivered only while their owner's account is the active one.
89
+ */
43
90
  export declare class OfflineMeasurementQueue {
44
91
  private readonly storage;
45
92
  private readonly transport;
@@ -50,10 +97,18 @@ export declare class OfflineMeasurementQueue {
50
97
  private readonly getOwnerKey?;
51
98
  private operation;
52
99
  constructor(storage: IClientStorage, transport: MeasurementTransport, options?: OfflineMeasurementQueueOptions);
100
+ /**
101
+ * Queues observations, then flushes the queue; an identical save is queued once.
102
+ *
103
+ * @throws Error when an owner key is configured but no account is active.
104
+ */
53
105
  enqueueAndFlush: (observations: Observation[], requestOptions?: MedplumRequestOptions, entryOptions?: ObservationEntryOptions) => Promise<{
106
+ /** Queue id of this save. */
54
107
  id: string;
108
+ /** Outcome of the flush that followed. */
55
109
  flush: OfflineMeasurementFlushResult;
56
110
  }>;
111
+ /** Retries the queued items that are due and resolves with the outcome. */
57
112
  flush: (options?: OfflineMeasurementFlushOptions, requestOptions?: MedplumRequestOptions) => Promise<OfflineMeasurementFlushResult>;
58
113
  private runExclusive;
59
114
  private readQueue;
@@ -3,11 +3,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.stableMeasurementId = exports.entryForObservation = exports.OFFLINE_MEASUREMENT_IDENTIFIER_SYSTEM = exports.DEFAULT_OFFLINE_MEASUREMENT_QUEUE_KEY = exports.OfflineMeasurementQueue = exports.OFFLINE_MEASUREMENT_QUEUE_STORAGE_KEY = void 0;
4
4
  const fhir_systems_1 = require("../observation/fhir-systems");
5
5
  const request_options_1 = require("../request-options");
6
+ /**
7
+ * Default client-storage key under which queued measurements are kept.
8
+ */
6
9
  exports.OFFLINE_MEASUREMENT_QUEUE_STORAGE_KEY = "ovok.core.offline-measurements";
7
10
  exports.DEFAULT_OFFLINE_MEASUREMENT_QUEUE_KEY = exports.OFFLINE_MEASUREMENT_QUEUE_STORAGE_KEY;
8
11
  const DEFAULT_MAX_RETRIES = 8;
9
12
  const DEFAULT_RETRY_BACKOFF_MS = 5000;
10
13
  const DEFAULT_MAX_RETRY_BACKOFF_MS = 60 * 60 * 1000;
14
+ /**
15
+ * Identifier system that marks an Observation with its offline measurement id.
16
+ */
11
17
  const IDENTIFIER_SYSTEM = "https://api.ovok.com/fhir/StructureDefinition/offline-measurement-id";
12
18
  exports.OFFLINE_MEASUREMENT_IDENTIFIER_SYSTEM = IDENTIFIER_SYSTEM;
13
19
  const canonicalize = (value) => {
@@ -46,6 +52,11 @@ const stableValueId = (input) => {
46
52
  hex[16] = ((Number.parseInt(hex[16], 16) & 0x3) | 0x8).toString(16);
47
53
  return `${hex.slice(0, 8).join("")}-${hex.slice(8, 12).join("")}-${hex.slice(12, 16).join("")}-${hex.slice(16, 20).join("")}-${hex.slice(20).join("")}`;
48
54
  };
55
+ /**
56
+ * Deterministic UUID for an observation, ignoring its device-reading identifier.
57
+ *
58
+ * @param observation - Observation to derive the id from.
59
+ */
49
60
  const stableMeasurementId = (observation) => {
50
61
  const identifiers = observation.identifier;
51
62
  if (!(identifiers === null || identifiers === void 0 ? void 0 : identifiers.some((identifier) => identifier.system === fhir_systems_1.DEVICE_READING_IDENTIFIER_SYSTEM))) {
@@ -140,12 +151,21 @@ const tally = (result, item) => {
140
151
  result.queued++;
141
152
  }
142
153
  };
154
+ /**
155
+ * Durable queue that stores observation bundles in client storage and retries delivery with exponential backoff.
156
+ * Items are delivered only while their owner's account is the active one.
157
+ */
143
158
  class OfflineMeasurementQueue {
144
159
  constructor(storage, transport, options = {}) {
145
160
  var _a, _b, _c, _d;
146
161
  this.storage = storage;
147
162
  this.transport = transport;
148
163
  this.operation = Promise.resolve();
164
+ /**
165
+ * Queues observations, then flushes the queue; an identical save is queued once.
166
+ *
167
+ * @throws Error when an owner key is configured but no account is active.
168
+ */
149
169
  this.enqueueAndFlush = (observations, requestOptions, entryOptions) => {
150
170
  var _a;
151
171
  const ownerKey = (_a = this.getOwnerKey) === null || _a === void 0 ? void 0 : _a.call(this);
@@ -172,6 +192,7 @@ class OfflineMeasurementQueue {
172
192
  return { id, flush: await this.flushQueue(queue, {}, ...(0, request_options_1.optionalArg)(requestOptions)) };
173
193
  });
174
194
  };
195
+ /** Retries the queued items that are due and resolves with the outcome. */
175
196
  this.flush = (options = {}, requestOptions) => this.runExclusive(async () => {
176
197
  var _a, _b;
177
198
  await ((_b = (_a = this.storage).getInitPromise) === null || _b === void 0 ? void 0 : _b.call(_a));
@@ -1,14 +1,29 @@
1
1
  import { Observation } from "@medplum/fhirtypes";
2
- /** Storage contract shared by native/background and React integrations. */
2
+ /**
3
+ * Storage contract shared by native/background and React integrations.
4
+ */
3
5
  export declare const OVOK_SHARED_MEASUREMENT_QUEUE_KEY = "@ovok/shared/measurements";
6
+ /**
7
+ * One queued item in the storage shared by native/background and React code.
8
+ */
4
9
  export type SharedMeasurementQueueEntry = {
10
+ /** Unique id of the entry. */
5
11
  id: string;
12
+ /** What the payload is: an observation or a Bluetooth result. */
6
13
  kind: "observation" | "bluetooth-result";
14
+ /** ISO 8601 time the entry was queued. */
7
15
  queuedAt: string;
16
+ /** Number of delivery attempts so far. */
8
17
  attempt: number;
18
+ /** The observation, or the raw Bluetooth result. */
9
19
  payload: Observation | Record<string, unknown>;
10
20
  };
21
+ /**
22
+ * Async key-value storage the shared queue is kept in.
23
+ */
11
24
  export interface SharedMeasurementQueueStorage {
25
+ /** Returns the stored value, or `null` when the key is absent. */
12
26
  getItem: (key: string) => Promise<string | null>;
27
+ /** Stores a value under a key. */
13
28
  setItem: (key: string, value: string) => Promise<void>;
14
29
  }