{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://schemata.openattestation.com/sg/gov/moh/pdt-healthcert/2.0/schema.json",
  "type": "object",
  "required": ["id", "version", "type", "validFrom", "validUntil", "fhirVersion", "fhirBundle"],
  "definitions": {
    "RecTypes": {
      "type": "string",
      "enum": ["PCR", "ART", "SER"]
    }
  },
  "properties": {
    "id": {
      "type": "string",
      "examples": ["TEST001"]
    },
    "version": {
      "type": "string",
      "enum": ["rec-healthcert-v2.0"]
    },
    "type": {
      "$ref": "#/definitions/RecTypes"
    },
    "logo": {
      "type": "string",
      "description": "base64 encoded image"
    },
    "validFrom": {
      "type": "string",
      "format": "date-time",
      "description": "Date and time from which the document is considered valid"
    },
    "validUntil": {
      "type": "string",
      "format": "date-time",
      "description": "Date and time after which the document is considered invalid"
    },
    "fhirVersion": {
      "type": "string",
      "examples": ["4.0.1"]
    },
    "fhirBundle": {
      "$ref": "https://schemata.openattestation.com/sg/gov/moh/fhir/4.0.1/lite-schema.json#/definitions/Bundle",
      "description": "FHIR bundle for a collection of resources. Each resource and the entire bundle should be compliant against the base spec of FHIR. You may use a validator like: https://inferno.healthit.gov/validator/"
    }
  }
}
