We are currently updating the OP Help Center content for the release of OP 14.19 or OP 19. OP 19 is a member of the certified OP 14 family of products (official version is 14.19.1), which you may see in your software (such as in Help > About) and in the Help Center tabs labeled 14.19. You may also notice that the version number in content and videos may not match the version of your software, and some procedural content may not match the workflow in your software. We appreciate your patience and understanding as we make these enhancements.

SQL: Claims Out to Secondary Insurance

About

This report shows claims which are “out” to a secondary insurance, along with primary and secondary insurance responsibility dates and aging days (i.e. the elapsed time from the secondary insurance responsibility date to today).

A sample image of this SQL report run in the Database Viewer is shown below:

Caveats

This SQL looks only for secondary claims with an insurance balance of $0.01 or greater.

Code

To highlight and copy the code below to your clipboard, simply click the Copy button.

select a.invoiceno as claim_number, claimdate as claim_created, patno, ins_carrier_code_1 as primary_ins, ins_carrier_code_2 as secondary_ins, primary_ins_resp_date, secondary_ins_resp_date,  coalesce(days_from_2ary,days_from_1ary,days_from_claim) as aging_days, case when days_from_2ary is null then ins_carrier_code_1 else ins_carrier_code_2 end as out_to from
(

select invoiceno, claimdate, patno, ins_carrier_code_1, ins_carrier_code_2, primary_ins_resp_date, secondary_ins_resp_date, cast('today' as date)-primary_ins_resp_date as days_from_1ary, 

cast('today' as date)-secondary_ins_resp_date as days_from_2ary, cast('today' as date)-claimdate as days_from_claim,  ins_balance

 from claims1 where ins_balance >= 0.01
) a
where secondary_ins_resp_date is not null