The medicine catalog is PharmaVault’s centralised drug reference. Rather than letting users type free-form medicine names directly into their inventory, the application separates drug metadata — name, pharmaceutical form, and dosage — into a dedicatedDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/JReyna217/PharmaVault/llms.txt
Use this file to discover all available pages before exploring further.
medicine_catalog table. Inventory entries then reference catalog records by catalog_id. This design prevents duplicate or misspelled entries, keeps drug details consistent across all your inventory rows, and lets you deactivate a medicine without losing historical stock data.
The MedicineCatalog Model
- Fields
- Validation rules
Auto-generated primary key returned by PostgreSQL via
RETURNING catalog_id on insert. Used as the foreign key in the inventory table.The full medicine name (e.g., Amoxicillin, Ibuprofen 400mg Tablet). Required; maximum 250 characters.
The dosage form of the medicine. Required; maximum 50 characters. This is a free-text field — see the note below for common values.
Optional strength or concentration string (e.g.,
500mg, 10mg/5mL). Maximum 50 characters. May be left blank when the strength is already encoded in the name.Controls visibility in the inventory form’s medicine dropdown. Defaults to
true when a new record is created. Set to false via Toggle Active Status to perform a soft-delete.Pharmaceutical Forms
PharmaceuticalForm is a free-text field — there is no fixed enumeration. You may enter any value that accurately describes the medicine’s dosage form. Common examples include:Tablet · Capsule · Syrup · Injection · Cream · Drops · Inhaler · Patch · Suppository · SolutionConsistency in naming helps the inventory’s real-time search to group related entries correctly.Catalog Operations
List All Medicines — GetAllAsync
List All Medicines — GetAllAsync
Returns every record in SQL:Called from:
medicine_catalog, ordered alphabetically by name ASC. Both active and inactive medicines are returned so the catalog management page can display the full list and allow administrators to toggle status.Interface signature:Medicines.razor.cs → LoadMedicinesAsync() and Inventory.razor.cs → OnInitializedAsync() to populate the catalog dropdown.Create Medicine — CreateAsync
Create Medicine — CreateAsync
Inserts a new record into New medicines are created with
medicine_catalog and returns the auto-generated primary key.Interface signature:IsActive = true by default (the model’s property initialiser). The catalog_id is returned via PostgreSQL’s RETURNING clause.Returns: The int primary key (catalog_id) of the newly inserted record.Update Medicine — UpdateAsync
Update Medicine — UpdateAsync
Overwrites all mutable fields on an existing catalog record.Interface signature:All four editable fields are updated in a single statement:
Returns:
| Field | Notes |
|---|---|
Name | Required; max 250 chars |
PharmaceuticalForm | Required; max 50 chars |
Dosage | Optional; set to NULL to clear |
IsActive | Can be toggled here as well as via ToggleActiveAsync |
true if one row was updated; false if the catalog_id was not found.Toggle Active Status — ToggleActiveAsync
Toggle Active Status — ToggleActiveAsync
Performs a targeted update that flips only the The Returns:
is_active column for a given catalog_id. This is the mechanism behind soft-delete in PharmaVault.Interface signature:Medicines.razor.cs page passes the inverse of the current status so the button acts as a toggle:true if the row was found and updated; false otherwise.Active/Inactive Status
TheIsActive flag is PharmaVault’s soft-delete mechanism for the catalog. Setting a medicine to inactive has the following effect:
Catalog page
The record remains visible in the full catalog list so you can review it, re-activate it, or update its details at any time.
Inventory form
Inactive medicines are not shown in the medicine dropdown on the Add/Edit Inventory form. Users cannot create new stock entries referencing an inactive catalog record.