@kenyaemr/esm-patient-clinical-view-app 5.4.2-pre.2788 → 5.4.2-pre.2797
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/127.js +1 -1
- package/dist/40.js +1 -1
- package/dist/{189.js → 791.js} +1 -1
- package/dist/791.js.map +1 -0
- package/dist/916.js +1 -1
- package/dist/kenyaemr-esm-patient-clinical-view-app.js +3 -3
- package/dist/kenyaemr-esm-patient-clinical-view-app.js.buildmanifest.json +36 -36
- package/dist/main.js +3 -3
- package/dist/main.js.map +1 -1
- package/dist/routes.json +1 -1
- package/package.json +1 -1
- package/src/config-schema.ts +8 -2
- package/src/maternal-and-child-health/partography/forms/cervical-contractions-form.component.tsx +63 -28
- package/src/maternal-and-child-health/partography/forms/cervix-form.component.tsx +52 -108
- package/src/maternal-and-child-health/partography/forms/drugs-iv-fluids-form.component.tsx +110 -100
- package/src/maternal-and-child-health/partography/forms/fetal-heart-rate-form.component.tsx +7 -7
- package/src/maternal-and-child-health/partography/forms/membrane-amniotic-fluid-form.component.tsx +72 -75
- package/src/maternal-and-child-health/partography/forms/oxytocin-form.component.tsx +14 -19
- package/src/maternal-and-child-health/partography/forms/pulse-bp-form.component.tsx +34 -28
- package/src/maternal-and-child-health/partography/forms/temperature-form.component.tsx +10 -9
- package/src/maternal-and-child-health/partography/forms/time-picker-dropdown.component.tsx +10 -10
- package/src/maternal-and-child-health/partography/forms/urine-test-form.component.tsx +7 -6
- package/src/maternal-and-child-health/partography/graphs/cervical-contractions-graph.component.tsx +51 -61
- package/src/maternal-and-child-health/partography/graphs/drugs-iv-fluids-graph-wrapper.component.tsx +0 -6
- package/src/maternal-and-child-health/partography/graphs/drugs-iv-fluids-graph.component.tsx +3 -3
- package/src/maternal-and-child-health/partography/graphs/fetal-heart-rate-graph.component.tsx +53 -30
- package/src/maternal-and-child-health/partography/graphs/membrane-amniotic-fluid-graph.component.tsx +25 -3
- package/src/maternal-and-child-health/partography/graphs/oxytocin-graph-wrapper.component.tsx +102 -97
- package/src/maternal-and-child-health/partography/graphs/oxytocin-graph.component.tsx +21 -22
- package/src/maternal-and-child-health/partography/graphs/pulse-bp-graph.component.tsx +21 -24
- package/src/maternal-and-child-health/partography/graphs/temperature-graph.component.tsx +23 -26
- package/src/maternal-and-child-health/partography/graphs/urine-test-graph.component.tsx +1 -1
- package/src/maternal-and-child-health/partography/partograph.component.tsx +323 -171
- package/src/maternal-and-child-health/partography/partography-data-form.scss +23 -0
- package/src/maternal-and-child-health/partography/partography.resource.ts +70 -56
- package/src/maternal-and-child-health/partography/partography.scss +65 -6
- package/src/maternal-and-child-health/partography/resources/fetal-heart-rate.resource.ts +5 -10
- package/src/maternal-and-child-health/partography/resources/oxytocin.resource.ts +5 -3
- package/src/maternal-and-child-health/partography/types/index.ts +40 -37
- package/translations/am.json +1 -1
- package/translations/en.json +1 -1
- package/translations/sw.json +1 -1
- package/dist/189.js.map +0 -1
package/src/maternal-and-child-health/partography/graphs/membrane-amniotic-fluid-graph.component.tsx
CHANGED
|
@@ -22,6 +22,7 @@ interface MembraneAmnioticFluidData {
|
|
|
22
22
|
exactTime: string;
|
|
23
23
|
amnioticFluid: string;
|
|
24
24
|
moulding: string;
|
|
25
|
+
time?: string;
|
|
25
26
|
date?: string;
|
|
26
27
|
id?: string;
|
|
27
28
|
}
|
|
@@ -82,13 +83,13 @@ const MembraneAmnioticFluidGraph: React.FC<MembraneAmnioticFluidGraphProps> = ({
|
|
|
82
83
|
];
|
|
83
84
|
|
|
84
85
|
const getTimeColumns = () => {
|
|
85
|
-
const emptyColumns = Array.from({ length:
|
|
86
|
+
const emptyColumns = Array.from({ length: 20 }, (_, i) => `grid-${i + 1}`);
|
|
86
87
|
if (data.length === 0) {
|
|
87
88
|
return emptyColumns;
|
|
88
89
|
}
|
|
89
90
|
const dataTimes = data.map((item, idx) => item.exactTime || String(idx));
|
|
90
|
-
if (dataTimes.length <=
|
|
91
|
-
const remainingEmpty = Array.from({ length:
|
|
91
|
+
if (dataTimes.length <= 20) {
|
|
92
|
+
const remainingEmpty = Array.from({ length: 20 - dataTimes.length }, (_, i) => `empty-${i + 1}`);
|
|
92
93
|
return [...dataTimes, ...remainingEmpty];
|
|
93
94
|
}
|
|
94
95
|
return dataTimes;
|
|
@@ -168,6 +169,27 @@ const MembraneAmnioticFluidGraph: React.FC<MembraneAmnioticFluidGraphProps> = ({
|
|
|
168
169
|
{viewMode === 'graph' ? (
|
|
169
170
|
<div className={styles.membraneGrid}>
|
|
170
171
|
<div className={styles.gridContainer}>
|
|
172
|
+
<div className={styles.gridRow}>
|
|
173
|
+
<div className={styles.gridRowLabel} style={{ fontWeight: 600 }}>
|
|
174
|
+
{t('time', 'Time')}
|
|
175
|
+
</div>
|
|
176
|
+
{timeColumns.map((timeColumn, idx) => {
|
|
177
|
+
const item = data[idx];
|
|
178
|
+
let timeValue = '';
|
|
179
|
+
if (item) {
|
|
180
|
+
timeValue = item.time || item.timeSlot || item.exactTime || '';
|
|
181
|
+
}
|
|
182
|
+
return (
|
|
183
|
+
<div
|
|
184
|
+
key={`time-${idx}`}
|
|
185
|
+
className={styles.gridCell}
|
|
186
|
+
style={{ textAlign: 'center', fontWeight: 600 }}>
|
|
187
|
+
{timeValue}
|
|
188
|
+
</div>
|
|
189
|
+
);
|
|
190
|
+
})}
|
|
191
|
+
</div>
|
|
192
|
+
|
|
171
193
|
<div className={styles.gridRow}>
|
|
172
194
|
<div className={styles.gridRowLabel}>{t('amnioticFluid', 'Amniotic Fluid')}</div>
|
|
173
195
|
{timeColumns.map((timeColumn) => {
|
package/src/maternal-and-child-health/partography/graphs/oxytocin-graph-wrapper.component.tsx
CHANGED
|
@@ -75,114 +75,119 @@ const OxytocinGraph: React.FC<OxytocinGraphProps> = ({
|
|
|
75
75
|
];
|
|
76
76
|
|
|
77
77
|
return (
|
|
78
|
-
<div className={styles.
|
|
79
|
-
<div className={styles.
|
|
80
|
-
<div className={styles.
|
|
81
|
-
<
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
78
|
+
<div className={styles.fetalHeartRateSection}>
|
|
79
|
+
<div className={styles.fetalHeartRateContainer}>
|
|
80
|
+
<div className={styles.fetalHeartRateHeader}>
|
|
81
|
+
<div className={styles.fetalHeartRateHeaderLeft}>
|
|
82
|
+
<h6 className={styles.fetalHeartRateTitle}>{t('oxytocinAdministration', 'Oxytocin Administration')}</h6>
|
|
83
|
+
<Tag type="outline">{t('oxytocinRange', '0-60 drops/min')}</Tag>
|
|
84
|
+
<p style={{ fontSize: '0.875rem', color: '#525252', margin: 0 }}>
|
|
85
|
+
{t('oxytocinDescription', 'Track oxytocin administration and drops per minute over time')}
|
|
86
|
+
</p>
|
|
87
|
+
</div>
|
|
88
|
+
<div className={styles.fetalHeartRateControls}>
|
|
89
|
+
<div className={styles.viewToggle}>
|
|
90
|
+
<Button
|
|
91
|
+
kind={viewMode === 'graph' ? 'primary' : 'secondary'}
|
|
92
|
+
size={controlSize}
|
|
93
|
+
hasIconOnly
|
|
94
|
+
iconDescription={t('graphView', 'Graph View')}
|
|
95
|
+
onClick={() => onViewModeChange('graph')}
|
|
96
|
+
className={styles.viewButton}>
|
|
97
|
+
<ChartColumn />
|
|
98
|
+
</Button>
|
|
99
|
+
<Button
|
|
100
|
+
kind={viewMode === 'table' ? 'primary' : 'secondary'}
|
|
101
|
+
size={controlSize}
|
|
102
|
+
hasIconOnly
|
|
103
|
+
iconDescription={t('tableView', 'Table View')}
|
|
104
|
+
onClick={() => onViewModeChange('table')}
|
|
105
|
+
className={styles.viewButton}>
|
|
106
|
+
<TableIcon />
|
|
107
|
+
</Button>
|
|
108
|
+
</div>
|
|
95
109
|
<Button
|
|
96
|
-
kind=
|
|
110
|
+
kind="primary"
|
|
97
111
|
size={controlSize}
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
<TableIcon />
|
|
112
|
+
renderIcon={Add}
|
|
113
|
+
onClick={onAddData}
|
|
114
|
+
disabled={isAddButtonDisabled}>
|
|
115
|
+
{t('add', 'Add')}
|
|
103
116
|
</Button>
|
|
104
117
|
</div>
|
|
105
|
-
<Button kind="primary" size={controlSize} renderIcon={Add} onClick={onAddData} disabled={isAddButtonDisabled}>
|
|
106
|
-
{t('add', 'Add')}
|
|
107
|
-
</Button>
|
|
108
118
|
</div>
|
|
109
|
-
</div>
|
|
110
|
-
<p className={styles.graphDescription}>
|
|
111
|
-
{t('oxytocinDescription', 'Track oxytocin administration and drops per minute over time')}
|
|
112
|
-
</p>
|
|
113
119
|
|
|
114
|
-
|
|
115
|
-
<div className={styles.chartContainer}>
|
|
120
|
+
{viewMode === 'graph' ? (
|
|
116
121
|
<OxytocinGraphComponent data={data} />
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
</TableHeader>
|
|
132
|
-
))}
|
|
133
|
-
</TableRow>
|
|
134
|
-
</TableHead>
|
|
135
|
-
<TableBody>
|
|
136
|
-
{rows.map((row) => (
|
|
137
|
-
<TableRow {...getRowProps({ row })} key={row.id}>
|
|
138
|
-
{row.cells.map((cell) => (
|
|
139
|
-
<TableCell key={cell.id}>{cell.value}</TableCell>
|
|
122
|
+
) : (
|
|
123
|
+
<div className={styles.tableContainer}>
|
|
124
|
+
{paginatedData.length > 0 ? (
|
|
125
|
+
<>
|
|
126
|
+
<DataTable rows={paginatedData} headers={tableHeaders}>
|
|
127
|
+
{({ rows, headers, getTableProps, getHeaderProps, getRowProps }) => (
|
|
128
|
+
<TableContainer title="" description="">
|
|
129
|
+
<Table {...getTableProps()} size="sm">
|
|
130
|
+
<TableHead>
|
|
131
|
+
<TableRow>
|
|
132
|
+
{headers.map((header) => (
|
|
133
|
+
<TableHeader {...getHeaderProps({ header })} key={header.key}>
|
|
134
|
+
{header.header}
|
|
135
|
+
</TableHeader>
|
|
140
136
|
))}
|
|
141
137
|
</TableRow>
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
138
|
+
</TableHead>
|
|
139
|
+
<TableBody>
|
|
140
|
+
{rows.map((row) => (
|
|
141
|
+
<TableRow {...getRowProps({ row })} key={row.id}>
|
|
142
|
+
{row.cells.map((cell) => (
|
|
143
|
+
<TableCell key={cell.id}>{cell.value}</TableCell>
|
|
144
|
+
))}
|
|
145
|
+
</TableRow>
|
|
146
|
+
))}
|
|
147
|
+
</TableBody>
|
|
148
|
+
</Table>
|
|
149
|
+
</TableContainer>
|
|
150
|
+
)}
|
|
151
|
+
</DataTable>
|
|
148
152
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
153
|
+
{totalItems > 0 && (
|
|
154
|
+
<Pagination
|
|
155
|
+
page={currentPage}
|
|
156
|
+
totalItems={totalItems}
|
|
157
|
+
pageSize={pageSize}
|
|
158
|
+
pageSizes={calculatedPageSizes}
|
|
159
|
+
onChange={(event) => {
|
|
160
|
+
onPageChange(event.page);
|
|
161
|
+
if (event.pageSize !== pageSize) {
|
|
162
|
+
onPageSizeChange(event.pageSize);
|
|
163
|
+
}
|
|
164
|
+
}}
|
|
165
|
+
size={controlSize as 'sm' | 'md' | 'lg'}
|
|
166
|
+
/>
|
|
167
|
+
)}
|
|
168
|
+
{totalItems > 0 && <div className={styles.paginationInfo}>{itemsDisplayed}</div>}
|
|
169
|
+
<div className={styles.tableStats}>
|
|
170
|
+
<span className={styles.recordCount}>
|
|
171
|
+
{t('showingResults', 'Showing {{start}}-{{end}} of {{total}} {{itemType}}', {
|
|
172
|
+
start: totalItems === 0 ? 0 : startIndex + 1,
|
|
173
|
+
end: Math.min(endIndex, totalItems),
|
|
174
|
+
total: totalItems,
|
|
175
|
+
itemType: totalItems === 1 ? t('record', 'record') : t('records', 'records'),
|
|
176
|
+
})}
|
|
177
|
+
</span>
|
|
178
|
+
</div>
|
|
179
|
+
</>
|
|
180
|
+
) : (
|
|
181
|
+
<div className={styles.emptyState}>
|
|
182
|
+
<p>{t('noOxytocinData', 'No oxytocin data available')}</p>
|
|
183
|
+
<Button kind="primary" size={controlSize} renderIcon={Add} onClick={onAddData}>
|
|
184
|
+
{t('addFirstDataPoint', 'Add first data point')}
|
|
185
|
+
</Button>
|
|
174
186
|
</div>
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
<Button kind="primary" size={controlSize} renderIcon={Add} onClick={onAddData}>
|
|
180
|
-
{t('addFirstDataPoint', 'Add first data point')}
|
|
181
|
-
</Button>
|
|
182
|
-
</div>
|
|
183
|
-
)}
|
|
184
|
-
</div>
|
|
185
|
-
)}
|
|
187
|
+
)}
|
|
188
|
+
</div>
|
|
189
|
+
)}
|
|
190
|
+
</div>
|
|
186
191
|
</div>
|
|
187
192
|
);
|
|
188
193
|
};
|
|
@@ -16,16 +16,15 @@ const OxytocinGraph: React.FC<OxytocinGraphProps> = ({ data }) => {
|
|
|
16
16
|
const { t } = useTranslation();
|
|
17
17
|
|
|
18
18
|
const getTimeColumns = () => {
|
|
19
|
-
const emptyColumns = Array.from({ length:
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
const remainingEmpty = Array.from({ length: 13 - dataTimeSlots.length }, (_, i) => `empty-${i + 1}`);
|
|
26
|
-
return [...dataTimeSlots, ...remainingEmpty];
|
|
19
|
+
const emptyColumns = Array.from({ length: 20 }, (_, i) => `grid-${i + 1}`);
|
|
20
|
+
|
|
21
|
+
if (data && data.length > 0) {
|
|
22
|
+
const dataSlots = data.map((item, i) => `data-${i + 1}`);
|
|
23
|
+
const remainingEmpty = Array.from({ length: 20 - data.length }, (_, i) => `empty-${i + 1}`);
|
|
24
|
+
return [...dataSlots, ...remainingEmpty];
|
|
27
25
|
}
|
|
28
|
-
|
|
26
|
+
|
|
27
|
+
return emptyColumns;
|
|
29
28
|
};
|
|
30
29
|
|
|
31
30
|
const timeColumns = getTimeColumns();
|
|
@@ -79,19 +78,12 @@ const OxytocinGraph: React.FC<OxytocinGraphProps> = ({ data }) => {
|
|
|
79
78
|
};
|
|
80
79
|
|
|
81
80
|
return (
|
|
82
|
-
<div
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
{timeColumns.map((timeColumn) => (
|
|
87
|
-
<div key={timeColumn} className={styles.gridCell}>
|
|
88
|
-
{timeColumn.startsWith('grid-') || timeColumn.startsWith('empty-') ? '' : timeColumn}
|
|
89
|
-
</div>
|
|
90
|
-
))}
|
|
91
|
-
</div>
|
|
92
|
-
|
|
81
|
+
<div
|
|
82
|
+
className={styles.membraneGrid}
|
|
83
|
+
style={{ marginTop: 0, maxHeight: 'fit-content', minHeight: 'auto', marginBottom: 0 }}>
|
|
84
|
+
<div className={styles.gridContainer} style={{ padding: '0' }}>
|
|
93
85
|
{rows.map((row) => (
|
|
94
|
-
<div key={row.id} className={styles.gridRow}>
|
|
86
|
+
<div key={row.id} className={styles.gridRow} style={{ minHeight: 40 }}>
|
|
95
87
|
<div className={styles.gridRowLabel}>{row.label}</div>
|
|
96
88
|
{timeColumns.map((timeColumn) => {
|
|
97
89
|
const content = getCellContent(row.id, timeColumn);
|
|
@@ -102,7 +94,14 @@ const OxytocinGraph: React.FC<OxytocinGraphProps> = ({ data }) => {
|
|
|
102
94
|
className={`${styles.gridCell} ${cellClass}`}
|
|
103
95
|
data-time-slot={timeColumn}
|
|
104
96
|
data-row={row.id}
|
|
105
|
-
title={`${timeColumn}: ${content || 'No data'}`}
|
|
97
|
+
title={`${timeColumn}: ${content || 'No data'}`}
|
|
98
|
+
style={{
|
|
99
|
+
minHeight: 40,
|
|
100
|
+
padding: '8px 4px',
|
|
101
|
+
display: 'flex',
|
|
102
|
+
alignItems: 'center',
|
|
103
|
+
justifyContent: 'center',
|
|
104
|
+
}}>
|
|
106
105
|
{content && (
|
|
107
106
|
<span
|
|
108
107
|
style={{
|
|
@@ -44,9 +44,9 @@ const PULSE_BP_CHART_OPTIONS = {
|
|
|
44
44
|
left: {
|
|
45
45
|
title: 'Pulse',
|
|
46
46
|
mapsTo: 'value',
|
|
47
|
-
domain: [
|
|
47
|
+
domain: [0, 260],
|
|
48
48
|
ticks: {
|
|
49
|
-
values: [
|
|
49
|
+
values: [0, 20, 40, 60, 80, 100, 120, 140, 160, 180, 200, 220, 240, 260],
|
|
50
50
|
formatter: (value: number) => `${value}`,
|
|
51
51
|
},
|
|
52
52
|
scaleType: ScaleTypes.LINEAR,
|
|
@@ -74,7 +74,7 @@ const PULSE_BP_CHART_OPTIONS = {
|
|
|
74
74
|
},
|
|
75
75
|
y: {
|
|
76
76
|
enabled: true,
|
|
77
|
-
numberOfTicks:
|
|
77
|
+
numberOfTicks: 14,
|
|
78
78
|
},
|
|
79
79
|
},
|
|
80
80
|
zoomBar: {
|
|
@@ -109,10 +109,9 @@ const PulseBPGraph: React.FC<PulseBPGraphProps> = ({ data }) => {
|
|
|
109
109
|
const pulseChartData: ChartDataPoint[] = [];
|
|
110
110
|
|
|
111
111
|
if (actualData.length > 0) {
|
|
112
|
-
pulseChartData.push({ index: 0, value: actualData[0].pulse, group: 'Pulse' });
|
|
113
112
|
actualData.forEach((item, index) => {
|
|
114
113
|
pulseChartData.push({
|
|
115
|
-
index: index
|
|
114
|
+
index: index,
|
|
116
115
|
value: item.pulse,
|
|
117
116
|
group: 'Pulse',
|
|
118
117
|
});
|
|
@@ -156,23 +155,23 @@ const PulseBPGraph: React.FC<PulseBPGraphProps> = ({ data }) => {
|
|
|
156
155
|
zIndex: 5,
|
|
157
156
|
}}>
|
|
158
157
|
{actualData.map((item, index) => {
|
|
159
|
-
const chartMarginTop =
|
|
160
|
-
const chartMarginBottom =
|
|
161
|
-
const chartMarginLeft =
|
|
162
|
-
const chartMarginRight =
|
|
163
|
-
|
|
158
|
+
const chartMarginTop = 5;
|
|
159
|
+
const chartMarginBottom = 8;
|
|
160
|
+
const chartMarginLeft = 3.59;
|
|
161
|
+
const chartMarginRight = 8;
|
|
164
162
|
const chartWidth = 100 - chartMarginLeft - chartMarginRight;
|
|
165
163
|
const chartHeight = 100 - chartMarginTop - chartMarginBottom;
|
|
166
|
-
|
|
167
|
-
const
|
|
168
|
-
const
|
|
169
|
-
|
|
170
|
-
const
|
|
171
|
-
const
|
|
172
|
-
|
|
173
|
-
const
|
|
174
|
-
|
|
175
|
-
|
|
164
|
+
const dataPointIndex = index;
|
|
165
|
+
const bpXPosition = chartMarginLeft + ((dataPointIndex + 0) / 12) * chartWidth;
|
|
166
|
+
const yOffset = 23;
|
|
167
|
+
const yOffsetDiastolic = 40;
|
|
168
|
+
const pulseYPosition = chartMarginTop + yOffset + ((260 - item.pulse) / 260) * (chartHeight - yOffset);
|
|
169
|
+
const systolicYPosition =
|
|
170
|
+
chartMarginTop + yOffset + ((260 - item.systolicBP) / 260) * (chartHeight - yOffset);
|
|
171
|
+
const diastolicYPosition =
|
|
172
|
+
chartMarginTop +
|
|
173
|
+
yOffsetDiastolic +
|
|
174
|
+
((260 - item.diastolicBP) / 260) * (chartHeight - yOffsetDiastolic);
|
|
176
175
|
|
|
177
176
|
const greenArrowStartY = Math.min(pulseYPosition, diastolicYPosition);
|
|
178
177
|
const greenArrowEndY = Math.max(pulseYPosition, diastolicYPosition);
|
|
@@ -198,7 +197,6 @@ const PulseBPGraph: React.FC<PulseBPGraphProps> = ({ data }) => {
|
|
|
198
197
|
refY="5"
|
|
199
198
|
orient="auto"
|
|
200
199
|
markerUnits="strokeWidth">
|
|
201
|
-
{/* Downward arrow for green (diastolic) */}
|
|
202
200
|
<polygon points="0,10 10,5 0,0 3,5" fill={getColorForGraph('green')} />
|
|
203
201
|
</marker>
|
|
204
202
|
</defs>
|
|
@@ -213,12 +211,11 @@ const PulseBPGraph: React.FC<PulseBPGraphProps> = ({ data }) => {
|
|
|
213
211
|
markerEnd={`url(#systolic-arrow-${index})`}
|
|
214
212
|
/>
|
|
215
213
|
|
|
216
|
-
{/* Always draw green arrow down, regardless of value */}
|
|
217
214
|
<line
|
|
218
215
|
x1={`${bpXPosition}%`}
|
|
219
|
-
y1={`${
|
|
216
|
+
y1={`${pulseYPosition}%`}
|
|
220
217
|
x2={`${bpXPosition}%`}
|
|
221
|
-
y2={`${
|
|
218
|
+
y2={`${diastolicYPosition}%`}
|
|
222
219
|
stroke={getColorForGraph('green')}
|
|
223
220
|
strokeWidth="2"
|
|
224
221
|
markerEnd={`url(#diastolic-arrow-${index})`}
|
|
@@ -77,8 +77,9 @@ const TemperatureGraph: React.FC<TemperatureGraphProps> = ({
|
|
|
77
77
|
{ key: 'temperature', header: t('temperature', 'Temperature (°C)') },
|
|
78
78
|
];
|
|
79
79
|
|
|
80
|
-
const timeColumns =
|
|
81
|
-
|
|
80
|
+
const timeColumns = Array.from(
|
|
81
|
+
{ length: Math.max(20, data.length) },
|
|
82
|
+
(_, colIndex) => data[colIndex]?.timeSlot || '',
|
|
82
83
|
);
|
|
83
84
|
|
|
84
85
|
const getTemperatureStatus = (temperature: number): string => {
|
|
@@ -94,18 +95,6 @@ const TemperatureGraph: React.FC<TemperatureGraphProps> = ({
|
|
|
94
95
|
return '';
|
|
95
96
|
};
|
|
96
97
|
|
|
97
|
-
const createGridData = () => {
|
|
98
|
-
const gridData: Record<string, { temperature: number }> = {};
|
|
99
|
-
data.forEach((item) => {
|
|
100
|
-
const key = item.timeSlot;
|
|
101
|
-
gridData[key] = {
|
|
102
|
-
temperature: item.temperature,
|
|
103
|
-
};
|
|
104
|
-
});
|
|
105
|
-
return gridData;
|
|
106
|
-
};
|
|
107
|
-
const gridData = createGridData();
|
|
108
|
-
|
|
109
98
|
return (
|
|
110
99
|
<div className={styles.fetalHeartRateSection}>
|
|
111
100
|
<div className={styles.fetalHeartRateContainer}>
|
|
@@ -157,22 +146,30 @@ const TemperatureGraph: React.FC<TemperatureGraphProps> = ({
|
|
|
157
146
|
<div className={styles.gridContainer}>
|
|
158
147
|
<div className={styles.gridHeader}>
|
|
159
148
|
<div className={styles.gridCell}>{t('time', 'Time')}</div>
|
|
160
|
-
{timeColumns.map((
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
149
|
+
{timeColumns.map((_, colIndex) => {
|
|
150
|
+
const item = data[colIndex];
|
|
151
|
+
return (
|
|
152
|
+
<div key={`time-${colIndex}`} className={styles.gridCell}>
|
|
153
|
+
{item?.exactTime || item?.timeSlot || ''}
|
|
154
|
+
</div>
|
|
155
|
+
);
|
|
156
|
+
})}
|
|
165
157
|
</div>
|
|
166
158
|
|
|
167
159
|
<div className={styles.gridRow}>
|
|
168
160
|
<div className={styles.gridRowLabel}>{t('temperature', 'Temp °C')}</div>
|
|
169
|
-
{
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
161
|
+
{timeColumns.map((_, colIndex) => {
|
|
162
|
+
const item = data[colIndex];
|
|
163
|
+
return (
|
|
164
|
+
<div
|
|
165
|
+
key={`temp-${colIndex}`}
|
|
166
|
+
className={`${styles.gridCell} ${
|
|
167
|
+
item?.temperature ? getTemperatureStatus(item.temperature) : ''
|
|
168
|
+
}`}>
|
|
169
|
+
{item?.temperature !== undefined && item?.temperature !== null ? item.temperature : ''}
|
|
170
|
+
</div>
|
|
171
|
+
);
|
|
172
|
+
})}
|
|
176
173
|
</div>
|
|
177
174
|
</div>
|
|
178
175
|
</div>
|