@ltht-react/diagnosis-summary 2.0.106 → 2.0.108
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-data-source.js +1 -1
- package/lib/atoms/diagnosis-data-source.js.map +1 -1
- package/lib/atoms/diagnosis-title.js +29 -27
- package/lib/atoms/diagnosis-title.js.map +1 -1
- package/package.json +10 -10
- package/src/atoms/diagnosis-data-source.tsx +1 -1
- package/src/atoms/diagnosis-title.tsx +43 -8
|
@@ -49,7 +49,7 @@ var extractDataSourceDisplayNames = function (condition) {
|
|
|
49
49
|
var DiagnosisDataSource = function (_a) {
|
|
50
50
|
var condition = _a.condition, enteredInError = _a.enteredInError, rest = __rest(_a, ["condition", "enteredInError"]);
|
|
51
51
|
var dataSourceDisplayNames = extractDataSourceDisplayNames(condition);
|
|
52
|
-
return ((0, jsx_runtime_1.jsx)(StyledConditionStatus, __assign({ enteredInError: enteredInError }, rest, { children: "Source: ".concat(dataSourceDisplayNames) })));
|
|
52
|
+
return ((0, jsx_runtime_1.jsx)(StyledConditionStatus, __assign({ enteredInError: enteredInError }, rest, { children: dataSourceDisplayNames ? "Source: ".concat(dataSourceDisplayNames) : "Source: Unknown" })));
|
|
53
53
|
};
|
|
54
54
|
exports.default = DiagnosisDataSource;
|
|
55
55
|
var templateObject_1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diagnosis-data-source.js","sourceRoot":"","sources":["../../src/atoms/diagnosis-data-source.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,2DAAoC;AAEpC,6CAAiD;AAGjD,IAAM,qBAAqB,GAAG,gBAAM,CAAC,GAAG,sLAAoB,aACjD,EAA4B,6FAIlB,EAAkE,KACtF,KALU,qBAAY,CAAC,SAAS,CAAC,KAAK,EAIlB,UAAC,EAAkB;QAAhB,cAAc,oBAAA;IAAO,OAAA,CAAC,cAAc,CAAC,CAAC,C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,GAAG,UAAC,SAAoB;;IACzD,IAAM,sBAAsB,GAAa,EAAE,CAAA;IAE3C,MAAA,MAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,QAAQ,0CAAE,WAAW,0CAAE,OAAO,CAAC,UAAC,UAAU,EAAE,CAAC;QACtD,IAAI,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,OAAO,EAAE,CAAC;YACxB,sBAAsB,CAAC,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAA;QACjD,CAAC;IACH,CAAC,CAAC,CAAA;IAEF,OAAO,sBAAsB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AAC1C,CAAC,CAAA;AAED,IAAM,mBAAmB,GAAc,UAAC,EAAsC;IAApC,IAAA,SAAS,eAAA,EAAE,cAAc,oBAAA,EAAK,IAAI,cAApC,+BAAsC,CAAF;IAC1E,IAAM,sBAAsB,GAAG,6BAA6B,CAAC,SAAS,CAAC,CAAA;IAEvE,OAAO,CACL,uBAAC,qBAAqB,aAAC,cAAc,EAAE,cAAc,IAAM,IAAI,cAC5D,sBAAsB,CAAC,CAAC,CAAC,kBAAW,sBAAsB,CAAE,CAAC,CAAC,CAAC,iBAAiB,IAC3D,CACzB,CAAA;AACH,CAAC,CAAA;AAWD,kBAAe,mBAAmB,CAAA"}
|
|
@@ -3,34 +3,13 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
|
|
|
3
3
|
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
4
|
return cooked;
|
|
5
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
6
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
29
7
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
30
8
|
};
|
|
31
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
10
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
33
11
|
var styled_1 = __importDefault(require("@emotion/styled"));
|
|
12
|
+
var utils_1 = require("@ltht-react/utils");
|
|
34
13
|
var styles_1 = require("@ltht-react/styles");
|
|
35
14
|
var constants_1 = require("../constants");
|
|
36
15
|
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) {
|
|
@@ -38,12 +17,35 @@ var StyledConditionTitle = styled_1.default.div(templateObject_1 || (templateObj
|
|
|
38
17
|
return (enteredInError ? 'line-through' : 'none');
|
|
39
18
|
});
|
|
40
19
|
var DiagnosisTitle = function (_a) {
|
|
41
|
-
var
|
|
42
|
-
var
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
20
|
+
var condition = _a.condition, enteredInError = _a.enteredInError;
|
|
21
|
+
var snippetTagText = extractSnippetTagDisplayValue(condition);
|
|
22
|
+
if (snippetTagText) {
|
|
23
|
+
return renderTitle(snippetTagText, enteredInError);
|
|
24
|
+
}
|
|
25
|
+
var conditionText = extractConditionOrFallbackText(condition);
|
|
26
|
+
var conditionStatusText = extractConditionStatusText(condition);
|
|
27
|
+
var title = conditionStatusText ? "".concat(conditionText, ", ").concat(conditionStatusText) : conditionText;
|
|
28
|
+
return renderTitle(title, enteredInError);
|
|
29
|
+
};
|
|
30
|
+
var extractConditionOrFallbackText = function (condition) {
|
|
31
|
+
if (!(condition === null || condition === void 0 ? void 0 : condition.code)) {
|
|
32
|
+
return (0, utils_1.titleCase)('Unknown Condition');
|
|
33
|
+
}
|
|
34
|
+
var diagnosisTitle = (0, utils_1.codeableConceptDisplaySummary)(condition.code);
|
|
35
|
+
return (0, utils_1.titleCase)(diagnosisTitle || 'Unknown Condition');
|
|
36
|
+
};
|
|
37
|
+
var extractConditionStatusText = function (condition) {
|
|
38
|
+
var statusParts = [];
|
|
39
|
+
if (condition === null || condition === void 0 ? void 0 : condition.clinicalStatus) {
|
|
40
|
+
statusParts.push(condition === null || condition === void 0 ? void 0 : condition.clinicalStatus);
|
|
41
|
+
}
|
|
42
|
+
if (condition === null || condition === void 0 ? void 0 : condition.verificationStatus) {
|
|
43
|
+
statusParts.push(condition.verificationStatus);
|
|
44
|
+
}
|
|
45
|
+
return (0, utils_1.titleCase)(statusParts.join(', '));
|
|
46
46
|
};
|
|
47
|
+
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 })); };
|
|
47
49
|
exports.default = DiagnosisTitle;
|
|
48
50
|
var templateObject_1;
|
|
49
51
|
//# sourceMappingURL=diagnosis-title.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diagnosis-title.js","sourceRoot":"","sources":["../../src/atoms/diagnosis-title.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"diagnosis-title.js","sourceRoot":"","sources":["../../src/atoms/diagnosis-title.tsx"],"names":[],"mappings":";;;;;;;;;;AACA,2DAAoC;AACpC,2CAA4E;AAE5E,6CAAiD;AAEjD,0CAAiD;AAEjD,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,EAA6B;QAA3B,SAAS,eAAA,EAAE,cAAc,oBAAA;IAC5D,IAAM,cAAc,GAAG,6BAA6B,CAAC,SAAS,CAAC,CAAA;IAE/D,IAAI,cAAc,EAAE,CAAC;QACnB,OAAO,WAAW,CAAC,cAAc,EAAE,cAAc,CAAC,CAAA;IACpD,CAAC;IAED,IAAM,aAAa,GAAG,8BAA8B,CAAC,SAAS,CAAC,CAAA;IAC/D,IAAM,mBAAmB,GAAG,0BAA0B,CAAC,SAAS,CAAC,CAAA;IACjE,IAAM,KAAK,GAAG,mBAAmB,CAAC,CAAC,CAAC,UAAG,aAAa,eAAK,mBAAmB,CAAE,CAAC,CAAC,CAAC,aAAa,CAAA;IAE9F,OAAO,WAAW,CAAC,KAAK,EAAE,cAAc,CAAC,CAAA;AAC3C,CAAC,CAAA;AAED,IAAM,8BAA8B,GAAG,UAAC,SAAoB;IAC1D,IAAI,CAAC,CAAA,SAAS,aAAT,SAAS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-1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ltht-react/diagnosis-summary",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.108",
|
|
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.108",
|
|
32
|
+
"@ltht-react/hooks": "^2.0.108",
|
|
33
|
+
"@ltht-react/icon": "^2.0.108",
|
|
34
|
+
"@ltht-react/list": "^2.0.108",
|
|
35
|
+
"@ltht-react/styles": "^2.0.108",
|
|
36
|
+
"@ltht-react/type-summary": "^2.0.108",
|
|
37
|
+
"@ltht-react/types": "^2.0.108",
|
|
38
|
+
"@ltht-react/utils": "^2.0.108",
|
|
39
39
|
"react": "^18.2.0"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "1e8868664037898ca44ed212e0d209205f7a5f15"
|
|
42
42
|
}
|
|
@@ -29,7 +29,7 @@ const DiagnosisDataSource: FC<Props> = ({ condition, enteredInError, ...rest })
|
|
|
29
29
|
|
|
30
30
|
return (
|
|
31
31
|
<StyledConditionStatus enteredInError={enteredInError} {...rest}>
|
|
32
|
-
{`Source: ${dataSourceDisplayNames}`}
|
|
32
|
+
{dataSourceDisplayNames ? `Source: ${dataSourceDisplayNames}` : `Source: Unknown`}
|
|
33
33
|
</StyledConditionStatus>
|
|
34
34
|
)
|
|
35
35
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { FC, HTMLAttributes } from 'react'
|
|
2
2
|
import styled from '@emotion/styled'
|
|
3
|
+
import { titleCase, codeableConceptDisplaySummary } from '@ltht-react/utils'
|
|
3
4
|
|
|
4
5
|
import { TEXT_COLOURS } from '@ltht-react/styles'
|
|
5
6
|
import { Condition } from '@ltht-react/types'
|
|
@@ -11,17 +12,51 @@ const StyledConditionTitle = styled.div<IStyledDescription>`
|
|
|
11
12
|
text-decoration: ${({ enteredInError }) => (enteredInError ? 'line-through' : 'none')};
|
|
12
13
|
`
|
|
13
14
|
|
|
14
|
-
const DiagnosisTitle: FC<Props> = ({ condition, enteredInError
|
|
15
|
-
const
|
|
16
|
-
const conditionCoding = condition?.code
|
|
15
|
+
const DiagnosisTitle: FC<Props> = ({ condition, enteredInError }) => {
|
|
16
|
+
const snippetTagText = extractSnippetTagDisplayValue(condition)
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
)
|
|
18
|
+
if (snippetTagText) {
|
|
19
|
+
return renderTitle(snippetTagText, enteredInError)
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const conditionText = extractConditionOrFallbackText(condition)
|
|
23
|
+
const conditionStatusText = extractConditionStatusText(condition)
|
|
24
|
+
const title = conditionStatusText ? `${conditionText}, ${conditionStatusText}` : conditionText
|
|
25
|
+
|
|
26
|
+
return renderTitle(title, enteredInError)
|
|
23
27
|
}
|
|
24
28
|
|
|
29
|
+
const extractConditionOrFallbackText = (condition: Condition): string => {
|
|
30
|
+
if (!condition?.code) {
|
|
31
|
+
return titleCase('Unknown Condition')
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const diagnosisTitle = codeableConceptDisplaySummary(condition.code)
|
|
35
|
+
|
|
36
|
+
return titleCase(diagnosisTitle || 'Unknown Condition')
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const extractConditionStatusText = (condition: Condition): string => {
|
|
40
|
+
const statusParts: string[] = []
|
|
41
|
+
|
|
42
|
+
if (condition?.clinicalStatus) {
|
|
43
|
+
statusParts.push(condition?.clinicalStatus)
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
if (condition?.verificationStatus) {
|
|
47
|
+
statusParts.push(condition.verificationStatus)
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
return titleCase(statusParts.join(', '))
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const extractSnippetTagDisplayValue = (condition: Condition) =>
|
|
54
|
+
condition?.metadata.tag?.find((coding) => coding?.system === SNIPPET_HOVER_TEXT)?.display
|
|
55
|
+
|
|
56
|
+
const renderTitle = (title: string, enteredInError: boolean) => (
|
|
57
|
+
<StyledConditionTitle enteredInError={enteredInError}>{title}</StyledConditionTitle>
|
|
58
|
+
)
|
|
59
|
+
|
|
25
60
|
interface Props extends HTMLAttributes<HTMLDivElement> {
|
|
26
61
|
condition: Condition
|
|
27
62
|
enteredInError: boolean
|