@kenyaemr/esm-patient-clinical-view-app 5.4.2-pre.2592 → 5.4.2-pre.2598
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 +6 -6
- package/dist/127.js +1 -1
- package/dist/152.js +3 -3
- package/dist/152.js.map +1 -1
- package/dist/481.js +66 -0
- package/dist/481.js.map +1 -0
- package/dist/671.js +1 -1
- package/dist/671.js.map +1 -1
- package/dist/941.js +1 -0
- package/dist/941.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 +55 -55
- package/dist/kenyaemr-esm-patient-clinical-view-app.js.map +1 -1
- package/dist/main.js +87 -14
- package/dist/main.js.map +1 -1
- package/dist/routes.json +1 -1
- package/package.json +1 -1
- package/src/config-schema.ts +144 -0
- package/src/index.ts +2 -2
- package/src/maternal-and-child-health/partography/labour-delivery.scss +6 -7
- package/src/maternal-and-child-health/partography/partograph.component.tsx +487 -151
- package/src/maternal-and-child-health/partography/partography-data-form.component.tsx +434 -0
- package/src/maternal-and-child-health/partography/partography-data-form.scss +50 -0
- package/src/maternal-and-child-health/partography/partography-link.component.tsx +21 -0
- package/src/maternal-and-child-health/partography/partography.resource.ts +1024 -0
- package/src/maternal-and-child-health/partography/partography.scss +378 -0
- package/src/maternal-and-child-health/partography/types/index.ts +980 -0
- package/translations/en.json +11 -1
- package/dist/287.js +0 -1
- package/dist/287.js.map +0 -1
- package/dist/98.js +0 -1
- package/dist/98.js.map +0 -1
- package/src/maternal-and-child-health/partography/cervical-dilation.component.tsx +0 -16
- package/src/maternal-and-child-health/partography/contraction-level.component.tsx +0 -16
- package/src/maternal-and-child-health/partography/descent-of-head.component.tsx +0 -16
- package/src/maternal-and-child-health/partography/foetal-heart-rate.component.tsx +0 -17
- package/src/maternal-and-child-health/partography/membrane-amniotic-fluid-moulding.component.tsx +0 -17
- package/src/maternal-and-child-health/partography/partograph-chart.scss +0 -94
- package/src/maternal-and-child-health/partography/partograph-chart.tsx +0 -176
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { EmptyState } from '@openmrs/esm-patient-common-lib/src';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { useTranslation } from 'react-i18next';
|
|
4
|
-
|
|
5
|
-
const CervicalDilation = () => {
|
|
6
|
-
const { t } = useTranslation();
|
|
7
|
-
return (
|
|
8
|
-
<EmptyState
|
|
9
|
-
headerTitle={t('cervicalDilation', 'Cervical Dilation')}
|
|
10
|
-
displayText={t('cervicalDilation', 'Cervical Dilation')}
|
|
11
|
-
launchForm={() => {}}
|
|
12
|
-
/>
|
|
13
|
-
);
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export default CervicalDilation;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { EmptyState } from '@openmrs/esm-patient-common-lib';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { useTranslation } from 'react-i18next';
|
|
4
|
-
|
|
5
|
-
const ContractionLevel = () => {
|
|
6
|
-
const { t } = useTranslation();
|
|
7
|
-
return (
|
|
8
|
-
<EmptyState
|
|
9
|
-
headerTitle={t('contractionLevel', 'Contraction level')}
|
|
10
|
-
displayText={t('contractionLevel', 'Contraction level')}
|
|
11
|
-
launchForm={() => {}}
|
|
12
|
-
/>
|
|
13
|
-
);
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export default ContractionLevel;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { EmptyState } from '@openmrs/esm-patient-common-lib';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { useTranslation } from 'react-i18next';
|
|
4
|
-
|
|
5
|
-
const DescentOfHead = () => {
|
|
6
|
-
const { t } = useTranslation();
|
|
7
|
-
return (
|
|
8
|
-
<EmptyState
|
|
9
|
-
headerTitle={t('descentOfHead', 'Descent of Head')}
|
|
10
|
-
displayText={t('descentOfHead', 'Descent of Head')}
|
|
11
|
-
launchForm={() => {}}
|
|
12
|
-
/>
|
|
13
|
-
);
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export default DescentOfHead;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { EmptyState } from '@openmrs/esm-patient-common-lib';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { useTranslation } from 'react-i18next';
|
|
4
|
-
|
|
5
|
-
const FoetalHeartRate = () => {
|
|
6
|
-
const { t } = useTranslation();
|
|
7
|
-
|
|
8
|
-
return (
|
|
9
|
-
<EmptyState
|
|
10
|
-
headerTitle={t('foetalHeartRate', 'Foetal Heart Rate')}
|
|
11
|
-
displayText={t('foetalHeartRate', 'Foetal Heart Rate')}
|
|
12
|
-
launchForm={() => {}}
|
|
13
|
-
/>
|
|
14
|
-
);
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export default FoetalHeartRate;
|
package/src/maternal-and-child-health/partography/membrane-amniotic-fluid-moulding.component.tsx
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { EmptyState } from '@openmrs/esm-patient-common-lib';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { useTranslation } from 'react-i18next';
|
|
4
|
-
|
|
5
|
-
const MembraneAmnioticFluidAndMoulding = () => {
|
|
6
|
-
const { t } = useTranslation();
|
|
7
|
-
|
|
8
|
-
return (
|
|
9
|
-
<EmptyState
|
|
10
|
-
headerTitle={t('membraneAmnioticFluidAndMoulding', 'Membrane Amniotic Fluid & Moulding')}
|
|
11
|
-
displayText={t('membraneAmnioticFluidAndMoulding', 'Membrane Amniotic Fluid & Moulding')}
|
|
12
|
-
launchForm={() => {}}
|
|
13
|
-
/>
|
|
14
|
-
);
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export default MembraneAmnioticFluidAndMoulding;
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
@use '@carbon/styles/scss/spacing';
|
|
2
|
-
@use '@carbon/styles/scss/type';
|
|
3
|
-
@use '~@openmrs/esm-styleguide/src/vars' as *;
|
|
4
|
-
|
|
5
|
-
.label01 {
|
|
6
|
-
@include type.type-style('label-01');
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
.bodyShort01 {
|
|
10
|
-
@include type.type-style('body-compact-01');
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.vitalsChartContainer {
|
|
14
|
-
margin-bottom: spacing.$spacing-05;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.vitalSignsArea {
|
|
18
|
-
flex-grow: 1;
|
|
19
|
-
margin: spacing.$spacing-03 0;
|
|
20
|
-
padding-right: spacing.$spacing-05;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.vitalsChartArea {
|
|
24
|
-
flex-grow: 4;
|
|
25
|
-
padding: 0 spacing.$spacing-05 spacing.$spacing-09;
|
|
26
|
-
|
|
27
|
-
:global(.cds--cc--layout-row) {
|
|
28
|
-
height: 0;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
:global(.layout-child) {
|
|
32
|
-
margin-top: 0.5rem;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.vitalsSignLabel {
|
|
37
|
-
@extend .label01;
|
|
38
|
-
margin-bottom: 1rem;
|
|
39
|
-
margin-left: 1.5rem;
|
|
40
|
-
display: inline-block;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
.verticalTabs {
|
|
44
|
-
margin: 1rem 0;
|
|
45
|
-
scroll-behavior: smooth;
|
|
46
|
-
|
|
47
|
-
> ul {
|
|
48
|
-
flex-direction: column !important;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
:global(.cds--tabs--scrollable .cds--tabs--scrollable__nav-item + .cds--tabs--scrollable__nav-item) {
|
|
52
|
-
margin-left: 0rem;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
:global(.cds--tabs--scrollable .cds--tabs--scrollable__nav-link) {
|
|
56
|
-
border-bottom: 0 !important;
|
|
57
|
-
border-left: 2px solid $color-gray-30;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
.tab {
|
|
62
|
-
outline: 0;
|
|
63
|
-
outline-offset: 0;
|
|
64
|
-
|
|
65
|
-
&:active,
|
|
66
|
-
&:focus {
|
|
67
|
-
outline: 2px solid var(--brand-03) !important;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
&[aria-selected='true'] {
|
|
71
|
-
border-left: 3px solid var(--brand-03);
|
|
72
|
-
border-bottom: none;
|
|
73
|
-
font-weight: 600;
|
|
74
|
-
margin-left: 0rem !important;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
&[aria-selected='false'] {
|
|
78
|
-
border-bottom: none;
|
|
79
|
-
border-left: 2px solid $ui-03;
|
|
80
|
-
margin-left: 0rem !important;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
.tablist {
|
|
85
|
-
:global(.cds--tab--list) {
|
|
86
|
-
flex-direction: column;
|
|
87
|
-
max-height: fit-content;
|
|
88
|
-
overflow-x: visible;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
> button :global(.cds--tabs .cds--tabs__nav-link) {
|
|
92
|
-
border-bottom: none;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
import React, { useMemo, useState } from 'react';
|
|
2
|
-
import { useTranslation } from 'react-i18next';
|
|
3
|
-
import { Tab, TabsVertical, TabListVertical, TabPanels, TabPanel } from '@carbon/react';
|
|
4
|
-
import { LineChart } from '@carbon/charts-react';
|
|
5
|
-
import styles from './partograph-chart.scss';
|
|
6
|
-
|
|
7
|
-
interface PartographyComponent {
|
|
8
|
-
date: string;
|
|
9
|
-
fetalHeartRate?: number;
|
|
10
|
-
cervicalDilation?: number;
|
|
11
|
-
descentOfHead?: string | number;
|
|
12
|
-
[key: string]: any;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
interface PartographChartProps {
|
|
16
|
-
partograpyComponents: PartographyComponent[];
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
interface PartographSignOption {
|
|
20
|
-
id: string;
|
|
21
|
-
title: string;
|
|
22
|
-
value: keyof PartographyComponent;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
enum ScaleTypes {
|
|
26
|
-
TIME = 'time',
|
|
27
|
-
LINEAR = 'linear',
|
|
28
|
-
LOG = 'log',
|
|
29
|
-
LABELS = 'labels',
|
|
30
|
-
LABELS_RATIO = 'labels-ratio',
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
const PartographChart: React.FC<PartographChartProps> = ({ partograpyComponents }) => {
|
|
34
|
-
const { t } = useTranslation();
|
|
35
|
-
|
|
36
|
-
const processedPartographData = useMemo(() => {
|
|
37
|
-
return partograpyComponents.map((item) => {
|
|
38
|
-
const processedItem = { ...item };
|
|
39
|
-
|
|
40
|
-
if (typeof item.descentOfHead === 'string' && item.descentOfHead.includes('/')) {
|
|
41
|
-
const [numerator, denominator] = item.descentOfHead.split('/').map(Number);
|
|
42
|
-
processedItem.descentOfHead = denominator !== 0 ? (numerator / denominator) * 10 : 10;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
return processedItem;
|
|
46
|
-
});
|
|
47
|
-
}, [partograpyComponents]);
|
|
48
|
-
|
|
49
|
-
const getFormattedValue = (value: any): string => {
|
|
50
|
-
if (value === undefined || value === null) {
|
|
51
|
-
return '-';
|
|
52
|
-
}
|
|
53
|
-
return value.toString();
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
const partographSignOptions = useMemo<PartographSignOption[]>(() => {
|
|
57
|
-
const firstValidItem = processedPartographData.find(
|
|
58
|
-
(item) =>
|
|
59
|
-
item.fetalHeartRate !== undefined || item.cervicalDilation !== undefined || item.descentOfHead !== undefined,
|
|
60
|
-
);
|
|
61
|
-
|
|
62
|
-
const fetalHeartRate = firstValidItem?.fetalHeartRate;
|
|
63
|
-
const cervicalDilation = firstValidItem?.cervicalDilation;
|
|
64
|
-
const descentOfHead = firstValidItem?.descentOfHead;
|
|
65
|
-
|
|
66
|
-
return [
|
|
67
|
-
{
|
|
68
|
-
id: 'fetalHeartRate',
|
|
69
|
-
title: `Heart Rate (${getFormattedValue(fetalHeartRate)})`,
|
|
70
|
-
value: 'fetalHeartRate',
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
id: 'cervicalDilation',
|
|
74
|
-
title: `Cervical Dilation (${getFormattedValue(cervicalDilation)})`,
|
|
75
|
-
value: 'cervicalDilation',
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
id: 'descentOfHead',
|
|
79
|
-
title: `Descent of Head (${getFormattedValue(descentOfHead)})`,
|
|
80
|
-
value: 'descentOfHead',
|
|
81
|
-
},
|
|
82
|
-
];
|
|
83
|
-
}, [processedPartographData]);
|
|
84
|
-
|
|
85
|
-
const [selectedPartographSign, setSelectedPartographSign] = useState<PartographSignOption>(partographSignOptions[0]);
|
|
86
|
-
|
|
87
|
-
const chartData = useMemo(() => {
|
|
88
|
-
if (!processedPartographData.length) {
|
|
89
|
-
return [];
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
return processedPartographData
|
|
93
|
-
.filter((item) => item[selectedPartographSign.value] !== undefined)
|
|
94
|
-
.slice(0, 10)
|
|
95
|
-
.sort((a, b) => new Date(a.date).getTime() - new Date(b.date).getTime())
|
|
96
|
-
.map((item) => ({
|
|
97
|
-
group: selectedPartographSign.title,
|
|
98
|
-
value: item[selectedPartographSign.value],
|
|
99
|
-
date: item.date,
|
|
100
|
-
}));
|
|
101
|
-
}, [processedPartographData, selectedPartographSign]);
|
|
102
|
-
|
|
103
|
-
const chartOptions = useMemo(
|
|
104
|
-
() => ({
|
|
105
|
-
title: t('partoGraphtChartTitle', 'PartoGraph Chart'),
|
|
106
|
-
axes: {
|
|
107
|
-
bottom: {
|
|
108
|
-
title: t('time', 'Time'),
|
|
109
|
-
mapsTo: 'date',
|
|
110
|
-
scaleType: ScaleTypes.TIME,
|
|
111
|
-
},
|
|
112
|
-
left: {
|
|
113
|
-
mapsTo: 'value',
|
|
114
|
-
title: selectedPartographSign.title,
|
|
115
|
-
scaleType: ScaleTypes.LINEAR,
|
|
116
|
-
includeZero: false,
|
|
117
|
-
},
|
|
118
|
-
},
|
|
119
|
-
curve: 'curveMonotoneX',
|
|
120
|
-
height: '400px',
|
|
121
|
-
tooltip: {
|
|
122
|
-
customHTML: ([{ value, group }]: any) => `
|
|
123
|
-
<div class="cds--tooltip cds--tooltip--shown" style="min-width: max-content; font-weight:600">
|
|
124
|
-
${value} - ${String(group).toUpperCase()}
|
|
125
|
-
<span style="color: #c6c6c6; font-size: 1rem; font-weight:600">${group}</span>
|
|
126
|
-
</div>
|
|
127
|
-
`,
|
|
128
|
-
},
|
|
129
|
-
}),
|
|
130
|
-
[t, selectedPartographSign.title],
|
|
131
|
-
);
|
|
132
|
-
|
|
133
|
-
const handleTabSelect = (option: PartographSignOption) => {
|
|
134
|
-
setSelectedPartographSign(option);
|
|
135
|
-
};
|
|
136
|
-
|
|
137
|
-
React.useEffect(() => {
|
|
138
|
-
const currentOption = partographSignOptions.find((option) => option.id === selectedPartographSign.id);
|
|
139
|
-
// Update to the new option or default to the first option
|
|
140
|
-
setSelectedPartographSign(currentOption || partographSignOptions[0]);
|
|
141
|
-
}, [partographSignOptions, selectedPartographSign.id]);
|
|
142
|
-
|
|
143
|
-
return (
|
|
144
|
-
<div className={styles.vitalsChartContainer}>
|
|
145
|
-
<div className={styles.partographSignsArea}>
|
|
146
|
-
<label className={styles.vitalsSignLabel} htmlFor="partography-chart-tab-group">
|
|
147
|
-
{t('partographyDisplay', 'Partography Displayed')}
|
|
148
|
-
</label>
|
|
149
|
-
<TabsVertical height="">
|
|
150
|
-
<TabListVertical>
|
|
151
|
-
{partographSignOptions.map((option) => (
|
|
152
|
-
<Tab
|
|
153
|
-
key={option.id}
|
|
154
|
-
className={`${styles.tab} ${styles.bodyLong01} ${
|
|
155
|
-
selectedPartographSign.id === option.id ? styles.selectedTab : ''
|
|
156
|
-
}`}
|
|
157
|
-
onClick={() => handleTabSelect(option)}>
|
|
158
|
-
{option.title}
|
|
159
|
-
</Tab>
|
|
160
|
-
))}
|
|
161
|
-
</TabListVertical>
|
|
162
|
-
|
|
163
|
-
<TabPanels>
|
|
164
|
-
{partographSignOptions.map(({ id, title, value }) => (
|
|
165
|
-
<TabPanel key={id}>
|
|
166
|
-
<LineChart data={chartData.flat()} options={chartOptions} />
|
|
167
|
-
</TabPanel>
|
|
168
|
-
))}
|
|
169
|
-
</TabPanels>
|
|
170
|
-
</TabsVertical>
|
|
171
|
-
</div>
|
|
172
|
-
</div>
|
|
173
|
-
);
|
|
174
|
-
};
|
|
175
|
-
|
|
176
|
-
export default PartographChart;
|