@egen-civitas/esm-styleguide 2.3.0 → 3.0.0
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/CHANGELOG.md +46 -0
- package/dist/_all.scss +0 -1
- package/dist/_vars.scss +4 -4
- package/dist/assistant/index.d.ts +7 -0
- package/dist/assistant/index.d.ts.map +1 -1
- package/dist/assistant/index.js +5 -0
- package/dist/assistant/live-orb.component.d.ts +6 -0
- package/dist/assistant/live-orb.component.d.ts.map +1 -1
- package/dist/assistant/live-orb.component.js +15 -3
- package/dist/assistant/robot/README.md +47 -0
- package/dist/assistant/robot/Robot.d.ts +16 -0
- package/dist/assistant/robot/Robot.d.ts.map +1 -0
- package/dist/assistant/robot/Robot.js +159 -0
- package/dist/assistant/robot/RobotStage.d.ts +31 -0
- package/dist/assistant/robot/RobotStage.d.ts.map +1 -0
- package/dist/assistant/robot/RobotStage.js +250 -0
- package/dist/assistant/robot/clips.d.ts +62 -0
- package/dist/assistant/robot/clips.d.ts.map +1 -0
- package/dist/assistant/robot/clips.js +179 -0
- package/dist/assistant/robot/controller.d.ts +133 -0
- package/dist/assistant/robot/controller.d.ts.map +1 -0
- package/dist/assistant/robot/controller.js +522 -0
- package/dist/assistant/robot/gestures.d.ts +23 -0
- package/dist/assistant/robot/gestures.d.ts.map +1 -0
- package/dist/assistant/robot/gestures.js +1301 -0
- package/dist/assistant/robot/hands.d.ts +55 -0
- package/dist/assistant/robot/hands.d.ts.map +1 -0
- package/dist/assistant/robot/hands.js +121 -0
- package/dist/assistant/robot/ik.d.ts +34 -0
- package/dist/assistant/robot/ik.d.ts.map +1 -0
- package/dist/assistant/robot/ik.js +57 -0
- package/dist/assistant/robot/index.d.ts +18 -0
- package/dist/assistant/robot/index.d.ts.map +1 -0
- package/dist/assistant/robot/index.js +9 -0
- package/dist/assistant/robot/lazy.d.ts +8 -0
- package/dist/assistant/robot/lazy.d.ts.map +1 -0
- package/dist/assistant/robot/lazy.js +33 -0
- package/dist/assistant/robot/materials.d.ts +46 -0
- package/dist/assistant/robot/materials.d.ts.map +1 -0
- package/dist/assistant/robot/materials.js +101 -0
- package/dist/assistant/robot/parts/Body.d.ts +28 -0
- package/dist/assistant/robot/parts/Body.d.ts.map +1 -0
- package/dist/assistant/robot/parts/Body.js +368 -0
- package/dist/assistant/robot/parts/Head.d.ts +11 -0
- package/dist/assistant/robot/parts/Head.d.ts.map +1 -0
- package/dist/assistant/robot/parts/Head.js +210 -0
- package/dist/assistant/robot/parts/primitives.d.ts +36 -0
- package/dist/assistant/robot/parts/primitives.d.ts.map +1 -0
- package/dist/assistant/robot/parts/primitives.js +127 -0
- package/dist/assistant/robot/skeleton.d.ts +66 -0
- package/dist/assistant/robot/skeleton.d.ts.map +1 -0
- package/dist/assistant/robot/skeleton.js +266 -0
- package/dist/cards/card-header.component.d.ts +1 -1
- package/dist/cards/card-header.component.js +1 -1
- package/dist/cards/card-header.stories.js +1 -1
- package/dist/components/_general.scss +3 -3
- package/dist/config-schema.d.ts +0 -17
- package/dist/config-schema.d.ts.map +1 -1
- package/dist/config-schema.js +0 -25
- package/dist/datepicker/datepicker.stories.js +1 -1
- package/dist/empty-card/empty-card.stories.js +2 -2
- package/dist/error-state/error-state.stories.js +2 -2
- package/dist/icons/icon-registration.d.ts.map +1 -1
- package/dist/icons/icon-registration.js +0 -30
- package/dist/icons/icons.d.ts +4 -32
- package/dist/icons/icons.d.ts.map +1 -1
- package/dist/icons/icons.js +18 -148
- package/dist/index.js +0 -2
- package/dist/internal.d.ts +0 -3
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +0 -3
- package/dist/notifications/actionable-notification.stories.js +5 -5
- package/dist/notifications/notification.stories.js +5 -5
- package/dist/page-header/page-header.component.d.ts +1 -1
- package/dist/page-header/page-header.component.js +1 -1
- package/dist/pagination/pagination.stories.js +2 -2
- package/dist/pictograms/pictogram-registration.d.ts.map +1 -1
- package/dist/pictograms/pictogram-registration.js +2 -36
- package/dist/pictograms/pictograms.d.ts +2 -20
- package/dist/pictograms/pictograms.d.ts.map +1 -1
- package/dist/pictograms/pictograms.js +2 -139
- package/dist/public.d.ts +0 -3
- package/dist/public.d.ts.map +1 -1
- package/dist/public.js +0 -3
- package/dist/responsive-wrapper/responsive-wrapper.stories.js +1 -1
- package/dist/snackbars/snackbar.stories.js +1 -1
- package/dist/toasts/toast.stories.js +1 -1
- package/dist/workbench/splitter.component.d.ts +14 -0
- package/dist/workbench/splitter.component.d.ts.map +1 -1
- package/dist/workbench/splitter.component.js +52 -0
- package/dist/workbench/tool-window-rail.component.d.ts.map +1 -1
- package/dist/workbench/tool-window-rail.component.js +9 -1
- package/dist/workbench/tool-window-zone.component.d.ts.map +1 -1
- package/dist/workbench/tool-window-zone.component.js +9 -1
- package/dist/workbench/workbench.module.scss +64 -1
- package/dist/workbench/workbench.store.d.ts +2 -0
- package/dist/workbench/workbench.store.d.ts.map +1 -1
- package/dist/workbench/workbench.store.js +9 -0
- package/dist/workspaces/container/workspace-container.component.d.ts +8 -8
- package/dist/workspaces/container/workspace-container.component.js +9 -9
- package/dist/workspaces2/workspace2.d.ts +3 -3
- package/dist/workspaces2/workspace2.js +3 -3
- package/mock-jest.tsx +0 -41
- package/mock.tsx +0 -41
- package/package.json +26 -23
- package/src/_vars.scss +4 -4
- package/dist/entity-banner/actions-menu/entity-banner-actions-menu.component.d.ts +0 -19
- package/dist/entity-banner/actions-menu/entity-banner-actions-menu.component.d.ts.map +0 -1
- package/dist/entity-banner/actions-menu/entity-banner-actions-menu.component.js +0 -137
- package/dist/entity-banner/actions-menu/entity-banner-actions-menu.module.scss +0 -23
- package/dist/entity-banner/contact-details/entity-banner-contact-details.component.d.ts +0 -9
- package/dist/entity-banner/contact-details/entity-banner-contact-details.component.d.ts.map +0 -1
- package/dist/entity-banner/contact-details/entity-banner-contact-details.component.js +0 -207
- package/dist/entity-banner/contact-details/entity-banner-contact-details.module.scss +0 -47
- package/dist/entity-banner/contact-details/entity-banner-toggle-contact-details-button.component.d.ts +0 -12
- package/dist/entity-banner/contact-details/entity-banner-toggle-contact-details-button.component.d.ts.map +0 -1
- package/dist/entity-banner/contact-details/entity-banner-toggle-contact-details-button.component.js +0 -15
- package/dist/entity-banner/contact-details/types.d.ts +0 -48
- package/dist/entity-banner/contact-details/types.d.ts.map +0 -1
- package/dist/entity-banner/contact-details/types.js +0 -1
- package/dist/entity-banner/contact-details/useEntityAttributes.d.ts +0 -14
- package/dist/entity-banner/contact-details/useEntityAttributes.d.ts.map +0 -1
- package/dist/entity-banner/contact-details/useEntityAttributes.js +0 -12
- package/dist/entity-banner/contact-details/useEntityGroupsForEntity.d.ts +0 -11
- package/dist/entity-banner/contact-details/useEntityGroupsForEntity.d.ts.map +0 -1
- package/dist/entity-banner/contact-details/useEntityGroupsForEntity.js +0 -9
- package/dist/entity-banner/contact-details/useRelationships.d.ts +0 -35
- package/dist/entity-banner/contact-details/useRelationships.d.ts.map +0 -1
- package/dist/entity-banner/contact-details/useRelationships.js +0 -37
- package/dist/entity-banner/entity-info/entity-banner-entity-identifiers.component.d.ts +0 -9
- package/dist/entity-banner/entity-info/entity-banner-entity-identifiers.component.d.ts.map +0 -1
- package/dist/entity-banner/entity-info/entity-banner-entity-identifiers.component.js +0 -77
- package/dist/entity-banner/entity-info/entity-banner-entity-info.component.d.ts +0 -9
- package/dist/entity-banner/entity-info/entity-banner-entity-info.component.d.ts.map +0 -1
- package/dist/entity-banner/entity-info/entity-banner-entity-info.component.js +0 -72
- package/dist/entity-banner/entity-info/entity-banner-entity-info.module.scss +0 -165
- package/dist/entity-banner/index.d.ts +0 -5
- package/dist/entity-banner/index.d.ts.map +0 -1
- package/dist/entity-banner/index.js +0 -4
- package/dist/entity-photo/entity-photo.component.d.ts +0 -21
- package/dist/entity-photo/entity-photo.component.d.ts.map +0 -1
- package/dist/entity-photo/entity-photo.component.js +0 -111
- package/dist/entity-photo/entity-photo.module.scss +0 -21
- package/dist/entity-photo/index.d.ts +0 -3
- package/dist/entity-photo/index.d.ts.map +0 -1
- package/dist/entity-photo/index.js +0 -2
- package/dist/entity-photo/placeholder-icon.component.d.ts +0 -9
- package/dist/entity-photo/placeholder-icon.component.d.ts.map +0 -1
- package/dist/entity-photo/placeholder-icon.component.js +0 -26
- package/dist/entity-photo/useEntityPhoto.d.ts +0 -29
- package/dist/entity-photo/useEntityPhoto.d.ts.map +0 -1
- package/dist/entity-photo/useEntityPhoto.js +0 -37
- package/dist/icons/svgs/baby.svg +0 -1
- package/dist/icons/svgs/chemistry.svg +0 -1
- package/dist/icons/svgs/drug-order.svg +0 -1
- package/dist/icons/svgs/generic-order-type.svg +0 -1
- package/dist/icons/svgs/hospital-bed.svg +0 -1
- package/dist/icons/svgs/image-medical.svg +0 -1
- package/dist/icons/svgs/lab-order.svg +0 -1
- package/dist/icons/svgs/material-order.svg +0 -1
- package/dist/icons/svgs/medication.svg +0 -1
- package/dist/icons/svgs/microscope.svg +0 -1
- package/dist/icons/svgs/mother.svg +0 -1
- package/dist/icons/svgs/procedure-order.svg +0 -1
- package/dist/icons/svgs/referral-order.svg +0 -1
- package/dist/icons/svgs/syringe.svg +0 -1
- package/dist/logo/_logo.scss +0 -34
- package/dist/logo/egen-logo-full.svg +0 -1
- package/dist/logo/egen-logo-icon.svg +0 -1
- package/dist/logo/egen-logo-partial.svg +0 -1
- package/dist/logo/egen-logo-white.svg +0 -1
- package/dist/logo/index.d.ts +0 -8
- package/dist/logo/index.d.ts.map +0 -1
- package/dist/logo/index.js +0 -22
- package/dist/numeric-datapoint/index.d.ts +0 -4
- package/dist/numeric-datapoint/index.d.ts.map +0 -1
- package/dist/numeric-datapoint/index.js +0 -3
- package/dist/numeric-datapoint/interpretation-utils.d.ts +0 -27
- package/dist/numeric-datapoint/interpretation-utils.d.ts.map +0 -1
- package/dist/numeric-datapoint/interpretation-utils.js +0 -66
- package/dist/numeric-datapoint/numeric-datapoint.component.d.ts +0 -44
- package/dist/numeric-datapoint/numeric-datapoint.component.d.ts.map +0 -1
- package/dist/numeric-datapoint/numeric-datapoint.component.js +0 -110
- package/dist/numeric-datapoint/numeric-datapoint.module.scss +0 -141
- package/dist/numeric-datapoint/use-concept-reference-range.d.ts +0 -13
- package/dist/numeric-datapoint/use-concept-reference-range.d.ts.map +0 -1
- package/dist/numeric-datapoint/use-concept-reference-range.js +0 -31
- package/dist/pictograms/svgs/blood-bank.svg +0 -1
- package/dist/pictograms/svgs/cardiology.svg +0 -1
- package/dist/pictograms/svgs/ct-scan.svg +0 -1
- package/dist/pictograms/svgs/dentistry.svg +0 -1
- package/dist/pictograms/svgs/emergency-department.svg +0 -1
- package/dist/pictograms/svgs/geriatrics.svg +0 -1
- package/dist/pictograms/svgs/gynaecology.svg +0 -1
- package/dist/pictograms/svgs/in-patient.svg +0 -1
- package/dist/pictograms/svgs/labs-2.svg +0 -1
- package/dist/pictograms/svgs/labs.svg +0 -1
- package/dist/pictograms/svgs/obstetrics.svg +0 -1
- package/dist/pictograms/svgs/patient-search.svg +0 -1
- package/dist/pictograms/svgs/patients.svg +0 -1
- package/dist/pictograms/svgs/pharmacy-1.svg +0 -1
- package/dist/pictograms/svgs/pharmacy-2.svg +0 -1
- package/dist/pictograms/svgs/triage.svg +0 -1
- package/dist/pictograms/svgs/x-ray.svg +0 -1
|
@@ -1,207 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
/** @module @category UI */ import React, { useMemo } from "react";
|
|
3
|
-
import classNames from "classnames";
|
|
4
|
-
import { InlineLoading } from "@carbon/react";
|
|
5
|
-
import { getCoreTranslation } from "@egen-civitas/esm-translations";
|
|
6
|
-
import { ConfigurableLink, useEntity } from "@egen-civitas/esm-react-utils";
|
|
7
|
-
import { parseDate } from "@egen-civitas/esm-utils";
|
|
8
|
-
import { useEntityContactAttributes } from "./useEntityAttributes.js";
|
|
9
|
-
import { useEntityGroupsForEntity } from "./useEntityGroupsForEntity.js";
|
|
10
|
-
import { useRelationships } from "./useRelationships.js";
|
|
11
|
-
import styles from "./entity-banner-contact-details.module.scss";
|
|
12
|
-
const EntityGroups = ({ entityUuid })=>{
|
|
13
|
-
const { groups = [], isLoading } = useEntityGroupsForEntity(entityUuid);
|
|
14
|
-
return /*#__PURE__*/ _jsxs(_Fragment, {
|
|
15
|
-
children: [
|
|
16
|
-
/*#__PURE__*/ _jsxs("p", {
|
|
17
|
-
className: styles.heading,
|
|
18
|
-
children: [
|
|
19
|
-
getCoreTranslation('entityGroups', 'Entity Groups'),
|
|
20
|
-
" (",
|
|
21
|
-
groups?.length ?? 0,
|
|
22
|
-
")"
|
|
23
|
-
]
|
|
24
|
-
}),
|
|
25
|
-
isLoading ? /*#__PURE__*/ _jsx(InlineLoading, {
|
|
26
|
-
description: `${getCoreTranslation('loading', 'Loading')} ...`,
|
|
27
|
-
role: "progressbar"
|
|
28
|
-
}) : /*#__PURE__*/ _jsxs("ul", {
|
|
29
|
-
children: [
|
|
30
|
-
(()=>{
|
|
31
|
-
if (groups?.length > 0) {
|
|
32
|
-
const sortedGroups = groups.sort((a, b)=>parseDate(a?.startDate).getTime() - parseDate(b?.startDate).getTime());
|
|
33
|
-
const slicedGroups = sortedGroups.slice(0, 3);
|
|
34
|
-
return slicedGroups?.map((group)=>/*#__PURE__*/ _jsx("li", {
|
|
35
|
-
children: /*#__PURE__*/ _jsx(ConfigurableLink, {
|
|
36
|
-
to: `${window.spaBase}/home/entity-groups/${group.uuid}`,
|
|
37
|
-
children: group.name
|
|
38
|
-
}, group.uuid)
|
|
39
|
-
}, group.uuid));
|
|
40
|
-
}
|
|
41
|
-
return /*#__PURE__*/ _jsx("li", {
|
|
42
|
-
children: "--"
|
|
43
|
-
});
|
|
44
|
-
})(),
|
|
45
|
-
groups.length > 3 && /*#__PURE__*/ _jsx("li", {
|
|
46
|
-
className: styles.link,
|
|
47
|
-
children: /*#__PURE__*/ _jsx(ConfigurableLink, {
|
|
48
|
-
to: `${window.spaBase}/home/entity-groups`,
|
|
49
|
-
children: getCoreTranslation('seeMoreGroups', 'See {{count}} more groups', {
|
|
50
|
-
count: groups?.length - 3
|
|
51
|
-
})
|
|
52
|
-
})
|
|
53
|
-
})
|
|
54
|
-
]
|
|
55
|
-
})
|
|
56
|
-
]
|
|
57
|
-
});
|
|
58
|
-
};
|
|
59
|
-
const Address = ({ entityId })=>{
|
|
60
|
-
const { entity, isLoading } = useEntity(entityId);
|
|
61
|
-
const address = entity?.address?.find((a)=>a.use === 'home');
|
|
62
|
-
const getAddressKey = (url)=>url.split('#')[1];
|
|
63
|
-
if (isLoading) {
|
|
64
|
-
return /*#__PURE__*/ _jsx(InlineLoading, {
|
|
65
|
-
description: `${getCoreTranslation('loading', 'Loading')} ...`,
|
|
66
|
-
role: "progressbar"
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
return /*#__PURE__*/ _jsxs(_Fragment, {
|
|
70
|
-
children: [
|
|
71
|
-
/*#__PURE__*/ _jsx("p", {
|
|
72
|
-
className: styles.heading,
|
|
73
|
-
children: getCoreTranslation('address', 'Address')
|
|
74
|
-
}),
|
|
75
|
-
/*#__PURE__*/ _jsx("ul", {
|
|
76
|
-
children: address ? Object.entries(address).filter(([key])=>key !== 'id' && key !== 'use').map(([key, value])=>key === 'extension' ? address.extension?.[0]?.extension?.map((add, i)=>/*#__PURE__*/ _jsxs("li", {
|
|
77
|
-
children: [
|
|
78
|
-
getCoreTranslation(getAddressKey(add.url), getAddressKey(add.url)),
|
|
79
|
-
": ",
|
|
80
|
-
add.valueString
|
|
81
|
-
]
|
|
82
|
-
}, `address-${key}-${i}`)) : /*#__PURE__*/ _jsxs("li", {
|
|
83
|
-
children: [
|
|
84
|
-
getCoreTranslation(key, key),
|
|
85
|
-
": ",
|
|
86
|
-
value
|
|
87
|
-
]
|
|
88
|
-
}, `address-${key}`)) : /*#__PURE__*/ _jsx("li", {
|
|
89
|
-
children: "--"
|
|
90
|
-
})
|
|
91
|
-
})
|
|
92
|
-
]
|
|
93
|
-
});
|
|
94
|
-
};
|
|
95
|
-
const Contact = ({ entityUuid })=>{
|
|
96
|
-
const { isLoading: isLoadingAttributes, contactAttributes } = useEntityContactAttributes(entityUuid);
|
|
97
|
-
const contacts = useMemo(()=>contactAttributes ? [
|
|
98
|
-
...contactAttributes?.map((contact)=>[
|
|
99
|
-
contact.attributeType.display ? getCoreTranslation(contact.attributeType.display, contact.attributeType.display) : '',
|
|
100
|
-
contact.value
|
|
101
|
-
])
|
|
102
|
-
] : [], [
|
|
103
|
-
contactAttributes
|
|
104
|
-
]);
|
|
105
|
-
return /*#__PURE__*/ _jsxs(_Fragment, {
|
|
106
|
-
children: [
|
|
107
|
-
/*#__PURE__*/ _jsx("p", {
|
|
108
|
-
className: styles.heading,
|
|
109
|
-
children: getCoreTranslation('contactDetails', 'Contact Details')
|
|
110
|
-
}),
|
|
111
|
-
isLoadingAttributes ? /*#__PURE__*/ _jsx(InlineLoading, {
|
|
112
|
-
description: `${getCoreTranslation('loading', 'Loading')} ...`,
|
|
113
|
-
role: "progressbar"
|
|
114
|
-
}) : /*#__PURE__*/ _jsx("ul", {
|
|
115
|
-
children: contacts.length ? contacts.map(([label, value], index)=>/*#__PURE__*/ _jsxs("li", {
|
|
116
|
-
children: [
|
|
117
|
-
label,
|
|
118
|
-
": ",
|
|
119
|
-
value
|
|
120
|
-
]
|
|
121
|
-
}, `${label}-${value}-${index}`)) : /*#__PURE__*/ _jsx("li", {
|
|
122
|
-
children: "--"
|
|
123
|
-
})
|
|
124
|
-
})
|
|
125
|
-
]
|
|
126
|
-
});
|
|
127
|
-
};
|
|
128
|
-
const Relationships = ({ entityId })=>{
|
|
129
|
-
const { data: relationships, isLoading } = useRelationships(entityId);
|
|
130
|
-
return /*#__PURE__*/ _jsxs(_Fragment, {
|
|
131
|
-
children: [
|
|
132
|
-
/*#__PURE__*/ _jsx("p", {
|
|
133
|
-
className: styles.heading,
|
|
134
|
-
children: getCoreTranslation('relationships', 'Relationships')
|
|
135
|
-
}),
|
|
136
|
-
isLoading ? /*#__PURE__*/ _jsx(InlineLoading, {
|
|
137
|
-
description: `${getCoreTranslation('loading', 'Loading')} ...`,
|
|
138
|
-
role: "progressbar"
|
|
139
|
-
}) : /*#__PURE__*/ _jsx("ul", {
|
|
140
|
-
children: relationships && relationships.length > 0 ? /*#__PURE__*/ _jsx(_Fragment, {
|
|
141
|
-
children: relationships.map((r)=>/*#__PURE__*/ _jsxs("li", {
|
|
142
|
-
className: styles.relationship,
|
|
143
|
-
children: [
|
|
144
|
-
/*#__PURE__*/ _jsx("div", {
|
|
145
|
-
children: /*#__PURE__*/ _jsx(ConfigurableLink, {
|
|
146
|
-
to: `${window.spaBase}/entity/${r.relativeUuid}/detail`,
|
|
147
|
-
children: r.display
|
|
148
|
-
})
|
|
149
|
-
}),
|
|
150
|
-
/*#__PURE__*/ _jsx("div", {
|
|
151
|
-
children: r.relationshipType
|
|
152
|
-
}),
|
|
153
|
-
/*#__PURE__*/ _jsx("div", {
|
|
154
|
-
children: `${r.relativeAge ? r.relativeAge : '--'} ${r.relativeAge ? r.relativeAge === 1 ? getCoreTranslation('yearAbbreviation', 'yr') : getCoreTranslation('yearsAbbreviation', 'yrs') : ''}`
|
|
155
|
-
})
|
|
156
|
-
]
|
|
157
|
-
}, r.uuid))
|
|
158
|
-
}) : /*#__PURE__*/ _jsx("li", {
|
|
159
|
-
children: "--"
|
|
160
|
-
})
|
|
161
|
-
})
|
|
162
|
-
]
|
|
163
|
-
});
|
|
164
|
-
};
|
|
165
|
-
export function EntityBannerContactDetails({ entityId, inactive }) {
|
|
166
|
-
return /*#__PURE__*/ _jsxs("div", {
|
|
167
|
-
className: classNames(styles.contactDetails, {
|
|
168
|
-
[styles.inactive]: inactive
|
|
169
|
-
}),
|
|
170
|
-
children: [
|
|
171
|
-
/*#__PURE__*/ _jsxs("div", {
|
|
172
|
-
className: styles.row,
|
|
173
|
-
children: [
|
|
174
|
-
/*#__PURE__*/ _jsx("div", {
|
|
175
|
-
className: styles.col,
|
|
176
|
-
children: /*#__PURE__*/ _jsx(Address, {
|
|
177
|
-
entityId: entityId
|
|
178
|
-
})
|
|
179
|
-
}),
|
|
180
|
-
/*#__PURE__*/ _jsx("div", {
|
|
181
|
-
className: styles.col,
|
|
182
|
-
children: /*#__PURE__*/ _jsx(Contact, {
|
|
183
|
-
entityUuid: entityId
|
|
184
|
-
})
|
|
185
|
-
})
|
|
186
|
-
]
|
|
187
|
-
}),
|
|
188
|
-
/*#__PURE__*/ _jsxs("div", {
|
|
189
|
-
className: styles.row,
|
|
190
|
-
children: [
|
|
191
|
-
/*#__PURE__*/ _jsx("div", {
|
|
192
|
-
className: styles.col,
|
|
193
|
-
children: /*#__PURE__*/ _jsx(Relationships, {
|
|
194
|
-
entityId: entityId
|
|
195
|
-
})
|
|
196
|
-
}),
|
|
197
|
-
/*#__PURE__*/ _jsx("div", {
|
|
198
|
-
className: styles.col,
|
|
199
|
-
children: /*#__PURE__*/ _jsx(EntityGroups, {
|
|
200
|
-
entityUuid: entityId
|
|
201
|
-
})
|
|
202
|
-
})
|
|
203
|
-
]
|
|
204
|
-
})
|
|
205
|
-
]
|
|
206
|
-
});
|
|
207
|
-
}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
@use '@carbon/colors';
|
|
2
|
-
@use '@carbon/layout';
|
|
3
|
-
@use '@carbon/type';
|
|
4
|
-
@use '../../vars' as *;
|
|
5
|
-
|
|
6
|
-
.contactDetails,
|
|
7
|
-
.deceased {
|
|
8
|
-
color: $text-02;
|
|
9
|
-
width: 100%;
|
|
10
|
-
border-top: 1px solid $ui-03;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.heading {
|
|
14
|
-
@include type.type-style('heading-compact-01');
|
|
15
|
-
color: $text-02;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.row {
|
|
19
|
-
@include type.type-style('body-compact-01');
|
|
20
|
-
display: flex;
|
|
21
|
-
|
|
22
|
-
&:first-child {
|
|
23
|
-
border-bottom: 1px solid $ui-03;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.row > .col {
|
|
28
|
-
flex: 1;
|
|
29
|
-
padding: layout.$spacing-05;
|
|
30
|
-
|
|
31
|
-
&:nth-of-type(2n + 1) {
|
|
32
|
-
border-right: 1px solid $ui-03;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.row li {
|
|
37
|
-
margin: layout.$spacing-03 0;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.relationship {
|
|
41
|
-
display: flex;
|
|
42
|
-
flex-flow: row nowrap;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
.relationship div {
|
|
46
|
-
flex: 1 1;
|
|
47
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/** @module @category UI */
|
|
2
|
-
import React, { type MouseEvent } from 'react';
|
|
3
|
-
export interface EntityBannerToggleContactDetailsButtonProps {
|
|
4
|
-
/** Whether the contact details are currently being displayed */
|
|
5
|
-
showContactDetails: boolean;
|
|
6
|
-
/** Function called when this button is clicked. */
|
|
7
|
-
toggleContactDetails: (e: MouseEvent) => void;
|
|
8
|
-
/** Passed through to the Carbon Button component */
|
|
9
|
-
className?: string;
|
|
10
|
-
}
|
|
11
|
-
export declare function EntityBannerToggleContactDetailsButton({ showContactDetails, toggleContactDetails, className, }: EntityBannerToggleContactDetailsButtonProps): React.JSX.Element;
|
|
12
|
-
//# sourceMappingURL=entity-banner-toggle-contact-details-button.component.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"entity-banner-toggle-contact-details-button.component.d.ts","sourceRoot":"","sources":["../../../src/entity-banner/contact-details/entity-banner-toggle-contact-details-button.component.tsx"],"names":[],"mappings":"AAAA,2BAA2B;AAC3B,OAAO,KAAK,EAAE,EAAE,KAAK,UAAU,EAAE,MAAM,OAAO,CAAC;AAK/C,MAAM,WAAW,2CAA2C;IAC1D,gEAAgE;IAChE,kBAAkB,EAAE,OAAO,CAAC;IAC5B,mDAAmD;IACnD,oBAAoB,EAAE,CAAC,CAAC,EAAE,UAAU,KAAK,IAAI,CAAC;IAC9C,oDAAoD;IACpD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,sCAAsC,CAAC,EACrD,kBAAkB,EAClB,oBAAoB,EACpB,SAAS,GACV,EAAE,2CAA2C,qBAY7C"}
|
package/dist/entity-banner/contact-details/entity-banner-toggle-contact-details-button.component.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
/** @module @category UI */ import React from "react";
|
|
3
|
-
import { Button } from "@carbon/react";
|
|
4
|
-
import { getCoreTranslation } from "@egen-civitas/esm-translations";
|
|
5
|
-
import { ChevronDownIcon, ChevronUpIcon } from "../../public.js";
|
|
6
|
-
export function EntityBannerToggleContactDetailsButton({ showContactDetails, toggleContactDetails, className }) {
|
|
7
|
-
return /*#__PURE__*/ _jsx(Button, {
|
|
8
|
-
className: className,
|
|
9
|
-
iconDescription: "Toggle contact details",
|
|
10
|
-
kind: "ghost",
|
|
11
|
-
onClick: toggleContactDetails,
|
|
12
|
-
renderIcon: showContactDetails ? ChevronUpIcon : ChevronDownIcon,
|
|
13
|
-
children: showContactDetails ? getCoreTranslation('showLess', 'Show less') : getCoreTranslation('showMore', 'Show more')
|
|
14
|
-
});
|
|
15
|
-
}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { type EgenResource } from '@egen-civitas/esm-api';
|
|
2
|
-
export interface Location {
|
|
3
|
-
uuid: string;
|
|
4
|
-
display?: string;
|
|
5
|
-
name?: string;
|
|
6
|
-
}
|
|
7
|
-
export interface VisitType {
|
|
8
|
-
uuid: string;
|
|
9
|
-
display: string;
|
|
10
|
-
name?: string;
|
|
11
|
-
}
|
|
12
|
-
export interface Patient {
|
|
13
|
-
uuid: string;
|
|
14
|
-
display: string;
|
|
15
|
-
identifiers: Array<any>;
|
|
16
|
-
person: Person;
|
|
17
|
-
}
|
|
18
|
-
export interface Person {
|
|
19
|
-
age: number;
|
|
20
|
-
attributes: Array<Attribute>;
|
|
21
|
-
birthDate: string;
|
|
22
|
-
gender: string;
|
|
23
|
-
display: string;
|
|
24
|
-
preferredAddress: EgenResource;
|
|
25
|
-
uuid: string;
|
|
26
|
-
}
|
|
27
|
-
export interface Attribute {
|
|
28
|
-
attributeType: EgenResource;
|
|
29
|
-
display: string;
|
|
30
|
-
uuid: string;
|
|
31
|
-
value: string | number;
|
|
32
|
-
}
|
|
33
|
-
export interface CohortMemberResponse {
|
|
34
|
-
results: Array<CohortMember>;
|
|
35
|
-
}
|
|
36
|
-
interface CohortMember {
|
|
37
|
-
uuid: string;
|
|
38
|
-
patient: EgenResource;
|
|
39
|
-
cohort: Cohort;
|
|
40
|
-
}
|
|
41
|
-
interface Cohort {
|
|
42
|
-
uuid: string;
|
|
43
|
-
name: string;
|
|
44
|
-
startDate: string;
|
|
45
|
-
endDate: string | null;
|
|
46
|
-
}
|
|
47
|
-
export {};
|
|
48
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/entity-banner/contact-details/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAE1D,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,MAAM;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,gBAAgB,EAAE,YAAY,CAAC;IAC/B,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,SAAS;IACxB,aAAa,EAAE,YAAY,CAAC;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC;CAC9B;AAED,UAAU,YAAY;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,YAAY,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,UAAU,MAAM;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { };
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
interface AttributeType {
|
|
2
|
-
display: string;
|
|
3
|
-
uuid: string;
|
|
4
|
-
}
|
|
5
|
-
interface Attribute {
|
|
6
|
-
attributeType: AttributeType;
|
|
7
|
-
value: string;
|
|
8
|
-
}
|
|
9
|
-
export declare function useEntityContactAttributes(entityUuid: string): {
|
|
10
|
-
contactAttributes: Attribute[] | undefined;
|
|
11
|
-
isLoading: boolean;
|
|
12
|
-
};
|
|
13
|
-
export {};
|
|
14
|
-
//# sourceMappingURL=useEntityAttributes.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useEntityAttributes.d.ts","sourceRoot":"","sources":["../../../src/entity-banner/contact-details/useEntityAttributes.ts"],"names":[],"mappings":"AAKA,UAAU,aAAa;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,UAAU,SAAS;IACjB,aAAa,EAAE,aAAa,CAAC;IAC7B,KAAK,EAAE,MAAM,CAAC;CACf;AAMD,wBAAgB,0BAA0B,CAAC,UAAU,EAAE,MAAM;;;EAe5D"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { restBaseUrl } from "@egen-civitas/esm-api";
|
|
2
|
-
import { useConfig } from "@egen-civitas/esm-react-utils";
|
|
3
|
-
import useSWRImmutable from "swr/immutable";
|
|
4
|
-
export function useEntityContactAttributes(entityUuid) {
|
|
5
|
-
const { contactAttributeTypes } = useConfig();
|
|
6
|
-
const { data, isLoading } = useSWRImmutable(entityUuid ? `${restBaseUrl}/entity/${entityUuid}?v=custom:(attributes:(attributeType:(display,uuid),value))` : null, (url)=>fetch(url).then((res)=>res.json()));
|
|
7
|
-
const contactAttributes = data?.data?.attributes?.filter((attr)=>contactAttributeTypes?.uuids?.includes(attr.attributeType.uuid));
|
|
8
|
-
return {
|
|
9
|
-
contactAttributes,
|
|
10
|
-
isLoading
|
|
11
|
-
};
|
|
12
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
interface EntityGroup {
|
|
2
|
-
uuid: string;
|
|
3
|
-
name: string;
|
|
4
|
-
startDate: string;
|
|
5
|
-
}
|
|
6
|
-
export declare function useEntityGroupsForEntity(entityUuid: string): {
|
|
7
|
-
groups: EntityGroup[];
|
|
8
|
-
isLoading: boolean;
|
|
9
|
-
};
|
|
10
|
-
export {};
|
|
11
|
-
//# sourceMappingURL=useEntityGroupsForEntity.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useEntityGroupsForEntity.d.ts","sourceRoot":"","sources":["../../../src/entity-banner/contact-details/useEntityGroupsForEntity.ts"],"names":[],"mappings":"AAGA,UAAU,WAAW;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,wBAAwB,CAAC,UAAU,EAAE,MAAM;;;EAO1D"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { restBaseUrl } from "@egen-civitas/esm-api";
|
|
2
|
-
import useSWRImmutable from "swr/immutable";
|
|
3
|
-
export function useEntityGroupsForEntity(entityUuid) {
|
|
4
|
-
const { data, isLoading } = useSWRImmutable(entityUuid ? `${restBaseUrl}/cohort?v=custom:(uuid,name,startDate)&member=${entityUuid}` : null, (url)=>fetch(url).then((res)=>res.json()));
|
|
5
|
-
return {
|
|
6
|
-
groups: data?.data?.results ?? [],
|
|
7
|
-
isLoading
|
|
8
|
-
};
|
|
9
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
export declare function useRelationships(entityUuid: string): {
|
|
2
|
-
data: ExtractedRelationship[] | null;
|
|
3
|
-
error: Error | undefined;
|
|
4
|
-
isLoading: boolean;
|
|
5
|
-
isValidating: boolean;
|
|
6
|
-
};
|
|
7
|
-
interface ExtractedRelationship {
|
|
8
|
-
uuid: string;
|
|
9
|
-
display: string;
|
|
10
|
-
relativeAge: number;
|
|
11
|
-
relativeUuid: string;
|
|
12
|
-
relationshipType: string;
|
|
13
|
-
}
|
|
14
|
-
export interface Relationship {
|
|
15
|
-
display: string;
|
|
16
|
-
uuid: number;
|
|
17
|
-
personA: {
|
|
18
|
-
uuid: string;
|
|
19
|
-
age: number;
|
|
20
|
-
display: string;
|
|
21
|
-
};
|
|
22
|
-
personB: {
|
|
23
|
-
uuid: string;
|
|
24
|
-
age: number;
|
|
25
|
-
display: string;
|
|
26
|
-
};
|
|
27
|
-
relationshipType: {
|
|
28
|
-
uuid: string;
|
|
29
|
-
display: string;
|
|
30
|
-
aIsToB: string;
|
|
31
|
-
bIsToA: string;
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
export {};
|
|
35
|
-
//# sourceMappingURL=useRelationships.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useRelationships.d.ts","sourceRoot":"","sources":["../../../src/entity-banner/contact-details/useRelationships.ts"],"names":[],"mappings":"AAMA,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,MAAM;;;;;EAkBlD;AAiCD,UAAU,qBAAqB;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE;QACP,IAAI,EAAE,MAAM,CAAC;QACb,GAAG,EAAE,MAAM,CAAC;QACZ,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,OAAO,EAAE;QACP,IAAI,EAAE,MAAM,CAAC;QACb,GAAG,EAAE,MAAM,CAAC;QACZ,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,gBAAgB,EAAE;QAChB,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;QAChB,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;CACH"}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { egenFetch, restBaseUrl } from "@egen-civitas/esm-api";
|
|
2
|
-
import useSWR from "swr";
|
|
3
|
-
const customRepresentation = 'custom:(display,uuid,personA:(age,display,birthdate,uuid),personB:(age,display,birthdate,uuid),relationshipType:(uuid,display,description,aIsToB,bIsToA))';
|
|
4
|
-
export function useRelationships(entityUuid) {
|
|
5
|
-
const apiUrl = `${restBaseUrl}/relationship?v=${customRepresentation}&person=${entityUuid}`;
|
|
6
|
-
const { data, error, isLoading, isValidating } = useSWR(entityUuid ? apiUrl : null, egenFetch);
|
|
7
|
-
const formattedRelationships = data?.data?.results?.length ? extractRelationshipData(entityUuid, data.data.results) : null;
|
|
8
|
-
return {
|
|
9
|
-
data: data ? formattedRelationships : null,
|
|
10
|
-
error,
|
|
11
|
-
isLoading,
|
|
12
|
-
isValidating
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
function extractRelationshipData(patientIdentifier, relationships) {
|
|
16
|
-
const relationshipsData = [];
|
|
17
|
-
for (const r of relationships){
|
|
18
|
-
if (patientIdentifier === r.personA.uuid) {
|
|
19
|
-
relationshipsData.push({
|
|
20
|
-
uuid: `${r.uuid}`,
|
|
21
|
-
display: r.personB.display,
|
|
22
|
-
relativeAge: r.personB.age,
|
|
23
|
-
relativeUuid: r.personB.uuid,
|
|
24
|
-
relationshipType: r.relationshipType.bIsToA
|
|
25
|
-
});
|
|
26
|
-
} else {
|
|
27
|
-
relationshipsData.push({
|
|
28
|
-
uuid: `${r.uuid}`,
|
|
29
|
-
display: r.personA.display,
|
|
30
|
-
relativeAge: r.personA.age,
|
|
31
|
-
relativeUuid: r.personA.uuid,
|
|
32
|
-
relationshipType: r.relationshipType.aIsToB
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
return relationshipsData;
|
|
37
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/** @module @category UI */
|
|
2
|
-
import React from 'react';
|
|
3
|
-
interface EntityBannerEntityIdentifiersProps {
|
|
4
|
-
identifiers: fhir.Identifier[] | undefined;
|
|
5
|
-
showIdentifierLabel: boolean;
|
|
6
|
-
}
|
|
7
|
-
export declare function EntityBannerEntityIdentifiers({ identifiers, showIdentifierLabel, }: EntityBannerEntityIdentifiersProps): React.JSX.Element;
|
|
8
|
-
export default EntityBannerEntityIdentifiers;
|
|
9
|
-
//# sourceMappingURL=entity-banner-entity-identifiers.component.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"entity-banner-entity-identifiers.component.d.ts","sourceRoot":"","sources":["../../../src/entity-banner/entity-info/entity-banner-entity-identifiers.component.tsx"],"names":[],"mappings":"AAAA,2BAA2B;AAC3B,OAAO,KAAK,MAAM,OAAO,CAAC;AAY1B,UAAU,kCAAkC;IAC1C,WAAW,EAAE,IAAI,CAAC,UAAU,EAAE,GAAG,SAAS,CAAC;IAC3C,mBAAmB,EAAE,OAAO,CAAC;CAC9B;AAsBD,wBAAgB,6BAA6B,CAAC,EAC5C,WAAW,EACX,mBAAmB,GACpB,EAAE,kCAAkC,qBA4BpC;AAED,eAAe,6BAA6B,CAAC"}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
/** @module @category UI */ import React from "react";
|
|
3
|
-
import { FormLabel, Tag } from "@carbon/react";
|
|
4
|
-
import { useConfig, usePrimaryIdentifierCode } from "@egen-civitas/esm-react-utils";
|
|
5
|
-
import styles from "./entity-banner-entity-info.module.scss";
|
|
6
|
-
function PrimaryIdentifier({ showIdentifierLabel, type, value }) {
|
|
7
|
-
return /*#__PURE__*/ _jsx("span", {
|
|
8
|
-
className: styles.primaryIdentifier,
|
|
9
|
-
children: /*#__PURE__*/ _jsxs(Tag, {
|
|
10
|
-
className: styles.tag,
|
|
11
|
-
type: "gray",
|
|
12
|
-
children: [
|
|
13
|
-
showIdentifierLabel && type?.text && /*#__PURE__*/ _jsxs("span", {
|
|
14
|
-
className: styles.label,
|
|
15
|
-
children: [
|
|
16
|
-
type.text,
|
|
17
|
-
": "
|
|
18
|
-
]
|
|
19
|
-
}),
|
|
20
|
-
/*#__PURE__*/ _jsx("span", {
|
|
21
|
-
className: styles.value,
|
|
22
|
-
children: value
|
|
23
|
-
})
|
|
24
|
-
]
|
|
25
|
-
})
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
function SecondaryIdentifier({ showIdentifierLabel, type, value }) {
|
|
29
|
-
return /*#__PURE__*/ _jsxs(FormLabel, {
|
|
30
|
-
className: styles.secondaryIdentifier,
|
|
31
|
-
id: `entity-banner-identifier-${value}`,
|
|
32
|
-
children: [
|
|
33
|
-
showIdentifierLabel && /*#__PURE__*/ _jsxs("span", {
|
|
34
|
-
className: styles.label,
|
|
35
|
-
children: [
|
|
36
|
-
type?.text,
|
|
37
|
-
": "
|
|
38
|
-
]
|
|
39
|
-
}),
|
|
40
|
-
/*#__PURE__*/ _jsx("span", {
|
|
41
|
-
className: styles.value,
|
|
42
|
-
children: value
|
|
43
|
-
})
|
|
44
|
-
]
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
export function EntityBannerEntityIdentifiers({ identifiers, showIdentifierLabel }) {
|
|
48
|
-
const { excludeEntityIdentifierCodeTypes } = useConfig();
|
|
49
|
-
const { primaryIdentifierCode } = usePrimaryIdentifierCode();
|
|
50
|
-
const filteredIdentifiers = identifiers?.filter((identifier)=>{
|
|
51
|
-
const code = identifier.type?.coding?.[0]?.code;
|
|
52
|
-
return code && !excludeEntityIdentifierCodeTypes?.uuids.includes(code);
|
|
53
|
-
}) ?? [];
|
|
54
|
-
return /*#__PURE__*/ _jsx(_Fragment, {
|
|
55
|
-
children: filteredIdentifiers?.length ? filteredIdentifiers.map(({ value, type }, index)=>/*#__PURE__*/ _jsxs(React.Fragment, {
|
|
56
|
-
children: [
|
|
57
|
-
/*#__PURE__*/ _jsx("span", {
|
|
58
|
-
className: styles.identifier,
|
|
59
|
-
children: type?.coding?.[0]?.code === primaryIdentifierCode ? /*#__PURE__*/ _jsx(PrimaryIdentifier, {
|
|
60
|
-
showIdentifierLabel: showIdentifierLabel,
|
|
61
|
-
type: type,
|
|
62
|
-
value: value
|
|
63
|
-
}) : /*#__PURE__*/ _jsx(SecondaryIdentifier, {
|
|
64
|
-
showIdentifierLabel: showIdentifierLabel,
|
|
65
|
-
type: type,
|
|
66
|
-
value: value
|
|
67
|
-
})
|
|
68
|
-
}),
|
|
69
|
-
index < filteredIdentifiers.length - 1 && /*#__PURE__*/ _jsx("span", {
|
|
70
|
-
className: styles.separator,
|
|
71
|
-
children: "·"
|
|
72
|
-
})
|
|
73
|
-
]
|
|
74
|
-
}, value)) : ''
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
export default EntityBannerEntityIdentifiers;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/** @module @category UI */
|
|
2
|
-
import React from 'react';
|
|
3
|
-
interface EntityBannerEntityInfoProps {
|
|
4
|
-
entity: fhir.Patient;
|
|
5
|
-
renderedFrom?: string;
|
|
6
|
-
}
|
|
7
|
-
export declare function EntityBannerEntityInfo({ entity, renderedFrom }: EntityBannerEntityInfoProps): React.JSX.Element;
|
|
8
|
-
export {};
|
|
9
|
-
//# sourceMappingURL=entity-banner-entity-info.component.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"entity-banner-entity-info.component.d.ts","sourceRoot":"","sources":["../../../src/entity-banner/entity-info/entity-banner-entity-info.component.tsx"],"names":[],"mappings":"AAAA,2BAA2B;AAC3B,OAAO,KAAkB,MAAM,OAAO,CAAC;AAQvC,UAAU,2BAA2B;IACnC,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,wBAAgB,sBAAsB,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,EAAE,2BAA2B,qBA8B3F"}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
/** @module @category UI */ import React, { useMemo } from "react";
|
|
3
|
-
import classNames from "classnames";
|
|
4
|
-
import { ExtensionSlot } from "@egen-civitas/esm-react-utils";
|
|
5
|
-
import { getCoreTranslation } from "@egen-civitas/esm-translations";
|
|
6
|
-
import { formatPartialDate } from "@egen-civitas/esm-utils";
|
|
7
|
-
import EntityBannerEntityIdentifiers from "./entity-banner-entity-identifiers.component.js";
|
|
8
|
-
import styles from "./entity-banner-entity-info.module.scss";
|
|
9
|
-
export function EntityBannerEntityInfo({ entity, renderedFrom }) {
|
|
10
|
-
const name = entity?.name?.[0] ? [
|
|
11
|
-
entity.name[0].given?.join(' '),
|
|
12
|
-
entity.name[0].family
|
|
13
|
-
].filter(Boolean).join(' ') : getCoreTranslation('unknown', 'Unknown');
|
|
14
|
-
const extensionState = useMemo(()=>({
|
|
15
|
-
entityUuid: entity.id,
|
|
16
|
-
entity,
|
|
17
|
-
renderedFrom
|
|
18
|
-
}), [
|
|
19
|
-
entity.id,
|
|
20
|
-
entity,
|
|
21
|
-
renderedFrom
|
|
22
|
-
]);
|
|
23
|
-
return /*#__PURE__*/ _jsxs("div", {
|
|
24
|
-
className: styles.entityInfo,
|
|
25
|
-
children: [
|
|
26
|
-
/*#__PURE__*/ _jsx("div", {
|
|
27
|
-
className: classNames(styles.row, styles.entityNameRow),
|
|
28
|
-
children: /*#__PURE__*/ _jsxs("div", {
|
|
29
|
-
className: styles.flexRow,
|
|
30
|
-
children: [
|
|
31
|
-
/*#__PURE__*/ _jsx("span", {
|
|
32
|
-
className: styles.entityName,
|
|
33
|
-
children: name
|
|
34
|
-
}),
|
|
35
|
-
/*#__PURE__*/ _jsx(ExtensionSlot, {
|
|
36
|
-
className: styles.tagsSlot,
|
|
37
|
-
name: "entity-banner-tags-slot",
|
|
38
|
-
state: extensionState
|
|
39
|
-
})
|
|
40
|
-
]
|
|
41
|
-
})
|
|
42
|
-
}),
|
|
43
|
-
/*#__PURE__*/ _jsxs("div", {
|
|
44
|
-
className: styles.demographics,
|
|
45
|
-
children: [
|
|
46
|
-
entity.birthDate && /*#__PURE__*/ _jsxs(_Fragment, {
|
|
47
|
-
children: [
|
|
48
|
-
/*#__PURE__*/ _jsx("span", {
|
|
49
|
-
children: formatPartialDate(entity.birthDate, {
|
|
50
|
-
time: false
|
|
51
|
-
})
|
|
52
|
-
}),
|
|
53
|
-
/*#__PURE__*/ _jsx("span", {
|
|
54
|
-
className: styles.separator,
|
|
55
|
-
children: "·"
|
|
56
|
-
})
|
|
57
|
-
]
|
|
58
|
-
}),
|
|
59
|
-
/*#__PURE__*/ _jsx(EntityBannerEntityIdentifiers, {
|
|
60
|
-
identifiers: entity.identifier,
|
|
61
|
-
showIdentifierLabel: true
|
|
62
|
-
}),
|
|
63
|
-
/*#__PURE__*/ _jsx(ExtensionSlot, {
|
|
64
|
-
className: styles.extensionSlot,
|
|
65
|
-
name: "entity-banner-bottom-slot",
|
|
66
|
-
state: extensionState
|
|
67
|
-
})
|
|
68
|
-
]
|
|
69
|
-
})
|
|
70
|
-
]
|
|
71
|
-
});
|
|
72
|
-
}
|