@ltht-react/care-plan-detail 2.0.3 → 2.0.4

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 (2) hide show
  1. package/package.json +9 -8
  2. package/src/index.tsx +34 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ltht-react/care-plan-detail",
3
- "version": "2.0.3",
3
+ "version": "2.0.4",
4
4
  "description": "ltht-react clinical CarePlanDetail component.",
5
5
  "author": "LTHT",
6
6
  "homepage": "",
@@ -8,7 +8,8 @@
8
8
  "main": "lib/index.js",
9
9
  "typings": "lib/index.d.ts",
10
10
  "files": [
11
- "lib"
11
+ "lib",
12
+ "src"
12
13
  ],
13
14
  "directories": {
14
15
  "lib": "lib"
@@ -27,12 +28,12 @@
27
28
  "dependencies": {
28
29
  "@emotion/react": "^11.0.0",
29
30
  "@emotion/styled": "^11.0.0",
30
- "@ltht-react/description-list": "^2.0.3",
31
- "@ltht-react/styles": "^2.0.3",
32
- "@ltht-react/type-detail": "^2.0.3",
33
- "@ltht-react/types": "^2.0.3",
34
- "@ltht-react/utils": "^2.0.3",
31
+ "@ltht-react/description-list": "^2.0.4",
32
+ "@ltht-react/styles": "^2.0.4",
33
+ "@ltht-react/type-detail": "^2.0.4",
34
+ "@ltht-react/types": "^2.0.4",
35
+ "@ltht-react/utils": "^2.0.4",
35
36
  "react": "^18.2.0"
36
37
  },
37
- "gitHead": "6f18742bbf2f44123b6478257e52fbbdd291a25b"
38
+ "gitHead": "b8fe243323a0f1b9ab345475db38c73fd3b35312"
38
39
  }
package/src/index.tsx ADDED
@@ -0,0 +1,34 @@
1
+ import { FC } from 'react'
2
+ import { CarePlan, DetailViewType } from '@ltht-react/types'
3
+ import {
4
+ StringDetail,
5
+ PeriodDetail,
6
+ NarrativeDetail,
7
+ ResourceReferenceListDetail,
8
+ CollapsibleDetailCollection,
9
+ CollapsibleDetailCollectionProps,
10
+ } from '@ltht-react/type-detail'
11
+
12
+ const CarePlanDetail: FC<Props> = ({ carePlan, viewType = DetailViewType.Compact }) => {
13
+ const performers = carePlan?.activity?.map((a) => a?.detail?.performer?.map((p) => p)).reduce((p) => p)
14
+
15
+ return (
16
+ <CollapsibleDetailCollection viewType={viewType}>
17
+ <StringDetail term="Plan" description={carePlan.title} />
18
+ <StringDetail term="Description" description={carePlan.description} />
19
+ <PeriodDetail period={carePlan.period} />
20
+ <StringDetail term="Intent" description={carePlan.intent.toString()} />
21
+ <StringDetail term="Status" description={carePlan.status.toString()} />
22
+ <NarrativeDetail narrative={carePlan.text} />
23
+ <ResourceReferenceListDetail term="Addresses" resourceReferences={carePlan?.addresses} />
24
+ <ResourceReferenceListDetail term="Performer(s)" resourceReferences={performers} />
25
+ <ResourceReferenceListDetail term="Author(s)" resourceReferences={carePlan?.author} />
26
+ </CollapsibleDetailCollection>
27
+ )
28
+ }
29
+
30
+ interface Props extends CollapsibleDetailCollectionProps {
31
+ carePlan: CarePlan
32
+ }
33
+
34
+ export default CarePlanDetail