@medicus.ai/medicus-report-pdf-generator 1.3.11 → 1.3.12
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/config/maisonsante.json +13 -1
- package/lib/big_integral_questionnaire.js +298 -0
- package/lib/template.js +31 -10
- package/lib/wellbeing_report_generator.js +18 -1
- package/locales/en.json +64 -0
- package/locales/wellbeing/en.json +422 -408
- package/package.json +1 -1
- package/preview-big-integral.js +75 -0
- package/templates/maisonsante/ltr_no_pages.html +1 -0
- package/templates/maisonsante/rtl_no_pages.html +1 -0
- package/test.js +7 -10
- package/testing-reports/mediclinic/arabic-data.js +402 -506
- package/testing-reports/mediclinic/doctor-data.js +483 -620
- package/testing-reports/mediclinic/with-wellbeing.js +382 -8110
- package/testing-reports/pha/notes-example.js +397 -0
- package/testing-reports/pha/ex1.js +0 -485
- package/testing-reports/pha/ex2.js +0 -116
- package/testing-reports/pha/prod-patient.js +0 -510
- package/testing-reports/pha/with-wellbeing-full-data.js +0 -813
- package/testing-reports/pha/with-wellbeing.js +0 -529
- package/testing-reports/pha/without-wellbeing.js +0 -448
package/package.json
CHANGED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
/**
|
|
3
|
+
* Standalone HTML preview for the Big Integral Questionnaire section.
|
|
4
|
+
* Writes output/big-integral-preview.html and opens it in the default browser.
|
|
5
|
+
* Does NOT need puppeteer or canvas.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
const fs = require('fs');
|
|
9
|
+
const path = require('path');
|
|
10
|
+
|
|
11
|
+
const { renderBigIntegralQuestionnaire } = require('./lib/big_integral_questionnaire');
|
|
12
|
+
|
|
13
|
+
// Load raw config
|
|
14
|
+
const clientConfig = JSON.parse(
|
|
15
|
+
fs.readFileSync(path.resolve(__dirname, 'config/maisonsante.json'), 'utf8')
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
const sectionHtml = renderBigIntegralQuestionnaire({ clientConfig });
|
|
19
|
+
|
|
20
|
+
const fullHtml = `<!DOCTYPE html>
|
|
21
|
+
<html lang="en">
|
|
22
|
+
<head>
|
|
23
|
+
<meta charset="UTF-8">
|
|
24
|
+
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
25
|
+
<title>Big Integral Questionnaire — Design Preview</title>
|
|
26
|
+
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600;700&display=swap" rel="stylesheet">
|
|
27
|
+
<style>
|
|
28
|
+
*, *::before, *::after { box-sizing: border-box; }
|
|
29
|
+
body {
|
|
30
|
+
font-family: 'Open Sans', sans-serif;
|
|
31
|
+
background: #f4f6fb;
|
|
32
|
+
margin: 0;
|
|
33
|
+
padding: 20px;
|
|
34
|
+
}
|
|
35
|
+
.page-title {
|
|
36
|
+
font-size: 15px;
|
|
37
|
+
font-weight: 700;
|
|
38
|
+
color: #0F2062;
|
|
39
|
+
margin-bottom: 6px;
|
|
40
|
+
letter-spacing: .5px;
|
|
41
|
+
}
|
|
42
|
+
.page-sub {
|
|
43
|
+
font-size: 11px;
|
|
44
|
+
color: #888;
|
|
45
|
+
margin-bottom: 30px;
|
|
46
|
+
}
|
|
47
|
+
.a4-wrapper {
|
|
48
|
+
width: 794px; /* approximate A4 @ 96 dpi */
|
|
49
|
+
margin: 0 auto;
|
|
50
|
+
background: #fff;
|
|
51
|
+
border-radius: 6px;
|
|
52
|
+
box-shadow: 0 4px 20px rgba(0,0,0,.10);
|
|
53
|
+
padding: 32px 36px;
|
|
54
|
+
}
|
|
55
|
+
</style>
|
|
56
|
+
</head>
|
|
57
|
+
<body>
|
|
58
|
+
<div class="a4-wrapper">
|
|
59
|
+
<div class="page-title">Maison Sante — Doctor PDF: Big Integral Questionnaire</div>
|
|
60
|
+
<div class="page-sub">Maison Sante colors — dummy data — Doctor PDF only</div>
|
|
61
|
+
${sectionHtml}
|
|
62
|
+
</div>
|
|
63
|
+
</body>
|
|
64
|
+
</html>`;
|
|
65
|
+
|
|
66
|
+
const outPath = path.resolve(__dirname, 'output/big-integral-preview.html');
|
|
67
|
+
fs.mkdirSync(path.dirname(outPath), { recursive: true });
|
|
68
|
+
fs.writeFileSync(outPath, fullHtml, 'utf8');
|
|
69
|
+
console.log('Preview written to:', outPath);
|
|
70
|
+
|
|
71
|
+
// Open in default browser (Windows)
|
|
72
|
+
const { exec } = require('child_process');
|
|
73
|
+
exec(`start "" "${outPath}"`, (err) => {
|
|
74
|
+
if (err) console.log('Open manually:', outPath);
|
|
75
|
+
});
|
package/test.js
CHANGED
|
@@ -10,20 +10,17 @@ const CLIENTS = {
|
|
|
10
10
|
MaisonSante: 'maisonsante'
|
|
11
11
|
};
|
|
12
12
|
|
|
13
|
-
const client = CLIENTS.
|
|
13
|
+
const client = CLIENTS.PHA;
|
|
14
14
|
|
|
15
15
|
const path = require("path");
|
|
16
|
-
const
|
|
17
|
-
const phaReportWithoutWellbeing = require("./testing-reports/pha/without-wellbeing");
|
|
18
|
-
const phaReportWithWellbeingFullData = require("./testing-reports/pha/with-wellbeing-full-data");
|
|
19
|
-
const phaReportEx2 = require("./testing-reports/pha/ex2");
|
|
20
|
-
const phaReportEx1 = require("./testing-reports/pha/ex1");
|
|
16
|
+
const phaNotesExample = require("./testing-reports/pha/notes-example");
|
|
21
17
|
const mediclinicReportWithWellbeing = require("./testing-reports/mediclinic/with-wellbeing");
|
|
22
18
|
const mediclinicDoctorData = require("./testing-reports/mediclinic/doctor-data");
|
|
23
19
|
const mediclinicArabicData = require("./testing-reports/mediclinic/arabic-data");
|
|
24
|
-
//
|
|
25
|
-
//
|
|
26
|
-
|
|
20
|
+
// PHA examples: phaNotesExample
|
|
21
|
+
// Mediclinic examples: mediclinicReportWithWellbeing | mediclinicDoctorData | mediclinicArabicData
|
|
22
|
+
// Using mediclinicDoctorData (IsDoctor:true) so the Big Integral Questionnaire section renders for Maison Sante
|
|
23
|
+
const data = phaNotesExample;
|
|
27
24
|
const doctorData = mediclinicDoctorData;
|
|
28
25
|
const arabicData = mediclinicArabicData;
|
|
29
26
|
|
|
@@ -31,7 +28,7 @@ async function generateTestPDF() {
|
|
|
31
28
|
const PDF_FILE_PATH = path.resolve(__dirname, "output/nasco-sample.pdf");
|
|
32
29
|
const ENCRYPTED_PATH = path.resolve(__dirname, "output/nasco-sample-encrypted.pdf");
|
|
33
30
|
|
|
34
|
-
// Generate HTML - uses `data` (
|
|
31
|
+
// Generate HTML - uses `data` (swap with any example variable above)
|
|
35
32
|
const html = await generateHTMLWellbeingReportWithSmartReport(
|
|
36
33
|
data,
|
|
37
34
|
true,
|