{
  "definitions": {},
  "externalDocs": {
    "description": "Full documentation - The Daily Stomp",
    "url": "https://www.stompingbear.com/rx-trac-api/"
  },
  "info": {
    "contact": {
      "name": "Rx-Trac"
    },
    "description": "REST API for the Rx-Trac medication tracking system. Provides endpoints for managing medications, prescriptions, refills, pharmacies, prescribers, medication events, blood pressure, weight, activity logging, and medication scheduling.\n\nFull documentation: https://www.stompingbear.com/rx-trac-api/\nAuth token setup: https://www.stompingbear.com/auth-token-setup/",
    "title": "Rx-Trac API",
    "version": "1.0.0"
  },
  "paths": {
    "/med_track/add_description": {
      "post": {
        "parameters": [
          {
            "in": "body",
            "name": "body",
            "required": true,
            "schema": {
              "properties": {
                "description_start_date": {
                  "description": "YYYY-MM-DD",
                  "type": "string"
                },
                "drug_name": {
                  "type": "string"
                },
                "pill_color": {
                  "type": "string"
                },
                "pill_form": {
                  "description": "e.g. tablet, capsule",
                  "type": "string"
                },
                "pill_markings": {
                  "type": "string"
                },
                "pill_shape": {
                  "type": "string"
                },
                "pill_size": {
                  "description": "e.g. small, medium, large",
                  "type": "string"
                }
              },
              "required": [
                "drug_name",
                "pill_form",
                "pill_size",
                "pill_color",
                "pill_shape",
                "pill_markings",
                "description_start_date"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "JSON MedicationDTO with updated description."
          },
          "400": {
            "description": "Validation error."
          }
        },
        "summary": "Add a physical description to a medication.",
        "tags": [
          "Medications"
        ]
      }
    },
    "/med_track/add_med_exclusion": {
      "post": {
        "description": "<br/>A drug exists in medication_usages OR medication_exclusions, never both.<br/>",
        "parameters": [
          {
            "in": "body",
            "name": "body",
            "required": true,
            "schema": {
              "properties": {
                "event_id": {
                  "type": "integer"
                },
                "exclusion_type": {
                  "enum": [
                    "forgotten",
                    "excluded"
                  ],
                  "type": "string"
                },
                "medication_id": {
                  "type": "integer"
                },
                "note": {
                  "description": "Optional free-text note.",
                  "type": "string"
                }
              },
              "required": [
                "event_id",
                "medication_id",
                "exclusion_type"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "JSON MedicationExclusionDTO."
          },
          "400": {
            "description": "Validation error."
          }
        },
        "summary": "Add a medication exclusion to an event. Also removes the corresponding usage record.",
        "tags": [
          "Exclusions"
        ]
      }
    },
    "/med_track/add_medication": {
      "post": {
        "parameters": [
          {
            "in": "body",
            "name": "body",
            "required": true,
            "schema": {
              "properties": {
                "drug_name": {
                  "description": "Brand name.",
                  "type": "string"
                },
                "generic_name": {
                  "description": "Generic name.",
                  "type": "string"
                },
                "medication_type": {
                  "description": "One of: diuretic, beta blocker, calcium channel blocker, statin, vitamin, supplement, etc.",
                  "type": "string"
                },
                "use_generic_name": {
                  "description": "If true, display the generic name in the UI.",
                  "type": "boolean"
                }
              },
              "required": [
                "drug_name",
                "generic_name",
                "medication_type",
                "use_generic_name"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "JSON MedicationDTO with attached assets."
          },
          "400": {
            "description": "Validation error or invalid medication_type."
          }
        },
        "summary": "Add a new medication.",
        "tags": [
          "Medications"
        ]
      }
    },
    "/med_track/add_pharmacy": {
      "post": {
        "parameters": [
          {
            "in": "body",
            "name": "body",
            "required": true,
            "schema": {
              "properties": {
                "address_one": {
                  "type": "string"
                },
                "address_two": {
                  "type": "string"
                },
                "city": {
                  "type": "string"
                },
                "pharmacy_name": {
                  "type": "string"
                },
                "phone_number": {
                  "type": "string"
                },
                "state": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                },
                "zipcode": {
                  "type": "string"
                }
              },
              "required": [
                "pharmacy_name",
                "address_one",
                "address_two",
                "city",
                "state",
                "zipcode",
                "phone_number",
                "url"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "JSON PharmacyDTO."
          },
          "400": {
            "description": "Validation error."
          }
        },
        "summary": "Add a new pharmacy.",
        "tags": [
          "Pharmacies"
        ]
      }
    },
    "/med_track/add_prescriber": {
      "post": {
        "parameters": [
          {
            "in": "body",
            "name": "body",
            "required": true,
            "schema": {
              "properties": {
                "address_one": {
                  "type": "string"
                },
                "address_two": {
                  "type": "string"
                },
                "business_name": {
                  "type": "string"
                },
                "city": {
                  "type": "string"
                },
                "email": {
                  "type": "string"
                },
                "fax_number": {
                  "type": "string"
                },
                "firstname": {
                  "type": "string"
                },
                "lastname": {
                  "type": "string"
                },
                "phone_number": {
                  "type": "string"
                },
                "speciality": {
                  "description": "e.g. general, cardiology",
                  "type": "string"
                },
                "state": {
                  "type": "string"
                },
                "title": {
                  "enum": [
                    "dr",
                    "pa-c",
                    "cnp",
                    "mr",
                    "mrs",
                    "ms"
                  ],
                  "type": "string"
                },
                "zipcode": {
                  "type": "string"
                }
              },
              "required": [
                "title",
                "firstname",
                "lastname",
                "speciality",
                "phone_number",
                "fax_number",
                "email",
                "business_name",
                "address_one",
                "address_two",
                "city",
                "state",
                "zipcode"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "JSON PrescriberDTO."
          },
          "400": {
            "description": "Validation error."
          }
        },
        "summary": "Add a new prescriber.",
        "tags": [
          "Prescribers"
        ]
      }
    },
    "/med_track/add_refill": {
      "post": {
        "parameters": [
          {
            "in": "body",
            "name": "body",
            "required": true,
            "schema": {
              "properties": {
                "count": {
                  "description": "Current pill count.",
                  "type": "integer"
                },
                "drug_name": {
                  "type": "string"
                },
                "notes": {
                  "type": "string"
                },
                "pharmacy_city": {
                  "type": "string"
                },
                "pharmacy_name": {
                  "type": "string"
                },
                "refill_start_date_str": {
                  "description": "YYYY-MM-DD",
                  "type": "string"
                },
                "refill_strength": {
                  "type": "number"
                },
                "refill_strength_range": {
                  "type": "number"
                },
                "refill_strength_units": {
                  "enum": [
                    "mg",
                    "mcg"
                  ],
                  "type": "string"
                },
                "renewal_date_str": {
                  "description": "YYYY-MM-DD, or \"calc\" for automatic calculation.",
                  "type": "string"
                },
                "rx_number": {
                  "type": "string"
                },
                "starting_count": {
                  "description": "Pills at time of fill.",
                  "type": "integer"
                }
              },
              "required": [
                "drug_name",
                "pharmacy_name",
                "pharmacy_city",
                "rx_number",
                "renewal_date_str",
                "count",
                "starting_count",
                "refill_strength",
                "refill_strength_range",
                "refill_strength_units",
                "notes",
                "refill_start_date_str"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "JSON MedicationDTO with attached refill."
          },
          "400": {
            "description": "Validation error."
          }
        },
        "summary": "Add a refill record to a medication.",
        "tags": [
          "Refills"
        ]
      }
    },
    "/med_track/add_script": {
      "post": {
        "parameters": [
          {
            "in": "body",
            "name": "body",
            "required": true,
            "schema": {
              "properties": {
                "am_dose": {
                  "description": "True if taken in the morning.",
                  "type": "boolean"
                },
                "drug_name": {
                  "type": "string"
                },
                "frequency_per_day": {
                  "enum": [
                    "once",
                    "twice",
                    "three",
                    "four",
                    "five"
                  ],
                  "type": "string"
                },
                "noon_dose": {
                  "description": "True if taken at noon.",
                  "type": "boolean"
                },
                "pm_dose": {
                  "description": "True if taken in the evening.",
                  "type": "boolean"
                },
                "prescriber_firstname": {
                  "type": "string"
                },
                "prescriber_lastname": {
                  "type": "string"
                },
                "script_start_date": {
                  "description": "YYYY-MM-DD",
                  "type": "string"
                },
                "script_strength": {
                  "type": "number"
                },
                "script_strength_range": {
                  "type": "number"
                },
                "script_strength_units": {
                  "enum": [
                    "mg",
                    "mcg"
                  ],
                  "type": "string"
                }
              },
              "required": [
                "drug_name",
                "prescriber_firstname",
                "prescriber_lastname",
                "frequency_per_day",
                "am_dose",
                "noon_dose",
                "pm_dose",
                "script_strength",
                "script_strength_range",
                "script_strength_units",
                "script_start_date"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "JSON MedicationDTO with attached script."
          },
          "400": {
            "description": "Validation error."
          }
        },
        "summary": "Add a prescription (script) to a medication.",
        "tags": [
          "Scripts"
        ]
      }
    },
    "/med_track/close_medication": {
      "post": {
        "parameters": [
          {
            "in": "body",
            "name": "body",
            "required": true,
            "schema": {
              "properties": {
                "drug_name": {
                  "type": "string"
                },
                "end_date": {
                  "description": "YYYY-MM-DD or \"now\".",
                  "type": "string"
                },
                "generic_name": {
                  "type": "string"
                }
              },
              "required": [
                "end_date",
                "drug_name",
                "generic_name"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "JSON MedicationDTO with closed records."
          },
          "400": {
            "description": "Validation error."
          }
        },
        "summary": "Close a medication by setting description, script, and refill end dates.",
        "tags": [
          "Medications"
        ]
      }
    },
    "/med_track/get_active_medication": {
      "post": {
        "parameters": [
          {
            "in": "body",
            "name": "body",
            "required": true,
            "schema": {
              "properties": {
                "drug_name": {
                  "description": "Brand or generic name of the drug.",
                  "type": "string"
                },
                "query_date": {
                  "description": "Date in YYYY-MM-DD format.",
                  "example": "2026-03-07",
                  "type": "string"
                }
              },
              "required": [
                "drug_name",
                "query_date"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "JSON MedicationDTO object."
          },
          "400": {
            "description": "Validation error."
          }
        },
        "summary": "Get a single medication and attached assets for a date.",
        "tags": [
          "Medications"
        ]
      }
    },
    "/med_track/get_active_medications": {
      "post": {
        "parameters": [
          {
            "in": "body",
            "name": "body",
            "required": true,
            "schema": {
              "properties": {
                "dosage_interval": {
                  "description": "Dosage interval to query.",
                  "enum": [
                    "am",
                    "noon",
                    "pm",
                    "all"
                  ],
                  "type": "string"
                },
                "ignore_exclusions": {
                  "description": "When true, include excluded drugs. Defaults to false.",
                  "type": "boolean"
                },
                "query_date": {
                  "description": "Date in YYYY-MM-DD format.",
                  "example": "2026-03-07",
                  "type": "string"
                }
              },
              "required": [
                "query_date",
                "dosage_interval"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "JSON list of MedicationDTO objects."
          },
          "400": {
            "description": "Validation error."
          }
        },
        "summary": "Get active medications and attached assets for a date and interval.",
        "tags": [
          "Medications"
        ]
      }
    },
    "/med_track/get_active_refills": {
      "post": {
        "parameters": [
          {
            "in": "body",
            "name": "body",
            "required": true,
            "schema": {
              "properties": {
                "query_date": {
                  "description": "YYYY-MM-DD or \"now\".",
                  "type": "string"
                }
              },
              "required": [
                "query_date"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "JSON array of RefillPlusDTO objects."
          },
          "400": {
            "description": "Validation error."
          }
        },
        "summary": "Get active refills with medication metadata for a date.",
        "tags": [
          "Refills"
        ]
      }
    },
    "/med_track/get_activity_totals": {
      "post": {
        "parameters": [
          {
            "in": "body",
            "name": "body",
            "required": true,
            "schema": {
              "properties": {
                "activity": {
                  "description": "Activity name, or \"all\" for every activity.",
                  "type": "string"
                },
                "query_date": {
                  "description": "YYYY-MM-DD or \"now\".",
                  "type": "string"
                }
              },
              "required": [
                "query_date",
                "activity"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "JSON list of ActivityTotalDTO objects."
          },
          "400": {
            "description": "Validation error."
          }
        },
        "summary": "Get aggregated unit totals per activity for a single date.",
        "tags": [
          "Activity"
        ]
      }
    },
    "/med_track/get_activity_totals_range": {
      "post": {
        "parameters": [
          {
            "in": "body",
            "name": "body",
            "required": true,
            "schema": {
              "properties": {
                "activity": {
                  "description": "Activity name, or \"all\" for every activity.",
                  "type": "string"
                },
                "end_date": {
                  "description": "YYYY-MM-DD or \"now\".",
                  "type": "string"
                },
                "start_date": {
                  "description": "YYYY-MM-DD or \"now\".",
                  "type": "string"
                }
              },
              "required": [
                "start_date",
                "end_date",
                "activity"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "JSON list of ActivityTotalDTO objects ordered by date."
          },
          "400": {
            "description": "Validation error."
          }
        },
        "summary": "Get aggregated unit totals per activity grouped by date across a date range.",
        "tags": [
          "Activity"
        ]
      }
    },
    "/med_track/get_exclusion_summary": {
      "post": {
        "parameters": [
          {
            "in": "body",
            "name": "body",
            "required": true,
            "schema": {
              "properties": {
                "end_date": {
                  "description": "YYYY-MM-DD",
                  "type": "string"
                },
                "start_date": {
                  "description": "YYYY-MM-DD",
                  "type": "string"
                }
              },
              "required": [
                "start_date",
                "end_date"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "JSON array of exclusion records with dosage_date, dosage_interval, medication_name, exclusion_type, note."
          },
          "400": {
            "description": "Validation error."
          }
        },
        "summary": "Get all medication exclusions across a date range, grouped for summary display.",
        "tags": [
          "Exclusions"
        ]
      }
    },
    "/med_track/get_med_exclusions": {
      "post": {
        "parameters": [
          {
            "in": "body",
            "name": "body",
            "required": true,
            "schema": {
              "properties": {
                "event_id": {
                  "description": "MedicationEvent primary key.",
                  "type": "integer"
                }
              },
              "required": [
                "event_id"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "JSON array of exclusion records with id, medication_id, medication_name, exclusion_type, note."
          },
          "400": {
            "description": "Validation error."
          }
        },
        "summary": "Get all medication exclusion records for a given event.",
        "tags": [
          "Exclusions"
        ]
      }
    },
    "/med_track/get_med_usages": {
      "post": {
        "parameters": [
          {
            "in": "body",
            "name": "body",
            "required": true,
            "schema": {
              "properties": {
                "event_id": {
                  "description": "MedicationEvent primary key.",
                  "type": "integer"
                }
              },
              "required": [
                "event_id"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "JSON array of usage records with medication_id, medication_name, strength, strength_units, count."
          },
          "400": {
            "description": "Validation error."
          }
        },
        "summary": "Get all medication usage records for a given event.",
        "tags": [
          "Exclusions"
        ]
      }
    },
    "/med_track/get_medication_counts": {
      "post": {
        "parameters": [
          {
            "in": "body",
            "name": "body",
            "required": true,
            "schema": {
              "properties": {
                "drug_name": {
                  "description": "Drug name to query, or \"all\" for all drugs.",
                  "type": "string"
                },
                "query_date": {
                  "description": "YYYY-MM-DD or \"now\".",
                  "type": "string"
                }
              },
              "required": [
                "drug_name",
                "query_date"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "JSON array of MedicationCountDTO objects."
          },
          "400": {
            "description": "Validation error."
          }
        },
        "summary": "Get remaining pill counts for active medications.",
        "tags": [
          "Medications"
        ]
      }
    },
    "/med_track/get_medication_schedule": {
      "post": {
        "parameters": [
          {
            "in": "body",
            "name": "body",
            "required": true,
            "schema": {
              "properties": {
                "query_date": {
                  "description": "YYYY-MM-DD or \"now\".",
                  "type": "string"
                }
              },
              "required": [
                "query_date"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "JSON array of schedule rows with medication_id, display_name, script_id, am_count, noon_count, pm_count, target_count."
          },
          "400": {
            "description": "Validation error."
          }
        },
        "summary": "Get the AM/Noon/PM dose schedule for all active medications on a given date.",
        "tags": [
          "Schedule"
        ]
      }
    },
    "/med_track/get_pharmacies": {
      "get": {
        "responses": {
          "200": {
            "description": "JSON array of PharmacyDTO objects."
          }
        },
        "summary": "List all pharmacies.",
        "tags": [
          "Pharmacies"
        ]
      }
    },
    "/med_track/get_pharmacy": {
      "post": {
        "parameters": [
          {
            "in": "body",
            "name": "body",
            "required": true,
            "schema": {
              "properties": {
                "pharmacy_city": {
                  "type": "string"
                },
                "pharmacy_name": {
                  "type": "string"
                }
              },
              "required": [
                "pharmacy_name",
                "pharmacy_city"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "JSON PharmacyDTO object, or null if not found."
          },
          "400": {
            "description": "Validation error."
          }
        },
        "summary": "Get a pharmacy by name and city.",
        "tags": [
          "Pharmacies"
        ]
      }
    },
    "/med_track/get_prescriber": {
      "post": {
        "parameters": [
          {
            "in": "body",
            "name": "body",
            "required": true,
            "schema": {
              "properties": {
                "firstname": {
                  "type": "string"
                },
                "lastname": {
                  "type": "string"
                }
              },
              "required": [
                "firstname",
                "lastname"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "JSON PrescriberDTO object, or null if not found."
          },
          "400": {
            "description": "Validation error."
          }
        },
        "summary": "Get a prescriber by first and last name.",
        "tags": [
          "Prescribers"
        ]
      }
    },
    "/med_track/get_prescribers": {
      "get": {
        "responses": {
          "200": {
            "description": "JSON array of PrescriberDTO objects."
          }
        },
        "summary": "List all prescribers.",
        "tags": [
          "Prescribers"
        ]
      }
    },
    "/med_track/get_recent_activities": {
      "post": {
        "parameters": [
          {
            "in": "body",
            "name": "body",
            "required": true,
            "schema": {
              "properties": {
                "count": {
                  "description": "Number of entries to return.",
                  "type": "integer"
                }
              },
              "required": [
                "count"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "JSON array of ActivityLogDTO objects."
          },
          "400": {
            "description": "Validation error."
          }
        },
        "summary": "Get the most recent activity log entries.",
        "tags": [
          "Activity"
        ]
      }
    },
    "/med_track/get_recent_blood_pressures": {
      "post": {
        "parameters": [
          {
            "in": "body",
            "name": "body",
            "required": true,
            "schema": {
              "properties": {
                "count": {
                  "description": "Number of readings to return.",
                  "type": "integer"
                }
              },
              "required": [
                "count"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "JSON array of BloodPressureDTO objects."
          },
          "400": {
            "description": "Validation error."
          }
        },
        "summary": "Get the most recent blood pressure readings.",
        "tags": [
          "Blood Pressure"
        ]
      }
    },
    "/med_track/get_recent_events": {
      "post": {
        "parameters": [
          {
            "in": "body",
            "name": "body",
            "required": true,
            "schema": {
              "properties": {
                "count": {
                  "description": "Number of events to return.",
                  "type": "integer"
                }
              },
              "required": [
                "count"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "JSON array of MedicationEventDTO objects."
          },
          "400": {
            "description": "Validation error."
          }
        },
        "summary": "Get the most recent MedicationEvents.",
        "tags": [
          "Events"
        ]
      }
    },
    "/med_track/get_recent_exclusion_notes": {
      "post": {
        "parameters": [
          {
            "in": "body",
            "name": "body",
            "required": true,
            "schema": {
              "properties": {
                "limit": {
                  "description": "Maximum number of notes to return (default 5).",
                  "type": "integer"
                },
                "medication_id": {
                  "description": "Medication primary key.",
                  "type": "integer"
                }
              },
              "required": [
                "medication_id"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "JSON array of note strings, most recent first."
          },
          "400": {
            "description": "Validation error."
          }
        },
        "summary": "Get the most recent distinct notes for a given medication.",
        "tags": [
          "Exclusions"
        ]
      }
    },
    "/med_track/get_recent_weights": {
      "post": {
        "parameters": [
          {
            "in": "body",
            "name": "body",
            "required": true,
            "schema": {
              "properties": {
                "count": {
                  "description": "Number of readings to return.",
                  "type": "integer"
                }
              },
              "required": [
                "count"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "JSON array of WeightDTO objects."
          },
          "400": {
            "description": "Validation error."
          }
        },
        "summary": "Get the most recent weight readings.",
        "tags": [
          "Weight"
        ]
      }
    },
    "/med_track/post_activity": {
      "post": {
        "description": "<br/>If posted between midnight and 4AM, the date is automatically assigned to the previous day.<br/>",
        "parameters": [
          {
            "in": "body",
            "name": "body",
            "required": true,
            "schema": {
              "properties": {
                "activity": {
                  "description": "Activity name, e.g. stairs, walking.",
                  "type": "string"
                },
                "date_posted": {
                  "description": "YYYY-MM-DD or \"now\".",
                  "type": "string"
                },
                "time_posted": {
                  "description": "HH:MM or \"now\".",
                  "type": "string"
                },
                "unit_count": {
                  "description": "Number of units, e.g. 3.0.",
                  "type": "number"
                },
                "unit_label": {
                  "description": "Unit of measurement, e.g. flights, miles.",
                  "type": "string"
                }
              },
              "required": [
                "date_posted",
                "time_posted",
                "activity",
                "unit_count",
                "unit_label"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "JSON ActivityLogDTO."
          },
          "400": {
            "description": "Validation error."
          }
        },
        "summary": "Post a single activity log entry.",
        "tags": [
          "Activity"
        ]
      }
    },
    "/med_track/post_bp": {
      "post": {
        "parameters": [
          {
            "in": "body",
            "name": "body",
            "required": true,
            "schema": {
              "properties": {
                "date_posted": {
                  "description": "YYYY-MM-DD or \"now\".",
                  "type": "string"
                },
                "diastolic": {
                  "type": "integer"
                },
                "pulse": {
                  "type": "integer"
                },
                "systolic": {
                  "type": "integer"
                },
                "time_posted": {
                  "description": "HH:MM or HH:MM:SS or \"now\".",
                  "type": "string"
                }
              },
              "required": [
                "date_posted",
                "time_posted",
                "systolic",
                "diastolic",
                "pulse"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "JSON BloodPressureDTO."
          },
          "400": {
            "description": "Validation error."
          }
        },
        "summary": "Post a blood pressure reading.",
        "tags": [
          "Blood Pressure"
        ]
      }
    },
    "/med_track/post_lbs": {
      "post": {
        "parameters": [
          {
            "in": "body",
            "name": "body",
            "required": true,
            "schema": {
              "properties": {
                "date_posted": {
                  "description": "YYYY-MM-DD or \"now\".",
                  "type": "string"
                },
                "time_posted": {
                  "description": "HH:MM or HH:MM:SS or \"now\".",
                  "type": "string"
                },
                "weight": {
                  "description": "Weight in pounds.",
                  "type": "integer"
                }
              },
              "required": [
                "date_posted",
                "time_posted",
                "weight"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "JSON WeightDTO."
          },
          "400": {
            "description": "Validation error."
          }
        },
        "summary": "Post a weight reading.",
        "tags": [
          "Weight"
        ]
      }
    },
    "/med_track/post_meds": {
      "post": {
        "description": "<br/>Creates a MedicationEvent with a MedicationUsage record for every active drug<br/>in the given interval. If posted between midnight and 4AM for a PM interval,<br/>the dosage date is automatically assigned to the previous day.<br/>",
        "parameters": [
          {
            "in": "body",
            "name": "body",
            "required": true,
            "schema": {
              "properties": {
                "date_posted": {
                  "description": "YYYY-MM-DD or \"now\".",
                  "type": "string"
                },
                "dosage_date": {
                  "description": "YYYY-MM-DD or \"calc\" to derive from date_posted/time_posted.",
                  "type": "string"
                },
                "dosage_interval": {
                  "enum": [
                    "am",
                    "noon",
                    "pm"
                  ],
                  "type": "string"
                },
                "ignore_exclusions": {
                  "description": "When true, bypass the exclusions.yaml list.",
                  "type": "boolean"
                },
                "time_posted": {
                  "description": "HH:MM or HH:MM:SS or \"now\".",
                  "type": "string"
                }
              },
              "required": [
                "dosage_interval",
                "date_posted",
                "time_posted",
                "dosage_date",
                "ignore_exclusions"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "JSON MedicationEventDTO, or empty object if no drugs to post."
          },
          "400": {
            "description": "Validation error."
          }
        },
        "summary": "Post a medication event for a dosage interval and date.",
        "tags": [
          "Events"
        ]
      }
    },
    "/med_track/remove_med_exclusion": {
      "post": {
        "description": "<br/>A drug exists in medication_usages OR medication_exclusions, never both.<br/>",
        "parameters": [
          {
            "in": "body",
            "name": "body",
            "required": true,
            "schema": {
              "properties": {
                "exclusion_id": {
                  "description": "MedicationExclusion primary key.",
                  "type": "integer"
                }
              },
              "required": [
                "exclusion_id"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "JSON confirmation with status and exclusion_id."
          },
          "404": {
            "description": "Exclusion record not found."
          }
        },
        "summary": "Remove a medication exclusion and restore the drug to the usage table.",
        "tags": [
          "Exclusions"
        ]
      }
    },
    "/med_track/update_script_schedule": {
      "post": {
        "parameters": [
          {
            "in": "body",
            "name": "body",
            "required": true,
            "schema": {
              "properties": {
                "am_dose": {
                  "description": "True if the drug is taken in the morning.",
                  "type": "boolean"
                },
                "noon_dose": {
                  "description": "True if the drug is taken at noon.",
                  "type": "boolean"
                },
                "pm_dose": {
                  "description": "True if the drug is taken in the evening.",
                  "type": "boolean"
                },
                "script_id": {
                  "type": "integer"
                }
              },
              "required": [
                "script_id",
                "am_dose",
                "noon_dose",
                "pm_dose"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "JSON confirmation with script_id and updated flags."
          },
          "400": {
            "description": "Validation error."
          }
        },
        "summary": "Update the AM/Noon/PM dose flags for a script.",
        "tags": [
          "Schedule"
        ]
      }
    }
  },
  "schemes": [
    "http",
    "https"
  ],
  "security": [
    {
      "Bearer": []
    }
  ],
  "securityDefinitions": {
    "Bearer": {
      "description": "JWT Bearer token from Authentik. Format: Bearer <token>\nGet a token: auth-token rx-trac\nSetup guide: https://www.stompingbear.com/auth-token-setup/",
      "in": "header",
      "name": "Authorization",
      "type": "apiKey"
    }
  },
  "swagger": "2.0"
}
