Backend: The claims App¶
Views¶
- class claims.views.AddNoteView(**kwargs)[source]¶
Handles POST requests to add a new note to a claim. Returns an HTML partial of the updated notes section.
- class claims.views.ClaimDetailView(**kwargs)[source]¶
Handles fetching and displaying the details for a single claim. This view is designed to be rendered within the main list view via an HTMX request, to avoid a full page reload.
- class claims.views.ClaimListView(**kwargs)[source]¶
Displays a list of all claims in the Claims Dashboard.
This view supports: - Searching by insurer name and patient name. - Filtering by claim status and flagged status. - Sorting on multiple fields. - HTMX-powered partial updates for filtering, sorting, and infinite scroll.
- get_context_data(**kwargs: Any) Dict[str, Any] [source]¶
Adds filter and sorting values to the context for use in the template.
- get_queryset() QuerySet [source]¶
Overrides the default queryset to implement search, filter, and sorting logic.
- class claims.views.FlagButtonView(**kwargs)[source]¶
Returns the current flag button partial for a claim without mutating state. Used to refresh the flag icon in the list row when the flag is toggled elsewhere.
Models¶
- class claims.models.Claim(*args, **kwargs)[source]¶
Represents a single insurance claim.
- exception DoesNotExist¶
- exception MultipleObjectsReturned¶
- property underpayment: Decimal¶
Calculates the difference between the billed and paid amounts and get the underpayment value.
Services¶
- class claims.services.ClaimDataIngestor(claims_csv_path: Path | str, details_csv_path: Path | str, delimiter: str = ',', mode: str = 'append')[source]¶
A service class to handle the ingestion of claim data from CSV files. This class encapsulates the logic for parsing, validating, and saving claim and claim detail data to the database.