Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Seems the QR code is not offered by MyHelathNB #1

Open
mikey506 opened this issue Oct 22, 2021 · 1 comment
Open

Seems the QR code is not offered by MyHelathNB #1

mikey506 opened this issue Oct 22, 2021 · 1 comment

Comments

@mikey506
Copy link

Interesting, what confused me, is the MyHealthNB web portal does not seem to offer the QR code version of the certificate, called the 1-866 # spoke with lady who has no idea when the qr code was going to be offered, I asked if it was previously offered and taken down she claims they never provided the code at any time.

How's this coder able to create an app for a QR code that technically doesn't exist or am I missing something here.

@ma99us
Copy link
Owner

ma99us commented Oct 22, 2021

I had invent my own barcode format. I call it JAB code (no pun intended :-)). It stands for JSON Array Barcode. The main idea is that we turn java beans objects into an array of their fields values. Excluding nulls. Values are encoded according to JSON rules. So for example bean like this:
Person{ String name; int age; Date dob; } where 'dob' Is null, will turn into this JSON payload: [“Mike”, 69,]. Note that 'null' is trimmed for brevity. Java reflection is used to parse such SJON array and assign values to correct bean fields.
Once we have objects to json array and back conversion, we can come up with a JAB format. It consists of 4 parts. Prefix, followed by format id, followed by Header object, followed by actual Payload object. ''pipe character used as a separator. Simple barcode example:
JAB|1234546[234567][“Mike”,69,]
where
Prefix|format id[header checksum][payload field Name, payload field Age, payload field dob]
Now header object could be customized. The header acts upon payload during barcode creation and parsing. For example barcode with encrypting header might look like this:
JAB|654321[234567,765432][AFQRFfD4D634GD74DF5RWDSFF34]
where
Prefix|format id[checksum,crypto key id][encrypted payload value array]
So now once we have a POJO with person's immunization data, it will look something like this:
Profile{String name, String age, List immunizations}, where Immunization {String date, String vaccineName}. So Profile object could be used as a payload for a JAB process, and in the unencrypted form, it will look something like this:
[“Name”,”DOB”,[[“vaccine#1 date”,”vaccine#1 name”],[“vaccine#2 date”,”vaccine#2 name”]]]
See how a list of objects becomes a json array where every item is also an array, representing list items.
Such format gives us relative brevity of data, because we do not include object field names or ids, we rely on predictable fields order of the reflection process (or we sort the fields in consistent manner).

In the ImmuNB app I use barcode header which checksums the payload data for consistency verification and then encrypts the payload with a symmetric cipher. (The production key has to be kept a secret!)
That results in an elegant format which can be ported on any non-java platform, and also provides reasonable protection of it's data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants