Documentation ¶
Overview ¶
Package fhirbundle constructs and marshals a (pre-compressed) JWS payload containing an FHIR bundle of information representing COVID-19 immunizations. See https://spec.smarthealth.cards/#health-cards-are-encoded-as-compact-serialization-json-web-signatures-jws and https://build.fhir.org/ig/HL7/fhir-shc-vaccination-ig/StructureDefinition-shc-vaccination-bundle-dm.html#tab-snapshot.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewJWSPayload ¶
func NewJWSPayload(fb FHIRBundle, issuer string) jwsPayload
NewJWSPayload returns a struct that can be serialized as JSON and represent the (pre-compressed) payload of a JSON Web Signature (JWS) as described here: https://spec.smarthealth.cards/#health-cards-are-encoded-as-compact-serialization-json-web-signatures-jws.
This function takes the core relevant data for an FHIR bundle representing a patient's COVID-19 immunizations, encapsulated in an FHIRBundle object, and an issuer which is the entity that will JWS, as inputs.
Types ¶
type FHIRBundle ¶
type FHIRBundle struct { // Patient represents an individual who has received immunizations. Patient // Immunizations represents the immunizations the patient has received. Immunizations []Immunization }
FHIRBundle encapsulates the core relevant data for an FHIR bundle representing a patient's COVID-19 immunizations.
func (FHIRBundle) MarshalJSON ¶
func (f FHIRBundle) MarshalJSON() ([]byte, error)
MarshalJSON takes the core relevant data for an FHIR bundle encapsulated in an FHIRBundle object, and seralizes it as a JSON byte slice including all the additional boilerplate as defined here: https://build.fhir.org/ig/HL7/fhir-shc-vaccination-ig/StructureDefinition-shc-vaccination-bundle-dm.html.
type Immunization ¶
type Immunization struct { // DatePerformed represents the date when the immunization was // performed. DatePerformed time.Time // Performer represents the entity which performed the immunization // such as a particular hospital or health clinic. Performer string // LotNumber represents the lot number of the specific batch of the // vaccine that was administered. LotNumber string // VaccineType represents the type of vaccine that was administered, // e.g. Pfizer-BioNTech. VaccineType }
Immunization represents one instance of a COVID-19 immunization performed on a patient.
type Name ¶
type Name struct { // Family represents the patient's family name. Family string `json:"family"` // Givens represents the patient's given names. Givens []string `json:"given"` }
Name represents a patient's name.
type Patient ¶
type Patient struct { // Name is the patient's name. Name // BirthDate is the patient's date of birth. BirthDate time.Time }
Patient represents an individual who has received immunizations.
type VaccineType ¶
type VaccineType string
const ( Pfizer VaccineType = "Pfizer" Moderna VaccineType = "Moderna" JohnsonAndJohnson VaccineType = "JohnsonAndJohnson" AstraZeneca VaccineType = "AstraZeneca" Sinopharm VaccineType = "Sinopharm" COVAXIN VaccineType = "COVAXIN" )
Supported COVID-19 vaccination types.