Branding, Excel watermark, live run progress, and uv
- Login and Reports pages: eCare logo, Waystar and Aquilaehr logos (light versions for the dark pages), eCare favicon. - Excel reports: faded eCare/Waystar/Aquila watermark as the sheet background on both sheets. Report writer moves to xlsxwriter, the only engine that can set a sheet background. - Reports page: animated run progress (both download lanes piped into the Excel sheet) and a plain-language activity feed built from the run log; the raw log stays under "Technical log". /status now returns the location count. - Dependencies move from requirements.txt to pyproject.toml + uv.lock; Dockerfile installs uv from PyPI and runs uv sync --frozen. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
2e1f28967e
commit
6616c91b7f
17 files changed
+816
-31
No files matched your search
+14
-15
@@ -5,7 +5,7 @@ Aquilaehr: Patient ("Mary Lopez Garcia") + Visit Date
|
||||
Waystar: Patient Name ("LOPEZ, MARY") + From Date
|
||||
Match = same date, same first name, and at least one last-name word in common.
|
||||
|
||||
Run: python consolidate.py
|
||||
Run: uv run consolidate.py
|
||||
"""
|
||||
from pathlib import Path
|
||||
|
||||
@@ -15,6 +15,7 @@ ROOT = Path(__file__).parent
|
||||
WAYSTAR_DIR = ROOT / "processing" / "Waystar"
|
||||
AQUILAEHR_DIR = ROOT / "processing" / "Aquilaehr"
|
||||
OUT_DIR = ROOT / "output"
|
||||
WATERMARK = str(ROOT / "static" / "report-watermark.png")
|
||||
SUFFIXES = {"JR", "SR", "II", "III", "IV"}
|
||||
|
||||
|
||||
@@ -130,20 +131,18 @@ def write_report(df, location, out):
|
||||
|
||||
|
||||
def write_xlsx(out, summary, df):
|
||||
with pd.ExcelWriter(out, engine="openpyxl") as xw:
|
||||
summary.to_excel(xw, sheet_name="Summary", index=False)
|
||||
df.to_excel(xw, sheet_name="Reconciliation", index=False)
|
||||
for ws in xw.book.worksheets:
|
||||
ws.freeze_panes = "A2"
|
||||
ws.auto_filter.ref = ws.dimensions
|
||||
for col in ws.columns:
|
||||
width = max(len(str(c.value or "")) for c in col[:200])
|
||||
ws.column_dimensions[col[0].column_letter].width = min(max(width + 2, 10), 60)
|
||||
ws = xw.book["Reconciliation"]
|
||||
for col in ws.iter_cols(min_row=1, max_row=ws.max_row):
|
||||
fmt = {"DOS": "mm/dd/yyyy", "Charges": '"$"#,##0.00'}.get(col[0].value)
|
||||
for c in col[1:] if fmt else ():
|
||||
c.number_format = fmt
|
||||
# xlsxwriter, not openpyxl: only it can set a sheet background (the eCare/Waystar/Aquilaehr watermark).
|
||||
with pd.ExcelWriter(out, engine="xlsxwriter", date_format="mm/dd/yyyy") as xw:
|
||||
money = xw.book.add_format({"num_format": '"$"#,##0.00'})
|
||||
for name, data in (("Summary", summary), ("Reconciliation", df)):
|
||||
data.to_excel(xw, sheet_name=name, index=False)
|
||||
ws = xw.sheets[name]
|
||||
ws.set_background(WATERMARK)
|
||||
ws.freeze_panes(1, 0)
|
||||
ws.autofilter(0, 0, len(data), len(data.columns) - 1)
|
||||
for i, col in enumerate(data.columns):
|
||||
width = max([len(col)] + [len(str(v)) for v in data[col].head(199) if pd.notna(v)])
|
||||
ws.set_column(i, i, min(max(width + 2, 10), 60), money if col == "Charges" else None)
|
||||
|
||||
|
||||
ALL_FILE = "All Locations.xlsx"
|
||||
|
||||
Reference in new issue
Block a user