@ovok/core 0.4.49-dev.495 → 0.4.49-dev.497
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.
- package/dist/client/observation/measurement-fields.d.ts +1 -1
- package/dist/client/observation/methods/observationsToMeasurements.d.ts +1 -1
- package/dist/client/observation/methods/observationsToMeasurements.js +59 -59
- package/dist/client/observation/services/base-observation-service.d.ts +1 -1
- package/dist/client/observation/services/blood-oxygen.d.ts +1 -1
- package/dist/client/observation/services/blood-oxygen.js +7 -7
- package/dist/client/observation/services/blood-pressure.d.ts +1 -1
- package/dist/client/observation/services/blood-pressure.js +16 -16
- package/dist/client/observation/services/component-observation-services.d.ts +1 -1
- package/dist/client/observation/services/component-observation-services.js +3 -3
- package/dist/client/observation/services/creator.d.ts +1 -1
- package/dist/client/observation/services/creator.js +10 -10
- package/dist/client/observation/services/ecg-observation-fragments.d.ts +1 -1
- package/dist/client/observation/services/ecg.d.ts +1 -1
- package/dist/client/observation/services/ecg.js +10 -10
- package/dist/client/observation/services/lipid-panel.d.ts +1 -1
- package/dist/client/observation/services/lipid-panel.js +13 -13
- package/dist/client/observation/services/single-value-services.d.ts +1 -1
- package/dist/client/observation/services/single-value-services.js +19 -19
- package/dist/client/observation/services/step-count.d.ts +1 -1
- package/dist/client/observation/services/step-count.js +5 -5
- package/dist/client/observation/services/uric-acid-service.d.ts +1 -1
- package/dist/client/observation/services/uric-acid-service.js +7 -7
- package/dist/client/offline/offline-measurement-queue.d.ts +1 -2
- package/dist/client/wearables/types.d.ts +5 -0
- package/dist/conformance/capability-requirements.js +1 -1
- package/dist/next/auth/access-token.d.ts +9 -0
- package/dist/next/auth/access-token.js +18 -0
- package/dist/next/auth/client-credentials.d.ts +16 -0
- package/dist/next/auth/client-credentials.js +40 -0
- package/dist/next/auth/credentials.d.ts +5 -0
- package/dist/next/auth/credentials.js +7 -0
- package/dist/next/auth/saved-accounts-store.d.ts +26 -0
- package/dist/next/auth/saved-accounts-store.js +93 -0
- package/dist/next/auth/session-store.d.ts +12 -0
- package/dist/next/auth/session-store.js +33 -0
- package/dist/next/auth/session.d.ts +28 -0
- package/dist/next/auth/session.js +27 -0
- package/dist/next/auth/token-endpoint.d.ts +12 -0
- package/dist/next/auth/token-endpoint.js +28 -0
- package/dist/next/auth/user-session.d.ts +39 -0
- package/dist/next/auth/user-session.js +183 -0
- package/dist/next/config/ovok-config.d.ts +42 -0
- package/dist/next/config/ovok-config.js +2 -0
- package/dist/next/config/settings.d.ts +6 -0
- package/dist/next/config/settings.js +74 -0
- package/dist/next/errors/error-from-response.d.ts +2 -0
- package/dist/next/errors/error-from-response.js +35 -0
- package/dist/next/errors/ovok-account-error.d.ts +5 -0
- package/dist/next/errors/ovok-account-error.js +13 -0
- package/dist/next/errors/ovok-errors.d.ts +42 -0
- package/dist/next/errors/ovok-errors.js +74 -0
- package/dist/next/http/http-client.d.ts +36 -0
- package/dist/next/http/http-client.js +116 -0
- package/dist/next/http/retry-after.d.ts +1 -0
- package/dist/next/http/retry-after.js +16 -0
- package/dist/next/http/retry-policy.d.ts +13 -0
- package/dist/next/http/retry-policy.js +27 -0
- package/dist/next/http/transmit.d.ts +14 -0
- package/dist/next/http/transmit.js +57 -0
- package/dist/next/http/url.d.ts +6 -0
- package/dist/next/http/url.js +22 -0
- package/dist/next/index.d.ts +74 -0
- package/dist/next/index.js +35 -0
- package/dist/next/ovok.d.ts +54 -0
- package/dist/next/ovok.js +77 -0
- package/dist/next/paging/bundle-page.d.ts +4 -0
- package/dist/next/paging/bundle-page.js +25 -0
- package/dist/next/paging/cursor-pages.d.ts +7 -0
- package/dist/next/paging/cursor-pages.js +14 -0
- package/dist/next/paging/numbered-pages.d.ts +15 -0
- package/dist/next/paging/numbered-pages.js +20 -0
- package/dist/next/paging/page.d.ts +12 -0
- package/dist/next/paging/page.js +17 -0
- package/dist/next/resources/accounts/accounts-resource.d.ts +8 -0
- package/dist/next/resources/accounts/accounts-resource.js +13 -0
- package/dist/next/resources/ai/ai-chat-resource.d.ts +8 -0
- package/dist/next/resources/ai/ai-chat-resource.js +12 -0
- package/dist/next/resources/ai/ai-resource.d.ts +16 -0
- package/dist/next/resources/ai/ai-resource.js +19 -0
- package/dist/next/resources/ai/chat-messages-resource.d.ts +9 -0
- package/dist/next/resources/ai/chat-messages-resource.js +18 -0
- package/dist/next/resources/ai/chat-sessions-resource.d.ts +14 -0
- package/dist/next/resources/ai/chat-sessions-resource.js +23 -0
- package/dist/next/resources/auth/auth-sessions-resource.d.ts +13 -0
- package/dist/next/resources/auth/auth-sessions-resource.js +25 -0
- package/dist/next/resources/auth/registration.d.ts +35 -0
- package/dist/next/resources/auth/registration.js +24 -0
- package/dist/next/resources/auth/social-login.d.ts +8 -0
- package/dist/next/resources/auth/social-login.js +7 -0
- package/dist/next/resources/auth-resource.d.ts +63 -0
- package/dist/next/resources/auth-resource.js +119 -0
- package/dist/next/resources/bots/bots-resource.d.ts +10 -0
- package/dist/next/resources/bots/bots-resource.js +15 -0
- package/dist/next/resources/cms/cms-delivery.d.ts +22 -0
- package/dist/next/resources/cms/cms-delivery.js +36 -0
- package/dist/next/resources/cms/cms-documents-resource.d.ts +11 -0
- package/dist/next/resources/cms/cms-documents-resource.js +17 -0
- package/dist/next/resources/cms/cms-resource.d.ts +17 -0
- package/dist/next/resources/cms/cms-resource.js +38 -0
- package/dist/next/resources/cms/payload-pages.d.ts +6 -0
- package/dist/next/resources/cms/payload-pages.js +15 -0
- package/dist/next/resources/cms/release-notes-resource.d.ts +10 -0
- package/dist/next/resources/cms/release-notes-resource.js +15 -0
- package/dist/next/resources/cms/translation-tree.d.ts +3 -0
- package/dist/next/resources/cms/translation-tree.js +45 -0
- package/dist/next/resources/consent/consent-resource.d.ts +23 -0
- package/dist/next/resources/consent/consent-resource.js +43 -0
- package/dist/next/resources/content/content-resource.d.ts +19 -0
- package/dist/next/resources/content/content-resource.js +41 -0
- package/dist/next/resources/documents/documents-resource.d.ts +26 -0
- package/dist/next/resources/documents/documents-resource.js +41 -0
- package/dist/next/resources/email/email-resource.d.ts +6 -0
- package/dist/next/resources/email/email-resource.js +10 -0
- package/dist/next/resources/email/email-templates-resource.d.ts +8 -0
- package/dist/next/resources/email/email-templates-resource.js +13 -0
- package/dist/next/resources/fhir-resource.d.ts +28 -0
- package/dist/next/resources/fhir-resource.js +64 -0
- package/dist/next/resources/health-resource.d.ts +17 -0
- package/dist/next/resources/health-resource.js +14 -0
- package/dist/next/resources/invites/invite-flow-resource.d.ts +12 -0
- package/dist/next/resources/invites/invite-flow-resource.js +19 -0
- package/dist/next/resources/invites/invites-resource.d.ts +22 -0
- package/dist/next/resources/invites/invites-resource.js +29 -0
- package/dist/next/resources/localization/i18next-resource.d.ts +10 -0
- package/dist/next/resources/localization/i18next-resource.js +18 -0
- package/dist/next/resources/localization/locales-resource.d.ts +9 -0
- package/dist/next/resources/localization/locales-resource.js +16 -0
- package/dist/next/resources/localization/localizations-resource.d.ts +17 -0
- package/dist/next/resources/localization/localizations-resource.js +27 -0
- package/dist/next/resources/measurements/measurements-resource.d.ts +42 -0
- package/dist/next/resources/measurements/measurements-resource.js +77 -0
- package/dist/next/resources/measurements/observation-builder.d.ts +5 -0
- package/dist/next/resources/measurements/observation-builder.js +57 -0
- package/dist/next/resources/measurements/save-error.d.ts +5 -0
- package/dist/next/resources/measurements/save-error.js +18 -0
- package/dist/next/resources/measurements/signed-in-account.d.ts +11 -0
- package/dist/next/resources/measurements/signed-in-account.js +26 -0
- package/dist/next/resources/patient/fhir-records.d.ts +19 -0
- package/dist/next/resources/patient/fhir-records.js +33 -0
- package/dist/next/resources/patient/patient-resource.d.ts +21 -0
- package/dist/next/resources/patient/patient-resource.js +38 -0
- package/dist/next/resources/projects/project-features-resource.d.ts +9 -0
- package/dist/next/resources/projects/project-features-resource.js +17 -0
- package/dist/next/resources/projects/project-members-resource.d.ts +19 -0
- package/dist/next/resources/projects/project-members-resource.js +25 -0
- package/dist/next/resources/projects/project-settings-resource.d.ts +10 -0
- package/dist/next/resources/projects/project-settings-resource.js +21 -0
- package/dist/next/resources/projects/projects-resource.d.ts +20 -0
- package/dist/next/resources/projects/projects-resource.js +21 -0
- package/dist/next/resources/questionnaires/questionnaires-resource.d.ts +18 -0
- package/dist/next/resources/questionnaires/questionnaires-resource.js +36 -0
- package/dist/next/resources/session/saved-accounts-resource.d.ts +13 -0
- package/dist/next/resources/session/saved-accounts-resource.js +44 -0
- package/dist/next/resources/session/session-resource.d.ts +11 -0
- package/dist/next/resources/session/session-resource.js +15 -0
- package/dist/next/resources/sharing/sharing-invites-resource.d.ts +9 -0
- package/dist/next/resources/sharing/sharing-invites-resource.js +17 -0
- package/dist/next/resources/sharing/sharing-resource.d.ts +10 -0
- package/dist/next/resources/sharing/sharing-resource.js +14 -0
- package/dist/next/resources/sharing/sharing-settings-resource.d.ts +9 -0
- package/dist/next/resources/sharing/sharing-settings-resource.js +16 -0
- package/dist/next/resources/sharing/sharing-shares-resource.d.ts +9 -0
- package/dist/next/resources/sharing/sharing-shares-resource.js +27 -0
- package/dist/next/resources/signals/signals-gateway-resource.d.ts +14 -0
- package/dist/next/resources/signals/signals-gateway-resource.js +44 -0
- package/dist/next/resources/signals/signals-resource.d.ts +13 -0
- package/dist/next/resources/signals/signals-resource.js +19 -0
- package/dist/next/resources/signals/undeliverable-resource.d.ts +26 -0
- package/dist/next/resources/signals/undeliverable-resource.js +18 -0
- package/dist/next/resources/slim/live-reads.d.ts +13 -0
- package/dist/next/resources/slim/live-reads.js +87 -0
- package/dist/next/resources/slim/slim-alarms-resource.d.ts +13 -0
- package/dist/next/resources/slim/slim-alarms-resource.js +25 -0
- package/dist/next/resources/slim/slim-change-history-resource.d.ts +9 -0
- package/dist/next/resources/slim/slim-change-history-resource.js +19 -0
- package/dist/next/resources/slim/slim-child-projects-resource.d.ts +17 -0
- package/dist/next/resources/slim/slim-child-projects-resource.js +22 -0
- package/dist/next/resources/slim/slim-devices-resource.d.ts +29 -0
- package/dist/next/resources/slim/slim-devices-resource.js +81 -0
- package/dist/next/resources/slim/slim-exports-resource.d.ts +8 -0
- package/dist/next/resources/slim/slim-exports-resource.js +14 -0
- package/dist/next/resources/slim/slim-locations-resource.d.ts +14 -0
- package/dist/next/resources/slim/slim-locations-resource.js +30 -0
- package/dist/next/resources/slim/slim-medical-notifications-resource.d.ts +18 -0
- package/dist/next/resources/slim/slim-medical-notifications-resource.js +46 -0
- package/dist/next/resources/slim/slim-notification-notes-resource.d.ts +12 -0
- package/dist/next/resources/slim/slim-notification-notes-resource.js +34 -0
- package/dist/next/resources/slim/slim-notifications-resource.d.ts +19 -0
- package/dist/next/resources/slim/slim-notifications-resource.js +26 -0
- package/dist/next/resources/slim/slim-organizations-resource.d.ts +11 -0
- package/dist/next/resources/slim/slim-organizations-resource.js +25 -0
- package/dist/next/resources/slim/slim-out-of-bed-resource.d.ts +13 -0
- package/dist/next/resources/slim/slim-out-of-bed-resource.js +20 -0
- package/dist/next/resources/slim/slim-paths.d.ts +6 -0
- package/dist/next/resources/slim/slim-paths.js +9 -0
- package/dist/next/resources/slim/slim-patient-thresholds-resource.d.ts +10 -0
- package/dist/next/resources/slim/slim-patient-thresholds-resource.js +20 -0
- package/dist/next/resources/slim/slim-patients-resource.d.ts +20 -0
- package/dist/next/resources/slim/slim-patients-resource.js +39 -0
- package/dist/next/resources/slim/slim-policies-resource.d.ts +12 -0
- package/dist/next/resources/slim/slim-policies-resource.js +29 -0
- package/dist/next/resources/slim/slim-practitioners-resource.d.ts +8 -0
- package/dist/next/resources/slim/slim-practitioners-resource.js +14 -0
- package/dist/next/resources/slim/slim-projects-resource.d.ts +16 -0
- package/dist/next/resources/slim/slim-projects-resource.js +35 -0
- package/dist/next/resources/slim/slim-queries.d.ts +34 -0
- package/dist/next/resources/slim/slim-queries.js +2 -0
- package/dist/next/resources/slim/slim-resource.d.ts +39 -0
- package/dist/next/resources/slim/slim-resource.js +44 -0
- package/dist/next/resources/slim/slim-sleep-resource.d.ts +9 -0
- package/dist/next/resources/slim/slim-sleep-resource.js +15 -0
- package/dist/next/resources/slim/slim-thresholds-resource.d.ts +11 -0
- package/dist/next/resources/slim/slim-thresholds-resource.js +18 -0
- package/dist/next/resources/slim/slim-trends-resource.d.ts +11 -0
- package/dist/next/resources/slim/slim-trends-resource.js +19 -0
- package/dist/next/resources/slim/slim-users-resource.d.ts +11 -0
- package/dist/next/resources/slim/slim-users-resource.js +15 -0
- package/dist/next/resources/slim/slim-zones-resource.d.ts +12 -0
- package/dist/next/resources/slim/slim-zones-resource.js +24 -0
- package/dist/next/resources/video-calls/video-call-access-resource.d.ts +11 -0
- package/dist/next/resources/video-calls/video-call-access-resource.js +19 -0
- package/dist/next/resources/video-calls/video-call-appointments-resource.d.ts +10 -0
- package/dist/next/resources/video-calls/video-call-appointments-resource.js +21 -0
- package/dist/next/resources/video-calls/video-call-emails-resource.d.ts +10 -0
- package/dist/next/resources/video-calls/video-call-emails-resource.js +19 -0
- package/dist/next/resources/video-calls/video-calls-resource.d.ts +14 -0
- package/dist/next/resources/video-calls/video-calls-resource.js +20 -0
- package/dist/next/resources/wearables/wearable-connections-resource.d.ts +12 -0
- package/dist/next/resources/wearables/wearable-connections-resource.js +25 -0
- package/dist/next/resources/wearables/wearable-providers-resource.d.ts +12 -0
- package/dist/next/resources/wearables/wearable-providers-resource.js +27 -0
- package/dist/next/resources/wearables/wearables-resource.d.ts +8 -0
- package/dist/next/resources/wearables/wearables-resource.js +14 -0
- package/dist/next/storage/ovok-storage.d.ts +11 -0
- package/dist/next/storage/ovok-storage.js +19 -0
- package/dist/types/MeasurementTypes.d.ts +5 -0
- package/dist/types/MeasurementTypes.js +21 -0
- package/dist/types/index.d.ts +1 -5
- package/dist/types/index.js +1 -5
- package/next/index.d.ts +1 -0
- package/next/index.js +3 -0
- 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
|
|
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 ===
|
|
23
|
-
coding.code ===
|
|
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 ===
|
|
26
|
-
if (result ===
|
|
27
|
-
result ===
|
|
28
|
-
result ===
|
|
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 ===
|
|
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) ===
|
|
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) ===
|
|
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: [
|
|
210
|
-
{ key: "hdlCholesterol", codes: [
|
|
211
|
-
{ key: "ldlCholesterol", codes: [
|
|
212
|
-
{ key: "triglycerides", codes: [
|
|
213
|
-
{ key: "totalCholesterolHdlRatio", codes: [
|
|
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
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
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
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
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
|
|
285
|
+
case MeasurementTypes_1.MeasurementTypeKey.bloodPressure:
|
|
286
286
|
return {
|
|
287
287
|
...measurement,
|
|
288
288
|
measurementTypeKey: type,
|
|
289
|
-
systolic: value(
|
|
290
|
-
diastolic: value(
|
|
291
|
-
meanArterialPressure: value(
|
|
292
|
-
heartRate: value(
|
|
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
|
|
295
|
+
case MeasurementTypes_1.MeasurementTypeKey.bloodOxygenPulseRate:
|
|
296
296
|
return {
|
|
297
297
|
...measurement,
|
|
298
298
|
measurementTypeKey: type,
|
|
299
|
-
bloodOxygen: value(
|
|
300
|
-
pulseRate: value(
|
|
299
|
+
bloodOxygen: value(MeasurementTypes_1.ObservationCode.OXYGEN_SATURATION),
|
|
300
|
+
pulseRate: value(MeasurementTypes_1.ObservationCode.OXYGEN_SATURATION_HEART_RATE),
|
|
301
301
|
};
|
|
302
|
-
case
|
|
302
|
+
case MeasurementTypes_1.MeasurementTypeKey.stepCount:
|
|
303
303
|
return {
|
|
304
304
|
...measurement,
|
|
305
305
|
measurementTypeKey: type,
|
|
306
|
-
stepCount: value(
|
|
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
|
|
310
|
+
case MeasurementTypes_1.MeasurementTypeKey.ecg: {
|
|
311
311
|
const sampled = observations
|
|
312
|
-
.filter((observation) => codeOf(observation) ===
|
|
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(
|
|
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
|
|
336
|
-
case
|
|
337
|
-
const analyteByCode = Object.fromEntries(
|
|
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
|
|
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
|
|
368
|
-
case
|
|
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([
|
|
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
|
-
[
|
|
382
|
-
[
|
|
383
|
-
[
|
|
384
|
-
[
|
|
385
|
-
[
|
|
386
|
-
|
|
387
|
-
...
|
|
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
|
-
[
|
|
390
|
-
|
|
391
|
-
...
|
|
389
|
+
[MeasurementTypes_1.MeasurementTypeKey.urineAnalysis]: [
|
|
390
|
+
MeasurementTypes_1.ObservationCode.URIC_ACID,
|
|
391
|
+
...MeasurementTypes_1.URINE_ANALYTE_DEFINITIONS.map((analyte) => analyte.code),
|
|
392
392
|
],
|
|
393
|
-
[
|
|
394
|
-
|
|
393
|
+
[MeasurementTypes_1.MeasurementTypeKey.lipidPanel]: [
|
|
394
|
+
MeasurementTypes_1.ObservationCode.LIPID_PANEL,
|
|
395
395
|
...LIPID_FIELDS.flatMap(({ codes }) => codes),
|
|
396
396
|
],
|
|
397
|
-
[
|
|
398
|
-
[
|
|
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 ===
|
|
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 ===
|
|
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
|
|
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 =
|
|
9
|
+
this.measurementTypeKey = MeasurementTypes_1.MeasurementTypeKey.bloodOxygenPulseRate;
|
|
10
10
|
this.measurementTypeName = "blood oxygen";
|
|
11
11
|
this.observationMetadata = [
|
|
12
12
|
{
|
|
13
|
-
primaryCode:
|
|
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:
|
|
22
|
-
additionalCodes: [
|
|
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:
|
|
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:
|
|
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
|
|
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 =
|
|
9
|
+
this.measurementTypeKey = MeasurementTypes_1.MeasurementTypeKey.bloodPressure;
|
|
10
10
|
this.measurementTypeName = "blood pressure";
|
|
11
11
|
this.observationMetadata = [
|
|
12
12
|
{
|
|
13
|
-
primaryCode:
|
|
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:
|
|
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:
|
|
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:
|
|
38
|
-
additionalCodes: [
|
|
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:
|
|
51
|
+
code: MeasurementTypes_1.PulseRhythmCoding.observation,
|
|
52
52
|
display: "Pulse rhythm",
|
|
53
|
-
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
|
-
?
|
|
65
|
-
:
|
|
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:
|
|
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) ===
|
|
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) ===
|
|
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:
|
|
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:
|
|
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
|
|
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(
|
|
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(
|
|
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
|
|
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
|
-
[
|
|
19
|
-
[
|
|
20
|
-
[
|
|
21
|
-
[
|
|
22
|
-
[
|
|
23
|
-
[
|
|
24
|
-
[
|
|
25
|
-
[
|
|
26
|
-
[
|
|
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
|
|
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 =
|
|
11
|
+
this.measurementTypeKey = MeasurementTypes_1.MeasurementTypeKey.ecg;
|
|
12
12
|
this.measurementTypeName = "ECG";
|
|
13
13
|
this.observationMetadata = [
|
|
14
14
|
{
|
|
15
|
-
primaryCode:
|
|
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:
|
|
24
|
-
additionalCodes: [
|
|
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:
|
|
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:
|
|
116
|
-
measurementTypeKey:
|
|
115
|
+
diagnosticResult: MeasurementTypes_1.EcgDiagnosticFlag.REGULAR,
|
|
116
|
+
measurementTypeKey: MeasurementTypes_1.MeasurementTypeKey.ecg,
|
|
117
117
|
};
|
|
118
118
|
}
|
|
119
119
|
convertRecordToMeasurement() {
|
|
120
120
|
return {
|
|
121
|
-
diagnosticResult:
|
|
122
|
-
measurementTypeKey:
|
|
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";
|