@f1studio/form-spec 5.0.0-alpha.140 → 5.0.0-alpha.142
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/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRElementTypeMap.d.ts +3 -2
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRElementTypeMap.d.ts.map +1 -1
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRFieldTypeMapper.d.ts.map +1 -1
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMREncoder.d.ts.map +1 -1
- package/FormSpec.FS/Integrations/OpenFda/OpenFdaTypes.d.ts +74 -0
- package/FormSpec.FS/Integrations/OpenFda/OpenFdaTypes.d.ts.map +1 -0
- package/FormSpec.TS/FormSpec.FS/BlueprintValidation.js.map +1 -1
- package/FormSpec.TS/FormSpec.FS/BlueprintValidation.ts.map +1 -1
- package/FormSpec.TS/FormSpec.FS/FormSpecHelpers.js.map +1 -1
- package/FormSpec.TS/FormSpec.FS/FormSpecHelpers.ts.map +1 -1
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRElementTypeMap.js +36 -30
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRElementTypeMap.js.map +1 -1
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRElementTypeMap.ts.map +1 -1
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRFieldTypeMapper.js +4 -19
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRFieldTypeMapper.js.map +1 -1
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRFieldTypeMapper.ts.map +1 -1
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTemplateToFormSpec.js.map +1 -1
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTemplateToFormSpec.ts.map +1 -1
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMREncoder.js +12 -2
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMREncoder.js.map +1 -1
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMREncoder.ts.map +1 -1
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMRSourceMap.js.map +1 -1
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMRSourceMap.ts.map +1 -1
- package/FormSpec.TS/FormSpec.FS/Integrations/CorEMR/TemplateManifestDecoder.js.map +1 -1
- package/FormSpec.TS/FormSpec.FS/Integrations/CorEMR/TemplateManifestDecoder.ts.map +1 -1
- package/FormSpec.TS/FormSpec.FS/Integrations/OpenFda/OpenFdaTypes.js +282 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/OpenFda/OpenFdaTypes.js.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/OpenFda/OpenFdaTypes.ts.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Interop/Facade/FormAnswersGate.js.map +1 -1
- package/FormSpec.TS/FormSpec.FS/Interop/Facade/FormAnswersGate.ts.map +1 -1
- package/FormSpec.TS/FormSpec.FS/Interop/FormSpec.Api.Helpers.js.map +1 -1
- package/FormSpec.TS/FormSpec.FS/Interop/FormSpec.Api.Helpers.ts.map +1 -1
- package/FormSpec.TS/FormSpec.FS/Interop/FormSpec.Api.Option.js.map +1 -1
- package/FormSpec.TS/FormSpec.FS/Interop/FormSpec.Api.Option.ts.map +1 -1
- package/FormSpec.TS/FormSpec.FS/Interop/FormSpec.Values.Api.Option.js.map +1 -1
- package/FormSpec.TS/FormSpec.FS/Interop/FormSpec.Values.Api.Option.ts.map +1 -1
- package/FormSpec.TS/FormSpec.FS/Migrator.js.map +1 -1
- package/FormSpec.TS/FormSpec.FS/Migrator.ts.map +1 -1
- package/FormSpec.TS/FormSpec.FS/PathwayExecutor.js.map +1 -1
- package/FormSpec.TS/FormSpec.FS/PathwayExecutor.ts.map +1 -1
- package/FormSpec.TS/PluginRegistration.js +2 -0
- package/FormSpec.TS/PluginRegistration.js.map +1 -1
- package/FormSpec.TS/PluginRegistration.ts.map +1 -1
- package/FormSpec.TS/Thoth.Json/packages/Thoth.Json/Decode.js +63 -69
- package/FormSpec.TS/Thoth.Json/packages/Thoth.Json/Decode.js.map +1 -1
- package/FormSpec.TS/Thoth.Json/packages/Thoth.Json/Decode.ts.map +1 -1
- package/FormSpec.TS/Thoth.Json/packages/Thoth.Json/Encode.js +6 -10
- package/FormSpec.TS/Thoth.Json/packages/Thoth.Json/Encode.js.map +1 -1
- package/FormSpec.TS/Thoth.Json/packages/Thoth.Json/Encode.ts.map +1 -1
- package/FormSpec.TS/fable_modules/Fable.Promise.3.2.0/AsyncIterable.fs +57 -0
- package/FormSpec.TS/fable_modules/Fable.Promise.3.2.0/AsyncIterable.fs.js +119 -0
- package/FormSpec.TS/fable_modules/Fable.Promise.3.2.0/AsyncIterable.fs.js.map +1 -0
- package/FormSpec.TS/fable_modules/Fable.Promise.3.2.0/AsyncIterable.fs.ts.map +1 -0
- package/FormSpec.TS/fable_modules/Fable.Promise.3.2.0/Fable.Promise.fableproj +20 -0
- package/FormSpec.TS/fable_modules/Fable.Promise.3.2.0/Promise.fs +766 -0
- package/FormSpec.TS/fable_modules/Fable.Promise.3.2.0/Promise.fs.js +165 -0
- package/FormSpec.TS/fable_modules/Fable.Promise.3.2.0/Promise.fs.js.map +1 -0
- package/FormSpec.TS/fable_modules/Fable.Promise.3.2.0/Promise.fs.ts.map +1 -0
- package/FormSpec.TS/fable_modules/Fable.Promise.3.2.0/PromiseImpl.fs +31 -0
- package/FormSpec.TS/fable_modules/Fable.Promise.3.2.0/PromiseImpl.fs.js +32 -0
- package/FormSpec.TS/fable_modules/Fable.Promise.3.2.0/PromiseImpl.fs.js.map +1 -0
- package/FormSpec.TS/fable_modules/Fable.Promise.3.2.0/PromiseImpl.fs.ts.map +1 -0
- package/FormSpec.TS/fable_modules/Feliz.2.8.0/DateParsing.fs.js.map +1 -1
- package/FormSpec.TS/fable_modules/Feliz.2.8.0/DateParsing.fs.ts.map +1 -1
- package/FormSpec.TS/fable_modules/project_cracked.json +1 -1
- package/FormSpec.TS/plugins/allergyfinder/src/AllergyFinderField.js +2431 -0
- package/FormSpec.TS/plugins/allergyfinder/src/AllergyFinderField.js.map +1 -0
- package/FormSpec.TS/plugins/allergyfinder/src/AllergyFinderField.ts.map +1 -0
- package/FormSpec.TS/plugins/allergyfinder/src/OpenFdaClient.js +107 -0
- package/FormSpec.TS/plugins/allergyfinder/src/OpenFdaClient.js.map +1 -0
- package/FormSpec.TS/plugins/allergyfinder/src/OpenFdaClient.ts.map +1 -0
- package/FormSpec.TS/plugins/vitals/src/VitalsField.js +85 -364
- package/FormSpec.TS/plugins/vitals/src/VitalsField.js.map +1 -1
- package/FormSpec.TS/plugins/vitals/src/VitalsField.ts.map +1 -1
- package/FormSpec.TS/plugins/vitals/src/VitalsLogic.js +548 -0
- package/FormSpec.TS/plugins/vitals/src/VitalsLogic.js.map +1 -0
- package/FormSpec.TS/plugins/vitals/src/VitalsLogic.ts.map +1 -0
- package/README.md +7 -7
- package/Thoth.Json/packages/Thoth.Json/Decode.d.ts +2 -2
- package/Thoth.Json/packages/Thoth.Json/Decode.d.ts.map +1 -1
- package/Thoth.Json/packages/Thoth.Json/Encode.d.ts.map +1 -1
- package/fable_modules/Fable.Promise.3.2.0/Promise.fs.d.ts +112 -0
- package/fable_modules/Fable.Promise.3.2.0/Promise.fs.d.ts.map +1 -0
- package/fable_modules/Fable.Promise.3.2.0/PromiseImpl.fs.d.ts +8 -0
- package/fable_modules/Fable.Promise.3.2.0/PromiseImpl.fs.d.ts.map +1 -0
- package/package.json +5 -1
- package/plugins/allergyfinder/src/AllergyFinderField.d.ts +116 -0
- package/plugins/allergyfinder/src/AllergyFinderField.d.ts.map +1 -0
- package/plugins/allergyfinder/src/OpenFdaClient.d.ts +5 -0
- package/plugins/allergyfinder/src/OpenFdaClient.d.ts.map +1 -0
- package/plugins/vitals/src/VitalsField.d.ts +4 -43
- package/plugins/vitals/src/VitalsField.d.ts.map +1 -1
- package/plugins/vitals/src/VitalsLogic.d.ts +78 -0
- package/plugins/vitals/src/VitalsLogic.d.ts.map +1 -0
- package/src/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRElementTypeMap.ts +35 -32
- package/src/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRFieldTypeMapper.ts +5 -22
- package/src/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMREncoder.ts +13 -2
- package/src/FormSpec.FS/Integrations/OpenFda/OpenFdaTypes.ts +160 -0
- package/src/PluginRegistration.ts +2 -0
- package/src/Thoth.Json/packages/Thoth.Json/Decode.ts +38 -55
- package/src/Thoth.Json/packages/Thoth.Json/Encode.ts +10 -16
- package/src/plugins/allergyfinder/src/AllergyFinderField.ts +1341 -0
- package/src/plugins/allergyfinder/src/OpenFdaClient.ts +103 -0
- package/src/plugins/vitals/src/VitalsField.ts +78 -298
- package/src/plugins/vitals/src/VitalsLogic.ts +399 -0
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import { FSharpRef, Record } from "@fable-org/fable-library-js/Types.js";
|
|
2
|
-
import {
|
|
3
|
-
import { float64 } from "@fable-org/fable-library-js/Int32.js";
|
|
2
|
+
import { isCriticalOxygenSat, isCriticalRespiration, isCriticalPulse, isCriticalDiastolicBP, isCriticalSystolicBP, isNormalTemperature, isCriticalTemperature, isValidPainScale, isValidOxygenSat, isValidRespiration, isValidPulse, isValidDiastolicBP, isValidSystolicBP, isValidTemperature, VitalPropertyValidation, validateVitalsProperty, serializeVitalsData, VitalsData, parseVitalsData, VitalsConfig_$reflection, VitalsConfig } from "./VitalsLogic.js";
|
|
4
3
|
import { equals, createObj, IComparable, IEquatable } from "@fable-org/fable-library-js/Util.js";
|
|
5
|
-
import { class_type, string_type, bool_type, record_type, option_type, float64_type, TypeInfo } from "@fable-org/fable-library-js/Reflection.js";
|
|
6
4
|
import { mapValues, Field$3, IAttributes } from "../../../fable_modules/Fable.Form.3.0.0/Field.fs.js";
|
|
5
|
+
import { class_type, record_type, string_type, TypeInfo } from "@fable-org/fable-library-js/Reflection.js";
|
|
7
6
|
import { Form$3, FieldConfig$4, field as field_1 } from "../../../fable_modules/Fable.Form.3.0.0/Base.fs.js";
|
|
8
|
-
import { printf, toText,
|
|
9
|
-
import { item } from "@fable-org/fable-library-js/Array.js";
|
|
10
|
-
import { tryParse, parse } from "@fable-org/fable-library-js/Double.js";
|
|
7
|
+
import { join, printf, toText, isNullOrWhiteSpace, isNullOrEmpty } from "@fable-org/fable-library-js/String.js";
|
|
11
8
|
import { createElement } from "react";
|
|
12
9
|
import React from "react";
|
|
10
|
+
import { some, bind, value as value_144, Option, map, defaultArg } from "@fable-org/fable-library-js/Option.js";
|
|
11
|
+
import { float64 } from "@fable-org/fable-library-js/Int32.js";
|
|
13
12
|
import { reactApi } from "../../../fable_modules/Feliz.2.8.0/Interop.fs.js";
|
|
13
|
+
import { tryParse } from "@fable-org/fable-library-js/Double.js";
|
|
14
14
|
import { ReactElement } from "../../../fable_modules/Fable.React.Types.18.3.0/Fable.React.fs.js";
|
|
15
|
+
import { empty, singleton, append, delay, toList } from "@fable-org/fable-library-js/Seq.js";
|
|
15
16
|
import { append as append_1, cons, empty as empty_1, tryFind, FSharpList, exists, singleton as singleton_1, ofArray } from "@fable-org/fable-library-js/List.js";
|
|
17
|
+
import { IReactProperty } from "../../../fable_modules/Feliz.2.8.0/Types.fs.js";
|
|
16
18
|
import { withLabelAndError } from "../../../fable_modules/Fable.Form.Simple.Bulma.5.0.1/Html.View.fs.js";
|
|
17
|
-
import { empty, singleton, append, delay, toList } from "@fable-org/fable-library-js/Seq.js";
|
|
18
19
|
import { IStandardField$3_$reflection, IStandardField$3, IField$1, StandardRenderFieldConfig$2 } from "../../../fable_modules/Fable.Form.Simple.Bulma.5.0.1/Types.fs.js";
|
|
19
20
|
import { Spec_FormField$1, Spec_FieldType_$union, Shared_FieldOption, Shared_FieldValue_$union, Shared_FieldKey, Shared_FieldValue_PluginData, Shared_PluginDataProperty, Shared_PluginPropertyKey, Spec_PluginFieldConfig } from "../../../FormSpec.FS/FormSpec.js";
|
|
20
21
|
import { FSharpResult$2_$union, FSharpResult$2_Error, FSharpResult$2_Ok } from "@fable-org/fable-library-js/Result.js";
|
|
@@ -23,57 +24,11 @@ import { Helpers_combineClasses } from "../../../fable_modules/Feliz.Bulma.3.0.0
|
|
|
23
24
|
import { RenderPreviewProps$1 } from "../../../FormSpec.FS/Interfaces.js";
|
|
24
25
|
import { FieldDetails } from "../../../FormSpec.FS/Designer.js";
|
|
25
26
|
|
|
26
|
-
export class VitalsField_VitalsData extends Record implements IEquatable<VitalsField_VitalsData>, IComparable<VitalsField_VitalsData> {
|
|
27
|
-
readonly Temperature: Option<float64>;
|
|
28
|
-
readonly SystolicBP: Option<float64>;
|
|
29
|
-
readonly DiastolicBP: Option<float64>;
|
|
30
|
-
readonly Pulse: Option<float64>;
|
|
31
|
-
readonly Respiration: Option<float64>;
|
|
32
|
-
readonly OxygenSaturation: Option<float64>;
|
|
33
|
-
readonly PainScale: Option<float64>;
|
|
34
|
-
constructor(Temperature: Option<float64>, SystolicBP: Option<float64>, DiastolicBP: Option<float64>, Pulse: Option<float64>, Respiration: Option<float64>, OxygenSaturation: Option<float64>, PainScale: Option<float64>) {
|
|
35
|
-
super();
|
|
36
|
-
this.Temperature = Temperature;
|
|
37
|
-
this.SystolicBP = SystolicBP;
|
|
38
|
-
this.DiastolicBP = DiastolicBP;
|
|
39
|
-
this.Pulse = Pulse;
|
|
40
|
-
this.Respiration = Respiration;
|
|
41
|
-
this.OxygenSaturation = OxygenSaturation;
|
|
42
|
-
this.PainScale = PainScale;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export function VitalsField_VitalsData_$reflection(): TypeInfo {
|
|
47
|
-
return record_type("Fable.Form.Simple.Bulma.Fields.VitalsField.VitalsField.VitalsData", [], VitalsField_VitalsData, () => [["Temperature", option_type(float64_type)], ["SystolicBP", option_type(float64_type)], ["DiastolicBP", option_type(float64_type)], ["Pulse", option_type(float64_type)], ["Respiration", option_type(float64_type)], ["OxygenSaturation", option_type(float64_type)], ["PainScale", option_type(float64_type)]]);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export class VitalsField_VitalsConfig extends Record implements IEquatable<VitalsField_VitalsConfig>, IComparable<VitalsField_VitalsConfig> {
|
|
51
|
-
readonly IncludeTemperature: boolean;
|
|
52
|
-
readonly IncludeBP: boolean;
|
|
53
|
-
readonly IncludePulse: boolean;
|
|
54
|
-
readonly IncludeRespiration: boolean;
|
|
55
|
-
readonly IncludeOxygenSat: boolean;
|
|
56
|
-
readonly IncludePainScale: boolean;
|
|
57
|
-
constructor(IncludeTemperature: boolean, IncludeBP: boolean, IncludePulse: boolean, IncludeRespiration: boolean, IncludeOxygenSat: boolean, IncludePainScale: boolean) {
|
|
58
|
-
super();
|
|
59
|
-
this.IncludeTemperature = IncludeTemperature;
|
|
60
|
-
this.IncludeBP = IncludeBP;
|
|
61
|
-
this.IncludePulse = IncludePulse;
|
|
62
|
-
this.IncludeRespiration = IncludeRespiration;
|
|
63
|
-
this.IncludeOxygenSat = IncludeOxygenSat;
|
|
64
|
-
this.IncludePainScale = IncludePainScale;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
export function VitalsField_VitalsConfig_$reflection(): TypeInfo {
|
|
69
|
-
return record_type("Fable.Form.Simple.Bulma.Fields.VitalsField.VitalsField.VitalsConfig", [], VitalsField_VitalsConfig, () => [["IncludeTemperature", bool_type], ["IncludeBP", bool_type], ["IncludePulse", bool_type], ["IncludeRespiration", bool_type], ["IncludeOxygenSat", bool_type], ["IncludePainScale", bool_type]]);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
27
|
export class VitalsField_Attributes extends Record implements IEquatable<VitalsField_Attributes>, IComparable<VitalsField_Attributes>, IAttributes {
|
|
73
28
|
readonly FieldId: string;
|
|
74
29
|
readonly Label: string;
|
|
75
|
-
readonly Config:
|
|
76
|
-
constructor(FieldId: string, Label: string, Config:
|
|
30
|
+
readonly Config: VitalsConfig;
|
|
31
|
+
constructor(FieldId: string, Label: string, Config: VitalsConfig) {
|
|
77
32
|
super();
|
|
78
33
|
this.FieldId = FieldId;
|
|
79
34
|
this.Label = Label;
|
|
@@ -86,180 +41,17 @@ export class VitalsField_Attributes extends Record implements IEquatable<VitalsF
|
|
|
86
41
|
}
|
|
87
42
|
|
|
88
43
|
export function VitalsField_Attributes_$reflection(): TypeInfo {
|
|
89
|
-
return record_type("Fable.Form.Simple.Bulma.Fields.VitalsField.VitalsField.Attributes", [], VitalsField_Attributes, () => [["FieldId", string_type], ["Label", string_type], ["Config",
|
|
44
|
+
return record_type("Fable.Form.Simple.Bulma.Fields.VitalsField.VitalsField.Attributes", [], VitalsField_Attributes, () => [["FieldId", string_type], ["Label", string_type], ["Config", VitalsConfig_$reflection()]]);
|
|
90
45
|
}
|
|
91
46
|
|
|
92
47
|
export function VitalsField_form<Values, Field, Output>(): ((arg0: ((arg0: Field$3<VitalsField_Attributes, string, Values>) => Field)) => ((arg0: FieldConfig$4<VitalsField_Attributes, string, Values, Output>) => Form$3<Values, Output, Field>)) {
|
|
93
48
|
return (build: ((arg0: Field$3<VitalsField_Attributes, string, Values>) => Field)): ((arg0: FieldConfig$4<VitalsField_Attributes, string, Values, Output>) => Form$3<Values, Output, Field>) => ((config: FieldConfig$4<VitalsField_Attributes, string, Values, Output>): Form$3<Values, Output, Field> => field_1<string, VitalsField_Attributes, Values, Field, Output>(isNullOrEmpty, build, config));
|
|
94
49
|
}
|
|
95
50
|
|
|
96
|
-
export function VitalsField_isValidTemperature(temp: float64): boolean {
|
|
97
|
-
if (temp >= 95) {
|
|
98
|
-
return temp <= 108;
|
|
99
|
-
}
|
|
100
|
-
else {
|
|
101
|
-
return false;
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
export function VitalsField_isValidSystolicBP(sys: float64): boolean {
|
|
106
|
-
if (sys >= 60) {
|
|
107
|
-
return sys <= 200;
|
|
108
|
-
}
|
|
109
|
-
else {
|
|
110
|
-
return false;
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
export function VitalsField_isValidDiastolicBP(dia: float64): boolean {
|
|
115
|
-
if (dia >= 40) {
|
|
116
|
-
return dia <= 120;
|
|
117
|
-
}
|
|
118
|
-
else {
|
|
119
|
-
return false;
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
export function VitalsField_isValidPulse(pulse: float64): boolean {
|
|
124
|
-
if (pulse >= 40) {
|
|
125
|
-
return pulse <= 180;
|
|
126
|
-
}
|
|
127
|
-
else {
|
|
128
|
-
return false;
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
export function VitalsField_isValidRespiration(resp: float64): boolean {
|
|
133
|
-
if (resp >= 8) {
|
|
134
|
-
return resp <= 35;
|
|
135
|
-
}
|
|
136
|
-
else {
|
|
137
|
-
return false;
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
export function VitalsField_isValidOxygenSat(sat: float64): boolean {
|
|
142
|
-
if (sat >= 70) {
|
|
143
|
-
return sat <= 100;
|
|
144
|
-
}
|
|
145
|
-
else {
|
|
146
|
-
return false;
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
export function VitalsField_isValidPainScale(pain: float64): boolean {
|
|
151
|
-
if (pain >= 0) {
|
|
152
|
-
return pain <= 10;
|
|
153
|
-
}
|
|
154
|
-
else {
|
|
155
|
-
return false;
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
export function VitalsField_isCriticalTemperature(temp: float64): boolean {
|
|
160
|
-
if (temp < 96) {
|
|
161
|
-
return true;
|
|
162
|
-
}
|
|
163
|
-
else {
|
|
164
|
-
return temp > 104;
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
export function VitalsField_isNormalTemperature(temp: float64): boolean {
|
|
169
|
-
if (temp >= 97) {
|
|
170
|
-
return temp <= 99;
|
|
171
|
-
}
|
|
172
|
-
else {
|
|
173
|
-
return false;
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
export function VitalsField_isCriticalSystolicBP(sys: float64): boolean {
|
|
178
|
-
if (sys < 90) {
|
|
179
|
-
return true;
|
|
180
|
-
}
|
|
181
|
-
else {
|
|
182
|
-
return sys > 180;
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
export function VitalsField_isCriticalDiastolicBP(dia: float64): boolean {
|
|
187
|
-
if (dia < 60) {
|
|
188
|
-
return true;
|
|
189
|
-
}
|
|
190
|
-
else {
|
|
191
|
-
return dia > 110;
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
export function VitalsField_isCriticalPulse(pulse: float64): boolean {
|
|
196
|
-
if (pulse < 50) {
|
|
197
|
-
return true;
|
|
198
|
-
}
|
|
199
|
-
else {
|
|
200
|
-
return pulse > 120;
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
export function VitalsField_isCriticalRespiration(resp: float64): boolean {
|
|
205
|
-
if (resp < 12) {
|
|
206
|
-
return true;
|
|
207
|
-
}
|
|
208
|
-
else {
|
|
209
|
-
return resp > 25;
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
export function VitalsField_isCriticalOxygenSat(sat: float64): boolean {
|
|
214
|
-
return sat < 95;
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
export function VitalsField_parseVitalsData(value: string): VitalsField_VitalsData {
|
|
218
|
-
try {
|
|
219
|
-
if (isNullOrWhiteSpace(value)) {
|
|
220
|
-
return new VitalsField_VitalsData(undefined, undefined, undefined, undefined, undefined, undefined, undefined);
|
|
221
|
-
}
|
|
222
|
-
else {
|
|
223
|
-
const parts: string[] = split(value, ["|"], undefined, 0);
|
|
224
|
-
return new VitalsField_VitalsData(((parts.length > 0) && !isNullOrWhiteSpace(item(0, parts))) ? parse(item(0, parts)) : undefined, ((parts.length > 1) && !isNullOrWhiteSpace(item(1, parts))) ? parse(item(1, parts)) : undefined, ((parts.length > 2) && !isNullOrWhiteSpace(item(2, parts))) ? parse(item(2, parts)) : undefined, ((parts.length > 3) && !isNullOrWhiteSpace(item(3, parts))) ? parse(item(3, parts)) : undefined, ((parts.length > 4) && !isNullOrWhiteSpace(item(4, parts))) ? parse(item(4, parts)) : undefined, ((parts.length > 5) && !isNullOrWhiteSpace(item(5, parts))) ? parse(item(5, parts)) : undefined, ((parts.length > 6) && !isNullOrWhiteSpace(item(6, parts))) ? parse(item(6, parts)) : undefined);
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
catch (matchValue: any) {
|
|
228
|
-
return new VitalsField_VitalsData(undefined, undefined, undefined, undefined, undefined, undefined, undefined);
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
export function VitalsField_serializeVitalsData(vitalsData: VitalsField_VitalsData): string {
|
|
233
|
-
const optToString = (opt: Option<float64>): string => defaultArg(map<float64, string>((value: float64): string => value.toString(), opt), "");
|
|
234
|
-
return join("|", [optToString(vitalsData.Temperature), optToString(vitalsData.SystolicBP), optToString(vitalsData.DiastolicBP), optToString(vitalsData.Pulse), optToString(vitalsData.Respiration), optToString(vitalsData.OxygenSaturation), optToString(vitalsData.PainScale)]);
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
export function VitalsField_getVitalStatus(value: Option<float64>, isValid: ((arg0: float64) => boolean), isCritical: ((arg0: float64) => boolean), isNormal: Option<((arg0: float64) => boolean)>): string {
|
|
238
|
-
let v_2: float64;
|
|
239
|
-
if (value == null) {
|
|
240
|
-
return "empty";
|
|
241
|
-
}
|
|
242
|
-
else if (isCritical(value_140(value))) {
|
|
243
|
-
const v_3: float64 = value_140(value);
|
|
244
|
-
return "critical";
|
|
245
|
-
}
|
|
246
|
-
else if (!isValid(value_140(value))) {
|
|
247
|
-
const v_4: float64 = value_140(value);
|
|
248
|
-
return "abnormal";
|
|
249
|
-
}
|
|
250
|
-
else if ((v_2 = value_140(value), (isNormal != null) && !value_140(isNormal)(v_2))) {
|
|
251
|
-
const v_5: float64 = value_140(value);
|
|
252
|
-
return "abnormal";
|
|
253
|
-
}
|
|
254
|
-
else {
|
|
255
|
-
return "normal";
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
|
|
259
51
|
export function VitalsField_VitalsFieldComponent(config: StandardRenderFieldConfig$2<string, VitalsField_Attributes>): ReactElement {
|
|
260
52
|
let elems_12: Iterable<ReactElement>;
|
|
261
|
-
const vitalsData:
|
|
262
|
-
const vitalsConfig:
|
|
53
|
+
const vitalsData: VitalsData = parseVitalsData(config.Value);
|
|
54
|
+
const vitalsConfig: VitalsConfig = config.Attributes.Config;
|
|
263
55
|
let patternInput: [string, ((arg0: string) => void)];
|
|
264
56
|
const initial: string = defaultArg(map<float64, string>((value: float64): string => value.toString(), vitalsData.Temperature), "");
|
|
265
57
|
patternInput = reactApi.useState<string, string>(initial);
|
|
@@ -308,64 +100,52 @@ export function VitalsField_VitalsFieldComponent(config: StandardRenderFieldConf
|
|
|
308
100
|
}
|
|
309
101
|
}
|
|
310
102
|
};
|
|
311
|
-
config.OnChange(
|
|
103
|
+
config.OnChange(serializeVitalsData(new VitalsData(parseOpt(temperature), parseOpt(systolicBP), parseOpt(diastolicBP), parseOpt(pulse), parseOpt(respiration), parseOpt(oxygenSat), parseOpt(painScale))));
|
|
312
104
|
}, dependencies);
|
|
313
|
-
const
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
let outArg_1 = 0;
|
|
320
|
-
matchValue_1 = ([tryParse(raw, new FSharpRef<float64>((): float64 => outArg_1, (v_2: float64): void => {
|
|
321
|
-
outArg_1 = v_2;
|
|
322
|
-
})), outArg_1] as [boolean, float64]);
|
|
323
|
-
if (matchValue_1[0]) {
|
|
324
|
-
return matchValue_1[1];
|
|
325
|
-
}
|
|
326
|
-
else {
|
|
327
|
-
return undefined;
|
|
328
|
-
}
|
|
329
|
-
}
|
|
105
|
+
const statusBadge = (clinicalStatus: string): ReactElement => {
|
|
106
|
+
const patternInput_7: [string, string] = (clinicalStatus === "invalid") ? (["bg-red-100 text-red-800 border border-red-300", "Invalid"] as [string, string]) : ((clinicalStatus === "critical") ? (["bg-red-100 text-red-700 border border-red-200", "Critical"] as [string, string]) : ((clinicalStatus === "abnormal") ? (["bg-amber-100 text-amber-700 border border-amber-200", "Abnormal"] as [string, string]) : ((clinicalStatus === "normal") ? (["bg-emerald-100 text-emerald-700 border border-emerald-200", "Normal"] as [string, string]) : (["bg-slate-100 text-slate-600 border border-slate-200", "Pending"] as [string, string]))));
|
|
107
|
+
return createElement<any>("span", {
|
|
108
|
+
className: `inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${patternInput_7[0]}`,
|
|
109
|
+
children: patternInput_7[1],
|
|
110
|
+
});
|
|
330
111
|
};
|
|
331
|
-
const
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
});
|
|
335
|
-
const createVitalInput = (label_1: string, value_18: string, setValue: ((arg0: string) => void), unitText: string, placeholder: string, isValid: ((arg0: float64) => boolean), isCritical: ((arg0: float64) => boolean), isNormal: Option<((arg0: float64) => boolean)>): ReactElement => {
|
|
336
|
-
let elems_1: Iterable<ReactElement>, elems: Iterable<ReactElement>;
|
|
337
|
-
const vitalStatus: string = VitalsField_getVitalStatus(parseNumeric(value_18), isValid, isCritical, isNormal);
|
|
112
|
+
const createVitalInput = (label_1: string, propertyName: string, value_18: string, setValue: ((arg0: string) => void), unitText: string, placeholder: string): ReactElement => {
|
|
113
|
+
let matchValue_1: string, elems_1: Iterable<ReactElement>;
|
|
114
|
+
const validation: VitalPropertyValidation = validateVitalsProperty(propertyName, value_18);
|
|
338
115
|
let inputClass: string;
|
|
339
116
|
const baseClass = "mt-1 block w-full rounded-md border bg-white px-2.5 py-1.5 text-sm text-slate-900 shadow-sm transition placeholder:text-slate-400 focus:outline-none focus:ring-2 disabled:cursor-not-allowed disabled:bg-slate-100 disabled:text-slate-500";
|
|
340
|
-
inputClass = ((config.ShowError && (config.Error != null)) ? (`${baseClass} border-red-400 focus:border-red-500 focus:ring-red-500/30`) : (`${baseClass} ${(
|
|
341
|
-
return createElement<any>("div", createObj(ofArray([["className", "rounded-lg border border-slate-200 bg-white p-2.5 shadow-sm"] as [string, any], (elems_1 =
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
children:
|
|
356
|
-
|
|
117
|
+
inputClass = ((config.ShowError && (config.Error != null)) ? (`${baseClass} border-red-400 focus:border-red-500 focus:ring-red-500/30`) : (`${baseClass} ${(matchValue_1 = validation.ClinicalStatus, (matchValue_1 === "invalid") ? "border-red-400 focus:border-red-500 focus:ring-red-500/30" : ((matchValue_1 === "critical") ? "border-red-300 focus:border-red-500 focus:ring-red-500/30" : ((matchValue_1 === "abnormal") ? "border-amber-300 focus:border-amber-500 focus:ring-amber-500/30" : "border-slate-300 focus:border-sky-500 focus:ring-sky-500/30")))}`));
|
|
118
|
+
return createElement<any>("div", createObj(ofArray([["className", "rounded-lg border border-slate-200 bg-white p-2.5 shadow-sm"] as [string, any], (elems_1 = toList<ReactElement>(delay<ReactElement>((): Iterable<ReactElement> => {
|
|
119
|
+
let elems: Iterable<ReactElement>;
|
|
120
|
+
return append<ReactElement>(singleton<ReactElement>(createElement<any>("div", createObj(ofArray([["className", "flex items-center justify-between gap-3"] as [string, any], (elems = [createElement<any>("label", {
|
|
121
|
+
className: "text-xs font-semibold uppercase tracking-wide text-slate-700",
|
|
122
|
+
children: label_1,
|
|
123
|
+
}), statusBadge(validation.ClinicalStatus)], ["children", reactApi.Children.toArray(Array.from(elems))] as [string, any])])))), delay<ReactElement>((): Iterable<ReactElement> => append<ReactElement>(singleton<ReactElement>(createElement<any>("input", {
|
|
124
|
+
type: "number",
|
|
125
|
+
className: inputClass,
|
|
126
|
+
value: value_18,
|
|
127
|
+
placeholder: placeholder,
|
|
128
|
+
disabled: config.Disabled ? true : config.IsReadOnly,
|
|
129
|
+
onChange: (ev: Event): void => {
|
|
130
|
+
setValue(ev.target.value);
|
|
131
|
+
},
|
|
132
|
+
})), delay<ReactElement>((): Iterable<ReactElement> => append<ReactElement>((validation.Message !== "") ? singleton<ReactElement>(createElement<any>("p", createObj(toList<IReactProperty>(delay<IReactProperty>((): Iterable<IReactProperty> => append<IReactProperty>(singleton<IReactProperty>(["className", !validation.IsValid ? "mt-1 text-[11px] text-red-600 font-medium" : "mt-1 text-[11px] text-amber-600"] as [string, any]), delay<IReactProperty>((): Iterable<IReactProperty> => singleton<IReactProperty>(["children", validation.Message] as [string, any])))))))) : empty<ReactElement>(), delay<ReactElement>((): Iterable<ReactElement> => singleton<ReactElement>(createElement<any>("p", {
|
|
133
|
+
className: "mt-1 text-[11px] text-slate-500",
|
|
134
|
+
children: unitText,
|
|
135
|
+
}))))))));
|
|
136
|
+
})), ["children", reactApi.Children.toArray(Array.from(elems_1))] as [string, any])])));
|
|
357
137
|
};
|
|
358
138
|
return withLabelAndError(config.Attributes.Label, config.ShowError, config.Error, createElement<any>("div", createObj(ofArray([["className", "space-y-2.5"] as [string, any], (elems_12 = toList<ReactElement>(delay<ReactElement>((): Iterable<ReactElement> => {
|
|
359
139
|
let elems_8: Iterable<ReactElement>;
|
|
360
|
-
return append<ReactElement>(singleton<ReactElement>(createElement<any>("div", createObj(ofArray([["className", "grid grid-cols-1 auto-rows-min content-start items-start gap-2 md:grid-cols-2 lg:grid-cols-3"] as [string, any], (elems_8 = toList<ReactElement>(delay<ReactElement>((): Iterable<ReactElement> => append<ReactElement>(vitalsConfig.IncludeTemperature ? singleton<ReactElement>(createVitalInput("Temperature", temperature, patternInput[1], "Normal: 97-99°F", "98.6"
|
|
361
|
-
let
|
|
362
|
-
return append<ReactElement>(vitalsConfig.IncludeBP ? ((
|
|
140
|
+
return append<ReactElement>(singleton<ReactElement>(createElement<any>("div", createObj(ofArray([["className", "grid grid-cols-1 auto-rows-min content-start items-start gap-2 md:grid-cols-2 lg:grid-cols-3"] as [string, any], (elems_8 = toList<ReactElement>(delay<ReactElement>((): Iterable<ReactElement> => append<ReactElement>(vitalsConfig.IncludeTemperature ? singleton<ReactElement>(createVitalInput("Temperature", "temperature", temperature, patternInput[1], "Normal: 97-99°F", "98.6")) : empty<ReactElement>(), delay<ReactElement>((): Iterable<ReactElement> => {
|
|
141
|
+
let systolicValidation: VitalPropertyValidation, diastolicValidation: VitalPropertyValidation, elems_7: Iterable<ReactElement>, elems_3: Iterable<ReactElement>, elems_2: Iterable<ReactElement>, elems_6: Iterable<ReactElement>, elems_4: Iterable<ReactElement>, value_70: string, elems_5: Iterable<ReactElement>, value_89: string;
|
|
142
|
+
return append<ReactElement>(vitalsConfig.IncludeBP ? ((systolicValidation = validateVitalsProperty("systolic_bp", systolicBP), (diastolicValidation = validateVitalsProperty("diastolic_bp", diastolicBP), singleton<ReactElement>(createElement<any>("div", createObj(ofArray([["className", "rounded-lg border border-slate-200 bg-white p-2.5 shadow-sm"] as [string, any], (elems_7 = [createElement<any>("div", createObj(ofArray([["className", "flex items-center justify-between gap-3"] as [string, any], (elems_3 = [createElement<any>("label", {
|
|
363
143
|
className: "text-xs font-semibold uppercase tracking-wide text-slate-700",
|
|
364
144
|
children: "Blood Pressure",
|
|
365
|
-
}), createElement<any>("div", createObj(ofArray([["className", "inline-flex gap-2"] as [string, any], (elems_2 = [statusBadge(
|
|
145
|
+
}), createElement<any>("div", createObj(ofArray([["className", "inline-flex gap-2"] as [string, any], (elems_2 = [statusBadge(systolicValidation.ClinicalStatus), statusBadge(diastolicValidation.ClinicalStatus)], ["children", reactApi.Children.toArray(Array.from(elems_2))] as [string, any])])))], ["children", reactApi.Children.toArray(Array.from(elems_3))] as [string, any])]))), createElement<any>("div", createObj(ofArray([["className", "mt-1 grid grid-cols-[1fr_auto_1fr] items-center gap-1.5"] as [string, any], (elems_6 = [createElement<any>("div", createObj(singleton_1((elems_4 = [createElement<any>("label", {
|
|
366
146
|
className: "text-[11px] font-medium text-slate-600",
|
|
367
147
|
children: "Systolic",
|
|
368
|
-
}), createElement<any>("input", createObj(ofArray([["type", "number"] as [string, any], (
|
|
148
|
+
}), createElement<any>("input", createObj(ofArray([["type", "number"] as [string, any], (value_70 = "mt-1 block w-full rounded-md border border-slate-300 bg-white px-2.5 py-1.5 text-sm shadow-sm placeholder:text-slate-400 focus:border-sky-500 focus:outline-none focus:ring-2 focus:ring-sky-500/30 disabled:cursor-not-allowed disabled:bg-slate-100 disabled:text-slate-500", ["className", value_70] as [string, any]), ["value", systolicBP] as [string, any], ["placeholder", "120"] as [string, any], ["disabled", config.Disabled ? true : config.IsReadOnly] as [string, any], ["onChange", (ev_1: Event): void => {
|
|
369
149
|
patternInput_1[1](ev_1.target.value);
|
|
370
150
|
}] as [string, any]])))], ["children", reactApi.Children.toArray(Array.from(elems_4))] as [string, any])))), createElement<any>("div", {
|
|
371
151
|
className: "pt-4 text-base font-semibold text-slate-500",
|
|
@@ -373,12 +153,12 @@ export function VitalsField_VitalsFieldComponent(config: StandardRenderFieldConf
|
|
|
373
153
|
}), createElement<any>("div", createObj(singleton_1((elems_5 = [createElement<any>("label", {
|
|
374
154
|
className: "text-[11px] font-medium text-slate-600",
|
|
375
155
|
children: "Diastolic",
|
|
376
|
-
}), createElement<any>("input", createObj(ofArray([["type", "number"] as [string, any], (
|
|
156
|
+
}), createElement<any>("input", createObj(ofArray([["type", "number"] as [string, any], (value_89 = "mt-1 block w-full rounded-md border border-slate-300 bg-white px-2.5 py-1.5 text-sm shadow-sm placeholder:text-slate-400 focus:border-sky-500 focus:outline-none focus:ring-2 focus:ring-sky-500/30 disabled:cursor-not-allowed disabled:bg-slate-100 disabled:text-slate-500", ["className", value_89] as [string, any]), ["value", diastolicBP] as [string, any], ["placeholder", "80"] as [string, any], ["disabled", config.Disabled ? true : config.IsReadOnly] as [string, any], ["onChange", (ev_2: Event): void => {
|
|
377
157
|
patternInput_2[1](ev_2.target.value);
|
|
378
158
|
}] as [string, any]])))], ["children", reactApi.Children.toArray(Array.from(elems_5))] as [string, any]))))], ["children", reactApi.Children.toArray(Array.from(elems_6))] as [string, any])]))), createElement<any>("p", {
|
|
379
159
|
className: "mt-1 text-[11px] text-slate-500",
|
|
380
160
|
children: "mmHg",
|
|
381
|
-
})], ["children", reactApi.Children.toArray(Array.from(elems_7))] as [string, any])]))))))) : empty<ReactElement>(), delay<ReactElement>((): Iterable<ReactElement> => append<ReactElement>(vitalsConfig.IncludePulse ? singleton<ReactElement>(createVitalInput("Pulse Rate", pulse, patternInput_3[1], "BPM", "72"
|
|
161
|
+
})], ["children", reactApi.Children.toArray(Array.from(elems_7))] as [string, any])]))))))) : empty<ReactElement>(), delay<ReactElement>((): Iterable<ReactElement> => append<ReactElement>(vitalsConfig.IncludePulse ? singleton<ReactElement>(createVitalInput("Pulse Rate", "pulse", pulse, patternInput_3[1], "BPM", "72")) : empty<ReactElement>(), delay<ReactElement>((): Iterable<ReactElement> => append<ReactElement>(vitalsConfig.IncludeRespiration ? singleton<ReactElement>(createVitalInput("Respiration Rate", "respiration", respiration, patternInput_4[1], "per minute", "16")) : empty<ReactElement>(), delay<ReactElement>((): Iterable<ReactElement> => append<ReactElement>(vitalsConfig.IncludeOxygenSat ? singleton<ReactElement>(createVitalInput("Oxygen Saturation", "oxygen_saturation", oxygenSat, patternInput_5[1], "%", "98")) : empty<ReactElement>(), delay<ReactElement>((): Iterable<ReactElement> => (vitalsConfig.IncludePainScale ? singleton<ReactElement>(createVitalInput("Pain Scale", "pain_scale", painScale, patternInput_6[1], "0-10 scale", "0")) : empty<ReactElement>())))))))));
|
|
382
162
|
})))), ["children", reactApi.Children.toArray(Array.from(elems_8))] as [string, any])])))), delay<ReactElement>((): Iterable<ReactElement> => {
|
|
383
163
|
let elems_11: Iterable<ReactElement>, elems_10: Iterable<ReactElement>, elems_9: Iterable<ReactElement>;
|
|
384
164
|
return exists<string>((s_1: string): boolean => !isNullOrWhiteSpace(s_1), ofArray([temperature, systolicBP, diastolicBP, pulse, respiration, oxygenSat, painScale])) ? singleton<ReactElement>(createElement<any>("div", createObj(ofArray([["className", "rounded-lg border border-sky-200 bg-sky-50/60 p-2.5 shadow-sm"] as [string, any], (elems_11 = [createElement<any>("h6", {
|
|
@@ -451,8 +231,8 @@ export const Form_PropertyKeys_OxygenSaturation: Shared_PluginPropertyKey = new
|
|
|
451
231
|
export const Form_PropertyKeys_PainScale: Shared_PluginPropertyKey = new Shared_PluginPropertyKey("67890123-4567-89ab-cdef-0123456789ef");
|
|
452
232
|
|
|
453
233
|
export const Form_enhancedVitalsConverter: IPluginValueConverter = new IPluginValueConverter((fieldKey: Shared_FieldKey, pluginValue: any): Option<Shared_FieldValue_$union> => {
|
|
454
|
-
const vitalsData:
|
|
455
|
-
return Shared_FieldValue_PluginData(toList<Shared_PluginDataProperty>(delay<Shared_PluginDataProperty>((): Iterable<Shared_PluginDataProperty> => append<Shared_PluginDataProperty>((vitalsData.Temperature != null) ? singleton<Shared_PluginDataProperty>(new Shared_PluginDataProperty(Form_PropertyKeys_Temperature, "temperature", "float",
|
|
234
|
+
const vitalsData: VitalsData = pluginValue;
|
|
235
|
+
return Shared_FieldValue_PluginData(toList<Shared_PluginDataProperty>(delay<Shared_PluginDataProperty>((): Iterable<Shared_PluginDataProperty> => append<Shared_PluginDataProperty>((vitalsData.Temperature != null) ? singleton<Shared_PluginDataProperty>(new Shared_PluginDataProperty(Form_PropertyKeys_Temperature, "temperature", "float", value_144(vitalsData.Temperature).toString(), "Temperature", "°F", "Body temperature in Fahrenheit")) : empty<Shared_PluginDataProperty>(), delay<Shared_PluginDataProperty>((): Iterable<Shared_PluginDataProperty> => append<Shared_PluginDataProperty>((vitalsData.SystolicBP != null) ? singleton<Shared_PluginDataProperty>(new Shared_PluginDataProperty(Form_PropertyKeys_SystolicBP, "systolic_bp", "float", value_144(vitalsData.SystolicBP).toString(), "Systolic BP", "mmHg", "Systolic blood pressure")) : empty<Shared_PluginDataProperty>(), delay<Shared_PluginDataProperty>((): Iterable<Shared_PluginDataProperty> => append<Shared_PluginDataProperty>((vitalsData.DiastolicBP != null) ? singleton<Shared_PluginDataProperty>(new Shared_PluginDataProperty(Form_PropertyKeys_DiastolicBP, "diastolic_bp", "float", value_144(vitalsData.DiastolicBP).toString(), "Diastolic BP", "mmHg", "Diastolic blood pressure")) : empty<Shared_PluginDataProperty>(), delay<Shared_PluginDataProperty>((): Iterable<Shared_PluginDataProperty> => append<Shared_PluginDataProperty>((vitalsData.Pulse != null) ? singleton<Shared_PluginDataProperty>(new Shared_PluginDataProperty(Form_PropertyKeys_Pulse, "pulse", "float", value_144(vitalsData.Pulse).toString(), "Pulse Rate", "BPM", "Heart rate in beats per minute")) : empty<Shared_PluginDataProperty>(), delay<Shared_PluginDataProperty>((): Iterable<Shared_PluginDataProperty> => append<Shared_PluginDataProperty>((vitalsData.Respiration != null) ? singleton<Shared_PluginDataProperty>(new Shared_PluginDataProperty(Form_PropertyKeys_Respiration, "respiration", "float", value_144(vitalsData.Respiration).toString(), "Respiration Rate", "RPM", "Respiratory rate per minute")) : empty<Shared_PluginDataProperty>(), delay<Shared_PluginDataProperty>((): Iterable<Shared_PluginDataProperty> => append<Shared_PluginDataProperty>((vitalsData.OxygenSaturation != null) ? singleton<Shared_PluginDataProperty>(new Shared_PluginDataProperty(Form_PropertyKeys_OxygenSaturation, "oxygen_saturation", "float", value_144(vitalsData.OxygenSaturation).toString(), "O2 Saturation", "%", "Oxygen saturation percentage")) : empty<Shared_PluginDataProperty>(), delay<Shared_PluginDataProperty>((): Iterable<Shared_PluginDataProperty> => ((vitalsData.PainScale != null) ? singleton<Shared_PluginDataProperty>(new Shared_PluginDataProperty(Form_PropertyKeys_PainScale, "pain_scale", "float", value_144(vitalsData.PainScale).toString(), "Pain Level", "/10", "Pain scale from 0 to 10")) : empty<Shared_PluginDataProperty>()))))))))))))))));
|
|
456
236
|
}, (fieldValue: Shared_FieldValue_$union): Option<any> => {
|
|
457
237
|
switch (fieldValue.tag) {
|
|
458
238
|
case /* PluginData */ 3: {
|
|
@@ -470,10 +250,10 @@ export const Form_enhancedVitalsConverter: IPluginValueConverter = new IPluginVa
|
|
|
470
250
|
return undefined;
|
|
471
251
|
}
|
|
472
252
|
}, tryFind<Shared_PluginDataProperty>((p: Shared_PluginDataProperty): boolean => (p.Name === name), properties));
|
|
473
|
-
return some(new
|
|
253
|
+
return some(new VitalsData(getPropertyValue("temperature"), getPropertyValue("systolic_bp"), getPropertyValue("diastolic_bp"), getPropertyValue("pulse"), getPropertyValue("respiration"), getPropertyValue("oxygen_saturation"), getPropertyValue("pain_scale")));
|
|
474
254
|
}
|
|
475
255
|
case /* Single */ 0:
|
|
476
|
-
return some(
|
|
256
|
+
return some(parseVitalsData(fieldValue.fields[0].Value));
|
|
477
257
|
default:
|
|
478
258
|
return undefined;
|
|
479
259
|
}
|
|
@@ -482,7 +262,7 @@ export const Form_enhancedVitalsConverter: IPluginValueConverter = new IPluginVa
|
|
|
482
262
|
case /* PluginData */ 3:
|
|
483
263
|
return tryFind<Shared_PluginDataProperty>((p_2: Shared_PluginDataProperty): boolean => (p_2.Name === propertyName_1), fieldValue_1.fields[0]);
|
|
484
264
|
case /* Single */ 0: {
|
|
485
|
-
const vitalsData_1:
|
|
265
|
+
const vitalsData_1: VitalsData = parseVitalsData(fieldValue_1.fields[0].Value);
|
|
486
266
|
return (propertyName_1 === "temperature") ? map<float64, Shared_PluginDataProperty>((v_1: float64): Shared_PluginDataProperty => (new Shared_PluginDataProperty(Form_PropertyKeys_Temperature, "temperature", "float", v_1.toString(), "Temperature", "°F", "Body temperature in Fahrenheit")), vitalsData_1.Temperature) : ((propertyName_1 === "systolic_bp") ? map<float64, Shared_PluginDataProperty>((v_2: float64): Shared_PluginDataProperty => (new Shared_PluginDataProperty(Form_PropertyKeys_SystolicBP, "systolic_bp", "float", v_2.toString(), "Systolic BP", "mmHg", "Systolic blood pressure")), vitalsData_1.SystolicBP) : ((propertyName_1 === "diastolic_bp") ? map<float64, Shared_PluginDataProperty>((v_3: float64): Shared_PluginDataProperty => (new Shared_PluginDataProperty(Form_PropertyKeys_DiastolicBP, "diastolic_bp", "float", v_3.toString(), "Diastolic BP", "mmHg", "Diastolic blood pressure")), vitalsData_1.DiastolicBP) : ((propertyName_1 === "pulse") ? map<float64, Shared_PluginDataProperty>((v_4: float64): Shared_PluginDataProperty => (new Shared_PluginDataProperty(Form_PropertyKeys_Pulse, "pulse", "float", v_4.toString(), "Pulse Rate", "BPM", "Heart rate in beats per minute")), vitalsData_1.Pulse) : ((propertyName_1 === "respiration") ? map<float64, Shared_PluginDataProperty>((v_5: float64): Shared_PluginDataProperty => (new Shared_PluginDataProperty(Form_PropertyKeys_Respiration, "respiration", "float", v_5.toString(), "Respiration Rate", "RPM", "Respiratory rate per minute")), vitalsData_1.Respiration) : ((propertyName_1 === "oxygen_saturation") ? map<float64, Shared_PluginDataProperty>((v_6: float64): Shared_PluginDataProperty => (new Shared_PluginDataProperty(Form_PropertyKeys_OxygenSaturation, "oxygen_saturation", "float", v_6.toString(), "O2 Saturation", "%", "Oxygen saturation percentage")), vitalsData_1.OxygenSaturation) : ((propertyName_1 === "pain_scale") ? map<float64, Shared_PluginDataProperty>((v_7: float64): Shared_PluginDataProperty => (new Shared_PluginDataProperty(Form_PropertyKeys_PainScale, "pain_scale", "float", v_7.toString(), "Pain Level", "/10", "Pain scale from 0 to 10")), vitalsData_1.PainScale) : undefined))))));
|
|
487
267
|
}
|
|
488
268
|
default:
|
|
@@ -493,7 +273,7 @@ export const Form_enhancedVitalsConverter: IPluginValueConverter = new IPluginVa
|
|
|
493
273
|
case /* PluginData */ 3:
|
|
494
274
|
return tryFind<Shared_PluginDataProperty>((p_3: Shared_PluginDataProperty): boolean => equals(p_3.PropertyKey, propertyKey_1), fieldValue_2.fields[0]);
|
|
495
275
|
case /* Single */ 0: {
|
|
496
|
-
const vitalsData_2:
|
|
276
|
+
const vitalsData_2: VitalsData = parseVitalsData(fieldValue_2.fields[0].Value);
|
|
497
277
|
return equals(propertyKey_1, Form_PropertyKeys_Temperature) ? map<float64, Shared_PluginDataProperty>((v_8: float64): Shared_PluginDataProperty => (new Shared_PluginDataProperty(Form_PropertyKeys_Temperature, "temperature", "float", v_8.toString(), "Temperature", "°F", "Body temperature in Fahrenheit")), vitalsData_2.Temperature) : (equals(propertyKey_1, Form_PropertyKeys_SystolicBP) ? map<float64, Shared_PluginDataProperty>((v_9: float64): Shared_PluginDataProperty => (new Shared_PluginDataProperty(Form_PropertyKeys_SystolicBP, "systolic_bp", "float", v_9.toString(), "Systolic BP", "mmHg", "Systolic blood pressure")), vitalsData_2.SystolicBP) : (equals(propertyKey_1, Form_PropertyKeys_DiastolicBP) ? map<float64, Shared_PluginDataProperty>((v_10: float64): Shared_PluginDataProperty => (new Shared_PluginDataProperty(Form_PropertyKeys_DiastolicBP, "diastolic_bp", "float", v_10.toString(), "Diastolic BP", "mmHg", "Diastolic blood pressure")), vitalsData_2.DiastolicBP) : (equals(propertyKey_1, Form_PropertyKeys_Pulse) ? map<float64, Shared_PluginDataProperty>((v_11: float64): Shared_PluginDataProperty => (new Shared_PluginDataProperty(Form_PropertyKeys_Pulse, "pulse", "float", v_11.toString(), "Pulse Rate", "BPM", "Heart rate in beats per minute")), vitalsData_2.Pulse) : (equals(propertyKey_1, Form_PropertyKeys_Respiration) ? map<float64, Shared_PluginDataProperty>((v_12: float64): Shared_PluginDataProperty => (new Shared_PluginDataProperty(Form_PropertyKeys_Respiration, "respiration", "float", v_12.toString(), "Respiration Rate", "RPM", "Respiratory rate per minute")), vitalsData_2.Respiration) : (equals(propertyKey_1, Form_PropertyKeys_OxygenSaturation) ? map<float64, Shared_PluginDataProperty>((v_13: float64): Shared_PluginDataProperty => (new Shared_PluginDataProperty(Form_PropertyKeys_OxygenSaturation, "oxygen_saturation", "float", v_13.toString(), "O2 Saturation", "%", "Oxygen saturation percentage")), vitalsData_2.OxygenSaturation) : (equals(propertyKey_1, Form_PropertyKeys_PainScale) ? map<float64, Shared_PluginDataProperty>((v_14: float64): Shared_PluginDataProperty => (new Shared_PluginDataProperty(Form_PropertyKeys_PainScale, "pain_scale", "float", v_14.toString(), "Pain Level", "/10", "Pain scale from 0 to 10")), vitalsData_2.PainScale) : undefined))))));
|
|
498
278
|
}
|
|
499
279
|
default:
|
|
@@ -507,7 +287,7 @@ export const Form_enhancedVitalsConverter: IPluginValueConverter = new IPluginVa
|
|
|
507
287
|
matchValue_1 = ([tryParse(value_1, new FSharpRef<float64>((): float64 => outArg_1, (v_15: float64): void => {
|
|
508
288
|
outArg_1 = v_15;
|
|
509
289
|
})), outArg_1] as [boolean, float64]);
|
|
510
|
-
return matchValue_1[0] ? (
|
|
290
|
+
return matchValue_1[0] ? (isValidTemperature(matchValue_1[1]) ? FSharpResult$2_Ok<void, string>(undefined) : FSharpResult$2_Error<void, string>(("Temperature must be between 95-108°F, got " + matchValue_1[1].toString()) + "°F")) : FSharpResult$2_Error<void, string>("Temperature must be a valid number");
|
|
511
291
|
}
|
|
512
292
|
case "systolic_bp": {
|
|
513
293
|
let matchValue_2: [boolean, float64];
|
|
@@ -515,7 +295,7 @@ export const Form_enhancedVitalsConverter: IPluginValueConverter = new IPluginVa
|
|
|
515
295
|
matchValue_2 = ([tryParse(value_1, new FSharpRef<float64>((): float64 => outArg_2, (v_19: float64): void => {
|
|
516
296
|
outArg_2 = v_19;
|
|
517
297
|
})), outArg_2] as [boolean, float64]);
|
|
518
|
-
return matchValue_2[0] ? (
|
|
298
|
+
return matchValue_2[0] ? (isValidSystolicBP(matchValue_2[1]) ? FSharpResult$2_Ok<void, string>(undefined) : FSharpResult$2_Error<void, string>("Systolic BP must be between 60-200 mmHg, got " + matchValue_2[1].toString())) : FSharpResult$2_Error<void, string>("Systolic BP must be a valid number");
|
|
519
299
|
}
|
|
520
300
|
case "diastolic_bp": {
|
|
521
301
|
let matchValue_3: [boolean, float64];
|
|
@@ -523,7 +303,7 @@ export const Form_enhancedVitalsConverter: IPluginValueConverter = new IPluginVa
|
|
|
523
303
|
matchValue_3 = ([tryParse(value_1, new FSharpRef<float64>((): float64 => outArg_3, (v_23: float64): void => {
|
|
524
304
|
outArg_3 = v_23;
|
|
525
305
|
})), outArg_3] as [boolean, float64]);
|
|
526
|
-
return matchValue_3[0] ? (
|
|
306
|
+
return matchValue_3[0] ? (isValidDiastolicBP(matchValue_3[1]) ? FSharpResult$2_Ok<void, string>(undefined) : FSharpResult$2_Error<void, string>("Diastolic BP must be between 40-120 mmHg, got " + matchValue_3[1].toString())) : FSharpResult$2_Error<void, string>("Diastolic BP must be a valid number");
|
|
527
307
|
}
|
|
528
308
|
case "pulse": {
|
|
529
309
|
let matchValue_4: [boolean, float64];
|
|
@@ -531,7 +311,7 @@ export const Form_enhancedVitalsConverter: IPluginValueConverter = new IPluginVa
|
|
|
531
311
|
matchValue_4 = ([tryParse(value_1, new FSharpRef<float64>((): float64 => outArg_4, (v_27: float64): void => {
|
|
532
312
|
outArg_4 = v_27;
|
|
533
313
|
})), outArg_4] as [boolean, float64]);
|
|
534
|
-
return matchValue_4[0] ? (
|
|
314
|
+
return matchValue_4[0] ? (isValidPulse(matchValue_4[1]) ? FSharpResult$2_Ok<void, string>(undefined) : FSharpResult$2_Error<void, string>("Pulse must be between 40-180 BPM, got " + matchValue_4[1].toString())) : FSharpResult$2_Error<void, string>("Pulse must be a valid number");
|
|
535
315
|
}
|
|
536
316
|
case "respiration": {
|
|
537
317
|
let matchValue_5: [boolean, float64];
|
|
@@ -539,7 +319,7 @@ export const Form_enhancedVitalsConverter: IPluginValueConverter = new IPluginVa
|
|
|
539
319
|
matchValue_5 = ([tryParse(value_1, new FSharpRef<float64>((): float64 => outArg_5, (v_31: float64): void => {
|
|
540
320
|
outArg_5 = v_31;
|
|
541
321
|
})), outArg_5] as [boolean, float64]);
|
|
542
|
-
return matchValue_5[0] ? (
|
|
322
|
+
return matchValue_5[0] ? (isValidRespiration(matchValue_5[1]) ? FSharpResult$2_Ok<void, string>(undefined) : FSharpResult$2_Error<void, string>("Respiration rate must be between 8-35 RPM, got " + matchValue_5[1].toString())) : FSharpResult$2_Error<void, string>("Respiration rate must be a valid number");
|
|
543
323
|
}
|
|
544
324
|
case "oxygen_saturation": {
|
|
545
325
|
let matchValue_6: [boolean, float64];
|
|
@@ -547,7 +327,7 @@ export const Form_enhancedVitalsConverter: IPluginValueConverter = new IPluginVa
|
|
|
547
327
|
matchValue_6 = ([tryParse(value_1, new FSharpRef<float64>((): float64 => outArg_6, (v_35: float64): void => {
|
|
548
328
|
outArg_6 = v_35;
|
|
549
329
|
})), outArg_6] as [boolean, float64]);
|
|
550
|
-
return matchValue_6[0] ? (
|
|
330
|
+
return matchValue_6[0] ? (isValidOxygenSat(matchValue_6[1]) ? FSharpResult$2_Ok<void, string>(undefined) : FSharpResult$2_Error<void, string>(("Oxygen saturation must be between 70-100%, got " + matchValue_6[1].toString()) + "%")) : FSharpResult$2_Error<void, string>("Oxygen saturation must be a valid number");
|
|
551
331
|
}
|
|
552
332
|
case "pain_scale": {
|
|
553
333
|
let matchValue_7: [boolean, float64];
|
|
@@ -555,7 +335,7 @@ export const Form_enhancedVitalsConverter: IPluginValueConverter = new IPluginVa
|
|
|
555
335
|
matchValue_7 = ([tryParse(value_1, new FSharpRef<float64>((): float64 => outArg_7, (v_39: float64): void => {
|
|
556
336
|
outArg_7 = v_39;
|
|
557
337
|
})), outArg_7] as [boolean, float64]);
|
|
558
|
-
return matchValue_7[0] ? (
|
|
338
|
+
return matchValue_7[0] ? (isValidPainScale(matchValue_7[1]) ? FSharpResult$2_Ok<void, string>(undefined) : FSharpResult$2_Error<void, string>("Pain scale must be between 0-10, got " + matchValue_7[1].toString())) : FSharpResult$2_Error<void, string>("Pain scale must be a valid number");
|
|
559
339
|
}
|
|
560
340
|
default:
|
|
561
341
|
return FSharpResult$2_Error<void, string>("Unknown property: " + propertyName_2);
|
|
@@ -565,8 +345,8 @@ export const Form_enhancedVitalsConverter: IPluginValueConverter = new IPluginVa
|
|
|
565
345
|
case /* PluginData */ 3:
|
|
566
346
|
return fieldValue_3.fields[0];
|
|
567
347
|
case /* Single */ 0: {
|
|
568
|
-
const vitalsData_3:
|
|
569
|
-
return toList<Shared_PluginDataProperty>(delay<Shared_PluginDataProperty>((): Iterable<Shared_PluginDataProperty> => append<Shared_PluginDataProperty>((vitalsData_3.Temperature != null) ? singleton<Shared_PluginDataProperty>(new Shared_PluginDataProperty(Form_PropertyKeys_Temperature, "temperature", "float",
|
|
348
|
+
const vitalsData_3: VitalsData = parseVitalsData(fieldValue_3.fields[0].Value);
|
|
349
|
+
return toList<Shared_PluginDataProperty>(delay<Shared_PluginDataProperty>((): Iterable<Shared_PluginDataProperty> => append<Shared_PluginDataProperty>((vitalsData_3.Temperature != null) ? singleton<Shared_PluginDataProperty>(new Shared_PluginDataProperty(Form_PropertyKeys_Temperature, "temperature", "float", value_144(vitalsData_3.Temperature).toString(), "Temperature", "°F", "Body temperature in Fahrenheit")) : empty<Shared_PluginDataProperty>(), delay<Shared_PluginDataProperty>((): Iterable<Shared_PluginDataProperty> => append<Shared_PluginDataProperty>((vitalsData_3.SystolicBP != null) ? singleton<Shared_PluginDataProperty>(new Shared_PluginDataProperty(Form_PropertyKeys_SystolicBP, "systolic_bp", "float", value_144(vitalsData_3.SystolicBP).toString(), "Systolic BP", "mmHg", "Systolic blood pressure")) : empty<Shared_PluginDataProperty>(), delay<Shared_PluginDataProperty>((): Iterable<Shared_PluginDataProperty> => append<Shared_PluginDataProperty>((vitalsData_3.DiastolicBP != null) ? singleton<Shared_PluginDataProperty>(new Shared_PluginDataProperty(Form_PropertyKeys_DiastolicBP, "diastolic_bp", "float", value_144(vitalsData_3.DiastolicBP).toString(), "Diastolic BP", "mmHg", "Diastolic blood pressure")) : empty<Shared_PluginDataProperty>(), delay<Shared_PluginDataProperty>((): Iterable<Shared_PluginDataProperty> => append<Shared_PluginDataProperty>((vitalsData_3.Pulse != null) ? singleton<Shared_PluginDataProperty>(new Shared_PluginDataProperty(Form_PropertyKeys_Pulse, "pulse", "float", value_144(vitalsData_3.Pulse).toString(), "Pulse Rate", "BPM", "Heart rate in beats per minute")) : empty<Shared_PluginDataProperty>(), delay<Shared_PluginDataProperty>((): Iterable<Shared_PluginDataProperty> => append<Shared_PluginDataProperty>((vitalsData_3.Respiration != null) ? singleton<Shared_PluginDataProperty>(new Shared_PluginDataProperty(Form_PropertyKeys_Respiration, "respiration", "float", value_144(vitalsData_3.Respiration).toString(), "Respiration Rate", "RPM", "Respiratory rate per minute")) : empty<Shared_PluginDataProperty>(), delay<Shared_PluginDataProperty>((): Iterable<Shared_PluginDataProperty> => append<Shared_PluginDataProperty>((vitalsData_3.OxygenSaturation != null) ? singleton<Shared_PluginDataProperty>(new Shared_PluginDataProperty(Form_PropertyKeys_OxygenSaturation, "oxygen_saturation", "float", value_144(vitalsData_3.OxygenSaturation).toString(), "O2 Saturation", "%", "Oxygen saturation percentage")) : empty<Shared_PluginDataProperty>(), delay<Shared_PluginDataProperty>((): Iterable<Shared_PluginDataProperty> => ((vitalsData_3.PainScale != null) ? singleton<Shared_PluginDataProperty>(new Shared_PluginDataProperty(Form_PropertyKeys_PainScale, "pain_scale", "float", value_144(vitalsData_3.PainScale).toString(), "Pain Level", "/10", "Pain scale from 0 to 10")) : empty<Shared_PluginDataProperty>())))))))))))))));
|
|
570
350
|
}
|
|
571
351
|
default:
|
|
572
352
|
return empty_1<Shared_PluginDataProperty>();
|
|
@@ -615,37 +395,37 @@ export function Form_markdownRenderer(field: Spec_FormField$1<Spec_FieldType_$un
|
|
|
615
395
|
}
|
|
616
396
|
else {
|
|
617
397
|
try {
|
|
618
|
-
const vitalsData:
|
|
398
|
+
const vitalsData: VitalsData = parseVitalsData(value);
|
|
619
399
|
if (exists<Option<float64>>((option: Option<float64>): boolean => (option != null), ofArray([vitalsData.Temperature, vitalsData.SystolicBP, vitalsData.DiastolicBP, vitalsData.Pulse, vitalsData.Respiration, vitalsData.OxygenSaturation, vitalsData.PainScale]))) {
|
|
620
400
|
let rows: FSharpList<string> = ofArray([("**" + field.Label) + "** 🩺", "", "| Vital Sign | Value | Status |", "|------------|-------|--------|"]);
|
|
621
401
|
if (vitalsData.Temperature != null) {
|
|
622
|
-
const temp: float64 =
|
|
623
|
-
const status: string =
|
|
402
|
+
const temp: float64 = value_144(vitalsData.Temperature);
|
|
403
|
+
const status: string = isCriticalTemperature(temp) ? "🚨 CRITICAL" : (!isValidTemperature(temp) ? "⚠️ ABNORMAL" : (!isNormalTemperature(temp) ? "⚠️ ABNORMAL" : "✅ Normal"));
|
|
624
404
|
rows = append_1(rows, singleton_1(((("| **Temperature** | " + toText(printf("%.1f"))(temp)) + "°F | ") + status) + " |"));
|
|
625
405
|
}
|
|
626
406
|
if ((vitalsData.SystolicBP != null) && (vitalsData.DiastolicBP != null)) {
|
|
627
|
-
const sys: float64 =
|
|
628
|
-
const dia: float64 =
|
|
629
|
-
const status_1: string = (
|
|
407
|
+
const sys: float64 = value_144(vitalsData.SystolicBP);
|
|
408
|
+
const dia: float64 = value_144(vitalsData.DiastolicBP);
|
|
409
|
+
const status_1: string = (isCriticalSystolicBP(sys) ? true : isCriticalDiastolicBP(dia)) ? "🚨 CRITICAL" : ((!isValidSystolicBP(sys) ? true : !isValidDiastolicBP(dia)) ? "⚠️ ABNORMAL" : "✅ Normal");
|
|
630
410
|
rows = append_1(rows, singleton_1(((((("| **Blood Pressure** | " + toText(printf("%.0f"))(sys)) + "/") + toText(printf("%.0f"))(dia)) + " mmHg | ") + status_1) + " |"));
|
|
631
411
|
}
|
|
632
412
|
if (vitalsData.Pulse != null) {
|
|
633
|
-
const pulse: float64 =
|
|
634
|
-
const status_2: string =
|
|
413
|
+
const pulse: float64 = value_144(vitalsData.Pulse);
|
|
414
|
+
const status_2: string = isCriticalPulse(pulse) ? "🚨 CRITICAL" : (!isValidPulse(pulse) ? "⚠️ ABNORMAL" : "✅ Normal");
|
|
635
415
|
rows = append_1(rows, singleton_1(((("| **Pulse Rate** | " + toText(printf("%.0f"))(pulse)) + " BPM | ") + status_2) + " |"));
|
|
636
416
|
}
|
|
637
417
|
if (vitalsData.Respiration != null) {
|
|
638
|
-
const resp: float64 =
|
|
639
|
-
const status_3: string =
|
|
418
|
+
const resp: float64 = value_144(vitalsData.Respiration);
|
|
419
|
+
const status_3: string = isCriticalRespiration(resp) ? "🚨 CRITICAL" : (!isValidRespiration(resp) ? "⚠️ ABNORMAL" : "✅ Normal");
|
|
640
420
|
rows = append_1(rows, singleton_1(((("| **Respiration** | " + toText(printf("%.0f"))(resp)) + " RPM | ") + status_3) + " |"));
|
|
641
421
|
}
|
|
642
422
|
if (vitalsData.OxygenSaturation != null) {
|
|
643
|
-
const sat: float64 =
|
|
644
|
-
const status_4: string =
|
|
423
|
+
const sat: float64 = value_144(vitalsData.OxygenSaturation);
|
|
424
|
+
const status_4: string = isCriticalOxygenSat(sat) ? "🚨 CRITICAL" : (!isValidOxygenSat(sat) ? "⚠️ ABNORMAL" : "✅ Normal");
|
|
645
425
|
rows = append_1(rows, singleton_1(((("| **O2 Saturation** | " + toText(printf("%.0f"))(sat)) + "% | ") + status_4) + " |"));
|
|
646
426
|
}
|
|
647
427
|
if (vitalsData.PainScale != null) {
|
|
648
|
-
const pain: float64 =
|
|
428
|
+
const pain: float64 = value_144(vitalsData.PainScale);
|
|
649
429
|
const status_5: string = (pain >= 7) ? "🔴 Severe" : ((pain >= 4) ? "🟡 Moderate" : "🟢 Mild");
|
|
650
430
|
rows = append_1(rows, singleton_1(((("| **Pain Scale** | " + toText(printf("%.0f"))(pain)) + "/10 | ") + status_5) + " |"));
|
|
651
431
|
}
|