API Referenceapipatient-graphGET /v1/adherence/calendar

GET /v1/adherence/calendar

Service: patient-graph · operationId: (none)

Required scopes

(no scope declared — review service config)

Query parameters

  • patient_id (string) required
  • month (string) —
  • start (string) —
  • end (string) —
  • from (string) —
  • to (string) —
  • protocol_id (string) —
  • protocol_compound_id (string) —

Responses

200 Protocol adherence calendar (legacy month view or resolved-compound range)

{
  "anyOf": [
    {
      "type": "object",
      "properties": {
        "patient_id": {
          "type": "string"
        },
        "protocol_id": {
          "type": [
            "string",
            "null"
          ]
        },
        "protocol_compound_id": {
          "type": [
            "string",
            "null"
          ],
          "format": "uuid"
        },
        "month": {
          "type": [
            "string",
            "null"
          ]
        },
        "start": {
          "type": "string"
        },
        "end": {
          "type": "string"
        },
        "days": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "date": {
                "type": "string"
              },
              "status": {
                "type": "string",
                "enum": [
                  "taken",
                  "missed",
                  "scheduled",
                  "off"
                ]
              }
            },
            "required": [
              "date",
              "status"
            ]
          }
        },
        "resolved_days": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "date": {
                "type": "string"
              },
              "weekday": {
                "type": "integer",
                "minimum": 0,
                "maximum": 6
              },
              "morning": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "protocol_compound_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "compound_slug": {
                      "type": "string"
                    },
                    "display_name": {
                      "type": "string"
                    },
                    "dose_amount": {
                      "type": "string"
                    },
                    "dose_unit": {
                      "type": "string"
                    },
                    "route": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "taken": {
                      "type": "boolean"
                    },
                    "schedule_changed": {
                      "type": "boolean"
                    },
                    "source": {
                      "type": "string",
                      "enum": [
                        "canonical",
                        "schedule",
                        "overridden",
                        "added"
                      ]
                    }
                  },
                  "required": [
                    "protocol_compound_id",
                    "compound_slug",
                    "display_name",
                    "dose_amount",
                    "dose_unit",
                    "route",
                    "taken",
                    "schedule_changed",
                    "source"
                  ]
                }
              },
              "afternoon": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "protocol_compound_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "compound_slug": {
                      "type": "string"
                    },
                    "display_name": {
                      "type": "string"
                    },
                    "dose_amount": {
                      "type": "string"
                    },
                    "dose_unit": {
                      "type": "string"
                    },
                    "route": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "taken": {
                      "type": "boolean"
                    },
                    "schedule_changed": {
                      "type": "boolean"
                    },
                    "source": {
                      "type": "string",
                      "enum": [
                        "canonical",
                        "schedule",
                        "overridden",
                        "added"
                      ]
                    }
                  },
                  "required": [
                    "protocol_compound_id",
                    "compound_slug",
                    "display_name",
                    "dose_amount",
                    "dose_unit",
                    "route",
                    "taken",
                    "schedule_changed",
                    "source"
                  ]
                }
              },
              "evening": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "protocol_compound_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "compound_slug": {
                      "type": "string"
                    },
                    "display_name": {
                      "type": "string"
                    },
                    "dose_amount": {
                      "type": "string"
                    },
                    "dose_unit": {
                      "type": "string"
                    },
                    "route": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "taken": {
                      "type": "boolean"
                    },
                    "schedule_changed": {
                      "type": "boolean"
                    },
                    "source": {
                      "type": "string",
                      "enum": [
                        "canonical",
                        "schedule",
                        "overridden",
                        "added"
                      ]
                    }
                  },
                  "required": [
                    "protocol_compound_id",
                    "compound_slug",
                    "display_name",
                    "dose_amount",
                    "dose_unit",
                    "route",
                    "taken",
                    "schedule_changed",
                    "source"
                  ]
                }
              },
              "before_bed": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "protocol_compound_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "compound_slug": {
                      "type": "string"
                    },
                    "display_name": {
                      "type": "string"
                    },
                    "dose_amount": {
                      "type": "string"
                    },
                    "dose_unit": {
                      "type": "string"
                    },
                    "route": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "taken": {
                      "type": "boolean"
                    },
                    "schedule_changed": {
                      "type": "boolean"
                    },
                    "source": {
                      "type": "string",
                      "enum": [
                        "canonical",
                        "schedule",
                        "overridden",
                        "added"
                      ]
                    }
                  },
                  "required": [
                    "protocol_compound_id",
                    "compound_slug",
                    "display_name",
                    "dose_amount",
                    "dose_unit",
                    "route",
                    "taken",
                    "schedule_changed",
                    "source"
                  ]
                }
              }
            },
            "required": [
              "date",
              "weekday",
              "morning",
              "afternoon",
              "evening",
              "before_bed"
            ]
          }
        }
      },
      "required": [
        "patient_id",
        "protocol_id",
        "protocol_compound_id",
        "month",
        "start",
        "end",
        "days",
        "resolved_days"
      ]
    },
    {
      "type": "object",
      "properties": {
        "patient_id": {
          "type": "string"
        },
        "from": {
          "type": "string"
        },
        "to": {
          "type": "string"
        },
        "days": {
          "type": "object",
          "additionalProperties": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "protocol_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "protocol_name": {
                  "type": "string"
                },
                "protocol_category": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "version_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "protocol_compound_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "compound_id": {
                  "type": "string"
                },
                "compound_slug": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "dose": {
                  "type": "object",
                  "properties": {
                    "amount": {
                      "type": "string"
                    },
                    "unit": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "amount",
                    "unit"
                  ]
                },
                "schedule": {
                  "type": "object",
                  "properties": {
                    "days_of_week": {
                      "type": "array",
                      "items": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 6
                      }
                    }
                  },
                  "required": [
                    "days_of_week"
                  ]
                },
                "route": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "source": {
                  "type": "string",
                  "enum": [
                    "canonical",
                    "overridden",
                    "added"
                  ]
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "taken",
                    "skipped",
                    "scheduled"
                  ]
                },
                "timing": {
                  "type": "string",
                  "enum": [
                    "morning",
                    "afternoon",
                    "evening",
                    "before_bed"
                  ]
                }
              },
              "required": [
                "protocol_id",
                "protocol_name",
                "protocol_category",
                "version_id",
                "protocol_compound_id",
                "compound_id",
                "compound_slug",
                "name",
                "dose",
                "schedule",
                "route",
                "source",
                "status",
                "timing"
              ]
            }
          }
        }
      },
      "required": [
        "patient_id",
        "from",
        "to",
        "days"
      ]
    }
  ]
}

400 Bad request

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "message": {
      "type": "string"
    }
  },
  "required": [
    "error",
    "message"
  ]
}

401 Unauthorized

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "message": {
      "type": "string"
    }
  },
  "required": [
    "error",
    "message"
  ]
}

404 Patient not found

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "message": {
      "type": "string"
    }
  },
  "required": [
    "error",
    "message"
  ]
}

Example

curl -X GET https://patient-graph.platform.loop.health/v1/adherence/calendar \
  -H "Authorization: Bearer $ACCESS_TOKEN"