@ovok/core 0.2.47
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/README.md +40 -0
- package/dist/client/ai-fhir/methods/AIFhirResources.d.ts +14 -0
- package/dist/client/ai-fhir/methods/AIFhirResources.js +16 -0
- package/dist/client/ai-fhir/methods/index.d.ts +1 -0
- package/dist/client/ai-fhir/methods/index.js +17 -0
- package/dist/client/ai-fhir/types/AIFhirPlan.d.ts +6 -0
- package/dist/client/ai-fhir/types/AIFhirPlan.js +2 -0
- package/dist/client/ai-fhir/types/AIFhirPlanRequest.d.ts +5 -0
- package/dist/client/ai-fhir/types/AIFhirPlanRequest.js +2 -0
- package/dist/client/ai-fhir/types/AIFhirRequest.d.ts +7 -0
- package/dist/client/ai-fhir/types/AIFhirRequest.js +2 -0
- package/dist/client/ai-fhir/types/AIFhirResponse.d.ts +18 -0
- package/dist/client/ai-fhir/types/AIFhirResponse.js +2 -0
- package/dist/client/ai-fhir/types/index.d.ts +4 -0
- package/dist/client/ai-fhir/types/index.js +20 -0
- package/dist/client/auth/methods/appleLogin.d.ts +4 -0
- package/dist/client/auth/methods/appleLogin.js +11 -0
- package/dist/client/auth/methods/changePassword.d.ts +4 -0
- package/dist/client/auth/methods/changePassword.js +6 -0
- package/dist/client/auth/methods/googleLogin.d.ts +4 -0
- package/dist/client/auth/methods/googleLogin.js +11 -0
- package/dist/client/auth/methods/index.d.ts +8 -0
- package/dist/client/auth/methods/index.js +24 -0
- package/dist/client/auth/methods/login.d.ts +4 -0
- package/dist/client/auth/methods/login.js +38 -0
- package/dist/client/auth/methods/refetchProfile.d.ts +2 -0
- package/dist/client/auth/methods/refetchProfile.js +9 -0
- package/dist/client/auth/methods/register.d.ts +4 -0
- package/dist/client/auth/methods/register.js +15 -0
- package/dist/client/auth/methods/requestDeleteUser.d.ts +11 -0
- package/dist/client/auth/methods/requestDeleteUser.js +13 -0
- package/dist/client/auth/methods/resetPassword.d.ts +13 -0
- package/dist/client/auth/methods/resetPassword.js +19 -0
- package/dist/client/auth/types/AppleLoginBody.d.ts +68 -0
- package/dist/client/auth/types/AppleLoginBody.js +17 -0
- package/dist/client/auth/types/AuthResponse.d.ts +15 -0
- package/dist/client/auth/types/AuthResponse.js +2 -0
- package/dist/client/auth/types/ChangePasswordBody.d.ts +5 -0
- package/dist/client/auth/types/ChangePasswordBody.js +2 -0
- package/dist/client/auth/types/GoogleLoginBody.d.ts +26 -0
- package/dist/client/auth/types/GoogleLoginBody.js +2 -0
- package/dist/client/auth/types/LoginBody.d.ts +26 -0
- package/dist/client/auth/types/LoginBody.js +2 -0
- package/dist/client/auth/types/RegisterBody.d.ts +8 -0
- package/dist/client/auth/types/RegisterBody.js +2 -0
- package/dist/client/auth/types/RequestDeleteUserBody.d.ts +11 -0
- package/dist/client/auth/types/RequestDeleteUserBody.js +2 -0
- package/dist/client/auth/types/RequestDeleteUserResponse.d.ts +12 -0
- package/dist/client/auth/types/RequestDeleteUserResponse.js +2 -0
- package/dist/client/auth/types/ResetPasswordBody.d.ts +14 -0
- package/dist/client/auth/types/ResetPasswordBody.js +2 -0
- package/dist/client/auth/types/StartLoginResponse.d.ts +34 -0
- package/dist/client/auth/types/StartLoginResponse.js +2 -0
- package/dist/client/bot/methods/executeBot.d.ts +10 -0
- package/dist/client/bot/methods/executeBot.js +14 -0
- package/dist/client/bot/methods/index.d.ts +1 -0
- package/dist/client/bot/methods/index.js +17 -0
- package/dist/client/chat/ai/methods/createAiSession.d.ts +4 -0
- package/dist/client/chat/ai/methods/createAiSession.js +17 -0
- package/dist/client/chat/ai/methods/index.d.ts +1 -0
- package/dist/client/chat/ai/methods/index.js +17 -0
- package/dist/client/chat/ai/types/CreateAiSessionProps.d.ts +51 -0
- package/dist/client/chat/ai/types/CreateAiSessionProps.js +2 -0
- package/dist/client/chat/ai/types/CreateAiSessionResponse.d.ts +21 -0
- package/dist/client/chat/ai/types/CreateAiSessionResponse.js +2 -0
- package/dist/client/chat/ai/types/SessionMessagesResponse.d.ts +9 -0
- package/dist/client/chat/ai/types/SessionMessagesResponse.js +2 -0
- package/dist/client/observation/methods/generateObservationBodiesByMeasurement.d.ts +4 -0
- package/dist/client/observation/methods/generateObservationBodiesByMeasurement.js +40 -0
- package/dist/client/observation/methods/getLatestObservationsByCodes.d.ts +4 -0
- package/dist/client/observation/methods/getLatestObservationsByCodes.js +19 -0
- package/dist/client/observation/methods/index.d.ts +2 -0
- package/dist/client/observation/methods/index.js +18 -0
- package/dist/client/observation/services/base-observation-service.d.ts +22 -0
- package/dist/client/observation/services/base-observation-service.js +70 -0
- package/dist/client/observation/services/blood-glucose.d.ts +12 -0
- package/dist/client/observation/services/blood-glucose.js +36 -0
- package/dist/client/observation/services/blood-oxygen.d.ts +14 -0
- package/dist/client/observation/services/blood-oxygen.js +57 -0
- package/dist/client/observation/services/blood-pressure.d.ts +15 -0
- package/dist/client/observation/services/blood-pressure.js +72 -0
- package/dist/client/observation/services/body-temperature.d.ts +13 -0
- package/dist/client/observation/services/body-temperature.js +36 -0
- package/dist/client/observation/services/body-weight.d.ts +13 -0
- package/dist/client/observation/services/body-weight.js +36 -0
- package/dist/client/observation/services/creator.d.ts +10 -0
- package/dist/client/observation/services/creator.js +54 -0
- package/dist/client/observation/services/ecg.d.ts +16 -0
- package/dist/client/observation/services/ecg.js +110 -0
- package/dist/client/observation/services/heart-rate-variability.d.ts +13 -0
- package/dist/client/observation/services/heart-rate-variability.js +38 -0
- package/dist/client/observation/services/heart-rate.d.ts +13 -0
- package/dist/client/observation/services/heart-rate.js +39 -0
- package/dist/client/observation/services/index.d.ts +1 -0
- package/dist/client/observation/services/index.js +17 -0
- package/dist/client/observation/services/respiratory-rate.d.ts +13 -0
- package/dist/client/observation/services/respiratory-rate.js +38 -0
- package/dist/client/observation/services/resting-heart-rate.d.ts +13 -0
- package/dist/client/observation/services/resting-heart-rate.js +38 -0
- package/dist/client/observation/services/step-count.d.ts +15 -0
- package/dist/client/observation/services/step-count.js +55 -0
- package/dist/client/observation/services/uric-acid-service.d.ts +21 -0
- package/dist/client/observation/services/uric-acid-service.js +120 -0
- package/dist/client/observation/services/vo2-max.d.ts +13 -0
- package/dist/client/observation/services/vo2-max.js +38 -0
- package/dist/client/observation/services/walking-heart-rate-average.d.ts +12 -0
- package/dist/client/observation/services/walking-heart-rate-average.js +38 -0
- package/dist/client/observation/types/GetLatestObservationsByCodeParams.d.ts +9 -0
- package/dist/client/observation/types/GetLatestObservationsByCodeParams.js +2 -0
- package/dist/client/observation/types/IObservationService.d.ts +15 -0
- package/dist/client/observation/types/IObservationService.js +2 -0
- package/dist/client/observation/types/MeasurementTypeKey.d.ts +20 -0
- package/dist/client/observation/types/MeasurementTypeKey.js +24 -0
- package/dist/client/observation/types/ObservationCode.d.ts +37 -0
- package/dist/client/observation/types/ObservationCode.js +41 -0
- package/dist/client/observation/types/generate-measurement/HealthConnectTypes.d.ts +641 -0
- package/dist/client/observation/types/generate-measurement/HealthConnectTypes.js +45 -0
- package/dist/client/observation/types/generate-measurement/Sample.d.ts +32 -0
- package/dist/client/observation/types/generate-measurement/Sample.js +2 -0
- package/dist/client/observation/types/generate-observation-body/BodyWeightValueParams.d.ts +1 -0
- package/dist/client/observation/types/generate-observation-body/BodyWeightValueParams.js +2 -0
- package/dist/client/observation/types/generate-observation-body/GenerateObservationBodyParams.d.ts +7 -0
- package/dist/client/observation/types/generate-observation-body/GenerateObservationBodyParams.js +2 -0
- package/dist/client/observation/types/generate-observation-body/ObservationValue.d.ts +14 -0
- package/dist/client/observation/types/generate-observation-body/ObservationValue.js +2 -0
- package/dist/client/observation/types/measurement/BloodGlucoseMeasurement.d.ts +6 -0
- package/dist/client/observation/types/measurement/BloodGlucoseMeasurement.js +2 -0
- package/dist/client/observation/types/measurement/BloodPressureMeasurement.d.ts +10 -0
- package/dist/client/observation/types/measurement/BloodPressureMeasurement.js +2 -0
- package/dist/client/observation/types/measurement/BloodPressureStates.d.ts +7 -0
- package/dist/client/observation/types/measurement/BloodPressureStates.js +11 -0
- package/dist/client/observation/types/measurement/BodyTemperatureMeasurement.d.ts +6 -0
- package/dist/client/observation/types/measurement/BodyTemperatureMeasurement.js +2 -0
- package/dist/client/observation/types/measurement/BodyWeightMeasurmement.d.ts +7 -0
- package/dist/client/observation/types/measurement/BodyWeightMeasurmement.js +2 -0
- package/dist/client/observation/types/measurement/EcgDiagnosticFlag.d.ts +15 -0
- package/dist/client/observation/types/measurement/EcgDiagnosticFlag.js +19 -0
- package/dist/client/observation/types/measurement/EcgMeasurement.d.ts +13 -0
- package/dist/client/observation/types/measurement/EcgMeasurement.js +2 -0
- package/dist/client/observation/types/measurement/HeartRateMeasurement.d.ts +6 -0
- package/dist/client/observation/types/measurement/HeartRateMeasurement.js +2 -0
- package/dist/client/observation/types/measurement/HeartRateVariabilityMeasurement.d.ts +6 -0
- package/dist/client/observation/types/measurement/HeartRateVariabilityMeasurement.js +2 -0
- package/dist/client/observation/types/measurement/Measurement.d.ts +4 -0
- package/dist/client/observation/types/measurement/Measurement.js +2 -0
- package/dist/client/observation/types/measurement/MeasurementDevice.d.ts +7 -0
- package/dist/client/observation/types/measurement/MeasurementDevice.js +2 -0
- package/dist/client/observation/types/measurement/PulseOximeterMeasurement.d.ts +9 -0
- package/dist/client/observation/types/measurement/PulseOximeterMeasurement.js +2 -0
- package/dist/client/observation/types/measurement/RespiratoryRateMeasurement.d.ts +6 -0
- package/dist/client/observation/types/measurement/RespiratoryRateMeasurement.js +2 -0
- package/dist/client/observation/types/measurement/RestingHeartRateMeasurement.d.ts +6 -0
- package/dist/client/observation/types/measurement/RestingHeartRateMeasurement.js +2 -0
- package/dist/client/observation/types/measurement/SpirometryMeasurement.d.ts +21 -0
- package/dist/client/observation/types/measurement/SpirometryMeasurement.js +2 -0
- package/dist/client/observation/types/measurement/StepCountMeasurement.d.ts +8 -0
- package/dist/client/observation/types/measurement/StepCountMeasurement.js +2 -0
- package/dist/client/observation/types/measurement/UrineAnalyzeMeasurement.d.ts +23 -0
- package/dist/client/observation/types/measurement/UrineAnalyzeMeasurement.js +2 -0
- package/dist/client/observation/types/measurement/Vo2MaxMeasurement.d.ts +6 -0
- package/dist/client/observation/types/measurement/Vo2MaxMeasurement.js +2 -0
- package/dist/client/observation/types/measurement/WalkingHeartRateAverageMeasurement.d.ts +6 -0
- package/dist/client/observation/types/measurement/WalkingHeartRateAverageMeasurement.js +2 -0
- package/dist/client/observation/types/measurement/index.d.ts +11 -0
- package/dist/client/observation/types/measurement/index.js +27 -0
- package/dist/client/observation/types/service/ObservationMetadata.d.ts +8 -0
- package/dist/client/observation/types/service/ObservationMetadata.js +2 -0
- package/dist/client/observation/utils/getDeviceObject.d.ts +3 -0
- package/dist/client/observation/utils/getDeviceObject.js +34 -0
- package/dist/client/observation/utils/getObservationValueDisplay.d.ts +15 -0
- package/dist/client/observation/utils/getObservationValueDisplay.js +25 -0
- package/dist/client/observation/utils/index.d.ts +1 -0
- package/dist/client/observation/utils/index.js +17 -0
- package/dist/client/ovok-client.d.ts +35 -0
- package/dist/client/ovok-client.js +85 -0
- package/dist/client/questionnaire-response/methods/createQuestionnaireResponseWithObservations.d.ts +3 -0
- package/dist/client/questionnaire-response/methods/createQuestionnaireResponseWithObservations.js +28 -0
- package/dist/client/questionnaire-response/methods/index.d.ts +1 -0
- package/dist/client/questionnaire-response/methods/index.js +17 -0
- package/dist/hooks/index.d.ts +7 -0
- package/dist/hooks/index.js +58 -0
- package/dist/index.d.ts +666 -0
- package/dist/index.js +49 -0
- package/dist/types/ValidationError.d.ts +6 -0
- package/dist/types/ValidationError.js +2 -0
- package/dist/types/index.d.ts +17 -0
- package/dist/types/index.js +38 -0
- package/dist/utils/auth/exchange-code.d.ts +14 -0
- package/dist/utils/auth/exchange-code.js +17 -0
- package/dist/utils/auth/generate-code-challenge-and-verifier.d.ts +6 -0
- package/dist/utils/auth/generate-code-challenge-and-verifier.js +45 -0
- package/dist/utils/auth/handle-tenant-code.d.ts +6 -0
- package/dist/utils/auth/handle-tenant-code.js +21 -0
- package/dist/utils/auth/sha256.d.ts +8 -0
- package/dist/utils/auth/sha256.js +300 -0
- package/dist/utils/auth/start-login.d.ts +10 -0
- package/dist/utils/auth/start-login.js +19 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.js +18 -0
- package/dist/utils/patch/getPatchOperationType.d.ts +2 -0
- package/dist/utils/patch/getPatchOperationType.js +16 -0
- package/package.json +83 -0
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StepCountService = void 0;
|
|
4
|
+
const types_1 = require("../../../types");
|
|
5
|
+
const base_observation_service_1 = require("./base-observation-service");
|
|
6
|
+
class StepCountService extends base_observation_service_1.BaseObservationService {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(...arguments);
|
|
9
|
+
this.measurementTypeKey = types_1.MeasurementTypeKey.stepCount;
|
|
10
|
+
this.measurementTypeName = "step count";
|
|
11
|
+
this.observationMetadata = [
|
|
12
|
+
{
|
|
13
|
+
primaryCode: types_1.ObservationCode.STEPS,
|
|
14
|
+
additionalCodes: [],
|
|
15
|
+
display: "Step Count",
|
|
16
|
+
unit: "steps",
|
|
17
|
+
valueKey: "stepCount",
|
|
18
|
+
toFixed: 0,
|
|
19
|
+
},
|
|
20
|
+
];
|
|
21
|
+
}
|
|
22
|
+
getAdditionalProperties(measurement) {
|
|
23
|
+
const castedMeasurement = this.getCastedMeasurement(measurement);
|
|
24
|
+
return [
|
|
25
|
+
{
|
|
26
|
+
...(castedMeasurement.start && castedMeasurement.end
|
|
27
|
+
? {
|
|
28
|
+
effectivePeriod: {
|
|
29
|
+
start: castedMeasurement.start.toISOString(),
|
|
30
|
+
end: castedMeasurement.end.toISOString(),
|
|
31
|
+
},
|
|
32
|
+
}
|
|
33
|
+
: {
|
|
34
|
+
effectiveDateTime: (castedMeasurement.start ||
|
|
35
|
+
castedMeasurement.end ||
|
|
36
|
+
new Date()).toISOString(),
|
|
37
|
+
}),
|
|
38
|
+
},
|
|
39
|
+
];
|
|
40
|
+
}
|
|
41
|
+
convertSamplesToMeasurement(samples) {
|
|
42
|
+
return {
|
|
43
|
+
stepCount: samples[0].quantity,
|
|
44
|
+
measurementTypeKey: types_1.MeasurementTypeKey.stepCount,
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
convertRecordToMeasurement(record) {
|
|
48
|
+
const stepCountRecord = record;
|
|
49
|
+
return {
|
|
50
|
+
stepCount: stepCountRecord.count,
|
|
51
|
+
measurementTypeKey: types_1.MeasurementTypeKey.stepCount,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
exports.StepCountService = StepCountService;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Observation } from "@medplum/fhirtypes";
|
|
2
|
+
import { Measurement, MeasurementTypeKey, Sample, UrineAnalyzeMeasurement } from "../../../types";
|
|
3
|
+
import { RecordResult, RecordType } from "../types/generate-measurement/HealthConnectTypes";
|
|
4
|
+
import { ObservationValue } from "../types/generate-observation-body/ObservationValue";
|
|
5
|
+
import { ObservationMetadata } from "../types/service/ObservationMetadata";
|
|
6
|
+
import { BaseObservationService } from "./base-observation-service";
|
|
7
|
+
export declare class UricAcidService extends BaseObservationService<UrineAnalyzeMeasurement> {
|
|
8
|
+
private static readonly THRESHOLDS;
|
|
9
|
+
protected measurementTypeKey: MeasurementTypeKey;
|
|
10
|
+
protected measurementTypeName: string;
|
|
11
|
+
protected observationMetadata: ObservationMetadata<UrineAnalyzeMeasurement>[];
|
|
12
|
+
generateValues(measurement: Measurement): ObservationValue[];
|
|
13
|
+
getAdditionalProperties(measurement: Measurement): Partial<Observation>[];
|
|
14
|
+
getMeasurementDisplay(measurement: Measurement): string;
|
|
15
|
+
getObservationDisplay(observations: Observation[]): string | undefined;
|
|
16
|
+
convertSamplesToMeasurement(_samples: Sample[]): UrineAnalyzeMeasurement;
|
|
17
|
+
convertRecordToMeasurement(_record: RecordResult<RecordType>): UrineAnalyzeMeasurement;
|
|
18
|
+
private isParameterOutOfThreshold;
|
|
19
|
+
private countProblems;
|
|
20
|
+
private getComponent;
|
|
21
|
+
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UricAcidService = void 0;
|
|
4
|
+
const types_1 = require("../../../types");
|
|
5
|
+
const base_observation_service_1 = require("./base-observation-service");
|
|
6
|
+
class UricAcidService extends base_observation_service_1.BaseObservationService {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(...arguments);
|
|
9
|
+
this.measurementTypeKey = types_1.MeasurementTypeKey.uricAcid;
|
|
10
|
+
this.measurementTypeName = "uric acid";
|
|
11
|
+
this.observationMetadata = [
|
|
12
|
+
{
|
|
13
|
+
primaryCode: types_1.ObservationCode.URIC_ACID,
|
|
14
|
+
additionalCodes: [],
|
|
15
|
+
display: "URINE",
|
|
16
|
+
unit: "problems",
|
|
17
|
+
valueKey: "uro",
|
|
18
|
+
toFixed: 0,
|
|
19
|
+
},
|
|
20
|
+
];
|
|
21
|
+
}
|
|
22
|
+
generateValues(measurement) {
|
|
23
|
+
const castedMeasurement = this.getCastedMeasurement(measurement);
|
|
24
|
+
const values = [];
|
|
25
|
+
const problemCount = this.countProblems(castedMeasurement);
|
|
26
|
+
values.push({
|
|
27
|
+
valueQuantity: {
|
|
28
|
+
value: problemCount,
|
|
29
|
+
unit: "problems",
|
|
30
|
+
code: types_1.ObservationCode.URIC_ACID,
|
|
31
|
+
system: "http://loinc.org",
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
return values;
|
|
35
|
+
}
|
|
36
|
+
getAdditionalProperties(measurement) {
|
|
37
|
+
const castedMeasurement = this.getCastedMeasurement(measurement);
|
|
38
|
+
const components = Object.entries(castedMeasurement)
|
|
39
|
+
.filter(([key]) => key !== "measurementTypeKey" && key !== "urineValues")
|
|
40
|
+
.map(([key, value]) => this.getComponent(key, value));
|
|
41
|
+
return [
|
|
42
|
+
{
|
|
43
|
+
effectiveDateTime: new Date().toISOString(),
|
|
44
|
+
component: components,
|
|
45
|
+
},
|
|
46
|
+
];
|
|
47
|
+
}
|
|
48
|
+
getMeasurementDisplay(measurement) {
|
|
49
|
+
const castedMeasurement = this.getCastedMeasurement(measurement);
|
|
50
|
+
const problemCount = this.countProblems(castedMeasurement);
|
|
51
|
+
return `${problemCount}`;
|
|
52
|
+
}
|
|
53
|
+
getObservationDisplay(observations) {
|
|
54
|
+
var _a, _b;
|
|
55
|
+
const observation = observations[0];
|
|
56
|
+
if (!observation || !observation.valueQuantity) {
|
|
57
|
+
return undefined;
|
|
58
|
+
}
|
|
59
|
+
return (_b = (_a = observation.valueQuantity) === null || _a === void 0 ? void 0 : _a.value) === null || _b === void 0 ? void 0 : _b.toString();
|
|
60
|
+
}
|
|
61
|
+
convertSamplesToMeasurement(_samples) {
|
|
62
|
+
throw new Error("Method not supported.");
|
|
63
|
+
}
|
|
64
|
+
convertRecordToMeasurement(_record) {
|
|
65
|
+
throw new Error("Method not supported.");
|
|
66
|
+
}
|
|
67
|
+
isParameterOutOfThreshold(key, value) {
|
|
68
|
+
if (value === undefined || value === null) {
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
const threshold = UricAcidService.THRESHOLDS[key];
|
|
72
|
+
if (!threshold) {
|
|
73
|
+
return false;
|
|
74
|
+
}
|
|
75
|
+
const isUnderMin = threshold.min !== undefined && value < threshold.min;
|
|
76
|
+
const isOverMax = threshold.max !== undefined && value > threshold.max;
|
|
77
|
+
return isUnderMin || isOverMax;
|
|
78
|
+
}
|
|
79
|
+
countProblems(measurement) {
|
|
80
|
+
let problemCount = 0;
|
|
81
|
+
const parametersToCheck = Object.keys(UricAcidService.THRESHOLDS);
|
|
82
|
+
for (const parameter of parametersToCheck) {
|
|
83
|
+
if (this.isParameterOutOfThreshold(parameter, measurement[parameter])) {
|
|
84
|
+
problemCount++;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return problemCount;
|
|
88
|
+
}
|
|
89
|
+
getComponent(key, value) {
|
|
90
|
+
if (!value) {
|
|
91
|
+
return {};
|
|
92
|
+
}
|
|
93
|
+
return {
|
|
94
|
+
code: {
|
|
95
|
+
text: key,
|
|
96
|
+
coding: [
|
|
97
|
+
{
|
|
98
|
+
code: key,
|
|
99
|
+
display: key,
|
|
100
|
+
},
|
|
101
|
+
],
|
|
102
|
+
},
|
|
103
|
+
valueInteger: value,
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
exports.UricAcidService = UricAcidService;
|
|
108
|
+
UricAcidService.THRESHOLDS = {
|
|
109
|
+
uro: { min: 0.1, max: 1.0 },
|
|
110
|
+
bil: { max: 0 },
|
|
111
|
+
ket: { min: 0, max: 15 },
|
|
112
|
+
glu: { max: 0 },
|
|
113
|
+
pro: { min: 0, max: 14 },
|
|
114
|
+
ph: { min: 4.5, max: 8.0 },
|
|
115
|
+
bld: { max: 0 },
|
|
116
|
+
nit: { max: 0 },
|
|
117
|
+
leu: { min: 0, max: 25 },
|
|
118
|
+
sg: { min: 1.003, max: 1.03 },
|
|
119
|
+
vc: {}, // Skip vitamin C from problem count
|
|
120
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { MeasurementTypeKey } from "../../../types";
|
|
2
|
+
import { RecordResult, RecordType } from "../types/generate-measurement/HealthConnectTypes";
|
|
3
|
+
import { Sample } from "../types/generate-measurement/Sample";
|
|
4
|
+
import { Vo2MaxMeasurement } from "../types/measurement/Vo2MaxMeasurement";
|
|
5
|
+
import { ObservationMetadata } from "../types/service/ObservationMetadata";
|
|
6
|
+
import { BaseObservationService } from "./base-observation-service";
|
|
7
|
+
export declare class Vo2MaxService extends BaseObservationService<Vo2MaxMeasurement> {
|
|
8
|
+
protected measurementTypeKey: MeasurementTypeKey;
|
|
9
|
+
protected measurementTypeName: string;
|
|
10
|
+
protected observationMetadata: ObservationMetadata<Vo2MaxMeasurement>[];
|
|
11
|
+
convertSamplesToMeasurement(samples: Sample[]): Vo2MaxMeasurement;
|
|
12
|
+
convertRecordToMeasurement(record: RecordResult<RecordType>): Vo2MaxMeasurement;
|
|
13
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Vo2MaxService = void 0;
|
|
4
|
+
const types_1 = require("../../../types");
|
|
5
|
+
const base_observation_service_1 = require("./base-observation-service");
|
|
6
|
+
class Vo2MaxService extends base_observation_service_1.BaseObservationService {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(...arguments);
|
|
9
|
+
this.measurementTypeKey = types_1.MeasurementTypeKey.vo2Max;
|
|
10
|
+
this.measurementTypeName = "VO2 max";
|
|
11
|
+
this.observationMetadata = [
|
|
12
|
+
{
|
|
13
|
+
primaryCode: types_1.ObservationCode.VO2_MAX,
|
|
14
|
+
additionalCodes: [],
|
|
15
|
+
display: "VO2 Max",
|
|
16
|
+
unit: "mL/kg/min",
|
|
17
|
+
valueKey: "vo2Max",
|
|
18
|
+
toFixed: 1,
|
|
19
|
+
},
|
|
20
|
+
];
|
|
21
|
+
}
|
|
22
|
+
convertSamplesToMeasurement(samples) {
|
|
23
|
+
var _a;
|
|
24
|
+
const vo2maxQuantity = (_a = samples.find((x) => x.quantityType === "HKQuantityTypeIdentifierVO2Max")) === null || _a === void 0 ? void 0 : _a.quantity;
|
|
25
|
+
return {
|
|
26
|
+
vo2Max: vo2maxQuantity,
|
|
27
|
+
measurementTypeKey: types_1.MeasurementTypeKey.vo2Max,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
convertRecordToMeasurement(record) {
|
|
31
|
+
const vo2MaxRecord = record;
|
|
32
|
+
return {
|
|
33
|
+
vo2Max: vo2MaxRecord.vo2MillilitersPerMinuteKilogram,
|
|
34
|
+
measurementTypeKey: types_1.MeasurementTypeKey.vo2Max,
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
exports.Vo2MaxService = Vo2MaxService;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { MeasurementTypeKey } from "../../../types";
|
|
2
|
+
import { Sample } from "../types/generate-measurement/Sample";
|
|
3
|
+
import { WalkingHeartRateAverageMeasurement } from "../types/measurement/WalkingHeartRateAverageMeasurement";
|
|
4
|
+
import { ObservationMetadata } from "../types/service/ObservationMetadata";
|
|
5
|
+
import { BaseObservationService } from "./base-observation-service";
|
|
6
|
+
export declare class WalkingHeartRateAverageService extends BaseObservationService<WalkingHeartRateAverageMeasurement> {
|
|
7
|
+
protected measurementTypeKey: MeasurementTypeKey;
|
|
8
|
+
protected measurementTypeName: string;
|
|
9
|
+
protected observationMetadata: ObservationMetadata<WalkingHeartRateAverageMeasurement>[];
|
|
10
|
+
convertSamplesToMeasurement(samples: Sample[]): WalkingHeartRateAverageMeasurement;
|
|
11
|
+
convertRecordToMeasurement(): WalkingHeartRateAverageMeasurement;
|
|
12
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WalkingHeartRateAverageService = void 0;
|
|
4
|
+
const types_1 = require("../../../types");
|
|
5
|
+
const base_observation_service_1 = require("./base-observation-service");
|
|
6
|
+
class WalkingHeartRateAverageService extends base_observation_service_1.BaseObservationService {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(...arguments);
|
|
9
|
+
this.measurementTypeKey = types_1.MeasurementTypeKey.walkingHeartRateAverage;
|
|
10
|
+
this.measurementTypeName = "walking heart rate average";
|
|
11
|
+
this.observationMetadata = [
|
|
12
|
+
{
|
|
13
|
+
primaryCode: types_1.ObservationCode.WALKING_HEART_RATE_AVERAGE,
|
|
14
|
+
additionalCodes: [],
|
|
15
|
+
display: "Walking Heart Rate Average",
|
|
16
|
+
unit: "bpm",
|
|
17
|
+
valueKey: "walkingHeartRateAverage",
|
|
18
|
+
toFixed: 0,
|
|
19
|
+
},
|
|
20
|
+
];
|
|
21
|
+
}
|
|
22
|
+
convertSamplesToMeasurement(samples) {
|
|
23
|
+
var _a;
|
|
24
|
+
const walkingHeartRateAverageQuantity = (_a = samples.find((x) => x.quantityType === "HKQuantityTypeIdentifierWalkingHeartRateAverage")) === null || _a === void 0 ? void 0 : _a.quantity;
|
|
25
|
+
return {
|
|
26
|
+
walkingHeartRateAverage: walkingHeartRateAverageQuantity,
|
|
27
|
+
measurementTypeKey: types_1.MeasurementTypeKey.walkingHeartRateAverage,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
convertRecordToMeasurement() {
|
|
31
|
+
// Android doesn't have a walking heart rate average record type
|
|
32
|
+
return {
|
|
33
|
+
walkingHeartRateAverage: 0,
|
|
34
|
+
measurementTypeKey: types_1.MeasurementTypeKey.walkingHeartRateAverage,
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
exports.WalkingHeartRateAverageService = WalkingHeartRateAverageService;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { CodeableConcept, Observation } from "@medplum/fhirtypes";
|
|
2
|
+
import { RecordResult, RecordType } from "./generate-measurement/HealthConnectTypes";
|
|
3
|
+
import { Sample } from "./generate-measurement/Sample";
|
|
4
|
+
import { ObservationValue } from "./generate-observation-body/ObservationValue";
|
|
5
|
+
import { Measurement } from "./measurement/Measurement";
|
|
6
|
+
export interface IObservationService {
|
|
7
|
+
generateValues: (measurement: Measurement) => ObservationValue[];
|
|
8
|
+
getObservationCodes: () => CodeableConcept[];
|
|
9
|
+
getAdditionalProperties: (measurement: Measurement) => Partial<Observation>[];
|
|
10
|
+
getUnits: () => string[];
|
|
11
|
+
getMeasurementDisplay: (measurement: Measurement) => string;
|
|
12
|
+
getObservationDisplay: (observations: Observation[]) => string | undefined;
|
|
13
|
+
convertSamplesToMeasurement: (samples: Sample[]) => Measurement;
|
|
14
|
+
convertRecordToMeasurement: (record: RecordResult<RecordType>) => Measurement;
|
|
15
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export declare enum MeasurementTypeKey {
|
|
2
|
+
symptomQuestionnaire = "symptom-questionnaire",
|
|
3
|
+
bloodGlucose = "blood-glucose",
|
|
4
|
+
bloodPressure = "blood-pressure",
|
|
5
|
+
ecg = "ecg",
|
|
6
|
+
bloodOxygenPulseRate = "blood-oxygen-pulse-rate",
|
|
7
|
+
bodyWeight = "body-weight",
|
|
8
|
+
temperature = "body-temperature",
|
|
9
|
+
cosinussMultiParam = "cosinuss-multi-param",
|
|
10
|
+
uricAcid = "uric-acid",
|
|
11
|
+
heartRate = "heart-rate",
|
|
12
|
+
heartRateVariability = "heart-rate-variability",
|
|
13
|
+
respiratoryRate = "respiratory-rate",
|
|
14
|
+
vo2Max = "vo2-max",
|
|
15
|
+
photoUpload = "photo-upload",
|
|
16
|
+
spirometryPanel = "spirometry-panel",
|
|
17
|
+
stepCount = "step-count",
|
|
18
|
+
restingHeartRate = "resting-heart-rate",
|
|
19
|
+
walkingHeartRateAverage = "walking-heart-rate-average"
|
|
20
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MeasurementTypeKey = void 0;
|
|
4
|
+
var MeasurementTypeKey;
|
|
5
|
+
(function (MeasurementTypeKey) {
|
|
6
|
+
MeasurementTypeKey["symptomQuestionnaire"] = "symptom-questionnaire";
|
|
7
|
+
MeasurementTypeKey["bloodGlucose"] = "blood-glucose";
|
|
8
|
+
MeasurementTypeKey["bloodPressure"] = "blood-pressure";
|
|
9
|
+
MeasurementTypeKey["ecg"] = "ecg";
|
|
10
|
+
MeasurementTypeKey["bloodOxygenPulseRate"] = "blood-oxygen-pulse-rate";
|
|
11
|
+
MeasurementTypeKey["bodyWeight"] = "body-weight";
|
|
12
|
+
MeasurementTypeKey["temperature"] = "body-temperature";
|
|
13
|
+
MeasurementTypeKey["cosinussMultiParam"] = "cosinuss-multi-param";
|
|
14
|
+
MeasurementTypeKey["uricAcid"] = "uric-acid";
|
|
15
|
+
MeasurementTypeKey["heartRate"] = "heart-rate";
|
|
16
|
+
MeasurementTypeKey["heartRateVariability"] = "heart-rate-variability";
|
|
17
|
+
MeasurementTypeKey["respiratoryRate"] = "respiratory-rate";
|
|
18
|
+
MeasurementTypeKey["vo2Max"] = "vo2-max";
|
|
19
|
+
MeasurementTypeKey["photoUpload"] = "photo-upload";
|
|
20
|
+
MeasurementTypeKey["spirometryPanel"] = "spirometry-panel";
|
|
21
|
+
MeasurementTypeKey["stepCount"] = "step-count";
|
|
22
|
+
MeasurementTypeKey["restingHeartRate"] = "resting-heart-rate";
|
|
23
|
+
MeasurementTypeKey["walkingHeartRateAverage"] = "walking-heart-rate-average";
|
|
24
|
+
})(MeasurementTypeKey || (exports.MeasurementTypeKey = MeasurementTypeKey = {}));
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export declare enum ObservationCode {
|
|
2
|
+
BLOOD_PRESSURE_HEART_RATE = "8885-6",
|
|
3
|
+
BLOOD_GLUCOSE = "2340-8",
|
|
4
|
+
KETONE = "33903-6",
|
|
5
|
+
SYMPTOM = "45853-9",
|
|
6
|
+
CHOLESTEROL = "12183-0",
|
|
7
|
+
URIC_ACID = "25548-9",
|
|
8
|
+
LACTATE = "32693-4",
|
|
9
|
+
ECG_HEART_RATE = "8886-4",
|
|
10
|
+
HEART_RATE = "8867-4",
|
|
11
|
+
OXYGEN_SATURATION_HEART_RATE = "8889-8",
|
|
12
|
+
DIASTOLIC_BLOOD_PRESSURE = "8462-4",
|
|
13
|
+
SYSTOLIC_BLOOD_PRESSURE = "8480-6",
|
|
14
|
+
OXYGEN_SATURATION = "2708-6",
|
|
15
|
+
OXYGEN_SATURATION_GRAPH = "2708",
|
|
16
|
+
BODY_TEMPERATURE = "8310-5",
|
|
17
|
+
ECG = "131328",
|
|
18
|
+
RESPIRATORY_RATE = "9279-1",
|
|
19
|
+
SPIROMETRY_PANEL = "62639-0",
|
|
20
|
+
HEART_RATE_VARIABILITY = "80404-7",
|
|
21
|
+
VO2_MAX = "60842-2",
|
|
22
|
+
MOOD = "52497-5",
|
|
23
|
+
BODY_HEIGHT = "8302-2",
|
|
24
|
+
BODY_WEIGHT = "29463-7",
|
|
25
|
+
GRATITUDE = "91262-6",
|
|
26
|
+
STEPS = "41950-7",
|
|
27
|
+
PAIN = "94085-8",
|
|
28
|
+
FATIGUE = "94085-9",
|
|
29
|
+
SLEEP_QUALITY = "94086-1",
|
|
30
|
+
STRESS_LEVEL = "94086-2",
|
|
31
|
+
MUSCLE_SORENESS = "94086-3",
|
|
32
|
+
BURNED_CALORIES = "41981-2",
|
|
33
|
+
PHOTOGRAPHIC_IMAGE = "72170-4",
|
|
34
|
+
PHENX_RESPIRATORY = "62628-3",
|
|
35
|
+
RESTING_HEART_RATE = "40443-4",
|
|
36
|
+
WALKING_HEART_RATE_AVERAGE = "40442-6"
|
|
37
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ObservationCode = void 0;
|
|
4
|
+
var ObservationCode;
|
|
5
|
+
(function (ObservationCode) {
|
|
6
|
+
ObservationCode["BLOOD_PRESSURE_HEART_RATE"] = "8885-6";
|
|
7
|
+
ObservationCode["BLOOD_GLUCOSE"] = "2340-8";
|
|
8
|
+
ObservationCode["KETONE"] = "33903-6";
|
|
9
|
+
ObservationCode["SYMPTOM"] = "45853-9";
|
|
10
|
+
ObservationCode["CHOLESTEROL"] = "12183-0";
|
|
11
|
+
ObservationCode["URIC_ACID"] = "25548-9";
|
|
12
|
+
ObservationCode["LACTATE"] = "32693-4";
|
|
13
|
+
ObservationCode["ECG_HEART_RATE"] = "8886-4";
|
|
14
|
+
ObservationCode["HEART_RATE"] = "8867-4";
|
|
15
|
+
ObservationCode["OXYGEN_SATURATION_HEART_RATE"] = "8889-8";
|
|
16
|
+
ObservationCode["DIASTOLIC_BLOOD_PRESSURE"] = "8462-4";
|
|
17
|
+
ObservationCode["SYSTOLIC_BLOOD_PRESSURE"] = "8480-6";
|
|
18
|
+
ObservationCode["OXYGEN_SATURATION"] = "2708-6";
|
|
19
|
+
ObservationCode["OXYGEN_SATURATION_GRAPH"] = "2708";
|
|
20
|
+
ObservationCode["BODY_TEMPERATURE"] = "8310-5";
|
|
21
|
+
ObservationCode["ECG"] = "131328";
|
|
22
|
+
ObservationCode["RESPIRATORY_RATE"] = "9279-1";
|
|
23
|
+
ObservationCode["SPIROMETRY_PANEL"] = "62639-0";
|
|
24
|
+
ObservationCode["HEART_RATE_VARIABILITY"] = "80404-7";
|
|
25
|
+
ObservationCode["VO2_MAX"] = "60842-2";
|
|
26
|
+
ObservationCode["MOOD"] = "52497-5";
|
|
27
|
+
ObservationCode["BODY_HEIGHT"] = "8302-2";
|
|
28
|
+
ObservationCode["BODY_WEIGHT"] = "29463-7";
|
|
29
|
+
ObservationCode["GRATITUDE"] = "91262-6";
|
|
30
|
+
ObservationCode["STEPS"] = "41950-7";
|
|
31
|
+
ObservationCode["PAIN"] = "94085-8";
|
|
32
|
+
ObservationCode["FATIGUE"] = "94085-9";
|
|
33
|
+
ObservationCode["SLEEP_QUALITY"] = "94086-1";
|
|
34
|
+
ObservationCode["STRESS_LEVEL"] = "94086-2";
|
|
35
|
+
ObservationCode["MUSCLE_SORENESS"] = "94086-3";
|
|
36
|
+
ObservationCode["BURNED_CALORIES"] = "41981-2";
|
|
37
|
+
ObservationCode["PHOTOGRAPHIC_IMAGE"] = "72170-4";
|
|
38
|
+
ObservationCode["PHENX_RESPIRATORY"] = "62628-3";
|
|
39
|
+
ObservationCode["RESTING_HEART_RATE"] = "40443-4";
|
|
40
|
+
ObservationCode["WALKING_HEART_RATE_AVERAGE"] = "40442-6";
|
|
41
|
+
})(ObservationCode || (exports.ObservationCode = ObservationCode = {}));
|