@ltht-react/diagnosis-summary 2.0.186 → 2.0.188
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/README.md +22 -22
- package/package.json +10 -10
- package/src/atoms/diagnosis-category.tsx +31 -31
- package/src/atoms/diagnosis-data-source.tsx +45 -45
- package/src/atoms/diagnosis-onset-estimated.tsx +40 -40
- package/src/atoms/diagnosis-title.tsx +72 -72
- package/src/constants.ts +5 -5
- package/src/index.tsx +3 -3
- package/src/molecules/diagnosis-redacted.tsx +31 -31
- package/src/organisms/diagnosis-summary.tsx +252 -252
- package/lib/atoms/diagnosis-category.d.ts +0 -8
- package/lib/atoms/diagnosis-category.js +0 -46
- package/lib/atoms/diagnosis-category.js.map +0 -1
- package/lib/atoms/diagnosis-data-source.d.ts +0 -8
- package/lib/atoms/diagnosis-data-source.js +0 -56
- package/lib/atoms/diagnosis-data-source.js.map +0 -1
- package/lib/atoms/diagnosis-onset-estimated.d.ts +0 -8
- package/lib/atoms/diagnosis-onset-estimated.js +0 -47
- package/lib/atoms/diagnosis-onset-estimated.js.map +0 -1
- package/lib/atoms/diagnosis-title.d.ts +0 -10
- package/lib/atoms/diagnosis-title.js +0 -52
- package/lib/atoms/diagnosis-title.js.map +0 -1
- package/lib/constants.d.ts +0 -4
- package/lib/constants.js +0 -10
- package/lib/constants.js.map +0 -1
- package/lib/index.d.ts +0 -2
- package/lib/index.js +0 -8
- package/lib/index.js.map +0 -1
- package/lib/molecules/diagnosis-redacted.d.ts +0 -7
- package/lib/molecules/diagnosis-redacted.js +0 -22
- package/lib/molecules/diagnosis-redacted.js.map +0 -1
- package/lib/organisms/diagnosis-summary.d.ts +0 -19
- package/lib/organisms/diagnosis-summary.js +0 -65
- package/lib/organisms/diagnosis-summary.js.map +0 -1
|
@@ -1,252 +1,252 @@
|
|
|
1
|
-
import { cloneElement, FC, HTMLAttributes, ReactElement } from 'react'
|
|
2
|
-
import styled from '@emotion/styled'
|
|
3
|
-
|
|
4
|
-
import { Condition, ConditionVerificationStatus } from '@ltht-react/types'
|
|
5
|
-
import { DateSummary } from '@ltht-react/type-summary'
|
|
6
|
-
import Icon from '@ltht-react/icon'
|
|
7
|
-
import { Button, ButtonProps } from '@ltht-react/button'
|
|
8
|
-
|
|
9
|
-
import { BTN_COLOURS, SMALL_SCREEN_MAXIMUM_MEDIA_QUERY, TABLET_MINIMUM_MEDIA_QUERY } from '@ltht-react/styles'
|
|
10
|
-
import Title from '../atoms/diagnosis-title'
|
|
11
|
-
import OnsetDateEstimated from '../atoms/diagnosis-onset-estimated'
|
|
12
|
-
import Redacted from '../molecules/diagnosis-redacted'
|
|
13
|
-
import DiagnosisDataSource from '../atoms/diagnosis-data-source'
|
|
14
|
-
|
|
15
|
-
const StyledTitle = styled.div`
|
|
16
|
-
display: flex;
|
|
17
|
-
`
|
|
18
|
-
|
|
19
|
-
const StyledSummary = styled.div`
|
|
20
|
-
display: flex;
|
|
21
|
-
justify-content: center;
|
|
22
|
-
flex-direction: column;
|
|
23
|
-
`
|
|
24
|
-
|
|
25
|
-
const StyledDescription = styled.div`
|
|
26
|
-
flex-grow: 1;
|
|
27
|
-
`
|
|
28
|
-
|
|
29
|
-
const StyledTitleAndDateContainer = styled.div`
|
|
30
|
-
display: flex;
|
|
31
|
-
flex-grow: 1;
|
|
32
|
-
flex-direction: row;
|
|
33
|
-
gap: 5px;
|
|
34
|
-
|
|
35
|
-
${SMALL_SCREEN_MAXIMUM_MEDIA_QUERY} {
|
|
36
|
-
flex-flow: column nowrap;
|
|
37
|
-
align-items: flex-start;
|
|
38
|
-
div {
|
|
39
|
-
text-align: left;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
`
|
|
43
|
-
|
|
44
|
-
const StyledButtonAndTagContainer = styled.div`
|
|
45
|
-
display: flex;
|
|
46
|
-
flex-grow: 1;
|
|
47
|
-
flex-direction: row;
|
|
48
|
-
gap: 5px;
|
|
49
|
-
margin-top: 5px;
|
|
50
|
-
|
|
51
|
-
${SMALL_SCREEN_MAXIMUM_MEDIA_QUERY} {
|
|
52
|
-
flex-direction: row;
|
|
53
|
-
justify-content: space-between;
|
|
54
|
-
}
|
|
55
|
-
`
|
|
56
|
-
|
|
57
|
-
const StyledResponsiveButtonContainer = styled.div`
|
|
58
|
-
display: flex;
|
|
59
|
-
margin-right: auto;
|
|
60
|
-
flex-flow: row wrap;
|
|
61
|
-
gap: 5px;
|
|
62
|
-
height: fit-content;
|
|
63
|
-
flex-grow: 1;
|
|
64
|
-
|
|
65
|
-
& > * {
|
|
66
|
-
height: 1.2rem;
|
|
67
|
-
padding: 0 5px;
|
|
68
|
-
|
|
69
|
-
${TABLET_MINIMUM_MEDIA_QUERY} {
|
|
70
|
-
font-size: 0.8rem !important;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
${SMALL_SCREEN_MAXIMUM_MEDIA_QUERY} {
|
|
75
|
-
margin: 0;
|
|
76
|
-
flex-direction: column;
|
|
77
|
-
|
|
78
|
-
span {
|
|
79
|
-
width: 100%;
|
|
80
|
-
max-width: 10rem;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
`
|
|
84
|
-
|
|
85
|
-
const StyledResponsiveTagContainer = styled.div`
|
|
86
|
-
display: flex;
|
|
87
|
-
margin-left: auto;
|
|
88
|
-
flex-flow: row wrap;
|
|
89
|
-
gap: 5px;
|
|
90
|
-
height: fit-content;
|
|
91
|
-
justify-content: flex-end;
|
|
92
|
-
flex-grow: 1;
|
|
93
|
-
|
|
94
|
-
& > * {
|
|
95
|
-
display: flex;
|
|
96
|
-
align-items: center;
|
|
97
|
-
height: 1.2rem;
|
|
98
|
-
margin: 0 !important;
|
|
99
|
-
font-size: 0.8rem !important;
|
|
100
|
-
padding: 0 10px;
|
|
101
|
-
justify-content: center;
|
|
102
|
-
|
|
103
|
-
${TABLET_MINIMUM_MEDIA_QUERY} {
|
|
104
|
-
font-size: 0.8rem !important;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
${SMALL_SCREEN_MAXIMUM_MEDIA_QUERY} {
|
|
109
|
-
flex-direction: column;
|
|
110
|
-
margin: 0;
|
|
111
|
-
|
|
112
|
-
& > * {
|
|
113
|
-
margin: 0;
|
|
114
|
-
width: 100%;
|
|
115
|
-
max-width: 10rem;
|
|
116
|
-
padding: 0 10px;
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
`
|
|
120
|
-
|
|
121
|
-
const StyledButton = styled(Button)`
|
|
122
|
-
padding: 0 5px;
|
|
123
|
-
width: fit-content;
|
|
124
|
-
|
|
125
|
-
${SMALL_SCREEN_MAXIMUM_MEDIA_QUERY} {
|
|
126
|
-
width: 100%;
|
|
127
|
-
max-width: 10rem;
|
|
128
|
-
}
|
|
129
|
-
`
|
|
130
|
-
const StyledDate = styled.div`
|
|
131
|
-
display: flex;
|
|
132
|
-
flex-flow: column nowrap;
|
|
133
|
-
text-align: right;
|
|
134
|
-
min-width: 6rem;
|
|
135
|
-
justify-content: start;
|
|
136
|
-
`
|
|
137
|
-
const IconButtonWrapper = styled(Button)`
|
|
138
|
-
-webkit-box-align: center;
|
|
139
|
-
align-items: center;
|
|
140
|
-
-webkit-box-pack: center;
|
|
141
|
-
justify-content: center;
|
|
142
|
-
margin-right: 0.5rem;
|
|
143
|
-
display: inline-block !important;
|
|
144
|
-
margin-left: 0.5rem;
|
|
145
|
-
width: auto;
|
|
146
|
-
padding: 0 5px;
|
|
147
|
-
`
|
|
148
|
-
const IconWrapper = styled.div`
|
|
149
|
-
margin-left: 0.5rem;
|
|
150
|
-
display: inline-block;
|
|
151
|
-
`
|
|
152
|
-
|
|
153
|
-
const DiagnosisSummary: FC<Props> = ({
|
|
154
|
-
condition,
|
|
155
|
-
extendedTemplateDisplayName,
|
|
156
|
-
extensionTemplateDisplayName,
|
|
157
|
-
extensionClickHandler,
|
|
158
|
-
isReadOnly = false,
|
|
159
|
-
dateOnlyView = false,
|
|
160
|
-
canExtendDiagnosis = false,
|
|
161
|
-
displaySource = false,
|
|
162
|
-
controls = [],
|
|
163
|
-
tags = [],
|
|
164
|
-
systemExclusionsFilter = [],
|
|
165
|
-
isRichText = false,
|
|
166
|
-
...rest
|
|
167
|
-
}) => {
|
|
168
|
-
if (condition.metadata.isRedacted) {
|
|
169
|
-
return (
|
|
170
|
-
<StyledSummary {...rest}>
|
|
171
|
-
<Redacted condition={condition} />
|
|
172
|
-
</StyledSummary>
|
|
173
|
-
)
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
const enteredInError = condition.verificationStatus === ConditionVerificationStatus.EnteredInError
|
|
177
|
-
|
|
178
|
-
return (
|
|
179
|
-
<StyledSummary {...rest}>
|
|
180
|
-
<StyledTitleAndDateContainer>
|
|
181
|
-
<StyledDescription>
|
|
182
|
-
<StyledTitle>
|
|
183
|
-
<Title
|
|
184
|
-
enteredInError={enteredInError}
|
|
185
|
-
condition={condition}
|
|
186
|
-
systemExclusionsFilter={systemExclusionsFilter}
|
|
187
|
-
isRichText={isRichText}
|
|
188
|
-
/>
|
|
189
|
-
{extensionTemplateDisplayName && !isReadOnly && canExtendDiagnosis && !enteredInError && (
|
|
190
|
-
<IconButtonWrapper
|
|
191
|
-
onClick={extensionClickHandler}
|
|
192
|
-
type="button"
|
|
193
|
-
styling={{ buttonStyle: 'clear' }}
|
|
194
|
-
value=""
|
|
195
|
-
icon={<Icon type="folder-plus" size="medium" />}
|
|
196
|
-
iconPlacement="center"
|
|
197
|
-
iconColour={BTN_COLOURS.PRIMARY.VALUE}
|
|
198
|
-
title={`This diagnosis can be extended further using form '${extensionTemplateDisplayName}' by clicking here`}
|
|
199
|
-
/>
|
|
200
|
-
)}
|
|
201
|
-
{extendedTemplateDisplayName && (
|
|
202
|
-
<IconWrapper>
|
|
203
|
-
<Icon
|
|
204
|
-
type="comment"
|
|
205
|
-
size="medium"
|
|
206
|
-
title={`This diagnosis has been extended beyond standard diagnosis with form '${extendedTemplateDisplayName}'.
|
|
207
|
-
To view these extra details, click into the full diagnosis detail or edit the existing form.`}
|
|
208
|
-
/>
|
|
209
|
-
</IconWrapper>
|
|
210
|
-
)}
|
|
211
|
-
</StyledTitle>
|
|
212
|
-
{displaySource && <DiagnosisDataSource condition={condition} enteredInError={enteredInError} />}
|
|
213
|
-
</StyledDescription>
|
|
214
|
-
<StyledDate>
|
|
215
|
-
<DateSummary enteredInError={enteredInError} datetime={condition?.assertedDate} dateOnlyView={dateOnlyView} />
|
|
216
|
-
<OnsetDateEstimated enteredInError={enteredInError} condition={condition} />
|
|
217
|
-
</StyledDate>
|
|
218
|
-
</StyledTitleAndDateContainer>
|
|
219
|
-
|
|
220
|
-
{!isReadOnly && (controls.length > 0 || tags.length > 0) && (
|
|
221
|
-
<StyledButtonAndTagContainer>
|
|
222
|
-
<StyledResponsiveButtonContainer>
|
|
223
|
-
{controls.map((props, index) => (
|
|
224
|
-
<StyledButton key={index} {...props} />
|
|
225
|
-
))}
|
|
226
|
-
</StyledResponsiveButtonContainer>
|
|
227
|
-
|
|
228
|
-
<StyledResponsiveTagContainer>
|
|
229
|
-
{tags?.map((tag, index) => (tag.key ? tag : cloneElement(tag, { key: index })))}
|
|
230
|
-
</StyledResponsiveTagContainer>
|
|
231
|
-
</StyledButtonAndTagContainer>
|
|
232
|
-
)}
|
|
233
|
-
</StyledSummary>
|
|
234
|
-
)
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
interface Props extends HTMLAttributes<HTMLDivElement> {
|
|
238
|
-
condition: Condition
|
|
239
|
-
extendedTemplateDisplayName?: string
|
|
240
|
-
extensionTemplateDisplayName?: string
|
|
241
|
-
isReadOnly?: boolean
|
|
242
|
-
dateOnlyView?: boolean
|
|
243
|
-
displaySource?: boolean
|
|
244
|
-
controls?: ButtonProps[]
|
|
245
|
-
tags?: ReactElement[]
|
|
246
|
-
canExtendDiagnosis?: boolean
|
|
247
|
-
extensionClickHandler?(): void
|
|
248
|
-
systemExclusionsFilter?: string[]
|
|
249
|
-
isRichText?: boolean
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
export default DiagnosisSummary
|
|
1
|
+
import { cloneElement, FC, HTMLAttributes, ReactElement } from 'react'
|
|
2
|
+
import styled from '@emotion/styled'
|
|
3
|
+
|
|
4
|
+
import { Condition, ConditionVerificationStatus } from '@ltht-react/types'
|
|
5
|
+
import { DateSummary } from '@ltht-react/type-summary'
|
|
6
|
+
import Icon from '@ltht-react/icon'
|
|
7
|
+
import { Button, ButtonProps } from '@ltht-react/button'
|
|
8
|
+
|
|
9
|
+
import { BTN_COLOURS, SMALL_SCREEN_MAXIMUM_MEDIA_QUERY, TABLET_MINIMUM_MEDIA_QUERY } from '@ltht-react/styles'
|
|
10
|
+
import Title from '../atoms/diagnosis-title'
|
|
11
|
+
import OnsetDateEstimated from '../atoms/diagnosis-onset-estimated'
|
|
12
|
+
import Redacted from '../molecules/diagnosis-redacted'
|
|
13
|
+
import DiagnosisDataSource from '../atoms/diagnosis-data-source'
|
|
14
|
+
|
|
15
|
+
const StyledTitle = styled.div`
|
|
16
|
+
display: flex;
|
|
17
|
+
`
|
|
18
|
+
|
|
19
|
+
const StyledSummary = styled.div`
|
|
20
|
+
display: flex;
|
|
21
|
+
justify-content: center;
|
|
22
|
+
flex-direction: column;
|
|
23
|
+
`
|
|
24
|
+
|
|
25
|
+
const StyledDescription = styled.div`
|
|
26
|
+
flex-grow: 1;
|
|
27
|
+
`
|
|
28
|
+
|
|
29
|
+
const StyledTitleAndDateContainer = styled.div`
|
|
30
|
+
display: flex;
|
|
31
|
+
flex-grow: 1;
|
|
32
|
+
flex-direction: row;
|
|
33
|
+
gap: 5px;
|
|
34
|
+
|
|
35
|
+
${SMALL_SCREEN_MAXIMUM_MEDIA_QUERY} {
|
|
36
|
+
flex-flow: column nowrap;
|
|
37
|
+
align-items: flex-start;
|
|
38
|
+
div {
|
|
39
|
+
text-align: left;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
`
|
|
43
|
+
|
|
44
|
+
const StyledButtonAndTagContainer = styled.div`
|
|
45
|
+
display: flex;
|
|
46
|
+
flex-grow: 1;
|
|
47
|
+
flex-direction: row;
|
|
48
|
+
gap: 5px;
|
|
49
|
+
margin-top: 5px;
|
|
50
|
+
|
|
51
|
+
${SMALL_SCREEN_MAXIMUM_MEDIA_QUERY} {
|
|
52
|
+
flex-direction: row;
|
|
53
|
+
justify-content: space-between;
|
|
54
|
+
}
|
|
55
|
+
`
|
|
56
|
+
|
|
57
|
+
const StyledResponsiveButtonContainer = styled.div`
|
|
58
|
+
display: flex;
|
|
59
|
+
margin-right: auto;
|
|
60
|
+
flex-flow: row wrap;
|
|
61
|
+
gap: 5px;
|
|
62
|
+
height: fit-content;
|
|
63
|
+
flex-grow: 1;
|
|
64
|
+
|
|
65
|
+
& > * {
|
|
66
|
+
height: 1.2rem;
|
|
67
|
+
padding: 0 5px;
|
|
68
|
+
|
|
69
|
+
${TABLET_MINIMUM_MEDIA_QUERY} {
|
|
70
|
+
font-size: 0.8rem !important;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
${SMALL_SCREEN_MAXIMUM_MEDIA_QUERY} {
|
|
75
|
+
margin: 0;
|
|
76
|
+
flex-direction: column;
|
|
77
|
+
|
|
78
|
+
span {
|
|
79
|
+
width: 100%;
|
|
80
|
+
max-width: 10rem;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
`
|
|
84
|
+
|
|
85
|
+
const StyledResponsiveTagContainer = styled.div`
|
|
86
|
+
display: flex;
|
|
87
|
+
margin-left: auto;
|
|
88
|
+
flex-flow: row wrap;
|
|
89
|
+
gap: 5px;
|
|
90
|
+
height: fit-content;
|
|
91
|
+
justify-content: flex-end;
|
|
92
|
+
flex-grow: 1;
|
|
93
|
+
|
|
94
|
+
& > * {
|
|
95
|
+
display: flex;
|
|
96
|
+
align-items: center;
|
|
97
|
+
height: 1.2rem;
|
|
98
|
+
margin: 0 !important;
|
|
99
|
+
font-size: 0.8rem !important;
|
|
100
|
+
padding: 0 10px;
|
|
101
|
+
justify-content: center;
|
|
102
|
+
|
|
103
|
+
${TABLET_MINIMUM_MEDIA_QUERY} {
|
|
104
|
+
font-size: 0.8rem !important;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
${SMALL_SCREEN_MAXIMUM_MEDIA_QUERY} {
|
|
109
|
+
flex-direction: column;
|
|
110
|
+
margin: 0;
|
|
111
|
+
|
|
112
|
+
& > * {
|
|
113
|
+
margin: 0;
|
|
114
|
+
width: 100%;
|
|
115
|
+
max-width: 10rem;
|
|
116
|
+
padding: 0 10px;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
`
|
|
120
|
+
|
|
121
|
+
const StyledButton = styled(Button)`
|
|
122
|
+
padding: 0 5px;
|
|
123
|
+
width: fit-content;
|
|
124
|
+
|
|
125
|
+
${SMALL_SCREEN_MAXIMUM_MEDIA_QUERY} {
|
|
126
|
+
width: 100%;
|
|
127
|
+
max-width: 10rem;
|
|
128
|
+
}
|
|
129
|
+
`
|
|
130
|
+
const StyledDate = styled.div`
|
|
131
|
+
display: flex;
|
|
132
|
+
flex-flow: column nowrap;
|
|
133
|
+
text-align: right;
|
|
134
|
+
min-width: 6rem;
|
|
135
|
+
justify-content: start;
|
|
136
|
+
`
|
|
137
|
+
const IconButtonWrapper = styled(Button)`
|
|
138
|
+
-webkit-box-align: center;
|
|
139
|
+
align-items: center;
|
|
140
|
+
-webkit-box-pack: center;
|
|
141
|
+
justify-content: center;
|
|
142
|
+
margin-right: 0.5rem;
|
|
143
|
+
display: inline-block !important;
|
|
144
|
+
margin-left: 0.5rem;
|
|
145
|
+
width: auto;
|
|
146
|
+
padding: 0 5px;
|
|
147
|
+
`
|
|
148
|
+
const IconWrapper = styled.div`
|
|
149
|
+
margin-left: 0.5rem;
|
|
150
|
+
display: inline-block;
|
|
151
|
+
`
|
|
152
|
+
|
|
153
|
+
const DiagnosisSummary: FC<Props> = ({
|
|
154
|
+
condition,
|
|
155
|
+
extendedTemplateDisplayName,
|
|
156
|
+
extensionTemplateDisplayName,
|
|
157
|
+
extensionClickHandler,
|
|
158
|
+
isReadOnly = false,
|
|
159
|
+
dateOnlyView = false,
|
|
160
|
+
canExtendDiagnosis = false,
|
|
161
|
+
displaySource = false,
|
|
162
|
+
controls = [],
|
|
163
|
+
tags = [],
|
|
164
|
+
systemExclusionsFilter = [],
|
|
165
|
+
isRichText = false,
|
|
166
|
+
...rest
|
|
167
|
+
}) => {
|
|
168
|
+
if (condition.metadata.isRedacted) {
|
|
169
|
+
return (
|
|
170
|
+
<StyledSummary {...rest}>
|
|
171
|
+
<Redacted condition={condition} />
|
|
172
|
+
</StyledSummary>
|
|
173
|
+
)
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
const enteredInError = condition.verificationStatus === ConditionVerificationStatus.EnteredInError
|
|
177
|
+
|
|
178
|
+
return (
|
|
179
|
+
<StyledSummary {...rest}>
|
|
180
|
+
<StyledTitleAndDateContainer>
|
|
181
|
+
<StyledDescription>
|
|
182
|
+
<StyledTitle>
|
|
183
|
+
<Title
|
|
184
|
+
enteredInError={enteredInError}
|
|
185
|
+
condition={condition}
|
|
186
|
+
systemExclusionsFilter={systemExclusionsFilter}
|
|
187
|
+
isRichText={isRichText}
|
|
188
|
+
/>
|
|
189
|
+
{extensionTemplateDisplayName && !isReadOnly && canExtendDiagnosis && !enteredInError && (
|
|
190
|
+
<IconButtonWrapper
|
|
191
|
+
onClick={extensionClickHandler}
|
|
192
|
+
type="button"
|
|
193
|
+
styling={{ buttonStyle: 'clear' }}
|
|
194
|
+
value=""
|
|
195
|
+
icon={<Icon type="folder-plus" size="medium" />}
|
|
196
|
+
iconPlacement="center"
|
|
197
|
+
iconColour={BTN_COLOURS.PRIMARY.VALUE}
|
|
198
|
+
title={`This diagnosis can be extended further using form '${extensionTemplateDisplayName}' by clicking here`}
|
|
199
|
+
/>
|
|
200
|
+
)}
|
|
201
|
+
{extendedTemplateDisplayName && (
|
|
202
|
+
<IconWrapper>
|
|
203
|
+
<Icon
|
|
204
|
+
type="comment"
|
|
205
|
+
size="medium"
|
|
206
|
+
title={`This diagnosis has been extended beyond standard diagnosis with form '${extendedTemplateDisplayName}'.
|
|
207
|
+
To view these extra details, click into the full diagnosis detail or edit the existing form.`}
|
|
208
|
+
/>
|
|
209
|
+
</IconWrapper>
|
|
210
|
+
)}
|
|
211
|
+
</StyledTitle>
|
|
212
|
+
{displaySource && <DiagnosisDataSource condition={condition} enteredInError={enteredInError} />}
|
|
213
|
+
</StyledDescription>
|
|
214
|
+
<StyledDate>
|
|
215
|
+
<DateSummary enteredInError={enteredInError} datetime={condition?.assertedDate} dateOnlyView={dateOnlyView} />
|
|
216
|
+
<OnsetDateEstimated enteredInError={enteredInError} condition={condition} />
|
|
217
|
+
</StyledDate>
|
|
218
|
+
</StyledTitleAndDateContainer>
|
|
219
|
+
|
|
220
|
+
{!isReadOnly && (controls.length > 0 || tags.length > 0) && (
|
|
221
|
+
<StyledButtonAndTagContainer>
|
|
222
|
+
<StyledResponsiveButtonContainer>
|
|
223
|
+
{controls.map((props, index) => (
|
|
224
|
+
<StyledButton key={index} {...props} />
|
|
225
|
+
))}
|
|
226
|
+
</StyledResponsiveButtonContainer>
|
|
227
|
+
|
|
228
|
+
<StyledResponsiveTagContainer>
|
|
229
|
+
{tags?.map((tag, index) => (tag.key ? tag : cloneElement(tag, { key: index })))}
|
|
230
|
+
</StyledResponsiveTagContainer>
|
|
231
|
+
</StyledButtonAndTagContainer>
|
|
232
|
+
)}
|
|
233
|
+
</StyledSummary>
|
|
234
|
+
)
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
interface Props extends HTMLAttributes<HTMLDivElement> {
|
|
238
|
+
condition: Condition
|
|
239
|
+
extendedTemplateDisplayName?: string
|
|
240
|
+
extensionTemplateDisplayName?: string
|
|
241
|
+
isReadOnly?: boolean
|
|
242
|
+
dateOnlyView?: boolean
|
|
243
|
+
displaySource?: boolean
|
|
244
|
+
controls?: ButtonProps[]
|
|
245
|
+
tags?: ReactElement[]
|
|
246
|
+
canExtendDiagnosis?: boolean
|
|
247
|
+
extensionClickHandler?(): void
|
|
248
|
+
systemExclusionsFilter?: string[]
|
|
249
|
+
isRichText?: boolean
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
export default DiagnosisSummary
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { FC, HTMLAttributes } from 'react';
|
|
2
|
-
import { Condition } from '@ltht-react/types';
|
|
3
|
-
declare const DiagnosisCategory: FC<Props>;
|
|
4
|
-
interface Props extends HTMLAttributes<HTMLDivElement> {
|
|
5
|
-
condition: Condition;
|
|
6
|
-
enteredInError: boolean;
|
|
7
|
-
}
|
|
8
|
-
export default DiagnosisCategory;
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
-
return cooked;
|
|
5
|
-
};
|
|
6
|
-
var __assign = (this && this.__assign) || function () {
|
|
7
|
-
__assign = Object.assign || function(t) {
|
|
8
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
9
|
-
s = arguments[i];
|
|
10
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
11
|
-
t[p] = s[p];
|
|
12
|
-
}
|
|
13
|
-
return t;
|
|
14
|
-
};
|
|
15
|
-
return __assign.apply(this, arguments);
|
|
16
|
-
};
|
|
17
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
18
|
-
var t = {};
|
|
19
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
20
|
-
t[p] = s[p];
|
|
21
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
22
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
23
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
24
|
-
t[p[i]] = s[p[i]];
|
|
25
|
-
}
|
|
26
|
-
return t;
|
|
27
|
-
};
|
|
28
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
29
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
30
|
-
};
|
|
31
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
|
-
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
33
|
-
var styled_1 = __importDefault(require("@emotion/styled"));
|
|
34
|
-
var styles_1 = require("@ltht-react/styles");
|
|
35
|
-
var utils_1 = require("@ltht-react/utils");
|
|
36
|
-
var StyledConditionCategory = styled_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n color: ", ";\n text-align: left;\n font-size: smaller;\n padding-top: 0.25rem;\n text-decoration: ", ";\n"], ["\n color: ", ";\n text-align: left;\n font-size: smaller;\n padding-top: 0.25rem;\n text-decoration: ", ";\n"])), styles_1.TEXT_COLOURS.SECONDARY.VALUE, function (_a) {
|
|
37
|
-
var enteredInError = _a.enteredInError;
|
|
38
|
-
return (enteredInError ? 'line-through' : 'none');
|
|
39
|
-
});
|
|
40
|
-
var DiagnosisCategory = function (_a) {
|
|
41
|
-
var condition = _a.condition, enteredInError = _a.enteredInError, rest = __rest(_a, ["condition", "enteredInError"]);
|
|
42
|
-
return ((0, jsx_runtime_1.jsx)(StyledConditionCategory, __assign({ enteredInError: enteredInError }, rest, { children: (0, utils_1.codeableConceptDisplaySummary)(condition.severity) })));
|
|
43
|
-
};
|
|
44
|
-
exports.default = DiagnosisCategory;
|
|
45
|
-
var templateObject_1;
|
|
46
|
-
//# sourceMappingURL=diagnosis-category.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"diagnosis-category.js","sourceRoot":"","sources":["../../src/atoms/diagnosis-category.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,2DAAoC;AAEpC,6CAAiD;AAEjD,2CAAiE;AAEjE,IAAM,uBAAuB,GAAG,gBAAM,CAAC,GAAG,sLAAoB,aACnD,EAA4B,6FAIlB,EAAkE,KACtF,KALU,qBAAY,CAAC,SAAS,CAAC,KAAK,EAIlB,UAAC,EAAkB;QAAhB,cAAc,oBAAA;IAAO,OAAA,CAAC,cAAc,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC;AAA1C,CAA0C,CACtF,CAAA;AAED,IAAM,iBAAiB,GAAc,UAAC,EAAsC;IAApC,IAAA,SAAS,eAAA,EAAE,cAAc,oBAAA,EAAK,IAAI,cAApC,+BAAsC,CAAF;IAAO,OAAA,CAC/E,uBAAC,uBAAuB,aAAC,cAAc,EAAE,cAAc,IAAM,IAAI,cAC9D,IAAA,qCAA6B,EAAC,SAAS,CAAC,QAAQ,CAAC,IAC1B,CAC3B,CAAA;CAAA,CAAA;AAWD,kBAAe,iBAAiB,CAAA"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { FC, HTMLAttributes } from 'react';
|
|
2
|
-
import { Condition } from '@ltht-react/types';
|
|
3
|
-
declare const DiagnosisDataSource: FC<Props>;
|
|
4
|
-
interface Props extends HTMLAttributes<HTMLDivElement> {
|
|
5
|
-
condition: Condition;
|
|
6
|
-
enteredInError: boolean;
|
|
7
|
-
}
|
|
8
|
-
export default DiagnosisDataSource;
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
-
return cooked;
|
|
5
|
-
};
|
|
6
|
-
var __assign = (this && this.__assign) || function () {
|
|
7
|
-
__assign = Object.assign || function(t) {
|
|
8
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
9
|
-
s = arguments[i];
|
|
10
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
11
|
-
t[p] = s[p];
|
|
12
|
-
}
|
|
13
|
-
return t;
|
|
14
|
-
};
|
|
15
|
-
return __assign.apply(this, arguments);
|
|
16
|
-
};
|
|
17
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
18
|
-
var t = {};
|
|
19
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
20
|
-
t[p] = s[p];
|
|
21
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
22
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
23
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
24
|
-
t[p[i]] = s[p[i]];
|
|
25
|
-
}
|
|
26
|
-
return t;
|
|
27
|
-
};
|
|
28
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
29
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
30
|
-
};
|
|
31
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
|
-
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
33
|
-
var styled_1 = __importDefault(require("@emotion/styled"));
|
|
34
|
-
var styles_1 = require("@ltht-react/styles");
|
|
35
|
-
var StyledConditionStatus = styled_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n color: ", ";\n text-align: left;\n font-size: smaller;\n text-decoration: ", ";\n"], ["\n color: ", ";\n text-align: left;\n font-size: smaller;\n text-decoration: ", ";\n"])), styles_1.TEXT_COLOURS.SECONDARY.VALUE, function (_a) {
|
|
36
|
-
var enteredInError = _a.enteredInError;
|
|
37
|
-
return (enteredInError ? 'line-through' : 'none');
|
|
38
|
-
});
|
|
39
|
-
var extractDataSourceDisplayNames = function (condition) {
|
|
40
|
-
var _a, _b;
|
|
41
|
-
var dataSourceDisplayNames = [];
|
|
42
|
-
(_b = (_a = condition === null || condition === void 0 ? void 0 : condition.metadata) === null || _a === void 0 ? void 0 : _a.dataSources) === null || _b === void 0 ? void 0 : _b.forEach(function (dataSource, _) {
|
|
43
|
-
if (dataSource === null || dataSource === void 0 ? void 0 : dataSource.display) {
|
|
44
|
-
dataSourceDisplayNames.push(dataSource.display);
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
return dataSourceDisplayNames.join(', ');
|
|
48
|
-
};
|
|
49
|
-
var DiagnosisDataSource = function (_a) {
|
|
50
|
-
var condition = _a.condition, enteredInError = _a.enteredInError, rest = __rest(_a, ["condition", "enteredInError"]);
|
|
51
|
-
var dataSourceDisplayNames = extractDataSourceDisplayNames(condition);
|
|
52
|
-
return ((0, jsx_runtime_1.jsx)(StyledConditionStatus, __assign({ enteredInError: enteredInError }, rest, { children: dataSourceDisplayNames ? "Source: ".concat(dataSourceDisplayNames) : "Source: Unknown" })));
|
|
53
|
-
};
|
|
54
|
-
exports.default = DiagnosisDataSource;
|
|
55
|
-
var templateObject_1;
|
|
56
|
-
//# sourceMappingURL=diagnosis-data-source.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"diagnosis-data-source.js","sourceRoot":"","sources":["../../src/atoms/diagnosis-data-source.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,2DAAoC;AAEpC,6CAAiD;AAGjD,IAAM,qBAAqB,GAAG,gBAAM,CAAC,GAAG,6JAAoB,aACjD,EAA4B,oEAGlB,EAAkE,KACtF,KAJU,qBAAY,CAAC,SAAS,CAAC,KAAK,EAGlB,UAAC,EAAkB;QAAhB,cAAc,oBAAA;IAAO,OAAA,CAAC,cAAc,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC;AAA1C,CAA0C,CACtF,CAAA;AAED,IAAM,6BAA6B,GAAG,UAAC,SAAoB;;IACzD,IAAM,sBAAsB,GAAa,EAAE,CAAA;IAE3C,MAAA,MAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,QAAQ,0CAAE,WAAW,0CAAE,OAAO,CAAC,UAAC,UAAU,EAAE,CAAC;QACtD,IAAI,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,OAAO,EAAE,CAAC;YACxB,sBAAsB,CAAC,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAA;QACjD,CAAC;IACH,CAAC,CAAC,CAAA;IAEF,OAAO,sBAAsB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AAC1C,CAAC,CAAA;AAED,IAAM,mBAAmB,GAAc,UAAC,EAAsC;IAApC,IAAA,SAAS,eAAA,EAAE,cAAc,oBAAA,EAAK,IAAI,cAApC,+BAAsC,CAAF;IAC1E,IAAM,sBAAsB,GAAG,6BAA6B,CAAC,SAAS,CAAC,CAAA;IAEvE,OAAO,CACL,uBAAC,qBAAqB,aAAC,cAAc,EAAE,cAAc,IAAM,IAAI,cAC5D,sBAAsB,CAAC,CAAC,CAAC,kBAAW,sBAAsB,CAAE,CAAC,CAAC,CAAC,iBAAiB,IAC3D,CACzB,CAAA;AACH,CAAC,CAAA;AAWD,kBAAe,mBAAmB,CAAA"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { FC, HTMLAttributes } from 'react';
|
|
2
|
-
import { Condition } from '@ltht-react/types';
|
|
3
|
-
declare const DiagnosisOnsetEstimated: FC<Props>;
|
|
4
|
-
interface Props extends HTMLAttributes<HTMLDivElement> {
|
|
5
|
-
condition: Condition;
|
|
6
|
-
enteredInError: boolean;
|
|
7
|
-
}
|
|
8
|
-
export default DiagnosisOnsetEstimated;
|