This package provides an interface to interact with AthenaIDX interface via Selenium
Project description
AthenaIDX — Selenium Page Object Model helpers
This repository contains the athenaidx Python package: Selenium-based helpers, Page Object Model (POM) pages, small tooling, and a few predefined workflows for working with AthenaIDX's web UI.
Install
- Create and activate a virtual environment (Windows CMD):
python -m venv .venv
.venv\Scripts\activate
python -m pip install --upgrade pip
- Install runtime/dev dependencies (recommended):
pip install -r requirements-dev.txt
# For editable install (so local edits are importable):
pip install -e .
Notes:
- This project uses Selenium. Ensure you have a compatible browser driver on PATH (or let your environment manage it).
- The
athenaidx.config.Confighelper will create a local Chrome driver by default via Selenium.
Minimal example (programmatic)
from athenaidx.config import Config
# Create a config which will create a Chrome driver by default
cfg = Config()
driver = cfg.get_driver()
# ... use page objects, workflows, etc.
# When done
driver.quit()
Repository layout (high-level)
src/athenaidx/— package rootconfig.py— small wrapper around Selenium driver lifecycle (create_driver / get_driver)model_objects/— lightweight data objects (e.g.,rejections.py)rejections.py—RejectionsandRejectionGroupeddataclasses and helpers
pages/— page objects for different screens and modalslogin_page.py— login helpermodals/— modal helpers (payment codes, reset modal, ...)payment_posting/— payment-posting related page objects (e.g.,pp_main.py,pp_lipp.py,pp_batch.py)
toolbars/— toolbar helpers (HOG Screen, VTB, etc.)workflows/— ready-to-run workflow orchestrations (subclasses ofBaseWorkflow)
Files in workflows/ are small orchestrators implementing steps (see BaseWorkflow in src/athenaidx/workflows/base_workflow.py).
Rejection objects — Rejections and RejectionGrouped
The library provides a simple, typed representation for rejections in src/athenaidx/model_objects/rejections.py.
-
Rejections(dataclass) — fields include:InvoiceNumber: intGroup: int— the numeric group for the invoiceRejCode1,RejCode2,RejCode3,RejCode4— rejection codesCarrier,Paycode,LineItemPost(bool),Remark1..4,BatchNumber,Completed,Comments
-
RejectionGrouped— holds agroup_idandrejections: list[Rejections].
Helpers:
Rejections.from_dataframe(df)— convert a pandas DataFrame tolist[Rejections](expects DataFrame columns matching the field names).Rejections.from_dataframe_row(row)— create a singleRejectionsfrom a DataFrame row.RejectionGrouped.from_rejections(list_of_rejections)— convert list of Rejections belonging to the same group into a singleRejectionGrouped.RejectionGrouped.group_by_group_num(list_of_rejections)— group a list of Rejections by theirGroupfield intolist[RejectionGrouped].
Example:
from athenaidx.model_objects.rejections import Rejections, RejectionGrouped
# Create one by hand
r = Rejections(InvoiceNumber=12345, Group=5, RejCode1='R01', Carrier='ABC', LineItemPost=True)
# Group from a list
grouped = RejectionGrouped.from_rejections([r])
# Or group many
many = [r, Rejections(InvoiceNumber=12346, Group=5, RejCode1='R02')]
groups = RejectionGrouped.group_by_group_num(many)
# If you have a pandas DataFrame `df` with the expected columns:
# rejections = Rejections.from_dataframe(df)
# groups = RejectionGrouped.group_by_group_num(rejections)
Notes:
- The classes are thin dataclasses — they do not perform I/O. They are intended as a data contract passed into workflows.
Using individual page/module steps
All page objects accept a Config instance (or at least expect a config object exposing get_driver() that returns a Selenium webdriver). Example usage pattern:
from athenaidx.config import Config
from athenaidx.pages.payment_posting.pp_main import PICScreen_Main
from athenaidx.pages.payment_posting.pp_select_patient import PP_SelectPatient
cfg = Config()
pic = PICScreen_Main(cfg)
select = PP_SelectPatient(cfg)
# Example: select a patient by invoice number
ok = select.select_patient('12345') # returns True or modal text
# Example: check which group is currently selected in the PIC header
current_group = pic.get_current_batch_group()
print('Current group:', current_group)
# When finished
cfg.get_driver().quit()
Common individual modules and what they expose (summary):
PICScreen_Main(pp_main) — enter paycodes, set line-item-post checkbox (enter_paycode,set_line_item_post_checkbox,open_paycode_modal), and helpers likeget_current_batch_group().PP_SelectPatient—select_patient(invoice_number)andreset_patient().PaymentPostingBatch— open/create batch (open_batch()), check batch state (is_batch_open()), andbatch_numberproperty.PP_LIPPandPP_LIPP_Rejections— helpers for line-item payment posting flows:populate_row,finalize_posting,enter_carrier,post_li_rejections().PostDropdown— small helper to read/set the per-row post dropdown value.
Because the page objects use Selenium, they act directly against the active driver. Use Config() to construct the driver, or set your own driver with cfg.set_driver(your_driver).
Predefined workflows
Workflows are small orchestrators in src/athenaidx/workflows/ built on top of BaseWorkflow.
Example: PostLineItemRejections (posts groups of rejections read from a file / list)
from athenaidx.config import Config
from athenaidx.workflows.base_workflow import WorkflowContext
from athenaidx.workflows.post_line_item_rejections import PostLineItemRejections
from athenaidx.model_objects.rejections import RejectionGrouped
cfg = Config()
# ctx.data can be one RejectionGrouped, many RejectionGrouped, or a flat list[Rejections]
ctx = WorkflowContext(config=cfg, data=[/* your RejectionGrouped objects or list of Rejections */])
wf = PostLineItemRejections(ctx)
# Run normally
wf.run(dry_run=False)
# Or perform a dry run which will iterate the workflow steps but not execute them
wf.run(dry_run=True)
# At the end, clean up or inspect ctx.meta/logs for details
cfg.get_driver().quit()
Notes for PostLineItemRejections:
- The workflow expects
ctx.configto be an instance ofathenaidx.config.Config. - The workflow will attempt to log in interactively if credentials are not present. You can provide credentials via environment variables
IDX_USERNAMEandIDX_PASSWORD(these are read by the workflow's login step). - The workflow performs a small sequence of steps: setup, login_step, process_groups, finalize. See
src/athenaidx/workflows/post_line_item_rejections.pyfor the exact logic.
Tips and troubleshooting
- Use
requirements-dev.txtto replicate the environment used in development and testing. - For CI, run the browser in headless mode and ensure a compatible ChromeDriver is available.
- If a page object raises
TimeoutException, increase implicit waits or investigate the page structure (some elements are lazy-loaded).
Files changed / touched
- README updated to document installation, structure, Rejection objects, individual steps and workflows.
Where to look next
src/athenaidx/model_objects/rejections.py— canonical data shapes and grouping helperssrc/athenaidx/workflows/post_line_item_rejections.py— a practical example of wiring model objects through the page objects and workflowsdocsdirectory for sample usages
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file athenaidx-0.1.2.tar.gz.
File metadata
- Download URL: athenaidx-0.1.2.tar.gz
- Upload date:
- Size: 69.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
77a45c45854ead5cf0c85864d6e862fbb10a945fed8488d74ae704b6421e518a
|
|
| MD5 |
a38f15409b3da8053da767958c3e73ba
|
|
| BLAKE2b-256 |
8dc6527f5c3f93e716480f0dc31566174a23fcd198dc4f6d594ab896ab886b8e
|
File details
Details for the file athenaidx-0.1.2-py3-none-any.whl.
File metadata
- Download URL: athenaidx-0.1.2-py3-none-any.whl
- Upload date:
- Size: 28.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
def9be43b83f49f2cd1329c0a178d1e7166fe1c89b8790cd5e7db6cd7dbe4345
|
|
| MD5 |
98310a1670503479b7d3a4f68736909c
|
|
| BLAKE2b-256 |
52f0b9cb4f022be922fc7a675ab13f704247efd652450e917167b52626038a84
|