@kenyaemr/esm-patient-clinical-view-app 5.4.2-pre.2716 → 5.4.2-pre.2722
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/.turbo/turbo-build.log +4 -4
- package/dist/805.js +1 -0
- package/dist/805.js.map +1 -0
- package/dist/kenyaemr-esm-patient-clinical-view-app.js +2 -2
- package/dist/kenyaemr-esm-patient-clinical-view-app.js.buildmanifest.json +27 -27
- package/dist/main.js +27 -27
- package/dist/main.js.map +1 -1
- package/dist/routes.json +1 -1
- package/package.json +1 -1
- package/src/config-schema.ts +97 -0
- package/src/contact-list/contact-tracing-history.component.tsx +18 -15
- package/src/maternal-and-child-health/partography/components/pulse-bp-graph.component.tsx +1 -0
- package/src/maternal-and-child-health/partography/components/temperature-graph.component.tsx +218 -0
- package/src/maternal-and-child-health/partography/components/uterine-contractions-graph.component.tsx +209 -0
- package/src/maternal-and-child-health/partography/forms/cervical-contractions-form.component.tsx +211 -0
- package/src/maternal-and-child-health/partography/forms/cervix-form.component.tsx +354 -0
- package/src/maternal-and-child-health/partography/forms/drugs-iv-fluids-form.component.tsx +321 -0
- package/src/maternal-and-child-health/partography/forms/fetal-heart-rate-form.component.tsx +275 -0
- package/src/maternal-and-child-health/partography/forms/index.ts +9 -0
- package/src/maternal-and-child-health/partography/forms/membrane-amniotic-fluid-form.component.tsx +330 -0
- package/src/maternal-and-child-health/partography/forms/oxytocin-form.component.tsx +207 -0
- package/src/maternal-and-child-health/partography/forms/pulse-bp-form.component.tsx +174 -0
- package/src/maternal-and-child-health/partography/forms/temperature-form.component.tsx +210 -0
- package/src/maternal-and-child-health/partography/forms/time-picker-dropdown.component.tsx +218 -0
- package/src/maternal-and-child-health/partography/forms/time-picker-dropdown.scss +107 -0
- package/src/maternal-and-child-health/partography/forms/time-picker-with-clock.component.tsx +174 -0
- package/src/maternal-and-child-health/partography/forms/time-picker-with-clock.scss +178 -0
- package/src/maternal-and-child-health/partography/forms/urine-test-form.component.tsx +255 -0
- package/src/maternal-and-child-health/partography/forms/useCervixData.ts +16 -0
- package/src/maternal-and-child-health/partography/graphs/cervical-contractions-graph.component.tsx +266 -0
- package/src/maternal-and-child-health/partography/graphs/cervix-graph.component.tsx +429 -0
- package/src/maternal-and-child-health/partography/graphs/drugs-iv-fluids-graph-wrapper.component.tsx +163 -0
- package/src/maternal-and-child-health/partography/graphs/drugs-iv-fluids-graph.component.tsx +82 -0
- package/src/maternal-and-child-health/partography/graphs/fetal-heart-rate-graph.component.tsx +359 -0
- package/src/maternal-and-child-health/partography/graphs/index.ts +10 -0
- package/src/maternal-and-child-health/partography/graphs/membrane-amniotic-fluid-graph.component.tsx +266 -0
- package/src/maternal-and-child-health/partography/graphs/oxytocin-graph-wrapper.component.tsx +190 -0
- package/src/maternal-and-child-health/partography/graphs/oxytocin-graph.component.tsx +126 -0
- package/src/maternal-and-child-health/partography/graphs/partograph-graph.component.tsx +266 -0
- package/src/maternal-and-child-health/partography/graphs/pulse-bp-graph-wrapper.component.tsx +298 -0
- package/src/maternal-and-child-health/partography/graphs/pulse-bp-graph.component.tsx +267 -0
- package/src/maternal-and-child-health/partography/graphs/temperature-graph.component.tsx +242 -0
- package/src/maternal-and-child-health/partography/graphs/urine-test-graph.component.tsx +246 -0
- package/src/maternal-and-child-health/partography/partograph.component.tsx +2141 -118
- package/src/maternal-and-child-health/partography/partography-dashboard.meta.ts +8 -0
- package/src/maternal-and-child-health/partography/partography-data-form.scss +163 -0
- package/src/maternal-and-child-health/partography/partography.resource.ts +233 -326
- package/src/maternal-and-child-health/partography/partography.scss +1341 -3
- package/src/maternal-and-child-health/partography/resources/blood-pressure.resource.ts +96 -0
- package/src/maternal-and-child-health/partography/resources/cervical-dilation.resource.ts +109 -0
- package/src/maternal-and-child-health/partography/resources/cervix.resource.ts +362 -0
- package/src/maternal-and-child-health/partography/resources/descent-of-head.resource.ts +101 -0
- package/src/maternal-and-child-health/partography/resources/drugs-fluids.resource.ts +88 -0
- package/src/maternal-and-child-health/partography/resources/fetal-heart-rate.resource.ts +122 -0
- package/src/maternal-and-child-health/partography/resources/maternal-pulse.resource.ts +77 -0
- package/src/maternal-and-child-health/partography/resources/membrane-amniotic-fluid.resource.ts +108 -0
- package/src/maternal-and-child-health/partography/resources/oxytocin.resource.ts +159 -0
- package/src/maternal-and-child-health/partography/resources/progress-events.resource.ts +6 -0
- package/src/maternal-and-child-health/partography/resources/pulse-bp-combined.resource.ts +53 -0
- package/src/maternal-and-child-health/partography/resources/temperature.resource.ts +84 -0
- package/src/maternal-and-child-health/partography/resources/uterine-contractions.resource.ts +173 -0
- package/src/maternal-and-child-health/partography/table/temperature-table.component.tsx +99 -0
- package/src/maternal-and-child-health/partography/table/uterine-contractions-table.component.tsx +86 -0
- package/src/maternal-and-child-health/partography/types/index.ts +319 -101
- package/dist/397.js +0 -1
- package/dist/397.js.map +0 -1
|
@@ -1,48 +1,145 @@
|
|
|
1
|
+
import {
|
|
2
|
+
configSchema,
|
|
3
|
+
MOULDING_NONE_CONCEPT,
|
|
4
|
+
MOULDING_SLIGHT_CONCEPT,
|
|
5
|
+
MOULDING_MODERATE_CONCEPT,
|
|
6
|
+
MOULDING_SEVERE_CONCEPT,
|
|
7
|
+
CERVIX_CONCEPT,
|
|
8
|
+
FETAL_HEART_RATE_CONCEPT,
|
|
9
|
+
FETAL_HEART_RATE_HOUR_CONCEPT,
|
|
10
|
+
DESCENT_OF_HEAD_CONCEPT,
|
|
11
|
+
UTERINE_CONTRACTIONS_CONCEPT,
|
|
12
|
+
UTERINE_CONTRACTION_FREQUENCY_CONCEPT,
|
|
13
|
+
UTERINE_CONTRACTION_DURATION_CONCEPT,
|
|
14
|
+
MATERNAL_PULSE_CONCEPT,
|
|
15
|
+
ROUTE_CONCEPT,
|
|
16
|
+
FREQUENCY_CONCEPT,
|
|
17
|
+
SYSTOLIC_BP_CONCEPT,
|
|
18
|
+
DIASTOLIC_BP_CONCEPT,
|
|
19
|
+
TEMPERATURE_CONCEPT,
|
|
20
|
+
PROTEIN_LEVEL_CONCEPT,
|
|
21
|
+
GLUCOSE_LEVEL_CONCEPT,
|
|
22
|
+
KETONE_LEVEL_CONCEPT,
|
|
23
|
+
URINE_VOLUME_CONCEPT,
|
|
24
|
+
CONTRACTION_COUNT_CONCEPT,
|
|
25
|
+
URINE_CHARACTERISTICS_CONCEPT,
|
|
26
|
+
MEDICATION_CONCEPT,
|
|
27
|
+
MEDICATION_NAME_CONCEPT,
|
|
28
|
+
OXYTOCIN_DOSE_CONCEPT,
|
|
29
|
+
IV_FLUIDS_CONCEPT,
|
|
30
|
+
DOSAGE_CONCEPT,
|
|
31
|
+
DRUG_DOSE_CONCEPT,
|
|
32
|
+
EVENT_TYPE_CONCEPT,
|
|
33
|
+
EVENT_DESCRIPTION_CONCEPT,
|
|
34
|
+
AMNIOTIC_FLUID_CONCEPT,
|
|
35
|
+
MOULDING_CONCEPT,
|
|
36
|
+
BLOOD_GROUP_CONCEPT,
|
|
37
|
+
TIME_SLOT_CONCEPT,
|
|
38
|
+
LABOR_PATTERN_CONCEPT,
|
|
39
|
+
HOURS_SINCE_RUPTURE_CONCEPT,
|
|
40
|
+
RUPTURED_MEMBRANES_CONCEPT,
|
|
41
|
+
DATE_OF_ADMISSION_CONCEPT,
|
|
42
|
+
GESTATION_WEEKS_CONCEPT,
|
|
43
|
+
ESTIMATED_DELIVERY_DATE_CONCEPT,
|
|
44
|
+
LAST_MENSTRUAL_PERIOD_CONCEPT,
|
|
45
|
+
AMNIOTIC_CLEAR_LIQUOR_CONCEPT,
|
|
46
|
+
AMNIOTIC_MECONIUM_STAINED_CONCEPT,
|
|
47
|
+
AMNIOTIC_ABSENT_CONCEPT,
|
|
48
|
+
AMNIOTIC_BLOOD_STAINED_CONCEPT,
|
|
49
|
+
STATION_0_CONCEPT,
|
|
50
|
+
STATION_1_CONCEPT,
|
|
51
|
+
STATION_2_CONCEPT,
|
|
52
|
+
STATION_3_CONCEPT,
|
|
53
|
+
STATION_4_CONCEPT,
|
|
54
|
+
STATION_5_CONCEPT,
|
|
55
|
+
PULSE_BP_TIME_CONCEPT,
|
|
56
|
+
FETAL_HEART_RATE_TIME_CONCEPT,
|
|
57
|
+
CONTRACTION_LEVEL_MILD_CONCEPT,
|
|
58
|
+
CONTRACTION_LEVEL_MODERATE_CONCEPT,
|
|
59
|
+
CONTRACTION_LEVEL_STRONG_CONCEPT,
|
|
60
|
+
} from '../../../config-schema';
|
|
61
|
+
|
|
62
|
+
const _CODE_TO_PLUS_MAP: Record<string, string> = {
|
|
63
|
+
[MOULDING_NONE_CONCEPT]: '0',
|
|
64
|
+
'0': '0',
|
|
65
|
+
[MOULDING_SLIGHT_CONCEPT]: '+',
|
|
66
|
+
'+': '+',
|
|
67
|
+
[MOULDING_MODERATE_CONCEPT]: '++',
|
|
68
|
+
'++': '++',
|
|
69
|
+
[MOULDING_SEVERE_CONCEPT]: '+++',
|
|
70
|
+
'+++': '+++',
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export const codeToPlus = (raw?: string): string => {
|
|
74
|
+
const key = (raw ?? '').toString().trim();
|
|
75
|
+
return _CODE_TO_PLUS_MAP[key] ?? raw ?? '';
|
|
76
|
+
};
|
|
77
|
+
const _partoConcepts = (configSchema as any)?.partography?._default?.conceptUuids ?? {};
|
|
78
|
+
|
|
1
79
|
export const PARTOGRAPHY_CONCEPTS = {
|
|
2
|
-
|
|
3
|
-
'
|
|
4
|
-
'
|
|
5
|
-
'
|
|
6
|
-
|
|
7
|
-
'
|
|
8
|
-
'
|
|
9
|
-
'
|
|
10
|
-
'
|
|
11
|
-
|
|
12
|
-
'
|
|
13
|
-
|
|
14
|
-
'
|
|
15
|
-
'
|
|
16
|
-
'
|
|
17
|
-
|
|
18
|
-
'
|
|
19
|
-
'
|
|
20
|
-
'
|
|
21
|
-
|
|
22
|
-
'
|
|
23
|
-
'
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
'
|
|
27
|
-
'
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
'
|
|
32
|
-
'
|
|
33
|
-
'
|
|
34
|
-
'
|
|
80
|
+
cervix: _partoConcepts.cervix ?? CERVIX_CONCEPT,
|
|
81
|
+
'fetal-heart-rate': _partoConcepts['fetal-heart-rate'] ?? FETAL_HEART_RATE_CONCEPT,
|
|
82
|
+
'fetal-heart-rate-hour': _partoConcepts['fetal-heart-rate-hour'] ?? FETAL_HEART_RATE_HOUR_CONCEPT,
|
|
83
|
+
'fetal-heart-rate-time': _partoConcepts['fetal-heart-rate-time'] ?? FETAL_HEART_RATE_TIME_CONCEPT,
|
|
84
|
+
|
|
85
|
+
'cervical-dilation': _partoConcepts['cervical-dilation'] ?? CERVIX_CONCEPT,
|
|
86
|
+
'descent-of-head': _partoConcepts['descent-of-head'] ?? DESCENT_OF_HEAD_CONCEPT,
|
|
87
|
+
'uterine-contractions': _partoConcepts['uterine-contractions'] ?? UTERINE_CONTRACTIONS_CONCEPT,
|
|
88
|
+
'uterine-contraction-frequency':
|
|
89
|
+
_partoConcepts['uterine-contraction-frequency'] ?? UTERINE_CONTRACTION_FREQUENCY_CONCEPT,
|
|
90
|
+
'uterine-contraction-duration':
|
|
91
|
+
_partoConcepts['uterine-contraction-duration'] ?? UTERINE_CONTRACTION_DURATION_CONCEPT,
|
|
92
|
+
'maternal-pulse': _partoConcepts['maternal-pulse'] ?? MATERNAL_PULSE_CONCEPT,
|
|
93
|
+
'systolic-bp': _partoConcepts['systolic-bp'] ?? SYSTOLIC_BP_CONCEPT,
|
|
94
|
+
'diastolic-bp': _partoConcepts['diastolic-bp'] ?? DIASTOLIC_BP_CONCEPT,
|
|
95
|
+
temperature: _partoConcepts.temperature ?? TEMPERATURE_CONCEPT,
|
|
96
|
+
'protein-level': _partoConcepts['protein-level'] ?? PROTEIN_LEVEL_CONCEPT,
|
|
97
|
+
'glucose-level': _partoConcepts['glucose-level'] ?? GLUCOSE_LEVEL_CONCEPT,
|
|
98
|
+
'ketone-level': _partoConcepts['ketone-level'] ?? KETONE_LEVEL_CONCEPT,
|
|
99
|
+
'urine-volume': _partoConcepts['urine-volume'] ?? URINE_VOLUME_CONCEPT,
|
|
100
|
+
'contraction-count': _partoConcepts['contraction-count'] ?? CONTRACTION_COUNT_CONCEPT,
|
|
101
|
+
'urine-characteristics': _partoConcepts['urine-characteristics'] ?? URINE_CHARACTERISTICS_CONCEPT,
|
|
102
|
+
medication: _partoConcepts.medication ?? MEDICATION_CONCEPT,
|
|
103
|
+
'medication-name': _partoConcepts['medication-name'] ?? MEDICATION_NAME_CONCEPT,
|
|
104
|
+
'oxytocin-dose': _partoConcepts['oxytocin-dose'] ?? OXYTOCIN_DOSE_CONCEPT,
|
|
105
|
+
'iv-fluids': _partoConcepts['iv-fluids'] ?? IV_FLUIDS_CONCEPT,
|
|
106
|
+
dosage: _partoConcepts.dosage ?? DOSAGE_CONCEPT,
|
|
107
|
+
route: _partoConcepts.route ?? ROUTE_CONCEPT,
|
|
108
|
+
frequency: _partoConcepts.frequency ?? FREQUENCY_CONCEPT,
|
|
109
|
+
'drug-dose': _partoConcepts['drug-dose'] ?? DRUG_DOSE_CONCEPT,
|
|
110
|
+
'event-type': _partoConcepts['event-type'] ?? EVENT_TYPE_CONCEPT,
|
|
111
|
+
'event-description': _partoConcepts['event-description'] ?? EVENT_DESCRIPTION_CONCEPT,
|
|
112
|
+
'amniotic-fluid': _partoConcepts['amniotic-fluid'] ?? AMNIOTIC_FLUID_CONCEPT,
|
|
113
|
+
moulding: _partoConcepts.moulding ?? MOULDING_CONCEPT,
|
|
114
|
+
'blood-group': _partoConcepts['blood-group'] ?? BLOOD_GROUP_CONCEPT,
|
|
115
|
+
'time-slot': _partoConcepts['time-slot'] ?? TIME_SLOT_CONCEPT,
|
|
116
|
+
'pulse-time-slot': _partoConcepts['pulse-time-slot'] ?? PULSE_BP_TIME_CONCEPT,
|
|
117
|
+
'labor-pattern': _partoConcepts['labor-pattern'] ?? LABOR_PATTERN_CONCEPT,
|
|
118
|
+
'hours-since-rupture': _partoConcepts['hours-since-rupture'] ?? HOURS_SINCE_RUPTURE_CONCEPT,
|
|
119
|
+
'ruptured-membranes': _partoConcepts['ruptured-membranes'] ?? RUPTURED_MEMBRANES_CONCEPT,
|
|
120
|
+
'date-of-admission': _partoConcepts['date-of-admission'] ?? DATE_OF_ADMISSION_CONCEPT,
|
|
121
|
+
'gestation-weeks': _partoConcepts['gestation-weeks'] ?? GESTATION_WEEKS_CONCEPT,
|
|
122
|
+
'estimated-delivery-date': _partoConcepts['estimated-delivery-date'] ?? ESTIMATED_DELIVERY_DATE_CONCEPT,
|
|
123
|
+
'last-menstrual-period': _partoConcepts['last-menstrual-period'] ?? LAST_MENSTRUAL_PERIOD_CONCEPT,
|
|
35
124
|
} as const;
|
|
36
125
|
|
|
37
|
-
|
|
126
|
+
const _partoUuids = (configSchema as any)?.partography?._default?.uuids ?? {};
|
|
127
|
+
|
|
128
|
+
export const MCH_PARTOGRAPHY_ENCOUNTER_UUID =
|
|
129
|
+
_partoUuids.mchPartographyEncounterUuid ?? '022d62af-e2a5-4282-953b-52dd5cba3296';
|
|
130
|
+
|
|
131
|
+
export const CONTRACTION_STRONG_UUID =
|
|
132
|
+
_partoUuids.contractionStrongConceptUuid ?? '4b90b73a-ad11-4650-91b0-baea131974e0';
|
|
38
133
|
|
|
39
134
|
export const PARTOGRAPHY_GRAPH_TYPES = [
|
|
135
|
+
'cervix',
|
|
40
136
|
'fetal-heart-rate',
|
|
41
137
|
'cervical-dilation',
|
|
42
138
|
'descent-of-head',
|
|
43
139
|
'uterine-contractions',
|
|
44
140
|
'maternal-pulse',
|
|
45
141
|
'blood-pressure',
|
|
142
|
+
'pulse-bp-combined',
|
|
46
143
|
'temperature',
|
|
47
144
|
'urine-analysis',
|
|
48
145
|
'drugs-fluids',
|
|
@@ -50,7 +147,14 @@ export const PARTOGRAPHY_GRAPH_TYPES = [
|
|
|
50
147
|
] as const;
|
|
51
148
|
|
|
52
149
|
export const PARTOGRAPHY_ENCOUNTER_TYPES = Object.fromEntries(
|
|
53
|
-
PARTOGRAPHY_GRAPH_TYPES.map((type) => [
|
|
150
|
+
PARTOGRAPHY_GRAPH_TYPES.map((type) => [
|
|
151
|
+
type,
|
|
152
|
+
type === 'drugs-fluids'
|
|
153
|
+
? _partoUuids.drugsFluidsEncounterUuid ?? '39da3525-afe4-45ff-8977-c53b7b359158'
|
|
154
|
+
: type === 'pulse-bp-combined'
|
|
155
|
+
? MCH_PARTOGRAPHY_ENCOUNTER_UUID
|
|
156
|
+
: MCH_PARTOGRAPHY_ENCOUNTER_UUID,
|
|
157
|
+
]),
|
|
54
158
|
) as Record<(typeof PARTOGRAPHY_GRAPH_TYPES)[number], string>;
|
|
55
159
|
|
|
56
160
|
export interface OpenMRSResponse<T> {
|
|
@@ -100,6 +204,7 @@ export interface PartographyGraph {
|
|
|
100
204
|
}
|
|
101
205
|
|
|
102
206
|
export const PARTOGRAPHY_UNITS = {
|
|
207
|
+
cervix: 'cm',
|
|
103
208
|
'fetal-heart-rate': 'BPM',
|
|
104
209
|
'cervical-dilation': 'cm',
|
|
105
210
|
'descent-of-head': 'Station',
|
|
@@ -113,6 +218,7 @@ export const PARTOGRAPHY_UNITS = {
|
|
|
113
218
|
} as const;
|
|
114
219
|
|
|
115
220
|
export const PARTOGRAPHY_NORMAL_RANGES = {
|
|
221
|
+
cervix: '1-10 cm',
|
|
116
222
|
'fetal-heart-rate': '110-160 BPM',
|
|
117
223
|
'cervical-dilation': '0-10 cm',
|
|
118
224
|
'descent-of-head': '-3 to +3',
|
|
@@ -126,6 +232,7 @@ export const PARTOGRAPHY_NORMAL_RANGES = {
|
|
|
126
232
|
} as const;
|
|
127
233
|
|
|
128
234
|
export const PARTOGRAPHY_COLORS = {
|
|
235
|
+
cervix: 'blue',
|
|
129
236
|
'fetal-heart-rate': 'red',
|
|
130
237
|
'cervical-dilation': 'blue',
|
|
131
238
|
'descent-of-head': 'green',
|
|
@@ -139,6 +246,7 @@ export const PARTOGRAPHY_COLORS = {
|
|
|
139
246
|
} as const;
|
|
140
247
|
|
|
141
248
|
export const PARTOGRAPHY_Y_RANGES = {
|
|
249
|
+
cervix: { min: 1, max: 10 },
|
|
142
250
|
'fetal-heart-rate': { min: 80, max: 200 },
|
|
143
251
|
'cervical-dilation': { min: 0, max: 10 },
|
|
144
252
|
'descent-of-head': { min: -4, max: 4 },
|
|
@@ -185,6 +293,18 @@ export const getPartographyYRange = (graphType: PartographyGraphType): { min: nu
|
|
|
185
293
|
};
|
|
186
294
|
|
|
187
295
|
export const PARTOGRAPHY_GRAPH_CONFIGS: PartographyGraph[] = [
|
|
296
|
+
{
|
|
297
|
+
id: 'cervix',
|
|
298
|
+
titleKey: 'cervix',
|
|
299
|
+
titleDefault: 'Cervix',
|
|
300
|
+
descriptionKey: 'cervixDesc',
|
|
301
|
+
descriptionDefault: 'Cervical monitoring during labor',
|
|
302
|
+
yAxisLabel: 'cm',
|
|
303
|
+
normalRange: '1-10 cm',
|
|
304
|
+
color: 'blue',
|
|
305
|
+
yMin: 1,
|
|
306
|
+
yMax: 10,
|
|
307
|
+
},
|
|
188
308
|
{
|
|
189
309
|
id: 'fetal-heart-rate',
|
|
190
310
|
titleKey: 'fetalHeartRate',
|
|
@@ -308,7 +428,9 @@ export const PARTOGRAPHY_GRAPH_CONFIGS: PartographyGraph[] = [
|
|
|
308
428
|
];
|
|
309
429
|
|
|
310
430
|
export const getTranslatedPartographyGraphs = (t: (key: string, fallback: string) => string) => {
|
|
311
|
-
|
|
431
|
+
const cervixOnlyConfigs = PARTOGRAPHY_GRAPH_CONFIGS.filter((config) => config.id === 'cervix');
|
|
432
|
+
|
|
433
|
+
return cervixOnlyConfigs.map((config) => ({
|
|
312
434
|
id: config.id,
|
|
313
435
|
title: t(config.titleKey, config.titleDefault),
|
|
314
436
|
description: t(config.descriptionKey, config.descriptionDefault),
|
|
@@ -330,54 +452,55 @@ export const getColorForGraph = (colorName: string): string => {
|
|
|
330
452
|
return PARTOGRAPHY_COLOR_MAPPINGS[colorName as keyof typeof PARTOGRAPHY_COLOR_MAPPINGS] || '#525252';
|
|
331
453
|
};
|
|
332
454
|
|
|
333
|
-
// Concept UUID mappings for form options
|
|
334
455
|
export const FORM_OPTION_CONCEPTS = {
|
|
335
|
-
// Amniotic fluid concepts
|
|
336
456
|
AMNIOTIC_FLUID: {
|
|
337
|
-
MEMBRANE_INTACT: PARTOGRAPHY_CONCEPTS['amniotic-fluid'],
|
|
338
|
-
CLEAR_LIQUOR:
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
457
|
+
MEMBRANE_INTACT: PARTOGRAPHY_CONCEPTS['amniotic-fluid'],
|
|
458
|
+
CLEAR_LIQUOR:
|
|
459
|
+
(configSchema as any)?.partography?._default?.conceptUuids?.['amniotic-clear-liquor'] ??
|
|
460
|
+
AMNIOTIC_CLEAR_LIQUOR_CONCEPT,
|
|
461
|
+
MECONIUM_STAINED:
|
|
462
|
+
(configSchema as any)?.partography?._default?.conceptUuids?.['amniotic-meconium-stained'] ??
|
|
463
|
+
AMNIOTIC_MECONIUM_STAINED_CONCEPT,
|
|
464
|
+
ABSENT: (configSchema as any)?.partography?._default?.conceptUuids?.['amniotic-absent'] ?? AMNIOTIC_ABSENT_CONCEPT,
|
|
465
|
+
BLOOD_STAINED:
|
|
466
|
+
(configSchema as any)?.partography?._default?.conceptUuids?.['amniotic-blood-stained'] ??
|
|
467
|
+
AMNIOTIC_BLOOD_STAINED_CONCEPT,
|
|
342
468
|
},
|
|
343
469
|
|
|
344
|
-
// Moulding concepts
|
|
345
470
|
MOULDING: {
|
|
346
|
-
NONE: '
|
|
347
|
-
SLIGHT: '
|
|
348
|
-
MODERATE:
|
|
349
|
-
|
|
471
|
+
NONE: (configSchema as any)?.partography?._default?.conceptUuids?.['moulding-none'] ?? MOULDING_NONE_CONCEPT,
|
|
472
|
+
SLIGHT: (configSchema as any)?.partography?._default?.conceptUuids?.['moulding-slight'] ?? MOULDING_SLIGHT_CONCEPT,
|
|
473
|
+
MODERATE:
|
|
474
|
+
(configSchema as any)?.partography?._default?.conceptUuids?.['moulding-moderate'] ?? MOULDING_MODERATE_CONCEPT,
|
|
475
|
+
SEVERE: (configSchema as any)?.partography?._default?.conceptUuids?.['moulding-severe'] ?? MOULDING_SEVERE_CONCEPT,
|
|
350
476
|
},
|
|
351
477
|
|
|
352
|
-
// Descent of head station concepts
|
|
353
478
|
DESCENT_STATION: {
|
|
354
|
-
ZERO_FIFTHS: '
|
|
355
|
-
ONE_FIFTH: '
|
|
356
|
-
TWO_FIFTHS: '
|
|
357
|
-
THREE_FIFTHS: '
|
|
358
|
-
FOUR_FIFTHS: '
|
|
359
|
-
FIVE_FIFTHS: '
|
|
479
|
+
ZERO_FIFTHS: (configSchema as any)?.partography?._default?.conceptUuids?.['station-0'] ?? STATION_0_CONCEPT,
|
|
480
|
+
ONE_FIFTH: (configSchema as any)?.partography?._default?.conceptUuids?.['station-1'] ?? STATION_1_CONCEPT,
|
|
481
|
+
TWO_FIFTHS: (configSchema as any)?.partography?._default?.conceptUuids?.['station-2'] ?? STATION_2_CONCEPT,
|
|
482
|
+
THREE_FIFTHS: (configSchema as any)?.partography?._default?.conceptUuids?.['station-3'] ?? STATION_3_CONCEPT,
|
|
483
|
+
FOUR_FIFTHS: (configSchema as any)?.partography?._default?.conceptUuids?.['station-4'] ?? STATION_4_CONCEPT,
|
|
484
|
+
FIVE_FIFTHS: (configSchema as any)?.partography?._default?.conceptUuids?.['station-5'] ?? STATION_5_CONCEPT,
|
|
360
485
|
},
|
|
361
486
|
|
|
362
|
-
// Contraction intensity concepts
|
|
363
487
|
CONTRACTION_INTENSITY: {
|
|
364
|
-
MILD:
|
|
365
|
-
MODERATE:
|
|
366
|
-
STRONG:
|
|
488
|
+
MILD: CONTRACTION_LEVEL_MILD_CONCEPT,
|
|
489
|
+
MODERATE: CONTRACTION_LEVEL_MODERATE_CONCEPT,
|
|
490
|
+
STRONG: CONTRACTION_LEVEL_STRONG_CONCEPT,
|
|
367
491
|
},
|
|
368
492
|
|
|
369
|
-
// Urine analysis level concepts
|
|
370
493
|
URINE_LEVELS: {
|
|
371
|
-
NEGATIVE: '
|
|
372
|
-
TRACE: '
|
|
373
|
-
POSITIVE_PLUS:
|
|
374
|
-
|
|
494
|
+
NEGATIVE: (configSchema as any)?.partography?._default?.conceptUuids?.['moulding-none'] ?? MOULDING_NONE_CONCEPT,
|
|
495
|
+
TRACE: (configSchema as any)?.partography?._default?.conceptUuids?.['moulding-slight'] ?? MOULDING_SLIGHT_CONCEPT,
|
|
496
|
+
POSITIVE_PLUS:
|
|
497
|
+
(configSchema as any)?.partography?._default?.conceptUuids?.['moulding-moderate'] ?? MOULDING_MODERATE_CONCEPT,
|
|
498
|
+
POSITIVE_PLUS_PLUS:
|
|
499
|
+
(configSchema as any)?.partography?._default?.conceptUuids?.['moulding-severe'] ?? MOULDING_SEVERE_CONCEPT,
|
|
375
500
|
},
|
|
376
501
|
|
|
377
|
-
// Blood group concept (single concept, different values)
|
|
378
502
|
BLOOD_GROUP: PARTOGRAPHY_CONCEPTS['blood-group'],
|
|
379
503
|
|
|
380
|
-
// Event type concepts
|
|
381
504
|
EVENT_TYPES: {
|
|
382
505
|
MEMBRANE_RUPTURE: PARTOGRAPHY_CONCEPTS['event-type'],
|
|
383
506
|
LABOR_ONSET: PARTOGRAPHY_CONCEPTS['event-type'],
|
|
@@ -389,7 +512,6 @@ export const FORM_OPTION_CONCEPTS = {
|
|
|
389
512
|
},
|
|
390
513
|
} as const;
|
|
391
514
|
|
|
392
|
-
// Form option configurations using concepts
|
|
393
515
|
export const AMNIOTIC_FLUID_OPTIONS = [
|
|
394
516
|
{ value: '', text: 'chooseAnOption', conceptUuid: '' },
|
|
395
517
|
{
|
|
@@ -447,6 +569,30 @@ export const MOULDING_OPTIONS = [
|
|
|
447
569
|
},
|
|
448
570
|
] as const;
|
|
449
571
|
|
|
572
|
+
export const ROUTE_OPTIONS = [
|
|
573
|
+
{ id: 'oral', text: 'Oral' },
|
|
574
|
+
{ id: 'iv', text: 'Intravenous (IV)' },
|
|
575
|
+
{ id: 'im', text: 'Intramuscular (IM)' },
|
|
576
|
+
{ id: 'sc', text: 'Subcutaneous (SC)' },
|
|
577
|
+
{ id: 'topical', text: 'Topical' },
|
|
578
|
+
{ id: 'inhalation', text: 'Inhalation' },
|
|
579
|
+
{ id: 'other', text: 'Other' },
|
|
580
|
+
] as const;
|
|
581
|
+
|
|
582
|
+
export const FREQUENCY_OPTIONS = [
|
|
583
|
+
{ id: 'stat', text: 'STAT (immediately)' },
|
|
584
|
+
{ id: 'od', text: 'Once daily (OD)' },
|
|
585
|
+
{ id: 'bd', text: 'Twice daily (BD)' },
|
|
586
|
+
{ id: 'tds', text: 'Three times daily (TDS)' },
|
|
587
|
+
{ id: 'qds', text: 'Four times daily (QDS)' },
|
|
588
|
+
{ id: 'q4h', text: 'Every 4 hours' },
|
|
589
|
+
{ id: 'q6h', text: 'Every 6 hours' },
|
|
590
|
+
{ id: 'q8h', text: 'Every 8 hours' },
|
|
591
|
+
{ id: 'q12h', text: 'Every 12 hours' },
|
|
592
|
+
{ id: 'prn', text: 'As needed (PRN)' },
|
|
593
|
+
{ id: 'other', text: 'Other' },
|
|
594
|
+
] as const;
|
|
595
|
+
|
|
450
596
|
export const DESCENT_OF_HEAD_OPTIONS = [
|
|
451
597
|
{ value: '', text: 'selectStation', stationValue: 0, conceptUuid: '' },
|
|
452
598
|
{
|
|
@@ -546,6 +692,23 @@ export const TIME_SLOT_OPTIONS = [
|
|
|
546
692
|
{ value: 'night', text: 'night', conceptUuid: PARTOGRAPHY_CONCEPTS['time-slot'] },
|
|
547
693
|
] as const;
|
|
548
694
|
|
|
695
|
+
export const MEMBRANE_TIME_SLOT_OPTIONS = [
|
|
696
|
+
{ value: '16:00', label: '16:00' },
|
|
697
|
+
{ value: '17:00', label: '17:00' },
|
|
698
|
+
{ value: '18:00', label: '18:00' },
|
|
699
|
+
{ value: '19:00', label: '19:00' },
|
|
700
|
+
{ value: '20:00', label: '20:00' },
|
|
701
|
+
{ value: '21:00', label: '21:00' },
|
|
702
|
+
{ value: '22:00', label: '22:00' },
|
|
703
|
+
{ value: '23:00', label: '23:00' },
|
|
704
|
+
{ value: '00:00', label: '00:00' },
|
|
705
|
+
{ value: '01:00', label: '01:00' },
|
|
706
|
+
{ value: '02:00', label: '02:00' },
|
|
707
|
+
{ value: '03:00', label: '03:00' },
|
|
708
|
+
{ value: '04:00', label: '04:00' },
|
|
709
|
+
{ value: '05:00', label: '05:00' },
|
|
710
|
+
] as const;
|
|
711
|
+
|
|
549
712
|
export const EVENT_TYPE_OPTIONS = [
|
|
550
713
|
{ value: '', text: 'selectEventType', conceptUuid: '' },
|
|
551
714
|
{
|
|
@@ -565,7 +728,6 @@ export const EVENT_TYPE_OPTIONS = [
|
|
|
565
728
|
{ value: 'other', text: 'other', conceptUuid: FORM_OPTION_CONCEPTS.EVENT_TYPES.OTHER },
|
|
566
729
|
] as const;
|
|
567
730
|
|
|
568
|
-
// Mapping functions
|
|
569
731
|
export const getDescentStationMapping = () => {
|
|
570
732
|
const mapping: Record<string, number> = {};
|
|
571
733
|
DESCENT_OF_HEAD_OPTIONS.forEach((option) => {
|
|
@@ -576,8 +738,8 @@ export const getDescentStationMapping = () => {
|
|
|
576
738
|
return mapping;
|
|
577
739
|
};
|
|
578
740
|
|
|
579
|
-
// Configurable input validation ranges
|
|
580
741
|
export const VALIDATION_RANGES = {
|
|
742
|
+
CERVIX: { min: 1, max: 10, normal: { min: 1, max: 10 }, step: 0.5 },
|
|
581
743
|
FETAL_HEART_RATE: { min: 80, max: 200, normal: { min: 110, max: 160 }, step: 1 },
|
|
582
744
|
CERVICAL_DILATION: { min: 0, max: 10, normal: { min: 0, max: 10 }, step: 0.5 },
|
|
583
745
|
MATERNAL_PULSE: { min: 40, max: 140, normal: { min: 60, max: 100 }, step: 1 },
|
|
@@ -587,8 +749,12 @@ export const VALIDATION_RANGES = {
|
|
|
587
749
|
UTERINE_CONTRACTIONS: { min: 0, max: 10, normal: { min: 2, max: 5 }, step: 1 },
|
|
588
750
|
} as const;
|
|
589
751
|
|
|
590
|
-
// Input ranges mapped to graph types
|
|
591
752
|
export const INPUT_RANGES = {
|
|
753
|
+
cervix: {
|
|
754
|
+
...VALIDATION_RANGES.CERVIX,
|
|
755
|
+
placeholderKey: 'cervixPlaceholder',
|
|
756
|
+
conceptUuid: PARTOGRAPHY_CONCEPTS['cervix'],
|
|
757
|
+
},
|
|
592
758
|
'fetal-heart-rate': {
|
|
593
759
|
...VALIDATION_RANGES.FETAL_HEART_RATE,
|
|
594
760
|
placeholderKey: 'fetalHeartRatePlaceholder',
|
|
@@ -626,7 +792,6 @@ export const INPUT_RANGES = {
|
|
|
626
792
|
},
|
|
627
793
|
} as const;
|
|
628
794
|
|
|
629
|
-
// Configurable form validation helpers
|
|
630
795
|
export const createRangeValidator = (rangeName: keyof typeof VALIDATION_RANGES) => {
|
|
631
796
|
const range = VALIDATION_RANGES[rangeName];
|
|
632
797
|
return (value: string | number): boolean => {
|
|
@@ -689,9 +854,8 @@ export const isValidMeasurement = (graphType: string, value: string): boolean =>
|
|
|
689
854
|
return value.trim() !== '';
|
|
690
855
|
}
|
|
691
856
|
};
|
|
692
|
-
|
|
693
|
-
// Measurement label mappings
|
|
694
857
|
export const MEASUREMENT_LABELS = {
|
|
858
|
+
cervix: { key: 'cervicalDilation', default: 'Cervical Dilation' },
|
|
695
859
|
'fetal-heart-rate': { key: 'fetalHeartRate', default: 'Foetal Heart Rate' },
|
|
696
860
|
'cervical-dilation': { key: 'membraneAmnioticFluidMoulding', default: 'Membrane Amniotic Fluid & Moulding' },
|
|
697
861
|
'descent-of-head': { key: 'descentOfHead', default: 'Descent of Head' },
|
|
@@ -704,10 +868,7 @@ export const MEASUREMENT_LABELS = {
|
|
|
704
868
|
'progress-events': { key: 'progressEvents', default: 'Progress & Events' },
|
|
705
869
|
} as const;
|
|
706
870
|
|
|
707
|
-
// Get measurement label function
|
|
708
|
-
// Field label mappings for all form inputs
|
|
709
871
|
export const FIELD_LABELS = {
|
|
710
|
-
// Number input labels
|
|
711
872
|
fetalHeartRate: { key: 'fetalHeartRate', default: 'Fetal Heart Rate (BPM)' },
|
|
712
873
|
cervicalDilation: { key: 'cervicalDilation', default: 'Cervical Dilation (cm)' },
|
|
713
874
|
maternalPulse: { key: 'maternalPulse', default: 'Maternal Pulse (BPM)' },
|
|
@@ -715,8 +876,6 @@ export const FIELD_LABELS = {
|
|
|
715
876
|
diastolic: { key: 'diastolic', default: 'Diastolic (mmHg)' },
|
|
716
877
|
temperature: { key: 'temperature', default: 'Temperature (°C)' },
|
|
717
878
|
frequency: { key: 'frequency', default: 'Frequency (per 10min)' },
|
|
718
|
-
|
|
719
|
-
// Select field labels
|
|
720
879
|
amnioticFluid: { key: 'amnioticFluid', default: 'Amniotic Fluid' },
|
|
721
880
|
moulding: { key: 'moulding', default: 'Moulding' },
|
|
722
881
|
descentOfHead: { key: 'descentOfHead', default: 'Descent of Head (Station)' },
|
|
@@ -725,21 +884,14 @@ export const FIELD_LABELS = {
|
|
|
725
884
|
glucoseLevel: { key: 'glucoseLevel', default: 'Glucose Level' },
|
|
726
885
|
ketoneLevel: { key: 'ketoneLevel', default: 'Ketone Level' },
|
|
727
886
|
eventType: { key: 'eventType', default: 'Event Type' },
|
|
728
|
-
|
|
729
|
-
// Text input labels
|
|
730
887
|
medication: { key: 'medication', default: 'Medication/Fluid' },
|
|
731
888
|
dosageRate: { key: 'dosageRate', default: 'Dosage/Rate' },
|
|
732
889
|
eventDescription: { key: 'eventDescription', default: 'Event Description' },
|
|
733
|
-
|
|
734
|
-
// Common labels
|
|
735
890
|
admission: { key: 'admission', default: 'Admission' },
|
|
736
891
|
bg: { key: 'bg', default: 'BG' },
|
|
737
892
|
am: { key: 'am', default: 'AM' },
|
|
738
893
|
} as const;
|
|
739
|
-
|
|
740
|
-
// Placeholder mappings for inputs - all translatable
|
|
741
894
|
export const FIELD_PLACEHOLDERS = {
|
|
742
|
-
// Number input placeholders
|
|
743
895
|
fetalHeartRatePlaceholder: { key: 'enterFetalHeartRate', default: 'Enter fetal heart rate (110-160 BPM)' },
|
|
744
896
|
cervicalDilationPlaceholder: { key: 'enterCervicalDilation', default: 'Enter cervical dilation (0-10 cm)' },
|
|
745
897
|
maternalPulsePlaceholder: { key: 'enterMaternalPulse', default: 'Enter maternal pulse (60-100 BPM)' },
|
|
@@ -749,23 +901,17 @@ export const FIELD_PLACEHOLDERS = {
|
|
|
749
901
|
contractionFrequencyPlaceholder: { key: 'enterContractionFrequency', default: 'Enter contractions per 10 minutes' },
|
|
750
902
|
contractionIntensityPlaceholder: { key: 'selectContractionIntensity', default: 'Select contraction intensity' },
|
|
751
903
|
descentOfHeadPlaceholder: { key: 'selectDescentStation', default: 'Select descent station (0/5 - 5/5)' },
|
|
752
|
-
|
|
753
|
-
// Select placeholders
|
|
754
904
|
amnioticFluidPlaceholder: { key: 'selectAmnioticFluid', default: 'Select amniotic fluid status' },
|
|
755
905
|
mouldingPlaceholder: { key: 'selectMoulding', default: 'Select moulding status' },
|
|
756
906
|
proteinLevelPlaceholder: { key: 'selectProteinLevel', default: 'Select protein level' },
|
|
757
907
|
glucoseLevelPlaceholder: { key: 'selectGlucoseLevel', default: 'Select glucose level' },
|
|
758
908
|
ketoneLevelPlaceholder: { key: 'selectKetoneLevel', default: 'Select ketone level' },
|
|
759
909
|
eventTypePlaceholder: { key: 'selectEventType', default: 'Select event type' },
|
|
760
|
-
|
|
761
|
-
// Text input placeholders
|
|
762
910
|
medicationType: { key: 'enterMedicationOrFluidType', default: 'Enter medication or fluid type' },
|
|
763
911
|
dosageRate: { key: 'enterDosageOrFlowRate', default: 'Enter dosage or flow rate' },
|
|
764
912
|
eventDescription: { key: 'describeEventOrMilestone', default: 'Describe the event or milestone' },
|
|
765
913
|
generalMeasurement: { key: 'enterMeasurementValue', default: 'Enter measurement value' },
|
|
766
914
|
} as const;
|
|
767
|
-
|
|
768
|
-
// Get measurement label function
|
|
769
915
|
export const getMeasurementLabel = (
|
|
770
916
|
graphType: string,
|
|
771
917
|
t: (key: string, fallback: string) => string,
|
|
@@ -777,8 +923,6 @@ export const getMeasurementLabel = (
|
|
|
777
923
|
}
|
|
778
924
|
return fallbackTitle || graphType;
|
|
779
925
|
};
|
|
780
|
-
|
|
781
|
-
// Get field label function
|
|
782
926
|
export const getFieldLabel = (
|
|
783
927
|
fieldKey: keyof typeof FIELD_LABELS,
|
|
784
928
|
t: (key: string, fallback: string) => string,
|
|
@@ -787,7 +931,6 @@ export const getFieldLabel = (
|
|
|
787
931
|
return t(labelConfig.key, labelConfig.default);
|
|
788
932
|
};
|
|
789
933
|
|
|
790
|
-
// Get field placeholder function
|
|
791
934
|
export const getFieldPlaceholder = (
|
|
792
935
|
fieldKey: keyof typeof FIELD_PLACEHOLDERS,
|
|
793
936
|
t: (key: string, fallback: string) => string,
|
|
@@ -796,7 +939,6 @@ export const getFieldPlaceholder = (
|
|
|
796
939
|
return t(placeholderConfig.key, placeholderConfig.default);
|
|
797
940
|
};
|
|
798
941
|
|
|
799
|
-
// Get dynamic placeholder for input ranges
|
|
800
942
|
export const getInputRangePlaceholder = (
|
|
801
943
|
graphType: keyof typeof INPUT_RANGES,
|
|
802
944
|
t: (key: string, fallback: string) => string,
|
|
@@ -808,7 +950,6 @@ export const getInputRangePlaceholder = (
|
|
|
808
950
|
return t('enterMeasurementValue', 'Enter measurement value');
|
|
809
951
|
};
|
|
810
952
|
|
|
811
|
-
// Get concept UUID for form option
|
|
812
953
|
export const getConceptUuid = (optionType: string, optionValue: string): string => {
|
|
813
954
|
switch (optionType) {
|
|
814
955
|
case 'amnioticFluid':
|
|
@@ -834,10 +975,8 @@ export const getConceptUuid = (optionType: string, optionValue: string): string
|
|
|
834
975
|
}
|
|
835
976
|
};
|
|
836
977
|
|
|
837
|
-
// Validate if measurement is within normal range
|
|
838
978
|
export const isWithinNormalRange = (graphType: string, value: number): boolean => {
|
|
839
979
|
const range = Object.values(VALIDATION_RANGES).find((r) => {
|
|
840
|
-
// Match range based on graph type
|
|
841
980
|
switch (graphType) {
|
|
842
981
|
case 'fetal-heart-rate':
|
|
843
982
|
return r === VALIDATION_RANGES.FETAL_HEART_RATE;
|
|
@@ -860,7 +999,6 @@ export const isWithinNormalRange = (graphType: string, value: number): boolean =
|
|
|
860
999
|
return value >= range.normal.min && value <= range.normal.max;
|
|
861
1000
|
};
|
|
862
1001
|
|
|
863
|
-
// Configurable data processing for different graph types
|
|
864
1002
|
export interface GraphDataProcessor {
|
|
865
1003
|
validate: (formData: any) => boolean;
|
|
866
1004
|
getValue: (formData: any) => number;
|
|
@@ -965,7 +1103,6 @@ export const GRAPH_DATA_PROCESSORS: Record<string, GraphDataProcessor> = {
|
|
|
965
1103
|
},
|
|
966
1104
|
};
|
|
967
1105
|
|
|
968
|
-
// Generic processor for unmapped graph types
|
|
969
1106
|
export const getDefaultProcessor = (graphType: string): GraphDataProcessor => ({
|
|
970
1107
|
validate: (formData) => isValidMeasurement(graphType, formData.measurementValue),
|
|
971
1108
|
getValue: (formData) => parseFloat(formData.measurementValue) || 0,
|
|
@@ -974,7 +1111,88 @@ export const getDefaultProcessor = (graphType: string): GraphDataProcessor => ({
|
|
|
974
1111
|
}),
|
|
975
1112
|
});
|
|
976
1113
|
|
|
977
|
-
// Get processor for a specific graph type
|
|
978
1114
|
export const getGraphDataProcessor = (graphType: string): GraphDataProcessor => {
|
|
979
1115
|
return GRAPH_DATA_PROCESSORS[graphType] || getDefaultProcessor(graphType);
|
|
980
1116
|
};
|
|
1117
|
+
|
|
1118
|
+
export const CERVIX_CHART_OPTIONS = {
|
|
1119
|
+
title: 'Cervical Dilation',
|
|
1120
|
+
axes: {
|
|
1121
|
+
bottom: {
|
|
1122
|
+
title: 'Time (Hours)',
|
|
1123
|
+
scaleType: 'time',
|
|
1124
|
+
},
|
|
1125
|
+
left: {
|
|
1126
|
+
title: 'Dilation (cm)',
|
|
1127
|
+
mapsTo: 'value',
|
|
1128
|
+
domain: [0, 10],
|
|
1129
|
+
ticks: {
|
|
1130
|
+
values: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
|
|
1131
|
+
},
|
|
1132
|
+
scaleType: 'linear',
|
|
1133
|
+
},
|
|
1134
|
+
},
|
|
1135
|
+
data: {
|
|
1136
|
+
groups: {
|
|
1137
|
+
'Alert Line': { stroke: 'orange', dashed: true, line: { strokeDasharray: '4 4' } },
|
|
1138
|
+
'Action Line': { stroke: 'red', dashed: true, line: { strokeDasharray: '4 4' } },
|
|
1139
|
+
},
|
|
1140
|
+
},
|
|
1141
|
+
curve: 'curveLinear',
|
|
1142
|
+
};
|
|
1143
|
+
|
|
1144
|
+
export const SVG_NAMESPACE = 'http://www.w3.org/2000/svg' as const;
|
|
1145
|
+
|
|
1146
|
+
export const generateRange = (start: number, end: number, step = 1): number[] => {
|
|
1147
|
+
const result: number[] = [];
|
|
1148
|
+
const precision = Math.max(0, (step.toString().split('.')[1] || '').length);
|
|
1149
|
+
for (let v = start; v <= end + Number.EPSILON; v = +(v + step).toFixed(precision)) {
|
|
1150
|
+
result.push(Number(v.toFixed(precision)));
|
|
1151
|
+
}
|
|
1152
|
+
return result;
|
|
1153
|
+
};
|
|
1154
|
+
|
|
1155
|
+
export const AMNIOTIC_FLUID_INITIALS_MAP: Record<string, string> = {
|
|
1156
|
+
'Membrane intact': 'M',
|
|
1157
|
+
'Clear liquor': 'C',
|
|
1158
|
+
Clear: 'C',
|
|
1159
|
+
'Meconium Stained': 'MS',
|
|
1160
|
+
'Meconium staining': 'MS',
|
|
1161
|
+
Absent: 'A',
|
|
1162
|
+
'Blood Stained': 'B',
|
|
1163
|
+
'Blood stained': 'B',
|
|
1164
|
+
A: 'A',
|
|
1165
|
+
C: 'C',
|
|
1166
|
+
MS: 'MS',
|
|
1167
|
+
B: 'B',
|
|
1168
|
+
};
|
|
1169
|
+
|
|
1170
|
+
export const AMNIOTIC_FLUID_LABEL_MAP: Record<string, string> = {
|
|
1171
|
+
M: 'Membrane intact',
|
|
1172
|
+
C: 'Clear liquor',
|
|
1173
|
+
MS: 'Meconium Stained',
|
|
1174
|
+
A: 'Absent',
|
|
1175
|
+
B: 'Blood Stained',
|
|
1176
|
+
};
|
|
1177
|
+
|
|
1178
|
+
export const MOULDING_SYMBOL_MAP: Record<string, string> = {
|
|
1179
|
+
'0': '0',
|
|
1180
|
+
'+': '+',
|
|
1181
|
+
'++': '++',
|
|
1182
|
+
'+++': '+++',
|
|
1183
|
+
None: '0',
|
|
1184
|
+
'ONE PLUS': '+',
|
|
1185
|
+
'TWO PLUS': '++',
|
|
1186
|
+
'THREE PLUS': '+++',
|
|
1187
|
+
};
|
|
1188
|
+
|
|
1189
|
+
export const OXYTOCIN_FORM_CONCEPTS = {
|
|
1190
|
+
time: FETAL_HEART_RATE_HOUR_CONCEPT,
|
|
1191
|
+
oxytocinDropsPerMinute: OXYTOCIN_DOSE_CONCEPT,
|
|
1192
|
+
} as const;
|
|
1193
|
+
export const CERVIX_FORM_CONCEPTS = {
|
|
1194
|
+
hour: FETAL_HEART_RATE_HOUR_CONCEPT,
|
|
1195
|
+
time: FETAL_HEART_RATE_TIME_CONCEPT,
|
|
1196
|
+
cervicalDilation: CERVIX_CONCEPT,
|
|
1197
|
+
descentOfHead: DESCENT_OF_HEAD_CONCEPT,
|
|
1198
|
+
} as const;
|