@medicus.ai/medicus-report-pdf-generator 1.0.243 → 1.0.244
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/index.js +1 -25
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -141,30 +141,6 @@ module.exports = {
|
|
|
141
141
|
}
|
|
142
142
|
|
|
143
143
|
console.log("shouldSendEmail", shouldSendEmail)
|
|
144
|
-
// 3: save PDF buffer
|
|
145
|
-
let fileBuffer
|
|
146
|
-
if (reportData.client === 'sanusx') {
|
|
147
|
-
fileBuffer = await generateSanusXReport(html);
|
|
148
|
-
} else {
|
|
149
|
-
fileBuffer = await generatePDFWellbeingReport(html);
|
|
150
|
-
}
|
|
151
|
-
if (isDebugging) {
|
|
152
|
-
console.log('3: save PDF buffer')
|
|
153
|
-
LOGS += '3: save PDF buffer' + '\n' + '=============' + '\n';
|
|
154
|
-
LOGS += fileBuffer + '\n\n\n';
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
console.log("PDF_FILE_PATH", PDF_FILE_PATH)
|
|
158
|
-
fs.writeFileSync(PDF_FILE_PATH, fileBuffer, 'utf8');
|
|
159
|
-
|
|
160
|
-
// 4: save encoded base64
|
|
161
|
-
const base64data = Buffer.from(fileBuffer, 'utf8').toString('base64');
|
|
162
|
-
if (isDebugging) {
|
|
163
|
-
console.log('4: save encoded base64');
|
|
164
|
-
LOGS += '4: save encoded base64' + '\n' + '=============' + '\n';
|
|
165
|
-
LOGS += base64data + '\n\n\n';
|
|
166
|
-
}
|
|
167
|
-
|
|
168
144
|
|
|
169
145
|
// 5: save logs to file
|
|
170
146
|
fs.writeFileSync(LOGS_FILE_PATH, LOGS, 'utf8');
|
|
@@ -173,7 +149,7 @@ module.exports = {
|
|
|
173
149
|
}
|
|
174
150
|
|
|
175
151
|
if (isDownloadable) {
|
|
176
|
-
return
|
|
152
|
+
return html;
|
|
177
153
|
} else {
|
|
178
154
|
if (shouldSendEmail)
|
|
179
155
|
return await sendNascoEmail(decodedJSON, PDF_FILE_PATH, mailConfig, reportData.client)
|
package/package.json
CHANGED