health.hats.listGrants

Grants the caller gave, as a patient, and grants the caller holds, as a grantee: one entry per request, newest first. Authenticated by service auth, so each caller sees only their own.

Repository @hats.health did:plc:uvvhtareovj2oaregs7vsibv not from the namespace authority
Details · query
Kindquery
Authorityhats.health
Indexed
cid bafyreigmfzyjicisbuvl3jhope4niurvpfjrzj76icqsoskn5ucbf4beh4

Checks

Valid
JSONDownload
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "grant": {
      "description": "One request's grants and where they stand. The caller is the patient or the grantee.",
      "properties": {
        "answeredAt": {
          "description": "When the patient approved or declined the request.",
          "format": "datetime",
          "type": "string"
        },
        "createdAt": {
          "format": "datetime",
          "type": "string"
        },
        "expiresAt": {
          "format": "datetime",
          "type": "string"
        },
        "grant": {
          "description": "The grant record in the patient's audit space that backs an approval.",
          "format": "at-uri",
          "type": "string"
        },
        "grantee": {
          "format": "did",
          "type": "string"
        },
        "id": {
          "description": "The request's identifier, as listRequests and answerRequest use it.",
          "type": "string"
        },
        "institution": {
          "description": "The institution the grantee acts for, as the registry names it.",
          "type": "string"
        },
        "patient": {
          "format": "did",
          "type": "string"
        },
        "reason": {
          "description": "HL7 PurposeOfUse code the request was made under.",
          "type": "string"
        },
        "reasonText": {
          "description": "What the requester said beside the code: for break-glass, why the patient couldn't be asked.",
          "type": "string"
        },
        "revokedAt": {
          "description": "When the patient revoked the approval.",
          "format": "datetime",
          "type": "string"
        },
        "role": {
          "description": "The grantee's NUCC Health Care Provider Taxonomy code, from the provider registry.",
          "type": "string"
        },
        "spaces": {
          "items": {
            "ref": "#space",
            "type": "ref"
          },
          "type": "array"
        },
        "status": {
          "knownValues": [
            "pending",
            "granted",
            "declined",
            "revoked",
            "expired"
          ],
          "type": "string"
        }
      },
      "required": [
        "id",
        "patient",
        "grantee",
        "reason",
        "status",
        "spaces",
        "createdAt"
      ],
      "type": "object"
    },
    "main": {
      "description": "Grants the caller gave, as a patient, and grants the caller holds, as a grantee: one entry per request, newest first. Authenticated by service auth, so each caller sees only their own.",
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "grants": {
              "items": {
                "ref": "#grant",
                "type": "ref"
              },
              "type": "array"
            }
          },
          "required": [
            "grants"
          ],
          "type": "object"
        }
      },
      "type": "query"
    },
    "space": {
      "properties": {
        "access": {
          "knownValues": [
            "read",
            "write"
          ],
          "type": "string"
        },
        "skey": {
          "type": "string"
        },
        "spaceType": {
          "format": "nsid",
          "type": "string"
        }
      },
      "required": [
        "spaceType",
        "skey",
        "access"
      ],
      "type": "object"
    }
  },
  "id": "health.hats.listGrants",
  "lexicon": 1
}