Medical bill retrieval¶
Medical bill retrieval loads bill data from the medical billing web API rather than directly from Oracle. A caller either retrieves one bill by identifier or retrieves a collection using a MedicalBillSearchRequest. Collection retrieval additionally applies AD-resource authorization checks, builds print links for completed bills, and propagates a SAIF-employee flag; every returned bill computes worker-name masking, pending-bill total suppression, and lazily-loaded audit/EOB/adjustment data on demand.
| Field | Value |
|---|---|
| Operation ID | OP-MB-01 |
| Trigger | clsMedicalBill.GetMedicalBill(dataportal, billID) for a single bill; clsMedicalBillCollection.GetMedicalBills(dataportal, searchCriteria[, security]) for a search |
| Inputs | billID (single retrieval); MedicalBillSearchRequest and, for the non-IsMedicalBillSearch overload, a clsSecurityPrincipal (collection retrieval) |
| Outputs | Populated clsMedicalBill or clsMedicalBillCollection; print link on completed bills; IsSaifEmployee flag; masked or unmasked WorkerName; suppressed or computed TotalPaidAmt |
| Primary components | clsMedicalBill.GetMedicalBill, clsMedicalBill.BeforeRetrieve, clsMedicalBill.AfterRetrieve, clsMedicalBillCollection.GetMedicalBills, clsMedicalBillCollection.BeforeRetrieve, clsMedicalBillCollection.AfterRetrieve, clsMedicalBillCollection.BuildPrintLink, clsMedicalBill.WorkerName, clsMedicalBill.TotalPaidAmt |
| Entry point | Business\SAIF.Business.Claim.MedicalBill\clsMedicalBill.vb, Business\SAIF.Business.Claim.MedicalBill\clsMedicalBillCollection.vb |
Steps¶
- Single-bill retrieval. The caller invokes
clsMedicalBill.GetMedicalBill(dataportal, billID).BeforeRetrieveformats the API route toROUTE_MEDICALBILL_RETRIEVE_BY_BILL_ID(v2/Integration/GetMedicalBillData/{billID});AfterRetrievedeserializes aMedicalBillSingleResultand calls the privateFillmethod with the returnedMedicalBillDatarow when present. - If the API returns no data row: the object is returned unfilled (no explicit not-found error is raised).*
- Collection retrieval — external/authorized search. The caller invokes
clsMedicalBillCollection.GetMedicalBills(dataportal, searchCriteria, security).BeforeRetrieveformats the route toROUTE_MEDICALBILL_RETRIEVE_BY_SEARCH_CRITERIA(v2/Integration/GetMedicalBillData, POST) and sets the request body to the search criteria. - Collection retrieval — medical-bill-search overload. The parameterless-security overload
GetMedicalBills(dataportal, searchCriteria)only issues the retrieval whensearchCriteria.IsMedicalBillSearchis true; otherwise it returnsNothingwithout calling the API. - Deserialize and load each row.
AfterRetrievereads aMedicalBillResultand, for eachMedicalBillDataitem, constructs a newclsMedicalBilland calls its internalLoadmethod, which fills the object and marks it as an existing (non-new) instance. - Apply print link and employee flag for non-search retrievals. When
searchCriteria.IsMedicalBillSearchis false,AfterRetrievecallsBuildPrintLinkand setsIsSaifEmployeeon the loaded bill: BuildPrintLinksetsPrintLinkto aPrintEOB(...)JavaScript anchor only whenBillStatusType = Completed; pending bills get no print link.IsSaifEmployeeis set from the collection's ownIsSAIFEmployeecheck, which comparesSecurityPrincipal.Domainto"SAIF"(BR-MB-003).- For an
IsMedicalBillSearchretrieval, neither the print link nor the employee flag is set on the returned bills.* - Authorization checks (lazy, per-collection).
HasExposureAccessandHasHealthIssueAccesslazily resolve and cacheSecurityPrincipal.IsAuthorized("ExposureClaim")andSecurityPrincipal.IsAuthorized("CollateralHealthClaim")respectively (BR-MB-001, BR-MB-002). These properties are exposed for callers to apply filtering; the retrieval itself does not filter rows based on them.* - Worker-name confidentiality masking. Reading
clsMedicalBill.WorkerNamereturns** Confidential **instead of the formatted name when the caller is internal (or the bill'sIsSaifEmployeeflag is set) andClaimSecurity.IsWorkerConflictis true (BR-MB-021). ClaimSecurityis lazily resolved viaclsClaimSecurity.GetClaimSecurity(dataPortalInfo, ClaimID).
Origin:
clsClaimSecurityand its claim-security data (includingIsWorkerConflictandWorkerNameFormatted) are implemented inSAIF.Businessand executed on behalf of this operation. See Claim information and authorization support (OP-SB-07) in theSAIF.Businessdocumentation set. Note: this operation calls the directclsClaimSecurity.GetClaimSecurity(dpi, claimID)overload rather than the CCClaimData API route described as the primary path on that operation page; behavior is expected to be equivalent but was not independently re-verified against that page's documented steps.* 8. Provider location resolution (lazy). ReadingclsMedicalBill.ProviderLocationlazily resolvesProvider.clsProviderLocation.GetProviderLocation(dataPortalInfo, ProviderLocationID), used byProviderRegisteredNameandProviderBusinessName.Origin:
Provider.clsProviderLocation.GetProviderLocationis implemented inSAIF.BOF.Business.View.Providerand executed on behalf of this operation. That library is documented in the previous format, so no per-operation page exists; see Operations and processes in theSAIF.BOF.Business.View.Providerdocumentation set. 9. Pending-bill total suppression. ReadingTotalPaidAmtreturns a null value instead ofTotalAllowedAmt - TotalMCOAdminFeeAmtwhen the bill isPending, has a parent collection, and that parent's originating search criteria hasIsMedicalBillSearch = True(BR-MB-019). 10. Bulk audit-detail suppression. SettingclsMedicalBillCollection.SuppresAuditDetail = TruepropagatesSuppressAuditDetail = Trueto every bill in the collection, which in turn skips the lazy loads described in Audit service and adjustment retrieval and EOB note retrieval (BR-MB-020). 11. Aggregate adjustment descriptions.clsMedicalBillCollection.AuditDescriptionswalks every non-suppressed bill's audit services and their adjustments, builds a deduplicatedclsAdjustmentCodeCollection(delegating each code lookup to Adjustment code lookup), and sorts the result byCode.
Process flow¶
The following diagram visualizes this operation's control flow.
flowchart TD
Start([Caller requests bill data]) --> Which{Single bill or search?}
Which -->|Single bill| SingleRoute[Route: GetMedicalBillData/{billID}]
SingleRoute --> SingleFill[Fill bill from MedicalBillSingleResult]
Which -->|Search| SearchType{IsMedicalBillSearch?}
SearchType -->|Yes, no security overload| SearchRouteA[POST GetMedicalBillData<br>no print link / employee flag applied]
SearchType -->|No, with security| SearchRouteB[POST GetMedicalBillData<br>BuildPrintLink + IsSaifEmployee applied]
SearchRouteA --> LoadEach[Load each MedicalBillData row]
SearchRouteB --> LoadEach
SingleFill --> Compute[Compute WorkerName masking,<br>TotalPaidAmt suppression on read]
LoadEach --> Compute
Compute --> Done([Bill or collection returned to caller])
Failure and edge-case behavior¶
- A single-bill retrieval with no matching row returns an unfilled
clsMedicalBillrather than raising a not-found error.* - The
GetMedicalBills(dataportal, searchCriteria)overload silently returnsNothingwhenIsMedicalBillSearchis false, so callers relying on this overload for a non-medical-bill-search must use the security-parameter overload instead. - Worker-name masking and pending-bill total suppression are computed on every read, not cached, so they always reflect the current
Parent/ClaimSecuritystate at access time. AuditDescriptionson both the bill and the collection silently skip bills withSuppressAuditDetail = True, which can make aggregate adjustment totals appear incomplete for bulk-print collections.
Related documentation¶
Note: Statements marked with
*were inferred from code structure, naming conventions, or contextual evidence where direct confirmation was not available in source artifacts.
Sources¶
Business\SAIF.Business.Claim.MedicalBill\clsMedicalBill.vbBusiness\SAIF.Business.Claim.MedicalBill\clsMedicalBillCollection.vbBusiness\SAIF.Business.Claim.MedicalBill\MedicalBillSearchRequest.vbBusiness\SAIF.Business.Claim.MedicalBill\MedicalBillResult.vb