@ltht-react/diagnosis-summary 2.0.62 → 2.0.64
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/lib/atoms/diagnosis-category.d.ts +8 -0
- package/lib/atoms/diagnosis-category.js +46 -0
- package/lib/atoms/diagnosis-category.js.map +1 -0
- package/lib/atoms/diagnosis-onset-estimated.d.ts +8 -0
- package/lib/atoms/diagnosis-onset-estimated.js +47 -0
- package/lib/atoms/diagnosis-onset-estimated.js.map +1 -0
- package/lib/atoms/diagnosis-status.d.ts +8 -0
- package/lib/atoms/diagnosis-status.js +51 -0
- package/lib/atoms/diagnosis-status.js.map +1 -0
- package/lib/atoms/diagnosis-title.d.ts +8 -0
- package/lib/atoms/diagnosis-title.js +55 -0
- package/lib/atoms/diagnosis-title.js.map +1 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +8 -0
- package/lib/index.js.map +1 -0
- package/lib/molecules/diagnosis-redacted.d.ts +7 -0
- package/lib/molecules/diagnosis-redacted.js +22 -0
- package/lib/molecules/diagnosis-redacted.js.map +1 -0
- package/lib/organisms/diagnosis-summary.d.ts +14 -0
- package/lib/organisms/diagnosis-summary.js +62 -0
- package/lib/organisms/diagnosis-summary.js.map +1 -0
- package/package.json +10 -10
- package/src/atoms/diagnosis-category.tsx +31 -31
- package/src/atoms/diagnosis-onset-estimated.tsx +39 -39
- package/src/atoms/diagnosis-status.tsx +38 -38
- package/src/atoms/diagnosis-title.tsx +39 -35
- package/src/index.tsx +3 -3
- package/src/molecules/diagnosis-redacted.tsx +31 -31
- package/src/organisms/diagnosis-summary.tsx +163 -165
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 |
|
|
@@ -0,0 +1,8 @@
|
|
|
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;
|
|
@@ -0,0 +1,46 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,8 @@
|
|
|
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;
|
|
@@ -0,0 +1,47 @@
|
|
|
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 StyledOnsetEstimated = styled_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n color: ", ";\n font-size: x-small;\n white-space: pre-wrap;\n display: inline-block;\n text-decoration: ", ";\n"], ["\n color: ", ";\n font-size: x-small;\n white-space: pre-wrap;\n display: inline-block;\n text-decoration: ", ";\n"])), styles_1.TEXT_COLOURS.INFO, function (_a) {
|
|
37
|
+
var enteredInError = _a.enteredInError;
|
|
38
|
+
return (enteredInError ? 'line-through' : 'none');
|
|
39
|
+
});
|
|
40
|
+
var DiagnosisOnsetEstimated = function (_a) {
|
|
41
|
+
var condition = _a.condition, enteredInError = _a.enteredInError, rest = __rest(_a, ["condition", "enteredInError"]);
|
|
42
|
+
var onsetDateEstimated = (0, utils_1.getBooleanExtension)(condition.extension, 'https://fhir.leedsth.nhs.uk/ValueSet/diagnosis-onset-date-estimated-1');
|
|
43
|
+
return ((0, jsx_runtime_1.jsx)(StyledOnsetEstimated, __assign({ enteredInError: enteredInError }, rest, { children: onsetDateEstimated ? ' (estimated)' : '' })));
|
|
44
|
+
};
|
|
45
|
+
exports.default = DiagnosisOnsetEstimated;
|
|
46
|
+
var templateObject_1;
|
|
47
|
+
//# sourceMappingURL=diagnosis-onset-estimated.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diagnosis-onset-estimated.js","sourceRoot":"","sources":["../../src/atoms/diagnosis-onset-estimated.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,2DAAoC;AAEpC,6CAAiD;AAGjD,2CAAuD;AAEvD,IAAM,oBAAoB,GAAG,gBAAM,CAAC,GAAG,4LAAoB,aAChD,EAAiB,mGAIP,EAAkE,KACtF,KALU,qBAAY,CAAC,IAAI,EAIP,UAAC,EAAkB;QAAhB,cAAc,oBAAA;IAAO,OAAA,CAAC,cAAc,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC;AAA1C,CAA0C,CACtF,CAAA;AAED,IAAM,uBAAuB,GAAc,UAAC,EAAsC;IAApC,IAAA,SAAS,eAAA,EAAE,cAAc,oBAAA,EAAK,IAAI,cAApC,+BAAsC,CAAF;IAC9E,IAAM,kBAAkB,GAAG,IAAA,2BAAmB,EAC5C,SAAS,CAAC,SAAS,EACnB,uEAAuE,CACxE,CAAA;IAED,OAAO,CACL,uBAAC,oBAAoB,aAAC,cAAc,EAAE,cAAc,IAAM,IAAI,cAC3D,kBAAkB,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,IACpB,CACxB,CAAA;AACH,CAAC,CAAA;AAWD,kBAAe,uBAAuB,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FC, HTMLAttributes } from 'react';
|
|
2
|
+
import { Condition } from '@ltht-react/types';
|
|
3
|
+
declare const DiagnosisStatus: FC<Props>;
|
|
4
|
+
interface Props extends HTMLAttributes<HTMLDivElement> {
|
|
5
|
+
condition: Condition;
|
|
6
|
+
enteredInError: boolean;
|
|
7
|
+
}
|
|
8
|
+
export default DiagnosisStatus;
|
|
@@ -0,0 +1,51 @@
|
|
|
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 StyledConditionStatus = 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 DiagnosisStatus = function (_a) {
|
|
41
|
+
var condition = _a.condition, enteredInError = _a.enteredInError, rest = __rest(_a, ["condition", "enteredInError"]);
|
|
42
|
+
var values = [];
|
|
43
|
+
if (condition.clinicalStatus)
|
|
44
|
+
values.push((0, utils_1.titleCase)(condition.clinicalStatus));
|
|
45
|
+
if (condition.verificationStatus)
|
|
46
|
+
values.push((0, utils_1.titleCase)(condition.verificationStatus));
|
|
47
|
+
return ((0, jsx_runtime_1.jsx)(StyledConditionStatus, __assign({ enteredInError: enteredInError }, rest, { children: values.length > 0 ? values.join(' - ') : 'Insufficient data provided' })));
|
|
48
|
+
};
|
|
49
|
+
exports.default = DiagnosisStatus;
|
|
50
|
+
var templateObject_1;
|
|
51
|
+
//# sourceMappingURL=diagnosis-status.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diagnosis-status.js","sourceRoot":"","sources":["../../src/atoms/diagnosis-status.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,2DAAoC;AAEpC,6CAAiD;AAEjD,2CAA6C;AAE7C,IAAM,qBAAqB,GAAG,gBAAM,CAAC,GAAG,sLAAoB,aACjD,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,eAAe,GAAc,UAAC,EAAsC;IAApC,IAAA,SAAS,eAAA,EAAE,cAAc,oBAAA,EAAK,IAAI,cAApC,+BAAsC,CAAF;IACtE,IAAM,MAAM,GAAG,EAAE,CAAA;IAEjB,IAAI,SAAS,CAAC,cAAc;QAAE,MAAM,CAAC,IAAI,CAAC,IAAA,iBAAS,EAAC,SAAS,CAAC,cAAc,CAAC,CAAC,CAAA;IAC9E,IAAI,SAAS,CAAC,kBAAkB;QAAE,MAAM,CAAC,IAAI,CAAC,IAAA,iBAAS,EAAC,SAAS,CAAC,kBAAkB,CAAC,CAAC,CAAA;IAEtF,OAAO,CACL,uBAAC,qBAAqB,aAAC,cAAc,EAAE,cAAc,IAAM,IAAI,cAC5D,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,4BAA4B,IAChD,CACzB,CAAA;AACH,CAAC,CAAA;AAWD,kBAAe,eAAe,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FC, HTMLAttributes } from 'react';
|
|
2
|
+
import { Condition } from '@ltht-react/types';
|
|
3
|
+
declare const DiagnosisTitle: FC<Props>;
|
|
4
|
+
interface Props extends HTMLAttributes<HTMLDivElement> {
|
|
5
|
+
condition: Condition;
|
|
6
|
+
enteredInError: boolean;
|
|
7
|
+
}
|
|
8
|
+
export default DiagnosisTitle;
|
|
@@ -0,0 +1,55 @@
|
|
|
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 StyledConditionTitle = styled_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n color: ", ";\n text-align: left;\n text-decoration: ", ";\n"], ["\n color: ", ";\n text-align: left;\n text-decoration: ", ";\n"])), styles_1.TEXT_COLOURS.PRIMARY, function (_a) {
|
|
37
|
+
var enteredInError = _a.enteredInError;
|
|
38
|
+
return (enteredInError ? 'line-through' : 'none');
|
|
39
|
+
});
|
|
40
|
+
var DiagnosisTitle = function (_a) {
|
|
41
|
+
var condition = _a.condition, enteredInError = _a.enteredInError, rest = __rest(_a, ["condition", "enteredInError"]);
|
|
42
|
+
var codes = [];
|
|
43
|
+
var snippets = [];
|
|
44
|
+
if (condition.code)
|
|
45
|
+
codes.push(condition.code);
|
|
46
|
+
snippets.push((0, utils_1.codeableConceptTextSummary)(codes));
|
|
47
|
+
if (condition.clinicalStatus)
|
|
48
|
+
snippets.push((0, utils_1.titleCase)(condition.clinicalStatus));
|
|
49
|
+
if (condition.verificationStatus)
|
|
50
|
+
snippets.push((0, utils_1.titleCase)(condition.verificationStatus));
|
|
51
|
+
return ((0, jsx_runtime_1.jsx)(StyledConditionTitle, __assign({ enteredInError: enteredInError }, rest, { children: snippets.length > 0 ? snippets.join(', ') : 'Insufficient data provided' })));
|
|
52
|
+
};
|
|
53
|
+
exports.default = DiagnosisTitle;
|
|
54
|
+
var templateObject_1;
|
|
55
|
+
//# sourceMappingURL=diagnosis-title.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diagnosis-title.js","sourceRoot":"","sources":["../../src/atoms/diagnosis-title.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,2DAAoC;AAEpC,6CAAiD;AAEjD,2CAAyE;AAEzE,IAAM,oBAAoB,GAAG,gBAAM,CAAC,GAAG,sIAAoB,aAChD,EAAoB,6CAEV,EAAkE,KACtF,KAHU,qBAAY,CAAC,OAAO,EAEV,UAAC,EAAkB;QAAhB,cAAc,oBAAA;IAAO,OAAA,CAAC,cAAc,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC;AAA1C,CAA0C,CACtF,CAAA;AAED,IAAM,cAAc,GAAc,UAAC,EAAsC;IAApC,IAAA,SAAS,eAAA,EAAE,cAAc,oBAAA,EAAK,IAAI,cAApC,+BAAsC,CAAF;IACrE,IAAM,KAAK,GAAG,EAAE,CAAA;IAChB,IAAM,QAAQ,GAAG,EAAE,CAAA;IAEnB,IAAI,SAAS,CAAC,IAAI;QAAE,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAA;IAC9C,QAAQ,CAAC,IAAI,CAAC,IAAA,kCAA0B,EAAC,KAAK,CAAC,CAAC,CAAA;IAChD,IAAI,SAAS,CAAC,cAAc;QAAE,QAAQ,CAAC,IAAI,CAAC,IAAA,iBAAS,EAAC,SAAS,CAAC,cAAc,CAAC,CAAC,CAAA;IAChF,IAAI,SAAS,CAAC,kBAAkB;QAAE,QAAQ,CAAC,IAAI,CAAC,IAAA,iBAAS,EAAC,SAAS,CAAC,kBAAkB,CAAC,CAAC,CAAA;IAExF,OAAO,CACL,uBAAC,oBAAoB,aAAC,cAAc,EAAE,cAAc,IAAM,IAAI,cAC3D,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,4BAA4B,IACpD,CACxB,CAAA;AACH,CAAC,CAAA;AAWD,kBAAe,cAAc,CAAA"}
|
package/lib/index.d.ts
ADDED
package/lib/index.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
var diagnosis_summary_1 = __importDefault(require("./organisms/diagnosis-summary"));
|
|
7
|
+
exports.default = diagnosis_summary_1.default;
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":";;;;;AAAA,oFAA4D;AAE5D,kBAAe,2BAAgB,CAAA"}
|
|
@@ -0,0 +1,22 @@
|
|
|
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 __importDefault = (this && this.__importDefault) || function (mod) {
|
|
7
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8
|
+
};
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
11
|
+
var styled_1 = __importDefault(require("@emotion/styled"));
|
|
12
|
+
var type_summary_1 = require("@ltht-react/type-summary");
|
|
13
|
+
var StyledRedactedDescription = styled_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n flex-grow: 1;\n text-align: left;\n"], ["\n flex-grow: 1;\n text-align: left;\n"])));
|
|
14
|
+
var StyledDateSummary = styled_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n text-align: right;\n"], ["\n text-align: right;\n"])));
|
|
15
|
+
var DiagnosisRedacted = function (_a) {
|
|
16
|
+
var _b;
|
|
17
|
+
var condition = _a.condition;
|
|
18
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(StyledRedactedDescription, { children: (0, jsx_runtime_1.jsx)(type_summary_1.RedactedDescription, {}) }), (0, jsx_runtime_1.jsx)(StyledDateSummary, { children: (0, jsx_runtime_1.jsx)(type_summary_1.DateSummary, { datetime: (_b = condition === null || condition === void 0 ? void 0 : condition.onset) === null || _b === void 0 ? void 0 : _b.dateTime }) })] }));
|
|
19
|
+
};
|
|
20
|
+
exports.default = DiagnosisRedacted;
|
|
21
|
+
var templateObject_1, templateObject_2;
|
|
22
|
+
//# sourceMappingURL=diagnosis-redacted.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diagnosis-redacted.js","sourceRoot":"","sources":["../../src/molecules/diagnosis-redacted.tsx"],"names":[],"mappings":";;;;;;;;;;AACA,2DAAoC;AAGpC,yDAA2E;AAE3E,IAAM,yBAAyB,GAAG,gBAAM,CAAC,GAAG,6GAAA,0CAG3C,IAAA,CAAA;AAED,IAAM,iBAAiB,GAAG,gBAAM,CAAC,GAAG,6FAAA,0BAEnC,IAAA,CAAA;AAED,IAAM,iBAAiB,GAAc,UAAC,EAAa;;QAAX,SAAS,eAAA;IAAO,OAAA,CACtD,6DACE,uBAAC,yBAAyB,cACxB,uBAAC,kCAAmB,KAAG,GACG,EAC5B,uBAAC,iBAAiB,cAChB,uBAAC,0BAAW,IAAC,QAAQ,EAAE,MAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,KAAK,0CAAE,QAAQ,GAAI,GACnC,IACnB,CACJ,CAAA;CAAA,CAAA;AAMD,kBAAe,iBAAiB,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FC, HTMLAttributes } from 'react';
|
|
2
|
+
import { Condition } from '@ltht-react/types';
|
|
3
|
+
import { ButtonProps } from '@ltht-react/button';
|
|
4
|
+
declare const DiagnosisSummary: FC<Props>;
|
|
5
|
+
interface Props extends HTMLAttributes<HTMLDivElement> {
|
|
6
|
+
condition: Condition;
|
|
7
|
+
extendedTemplateDisplayName?: string | undefined;
|
|
8
|
+
extensionTemplateDisplayName?: string | undefined;
|
|
9
|
+
extensionClickHandler?(): void;
|
|
10
|
+
isReadOnly?: boolean;
|
|
11
|
+
dateOnlyView?: boolean;
|
|
12
|
+
controls?: ButtonProps[];
|
|
13
|
+
}
|
|
14
|
+
export default DiagnosisSummary;
|
|
@@ -0,0 +1,62 @@
|
|
|
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 types_1 = require("@ltht-react/types");
|
|
35
|
+
var type_summary_1 = require("@ltht-react/type-summary");
|
|
36
|
+
var icon_1 = __importDefault(require("@ltht-react/icon"));
|
|
37
|
+
var button_1 = require("@ltht-react/button");
|
|
38
|
+
var styles_1 = require("@ltht-react/styles");
|
|
39
|
+
var diagnosis_category_1 = __importDefault(require("../atoms/diagnosis-category"));
|
|
40
|
+
var diagnosis_title_1 = __importDefault(require("../atoms/diagnosis-title"));
|
|
41
|
+
var diagnosis_onset_estimated_1 = __importDefault(require("../atoms/diagnosis-onset-estimated"));
|
|
42
|
+
var diagnosis_redacted_1 = __importDefault(require("../molecules/diagnosis-redacted"));
|
|
43
|
+
var StyledTitle = styled_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: inline-block;\n"], ["\n display: inline-block;\n"])));
|
|
44
|
+
var StyledSummary = styled_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n justify-content: center;\n"], ["\n display: flex;\n justify-content: center;\n"])));
|
|
45
|
+
var StyledDescription = styled_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n flex-grow: 1;\n"], ["\n flex-grow: 1;\n"])));
|
|
46
|
+
var StyledLeftContainer = styled_1.default.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: flex;\n flex-grow: 1;\n flex-direction: row;\n\n ", " {\n flex-direction: column;\n }\n"], ["\n display: flex;\n flex-grow: 1;\n flex-direction: row;\n\n ", " {\n flex-direction: column;\n }\n"])), styles_1.MOBILE_MAXIMUM_MEDIA_QUERY);
|
|
47
|
+
var StyledControlsContainer = styled_1.default.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n display: flex;\n margin: auto 10px auto 10px;\n flex-direction: column;\n\n ", " {\n margin: 10px 0 0 0;\n flex-flow: row wrap;\n }\n\n ", " {\n margin: 10px 5px 0 0;\n flex-direction: column;\n }\n"], ["\n display: flex;\n margin: auto 10px auto 10px;\n flex-direction: column;\n\n ", " {\n margin: 10px 0 0 0;\n flex-flow: row wrap;\n }\n\n ", " {\n margin: 10px 5px 0 0;\n flex-direction: column;\n }\n"])), styles_1.MOBILE_MAXIMUM_MEDIA_QUERY, styles_1.SMALL_SCREEN_MAXIMUM_MEDIA_QUERY);
|
|
48
|
+
var StyledButton = (0, styled_1.default)(button_1.Button)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n margin: 2px 0 2px 0;\n font-size: 0.8em !important;\n padding: 1px 5px;\n\n ", " {\n margin: 2px 5px 2px 0;\n width: fit-content;\n }\n\n ", " {\n margin: 2px 0 2px 0;\n width: 100%;\n max-width: 200px;\n }\n"], ["\n margin: 2px 0 2px 0;\n font-size: 0.8em !important;\n padding: 1px 5px;\n\n ", " {\n margin: 2px 5px 2px 0;\n width: fit-content;\n }\n\n ", " {\n margin: 2px 0 2px 0;\n width: 100%;\n max-width: 200px;\n }\n"])), styles_1.MOBILE_MAXIMUM_MEDIA_QUERY, styles_1.SMALL_SCREEN_MAXIMUM_MEDIA_QUERY);
|
|
49
|
+
var StyledDate = styled_1.default.div(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n text-align: left;\n width: 15%;\n"], ["\n text-align: left;\n width: 15%;\n"])));
|
|
50
|
+
var IconButtonWrapper = (0, styled_1.default)(button_1.Button)(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n -webkit-box-align: center;\n align-items: center;\n -webkit-box-pack: center;\n justify-content: center;\n margin-right: 0.5rem;\n display: inline-block !important;\n margin-left: 0.5rem;\n width: auto;\n"], ["\n -webkit-box-align: center;\n align-items: center;\n -webkit-box-pack: center;\n justify-content: center;\n margin-right: 0.5rem;\n display: inline-block !important;\n margin-left: 0.5rem;\n width: auto;\n"])));
|
|
51
|
+
var IconWrapper = styled_1.default.div(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n margin-left: 0.5rem;\n display: inline-block;\n"], ["\n margin-left: 0.5rem;\n display: inline-block;\n"])));
|
|
52
|
+
var DiagnosisSummary = function (_a) {
|
|
53
|
+
var condition = _a.condition, extendedTemplateDisplayName = _a.extendedTemplateDisplayName, extensionTemplateDisplayName = _a.extensionTemplateDisplayName, extensionClickHandler = _a.extensionClickHandler, _b = _a.isReadOnly, isReadOnly = _b === void 0 ? false : _b, _c = _a.dateOnlyView, dateOnlyView = _c === void 0 ? false : _c, _d = _a.controls, controls = _d === void 0 ? [] : _d, rest = __rest(_a, ["condition", "extendedTemplateDisplayName", "extensionTemplateDisplayName", "extensionClickHandler", "isReadOnly", "dateOnlyView", "controls"]);
|
|
54
|
+
if (condition.metadata.isRedacted) {
|
|
55
|
+
return ((0, jsx_runtime_1.jsx)(StyledSummary, __assign({}, rest, { children: (0, jsx_runtime_1.jsx)(diagnosis_redacted_1.default, { condition: condition }) })));
|
|
56
|
+
}
|
|
57
|
+
var enteredInError = condition.verificationStatus === types_1.ConditionVerificationStatus.EnteredInError;
|
|
58
|
+
return ((0, jsx_runtime_1.jsxs)(StyledSummary, __assign({}, rest, { children: [(0, jsx_runtime_1.jsxs)(StyledLeftContainer, { children: [(0, jsx_runtime_1.jsxs)(StyledDescription, { children: [(0, jsx_runtime_1.jsx)(StyledTitle, { children: (0, jsx_runtime_1.jsx)(diagnosis_title_1.default, { enteredInError: enteredInError, condition: condition }) }), extensionTemplateDisplayName && !isReadOnly && !enteredInError && ((0, jsx_runtime_1.jsx)(IconButtonWrapper, { onClick: extensionClickHandler, type: "button", styling: { buttonStyle: 'clear' }, value: "", icon: (0, jsx_runtime_1.jsx)(icon_1.default, { type: "folder-plus", size: "medium" }), iconPlacement: "center", iconColour: styles_1.BTN_COLOURS.PRIMARY.VALUE, title: "This diagnosis can be extended further using form '".concat(extensionTemplateDisplayName, "' by clicking here") })), extendedTemplateDisplayName && ((0, jsx_runtime_1.jsx)(IconWrapper, { children: (0, jsx_runtime_1.jsx)(icon_1.default, { type: "comment", size: "medium", title: "This diagnosis has been extended beyond standard diagnosis with form '".concat(extendedTemplateDisplayName, "'.\n To view these extra details, click into the full diagnosis detail or edit the existing form.") }) })), (0, jsx_runtime_1.jsx)(diagnosis_category_1.default, { enteredInError: enteredInError, condition: condition })] }), !isReadOnly && controls.length > 0 && ((0, jsx_runtime_1.jsx)(StyledControlsContainer, { children: controls.map(function (props, index) { return ((0, jsx_runtime_1.jsx)(StyledButton, __assign({}, props), index)); }) }))] }), (0, jsx_runtime_1.jsxs)(StyledDate, { children: [(0, jsx_runtime_1.jsx)(type_summary_1.DateSummary, { enteredInError: enteredInError, datetime: condition === null || condition === void 0 ? void 0 : condition.assertedDate, dateOnlyView: dateOnlyView }), (0, jsx_runtime_1.jsx)(diagnosis_onset_estimated_1.default, { enteredInError: enteredInError, condition: condition })] })] })));
|
|
59
|
+
};
|
|
60
|
+
exports.default = DiagnosisSummary;
|
|
61
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9;
|
|
62
|
+
//# sourceMappingURL=diagnosis-summary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diagnosis-summary.js","sourceRoot":"","sources":["../../src/organisms/diagnosis-summary.tsx"],"names":[],"mappings":"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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ltht-react/diagnosis-summary",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.64",
|
|
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.
|
|
32
|
-
"@ltht-react/hooks": "^2.0.
|
|
33
|
-
"@ltht-react/icon": "^2.0.
|
|
34
|
-
"@ltht-react/list": "^2.0.
|
|
35
|
-
"@ltht-react/styles": "^2.0.
|
|
36
|
-
"@ltht-react/type-summary": "^2.0.
|
|
37
|
-
"@ltht-react/types": "^2.0.
|
|
38
|
-
"@ltht-react/utils": "^2.0.
|
|
31
|
+
"@ltht-react/button": "^2.0.64",
|
|
32
|
+
"@ltht-react/hooks": "^2.0.64",
|
|
33
|
+
"@ltht-react/icon": "^2.0.64",
|
|
34
|
+
"@ltht-react/list": "^2.0.64",
|
|
35
|
+
"@ltht-react/styles": "^2.0.64",
|
|
36
|
+
"@ltht-react/type-summary": "^2.0.64",
|
|
37
|
+
"@ltht-react/types": "^2.0.64",
|
|
38
|
+
"@ltht-react/utils": "^2.0.64",
|
|
39
39
|
"react": "^18.2.0"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "0cba014a75df54769f93f6dfa1a2c69a77296a4a"
|
|
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,35 +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
|
-
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
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
enteredInError: boolean
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
|
|
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, titleCase } 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
|
+
if (condition.clinicalStatus) snippets.push(titleCase(condition.clinicalStatus))
|
|
21
|
+
if (condition.verificationStatus) snippets.push(titleCase(condition.verificationStatus))
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<StyledConditionTitle enteredInError={enteredInError} {...rest}>
|
|
25
|
+
{snippets.length > 0 ? snippets.join(', ') : 'Insufficient data provided'}
|
|
26
|
+
</StyledConditionTitle>
|
|
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 DiagnosisTitle
|
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
|
|
@@ -1,165 +1,163 @@
|
|
|
1
|
-
import { FC, HTMLAttributes } 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, MOBILE_MAXIMUM_MEDIA_QUERY, SMALL_SCREEN_MAXIMUM_MEDIA_QUERY } from '@ltht-react/styles'
|
|
10
|
-
import Category from '../atoms/diagnosis-category'
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
`
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
`
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
`
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
flex-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
`
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
`
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
width:
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
`
|
|
71
|
-
|
|
72
|
-
-
|
|
73
|
-
|
|
74
|
-
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
`
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
<
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
export default DiagnosisSummary
|
|
1
|
+
import { FC, HTMLAttributes } 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, MOBILE_MAXIMUM_MEDIA_QUERY, SMALL_SCREEN_MAXIMUM_MEDIA_QUERY } from '@ltht-react/styles'
|
|
10
|
+
import Category from '../atoms/diagnosis-category'
|
|
11
|
+
import Title from '../atoms/diagnosis-title'
|
|
12
|
+
import OnsetDateEstimated from '../atoms/diagnosis-onset-estimated'
|
|
13
|
+
import Redacted from '../molecules/diagnosis-redacted'
|
|
14
|
+
|
|
15
|
+
const StyledTitle = styled.div`
|
|
16
|
+
display: inline-block;
|
|
17
|
+
`
|
|
18
|
+
const StyledSummary = styled.div`
|
|
19
|
+
display: flex;
|
|
20
|
+
justify-content: center;
|
|
21
|
+
`
|
|
22
|
+
const StyledDescription = styled.div`
|
|
23
|
+
flex-grow: 1;
|
|
24
|
+
`
|
|
25
|
+
const StyledLeftContainer = styled.div`
|
|
26
|
+
display: flex;
|
|
27
|
+
flex-grow: 1;
|
|
28
|
+
flex-direction: row;
|
|
29
|
+
|
|
30
|
+
${MOBILE_MAXIMUM_MEDIA_QUERY} {
|
|
31
|
+
flex-direction: column;
|
|
32
|
+
}
|
|
33
|
+
`
|
|
34
|
+
const StyledControlsContainer = styled.div`
|
|
35
|
+
display: flex;
|
|
36
|
+
margin: auto 10px auto 10px;
|
|
37
|
+
flex-direction: column;
|
|
38
|
+
|
|
39
|
+
${MOBILE_MAXIMUM_MEDIA_QUERY} {
|
|
40
|
+
margin: 10px 0 0 0;
|
|
41
|
+
flex-flow: row wrap;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
${SMALL_SCREEN_MAXIMUM_MEDIA_QUERY} {
|
|
45
|
+
margin: 10px 5px 0 0;
|
|
46
|
+
flex-direction: column;
|
|
47
|
+
}
|
|
48
|
+
`
|
|
49
|
+
const StyledButton = styled(Button)`
|
|
50
|
+
margin: 2px 0 2px 0;
|
|
51
|
+
font-size: 0.8em !important;
|
|
52
|
+
padding: 1px 5px;
|
|
53
|
+
|
|
54
|
+
${MOBILE_MAXIMUM_MEDIA_QUERY} {
|
|
55
|
+
margin: 2px 5px 2px 0;
|
|
56
|
+
width: fit-content;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
${SMALL_SCREEN_MAXIMUM_MEDIA_QUERY} {
|
|
60
|
+
margin: 2px 0 2px 0;
|
|
61
|
+
width: 100%;
|
|
62
|
+
max-width: 200px;
|
|
63
|
+
}
|
|
64
|
+
`
|
|
65
|
+
|
|
66
|
+
const StyledDate = styled.div`
|
|
67
|
+
text-align: left;
|
|
68
|
+
width: 15%;
|
|
69
|
+
`
|
|
70
|
+
const IconButtonWrapper = styled(Button)`
|
|
71
|
+
-webkit-box-align: center;
|
|
72
|
+
align-items: center;
|
|
73
|
+
-webkit-box-pack: center;
|
|
74
|
+
justify-content: center;
|
|
75
|
+
margin-right: 0.5rem;
|
|
76
|
+
display: inline-block !important;
|
|
77
|
+
margin-left: 0.5rem;
|
|
78
|
+
width: auto;
|
|
79
|
+
`
|
|
80
|
+
const IconWrapper = styled.div`
|
|
81
|
+
margin-left: 0.5rem;
|
|
82
|
+
display: inline-block;
|
|
83
|
+
`
|
|
84
|
+
|
|
85
|
+
const DiagnosisSummary: FC<Props> = ({
|
|
86
|
+
condition,
|
|
87
|
+
extendedTemplateDisplayName,
|
|
88
|
+
extensionTemplateDisplayName,
|
|
89
|
+
extensionClickHandler,
|
|
90
|
+
isReadOnly = false,
|
|
91
|
+
dateOnlyView = false,
|
|
92
|
+
controls = [],
|
|
93
|
+
...rest
|
|
94
|
+
}) => {
|
|
95
|
+
if (condition.metadata.isRedacted) {
|
|
96
|
+
return (
|
|
97
|
+
<StyledSummary {...rest}>
|
|
98
|
+
<Redacted condition={condition} />
|
|
99
|
+
</StyledSummary>
|
|
100
|
+
)
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
const enteredInError = condition.verificationStatus === ConditionVerificationStatus.EnteredInError
|
|
104
|
+
|
|
105
|
+
return (
|
|
106
|
+
<StyledSummary {...rest}>
|
|
107
|
+
<StyledLeftContainer>
|
|
108
|
+
<StyledDescription>
|
|
109
|
+
<StyledTitle>
|
|
110
|
+
<Title enteredInError={enteredInError} condition={condition} />
|
|
111
|
+
</StyledTitle>
|
|
112
|
+
{extensionTemplateDisplayName && !isReadOnly && !enteredInError && (
|
|
113
|
+
<IconButtonWrapper
|
|
114
|
+
onClick={extensionClickHandler}
|
|
115
|
+
type="button"
|
|
116
|
+
styling={{ buttonStyle: 'clear' }}
|
|
117
|
+
value=""
|
|
118
|
+
icon={<Icon type="folder-plus" size="medium" />}
|
|
119
|
+
iconPlacement="center"
|
|
120
|
+
iconColour={BTN_COLOURS.PRIMARY.VALUE}
|
|
121
|
+
title={`This diagnosis can be extended further using form '${extensionTemplateDisplayName}' by clicking here`}
|
|
122
|
+
/>
|
|
123
|
+
)}
|
|
124
|
+
{extendedTemplateDisplayName && (
|
|
125
|
+
<IconWrapper>
|
|
126
|
+
<Icon
|
|
127
|
+
type="comment"
|
|
128
|
+
size="medium"
|
|
129
|
+
title={`This diagnosis has been extended beyond standard diagnosis with form '${extendedTemplateDisplayName}'.
|
|
130
|
+
To view these extra details, click into the full diagnosis detail or edit the existing form.`}
|
|
131
|
+
/>
|
|
132
|
+
</IconWrapper>
|
|
133
|
+
)}
|
|
134
|
+
<Category enteredInError={enteredInError} condition={condition} />
|
|
135
|
+
</StyledDescription>
|
|
136
|
+
|
|
137
|
+
{!isReadOnly && controls.length > 0 && (
|
|
138
|
+
<StyledControlsContainer>
|
|
139
|
+
{controls.map((props, index) => (
|
|
140
|
+
<StyledButton key={index} {...props} />
|
|
141
|
+
))}
|
|
142
|
+
</StyledControlsContainer>
|
|
143
|
+
)}
|
|
144
|
+
</StyledLeftContainer>
|
|
145
|
+
<StyledDate>
|
|
146
|
+
<DateSummary enteredInError={enteredInError} datetime={condition?.assertedDate} dateOnlyView={dateOnlyView} />
|
|
147
|
+
<OnsetDateEstimated enteredInError={enteredInError} condition={condition} />
|
|
148
|
+
</StyledDate>
|
|
149
|
+
</StyledSummary>
|
|
150
|
+
)
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
interface Props extends HTMLAttributes<HTMLDivElement> {
|
|
154
|
+
condition: Condition
|
|
155
|
+
extendedTemplateDisplayName?: string | undefined
|
|
156
|
+
extensionTemplateDisplayName?: string | undefined
|
|
157
|
+
extensionClickHandler?(): void
|
|
158
|
+
isReadOnly?: boolean
|
|
159
|
+
dateOnlyView?: boolean
|
|
160
|
+
controls?: ButtonProps[]
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export default DiagnosisSummary
|