Katon Minhas deef52193c Merged in DEV (pull request #873)
DEV

* file_processing

* Merge branch 'bugfix/code_implicit' into DEV

* Update split reimb dates condition

* Pipe line general fixes, fixed tests, ran black, and fixed mypy type check issues, still have a list of lists issue with prov other name full

* Merged in feature/update-claim-type (pull request #869)

Feature/update claim type

* Update CLAIM_TYPE_CD extraction to prioritize title/header

- Modified retrieval_question to search for title, header, and agreement name
- Updated prompt to check title/header first before analyzing body text
- Enhanced FULL_CONTEXT_CLAIM_TYPES_ADDITIONAL_INSTRUCTION to emphasize title/header as primary source

* Fix CLAIM_TYPE_CD extraction with 3-step fallback

1. Exhibit Level: Updated retrieval_question and prompt to prioritize title/header
2. Contract Title fallback: Added infer_claim_type_from_title() function that extracts
   claim type from CONTRACT_TITLE when exhibit-level extraction returns empty
3. Postprocessing: fill_claim_type() now uses CONTRACT_TITLE inference when all
   AARETE_DERIVED_CLAIM_TYPE_CD values are empty

Keywords mapped:
- Professional/Ancillary -> M (Physician, Professional, Ancillary, Home Health, DME, etc.)
- Institutional -> H (Hospital, Facility, Surgery Center, SNF, etc.)

* Add more prof…
* Merged in bugfix/code-funcs (pull request #872)

Bugfix/code funcs

* Try-except code extraction

* Additional try-except for protection

* Black format


Approved-by: Praneel Panchigar

* Merged in feature/update-testbed-metrics (pull request #871)

Feature/update testbed metrics

* Combine fee schedule with methodology breakout; remove Reimbursement primary; do not run trigger cap or additions

* Deprecate reimb primary functions

* combine multiple sheets to one

* Clean 1:N metrics

* Improve dynamic primary evaluation

* Resolve dynamic primary

* Update row counts

* black format

* Merged DEV into feature/update-testbed-metrics


Approved-by: Praneel Panchigar

* Merged in feature/adding_contract_admenment_num_pc (pull request #870)

Feature/adding contract admenment num pc

* Updated contract amendment

* Format code with Black

* updated to have letters

* format fixes

* Adjusted unit testing

* Merge remote-tracking branch 'origin/DEV' into feature/adding_contract_admenment_num_pc

* apply formatting

* format fixes

* Merge remote-tracking branch 'origin/DEV' into feature/adding_contract_admenment_num_pc

* test conflicts solved

* Format code with Black

* format fixes

* reverted the changes for prompt templates

* test_case reverted
* Sorted effective date for ranking

* format fix for lint

* Merged DEV into feature/adding_contract_admenment_num_pc

* format

* Merged DEV into feature/adding_contract_admenment_num_pc

* Merged DEV into feature/adding_contract_admenment_num_pc


Approved-by: Siddhant Medar

* Consolidate docs and documentation

* Remove PRD

* Add Essential Plan as a NY Program

* Resolve Comments

* Resolve comments

* Black format

* Resolve remaining comments

* Black format

* Merged in bugfix/fill_claim_type (pull request #874)

Bugfix/fill claim type

* Handle if AARETE_DERIVED_CLAIM_TYPE_CD comes in as list

* add unit tests

* Black format


Approved-by: Siddhant Medar

* Remove print

* Merged in bugfix/parser-downstream-improvements (pull request #875)

Bugfix/parser downstream improvements

* Refactor: Implement field-aware JSON parsers with centralized normalization

This refactor introduces a robust system for normalizing LLM output based on
field format mappings, ensuring consistent data types throughout the pipeline.

Key Changes:
- Add FIELD_FORMAT_MAPPING constant defining expected formats for all fields
- Create format_normalization.py utility for type-aware normalization
- Update json_utils.py parsers to accept field_names/field_name parameters
- Refactor prompt_templates.py to use parser factories (_create_json_dict_parser,
  _create_json_list_parser) that bind field metadata for automatic normalization
- Update prompt_calls.py to pass field names to parsers, eliminating redundant
  normalization logic
- Remove parse_json_dict_or_list (unused, ambiguous function)
- Simplify METHODOLOGY_BREAKOUT and REIMBURSEMENT_PRIMARY to use helper functions
- Add comprehensive integration tests…
* Update other lists

* Black format

* Remove prints

* Update qa_qc to account for lists in is_empty check

* Resolve issues

* Black format


Approved-by: Siddhant Medar
2026-02-10 17:09:54 +00:00
2026-02-10 17:09:54 +00:00
2026-02-10 17:09:54 +00:00

Field Extraction Pipeline

Contract field extraction using LLMs.

Setup

Install uv (if not already installed)

# Ubuntu/WSL (recommended)
curl -LsSf https://astral.sh/uv/install.sh | sh
source ~/.bashrc  # or restart terminal

# macOS
curl -LsSf https://astral.sh/uv/install.sh | sh

# Windows (PowerShell - native, not WSL)
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

Verify installation: uv --version

Install dependencies

uv sync

Running the Code

Use uv run with Python's module flag from the project root:

# Run the default SaaS pipeline
uv run python -m src.pipelines.saas.main

# Run with unified runner (supports client selection)
uv run python -m src.pipelines.runner --client saas --input-dir /path/to/input

# Run with specific client
uv run python -m src.pipelines.runner --client clover --input-dir /path/to/input

Note: Always use uv run to ensure correct virtual environment. Always use -m flag for proper imports.

Development

Before pushing, always run these checks to avoid breaking the CI pipeline:

# Format code
uv run black src/

# Type checking
uv run mypy src/

# Run tests
uv run pytest

All checks must pass before merging to main.

Project Structure

├── src/
│   ├── pipelines/              # Pipeline implementations
│   │   ├── runner.py           # Unified CLI entry point with client routing
│   │   ├── saas/               # Default SaaS pipeline
│   │   │   └── main.py         # Main entry point for SaaS
│   │   ├── shared/             # Shared pipeline components
│   │   │   ├── preprocessing/  # Document preprocessing
│   │   │   ├── extraction/     # Field extraction logic
│   │   │   └── postprocessing/ # Result postprocessing
│   │   └── clients/            # Client-specific overrides
│   │       └── clover/         # Clover client customizations
│   ├── core/                   # Core utilities (registry, fieldset)
│   ├── constants/              # Constants, mappings, and field definitions
│   │   ├── mappings/           # Crosswalk JSON files
│   │   └── lists/              # Lookup lists
│   ├── prompts/                # LLM prompt templates
│   ├── utils/                  # Shared utilities (IO, string, logging, etc.)
│   ├── codes/                  # Medical code extraction utilities
│   ├── crosswalk/              # Crosswalk mapping logic
│   ├── embeddings/             # Pre-computed embeddings for code matching
│   ├── qc_qa/                  # QC/QA validation pipeline
│   ├── parent_child/           # Parent-child relationship mapping
│   ├── document_classification/ # Document type classification (DTC)
│   └── tests/                  # Unit tests
├── documentation/              # Project documentation
├── outputs/                    # Pipeline output files (gitignored)
├── logs/                       # Log files (gitignored)
└── pyproject.toml              # Project dependencies (uv/pip)

Branching

Naming Conventions

Type Pattern Use Case Example
Feature feature/<ticket>-<description> New functionality feature/PROJ-123-add-export-csv
Bugfix bugfix/<ticket>-<description> Bug fixes bugfix/PROJ-456-fix-null-handling
Hotfix hotfix/<ticket>-<description> Urgent production fixes hotfix/PROJ-789-critical-parse-error
Test test/<description> Testing/experimentation test/lesser-table-caching-refactor
Release release/<version> Release preparation release/v1.2.0

Branch Guidelines

  • Use lowercase with hyphens (kebab-case) for descriptions
  • Include ticket number when applicable (e.g., JIRA, GitHub issue)
  • Keep branch names concise but descriptive
  • Delete branches after merging

Workflow

  1. Create branch from main
  2. Make changes and commit with clear messages
  3. Run checks before pushing: uv run black src/ && uv run mypy src/ && uv run pytest
  4. Create PR to main
  5. Ensure all CI checks pass
  6. Get code review approval
  7. Squash and merge
S
Description
AARETE DoczyAI pipelines mirror.
Readme 642 MiB
Languages
Python 80.5%
Jupyter Notebook 13%
HCL 3.1%
HTML 1.6%
PLpgSQL 1.5%
Other 0.2%