Skip to content

Commit 909a495

Browse files
authored
Merge pull request #53 from the-commons-project/develop
Develop
2 parents 1c0d704 + 0b3481d commit 909a495

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

src/WrongPatientWarning.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export default function WrongPatientWarning({ organized }) {
5555
if (foundMatch) return(undefined);
5656

5757
return(
58-
<div class={styles.warning}>
58+
<div className={styles.warning}>
5959
Warning: It appears that the subject referenced in the information
6060
below may differ from the patient selected in the
6161
EHR (<span className={styles.deets}>{getPatientDeets()}</span>).

src/lib/getDocSHX.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
// NYI --- reuse canvas and engine for perf
66

77
import QrScanner from 'qr-scanner';
8-
import * as PdfjsLib from 'pdfjs-dist/build/pdf';
9-
import PdfjsWorker from 'pdfjs-dist/build/pdf.worker.entry';
108
import { b64_to_arr } from './b64.js';
119
import { looksLikeSHX } from './SHX.js';
1210

@@ -33,6 +31,14 @@ export default async function getDocSHX(fhir, doc) {
3331
}
3432

3533
async function scanPdf(doc, base64) {
34+
35+
const PdfjsLib = await import('pdfjs-dist/build/pdf');
36+
const PdfjsWorker = await import('pdfjs-dist/build/pdf.worker.entry');
37+
38+
return(await _scanPdf(doc, base64, PdfjsLib, PdfjsWorker));
39+
}
40+
41+
async function _scanPdf(doc, base64, PdfjsLib, PdfjsWorker) {
3642

3743
const canvas = document.createElement('canvas');
3844
const ctx = canvas.getContext('2d');

0 commit comments

Comments
 (0)