Pharmacy report retrieval¶
Pharmacy eligibility data must periodically be extracted and sent to the pharmacy benefit manager (MedImpact) so pharmacies can verify a worker's eligibility at the point of sale. Three related extraction modes exist: a full snapshot, a change-only (delta) extract for routine transmission, and a first-fill (FF) extract that identifies claims ready for a first pharmacy pickup.
| Field | Value |
|---|---|
| Operation ID | OP-CE-10 |
| Trigger | Caller calls GetEligibilityReports (full/delta) or GetEligibilityFFReports / GetFirstFillEligibilityReports (first-fill) |
| Inputs | A full/delta extraction flag |
| Outputs | A sorted collection of pharmacy eligibility report entries for transmission |
| Primary components | clsPharmacyEligibilityReportCollection.GetEligibilityReports, GetEligibilityFFReports, GetFirstFillEligibilityReports |
| Entry point | Business\SAIF.Business.Claim.Entry\clsPharmacyEligibility.vb |
Steps¶
- Full extract path (BR-CE-016).
GetEligibilityReportscalled with the full-extract flag selects every eligibility report row except those whose status is inactive, via an inline query not catalogued in the SQL index.* - Change-only (delta) extract path (BR-CE-017).
GetEligibilityReportscalled with the delta flag instead selects only rows that have never been transmitted, or whose update date is later than their last transmit date, via a separate inline query not catalogued in the SQL index.* - First-fill (FF) extract path (BR-CE-018).
GetEligibilityFFReportsselects rows for FF transmission and remaps an inactive eligibility status to the outbound code'1'before returning it, so the pharmacy-facing status code does not simply mirror the internal status column. - First-fill pickup eligibility check (BR-CE-019).
GetFirstFillEligibilityReportsfurther restricts the FF set to rows that: have a related Online 801 document on file, have not yet been transmitted to MedImpact for first fill, and have aged at least two minutes since their last update — the aging delay guards against transmitting a report before all of its related same-transaction updates have committed.* - Sort and return the resulting collection in each path for the caller to iterate over and transmit.
Process flow¶
flowchart TD
Start([Caller requests<br>pharmacy eligibility extract]) --> Mode{Which extract?}
Mode -->|Full| Full[Select all rows<br>excluding inactive]
Mode -->|Delta| Delta[Select untransmitted or<br>changed-since-transmit rows]
Mode -->|First fill| FF[Select FF rows;<br>remap inactive status to '1']
FF --> Pickup{Related document exists,<br>not yet MedImpact-transmitted,<br>aged 2+ minutes?}
Pickup -->|Yes| Include[Include in first-fill<br>pickup set]
Pickup -->|No| Exclude[Exclude from result]
Full --> Sort[Sort collection]
Delta --> Sort
Include --> Sort
Exclude --> Sort
Sort --> Return([Return report collection])
Failure and edge-case behavior¶
- None of the four extract queries (full, delta, FF, first-fill-pickup) are catalogued in the library's SQL index; they are inline queries embedded directly in
clsPharmacyEligibility.vband are described here from source rather than linked to aSQL-NNNcatalog entry.* - The two-minute aging delay in step 4 is a fixed value in code rather than configurable, so it applies uniformly regardless of transaction volume or system load.*
- Because the underlying
UpdateNum/update-date tracking in Pharmacy eligibility CRUD has a confirmed double-increment defect, any downstream logic that relies onUpdateNum(rather than the update-date comparison used here) to detect changes could be affected by that defect; the delta extract documented here relies on the update-date column, notUpdateNum, so it is not directly affected.*
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.Entry\clsPharmacyEligibility.vb