Menu

#2 up_x12_837p_export fix

open
nobody
None
5
2007-11-29
2007-11-29
No

I discovered that if you have two claims on the same client for the same amount it would only output the first claim even if the dates of service are different.

my patch will output multiple claims if the service line dates of service are different. There are a few problems with this however.

first, this would only work if your only outputing one service per claim line.

second, this still doesn't catch if you want to submit two claims for the same amount on the same day. ie two services that costs the same amount. I suppose you could do some kind of logic before outputing to the 837 table but still.

Situations like this is why it might be a good idea to break out the table structure by loop.

The following sql will help track down which claims may not have been output.

select c1.x12_transaction_id
, c1.L2300_clm01_pt_acct_num
, c1.L2300_clm02_total_claim_chg_amt
, c1.L2400_dtp02_472_from_service_date
, c2.L2400_dtp02_472_from_service_date
from x12_837_claim_professional c1
, x12_837_claim_professional c2
where c1.x12_transaction_id = c2.x12_transaction_id
and c1.L2300_clm01_pt_acct_num = c2.L2300_clm01_pt_acct_num
and c1.L2300_clm02_total_claim_chg_amt = c2.L2300_clm02_total_claim_chg_amt
and c1.L2400_dtp02_472_from_service_date <> c2.L2400_dtp02_472_from_service_date

Just adjusted the following if statement at line: 2876

if ( IsNull(@L2000B_hl01_hierarchical_id_num, '') <> IsNull(@prev_L2000B_hl01_hierarchical_id_num, '') OR
IsNull(@L2000C_hl01_hierarchical_id_num, '') <> IsNull(@prev_L2000C_hl01_hierarchical_id_num, '') OR
@L2300_clm01_pt_acct_num <> IsNull(@prev_L2300_clm01_pt_acct_num, '') OR
@L2300_clm01_pt_acct_num IS NULL OR
@L2300_clm02_total_claim_chg_amt <> @prev_L2300_clm02_total_claim_chg_amt OR
@L2400_dtp02_472_from_service_date <> @prev_L2400_dtp02_472_from_service_date OR -- ars 11/29/2007 added to handle claims when they look the same but are on diff dates
@L2400_dtp02_472_to_service_date <> @prev_L2400_dtp02_472_to_service_date OR -- ars 11/29/2007 note this will only work as long as there is only one service per claim
@L2330B_ref02_F8_other_payer_secondary_id <> @prev_L2330B_ref02_F8_other_payer_secondary_id OR
@L2300_ref02_F8_original_ref_num <> @prev_L2300_ref02_F8_original_ref_num
)

Discussion

  • Aaron R. Short

    Aaron R. Short - 2007-11-29

    Logged In: YES
    user_id=1108183
    Originator: YES

    I suppose one could also add logic to check the service codes for changes which would allow for multiple services with the same amount but the one service per claim would still hold.

     
  • Aaron R. Short

    Aaron R. Short - 2007-11-29

    Logged In: YES
    user_id=1108183
    Originator: YES

    To catch if the code changes but date the same:

    if ( IsNull(@L2000B_hl01_hierarchical_id_num, '') <> IsNull(@prev_L2000B_hl01_hierarchical_id_num, '') OR
    IsNull(@L2000C_hl01_hierarchical_id_num, '') <> IsNull(@prev_L2000C_hl01_hierarchical_id_num, '') OR
    @L2300_clm01_pt_acct_num <> IsNull(@prev_L2300_clm01_pt_acct_num, '') OR
    @L2300_clm01_pt_acct_num IS NULL OR
    @L2300_clm02_total_claim_chg_amt <> @prev_L2300_clm02_total_claim_chg_amt OR
    @L2400_dtp02_472_from_service_date <> @prev_L2400_dtp02_472_from_service_date OR -- ars 11/29/2007 added to handle claims when they look the same but are on diff dates
    @L2400_dtp02_472_to_service_date <> @prev_L2400_dtp02_472_to_service_date OR -- ars 11/29/2007 note this will only work as long as there is only one service per claim
    @L2400_sv101_proc_code + @L2400_sv101_proc_mod1 <> @L2400_sv101_proc_code + @L2400_sv101_proc_mod1 OR -- ars 11/29/2007
    @L2330B_ref02_F8_other_payer_secondary_id <> @prev_L2330B_ref02_F8_other_payer_secondary_id OR
    @L2300_ref02_F8_original_ref_num <> @prev_L2300_ref02_F8_original_ref_num
    )

     
  • Aaron R. Short

    Aaron R. Short - 2007-11-29

    Logged In: YES
    user_id=1108183
    Originator: YES

    File Added: up_x12_837p_export.sql

     
  • Aaron R. Short

    Aaron R. Short - 2007-11-30

    Logged In: YES
    user_id=1108183
    Originator: YES

    Chad had already fixed this! with the far more elegant if statement checking if the service line number had reset. duh! Please note that the attached file also fixes a minor code update from 1G to IG.

    -- If this is a different subscriber, a different patient, a different patient account number, or the charges are different, start a new 2300 LOOP.
    if ( IsNull(@L2000B_hl01_hierarchical_id_num, '') <> IsNull(@prev_L2000B_hl01_hierarchical_id_num, '') OR
    IsNull(@L2000C_hl01_hierarchical_id_num, '') <> IsNull(@prev_L2000C_hl01_hierarchical_id_num, '') OR
    @L2300_clm01_pt_acct_num <> IsNull(@prev_L2300_clm01_pt_acct_num, '') OR
    @L2300_clm01_pt_acct_num IS NULL OR
    @L2400_lx01_assigned_num = '1' OR
    @L2300_clm02_total_claim_chg_amt <> @prev_L2300_clm02_total_claim_chg_amt OR
    @L2330B_ref02_F8_other_payer_secondary_id <> @prev_L2330B_ref02_F8_other_payer_secondary_id OR
    @L2300_ref02_F8_original_ref_num <> @prev_L2300_ref02_F8_original_ref_num
    )

     
  • Aaron R. Short

    Aaron R. Short - 2007-11-30

    Logged In: YES
    user_id=1108183
    Originator: YES

    File Added: up_x12_837p_export.sql

     
  • Aaron R. Short

    Aaron R. Short - 2007-11-30
     
  • Aaron R. Short

    Aaron R. Short - 2007-11-30

    Logged In: YES
    user_id=1108183
    Originator: YES

    File Added: up_x12_837p_export.sql

     

Log in to post a comment.