Skip to content

Instantly share code, notes, and snippets.

@GHkrishna
Created December 8, 2024 19:59
Show Gist options
  • Save GHkrishna/e3428d5c714d3e05a9d3cd176ece7432 to your computer and use it in GitHub Desktop.
Save GHkrishna/e3428d5c714d3e05a9d3cd176ece7432 to your computer and use it in GitHub Desktop.
prescriptionSchema
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "2024-12-08T16:54:43.166Z-Prescription",
"type": "object",
"required": [
"@context",
"issuer",
"issuanceDate",
"type",
"credentialSubject"
],
"properties": {
"@context": {
"$ref": "#/definitions/context"
},
"type": {
"type": "array",
"items": {
"anyOf": [
{
"$ref": "#/definitions/VerifiableCredential"
},
{
"const": "#/definitions/$Prescription"
}
]
}
},
"credentialSubject": {
"$ref": "#/definitions/credentialSubject"
},
"id": {
"type": "string",
"format": "uri"
},
"issuer": {
"$ref": "#/definitions/uriOrId"
},
"issuanceDate": {
"type": "string",
"format": "date-time"
},
"expirationDate": {
"type": "string",
"format": "date-time"
},
"credentialStatus": {
"$ref": "#/definitions/credentialStatus"
},
"credentialSchema": {
"$ref": "#/definitions/credentialSchema"
}
},
"definitions": {
"context": {
"type": "array",
"items": [
{
"const": "https://www.w3.org/2018/credentials/v1"
}
],
"additionalItems": {
"oneOf": [
{
"type": "string",
"format": "uri"
},
{
"type": "object"
},
{
"type": "array",
"items": {
"$ref": "#/definitions/context"
}
}
]
},
"minItems": 1,
"uniqueItems": true
},
"credentialSubject": {
"type": "object",
"required": [
"id"
],
"additionalProperties": false,
"properties": {
"id": {
"type": "string",
"format": "uri"
},
"prescription": {
"type": "string",
"order": 0,
"title": "prescription"
},
"patientDetails": {
"type": "string",
"order": 1,
"title": "patientDetails"
}
}
},
"VerifiableCredential": {
"const": "VerifiableCredential"
},
"credentialSchema": {
"oneOf": [
{
"$ref": "#/definitions/idAndType"
},
{
"type": "array",
"items": {
"$ref": "#/definitions/idAndType"
},
"minItems": 1,
"uniqueItems": true
}
]
},
"credentialStatus": {
"oneOf": [
{
"$ref": "#/definitions/idAndType"
},
{
"type": "array",
"items": {
"$ref": "#/definitions/idAndType"
},
"minItems": 1,
"uniqueItems": true
}
]
},
"idAndType": {
"type": "object",
"required": [
"id",
"type"
],
"properties": {
"id": {
"type": "string",
"format": "uri"
},
"type": {
"type": "string"
}
}
},
"uriOrId": {
"oneOf": [
{
"type": "string",
"format": "uri"
},
{
"type": "object",
"required": [
"id"
],
"properties": {
"id": {
"type": "string",
"format": "uri"
}
}
}
]
},
"Prescription": {
"const": "Prescription"
}
},
"title": "Prescription",
"description": "Prescription"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment