@ltht-react/diagnosis-summary 2.0.157 → 2.0.159
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/lib/atoms/diagnosis-title.d.ts +1 -0
- package/lib/atoms/diagnosis-title.js +5 -4
- package/lib/atoms/diagnosis-title.js.map +1 -1
- package/lib/organisms/diagnosis-summary.d.ts +3 -2
- package/lib/organisms/diagnosis-summary.js +2 -2
- package/lib/organisms/diagnosis-summary.js.map +1 -1
- package/package.json +11 -10
- package/src/atoms/diagnosis-title.tsx +7 -5
- package/src/organisms/diagnosis-summary.tsx +5 -2
|
@@ -10,6 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
10
10
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
11
11
|
var styled_1 = __importDefault(require("@emotion/styled"));
|
|
12
12
|
var utils_1 = require("@ltht-react/utils");
|
|
13
|
+
var html_react_parser_1 = __importDefault(require("html-react-parser"));
|
|
13
14
|
var styles_1 = require("@ltht-react/styles");
|
|
14
15
|
var constants_1 = require("../constants");
|
|
15
16
|
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) {
|
|
@@ -17,15 +18,15 @@ var StyledConditionTitle = styled_1.default.div(templateObject_1 || (templateObj
|
|
|
17
18
|
return (enteredInError ? 'line-through' : 'none');
|
|
18
19
|
});
|
|
19
20
|
var DiagnosisTitle = function (_a) {
|
|
20
|
-
var condition = _a.condition, enteredInError = _a.enteredInError, systemExclusionsFilter = _a.systemExclusionsFilter;
|
|
21
|
+
var condition = _a.condition, enteredInError = _a.enteredInError, systemExclusionsFilter = _a.systemExclusionsFilter, _b = _a.isRichText, isRichText = _b === void 0 ? false : _b;
|
|
21
22
|
var snippetTagText = extractSnippetTagDisplayValue(condition);
|
|
22
23
|
if (snippetTagText) {
|
|
23
|
-
return renderTitle(snippetTagText, enteredInError);
|
|
24
|
+
return renderTitle(snippetTagText, enteredInError, isRichText);
|
|
24
25
|
}
|
|
25
26
|
var conditionText = extractConditionOrFallbackText(condition, systemExclusionsFilter);
|
|
26
27
|
var conditionStatusText = extractConditionStatusText(condition);
|
|
27
28
|
var title = conditionStatusText ? "".concat(conditionText, ", ").concat(conditionStatusText) : conditionText;
|
|
28
|
-
return renderTitle(title, enteredInError);
|
|
29
|
+
return renderTitle(title, enteredInError, isRichText);
|
|
29
30
|
};
|
|
30
31
|
var extractConditionOrFallbackText = function (condition, systemExclusionsFilter) {
|
|
31
32
|
if (!(condition === null || condition === void 0 ? void 0 : condition.code)) {
|
|
@@ -45,7 +46,7 @@ var extractConditionStatusText = function (condition) {
|
|
|
45
46
|
return (0, utils_1.titleCase)(statusParts.join(', '));
|
|
46
47
|
};
|
|
47
48
|
var extractSnippetTagDisplayValue = function (condition) { var _a, _b; return (_b = (_a = condition === null || condition === void 0 ? void 0 : condition.metadata.tag) === null || _a === void 0 ? void 0 : _a.find(function (coding) { return (coding === null || coding === void 0 ? void 0 : coding.system) === constants_1.SNIPPET_HOVER_TEXT; })) === null || _b === void 0 ? void 0 : _b.display; };
|
|
48
|
-
var renderTitle = function (title, enteredInError) { return ((0, jsx_runtime_1.jsx)(StyledConditionTitle, { enteredInError: enteredInError, children: title })); };
|
|
49
|
+
var renderTitle = function (title, enteredInError, isRichText) { return ((0, jsx_runtime_1.jsx)(StyledConditionTitle, { enteredInError: enteredInError, children: isRichText ? (0, html_react_parser_1.default)(title) : title })); };
|
|
49
50
|
exports.default = DiagnosisTitle;
|
|
50
51
|
var templateObject_1;
|
|
51
52
|
//# sourceMappingURL=diagnosis-title.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diagnosis-title.js","sourceRoot":"","sources":["../../src/atoms/diagnosis-title.tsx"],"names":[],"mappings":";;;;;;;;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,CAErF,CAAA;AAaD,kBAAe,cAAc,CAAA"}
|
|
@@ -4,8 +4,8 @@ import { ButtonProps } from '@ltht-react/button';
|
|
|
4
4
|
declare const DiagnosisSummary: FC<Props>;
|
|
5
5
|
interface Props extends HTMLAttributes<HTMLDivElement> {
|
|
6
6
|
condition: Condition;
|
|
7
|
-
extendedTemplateDisplayName?: string
|
|
8
|
-
extensionTemplateDisplayName?: string
|
|
7
|
+
extendedTemplateDisplayName?: string;
|
|
8
|
+
extensionTemplateDisplayName?: string;
|
|
9
9
|
isReadOnly?: boolean;
|
|
10
10
|
dateOnlyView?: boolean;
|
|
11
11
|
displaySource?: boolean;
|
|
@@ -14,5 +14,6 @@ interface Props extends HTMLAttributes<HTMLDivElement> {
|
|
|
14
14
|
canExtendDiagnosis?: boolean;
|
|
15
15
|
extensionClickHandler?(): void;
|
|
16
16
|
systemExclusionsFilter?: string[];
|
|
17
|
+
isRichText?: boolean;
|
|
17
18
|
}
|
|
18
19
|
export default DiagnosisSummary;
|
|
@@ -53,12 +53,12 @@ var StyledDate = styled_1.default.div(templateObject_9 || (templateObject_9 = __
|
|
|
53
53
|
var IconButtonWrapper = (0, styled_1.default)(button_1.Button)(templateObject_10 || (templateObject_10 = __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 padding: 0 5px;\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 padding: 0 5px;\n"])));
|
|
54
54
|
var IconWrapper = styled_1.default.div(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n margin-left: 0.5rem;\n display: inline-block;\n"], ["\n margin-left: 0.5rem;\n display: inline-block;\n"])));
|
|
55
55
|
var DiagnosisSummary = function (_a) {
|
|
56
|
-
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.canExtendDiagnosis, canExtendDiagnosis = _d === void 0 ? false : _d, _e = _a.displaySource, displaySource = _e === void 0 ? false : _e, _f = _a.controls, controls = _f === void 0 ? [] : _f, _g = _a.tags, tags = _g === void 0 ? [] : _g, _h = _a.systemExclusionsFilter, systemExclusionsFilter = _h === void 0 ? [] : _h, rest = __rest(_a, ["condition", "extendedTemplateDisplayName", "extensionTemplateDisplayName", "extensionClickHandler", "isReadOnly", "dateOnlyView", "canExtendDiagnosis", "displaySource", "controls", "tags", "systemExclusionsFilter"]);
|
|
56
|
+
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.canExtendDiagnosis, canExtendDiagnosis = _d === void 0 ? false : _d, _e = _a.displaySource, displaySource = _e === void 0 ? false : _e, _f = _a.controls, controls = _f === void 0 ? [] : _f, _g = _a.tags, tags = _g === void 0 ? [] : _g, _h = _a.systemExclusionsFilter, systemExclusionsFilter = _h === void 0 ? [] : _h, _j = _a.isRichText, isRichText = _j === void 0 ? false : _j, rest = __rest(_a, ["condition", "extendedTemplateDisplayName", "extensionTemplateDisplayName", "extensionClickHandler", "isReadOnly", "dateOnlyView", "canExtendDiagnosis", "displaySource", "controls", "tags", "systemExclusionsFilter", "isRichText"]);
|
|
57
57
|
if (condition.metadata.isRedacted) {
|
|
58
58
|
return ((0, jsx_runtime_1.jsx)(StyledSummary, __assign({}, rest, { children: (0, jsx_runtime_1.jsx)(diagnosis_redacted_1.default, { condition: condition }) })));
|
|
59
59
|
}
|
|
60
60
|
var enteredInError = condition.verificationStatus === types_1.ConditionVerificationStatus.EnteredInError;
|
|
61
|
-
return ((0, jsx_runtime_1.jsxs)(StyledSummary, __assign({}, rest, { children: [(0, jsx_runtime_1.jsxs)(StyledTitleAndDateContainer, { children: [(0, jsx_runtime_1.jsxs)(StyledDescription, { children: [(0, jsx_runtime_1.jsxs)(StyledTitle, { children: [(0, jsx_runtime_1.jsx)(diagnosis_title_1.default, { enteredInError: enteredInError, condition: condition, systemExclusionsFilter: systemExclusionsFilter }), extensionTemplateDisplayName && !isReadOnly && canExtendDiagnosis && !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.") }) }))] }), displaySource && (0, jsx_runtime_1.jsx)(diagnosis_data_source_1.default, { condition: condition, enteredInError: enteredInError })] }), (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 })] })] }), !isReadOnly && (controls.length > 0 || tags.length > 0) && ((0, jsx_runtime_1.jsxs)(StyledButtonAndTagContainer, { children: [(0, jsx_runtime_1.jsx)(StyledResponsiveButtonContainer, { children: controls.map(function (props, index) { return ((0, jsx_runtime_1.jsx)(StyledButton, __assign({}, props), index)); }) }), (0, jsx_runtime_1.jsx)(StyledResponsiveTagContainer, { children: tags === null || tags === void 0 ? void 0 : tags.map(function (tag, index) { return (tag.key ? tag : (0, react_1.cloneElement)(tag, { key: index })); }) })] }))] })));
|
|
61
|
+
return ((0, jsx_runtime_1.jsxs)(StyledSummary, __assign({}, rest, { children: [(0, jsx_runtime_1.jsxs)(StyledTitleAndDateContainer, { children: [(0, jsx_runtime_1.jsxs)(StyledDescription, { children: [(0, jsx_runtime_1.jsxs)(StyledTitle, { children: [(0, jsx_runtime_1.jsx)(diagnosis_title_1.default, { enteredInError: enteredInError, condition: condition, systemExclusionsFilter: systemExclusionsFilter, isRichText: isRichText }), extensionTemplateDisplayName && !isReadOnly && canExtendDiagnosis && !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.") }) }))] }), displaySource && (0, jsx_runtime_1.jsx)(diagnosis_data_source_1.default, { condition: condition, enteredInError: enteredInError })] }), (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 })] })] }), !isReadOnly && (controls.length > 0 || tags.length > 0) && ((0, jsx_runtime_1.jsxs)(StyledButtonAndTagContainer, { children: [(0, jsx_runtime_1.jsx)(StyledResponsiveButtonContainer, { children: controls.map(function (props, index) { return ((0, jsx_runtime_1.jsx)(StyledButton, __assign({}, props), index)); }) }), (0, jsx_runtime_1.jsx)(StyledResponsiveTagContainer, { children: tags === null || tags === void 0 ? void 0 : tags.map(function (tag, index) { return (tag.key ? tag : (0, react_1.cloneElement)(tag, { key: index })); }) })] }))] })));
|
|
62
62
|
};
|
|
63
63
|
exports.default = DiagnosisSummary;
|
|
64
64
|
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diagnosis-summary.js","sourceRoot":"","sources":["../../src/organisms/diagnosis-summary.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAAsE;AACtE,2DAAoC;AAEpC,2CAA0E;AAC1E,yDAAsD;AACtD,0DAAmC;AACnC,6CAAwD;AAExD,6CAA8G;AAC9G,6EAA4C;AAC5C,iGAAmE;AACnE,uFAAsD;AACtD,yFAAgE;AAEhE,IAAM,WAAW,GAAG,gBAAM,CAAC,GAAG,yFAAA,sBAE7B,IAAA,CAAA;AAED,IAAM,aAAa,GAAG,gBAAM,CAAC,GAAG,gJAAA,6EAI/B,IAAA,CAAA;AAED,IAAM,iBAAiB,GAAG,gBAAM,CAAC,GAAG,wFAAA,qBAEnC,IAAA,CAAA;AAED,IAAM,2BAA2B,GAAG,gBAAM,CAAC,GAAG,wQAAA,gFAM1C,EAAgC,mHAOnC,KAPG,yCAAgC,CAOnC,CAAA;AAED,IAAM,2BAA2B,GAAG,gBAAM,CAAC,GAAG,mPAAA,oGAO1C,EAAgC,0EAInC,KAJG,yCAAgC,CAInC,CAAA;AAED,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AAW,IAAC,cAAc,EAAE,cAAc,EAAE,QAAQ,EAAE,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,YAAY,EAAE,YAAY,EAAE,YAAY,GAAI,EAC9G,uBAAC,mCAAkB,IAAC,cAAc,EAAE,cAAc,EAAE,SAAS,EAAE,SAAS,GAAI,IACjE,IACe,EAE7B,CAAC,UAAU,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,CAC1D,wBAAC,2BAA2B,eAC1B,uBAAC,+BAA+B,cAC7B,QAAQ,CAAC,GAAG,CAAC,UAAC,KAAK,EAAE,KAAK,IAAK,OAAA,CAC9B,uBAAC,YAAY,eAAiB,KAAK,GAAhB,KAAK,CAAe,CACxC,EAF+B,CAE/B,CAAC,GAC8B,EAElC,uBAAC,4BAA4B,cAC1B,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,GAAG,CAAC,UAAC,GAAG,EAAE,KAAK,IAAK,OAAA,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAA,oBAAY,EAAC,GAAG,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,CAAC,EAAnD,CAAmD,CAAC,GAClD,IACH,CAC/B,KACa,CACjB,CAAA;AACH,CAAC,CAAA;AAiBD,kBAAe,gBAAgB,CAAA"}
|
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.159",
|
|
4
4
|
"description": "ltht-react clinical DiagnosisSummary component.",
|
|
5
5
|
"author": "LTHT",
|
|
6
6
|
"homepage": "",
|
|
@@ -28,15 +28,16 @@
|
|
|
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.159",
|
|
32
|
+
"@ltht-react/hooks": "^2.0.159",
|
|
33
|
+
"@ltht-react/icon": "^2.0.159",
|
|
34
|
+
"@ltht-react/list": "^2.0.159",
|
|
35
|
+
"@ltht-react/styles": "^2.0.159",
|
|
36
|
+
"@ltht-react/type-summary": "^2.0.159",
|
|
37
|
+
"@ltht-react/types": "^2.0.159",
|
|
38
|
+
"@ltht-react/utils": "^2.0.159",
|
|
39
|
+
"html-react-parser": "^5.0.6",
|
|
39
40
|
"react": "^18.2.0"
|
|
40
41
|
},
|
|
41
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "4a697c254ecf73e4c69eaae4116e59d27c1558ff"
|
|
42
43
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { FC, HTMLAttributes } from 'react'
|
|
2
2
|
import styled from '@emotion/styled'
|
|
3
3
|
import { titleCase, codeableConceptDisplaySummary } from '@ltht-react/utils'
|
|
4
|
+
import parseHtml from 'html-react-parser'
|
|
4
5
|
|
|
5
6
|
import { TEXT_COLOURS } from '@ltht-react/styles'
|
|
6
7
|
import { Condition } from '@ltht-react/types'
|
|
@@ -12,18 +13,18 @@ const StyledConditionTitle = styled.div<IStyledDescription>`
|
|
|
12
13
|
text-decoration: ${({ enteredInError }) => (enteredInError ? 'line-through' : 'none')};
|
|
13
14
|
`
|
|
14
15
|
|
|
15
|
-
const DiagnosisTitle: FC<Props> = ({ condition, enteredInError, systemExclusionsFilter }) => {
|
|
16
|
+
const DiagnosisTitle: FC<Props> = ({ condition, enteredInError, systemExclusionsFilter, isRichText = false }) => {
|
|
16
17
|
const snippetTagText = extractSnippetTagDisplayValue(condition)
|
|
17
18
|
|
|
18
19
|
if (snippetTagText) {
|
|
19
|
-
return renderTitle(snippetTagText, enteredInError)
|
|
20
|
+
return renderTitle(snippetTagText, enteredInError, isRichText)
|
|
20
21
|
}
|
|
21
22
|
|
|
22
23
|
const conditionText = extractConditionOrFallbackText(condition, systemExclusionsFilter)
|
|
23
24
|
const conditionStatusText = extractConditionStatusText(condition)
|
|
24
25
|
const title = conditionStatusText ? `${conditionText}, ${conditionStatusText}` : conditionText
|
|
25
26
|
|
|
26
|
-
return renderTitle(title, enteredInError)
|
|
27
|
+
return renderTitle(title, enteredInError, isRichText)
|
|
27
28
|
}
|
|
28
29
|
|
|
29
30
|
const extractConditionOrFallbackText = (condition: Condition, systemExclusionsFilter?: string[]): string => {
|
|
@@ -53,14 +54,15 @@ const extractConditionStatusText = (condition: Condition): string => {
|
|
|
53
54
|
const extractSnippetTagDisplayValue = (condition: Condition) =>
|
|
54
55
|
condition?.metadata.tag?.find((coding) => coding?.system === SNIPPET_HOVER_TEXT)?.display
|
|
55
56
|
|
|
56
|
-
const renderTitle = (title: string, enteredInError: boolean) => (
|
|
57
|
-
<StyledConditionTitle enteredInError={enteredInError}>{title}</StyledConditionTitle>
|
|
57
|
+
const renderTitle = (title: string, enteredInError: boolean, isRichText?: boolean) => (
|
|
58
|
+
<StyledConditionTitle enteredInError={enteredInError}>{isRichText ? parseHtml(title) : title}</StyledConditionTitle>
|
|
58
59
|
)
|
|
59
60
|
|
|
60
61
|
interface Props extends HTMLAttributes<HTMLDivElement> {
|
|
61
62
|
condition: Condition
|
|
62
63
|
enteredInError: boolean
|
|
63
64
|
systemExclusionsFilter?: string[]
|
|
65
|
+
isRichText?: boolean
|
|
64
66
|
}
|
|
65
67
|
|
|
66
68
|
interface IStyledDescription {
|
|
@@ -162,6 +162,7 @@ const DiagnosisSummary: FC<Props> = ({
|
|
|
162
162
|
controls = [],
|
|
163
163
|
tags = [],
|
|
164
164
|
systemExclusionsFilter = [],
|
|
165
|
+
isRichText = false,
|
|
165
166
|
...rest
|
|
166
167
|
}) => {
|
|
167
168
|
if (condition.metadata.isRedacted) {
|
|
@@ -183,6 +184,7 @@ const DiagnosisSummary: FC<Props> = ({
|
|
|
183
184
|
enteredInError={enteredInError}
|
|
184
185
|
condition={condition}
|
|
185
186
|
systemExclusionsFilter={systemExclusionsFilter}
|
|
187
|
+
isRichText={isRichText}
|
|
186
188
|
/>
|
|
187
189
|
{extensionTemplateDisplayName && !isReadOnly && canExtendDiagnosis && !enteredInError && (
|
|
188
190
|
<IconButtonWrapper
|
|
@@ -234,8 +236,8 @@ const DiagnosisSummary: FC<Props> = ({
|
|
|
234
236
|
|
|
235
237
|
interface Props extends HTMLAttributes<HTMLDivElement> {
|
|
236
238
|
condition: Condition
|
|
237
|
-
extendedTemplateDisplayName?: string
|
|
238
|
-
extensionTemplateDisplayName?: string
|
|
239
|
+
extendedTemplateDisplayName?: string
|
|
240
|
+
extensionTemplateDisplayName?: string
|
|
239
241
|
isReadOnly?: boolean
|
|
240
242
|
dateOnlyView?: boolean
|
|
241
243
|
displaySource?: boolean
|
|
@@ -244,6 +246,7 @@ interface Props extends HTMLAttributes<HTMLDivElement> {
|
|
|
244
246
|
canExtendDiagnosis?: boolean
|
|
245
247
|
extensionClickHandler?(): void
|
|
246
248
|
systemExclusionsFilter?: string[]
|
|
249
|
+
isRichText?: boolean
|
|
247
250
|
}
|
|
248
251
|
|
|
249
252
|
export default DiagnosisSummary
|