Posting
Introduction #
This module defines models related to payments and postings associated with healthcare claims.
Basic usage #
To retrieve a posting by ID:
from canvas_sdk.v1.data.posting import BasePosting
posting = BasePosting.objects.get(dbid=1234)
To retrieve all active postings for a given claim:
from canvas_sdk.v1.data.claim import Claim
claim = Claim.objects.get(id="<uuid>")
claim_postings = claim.postings.active()
Payments, adjustments, and transfers each record the claim line item the amount was posted to. To find the charge behind a payment, go through its claim line item:
from canvas_sdk.v1.data import NewLineItemPayment
payment = NewLineItemPayment.objects.select_related("claim_line_item").get(dbid=1234)
claim_line_item = payment.claim_line_item
print(claim_line_item.proc_code)
# None when the claim line item has no billing line item
charge = claim_line_item.billing_line_item
On a remit, each coverage posting also records the amount the payer allowed on each claim line item and the remark codes the payer sent with it:
from canvas_sdk.v1.data import CoveragePosting
posting = CoveragePosting.objects.get(dbid=1234)
for allowed in posting.lineitemalloweds.active():
print(allowed.claim_line_item.proc_code, allowed.amount)
for remark in posting.remark_codes.all():
print(remark.claim_line_item.proc_code, remark.remark_code)
Remits #
A remit is a payer’s payment and explanation for one or more claims. Canvas stores each one as a BaseRemittanceAdvice, which is either an ElectronicRemittanceAdvice received from a clearinghouse or a ManualRemittanceAdvice posted by hand. Query the subtype to get only one kind, along with its own fields:
from canvas_sdk.v1.data import ElectronicRemittanceAdvice
for era in ElectronicRemittanceAdvice.objects.filter(payer_name="Acme Health"):
print(era.era_id, era.received_time, era.total_paid)
A remit lists the claims it covers in claims, and a claim lists its remits in remits. The file a remit was posted from is a NewRemittanceDocument, reached through the remit’s document:
from canvas_sdk.v1.data import BaseRemittanceAdvice, NewRemittanceDocument
remit = BaseRemittanceAdvice.objects.get(id="d2194110-5c9a-4842-8733-ef09ea5ead11")
claims = remit.claims.all()
try:
# Presigned S3 URL to the remit file, or None if there is no file
url = remit.document.document_url
except NewRemittanceDocument.DoesNotExist:
url = None
Attributes #
BasePosting #
Base model for aggregating multiple line item-level transactions (payments, adjustments, transfers) associated with a claim.
| Field Name | Type | Description |
|---|---|---|
| dbid | Integer | |
| corrected_posting | BasePosting | |
| claim | Claim | |
| payment_collection | PaymentCollection | |
| description | String | |
| entered_in_error | CanvasUser | |
| created | DateTime | |
| modified | DateTime | |
| correction_postings | QuerySet[BasePosting] | |
| lineitemalloweds | QuerySet[LineItemAllowed] | Allowed amounts per claim line item |
| paid_amount | Decimal (computed) | Total paid |
| contractual_adjusted_amount | Decimal (computed) | Adjustments marked as write-offs |
| non_write_off_adjusted_amount | Decimal (computed) | Non-write-off adjustments |
| transferred_amount | Decimal (computed) | Total transferred |
| transferred_to_patient_amount | Decimal (computed) | Portion transferred to the patient |
| transferred_to_coverage_amount | Decimal (computed) | Portion transferred to another coverage |
| adjusted_and_transferred_amount | Decimal (computed) | Combined adjusted and transferred amount |
| posted_amount | Decimal (computed) | Total of payments and write-offs |
CoveragePosting #
Represents an insurance payment or adjustment associated with a claim’s coverage.
| Field Name | Type |
|---|---|
| remittance | BaseRemittanceAdvice |
| claim_coverage | ClaimCoverage |
| crossover_carrier | String |
| crossover_id | String |
| payer_icn | String |
| position_in_era | Integer |
| remark_codes | QuerySet[RemarkCode] |
PatientPosting #
Represents patient-side payments or adjustments, including links to copays or patient-level discounts.
| Field Name | Type | Description |
|---|---|---|
| claim_patient | ClaimPatient | |
| patient_payment | BulkPatientPosting | |
| copay | BulkPatientPosting | |
| discounted_amount | Decimal (computed) | Discount applied |
| charges_amount | Decimal (computed) | Discount plus paid amount |
BulkPatientPosting #
Aggregates bulk patient payments on multiple claims.
| Field Name | Type | Description |
|---|---|---|
| id | UUID | |
| dbid | Integer | |
| payment_collection | PaymentCollection | |
| total_paid | Decimal | |
| created | DateTime | |
| modified | DateTime | |
| discount | Discount | |
| payer | Patient | |
| postings | QuerySet[PatientPosting] | |
| copays | QuerySet[PatientPosting] | |
| total_posted_amount | Decimal (computed) | Sum of all posted amounts |
| discounted_amount | Decimal (computed) | Sum of discounted amounts |
BaseRemittanceAdvice #
Represents shared data for both electronic and manual remittance advice.
| Field Name | Type | Description |
|---|---|---|
| id | UUID | |
| dbid | Integer | |
| payment_collection | PaymentCollection | |
| total_paid | Decimal | |
| created | DateTime | |
| modified | DateTime | |
| transactor | Transactor | |
| era_id | String | |
| claims | QuerySet[Claim] | Claims the remit covers, including claims whose remit processing was skipped |
| postings | QuerySet[CoveragePosting] | |
| document | NewRemittanceDocument | File the remit was posted from |
| total_posted_amount | Decimal (computed) | Sum of all posted amounts |
ElectronicRemittanceAdvice #
An electronic remit (ERA) received from a clearinghouse. It has every BaseRemittanceAdvice field, plus:
| Field Name | Type |
|---|---|
| check_type | String |
| payer_name | String |
| provider_name | String |
| provider_npi | String |
| download_date | Date |
| received_time | DateTime |
ManualRemittanceAdvice #
A remit posted by hand. It has the BaseRemittanceAdvice fields and no others.
BaseRemittanceAdviceClaim #
Links a remit to a claim it covers. Read the link through remit.claims or claim.remits rather than querying this model.
from canvas_sdk.v1.data import Claim
claim = Claim.objects.get(id="9d2e0f58-338b-11ec-8d3d-0242ac130003")
remits = claim.remits.all()
| Field Name | Type |
|---|---|
| dbid | Integer |
| remittance | BaseRemittanceAdvice |
| claim | Claim |
NewRemittanceDocument #
The file a manual or electronic remit was posted from.
| Field Name | Type | Description |
|---|---|---|
| dbid | Integer | |
| remittance | BaseRemittanceAdvice | |
| document | File (S3 key) | |
| document_url | String (computed) | Presigned URL for the file, or None when unset |
| originator | CanvasUser | |
| committer | CanvasUser | |
| entered_in_error | CanvasUser | |
| created | DateTime | |
| modified | DateTime |
PaymentCollection #
Captures metadata about the method and details of a collected payment.
| Field Name | Type |
|---|---|
| id | UUID |
| dbid | Integer |
| total_collected | Decimal |
| method | PostingMethods |
| check_number | String |
| check_date | Date |
| deposit_date | Date |
| description | String |
| created | DateTime |
| modified | DateTime |
| postings | QuerySet[BasePosting] |
| receipt | Receipt |
NewLineItemPayment #
Represents a payment applied to a claim line item.
| Field Name | Type |
|---|---|
| dbid | Integer |
| posting | BasePosting |
| billing_line_item | BillingLineItem (deprecated) |
| claim_line_item | ClaimLineItem |
| amount | Decimal |
| charged | Decimal |
| entered_in_error | CanvasUser |
| created | DateTime |
| modified | DateTime |
NewLineItemAdjustment #
Represents an adjustment applied to a claim line item.
| Field Name | Type |
|---|---|
| dbid | Integer |
| posting | BasePosting |
| billing_line_item | BillingLineItem (deprecated) |
| claim_line_item | ClaimLineItem |
| amount | Decimal |
| code | String |
| group | String |
| deviated_from_posting_ruleset | Boolean |
| write_off | Boolean |
| entered_in_error | CanvasUser |
| created | DateTime |
| modified | DateTime |
LineItemTransfer #
Represents a transfer of a claim line item balance to another coverage or patient.
| Field Name | Type |
|---|---|
| dbid | Integer |
| posting | BasePosting |
| billing_line_item | BillingLineItem (deprecated) |
| claim_line_item | ClaimLineItem |
| amount | Decimal |
| code | String |
| group | String |
| deviated_from_posting_ruleset | Boolean |
| transfer_to | ClaimCoverage |
| transfer_to_patient | Boolean |
| entered_in_error | CanvasUser |
| created | DateTime |
| modified | DateTime |
LineItemAllowed #
Represents the amount a payer allowed on a claim line item. Call active() to leave out amounts entered in error.
| Field Name | Type |
|---|---|
| dbid | Integer |
| posting | BasePosting |
| billing_line_item | BillingLineItem (deprecated) |
| claim_line_item | ClaimLineItem |
| amount | Decimal |
| entered_in_error | CanvasUser |
| created | DateTime |
| modified | DateTime |
RemarkCode #
Represents a remark code a payer sent in an 835 remit for a claim line item on a coverage posting.
remark_code holds the code exactly as the payer sent it. Payers send codes from the X12 Remittance Advice Remark Codes list, such as N381 or M15, which X12 updates several times a year, so look up a code’s meaning there rather than hardcoding a list.
| Field Name | Type |
|---|---|
| dbid | Integer |
| posting | CoveragePosting |
| claim_line_item | ClaimLineItem |
| remark_code | String |
| created | DateTime |
| modified | DateTime |
Discount #
Represents a discount applied to a claim or patient posting, linked by adjustment group and code.
| Field Name | Type |
|---|---|
| dbid | Integer |
| name | String |
| adjustment_group | String |
| adjustment_code | String |
| discount | Decimal |
| created | DateTime |
| modified | DateTime |
| patient_postings | QuerySet[BulkPatientPosting] |
Enumeration types #
PostingMethods #
| Value | Label |
|---|---|
| cash | Cash |
| check | Check |
| card | Card |
| other | Other |