To solve this linear programming optimization problem, we first need to define the decision variables, objective function, and constraints based on the given information.

Let's denote:
- \(x_b\) as the number of blue jelly pouches purchased.
- \(x_r\) as the number of red jelly pouches purchased.

The objective is to minimize the total cost of purchasing these jelly pouches. Given that each blue jelly pouch costs $5 and each red jelly pouch costs $7, the objective function can be written as:
\[ \text{Minimize} \quad 5x_b + 7x_r \]

Now, let's define the constraints based on the mineral requirements:
1. Calcium requirement: Each blue jelly pouch contains 2 units of calcium, and each red jelly pouch contains 3 units of calcium. The patient needs at least 30 units of calcium.
\[ 2x_b + 3x_r \geq 30 \]

2. Potassium requirement: Each blue jelly pouch contains 1 unit of potassium, and each red jelly pouch contains 2 units of potassium. The patient needs at least 25 units of potassium.
\[ x_b + 2x_r \geq 25 \]

3. Sodium requirement: Each blue jelly pouch contains 3 units of sodium, and each red jelly pouch contains 1 unit of sodium. The patient needs at least 30 units of sodium.
\[ 3x_b + x_r \geq 30 \]

Additionally, since we cannot purchase a negative number of jelly pouches, we have non-negativity constraints:
\[ x_b \geq 0 \]
\[ x_r \geq 0 \]

Given these definitions, we can now translate the problem into Gurobi code in Python.

```python
from gurobipy import *

# Create a model
m = Model("Jelly_Pouch_Optimization")

# Define decision variables
x_b = m.addVar(vtype=GRB.CONTINUOUS, name="blue_pouches")
x_r = m.addVar(vtype=GRB.CONTINUOUS, name="red_pouches")

# Set the objective function
m.setObjective(5*x_b + 7*x_r, GRB.MINIMIZE)

# Add constraints
m.addConstr(2*x_b + 3*x_r >= 30, "calcium_requirement")
m.addConstr(x_b + 2*x_r >= 25, "potassium_requirement")
m.addConstr(3*x_b + x_r >= 30, "sodium_requirement")

# Optimize the model
m.optimize()

# Print results
if m.status == GRB.OPTIMAL:
    print("Optimal solution found:")
    print(f"Blue pouches: {x_b.x}")
    print(f"Red pouches: {x_r.x}")
    print(f"Total cost: ${5*x_b.x + 7*x_r.x:.2f}")
else:
    print("No optimal solution found")
```