@measurequick/measurequick-report-generator 1.4.57 → 1.4.59
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/package.json
CHANGED
|
@@ -29,7 +29,7 @@ export async function getReport(payload) {
|
|
|
29
29
|
const [_coverPageDoc] = coverPageDoc ? await coreDoc.copyPages(coverPageDoc, [0]) : false;
|
|
30
30
|
if (_coverPageDoc) coreDoc.insertPage(coreDoc.getPages().length, _coverPageDoc);
|
|
31
31
|
} catch (error) {
|
|
32
|
-
errors.push(error);
|
|
32
|
+
errors.push(`Cover Page: ${error}`);
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
/******** TEST IN VITALS (2 PAGES) *********/
|
|
@@ -61,7 +61,7 @@ export async function getReport(payload) {
|
|
|
61
61
|
coreDoc.insertPage(coreDoc.getPages().length, _vitalsReportPg2);
|
|
62
62
|
}
|
|
63
63
|
} catch (error) {
|
|
64
|
-
errors.push(error);
|
|
64
|
+
errors.push(`Test In Vitals: ${error}`);
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
/******** TEST IN MEASUREMENTS (1 PAGE) *********/
|
|
@@ -72,20 +72,20 @@ export async function getReport(payload) {
|
|
|
72
72
|
const [_measurementDetailsDoc] = measurementDetailsDoc ? await coreDoc.copyPages(measurementDetailsDoc, [0]) : false;
|
|
73
73
|
if (_measurementDetailsDoc) coreDoc.insertPage(coreDoc.getPages().length, _measurementDetailsDoc);
|
|
74
74
|
} catch (error) {
|
|
75
|
-
errors.push(error);
|
|
75
|
+
errors.push(`Test In Measurements: ${error}`);
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
/******** TEST IN ACCA MEASUREMENTS (1 PAGE) *********/
|
|
79
|
-
try {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
} catch (error) {
|
|
87
|
-
|
|
88
|
-
}
|
|
79
|
+
// try {
|
|
80
|
+
// if (payload.acca) {
|
|
81
|
+
// let measurementDetailsAccaBase64 = await measurementDetailsAcca.getReport(payload);
|
|
82
|
+
// const measurementDetailsAccaDoc = measurementDetailsAccaBase64 ? await PDFDocument.load(util._base64ToArrayBuffer(measurementDetailsAccaBase64.data)) : false;
|
|
83
|
+
// const [_measurementDetailsAccaDoc] = measurementDetailsAccaDoc ? await coreDoc.copyPages(measurementDetailsAccaDoc, [0]) : false;
|
|
84
|
+
// if (_measurementDetailsAccaDoc) coreDoc.insertPage(coreDoc.getPages().length, _measurementDetailsAccaDoc);
|
|
85
|
+
// }
|
|
86
|
+
// } catch (error) {
|
|
87
|
+
// errors.push(`Test In ACCA Measurements: ${error}`);
|
|
88
|
+
// }
|
|
89
89
|
|
|
90
90
|
/******** TEST OUT VITALS (2 PAGES) *********/
|
|
91
91
|
try {
|
|
@@ -99,7 +99,7 @@ export async function getReport(payload) {
|
|
|
99
99
|
coreDoc.insertPage(coreDoc.getPages().length, _vitalsReportPg2);
|
|
100
100
|
}
|
|
101
101
|
} catch (error) {
|
|
102
|
-
errors.push(error);
|
|
102
|
+
errors.push(`Test Out Vitals: ${error}`);
|
|
103
103
|
}
|
|
104
104
|
|
|
105
105
|
/******** TEST OUT MEASUREMENTS (1 PAGE) *********/
|
|
@@ -111,20 +111,20 @@ export async function getReport(payload) {
|
|
|
111
111
|
if (_measurementDetailsDocPg2) coreDoc.insertPage(coreDoc.getPages().length, _measurementDetailsDocPg2);
|
|
112
112
|
}
|
|
113
113
|
} catch (error) {
|
|
114
|
-
errors.push(error);
|
|
114
|
+
errors.push(`Test Out Measurements: ${error}`);
|
|
115
115
|
}
|
|
116
116
|
|
|
117
117
|
/******** TEST OUT ACCA MEASUREMENTS (1 PAGE) *********/
|
|
118
|
-
try {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
} catch (error) {
|
|
126
|
-
|
|
127
|
-
}
|
|
118
|
+
// try {
|
|
119
|
+
// if (payload.acca && payload.tests.length > 1) {
|
|
120
|
+
// let measurementDetailsAccaBase64 = await measurementDetailsAcca.getReport(payload);
|
|
121
|
+
// const measurementDetailsAccaDoc = measurementDetailsAccaBase64 ? await PDFDocument.load(util._base64ToArrayBuffer(measurementDetailsAccaBase64.data)) : false;
|
|
122
|
+
// const [_measurementDetailsAccaDocPg2] = measurementDetailsAccaDoc ? await coreDoc.copyPages(measurementDetailsAccaDoc, [1]) : false;
|
|
123
|
+
// if (_measurementDetailsAccaDocPg2) coreDoc.insertPage(coreDoc.getPages().length, _measurementDetailsAccaDocPg2);
|
|
124
|
+
// }
|
|
125
|
+
// } catch (error) {
|
|
126
|
+
// errors.push(`Test Out ACCA Measurements: ${error}`);
|
|
127
|
+
// }
|
|
128
128
|
|
|
129
129
|
/******** ACCA / ESVI CERTIFICATES (1 PAGE) *********/
|
|
130
130
|
try {
|
|
@@ -142,7 +142,7 @@ export async function getReport(payload) {
|
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
144
|
} catch (error) {
|
|
145
|
-
errors.push(error);
|
|
145
|
+
errors.push(`ACCA / ESVI Certificate: ${error}`);
|
|
146
146
|
}
|
|
147
147
|
|
|
148
148
|
/******** BLUVAC REPORT (1 PAGE) *********/
|
|
@@ -153,7 +153,7 @@ export async function getReport(payload) {
|
|
|
153
153
|
const [_bluvacReportDoc] = bluvacReportDoc ? await coreDoc.copyPages(bluvacReportDoc, [0]) : false;
|
|
154
154
|
if (_bluvacReportDoc) coreDoc.insertPage(coreDoc.getPages().length, _bluvacReportDoc);
|
|
155
155
|
} catch (error) {
|
|
156
|
-
errors.push(error);
|
|
156
|
+
errors.push(`BluVac Report: ${error}`);
|
|
157
157
|
}
|
|
158
158
|
}
|
|
159
159
|
|
|
@@ -169,7 +169,7 @@ export async function getReport(payload) {
|
|
|
169
169
|
if (_correctiveMeasuresDocPage2) coreDoc.insertPage(coreDoc.getPages().length, _correctiveMeasuresDocPage2);
|
|
170
170
|
} else if (_correctiveMeasuresDoc) coreDoc.insertPage(coreDoc.getPages().length, _correctiveMeasuresDoc);
|
|
171
171
|
} catch (error) {
|
|
172
|
-
errors.push(error);
|
|
172
|
+
errors.push(`Corrective Measures: ${error}`);
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
175
|
|
|
@@ -183,7 +183,7 @@ export async function getReport(payload) {
|
|
|
183
183
|
coreDoc.insertPage(coreDoc.getPages().length, _photosReport);
|
|
184
184
|
}
|
|
185
185
|
} catch (error) {
|
|
186
|
-
errors.push(error);
|
|
186
|
+
errors.push(`Photos: ${error}`);
|
|
187
187
|
}
|
|
188
188
|
|
|
189
189
|
/******** SYSTEM INFO (1 PAGE) *********/
|
|
@@ -193,7 +193,7 @@ export async function getReport(payload) {
|
|
|
193
193
|
const [_systemInfoPageDoc] = systemInfoPageDoc ? await coreDoc.copyPages(systemInfoPageDoc, [0]) : false;
|
|
194
194
|
if (_systemInfoPageDoc) coreDoc.insertPage(coreDoc.getPages().length, _systemInfoPageDoc);
|
|
195
195
|
} catch (error) {
|
|
196
|
-
errors.push(error);
|
|
196
|
+
errors.push(`System Info: ${error}`);
|
|
197
197
|
}
|
|
198
198
|
|
|
199
199
|
return errors.length > 0
|
|
@@ -112,10 +112,10 @@ export async function getReport(payload) {
|
|
|
112
112
|
if (photo.base64.includes("image/jpeg")) imageToSet = await docs[docIndex].embedJpg(util._base64ToArrayBuffer(photo.base64));
|
|
113
113
|
else if (photo.base64.includes("image/png")) imageToSet = await docs[docIndex].embedPng(util._base64ToArrayBuffer(photo.base64));
|
|
114
114
|
else if (photo.fileName && (photo.fileName.includes('.png') || photo.file_name.includes('.png'))) {
|
|
115
|
-
base64.replace('data:binary/octet-stream', 'data:image/png;base64');
|
|
115
|
+
photo.base64 = photo.base64.replace('data:binary/octet-stream', 'data:image/png;base64');
|
|
116
116
|
imageToSet = await docs[docIndex].embedPng(util._base64ToArrayBuffer(photo.base64));
|
|
117
117
|
} else if (photo.fileName && (photo.fileName.includes('.jpg') || photo.file_name.includes('.jpg') || photo.fileName.includes('.jpeg') || photo.file_name.includes('.jpeg'))) {
|
|
118
|
-
base64.replace('data:binary/octet-stream', 'data:image/jpeg;base64');
|
|
118
|
+
photo.base64 = photo.base64.replace('data:binary/octet-stream', 'data:image/jpeg;base64');
|
|
119
119
|
imageToSet = await docs[docIndex].embedJpg(util._base64ToArrayBuffer(photo.base64));
|
|
120
120
|
}
|
|
121
121
|
//else imageToSet = await docs[docIndex].embedJpg(util._base64ToArrayBuffer(photo.base64));
|