API Referenceapipatient-graphGET /v1/patients/{patient_id}/metrics/{metric_key}

GET /v1/patients/\{patient_id\}/metrics/\{metric_key\}

Service: patient-graph · operationId: (none)

Required scopes

(no scope declared — review service config)

Path parameters

  • patient_id (string) required
  • metric_key (string) required

Query parameters

  • from (string) —
  • to (string) —
  • granularity (string) —

Responses

200 Metric time-series

{
  "type": "object",
  "properties": {
    "patient_id": {
      "type": "string"
    },
    "metric_key": {
      "type": "string"
    },
    "data": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "patient_id": {
            "type": "string"
          },
          "brand_id": {
            "type": "string"
          },
          "metric_key": {
            "type": "string"
          },
          "value_numeric": {
            "type": [
              "string",
              "null"
            ]
          },
          "value_text": {
            "type": [
              "string",
              "null"
            ]
          },
          "unit": {
            "type": [
              "string",
              "null"
            ]
          },
          "source": {
            "type": "string"
          },
          "is_phi": {
            "type": "boolean"
          },
          "recorded_at": {
            "type": "string"
          },
          "created_at": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "patient_id",
          "brand_id",
          "metric_key",
          "value_numeric",
          "value_text",
          "unit",
          "source",
          "is_phi",
          "recorded_at",
          "created_at"
        ]
      }
    },
    "count": {
      "type": "number"
    }
  },
  "required": [
    "patient_id",
    "metric_key",
    "data",
    "count"
  ]
}

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/patients/{patient_id}/metrics/{metric_key} \
  -H "Authorization: Bearer $ACCESS_TOKEN"