@ltht-react/diagnosis-summary 2.0.92 → 2.0.93

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.
Files changed (38) hide show
  1. package/README.md +22 -22
  2. package/package.json +10 -10
  3. package/src/atoms/diagnosis-category.tsx +31 -31
  4. package/src/atoms/diagnosis-onset-estimated.tsx +39 -39
  5. package/src/atoms/diagnosis-status.tsx +38 -38
  6. package/src/atoms/diagnosis-title.tsx +28 -37
  7. package/src/constants.ts +3 -3
  8. package/src/index.tsx +3 -3
  9. package/src/molecules/diagnosis-redacted.tsx +31 -31
  10. package/src/organisms/diagnosis-summary.tsx +166 -168
  11. package/lib/atoms/diagnosis-category.d.ts +0 -8
  12. package/lib/atoms/diagnosis-category.js +0 -46
  13. package/lib/atoms/diagnosis-category.js.map +0 -1
  14. package/lib/atoms/diagnosis-onset-estimated.d.ts +0 -8
  15. package/lib/atoms/diagnosis-onset-estimated.js +0 -47
  16. package/lib/atoms/diagnosis-onset-estimated.js.map +0 -1
  17. package/lib/atoms/diagnosis-status.d.ts +0 -8
  18. package/lib/atoms/diagnosis-status.js +0 -51
  19. package/lib/atoms/diagnosis-status.js.map +0 -1
  20. package/lib/atoms/diagnosis-sub-header.d.ts +0 -7
  21. package/lib/atoms/diagnosis-sub-header.js +0 -45
  22. package/lib/atoms/diagnosis-sub-header.js.map +0 -1
  23. package/lib/atoms/diagnosis-title.d.ts +0 -8
  24. package/lib/atoms/diagnosis-title.js +0 -51
  25. package/lib/atoms/diagnosis-title.js.map +0 -1
  26. package/lib/constants.d.ts +0 -2
  27. package/lib/constants.js +0 -5
  28. package/lib/constants.js.map +0 -1
  29. package/lib/index.d.ts +0 -2
  30. package/lib/index.js +0 -8
  31. package/lib/index.js.map +0 -1
  32. package/lib/molecules/diagnosis-redacted.d.ts +0 -7
  33. package/lib/molecules/diagnosis-redacted.js +0 -22
  34. package/lib/molecules/diagnosis-redacted.js.map +0 -1
  35. package/lib/organisms/diagnosis-summary.d.ts +0 -15
  36. package/lib/organisms/diagnosis-summary.js +0 -65
  37. package/lib/organisms/diagnosis-summary.js.map +0 -1
  38. package/src/atoms/diagnosis-sub-header.tsx +0 -29
package/README.md CHANGED
@@ -1,22 +1,22 @@
1
- # DiagnosisSummary
2
-
3
- <!-- STORY -->
4
-
5
- ### Import
6
-
7
- ```js
8
- import DiagnosisSummary from '@ltht-react/diagnosis-summary'
9
- ```
10
-
11
- ### Usage
12
-
13
- ```jsx
14
- <DiagnosisSummary title="Conditions" conditions={conditions} clickHandler={handleCLick} />
15
- ```
16
-
17
- ### Properties
18
-
19
- | Prop | Required | Default | Type | Description |
20
- | :------------- | :------- | :-------- | :---------- | :------------------------------------------------------------ |
21
- | `conditions` | Yes | | Condition[] | Array of conditions to display |
22
- | `clickHandler` | No | undefined | Function | Callback click handler containing the selected condition item |
1
+ # DiagnosisSummary
2
+
3
+ <!-- STORY -->
4
+
5
+ ### Import
6
+
7
+ ```js
8
+ import DiagnosisSummary from '@ltht-react/diagnosis-summary'
9
+ ```
10
+
11
+ ### Usage
12
+
13
+ ```jsx
14
+ <DiagnosisSummary title="Conditions" conditions={conditions} clickHandler={handleCLick} />
15
+ ```
16
+
17
+ ### Properties
18
+
19
+ | Prop | Required | Default | Type | Description |
20
+ | :------------- | :------- | :-------- | :---------- | :------------------------------------------------------------ |
21
+ | `conditions` | Yes | | Condition[] | Array of conditions to display |
22
+ | `clickHandler` | No | undefined | Function | Callback click handler containing the selected condition item |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ltht-react/diagnosis-summary",
3
- "version": "2.0.92",
3
+ "version": "2.0.93",
4
4
  "description": "ltht-react clinical DiagnosisSummary component.",
5
5
  "author": "LTHT",
6
6
  "homepage": "",
@@ -28,15 +28,15 @@
28
28
  "dependencies": {
29
29
  "@emotion/react": "^11.0.0",
30
30
  "@emotion/styled": "^11.0.0",
31
- "@ltht-react/button": "^2.0.92",
32
- "@ltht-react/hooks": "^2.0.92",
33
- "@ltht-react/icon": "^2.0.92",
34
- "@ltht-react/list": "^2.0.92",
35
- "@ltht-react/styles": "^2.0.92",
36
- "@ltht-react/type-summary": "^2.0.92",
37
- "@ltht-react/types": "^2.0.92",
38
- "@ltht-react/utils": "^2.0.92",
31
+ "@ltht-react/button": "^2.0.93",
32
+ "@ltht-react/hooks": "^2.0.93",
33
+ "@ltht-react/icon": "^2.0.93",
34
+ "@ltht-react/list": "^2.0.93",
35
+ "@ltht-react/styles": "^2.0.93",
36
+ "@ltht-react/type-summary": "^2.0.93",
37
+ "@ltht-react/types": "^2.0.93",
38
+ "@ltht-react/utils": "^2.0.93",
39
39
  "react": "^18.2.0"
40
40
  },
41
- "gitHead": "38e73d8070788d851439e08e61ffae6a16ea8004"
41
+ "gitHead": "a719fb23b34bec9e9913d310c94e385a1f9e4747"
42
42
  }
@@ -1,31 +1,31 @@
1
- import { FC, HTMLAttributes } from 'react'
2
- import styled from '@emotion/styled'
3
-
4
- import { TEXT_COLOURS } from '@ltht-react/styles'
5
- import { Condition } from '@ltht-react/types'
6
- import { codeableConceptDisplaySummary } from '@ltht-react/utils'
7
-
8
- const StyledConditionCategory = styled.div<IStyledDescription>`
9
- color: ${TEXT_COLOURS.SECONDARY.VALUE};
10
- text-align: left;
11
- font-size: smaller;
12
- padding-top: 0.25rem;
13
- text-decoration: ${({ enteredInError }) => (enteredInError ? 'line-through' : 'none')};
14
- `
15
-
16
- const DiagnosisCategory: FC<Props> = ({ condition, enteredInError, ...rest }) => (
17
- <StyledConditionCategory enteredInError={enteredInError} {...rest}>
18
- {codeableConceptDisplaySummary(condition.severity)}
19
- </StyledConditionCategory>
20
- )
21
-
22
- interface Props extends HTMLAttributes<HTMLDivElement> {
23
- condition: Condition
24
- enteredInError: boolean
25
- }
26
-
27
- interface IStyledDescription {
28
- enteredInError: boolean
29
- }
30
-
31
- export default DiagnosisCategory
1
+ import { FC, HTMLAttributes } from 'react'
2
+ import styled from '@emotion/styled'
3
+
4
+ import { TEXT_COLOURS } from '@ltht-react/styles'
5
+ import { Condition } from '@ltht-react/types'
6
+ import { codeableConceptDisplaySummary } from '@ltht-react/utils'
7
+
8
+ const StyledConditionCategory = styled.div<IStyledDescription>`
9
+ color: ${TEXT_COLOURS.SECONDARY.VALUE};
10
+ text-align: left;
11
+ font-size: smaller;
12
+ padding-top: 0.25rem;
13
+ text-decoration: ${({ enteredInError }) => (enteredInError ? 'line-through' : 'none')};
14
+ `
15
+
16
+ const DiagnosisCategory: FC<Props> = ({ condition, enteredInError, ...rest }) => (
17
+ <StyledConditionCategory enteredInError={enteredInError} {...rest}>
18
+ {codeableConceptDisplaySummary(condition.severity)}
19
+ </StyledConditionCategory>
20
+ )
21
+
22
+ interface Props extends HTMLAttributes<HTMLDivElement> {
23
+ condition: Condition
24
+ enteredInError: boolean
25
+ }
26
+
27
+ interface IStyledDescription {
28
+ enteredInError: boolean
29
+ }
30
+
31
+ export default DiagnosisCategory
@@ -1,39 +1,39 @@
1
- import { FC, HTMLAttributes } from 'react'
2
- import styled from '@emotion/styled'
3
-
4
- import { TEXT_COLOURS } from '@ltht-react/styles'
5
- import { Condition } from '@ltht-react/types'
6
-
7
- import { getBooleanExtension } from '@ltht-react/utils'
8
-
9
- const StyledOnsetEstimated = styled.div<IStyledDescription>`
10
- color: ${TEXT_COLOURS.INFO};
11
- font-size: x-small;
12
- white-space: pre-wrap;
13
- display: inline-block;
14
- text-decoration: ${({ enteredInError }) => (enteredInError ? 'line-through' : 'none')};
15
- `
16
-
17
- const DiagnosisOnsetEstimated: FC<Props> = ({ condition, enteredInError, ...rest }) => {
18
- const onsetDateEstimated = getBooleanExtension(
19
- condition.extension,
20
- 'https://fhir.leedsth.nhs.uk/ValueSet/diagnosis-onset-date-estimated-1'
21
- )
22
-
23
- return (
24
- <StyledOnsetEstimated enteredInError={enteredInError} {...rest}>
25
- {onsetDateEstimated ? ' (estimated)' : ''}
26
- </StyledOnsetEstimated>
27
- )
28
- }
29
-
30
- interface Props extends HTMLAttributes<HTMLDivElement> {
31
- condition: Condition
32
- enteredInError: boolean
33
- }
34
-
35
- interface IStyledDescription {
36
- enteredInError: boolean
37
- }
38
-
39
- export default DiagnosisOnsetEstimated
1
+ import { FC, HTMLAttributes } from 'react'
2
+ import styled from '@emotion/styled'
3
+
4
+ import { TEXT_COLOURS } from '@ltht-react/styles'
5
+ import { Condition } from '@ltht-react/types'
6
+
7
+ import { getBooleanExtension } from '@ltht-react/utils'
8
+
9
+ const StyledOnsetEstimated = styled.div<IStyledDescription>`
10
+ color: ${TEXT_COLOURS.INFO};
11
+ font-size: x-small;
12
+ white-space: pre-wrap;
13
+ display: inline-block;
14
+ text-decoration: ${({ enteredInError }) => (enteredInError ? 'line-through' : 'none')};
15
+ `
16
+
17
+ const DiagnosisOnsetEstimated: FC<Props> = ({ condition, enteredInError, ...rest }) => {
18
+ const onsetDateEstimated = getBooleanExtension(
19
+ condition.extension,
20
+ 'https://fhir.leedsth.nhs.uk/ValueSet/diagnosis-onset-date-estimated-1'
21
+ )
22
+
23
+ return (
24
+ <StyledOnsetEstimated enteredInError={enteredInError} {...rest}>
25
+ {onsetDateEstimated ? ' (estimated)' : ''}
26
+ </StyledOnsetEstimated>
27
+ )
28
+ }
29
+
30
+ interface Props extends HTMLAttributes<HTMLDivElement> {
31
+ condition: Condition
32
+ enteredInError: boolean
33
+ }
34
+
35
+ interface IStyledDescription {
36
+ enteredInError: boolean
37
+ }
38
+
39
+ export default DiagnosisOnsetEstimated
@@ -1,38 +1,38 @@
1
- import { FC, HTMLAttributes } from 'react'
2
- import styled from '@emotion/styled'
3
-
4
- import { TEXT_COLOURS } from '@ltht-react/styles'
5
- import { Condition } from '@ltht-react/types'
6
- import { titleCase } from '@ltht-react/utils'
7
-
8
- const StyledConditionStatus = styled.div<IStyledDescription>`
9
- color: ${TEXT_COLOURS.SECONDARY.VALUE};
10
- text-align: left;
11
- font-size: smaller;
12
- padding-top: 0.25rem;
13
- text-decoration: ${({ enteredInError }) => (enteredInError ? 'line-through' : 'none')};
14
- `
15
-
16
- const DiagnosisStatus: FC<Props> = ({ condition, enteredInError, ...rest }) => {
17
- const values = []
18
-
19
- if (condition.clinicalStatus) values.push(titleCase(condition.clinicalStatus))
20
- if (condition.verificationStatus) values.push(titleCase(condition.verificationStatus))
21
-
22
- return (
23
- <StyledConditionStatus enteredInError={enteredInError} {...rest}>
24
- {values.length > 0 ? values.join(' - ') : 'Insufficient data provided'}
25
- </StyledConditionStatus>
26
- )
27
- }
28
-
29
- interface Props extends HTMLAttributes<HTMLDivElement> {
30
- condition: Condition
31
- enteredInError: boolean
32
- }
33
-
34
- interface IStyledDescription {
35
- enteredInError: boolean
36
- }
37
-
38
- export default DiagnosisStatus
1
+ import { FC, HTMLAttributes } from 'react'
2
+ import styled from '@emotion/styled'
3
+
4
+ import { TEXT_COLOURS } from '@ltht-react/styles'
5
+ import { Condition } from '@ltht-react/types'
6
+ import { titleCase } from '@ltht-react/utils'
7
+
8
+ const StyledConditionStatus = styled.div<IStyledDescription>`
9
+ color: ${TEXT_COLOURS.SECONDARY.VALUE};
10
+ text-align: left;
11
+ font-size: smaller;
12
+ padding-top: 0.25rem;
13
+ text-decoration: ${({ enteredInError }) => (enteredInError ? 'line-through' : 'none')};
14
+ `
15
+
16
+ const DiagnosisStatus: FC<Props> = ({ condition, enteredInError, ...rest }) => {
17
+ const values = []
18
+
19
+ if (condition.clinicalStatus) values.push(titleCase(condition.clinicalStatus))
20
+ if (condition.verificationStatus) values.push(titleCase(condition.verificationStatus))
21
+
22
+ return (
23
+ <StyledConditionStatus enteredInError={enteredInError} {...rest}>
24
+ {values.length > 0 ? values.join(' - ') : 'Insufficient data provided'}
25
+ </StyledConditionStatus>
26
+ )
27
+ }
28
+
29
+ interface Props extends HTMLAttributes<HTMLDivElement> {
30
+ condition: Condition
31
+ enteredInError: boolean
32
+ }
33
+
34
+ interface IStyledDescription {
35
+ enteredInError: boolean
36
+ }
37
+
38
+ export default DiagnosisStatus
@@ -1,37 +1,28 @@
1
- import { FC, HTMLAttributes } from 'react'
2
- import styled from '@emotion/styled'
3
-
4
- import { TEXT_COLOURS } from '@ltht-react/styles'
5
- import { Condition } from '@ltht-react/types'
6
- import { codeableConceptTextSummary } from '@ltht-react/utils'
7
-
8
- const StyledConditionTitle = styled.div<IStyledDescription>`
9
- color: ${TEXT_COLOURS.PRIMARY};
10
- text-align: left;
11
- text-decoration: ${({ enteredInError }) => (enteredInError ? 'line-through' : 'none')};
12
- `
13
-
14
- const DiagnosisTitle: FC<Props> = ({ condition, enteredInError, ...rest }) => {
15
- const codes = []
16
- const snippets = []
17
-
18
- if (condition.code) codes.push(condition.code)
19
- snippets.push(codeableConceptTextSummary(codes))
20
-
21
- return (
22
- <StyledConditionTitle enteredInError={enteredInError} {...rest}>
23
- {snippets.length > 0 ? snippets.join(', ') : 'Insufficient data provided'}
24
- </StyledConditionTitle>
25
- )
26
- }
27
-
28
- interface Props extends HTMLAttributes<HTMLDivElement> {
29
- condition: Condition
30
- enteredInError: boolean
31
- }
32
-
33
- interface IStyledDescription {
34
- enteredInError: boolean
35
- }
36
-
37
- export default DiagnosisTitle
1
+ import { FC, HTMLAttributes } from 'react'
2
+ import styled from '@emotion/styled'
3
+
4
+ import { TEXT_COLOURS } from '@ltht-react/styles'
5
+ import { Maybe, Scalars } from '@ltht-react/types'
6
+
7
+ const StyledConditionTitle = styled.div<IStyledDescription>`
8
+ color: ${TEXT_COLOURS.PRIMARY};
9
+ text-align: left;
10
+ text-decoration: ${({ enteredInError }) => (enteredInError ? 'line-through' : 'none')};
11
+ `
12
+
13
+ const DiagnosisTitle: FC<Props> = ({ text, enteredInError, ...rest }) => (
14
+ <StyledConditionTitle enteredInError={enteredInError} {...rest}>
15
+ {text || 'Insufficient data provided.'}
16
+ </StyledConditionTitle>
17
+ )
18
+
19
+ interface Props extends HTMLAttributes<HTMLDivElement> {
20
+ text?: Maybe<Scalars['String']>
21
+ enteredInError: boolean
22
+ }
23
+
24
+ interface IStyledDescription {
25
+ enteredInError: boolean
26
+ }
27
+
28
+ export default DiagnosisTitle
package/src/constants.ts CHANGED
@@ -1,3 +1,3 @@
1
- const SNIPPET_HOVER_TEXT = 'https://leedsth.nhs.uk/cds/snippet-hover-text'
2
-
3
- export default SNIPPET_HOVER_TEXT
1
+ const SNIPPET_HOVER_TEXT = 'https://leedsth.nhs.uk/cds/snippet-hover-text'
2
+
3
+ export default SNIPPET_HOVER_TEXT
package/src/index.tsx CHANGED
@@ -1,3 +1,3 @@
1
- import DiagnosisSummary from './organisms/diagnosis-summary'
2
-
3
- export default DiagnosisSummary
1
+ import DiagnosisSummary from './organisms/diagnosis-summary'
2
+
3
+ export default DiagnosisSummary
@@ -1,31 +1,31 @@
1
- import { FC } from 'react'
2
- import styled from '@emotion/styled'
3
-
4
- import { Condition } from '@ltht-react/types'
5
- import { DateSummary, RedactedDescription } from '@ltht-react/type-summary'
6
-
7
- const StyledRedactedDescription = styled.div`
8
- flex-grow: 1;
9
- text-align: left;
10
- `
11
-
12
- const StyledDateSummary = styled.div`
13
- text-align: right;
14
- `
15
-
16
- const DiagnosisRedacted: FC<Props> = ({ condition }) => (
17
- <>
18
- <StyledRedactedDescription>
19
- <RedactedDescription />
20
- </StyledRedactedDescription>
21
- <StyledDateSummary>
22
- <DateSummary datetime={condition?.onset?.dateTime} />
23
- </StyledDateSummary>
24
- </>
25
- )
26
-
27
- interface Props {
28
- condition?: Condition | null
29
- }
30
-
31
- export default DiagnosisRedacted
1
+ import { FC } from 'react'
2
+ import styled from '@emotion/styled'
3
+
4
+ import { Condition } from '@ltht-react/types'
5
+ import { DateSummary, RedactedDescription } from '@ltht-react/type-summary'
6
+
7
+ const StyledRedactedDescription = styled.div`
8
+ flex-grow: 1;
9
+ text-align: left;
10
+ `
11
+
12
+ const StyledDateSummary = styled.div`
13
+ text-align: right;
14
+ `
15
+
16
+ const DiagnosisRedacted: FC<Props> = ({ condition }) => (
17
+ <>
18
+ <StyledRedactedDescription>
19
+ <RedactedDescription />
20
+ </StyledRedactedDescription>
21
+ <StyledDateSummary>
22
+ <DateSummary datetime={condition?.onset?.dateTime} />
23
+ </StyledDateSummary>
24
+ </>
25
+ )
26
+
27
+ interface Props {
28
+ condition?: Condition | null
29
+ }
30
+
31
+ export default DiagnosisRedacted