@medicus.ai/medicus-report-pdf-generator 1.3.24 → 1.3.26
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/template.js +22 -2
- package/lib/wellbeing_report_generator.js +3 -1
- package/locales/wellbeing/ar-AE.json +8 -0
- package/locales/wellbeing/ar-SA.json +8 -0
- package/locales/wellbeing/en.json +8 -0
- package/package.json +1 -1
- package/templates/maisonsante/ltr_no_pages.html +11 -0
- package/templates/maisonsante/rtl_no_pages.html +10 -0
package/lib/template.js
CHANGED
|
@@ -6,6 +6,11 @@ const path = require('path');
|
|
|
6
6
|
|
|
7
7
|
let useMonospace = false;
|
|
8
8
|
function setUseMonospace(val) { useMonospace = val; }
|
|
9
|
+
// Maison Santé-only rendering switches. Set per request by
|
|
10
|
+
// generateHTMLWellbeingReportWithSmartReport (reset after), like useMonospace,
|
|
11
|
+
// so other clients are never affected.
|
|
12
|
+
let isMaisonSante = false;
|
|
13
|
+
function setIsMaisonSante(val) { isMaisonSante = val; }
|
|
9
14
|
const INDENTATION = {
|
|
10
15
|
PANEL_TITLE: 12,
|
|
11
16
|
BIOMARKER_DETAILS: 12,
|
|
@@ -900,7 +905,7 @@ function renderReportSummary(data, isIMCLab) {
|
|
|
900
905
|
content += '<div id="report-summary" class="section">';
|
|
901
906
|
if (data.reportSummary) {
|
|
902
907
|
content += `
|
|
903
|
-
<div class="resume-title report-summary-title">${localeService.t('reportSummary')}</div>
|
|
908
|
+
<div class="resume-title report-summary-title">${localeService.t('reportSummary') || 'Report Summary'}</div>
|
|
904
909
|
<div class="section-content report-summary-content">${data.reportSummary}</div>
|
|
905
910
|
`;
|
|
906
911
|
}
|
|
@@ -910,7 +915,7 @@ function renderReportSummary(data, isIMCLab) {
|
|
|
910
915
|
reportProperties += `<p>${key}: ${value}</p>`;
|
|
911
916
|
}
|
|
912
917
|
content += `
|
|
913
|
-
<div class="resume-title report-properties-title">${localeService.t('reportProperties')}</div>
|
|
918
|
+
<div class="resume-title report-properties-title">${localeService.t('reportProperties') || 'Report Properties'}</div>
|
|
914
919
|
<div class="section-content report-properties-content">${reportProperties}</div>
|
|
915
920
|
`;
|
|
916
921
|
}
|
|
@@ -1182,6 +1187,20 @@ function renderBiomarkerV3(biomarker, nestingLevel, isChildBiomarker, isCompactV
|
|
|
1182
1187
|
|
|
1183
1188
|
function renderPanelV3(panel, nestingLevel, isCompactView, counter = null, isRectified = false, isAllergyItem = false) {
|
|
1184
1189
|
|
|
1190
|
+
// Maison Santé: the LIS sometimes sends a prescription under a panel whose
|
|
1191
|
+
// name is the literal string "undefined" (a sender bug). That wrapper panel
|
|
1192
|
+
// carries no biomarkers of its own (the prescription biomarker + its details
|
|
1193
|
+
// table are sibling items), so rendering its header just prints an
|
|
1194
|
+
// "undefined" title bar. Drop the header entirely in that exact case; the
|
|
1195
|
+
// prescription content still renders from the sibling items. Other clients
|
|
1196
|
+
// and any panel that actually has biomarkers are untouched.
|
|
1197
|
+
if (isMaisonSante
|
|
1198
|
+
&& /^\s*(undefined|null)\s*$/i.test(String(panel && panel.name))
|
|
1199
|
+
&& (!panel.biomarkers || panel.biomarkers.length === 0)
|
|
1200
|
+
&& !panel.panelBiomarker) {
|
|
1201
|
+
return '';
|
|
1202
|
+
}
|
|
1203
|
+
|
|
1185
1204
|
|
|
1186
1205
|
const panelCssId = `panel-${panel.panelId}db${Math.floor(Math.random() * 3)}`;
|
|
1187
1206
|
// Each panel note is a separate line from the lab; joining with '' glued them
|
|
@@ -2224,6 +2243,7 @@ module.exports = {
|
|
|
2224
2243
|
renderHTMLTemplate,
|
|
2225
2244
|
renderAllergyClasses,
|
|
2226
2245
|
setUseMonospace,
|
|
2246
|
+
setIsMaisonSante,
|
|
2227
2247
|
}
|
|
2228
2248
|
|
|
2229
2249
|
|
|
@@ -7,7 +7,7 @@ const path = require("path");
|
|
|
7
7
|
const LocaleService = require('../app/services/localeService.js');
|
|
8
8
|
const i18n = require('../app/i18n_wellbeing.config.js');
|
|
9
9
|
const puppeteer = require("puppeteer");
|
|
10
|
-
const { renderReportItems, find, renderSummary, renderReportSummary, renderHTMLTemplate, renderAllergyClasses, setUseMonospace } = require("./template.js");
|
|
10
|
+
const { renderReportItems, find, renderSummary, renderReportSummary, renderHTMLTemplate, renderAllergyClasses, setUseMonospace, setIsMaisonSante } = require("./template.js");
|
|
11
11
|
const { cli } = require("webpack");
|
|
12
12
|
|
|
13
13
|
|
|
@@ -1475,7 +1475,9 @@ let generateHTMLWellbeingReportWithSmartReport = async (data, isDebugging, clien
|
|
|
1475
1475
|
// Add smart report if available
|
|
1476
1476
|
if (!empty(smartReport)) {
|
|
1477
1477
|
setUseMonospace(client.toLowerCase() === 'pha');
|
|
1478
|
+
setIsMaisonSante(client.toLowerCase() === 'maisonsante');
|
|
1478
1479
|
let smartReportHtml = generateReportHtml(smartReport, isRtl, false, false, language).html;
|
|
1480
|
+
setIsMaisonSante(false);
|
|
1479
1481
|
setUseMonospace(false);
|
|
1480
1482
|
|
|
1481
1483
|
if (shouldHideWellbeingUI) {
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
{
|
|
2
|
+
"reportSummary": {
|
|
3
|
+
"message": "ملخص التقرير",
|
|
4
|
+
"description": "Report summary section title"
|
|
5
|
+
},
|
|
6
|
+
"reportProperties": {
|
|
7
|
+
"message": "خصائص التقرير",
|
|
8
|
+
"description": "Report properties section title"
|
|
9
|
+
},
|
|
2
10
|
"yearsOld": {
|
|
3
11
|
"message": "years old",
|
|
4
12
|
"description": "After the patient old in the header"
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
{
|
|
2
|
+
"reportSummary": {
|
|
3
|
+
"message": "ملخص التقرير",
|
|
4
|
+
"description": "Report summary section title"
|
|
5
|
+
},
|
|
6
|
+
"reportProperties": {
|
|
7
|
+
"message": "خصائص التقرير",
|
|
8
|
+
"description": "Report properties section title"
|
|
9
|
+
},
|
|
2
10
|
"yearsOld": {
|
|
3
11
|
"message": "سنة",
|
|
4
12
|
"description": "After the patient old in the header"
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
{
|
|
2
|
+
"reportSummary": {
|
|
3
|
+
"message": "Report Summary",
|
|
4
|
+
"description": "Report summary section title"
|
|
5
|
+
},
|
|
6
|
+
"reportProperties": {
|
|
7
|
+
"message": "Report Properties",
|
|
8
|
+
"description": "Report properties section title"
|
|
9
|
+
},
|
|
2
10
|
"yearsOld": {
|
|
3
11
|
"message": "years old",
|
|
4
12
|
"description": "After the patient old in the header"
|
package/package.json
CHANGED
|
@@ -15,6 +15,17 @@
|
|
|
15
15
|
float: none !important;
|
|
16
16
|
display: flow-root;
|
|
17
17
|
}
|
|
18
|
+
|
|
19
|
+
/* Sub-panel headers carry an inline width (e.g. "margin-left:14px;width:780px")
|
|
20
|
+
to sit indented under their parent. A stray global rule
|
|
21
|
+
`.panel-title { float: right }` in the shared sheet makes those
|
|
22
|
+
fixed-width headers float to the right edge, so the sub-panel looks
|
|
23
|
+
shifted far to the right. Force nested headers back to the left so the
|
|
24
|
+
indent reads correctly. Only nested headers match [style*="width:"];
|
|
25
|
+
top-level panel titles (full width) are untouched. */
|
|
26
|
+
.score-main .section.panel .panel-title[style*="width:"] {
|
|
27
|
+
float: left !important;
|
|
28
|
+
}
|
|
18
29
|
</style>
|
|
19
30
|
<script>
|
|
20
31
|
var IS_ARABIC = false;
|
|
@@ -70,6 +70,16 @@
|
|
|
70
70
|
float: none !important;
|
|
71
71
|
display: flow-root;
|
|
72
72
|
}
|
|
73
|
+
|
|
74
|
+
/* RTL mirror of the sub-panel indent fix: nested headers (identified by
|
|
75
|
+
their inline width) must indent from the right. The inline style sets
|
|
76
|
+
margin-left for LTR; in RTL move that indent to the right side so the
|
|
77
|
+
sub-panel sits inset from the right edge, not flush against it. */
|
|
78
|
+
.score-main .section.panel .panel-title[style*="width:"] {
|
|
79
|
+
float: right !important;
|
|
80
|
+
margin-left: 0 !important;
|
|
81
|
+
margin-right: 14px !important;
|
|
82
|
+
}
|
|
73
83
|
</style>
|
|
74
84
|
<script>
|
|
75
85
|
var IS_ARABIC = true;
|