Go to file
Cyberes 5b724b3ee8
improvements
2023-05-31 12:45:29 -06:00
README.md improvements 2023-05-31 12:45:29 -06:00
covid-qr-decode.py improvements 2023-05-31 12:45:29 -06:00

README.md

Covid Passport Decoder

Forked from ggqc007/Covid-QR-Decoder. Removed the JS version and improved the Py version.


A simple commandline tool to extract the data from a Covid-19 QR code in the SMART Health Card format. Displays the data with fancy formatting. No error checking is preformed.

Sample code is included to validate the QR code. Requires the public key from an authority (probably the government).

More info about the SMART Health Cards Framework can be found here: https://spec.smarthealth.cards/


Usage

  1. pip install python-jose pyzbar rich
  2. ./covid-qr-decode.py [path to QR code]

Raw QR Code Data: You can specify --raw to enter the raw QR code data instead of the path to a QR file.

Validate: To validate the QR code signature, add --validate [path to public key].

Sample Data Output

{"kid":"SOME-KEY-ID","zip":"SOME-ZIP","alg":"ES256"}

{
  "resource": {
    "resourceType": "Patient",
    "name": [
      {
        "family": [
          "NAME"
        ],
        "given": [
          "SURNAME"
        ]
      }
    ],
    "birthDate": "1900-01-01",
    "gender": "SEX"
  }
}
{
  "resource": {
    "resourceType": "Immunization",
    "vaccineCode": {
      "coding": [
        {
          "system": "http://hl7.org/fhir/sid/cvx",
          "code": "208"
        }
      ]
    },
    "patient": {
      "reference": "resource:0"
    },
    "lotNumber": "SOME-LOT-NUMBER",
    "status": "Completed",
    "occurrenceDateTime": "2021-04-01T04:00:00+00:00",
    "location": {
      "reference": "resource:0",
      "display": "VACCINATION-SITE"
    },
    "protocolApplied": {
      "doseNumber": 1,
      "targetDisease": {
        "coding": [
          {
            "system": "http://browser.ihtsdotools.org/?perspective=full&conceptId1=840536004",
            "code": "840536004"
          }
        ]
      }
    },
    "note": [
      {
        "text": "PB COVID-19"
      }
    ]
  }
}