# daniellepashayan/ccn-bulk-populate architecture

> Architecture diagram of the GitHub repository daniellepashayan/ccn-bulk-populate, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/daniellepashayan/ccn-bulk-populate
- Repository: https://github.com/daniellepashayan/ccn-bulk-populate

## Overview

This Python application builds Northwell charge-correction Excel inputs from Electronic and Paper ETM exports. The main workflow selects an export and generation date, filters eligible invoices, maps CPT codes and fields into a template, excludes invoices present in recent outputs, and saves a formatted file. A separate resubmission workflow identifies prior bot results marked not worked and adds matching current invoices to an output. The README is empty; the graph reflects the supplied source excerpts, so unrelated database helpers are omitted.

Main entry points: [`file.py`](https://github.com/daniellepashayan/ccn-bulk-populate/blob/master/file.py) (Raw file processor), [`resubmission.py`](https://github.com/daniellepashayan/ccn-bulk-populate/blob/master/resubmission.py) (Resubmission workflow), [`bulk_combine.py`](https://github.com/daniellepashayan/ccn-bulk-populate/blob/master/bulk_combine.py) (Bulk combine), [`util/date_functions.py`](https://github.com/daniellepashayan/ccn-bulk-populate/blob/master/util/date_functions.py) (Business date rules)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_orchestration["Run orchestration"]
  node_main["Main entry<br/>[main.py]"]
  node_bulk["Bulk combine<br/>[bulk_combine.py]"]
end

subgraph group_processing["Invoice processing"]
  node_raw["Raw file processor<br/>[file.py]"]
end

subgraph group_resubmission["Resubmission"]
  node_resub["Resubmission workflow<br/>[resubmission.py]"]
end

subgraph group_support["Shared rules"]
  node_mappings["Column and CPT mappings<br/>[mappings.py]"]
  node_cpt_helpers["CPT conversion"]
  node_dates["Business date rules<br/>[date_functions.py]"]
  node_logger["Logging<br/>[logger_config.py]"]
end

node_operator(("Operator"))
node_etm_export["ETM exports"]
node_template["CCN template<br/>[ccn_template.xlsx]"]
node_recent_files["Recent formatted files"]
node_formatted_output["Formatted CCN files"]
node_bot_results["Prior bot results"]

node_operator -->|"starts"| node_main
node_main -->|"runs both types"| node_bulk
node_bulk -->|"gets generation date"| node_dates
node_bulk -->|"creates processor"| node_raw
node_raw -->|"reads export"| node_etm_export
node_raw -->|"reads template"| node_template
node_raw -->|"uses mappings"| node_mappings
node_raw -->|"converts CPTs"| node_cpt_helpers
node_raw -->|"gets generation date"| node_dates
node_raw -->|"checks recent invoices"| node_recent_files
node_raw -->|"writes workbook"| node_formatted_output
node_operator -->|"runs resubmission"| node_resub
node_resub -->|"reads current export"| node_etm_export
node_resub -->|"reads prior results"| node_bot_results
node_resub -->|"creates processor"| node_raw
node_resub -->|"gets generation date"| node_dates
node_resub -->|"appends resubmissions"| node_formatted_output
node_bulk -->|"logs progress"| node_logger
node_raw -->|"logs processing"| node_logger
node_resub -->|"logs progress"| node_logger

click node_main "https://github.com/daniellepashayan/ccn-bulk-populate/blob/master/main.py"
click node_bulk "https://github.com/daniellepashayan/ccn-bulk-populate/blob/master/bulk_combine.py"
click node_raw "https://github.com/daniellepashayan/ccn-bulk-populate/blob/master/file.py"
click node_template "https://github.com/daniellepashayan/ccn-bulk-populate/blob/master/references/ccn_template.xlsx"
click node_resub "https://github.com/daniellepashayan/ccn-bulk-populate/blob/master/resubmission.py"
click node_mappings "https://github.com/daniellepashayan/ccn-bulk-populate/blob/master/util/mappings.py"
click node_cpt_helpers "https://github.com/daniellepashayan/ccn-bulk-populate/blob/master/util/utilitiy_functions.py"
click node_dates "https://github.com/daniellepashayan/ccn-bulk-populate/blob/master/util/date_functions.py"
click node_logger "https://github.com/daniellepashayan/ccn-bulk-populate/blob/master/util/logger_config.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_main,node_bulk toneBlue
class node_raw toneAmber
class node_resub toneMint
class node_mappings,node_cpt_helpers,node_dates,node_logger toneRose
class node_operator,node_etm_export,node_recent_files,node_formatted_output,node_bot_results toneIndigo
class node_template toneTeal
```

## Components

### Run orchestration

- [Main entry](https://github.com/daniellepashayan/ccn-bulk-populate/blob/master/main.py): `main.py`
- [Bulk combine](https://github.com/daniellepashayan/ccn-bulk-populate/blob/master/bulk_combine.py): `bulk_combine.py`

### Invoice processing

- [Raw file processor](https://github.com/daniellepashayan/ccn-bulk-populate/blob/master/file.py): `file.py`

### Resubmission

- [Resubmission workflow](https://github.com/daniellepashayan/ccn-bulk-populate/blob/master/resubmission.py): `resubmission.py`

### Shared rules

- [Column and CPT mappings](https://github.com/daniellepashayan/ccn-bulk-populate/blob/master/util/mappings.py): `util/mappings.py`
- [CPT conversion](https://github.com/daniellepashayan/ccn-bulk-populate/blob/master/util/utilitiy_functions.py): `util/utilitiy_functions.py`
- [Business date rules](https://github.com/daniellepashayan/ccn-bulk-populate/blob/master/util/date_functions.py): `util/date_functions.py`
- [Logging](https://github.com/daniellepashayan/ccn-bulk-populate/blob/master/util/logger_config.py): `util/logger_config.py`

### Other components

- **Operator**
- **ETM exports**
- [CCN template](https://github.com/daniellepashayan/ccn-bulk-populate/blob/master/references/ccn_template.xlsx): `references/ccn_template.xlsx`
- **Recent formatted files**
- **Formatted CCN files**
- **Prior bot results**

## Connections

- Operator → Main entry: starts
- Main entry → Bulk combine: runs both types
- Bulk combine → Business date rules: gets generation date
- Bulk combine → Raw file processor: creates processor
- Raw file processor → ETM exports: reads export
- Raw file processor → CCN template: reads template
- Raw file processor → Column and CPT mappings: uses mappings
- Raw file processor → CPT conversion: converts CPTs
- Raw file processor → Business date rules: gets generation date
- Raw file processor → Recent formatted files: checks recent invoices
- Raw file processor → Formatted CCN files: writes workbook
- Operator → Resubmission workflow: runs resubmission
- Resubmission workflow → ETM exports: reads current export
- Resubmission workflow → Prior bot results: reads prior results
- Resubmission workflow → Raw file processor: creates processor
- Resubmission workflow → Business date rules: gets generation date
- Resubmission workflow → Formatted CCN files: appends resubmissions
- Bulk combine → Logging: logs progress
- Raw file processor → Logging: logs processing
- Resubmission workflow → Logging: logs progress
