@ovok/core 0.4.49-dev.494 → 0.4.49-dev.496

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 (235) hide show
  1. package/dist/client/observation/measurement-fields.d.ts +1 -1
  2. package/dist/client/observation/methods/observationsToMeasurements.d.ts +1 -1
  3. package/dist/client/observation/methods/observationsToMeasurements.js +59 -59
  4. package/dist/client/observation/services/base-observation-service.d.ts +1 -1
  5. package/dist/client/observation/services/blood-oxygen.d.ts +1 -1
  6. package/dist/client/observation/services/blood-oxygen.js +7 -7
  7. package/dist/client/observation/services/blood-pressure.d.ts +1 -1
  8. package/dist/client/observation/services/blood-pressure.js +16 -16
  9. package/dist/client/observation/services/component-observation-services.d.ts +1 -1
  10. package/dist/client/observation/services/component-observation-services.js +3 -3
  11. package/dist/client/observation/services/creator.d.ts +1 -1
  12. package/dist/client/observation/services/creator.js +10 -10
  13. package/dist/client/observation/services/ecg-observation-fragments.d.ts +1 -1
  14. package/dist/client/observation/services/ecg.d.ts +1 -1
  15. package/dist/client/observation/services/ecg.js +10 -10
  16. package/dist/client/observation/services/lipid-panel.d.ts +1 -1
  17. package/dist/client/observation/services/lipid-panel.js +13 -13
  18. package/dist/client/observation/services/single-value-services.d.ts +1 -1
  19. package/dist/client/observation/services/single-value-services.js +19 -19
  20. package/dist/client/observation/services/step-count.d.ts +1 -1
  21. package/dist/client/observation/services/step-count.js +5 -5
  22. package/dist/client/observation/services/uric-acid-service.d.ts +1 -1
  23. package/dist/client/observation/services/uric-acid-service.js +7 -7
  24. package/dist/client/offline/offline-measurement-queue.d.ts +1 -2
  25. package/dist/client/wearables/types.d.ts +5 -0
  26. package/dist/conformance/capability-requirements.js +1 -1
  27. package/dist/next/auth/access-token.d.ts +9 -0
  28. package/dist/next/auth/access-token.js +18 -0
  29. package/dist/next/auth/client-credentials.d.ts +16 -0
  30. package/dist/next/auth/client-credentials.js +40 -0
  31. package/dist/next/auth/credentials.d.ts +5 -0
  32. package/dist/next/auth/credentials.js +7 -0
  33. package/dist/next/auth/session-store.d.ts +12 -0
  34. package/dist/next/auth/session-store.js +33 -0
  35. package/dist/next/auth/session.d.ts +28 -0
  36. package/dist/next/auth/session.js +27 -0
  37. package/dist/next/auth/token-endpoint.d.ts +12 -0
  38. package/dist/next/auth/token-endpoint.js +28 -0
  39. package/dist/next/auth/user-session.d.ts +27 -0
  40. package/dist/next/auth/user-session.js +82 -0
  41. package/dist/next/config/ovok-config.d.ts +42 -0
  42. package/dist/next/config/ovok-config.js +2 -0
  43. package/dist/next/config/settings.d.ts +6 -0
  44. package/dist/next/config/settings.js +74 -0
  45. package/dist/next/errors/error-from-response.d.ts +2 -0
  46. package/dist/next/errors/error-from-response.js +35 -0
  47. package/dist/next/errors/ovok-errors.d.ts +42 -0
  48. package/dist/next/errors/ovok-errors.js +74 -0
  49. package/dist/next/http/http-client.d.ts +35 -0
  50. package/dist/next/http/http-client.js +113 -0
  51. package/dist/next/http/retry-after.d.ts +1 -0
  52. package/dist/next/http/retry-after.js +16 -0
  53. package/dist/next/http/retry-policy.d.ts +13 -0
  54. package/dist/next/http/retry-policy.js +27 -0
  55. package/dist/next/http/transmit.d.ts +14 -0
  56. package/dist/next/http/transmit.js +57 -0
  57. package/dist/next/http/url.d.ts +6 -0
  58. package/dist/next/http/url.js +22 -0
  59. package/dist/next/index.d.ts +69 -0
  60. package/dist/next/index.js +33 -0
  61. package/dist/next/ovok.d.ts +52 -0
  62. package/dist/next/ovok.js +74 -0
  63. package/dist/next/paging/bundle-page.d.ts +4 -0
  64. package/dist/next/paging/bundle-page.js +25 -0
  65. package/dist/next/paging/cursor-pages.d.ts +7 -0
  66. package/dist/next/paging/cursor-pages.js +14 -0
  67. package/dist/next/paging/numbered-pages.d.ts +15 -0
  68. package/dist/next/paging/numbered-pages.js +20 -0
  69. package/dist/next/paging/page.d.ts +12 -0
  70. package/dist/next/paging/page.js +17 -0
  71. package/dist/next/resources/accounts/accounts-resource.d.ts +8 -0
  72. package/dist/next/resources/accounts/accounts-resource.js +13 -0
  73. package/dist/next/resources/ai/ai-chat-resource.d.ts +8 -0
  74. package/dist/next/resources/ai/ai-chat-resource.js +12 -0
  75. package/dist/next/resources/ai/ai-resource.d.ts +16 -0
  76. package/dist/next/resources/ai/ai-resource.js +19 -0
  77. package/dist/next/resources/ai/chat-messages-resource.d.ts +9 -0
  78. package/dist/next/resources/ai/chat-messages-resource.js +18 -0
  79. package/dist/next/resources/ai/chat-sessions-resource.d.ts +14 -0
  80. package/dist/next/resources/ai/chat-sessions-resource.js +23 -0
  81. package/dist/next/resources/auth/auth-sessions-resource.d.ts +13 -0
  82. package/dist/next/resources/auth/auth-sessions-resource.js +25 -0
  83. package/dist/next/resources/auth/registration.d.ts +35 -0
  84. package/dist/next/resources/auth/registration.js +24 -0
  85. package/dist/next/resources/auth/social-login.d.ts +8 -0
  86. package/dist/next/resources/auth/social-login.js +7 -0
  87. package/dist/next/resources/auth-resource.d.ts +63 -0
  88. package/dist/next/resources/auth-resource.js +119 -0
  89. package/dist/next/resources/bots/bots-resource.d.ts +10 -0
  90. package/dist/next/resources/bots/bots-resource.js +15 -0
  91. package/dist/next/resources/cms/cms-delivery.d.ts +22 -0
  92. package/dist/next/resources/cms/cms-delivery.js +36 -0
  93. package/dist/next/resources/cms/cms-documents-resource.d.ts +11 -0
  94. package/dist/next/resources/cms/cms-documents-resource.js +17 -0
  95. package/dist/next/resources/cms/cms-resource.d.ts +17 -0
  96. package/dist/next/resources/cms/cms-resource.js +38 -0
  97. package/dist/next/resources/cms/payload-pages.d.ts +6 -0
  98. package/dist/next/resources/cms/payload-pages.js +15 -0
  99. package/dist/next/resources/cms/release-notes-resource.d.ts +10 -0
  100. package/dist/next/resources/cms/release-notes-resource.js +15 -0
  101. package/dist/next/resources/cms/translation-tree.d.ts +3 -0
  102. package/dist/next/resources/cms/translation-tree.js +45 -0
  103. package/dist/next/resources/consent/consent-resource.d.ts +23 -0
  104. package/dist/next/resources/consent/consent-resource.js +43 -0
  105. package/dist/next/resources/content/content-resource.d.ts +19 -0
  106. package/dist/next/resources/content/content-resource.js +41 -0
  107. package/dist/next/resources/documents/documents-resource.d.ts +26 -0
  108. package/dist/next/resources/documents/documents-resource.js +41 -0
  109. package/dist/next/resources/email/email-resource.d.ts +6 -0
  110. package/dist/next/resources/email/email-resource.js +10 -0
  111. package/dist/next/resources/email/email-templates-resource.d.ts +8 -0
  112. package/dist/next/resources/email/email-templates-resource.js +13 -0
  113. package/dist/next/resources/fhir-resource.d.ts +28 -0
  114. package/dist/next/resources/fhir-resource.js +64 -0
  115. package/dist/next/resources/health-resource.d.ts +17 -0
  116. package/dist/next/resources/health-resource.js +14 -0
  117. package/dist/next/resources/invites/invite-flow-resource.d.ts +12 -0
  118. package/dist/next/resources/invites/invite-flow-resource.js +19 -0
  119. package/dist/next/resources/invites/invites-resource.d.ts +17 -0
  120. package/dist/next/resources/invites/invites-resource.js +14 -0
  121. package/dist/next/resources/localization/i18next-resource.d.ts +10 -0
  122. package/dist/next/resources/localization/i18next-resource.js +18 -0
  123. package/dist/next/resources/localization/locales-resource.d.ts +9 -0
  124. package/dist/next/resources/localization/locales-resource.js +16 -0
  125. package/dist/next/resources/localization/localizations-resource.d.ts +17 -0
  126. package/dist/next/resources/localization/localizations-resource.js +27 -0
  127. package/dist/next/resources/measurements/measurements-resource.d.ts +42 -0
  128. package/dist/next/resources/measurements/measurements-resource.js +77 -0
  129. package/dist/next/resources/measurements/observation-builder.d.ts +5 -0
  130. package/dist/next/resources/measurements/observation-builder.js +57 -0
  131. package/dist/next/resources/measurements/save-error.d.ts +5 -0
  132. package/dist/next/resources/measurements/save-error.js +18 -0
  133. package/dist/next/resources/measurements/signed-in-account.d.ts +11 -0
  134. package/dist/next/resources/measurements/signed-in-account.js +26 -0
  135. package/dist/next/resources/patient/fhir-records.d.ts +19 -0
  136. package/dist/next/resources/patient/fhir-records.js +33 -0
  137. package/dist/next/resources/patient/patient-resource.d.ts +21 -0
  138. package/dist/next/resources/patient/patient-resource.js +38 -0
  139. package/dist/next/resources/projects/project-features-resource.d.ts +9 -0
  140. package/dist/next/resources/projects/project-features-resource.js +17 -0
  141. package/dist/next/resources/projects/project-members-resource.d.ts +19 -0
  142. package/dist/next/resources/projects/project-members-resource.js +25 -0
  143. package/dist/next/resources/projects/project-settings-resource.d.ts +10 -0
  144. package/dist/next/resources/projects/project-settings-resource.js +21 -0
  145. package/dist/next/resources/projects/projects-resource.d.ts +20 -0
  146. package/dist/next/resources/projects/projects-resource.js +21 -0
  147. package/dist/next/resources/questionnaires/questionnaires-resource.d.ts +18 -0
  148. package/dist/next/resources/questionnaires/questionnaires-resource.js +36 -0
  149. package/dist/next/resources/sharing/sharing-invites-resource.d.ts +9 -0
  150. package/dist/next/resources/sharing/sharing-invites-resource.js +17 -0
  151. package/dist/next/resources/sharing/sharing-resource.d.ts +10 -0
  152. package/dist/next/resources/sharing/sharing-resource.js +14 -0
  153. package/dist/next/resources/sharing/sharing-settings-resource.d.ts +9 -0
  154. package/dist/next/resources/sharing/sharing-settings-resource.js +16 -0
  155. package/dist/next/resources/sharing/sharing-shares-resource.d.ts +9 -0
  156. package/dist/next/resources/sharing/sharing-shares-resource.js +27 -0
  157. package/dist/next/resources/signals/signals-gateway-resource.d.ts +14 -0
  158. package/dist/next/resources/signals/signals-gateway-resource.js +44 -0
  159. package/dist/next/resources/signals/signals-resource.d.ts +13 -0
  160. package/dist/next/resources/signals/signals-resource.js +19 -0
  161. package/dist/next/resources/signals/undeliverable-resource.d.ts +26 -0
  162. package/dist/next/resources/signals/undeliverable-resource.js +18 -0
  163. package/dist/next/resources/slim/live-reads.d.ts +12 -0
  164. package/dist/next/resources/slim/live-reads.js +76 -0
  165. package/dist/next/resources/slim/slim-alarms-resource.d.ts +13 -0
  166. package/dist/next/resources/slim/slim-alarms-resource.js +25 -0
  167. package/dist/next/resources/slim/slim-change-history-resource.d.ts +9 -0
  168. package/dist/next/resources/slim/slim-change-history-resource.js +19 -0
  169. package/dist/next/resources/slim/slim-child-projects-resource.d.ts +17 -0
  170. package/dist/next/resources/slim/slim-child-projects-resource.js +22 -0
  171. package/dist/next/resources/slim/slim-devices-resource.d.ts +28 -0
  172. package/dist/next/resources/slim/slim-devices-resource.js +80 -0
  173. package/dist/next/resources/slim/slim-exports-resource.d.ts +8 -0
  174. package/dist/next/resources/slim/slim-exports-resource.js +14 -0
  175. package/dist/next/resources/slim/slim-locations-resource.d.ts +14 -0
  176. package/dist/next/resources/slim/slim-locations-resource.js +30 -0
  177. package/dist/next/resources/slim/slim-medical-notifications-resource.d.ts +18 -0
  178. package/dist/next/resources/slim/slim-medical-notifications-resource.js +46 -0
  179. package/dist/next/resources/slim/slim-notification-notes-resource.d.ts +12 -0
  180. package/dist/next/resources/slim/slim-notification-notes-resource.js +34 -0
  181. package/dist/next/resources/slim/slim-notifications-resource.d.ts +19 -0
  182. package/dist/next/resources/slim/slim-notifications-resource.js +26 -0
  183. package/dist/next/resources/slim/slim-organizations-resource.d.ts +11 -0
  184. package/dist/next/resources/slim/slim-organizations-resource.js +25 -0
  185. package/dist/next/resources/slim/slim-out-of-bed-resource.d.ts +13 -0
  186. package/dist/next/resources/slim/slim-out-of-bed-resource.js +20 -0
  187. package/dist/next/resources/slim/slim-paths.d.ts +6 -0
  188. package/dist/next/resources/slim/slim-paths.js +9 -0
  189. package/dist/next/resources/slim/slim-patient-thresholds-resource.d.ts +10 -0
  190. package/dist/next/resources/slim/slim-patient-thresholds-resource.js +20 -0
  191. package/dist/next/resources/slim/slim-patients-resource.d.ts +20 -0
  192. package/dist/next/resources/slim/slim-patients-resource.js +39 -0
  193. package/dist/next/resources/slim/slim-policies-resource.d.ts +12 -0
  194. package/dist/next/resources/slim/slim-policies-resource.js +29 -0
  195. package/dist/next/resources/slim/slim-practitioners-resource.d.ts +8 -0
  196. package/dist/next/resources/slim/slim-practitioners-resource.js +14 -0
  197. package/dist/next/resources/slim/slim-projects-resource.d.ts +16 -0
  198. package/dist/next/resources/slim/slim-projects-resource.js +35 -0
  199. package/dist/next/resources/slim/slim-queries.d.ts +34 -0
  200. package/dist/next/resources/slim/slim-queries.js +2 -0
  201. package/dist/next/resources/slim/slim-resource.d.ts +38 -0
  202. package/dist/next/resources/slim/slim-resource.js +44 -0
  203. package/dist/next/resources/slim/slim-sleep-resource.d.ts +9 -0
  204. package/dist/next/resources/slim/slim-sleep-resource.js +15 -0
  205. package/dist/next/resources/slim/slim-thresholds-resource.d.ts +11 -0
  206. package/dist/next/resources/slim/slim-thresholds-resource.js +18 -0
  207. package/dist/next/resources/slim/slim-trends-resource.d.ts +11 -0
  208. package/dist/next/resources/slim/slim-trends-resource.js +19 -0
  209. package/dist/next/resources/slim/slim-users-resource.d.ts +11 -0
  210. package/dist/next/resources/slim/slim-users-resource.js +15 -0
  211. package/dist/next/resources/slim/slim-zones-resource.d.ts +12 -0
  212. package/dist/next/resources/slim/slim-zones-resource.js +24 -0
  213. package/dist/next/resources/video-calls/video-call-access-resource.d.ts +11 -0
  214. package/dist/next/resources/video-calls/video-call-access-resource.js +19 -0
  215. package/dist/next/resources/video-calls/video-call-appointments-resource.d.ts +10 -0
  216. package/dist/next/resources/video-calls/video-call-appointments-resource.js +21 -0
  217. package/dist/next/resources/video-calls/video-call-emails-resource.d.ts +10 -0
  218. package/dist/next/resources/video-calls/video-call-emails-resource.js +19 -0
  219. package/dist/next/resources/video-calls/video-calls-resource.d.ts +14 -0
  220. package/dist/next/resources/video-calls/video-calls-resource.js +20 -0
  221. package/dist/next/resources/wearables/wearable-connections-resource.d.ts +12 -0
  222. package/dist/next/resources/wearables/wearable-connections-resource.js +25 -0
  223. package/dist/next/resources/wearables/wearable-providers-resource.d.ts +12 -0
  224. package/dist/next/resources/wearables/wearable-providers-resource.js +27 -0
  225. package/dist/next/resources/wearables/wearables-resource.d.ts +8 -0
  226. package/dist/next/resources/wearables/wearables-resource.js +14 -0
  227. package/dist/next/storage/ovok-storage.d.ts +11 -0
  228. package/dist/next/storage/ovok-storage.js +19 -0
  229. package/dist/types/MeasurementTypes.d.ts +5 -0
  230. package/dist/types/MeasurementTypes.js +21 -0
  231. package/dist/types/index.d.ts +1 -5
  232. package/dist/types/index.js +1 -5
  233. package/next/index.d.ts +1 -0
  234. package/next/index.js +3 -0
  235. package/package.json +3 -2
@@ -1,4 +1,4 @@
1
- import { MeasurementTypeKey } from "../../types";
1
+ import { MeasurementTypeKey } from "../../types/MeasurementTypes";
2
2
  import { MeasurementField } from "./types/service/MeasurementField";
3
3
  /**
4
4
  * For each measurement type the SDK stores, its properties as their Observations store them: the
@@ -1,5 +1,5 @@
1
1
  import { Observation } from "@medplum/fhirtypes";
2
- import { BabySleepMeasurement, BloodGlucoseMeasurement, BloodPressureMeasurement, BodyTemperatureMeasurement, BodyWeightMeasurement, EcgMeasurement, HeartRateMeasurement, HeartRateVariabilityMeasurement, LipidPanelMeasurement, Measurement, MeasurementTypeKey, PulseOximeterMeasurement, RespiratoryRateMeasurement, RespiratoryTherapyMeasurement, RestingHeartRateMeasurement, StepCountMeasurement, UrineAnalyzeMeasurement, Vo2MaxMeasurement, WalkingHeartRateAverageMeasurement } from "../../../types";
2
+ import { BabySleepMeasurement, BloodGlucoseMeasurement, BloodPressureMeasurement, BodyTemperatureMeasurement, BodyWeightMeasurement, EcgMeasurement, HeartRateMeasurement, HeartRateVariabilityMeasurement, LipidPanelMeasurement, Measurement, MeasurementTypeKey, PulseOximeterMeasurement, RespiratoryRateMeasurement, RespiratoryTherapyMeasurement, RestingHeartRateMeasurement, StepCountMeasurement, UrineAnalyzeMeasurement, Vo2MaxMeasurement, WalkingHeartRateAverageMeasurement } from "../../../types/MeasurementTypes";
3
3
  export type SupportedMeasurement = BloodGlucoseMeasurement | BabySleepMeasurement | BloodPressureMeasurement | BodyTemperatureMeasurement | BodyWeightMeasurement | EcgMeasurement | HeartRateMeasurement | HeartRateVariabilityMeasurement | LipidPanelMeasurement | PulseOximeterMeasurement | RespiratoryRateMeasurement | RespiratoryTherapyMeasurement | RestingHeartRateMeasurement | StepCountMeasurement | UrineAnalyzeMeasurement | Vo2MaxMeasurement | WalkingHeartRateAverageMeasurement | Measurement;
4
4
  type SupportedType = Exclude<MeasurementTypeKey, MeasurementTypeKey.symptomQuestionnaire>;
5
5
  export type ObservationGrouping = "hasMember" | "time" | ((observation: Observation, index: number, observations: readonly Observation[]) => string);
@@ -2,7 +2,7 @@
2
2
  /* eslint-disable max-lines */
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.observationsToMeasurements = exports.observationCodesForTypes = void 0;
5
- const types_1 = require("../../../types");
5
+ const MeasurementTypes_1 = require("../../../types/MeasurementTypes");
6
6
  const fhir_systems_1 = require("../fhir-systems");
7
7
  const single_value_services_1 = require("../services/single-value-services");
8
8
  const DEFAULT_OBSERVATION_TIME_TOLERANCE_MS = 1000;
@@ -19,16 +19,16 @@ const irregularHeartbeatOf = (observations) => {
19
19
  var _a, _b, _c;
20
20
  const rhythm = observations.find((observation) => {
21
21
  var _a, _b;
22
- return (_b = (_a = observation.code) === null || _a === void 0 ? void 0 : _a.coding) === null || _b === void 0 ? void 0 : _b.some((coding) => coding.system === types_1.PulseRhythmCoding.system &&
23
- coding.code === types_1.PulseRhythmCoding.observation);
22
+ return (_b = (_a = observation.code) === null || _a === void 0 ? void 0 : _a.coding) === null || _b === void 0 ? void 0 : _b.some((coding) => coding.system === MeasurementTypes_1.PulseRhythmCoding.system &&
23
+ coding.code === MeasurementTypes_1.PulseRhythmCoding.observation);
24
24
  });
25
- const result = (_c = (_b = (_a = rhythm === null || rhythm === void 0 ? void 0 : rhythm.valueCodeableConcept) === null || _a === void 0 ? void 0 : _a.coding) === null || _b === void 0 ? void 0 : _b.find((coding) => coding.system === types_1.PulseRhythmCoding.system)) === null || _c === void 0 ? void 0 : _c.code;
26
- if (result === types_1.PulseRhythmCoding.irregular ||
27
- result === types_1.PulseRhythmCoding.irregularlyIrregular ||
28
- result === types_1.PulseRhythmCoding.regularlyIrregular) {
25
+ const result = (_c = (_b = (_a = rhythm === null || rhythm === void 0 ? void 0 : rhythm.valueCodeableConcept) === null || _a === void 0 ? void 0 : _a.coding) === null || _b === void 0 ? void 0 : _b.find((coding) => coding.system === MeasurementTypes_1.PulseRhythmCoding.system)) === null || _c === void 0 ? void 0 : _c.code;
26
+ if (result === MeasurementTypes_1.PulseRhythmCoding.irregular ||
27
+ result === MeasurementTypes_1.PulseRhythmCoding.irregularlyIrregular ||
28
+ result === MeasurementTypes_1.PulseRhythmCoding.regularlyIrregular) {
29
29
  return true;
30
30
  }
31
- return result === types_1.PulseRhythmCoding.regular ? false : undefined;
31
+ return result === MeasurementTypes_1.PulseRhythmCoding.regular ? false : undefined;
32
32
  };
33
33
  const recordedAtOf = (observation) => {
34
34
  var _a, _b;
@@ -53,14 +53,14 @@ const ecgGroupKey = (observation, observations) => {
53
53
  if (parent) {
54
54
  return groupKey(parent);
55
55
  }
56
- if (codeOf(observation) === types_1.ObservationCode.ECG) {
56
+ if (codeOf(observation) === MeasurementTypes_1.ObservationCode.ECG) {
57
57
  return groupKey(observation);
58
58
  }
59
59
  const recordedAt = recordedAtOf(observation);
60
60
  const root = observations.find((candidate) => {
61
61
  var _a;
62
62
  const start = (_a = candidate.effectivePeriod) === null || _a === void 0 ? void 0 : _a.start;
63
- return (codeOf(candidate) === types_1.ObservationCode.ECG &&
63
+ return (codeOf(candidate) === MeasurementTypes_1.ObservationCode.ECG &&
64
64
  start &&
65
65
  recordedAt &&
66
66
  new Date(start).toISOString().slice(0, 16) ===
@@ -206,11 +206,11 @@ const firstValue = (observations, code) => {
206
206
  return match ? valueOf(match) : undefined;
207
207
  };
208
208
  const LIPID_FIELDS = [
209
- { key: "totalCholesterol", codes: [types_1.ObservationCode.TOTAL_CHOLESTEROL_MASS, types_1.ObservationCode.TOTAL_CHOLESTEROL_MOLAR] },
210
- { key: "hdlCholesterol", codes: [types_1.ObservationCode.HDL_CHOLESTEROL_MASS, types_1.ObservationCode.HDL_CHOLESTEROL_MOLAR] },
211
- { key: "ldlCholesterol", codes: [types_1.ObservationCode.LDL_CHOLESTEROL_MASS, types_1.ObservationCode.LDL_CHOLESTEROL_MOLAR] },
212
- { key: "triglycerides", codes: [types_1.ObservationCode.TRIGLYCERIDES_MASS, types_1.ObservationCode.TRIGLYCERIDES_MOLAR] },
213
- { key: "totalCholesterolHdlRatio", codes: [types_1.ObservationCode.TOTAL_CHOLESTEROL_HDL_RATIO] },
209
+ { key: "totalCholesterol", codes: [MeasurementTypes_1.ObservationCode.TOTAL_CHOLESTEROL_MASS, MeasurementTypes_1.ObservationCode.TOTAL_CHOLESTEROL_MOLAR] },
210
+ { key: "hdlCholesterol", codes: [MeasurementTypes_1.ObservationCode.HDL_CHOLESTEROL_MASS, MeasurementTypes_1.ObservationCode.HDL_CHOLESTEROL_MOLAR] },
211
+ { key: "ldlCholesterol", codes: [MeasurementTypes_1.ObservationCode.LDL_CHOLESTEROL_MASS, MeasurementTypes_1.ObservationCode.LDL_CHOLESTEROL_MOLAR] },
212
+ { key: "triglycerides", codes: [MeasurementTypes_1.ObservationCode.TRIGLYCERIDES_MASS, MeasurementTypes_1.ObservationCode.TRIGLYCERIDES_MOLAR] },
213
+ { key: "totalCholesterolHdlRatio", codes: [MeasurementTypes_1.ObservationCode.TOTAL_CHOLESTEROL_HDL_RATIO] },
214
214
  ];
215
215
  const lipidValue = (observations, field) => {
216
216
  var _a, _b, _c;
@@ -224,16 +224,16 @@ const lipidValue = (observations, field) => {
224
224
  return undefined;
225
225
  };
226
226
  const MOLAR_LIPID_CODES = [
227
- types_1.ObservationCode.TOTAL_CHOLESTEROL_MOLAR,
228
- types_1.ObservationCode.HDL_CHOLESTEROL_MOLAR,
229
- types_1.ObservationCode.LDL_CHOLESTEROL_MOLAR,
230
- types_1.ObservationCode.TRIGLYCERIDES_MOLAR,
227
+ MeasurementTypes_1.ObservationCode.TOTAL_CHOLESTEROL_MOLAR,
228
+ MeasurementTypes_1.ObservationCode.HDL_CHOLESTEROL_MOLAR,
229
+ MeasurementTypes_1.ObservationCode.LDL_CHOLESTEROL_MOLAR,
230
+ MeasurementTypes_1.ObservationCode.TRIGLYCERIDES_MOLAR,
231
231
  ];
232
232
  const MASS_LIPID_CODES = [
233
- types_1.ObservationCode.TOTAL_CHOLESTEROL_MASS,
234
- types_1.ObservationCode.HDL_CHOLESTEROL_MASS,
235
- types_1.ObservationCode.LDL_CHOLESTEROL_MASS,
236
- types_1.ObservationCode.TRIGLYCERIDES_MASS,
233
+ MeasurementTypes_1.ObservationCode.TOTAL_CHOLESTEROL_MASS,
234
+ MeasurementTypes_1.ObservationCode.HDL_CHOLESTEROL_MASS,
235
+ MeasurementTypes_1.ObservationCode.LDL_CHOLESTEROL_MASS,
236
+ MeasurementTypes_1.ObservationCode.TRIGLYCERIDES_MASS,
237
237
  ];
238
238
  /** The unit a lipid code implies, else the quantity's own unit when it is a lipid unit. */
239
239
  const lipidUnitOf = (code, unit) => {
@@ -282,34 +282,34 @@ const inverseGroup = (type, observations) => {
282
282
  return { ...measurement, measurementTypeKey: type, [single.valueKey]: value(single.code) };
283
283
  }
284
284
  switch (type) {
285
- case types_1.MeasurementTypeKey.bloodPressure:
285
+ case MeasurementTypes_1.MeasurementTypeKey.bloodPressure:
286
286
  return {
287
287
  ...measurement,
288
288
  measurementTypeKey: type,
289
- systolic: value(types_1.ObservationCode.SYSTOLIC_BLOOD_PRESSURE),
290
- diastolic: value(types_1.ObservationCode.DIASTOLIC_BLOOD_PRESSURE),
291
- meanArterialPressure: value(types_1.ObservationCode.MEAN_BLOOD_PRESSURE),
292
- heartRate: value(types_1.ObservationCode.BLOOD_PRESSURE_HEART_RATE),
289
+ systolic: value(MeasurementTypes_1.ObservationCode.SYSTOLIC_BLOOD_PRESSURE),
290
+ diastolic: value(MeasurementTypes_1.ObservationCode.DIASTOLIC_BLOOD_PRESSURE),
291
+ meanArterialPressure: value(MeasurementTypes_1.ObservationCode.MEAN_BLOOD_PRESSURE),
292
+ heartRate: value(MeasurementTypes_1.ObservationCode.BLOOD_PRESSURE_HEART_RATE),
293
293
  irregularHeartbeat: irregularHeartbeatOf(observations),
294
294
  };
295
- case types_1.MeasurementTypeKey.bloodOxygenPulseRate:
295
+ case MeasurementTypes_1.MeasurementTypeKey.bloodOxygenPulseRate:
296
296
  return {
297
297
  ...measurement,
298
298
  measurementTypeKey: type,
299
- bloodOxygen: value(types_1.ObservationCode.OXYGEN_SATURATION),
300
- pulseRate: value(types_1.ObservationCode.OXYGEN_SATURATION_HEART_RATE),
299
+ bloodOxygen: value(MeasurementTypes_1.ObservationCode.OXYGEN_SATURATION),
300
+ pulseRate: value(MeasurementTypes_1.ObservationCode.OXYGEN_SATURATION_HEART_RATE),
301
301
  };
302
- case types_1.MeasurementTypeKey.stepCount:
302
+ case MeasurementTypes_1.MeasurementTypeKey.stepCount:
303
303
  return {
304
304
  ...measurement,
305
305
  measurementTypeKey: type,
306
- stepCount: value(types_1.ObservationCode.STEPS),
306
+ stepCount: value(MeasurementTypes_1.ObservationCode.STEPS),
307
307
  ...(((_a = first.effectivePeriod) === null || _a === void 0 ? void 0 : _a.start) ? { start: new Date(first.effectivePeriod.start) } : {}),
308
308
  ...(((_b = first.effectivePeriod) === null || _b === void 0 ? void 0 : _b.end) ? { end: new Date(first.effectivePeriod.end) } : {}),
309
309
  };
310
- case types_1.MeasurementTypeKey.ecg: {
310
+ case MeasurementTypes_1.MeasurementTypeKey.ecg: {
311
311
  const sampled = observations
312
- .filter((observation) => codeOf(observation) === types_1.ObservationCode.ECG)
312
+ .filter((observation) => codeOf(observation) === MeasurementTypes_1.ObservationCode.ECG)
313
313
  .sort((left, right) => { var _a, _b, _c, _d; return ((_b = (_a = left.effectivePeriod) === null || _a === void 0 ? void 0 : _a.start) !== null && _b !== void 0 ? _b : "").localeCompare((_d = (_c = right.effectivePeriod) === null || _c === void 0 ? void 0 : _c.start) !== null && _d !== void 0 ? _d : ""); });
314
314
  const points = sampled.flatMap((observation) => {
315
315
  var _a;
@@ -327,14 +327,14 @@ const inverseGroup = (type, observations) => {
327
327
  ...measurement,
328
328
  measurementTypeKey: type,
329
329
  diagramPoints: points,
330
- heartRate: (_e = value(types_1.ObservationCode.ECG_HEART_RATE)) !== null && _e !== void 0 ? _e : value(types_1.ObservationCode.HEART_RATE),
330
+ heartRate: (_e = value(MeasurementTypes_1.ObservationCode.ECG_HEART_RATE)) !== null && _e !== void 0 ? _e : value(MeasurementTypes_1.ObservationCode.HEART_RATE),
331
331
  ...(diagnosticResult ? { diagnosticResult } : {}),
332
332
  ...(duration > 0 ? { duration } : {}),
333
333
  };
334
334
  }
335
- case types_1.MeasurementTypeKey.urineAnalysis:
336
- case types_1.MeasurementTypeKey.uricAcid: {
337
- const analyteByCode = Object.fromEntries(types_1.URINE_ANALYTE_DEFINITIONS.map((analyte) => [analyte.code, analyte.key]));
335
+ case MeasurementTypes_1.MeasurementTypeKey.urineAnalysis:
336
+ case MeasurementTypes_1.MeasurementTypeKey.uricAcid: {
337
+ const analyteByCode = Object.fromEntries(MeasurementTypes_1.URINE_ANALYTE_DEFINITIONS.map((analyte) => [analyte.code, analyte.key]));
338
338
  const result = {
339
339
  ...measurement,
340
340
  measurementTypeKey: type,
@@ -354,7 +354,7 @@ const inverseGroup = (type, observations) => {
354
354
  }
355
355
  return result;
356
356
  }
357
- case types_1.MeasurementTypeKey.lipidPanel:
357
+ case MeasurementTypes_1.MeasurementTypeKey.lipidPanel:
358
358
  return {
359
359
  ...measurement,
360
360
  measurementTypeKey: type,
@@ -364,8 +364,8 @@ const inverseGroup = (type, observations) => {
364
364
  return value === undefined ? [] : [[key, value]];
365
365
  })),
366
366
  };
367
- case types_1.MeasurementTypeKey.respiratoryTherapy:
368
- case types_1.MeasurementTypeKey.babySleep:
367
+ case MeasurementTypes_1.MeasurementTypeKey.respiratoryTherapy:
368
+ case MeasurementTypes_1.MeasurementTypeKey.babySleep:
369
369
  return {
370
370
  ...measurement,
371
371
  measurementTypeKey: type,
@@ -375,27 +375,27 @@ const inverseGroup = (type, observations) => {
375
375
  return measurement;
376
376
  }
377
377
  };
378
- const COMPONENT_TYPES = new Set([types_1.MeasurementTypeKey.respiratoryTherapy, types_1.MeasurementTypeKey.babySleep]);
378
+ const COMPONENT_TYPES = new Set([MeasurementTypes_1.MeasurementTypeKey.respiratoryTherapy, MeasurementTypes_1.MeasurementTypeKey.babySleep]);
379
379
  const codesForType = {
380
380
  ...Object.fromEntries([...single_value_services_1.singleValueFields].map(([type, { code }]) => [type, [code]])),
381
- [types_1.MeasurementTypeKey.bloodPressure]: [types_1.ObservationCode.SYSTOLIC_BLOOD_PRESSURE, types_1.ObservationCode.DIASTOLIC_BLOOD_PRESSURE, types_1.ObservationCode.MEAN_BLOOD_PRESSURE, types_1.ObservationCode.BLOOD_PRESSURE_HEART_RATE, types_1.PulseRhythmCoding.observation],
382
- [types_1.MeasurementTypeKey.bloodOxygenPulseRate]: [types_1.ObservationCode.OXYGEN_SATURATION, types_1.ObservationCode.OXYGEN_SATURATION_HEART_RATE],
383
- [types_1.MeasurementTypeKey.stepCount]: [types_1.ObservationCode.STEPS],
384
- [types_1.MeasurementTypeKey.ecg]: [types_1.ObservationCode.ECG, types_1.ObservationCode.ECG_HEART_RATE, types_1.ObservationCode.HEART_RATE],
385
- [types_1.MeasurementTypeKey.uricAcid]: [
386
- types_1.ObservationCode.URIC_ACID,
387
- ...types_1.URINE_ANALYTE_DEFINITIONS.map((analyte) => analyte.code),
381
+ [MeasurementTypes_1.MeasurementTypeKey.bloodPressure]: [MeasurementTypes_1.ObservationCode.SYSTOLIC_BLOOD_PRESSURE, MeasurementTypes_1.ObservationCode.DIASTOLIC_BLOOD_PRESSURE, MeasurementTypes_1.ObservationCode.MEAN_BLOOD_PRESSURE, MeasurementTypes_1.ObservationCode.BLOOD_PRESSURE_HEART_RATE, MeasurementTypes_1.PulseRhythmCoding.observation],
382
+ [MeasurementTypes_1.MeasurementTypeKey.bloodOxygenPulseRate]: [MeasurementTypes_1.ObservationCode.OXYGEN_SATURATION, MeasurementTypes_1.ObservationCode.OXYGEN_SATURATION_HEART_RATE],
383
+ [MeasurementTypes_1.MeasurementTypeKey.stepCount]: [MeasurementTypes_1.ObservationCode.STEPS],
384
+ [MeasurementTypes_1.MeasurementTypeKey.ecg]: [MeasurementTypes_1.ObservationCode.ECG, MeasurementTypes_1.ObservationCode.ECG_HEART_RATE, MeasurementTypes_1.ObservationCode.HEART_RATE],
385
+ [MeasurementTypes_1.MeasurementTypeKey.uricAcid]: [
386
+ MeasurementTypes_1.ObservationCode.URIC_ACID,
387
+ ...MeasurementTypes_1.URINE_ANALYTE_DEFINITIONS.map((analyte) => analyte.code),
388
388
  ],
389
- [types_1.MeasurementTypeKey.urineAnalysis]: [
390
- types_1.ObservationCode.URIC_ACID,
391
- ...types_1.URINE_ANALYTE_DEFINITIONS.map((analyte) => analyte.code),
389
+ [MeasurementTypes_1.MeasurementTypeKey.urineAnalysis]: [
390
+ MeasurementTypes_1.ObservationCode.URIC_ACID,
391
+ ...MeasurementTypes_1.URINE_ANALYTE_DEFINITIONS.map((analyte) => analyte.code),
392
392
  ],
393
- [types_1.MeasurementTypeKey.lipidPanel]: [
394
- types_1.ObservationCode.LIPID_PANEL,
393
+ [MeasurementTypes_1.MeasurementTypeKey.lipidPanel]: [
394
+ MeasurementTypes_1.ObservationCode.LIPID_PANEL,
395
395
  ...LIPID_FIELDS.flatMap(({ codes }) => codes),
396
396
  ],
397
- [types_1.MeasurementTypeKey.respiratoryTherapy]: [types_1.ObservationCode.RESPIRATORY_THERAPY],
398
- [types_1.MeasurementTypeKey.babySleep]: [types_1.ObservationCode.BABY_SLEEP],
397
+ [MeasurementTypes_1.MeasurementTypeKey.respiratoryTherapy]: [MeasurementTypes_1.ObservationCode.RESPIRATORY_THERAPY],
398
+ [MeasurementTypes_1.MeasurementTypeKey.babySleep]: [MeasurementTypes_1.ObservationCode.BABY_SLEEP],
399
399
  };
400
400
  const observationCodesForTypes = (types) => [...new Set(types.flatMap((type) => { var _a; return (_a = codesForType[type]) !== null && _a !== void 0 ? _a : []; }))].join(",");
401
401
  exports.observationCodesForTypes = observationCodesForTypes;
@@ -406,11 +406,11 @@ const observationsToMeasurements = (observations, types, options = {}) => {
406
406
  var _a;
407
407
  const codes = (_a = codesForType[type]) !== null && _a !== void 0 ? _a : [];
408
408
  const matching = observations.filter((observation) => { var _a; return codes.includes((_a = codeOf(observation)) !== null && _a !== void 0 ? _a : ""); });
409
- const groups = groupObservations(matching, options, type === types_1.MeasurementTypeKey.ecg
409
+ const groups = groupObservations(matching, options, type === MeasurementTypes_1.MeasurementTypeKey.ecg
410
410
  ? (observation, index) => ecgGroupKey(observation, matching) || `ecg:${index}`
411
411
  : undefined);
412
412
  groups.forEach((group) => {
413
- if (type === types_1.MeasurementTypeKey.lipidPanel &&
413
+ if (type === MeasurementTypes_1.MeasurementTypeKey.lipidPanel &&
414
414
  !LIPID_FIELDS.some((field) => lipidValue(group.observations, field) !== undefined)) {
415
415
  return;
416
416
  }
@@ -1,5 +1,5 @@
1
1
  import { CodeableConcept, Observation } from "@medplum/fhirtypes";
2
- import { MeasurementTypeKey } from "../../../types";
2
+ import { MeasurementTypeKey } from "../../../types/MeasurementTypes";
3
3
  import { RecordResult, RecordType } from "../types/generate-measurement/HealthConnectTypes";
4
4
  import { Sample } from "../types/generate-measurement/Sample";
5
5
  import { ObservationValue } from "../types/generate-observation-body/ObservationValue";
@@ -1,4 +1,4 @@
1
- import { Measurement, MeasurementTypeKey } from "../../../types";
1
+ import { Measurement, MeasurementTypeKey } from "../../../types/MeasurementTypes";
2
2
  import { RecordResult, RecordType } from "../types/generate-measurement/HealthConnectTypes";
3
3
  import { Sample } from "../types/generate-measurement/Sample";
4
4
  import { PulseOximeterMeasurement } from "../types/measurement/PulseOximeterMeasurement";
@@ -1,16 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.BloodOxygenService = void 0;
4
- const types_1 = require("../../../types");
4
+ const MeasurementTypes_1 = require("../../../types/MeasurementTypes");
5
5
  const base_observation_service_1 = require("./base-observation-service");
6
6
  class BloodOxygenService extends base_observation_service_1.BaseObservationService {
7
7
  constructor() {
8
8
  super(...arguments);
9
- this.measurementTypeKey = types_1.MeasurementTypeKey.bloodOxygenPulseRate;
9
+ this.measurementTypeKey = MeasurementTypes_1.MeasurementTypeKey.bloodOxygenPulseRate;
10
10
  this.measurementTypeName = "blood oxygen";
11
11
  this.observationMetadata = [
12
12
  {
13
- primaryCode: types_1.ObservationCode.OXYGEN_SATURATION,
13
+ primaryCode: MeasurementTypes_1.ObservationCode.OXYGEN_SATURATION,
14
14
  additionalCodes: [],
15
15
  display: "Oxygen Saturation",
16
16
  unit: "%",
@@ -18,8 +18,8 @@ class BloodOxygenService extends base_observation_service_1.BaseObservationServi
18
18
  toFixed: 0,
19
19
  },
20
20
  {
21
- primaryCode: types_1.ObservationCode.OXYGEN_SATURATION_HEART_RATE,
22
- additionalCodes: [types_1.ObservationCode.HEART_RATE],
21
+ primaryCode: MeasurementTypes_1.ObservationCode.OXYGEN_SATURATION_HEART_RATE,
22
+ additionalCodes: [MeasurementTypes_1.ObservationCode.HEART_RATE],
23
23
  display: "Heart Rate",
24
24
  unit: "bpm",
25
25
  valueKey: "pulseRate",
@@ -42,7 +42,7 @@ class BloodOxygenService extends base_observation_service_1.BaseObservationServi
42
42
  return {
43
43
  pulseRate,
44
44
  bloodOxygen,
45
- measurementTypeKey: types_1.MeasurementTypeKey.bloodOxygenPulseRate,
45
+ measurementTypeKey: MeasurementTypes_1.MeasurementTypeKey.bloodOxygenPulseRate,
46
46
  };
47
47
  }
48
48
  convertRecordToMeasurement(record) {
@@ -50,7 +50,7 @@ class BloodOxygenService extends base_observation_service_1.BaseObservationServi
50
50
  return {
51
51
  pulseRate: 0,
52
52
  bloodOxygen: pulseOximeterRecord.percentage,
53
- measurementTypeKey: types_1.MeasurementTypeKey.bloodOxygenPulseRate,
53
+ measurementTypeKey: MeasurementTypes_1.MeasurementTypeKey.bloodOxygenPulseRate,
54
54
  };
55
55
  }
56
56
  }
@@ -1,5 +1,5 @@
1
1
  import { CodeableConcept, Observation } from "@medplum/fhirtypes";
2
- import { BloodPressureMeasurement, Measurement, MeasurementTypeKey } from "../../../types";
2
+ import { BloodPressureMeasurement, Measurement, MeasurementTypeKey } from "../../../types/MeasurementTypes";
3
3
  import { RecordResult, RecordType } from "../types/generate-measurement/HealthConnectTypes";
4
4
  import { Sample } from "../types/generate-measurement/Sample";
5
5
  import { ObservationValue } from "../types/generate-observation-body/ObservationValue";
@@ -1,16 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.BloodPressureService = void 0;
4
- const types_1 = require("../../../types");
4
+ const MeasurementTypes_1 = require("../../../types/MeasurementTypes");
5
5
  const base_observation_service_1 = require("./base-observation-service");
6
6
  class BloodPressureService extends base_observation_service_1.BaseObservationService {
7
7
  constructor() {
8
8
  super(...arguments);
9
- this.measurementTypeKey = types_1.MeasurementTypeKey.bloodPressure;
9
+ this.measurementTypeKey = MeasurementTypes_1.MeasurementTypeKey.bloodPressure;
10
10
  this.measurementTypeName = "blood pressure";
11
11
  this.observationMetadata = [
12
12
  {
13
- primaryCode: types_1.ObservationCode.SYSTOLIC_BLOOD_PRESSURE,
13
+ primaryCode: MeasurementTypes_1.ObservationCode.SYSTOLIC_BLOOD_PRESSURE,
14
14
  additionalCodes: [],
15
15
  display: "Systolic Blood Pressure",
16
16
  unit: "mmHg",
@@ -18,7 +18,7 @@ class BloodPressureService extends base_observation_service_1.BaseObservationSer
18
18
  toFixed: 0,
19
19
  },
20
20
  {
21
- primaryCode: types_1.ObservationCode.DIASTOLIC_BLOOD_PRESSURE,
21
+ primaryCode: MeasurementTypes_1.ObservationCode.DIASTOLIC_BLOOD_PRESSURE,
22
22
  additionalCodes: [],
23
23
  display: "Diastolic Blood Pressure",
24
24
  unit: "mmHg",
@@ -26,7 +26,7 @@ class BloodPressureService extends base_observation_service_1.BaseObservationSer
26
26
  toFixed: 0,
27
27
  },
28
28
  {
29
- primaryCode: types_1.ObservationCode.MEAN_BLOOD_PRESSURE,
29
+ primaryCode: MeasurementTypes_1.ObservationCode.MEAN_BLOOD_PRESSURE,
30
30
  additionalCodes: [],
31
31
  display: "Mean Arterial Pressure",
32
32
  unit: "mmHg",
@@ -34,8 +34,8 @@ class BloodPressureService extends base_observation_service_1.BaseObservationSer
34
34
  toFixed: 0,
35
35
  },
36
36
  {
37
- primaryCode: types_1.ObservationCode.BLOOD_PRESSURE_HEART_RATE,
38
- additionalCodes: [types_1.ObservationCode.HEART_RATE],
37
+ primaryCode: MeasurementTypes_1.ObservationCode.BLOOD_PRESSURE_HEART_RATE,
38
+ additionalCodes: [MeasurementTypes_1.ObservationCode.HEART_RATE],
39
39
  display: "Blood Pressure Heart Rate",
40
40
  unit: "bpm",
41
41
  valueKey: "heartRate",
@@ -48,9 +48,9 @@ class BloodPressureService extends base_observation_service_1.BaseObservationSer
48
48
  ...super.getObservationCodes(),
49
49
  {
50
50
  coding: [{
51
- code: types_1.PulseRhythmCoding.observation,
51
+ code: MeasurementTypes_1.PulseRhythmCoding.observation,
52
52
  display: "Pulse rhythm",
53
- system: types_1.PulseRhythmCoding.system,
53
+ system: MeasurementTypes_1.PulseRhythmCoding.system,
54
54
  }],
55
55
  text: "Pulse rhythm",
56
56
  },
@@ -61,8 +61,8 @@ class BloodPressureService extends base_observation_service_1.BaseObservationSer
61
61
  const rhythmCode = castedMeasurement.irregularHeartbeat === undefined
62
62
  ? undefined
63
63
  : castedMeasurement.irregularHeartbeat
64
- ? types_1.PulseRhythmCoding.irregular
65
- : types_1.PulseRhythmCoding.regular;
64
+ ? MeasurementTypes_1.PulseRhythmCoding.irregular
65
+ : MeasurementTypes_1.PulseRhythmCoding.regular;
66
66
  return [
67
67
  ...super.generateValues(measurement),
68
68
  rhythmCode
@@ -70,7 +70,7 @@ class BloodPressureService extends base_observation_service_1.BaseObservationSer
70
70
  valueCodeableConcept: {
71
71
  coding: [{
72
72
  code: rhythmCode,
73
- system: types_1.PulseRhythmCoding.system,
73
+ system: MeasurementTypes_1.PulseRhythmCoding.system,
74
74
  }],
75
75
  },
76
76
  }
@@ -91,8 +91,8 @@ class BloodPressureService extends base_observation_service_1.BaseObservationSer
91
91
  }
92
92
  getObservationDisplay(observations) {
93
93
  var _a, _b, _c, _d;
94
- const systolic = (_b = (_a = observations === null || observations === void 0 ? void 0 : observations.find((x) => { var _a, _b, _c; return ((_c = (_b = (_a = x.code) === null || _a === void 0 ? void 0 : _a.coding) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.code) === types_1.ObservationCode.SYSTOLIC_BLOOD_PRESSURE; })) === null || _a === void 0 ? void 0 : _a.valueQuantity) === null || _b === void 0 ? void 0 : _b.value;
95
- const diastolic = (_d = (_c = observations === null || observations === void 0 ? void 0 : observations.find((x) => { var _a, _b, _c; return ((_c = (_b = (_a = x.code) === null || _a === void 0 ? void 0 : _a.coding) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.code) === types_1.ObservationCode.DIASTOLIC_BLOOD_PRESSURE; })) === null || _c === void 0 ? void 0 : _c.valueQuantity) === null || _d === void 0 ? void 0 : _d.value;
94
+ const systolic = (_b = (_a = observations === null || observations === void 0 ? void 0 : observations.find((x) => { var _a, _b, _c; return ((_c = (_b = (_a = x.code) === null || _a === void 0 ? void 0 : _a.coding) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.code) === MeasurementTypes_1.ObservationCode.SYSTOLIC_BLOOD_PRESSURE; })) === null || _a === void 0 ? void 0 : _a.valueQuantity) === null || _b === void 0 ? void 0 : _b.value;
95
+ const diastolic = (_d = (_c = observations === null || observations === void 0 ? void 0 : observations.find((x) => { var _a, _b, _c; return ((_c = (_b = (_a = x.code) === null || _a === void 0 ? void 0 : _a.coding) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.code) === MeasurementTypes_1.ObservationCode.DIASTOLIC_BLOOD_PRESSURE; })) === null || _c === void 0 ? void 0 : _c.valueQuantity) === null || _d === void 0 ? void 0 : _d.value;
96
96
  if (!systolic || !diastolic) {
97
97
  return undefined;
98
98
  }
@@ -104,7 +104,7 @@ class BloodPressureService extends base_observation_service_1.BaseObservationSer
104
104
  return {
105
105
  systolic: systolic === null || systolic === void 0 ? void 0 : systolic.quantity,
106
106
  diastolic: diastolic === null || diastolic === void 0 ? void 0 : diastolic.quantity,
107
- measurementTypeKey: types_1.MeasurementTypeKey.bloodPressure,
107
+ measurementTypeKey: MeasurementTypes_1.MeasurementTypeKey.bloodPressure,
108
108
  };
109
109
  }
110
110
  convertRecordToMeasurement(record) {
@@ -112,7 +112,7 @@ class BloodPressureService extends base_observation_service_1.BaseObservationSer
112
112
  return {
113
113
  systolic: bloodPressureRecord.systolic.inMillimetersOfMercury,
114
114
  diastolic: bloodPressureRecord.diastolic.inMillimetersOfMercury,
115
- measurementTypeKey: types_1.MeasurementTypeKey.bloodPressure,
115
+ measurementTypeKey: MeasurementTypes_1.MeasurementTypeKey.bloodPressure,
116
116
  };
117
117
  }
118
118
  }
@@ -1,5 +1,5 @@
1
1
  import { CodeableConcept, Observation, ObservationComponent } from "@medplum/fhirtypes";
2
- import { Measurement, MeasurementTypeKey, ObservationCode } from "../../../types";
2
+ import { Measurement, MeasurementTypeKey, ObservationCode } from "../../../types/MeasurementTypes";
3
3
  import { RecordResult, RecordType } from "../types/generate-measurement/HealthConnectTypes";
4
4
  import { Sample } from "../types/generate-measurement/Sample";
5
5
  import { ObservationFragment } from "../types/generate-observation-body/ObservationFragment";
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.respiratoryTherapyService = exports.babySleepService = void 0;
4
- const types_1 = require("../../../types");
4
+ const MeasurementTypes_1 = require("../../../types/MeasurementTypes");
5
5
  const base_observation_service_1 = require("./base-observation-service");
6
6
  const measurement_time_1 = require("./measurement-time");
7
7
  const MEASUREMENT_TYPE_SYSTEM = "https://sdk.ovok.com/fhir/CodeSystem/measurement-type";
@@ -63,7 +63,7 @@ class ComponentObservationService extends base_observation_service_1.BaseObserva
63
63
  };
64
64
  }
65
65
  }
66
- const babySleepService = () => new ComponentObservationService(types_1.MeasurementTypeKey.babySleep, "baby sleep", types_1.ObservationCode.BABY_SLEEP);
66
+ const babySleepService = () => new ComponentObservationService(MeasurementTypes_1.MeasurementTypeKey.babySleep, "baby sleep", MeasurementTypes_1.ObservationCode.BABY_SLEEP);
67
67
  exports.babySleepService = babySleepService;
68
- const respiratoryTherapyService = () => new ComponentObservationService(types_1.MeasurementTypeKey.respiratoryTherapy, "respiratory therapy", types_1.ObservationCode.RESPIRATORY_THERAPY);
68
+ const respiratoryTherapyService = () => new ComponentObservationService(MeasurementTypes_1.MeasurementTypeKey.respiratoryTherapy, "respiratory therapy", MeasurementTypes_1.ObservationCode.RESPIRATORY_THERAPY);
69
69
  exports.respiratoryTherapyService = respiratoryTherapyService;
@@ -1,4 +1,4 @@
1
- import { MeasurementTypeKey } from "../../../types";
1
+ import { MeasurementTypeKey } from "../../../types/MeasurementTypes";
2
2
  import { IObservationService } from "../types/IObservationService";
3
3
  export declare class ObservationServiceCreator {
4
4
  private static instance;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ObservationServiceCreator = void 0;
4
- const types_1 = require("../../../types");
4
+ const MeasurementTypes_1 = require("../../../types/MeasurementTypes");
5
5
  const blood_oxygen_1 = require("./blood-oxygen");
6
6
  const blood_pressure_1 = require("./blood-pressure");
7
7
  const component_observation_services_1 = require("./component-observation-services");
@@ -15,15 +15,15 @@ class ObservationServiceCreator {
15
15
  const uricAcid = new uric_acid_service_1.UricAcidService();
16
16
  this.services = new Map([
17
17
  ...(0, single_value_services_1.singleValueObservationServices)(),
18
- [types_1.MeasurementTypeKey.bloodPressure, new blood_pressure_1.BloodPressureService()],
19
- [types_1.MeasurementTypeKey.bloodOxygenPulseRate, new blood_oxygen_1.BloodOxygenService()],
20
- [types_1.MeasurementTypeKey.ecg, new ecg_1.EcgService()],
21
- [types_1.MeasurementTypeKey.stepCount, new step_count_1.StepCountService()],
22
- [types_1.MeasurementTypeKey.urineAnalysis, uricAcid],
23
- [types_1.MeasurementTypeKey.uricAcid, uricAcid],
24
- [types_1.MeasurementTypeKey.lipidPanel, new lipid_panel_1.LipidPanelService()],
25
- [types_1.MeasurementTypeKey.respiratoryTherapy, (0, component_observation_services_1.respiratoryTherapyService)()],
26
- [types_1.MeasurementTypeKey.babySleep, (0, component_observation_services_1.babySleepService)()],
18
+ [MeasurementTypes_1.MeasurementTypeKey.bloodPressure, new blood_pressure_1.BloodPressureService()],
19
+ [MeasurementTypes_1.MeasurementTypeKey.bloodOxygenPulseRate, new blood_oxygen_1.BloodOxygenService()],
20
+ [MeasurementTypes_1.MeasurementTypeKey.ecg, new ecg_1.EcgService()],
21
+ [MeasurementTypes_1.MeasurementTypeKey.stepCount, new step_count_1.StepCountService()],
22
+ [MeasurementTypes_1.MeasurementTypeKey.urineAnalysis, uricAcid],
23
+ [MeasurementTypes_1.MeasurementTypeKey.uricAcid, uricAcid],
24
+ [MeasurementTypes_1.MeasurementTypeKey.lipidPanel, new lipid_panel_1.LipidPanelService()],
25
+ [MeasurementTypes_1.MeasurementTypeKey.respiratoryTherapy, (0, component_observation_services_1.respiratoryTherapyService)()],
26
+ [MeasurementTypes_1.MeasurementTypeKey.babySleep, (0, component_observation_services_1.babySleepService)()],
27
27
  ]);
28
28
  }
29
29
  static getInstance() {
@@ -1,4 +1,4 @@
1
1
  import { CodeableConcept } from "@medplum/fhirtypes";
2
- import { EcgMeasurement } from "../../../types";
2
+ import { EcgMeasurement } from "../../../types/MeasurementTypes";
3
3
  import { ObservationFragment } from "../types/generate-observation-body/ObservationFragment";
4
4
  export declare const generateEcgObservationFragments: (measurement: EcgMeasurement, observationCodes: CodeableConcept[]) => ObservationFragment[];
@@ -1,5 +1,5 @@
1
1
  import { Observation } from "@medplum/fhirtypes";
2
- import { EcgMeasurement, Measurement, MeasurementTypeKey } from "../../../types";
2
+ import { EcgMeasurement, Measurement, MeasurementTypeKey } from "../../../types/MeasurementTypes";
3
3
  import { ObservationFragment } from "../types/generate-observation-body/ObservationFragment";
4
4
  import { ObservationValue } from "../types/generate-observation-body/ObservationValue";
5
5
  import { ObservationMetadata } from "../types/service/ObservationMetadata";
@@ -1,18 +1,18 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.EcgService = void 0;
4
- const types_1 = require("../../../types");
4
+ const MeasurementTypes_1 = require("../../../types/MeasurementTypes");
5
5
  const fhir_systems_1 = require("../fhir-systems");
6
6
  const base_observation_service_1 = require("./base-observation-service");
7
7
  const ecg_observation_fragments_1 = require("./ecg-observation-fragments");
8
8
  class EcgService extends base_observation_service_1.BaseObservationService {
9
9
  constructor() {
10
10
  super(...arguments);
11
- this.measurementTypeKey = types_1.MeasurementTypeKey.ecg;
11
+ this.measurementTypeKey = MeasurementTypes_1.MeasurementTypeKey.ecg;
12
12
  this.measurementTypeName = "ECG";
13
13
  this.observationMetadata = [
14
14
  {
15
- primaryCode: types_1.ObservationCode.ECG,
15
+ primaryCode: MeasurementTypes_1.ObservationCode.ECG,
16
16
  additionalCodes: [],
17
17
  display: "ECG",
18
18
  unit: "mV",
@@ -20,8 +20,8 @@ class EcgService extends base_observation_service_1.BaseObservationService {
20
20
  toFixed: 0,
21
21
  },
22
22
  {
23
- primaryCode: types_1.ObservationCode.ECG_HEART_RATE,
24
- additionalCodes: [types_1.ObservationCode.HEART_RATE],
23
+ primaryCode: MeasurementTypes_1.ObservationCode.ECG_HEART_RATE,
24
+ additionalCodes: [MeasurementTypes_1.ObservationCode.HEART_RATE],
25
25
  display: "ECG Heart Rate",
26
26
  unit: "bpm",
27
27
  valueKey: "heartRate",
@@ -54,7 +54,7 @@ class EcgService extends base_observation_service_1.BaseObservationService {
54
54
  valueQuantity: {
55
55
  value: Number(fixedValue),
56
56
  unit: "bpm",
57
- code: types_1.ObservationCode.ECG_HEART_RATE,
57
+ code: MeasurementTypes_1.ObservationCode.ECG_HEART_RATE,
58
58
  system: fhir_systems_1.LOINC_SYSTEM,
59
59
  },
60
60
  });
@@ -112,14 +112,14 @@ class EcgService extends base_observation_service_1.BaseObservationService {
112
112
  }
113
113
  convertSamplesToMeasurement() {
114
114
  return {
115
- diagnosticResult: types_1.EcgDiagnosticFlag.REGULAR,
116
- measurementTypeKey: types_1.MeasurementTypeKey.ecg,
115
+ diagnosticResult: MeasurementTypes_1.EcgDiagnosticFlag.REGULAR,
116
+ measurementTypeKey: MeasurementTypes_1.MeasurementTypeKey.ecg,
117
117
  };
118
118
  }
119
119
  convertRecordToMeasurement() {
120
120
  return {
121
- diagnosticResult: types_1.EcgDiagnosticFlag.REGULAR,
122
- measurementTypeKey: types_1.MeasurementTypeKey.ecg,
121
+ diagnosticResult: MeasurementTypes_1.EcgDiagnosticFlag.REGULAR,
122
+ measurementTypeKey: MeasurementTypes_1.MeasurementTypeKey.ecg,
123
123
  };
124
124
  }
125
125
  }
@@ -1,5 +1,5 @@
1
1
  import { Observation } from "@medplum/fhirtypes";
2
- import { LipidPanelMeasurement, Measurement, MeasurementTypeKey, ObservationCode } from "../../../types";
2
+ import { LipidPanelMeasurement, Measurement, MeasurementTypeKey, ObservationCode } from "../../../types/MeasurementTypes";
3
3
  import { RecordResult, RecordType } from "../types/generate-measurement/HealthConnectTypes";
4
4
  import { Sample } from "../types/generate-measurement/Sample";
5
5
  import { ObservationFragment } from "../types/generate-observation-body/ObservationFragment";