apozas/contactdiary

[Request] Support sharing of UK NHS Venue QR Code scans

Closed this issue · 9 comments

mjray commented

Is your feature request related to a problem? Please describe.
Lots of places in the UK display a NHS QR code poster (including some required by law such as eateries but they are mostly closed right now due to lockdown). That code is intended to be read by their official app which only works on some devices, because it requires the bluetooth exposures API and closes itself otherwise, so people with older phones cannot use the scanner. It would be great to be able to scan this with a regular QR app (such as SecScanQR) and use it to start a Contact Diary entry.

Describe the solution you'd like
Enable Contact Diary as a target for the Share function and if the Share is text starting "UKC19TRACING:" then extract the second dot-delimited part, base64-decode it to get the JSON and use the id and opn fields as the Event Name and pc (postcode) field as the Place, with the current Date and Time as the start time. Maybe put "Shared from UKC19TRACING. You still need to register your details at the venue." in the Notes field.

Describe alternatives you've considered
Coding it myself but I would be replicating Contact Diary's functions.

Additional Context
An explanation of the QR code format is included near the top of https://www.revk.uk/2020/09/how-not-to-qr-nhs-c19-app.html before most of the criticism of it.

Hi mjray,

Well, that's a nice idea, indeed :). I will play around with this in the coming days, thanks!

So, 2886f46 and 187aa5b constitute a first implementation. The hard part seems to be done, and now comes thinking about how to use the information. I am inclined to understand that the opn field corresponds to the venue, so I'd put it in the Place field. Then, I'm hesitating between:

  • Putting opn also in Event name. This is the easiest in terms of "clicks to register", since you can just press the FAB to add the entry to the list.
  • Leaving Event name empty. This requires a bit more effort (a name must be put in order to save the entry), but this may "motivate" a bit more to fill in the rest of the fields.
  • Putting the "warning" you suggested in Event name. A pain to erase, but a good way of showing the message (in small screens I'm not sure if the Notes are seen straightaway)

I want to spend some time thinking about the best solution (which may not be in the list above), but it won't take a lot until I release a new version with this feature. Opinions and thoughts are appreciated :)

mjray commented

I suspect the last option of those is the best, as an encouragement.

I also found that the NZ Covid Tracer uses a similar but simpler QR code, specified at https://www.health.govt.nz/publication/hiso-100852020-covid-19-contact-tracing-data-standard but their app is open source and has a diary function of its own. I'm not sure if it dies on older phones like the UK app does.

The NZ Specification also explains what opn is. It is Organization Part Name, whereas adr is the Address in their version, and pc (Post Code) is used for place in the UK one. Putting only opn in the Place field risks not being able to tell which branch of a chain you are in, I think. pc is also needed.

I have a fourth alternative, that now I think is better than the above: every time a QR is imported, show a warning message (showing something along the lines of "You still need to register your details at the venue.") that must be accepted in order to proceed. This message would have an option to "Do not show again", so once you remember it, it will not bother you any more. How does this sound?

I also found that the NZ Covid Tracer uses a similar but simpler QR code

Nice! I'll add it as well. Thanks! :)

Putting only opn in the Place field risks not being able to tell which branch of a chain you are in, I think. pc is also needed.

That makes sense, yes. I'll probably combine both in the Place field.

If all goes well, expect the update to be ready by the end of the weekend :)

mjray commented

The pop-up sounds good too. I hope not too many people will tick the "Do not show".

Thanks! I hope this reaches f-droid soon for a less disruptive upgrade for me ☺

Well, here it goes. Looking good? :)

I saw (not officially, though) that the UK is also using the adr field for storing the address of the venue. Thus, with fc3a7d7 I will first look whether the adr field is present, and if not, put the postal code instead.

Expect that tomorrow everything will be set for F-Droid to pick this up.

EDIT: The release is made, it should be available on F-Droid in a few days.

mjray commented

Looks good. Thanks for the release. I'll try it in the wild whenever I'm next out getting food after upgrading.

That is interesting info about the adr field. I don't think it was present in the ones I had but they were scanned some time ago and this may have been added since, or maybe the businesses did not submit their full address to the code generator.

It took a while to get the update that implemented this up on F-Droid, but now that there seems to be no apparent problems, I'm proceeding to close the issue. Thanks!

mjray commented

And I used it in the wild for the first time yesterday. It worked well. I had to edit the time a bit but this was not the app's fault because the shop had displayed their code poster at the checkout rather than the entrance. Based on what it entered, I suspect that the code may not have had any location except postcode (so you made a good decision to combine them), but I have not decoded the data to verify that. Many thanks.