Stream: smart/health-cards
Topic: Multiple QR codes example
Michele Mottini (May 19 2021 at 13:21):
Does anyone have (or can create) an example JWS that requires multiple QR codes - ie exceeding the 1195 maximum size ? (Writing code to generate QR codes and I would like to test that case)
Josh Mandel (May 19 2021 at 13:29):
I assume you've seen https://smarthealth.cards/examples/#example-2
Josh Mandel (May 19 2021 at 13:29):
(it's not semantically interesting but should give you something to test with.)
Michele Mottini (May 19 2021 at 13:31):
doh...sorry, it was right there under my nose. Thanks Josh
Josh Mandel (May 19 2021 at 13:32):
Sure thing. https://github.com/smart-on-fhir/health-cards/blob/main/generate-examples/src/index.ts has the generation code behind the examples, FWIW.
Reece Adamson (May 19 2021 at 13:51):
https://connectathon.vci.org is capable of producing Health Cards that require multiple QR codes, but it would take a lot of immunizations. I just created 30 immunizations for the patient in the QR below and the JWS is only 959 characters. The example Josh shared has 55 resources of more diverse types that may make it less compressible than the ones https://connectathon.vci.org can produce with Immunizations alone.
validation-skd results for QR code
Josh Mandel (May 19 2021 at 13:53):
If you inject some entropy by having different immunizations come from different provider orgs with long and distinct names, that probably helps too :-) DEFLATE does a phenomenal job over highly repetitive data.
Reece Adamson (May 19 2021 at 14:05):
Supercalifragilisticexpialidocious idea!
Reece Adamson (May 19 2021 at 14:06):
https://connectathon.vci.org supports scanning multiple QR codes too if you want to test the spec examples (warning: scanner can be a little finicky).
e.g. here is me scanning them "out of order"
Vijayendra Prabhakar (May 19 2021 at 14:38):
Michele Mottini said:
Does anyone have (or can create) an example JWS that requires multiple QR codes - ie exceeding the 1195 maximum size ? (Writing code to generate QR codes and I would like to test that case)
Hey @Michele Mottini the Siemens Holder and verifier app does also supports chunking of qr codes and verifying it. You could download the health card with name "Walton, Sauer"
Michele Mottini (May 19 2021 at 14:39):
Thanks Vijayendra
Reece Adamson (May 19 2021 at 14:44):
@Vijayendra Prabhakar showing the QR code for "Walton, Sauer" on https://smart-health-vault-siemens-healthineers.azurewebsites.net/holder I only see a single QR code. Am I looking at the wrong patient or is that patient being updated?
Vijayendra Prabhakar (May 19 2021 at 14:47):
Reece Adamson said:
Vijayendra Prabhakar showing the QR code for "Walton, Sauer" on https://smart-health-vault-siemens-healthineers.azurewebsites.net/holder I only see a single QR code. Am I looking at the wrong patient or is that patient being updated?
@Reece Adamson Apologies it is Adella39, Von197
Michele Mottini (May 19 2021 at 14:51):
I cannot make the QR code scanner at vci.org work - trying to run it on my phone scanning QR codes on my computer screen
Stephen MacVicar (May 19 2021 at 14:55):
i was unable to get my phone to recognize a qr code on my monitor, but it would recognize a hard-copy qr code i have
Reece Adamson (May 19 2021 at 14:57):
@Vijayendra Prabhakar what QR code scanning library are you using with your implementation? We're using qr-scanner, but it seems pretty sensitive to glare and positioning.
Vijayendra Prabhakar (May 19 2021 at 15:00):
Reece Adamson said:
Vijayendra Prabhakar what QR code scanning library are you using with your implementation? We're using qr-scanner, but it seems pretty sensitive to glare and positioning.
@Reece Adamson Even we are using the same QR code scanning library https://www.npmjs.com/package/qr-scanner
Josh Mandel (May 19 2021 at 15:13):
@Michele Mottini do you have any better luck with https://joshuamandel.com/health-card-scanner-demo ? (Same underlying library but slightly different configuration.)
Reece Adamson (May 19 2021 at 15:14):
Huh, weird. Maybe there is some configuration settings or something we missed that could improve ours since it seems like the siemens verifier picks it up more readily. Our FOV is pretty big compared to others I've seen.
Michele Mottini (May 19 2021 at 15:17):
It's the glare: I moved my computer in a darker room and it worked (with both scanners)
Maruthi M (May 19 2021 at 16:53):
Josh Mandel said:
Michele Mottini do you have any better luck with https://joshuamandel.com/health-card-scanner-demo ? (Same underlying library but slightly different configuration.)
@Josh Mandel In siemens verifier we have configured to show only section which is focus qr scanning.
Josh Mandel (May 19 2021 at 17:05):
Yeah, in my demo I just use the whole area as an active region.
Richard Braman (FLY.HEALTH) (May 19 2021 at 18:17):
I have coded in the support for chunking the jws, but I would like to know if anyone has any thoughts on sending mutiple qr codes over http?
Josh Mandel (May 19 2021 at 18:51):
In what context? If you've got a web connection between systems you'd generally just share a .smart-health-card
JSON file or some other direct form of the JWS, rather than a QR. Those don't require chunking, and you can always generate a QR on the other side since you have all the data required.
Richard Braman (FLY.HEALTH) (May 19 2021 at 19:57):
my system lets the user have an online wallet with their qrcodes, or lets them save a local copy. I am trying not to put any qrcode generation logic in the local device.
Josh Mandel (May 19 2021 at 20:15):
Okay. Is there something you're looking to standardize? You can have a web page that lets a user download 3 QRs as separate clicks, or use JS to trigger three downloads from one click, or host a zip file with lots of QRs inside... or you can store the QRs in browser storage rather than downloading into the host filesystems. Lots of options.
Richard Braman (FLY.HEALTH) (May 19 2021 at 22:19):
Not sure about standardization, but I would think if we are dealing with http and multiple images, that a http request that returns multiple qrcodes would need to return it in a standard way for clients to interpret. I was thinking it would be a mime multipart with the individual qrcodes inside. soemthing like:
Content-Type: multipart/form-data; boundary=2a8ae6ad-f4ad-4d9a-a92c-6d217011fe0f
Content-Length: 112123
Content-Disposition: form-data; name="qrcode1"; filename="qrcode1.svg"
Content-Type: image/svg+xml
<svg............,...........D..;
--2a8ae6ad-f4ad-4d9a-a92c-6d217011fe0f
Content-Disposition: form-data; name="datafile2"; filename="qrcode2.svg"
Content-Type: image/svg+xml
<svg.............,...........D..;
--2a8ae6ad-f4ad-4d9a-a92c-6d217011fe0f
Content-Disposition: form-data; name="datafile3"; filename="qrcode2.svg"
Content-Type: image/svg+xml
Richard Braman (FLY.HEALTH) (May 19 2021 at 22:28):
node js might let me do something like this:
var form = new FormData();
form.append(qrcode1.svg, 'smart health card qrcode seq 1');
form.append('qrcode2.svg', 'smart health card qrcode seq 2');
res.setHeader('x-Content-Type', 'multipart/form-data; boundary='+form._boundary);
res.setHeader('Content-Type', 'image/svg+xml');
\\the overall content length would have to be calculated as well
res.setHeader('Content-Length', <ContentLength>);
form.pipe(res);
Josh Mandel (May 19 2021 at 23:13):
https://stackoverflow.com/questions/1041542/how-to-download-multiple-files-with-one-http-request doesn't bode well.
Josh Mandel (May 19 2021 at 23:14):
(But it is 12 years old ;-))
Last updated: Apr 12 2022 at 19:14 UTC