API Referenceapipatient-graphGET /v1/adherence/resolved-compounds

GET /v1/adherence/resolved-compounds

Service: patient-graph · operationId: (none)

Required scopes

(no scope declared — review service config)

Query parameters

  • patient_id (string) required
  • date (string) required
  • protocol_id (string) —

Responses

200 Resolved compounds for a single date, bucketed by time_of_day

{
  "type": "object",
  "properties": {
    "patient_id": {
      "type": "string",
      "format": "uuid"
    },
    "protocol_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid"
    },
    "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_id": {
            "type": "string"
          },
          "compound_slug": {
            "type": "string"
          },
          "display_name": {
            "type": "string"
          },
          "dose_amount": {
            "type": "string"
          },
          "dose_unit": {
            "type": "string"
          },
          "route": {
            "type": [
              "string",
              "null"
            ]
          },
          "days_of_week": {
            "type": "array",
            "items": {
              "type": "integer",
              "minimum": 0,
              "maximum": 6
            }
          },
          "time_of_day": {
            "type": "string",
            "enum": [
              "morning",
              "afternoon",
              "evening",
              "before_bed"
            ]
          },
          "source": {
            "type": "string",
            "enum": [
              "canonical",
              "schedule",
              "overridden",
              "added"
            ]
          },
          "schedule_changed": {
            "type": "boolean"
          }
        },
        "required": [
          "protocol_compound_id",
          "compound_id",
          "compound_slug",
          "display_name",
          "dose_amount",
          "dose_unit",
          "route",
          "days_of_week",
          "time_of_day",
          "source",
          "schedule_changed"
        ]
      }
    },
    "afternoon": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "protocol_compound_id": {
            "type": "string",
            "format": "uuid"
          },
          "compound_id": {
            "type": "string"
          },
          "compound_slug": {
            "type": "string"
          },
          "display_name": {
            "type": "string"
          },
          "dose_amount": {
            "type": "string"
          },
          "dose_unit": {
            "type": "string"
          },
          "route": {
            "type": [
              "string",
              "null"
            ]
          },
          "days_of_week": {
            "type": "array",
            "items": {
              "type": "integer",
              "minimum": 0,
              "maximum": 6
            }
          },
          "time_of_day": {
            "type": "string",
            "enum": [
              "morning",
              "afternoon",
              "evening",
              "before_bed"
            ]
          },
          "source": {
            "type": "string",
            "enum": [
              "canonical",
              "schedule",
              "overridden",
              "added"
            ]
          },
          "schedule_changed": {
            "type": "boolean"
          }
        },
        "required": [
          "protocol_compound_id",
          "compound_id",
          "compound_slug",
          "display_name",
          "dose_amount",
          "dose_unit",
          "route",
          "days_of_week",
          "time_of_day",
          "source",
          "schedule_changed"
        ]
      }
    },
    "evening": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "protocol_compound_id": {
            "type": "string",
            "format": "uuid"
          },
          "compound_id": {
            "type": "string"
          },
          "compound_slug": {
            "type": "string"
          },
          "display_name": {
            "type": "string"
          },
          "dose_amount": {
            "type": "string"
          },
          "dose_unit": {
            "type": "string"
          },
          "route": {
            "type": [
              "string",
              "null"
            ]
          },
          "days_of_week": {
            "type": "array",
            "items": {
              "type": "integer",
              "minimum": 0,
              "maximum": 6
            }
          },
          "time_of_day": {
            "type": "string",
            "enum": [
              "morning",
              "afternoon",
              "evening",
              "before_bed"
            ]
          },
          "source": {
            "type": "string",
            "enum": [
              "canonical",
              "schedule",
              "overridden",
              "added"
            ]
          },
          "schedule_changed": {
            "type": "boolean"
          }
        },
        "required": [
          "protocol_compound_id",
          "compound_id",
          "compound_slug",
          "display_name",
          "dose_amount",
          "dose_unit",
          "route",
          "days_of_week",
          "time_of_day",
          "source",
          "schedule_changed"
        ]
      }
    },
    "before_bed": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "protocol_compound_id": {
            "type": "string",
            "format": "uuid"
          },
          "compound_id": {
            "type": "string"
          },
          "compound_slug": {
            "type": "string"
          },
          "display_name": {
            "type": "string"
          },
          "dose_amount": {
            "type": "string"
          },
          "dose_unit": {
            "type": "string"
          },
          "route": {
            "type": [
              "string",
              "null"
            ]
          },
          "days_of_week": {
            "type": "array",
            "items": {
              "type": "integer",
              "minimum": 0,
              "maximum": 6
            }
          },
          "time_of_day": {
            "type": "string",
            "enum": [
              "morning",
              "afternoon",
              "evening",
              "before_bed"
            ]
          },
          "source": {
            "type": "string",
            "enum": [
              "canonical",
              "schedule",
              "overridden",
              "added"
            ]
          },
          "schedule_changed": {
            "type": "boolean"
          }
        },
        "required": [
          "protocol_compound_id",
          "compound_id",
          "compound_slug",
          "display_name",
          "dose_amount",
          "dose_unit",
          "route",
          "days_of_week",
          "time_of_day",
          "source",
          "schedule_changed"
        ]
      }
    },
    "hidden": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "protocol_compound_id": {
            "type": "string",
            "format": "uuid"
          },
          "compound_slug": {
            "type": "string"
          },
          "display_name": {
            "type": "string"
          },
          "reason": {
            "type": "string",
            "enum": [
              "removed_by_member"
            ]
          }
        },
        "required": [
          "protocol_compound_id",
          "compound_slug",
          "display_name",
          "reason"
        ]
      }
    }
  },
  "required": [
    "patient_id",
    "protocol_id",
    "date",
    "weekday",
    "morning",
    "afternoon",
    "evening",
    "before_bed",
    "hidden"
  ]
}

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/resolved-compounds \
  -H "Authorization: Bearer $ACCESS_TOKEN"