Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: ABME8SBR

ABME8SBR.m

Go to the documentation of this file.
  1. ABME8SBR ; IHS/ASDST/DMJ - 837 SBR Segment
  1. ;;2.6;IHS 3P BILLING SYSTEM;**8,9**;NOV 12, 2009
  1. ;Transaction Set Header
  1. ;
  1. ; IHS/SD/SDR - v2.5 p8 - IM15307/IM14092
  1. ; Modified to check MSP reason if Medicare
  1. ;
  1. ; IHS/SD/SDR/LSL - v2.5 p8 - IM13693/IM17856
  1. ; Send SBR06 for 837D only in loop 2000B (Subscriber)
  1. ; Not in loop 2320 (Other Subscriber) or other 837 formats
  1. ;
  1. ; IHS/SD/SDR - v2.5 p10 - COB issue
  1. ; Added code to check if COB
  1. ;
  1. ; IHS/SD/SDR - v2.5 p13 - IM25436
  1. ; SBR05 s/b C1 when Medicare Suppl insurer type
  1. ;
  1. EP(X) ;EP
  1. ;x=1 (primary), 2 (secondary) or 3 (tertiary)
  1. K ABMREC("SBR"),ABMR("SBR")
  1. S ABME("RTYPE")="SBR"
  1. S ABMPST=X
  1. D LOOP
  1. K ABME,ABM
  1. Q
  1. LOOP ;LOOP HERE
  1. F I=10:10:100 D
  1. .D @I
  1. .I $D(^ABMEXLM("AA",+$G(ABMP("INS")),+$G(ABMP("EXP")),ABME("RTYPE"),I)) D @(^(I))
  1. .I $G(ABMREC("SBR"))'="" S ABMREC("SBR")=ABMREC("SBR")_"*"
  1. .S ABMREC("SBR")=$G(ABMREC("SBR"))_ABMR("SBR",I)
  1. Q
  1. 10 ;segment
  1. S ABMR("SBR",10)="SBR"
  1. Q
  1. 20 ;SBR01 - Payer Responsibility Sequence Number Code
  1. S ABMR("SBR",20)=$S(ABMPST=1:"P",ABMPST=2:"S",ABMPST=3:"T",1:"P")
  1. Q
  1. 30 ;SBR02 - Individual Relationship Code
  1. S ABMR("SBR",30)=$G(ABMP("REL",ABMPST))
  1. I $G(ABMHL)=22 D
  1. .I $G(ABMCHILD)=0 S ABMR("SBR",30)=18
  1. .I $G(ABMCHILD)=1 S ABMR("SBR",30)=""
  1. Q
  1. 40 ;SBR03 - Reference Identification (Group Number)
  1. S ABMR("SBR",40)=$G(ABMP("GRP#",ABMPST))
  1. Q
  1. 50 ;SBR04 - Group Name
  1. I ABMR("SBR",40)'="" D Q
  1. .S ABMR("SBR",50)=""
  1. S ABMR("SBR",50)=$G(ABMP("GRPNM",ABMPST))
  1. Q
  1. 60 ;SBR05 - Insurance Type Code
  1. S ABMR("SBR",60)=""
  1. D PREV^ABMDFUTL
  1. I (ABMPST=1)&(+$G(ABMP("PD"))=0)&(+$G(ABMP("DED"))=0)&(+$G(ABMP("COI"))=0)&(+$G(ABMP("NONC"))=0) Q
  1. I $P(ABMP("INS",ABMPST),U,2)="R",(ABMPST=2),($P($G(^ABMNINS(ABMP("LDFN"),$P(ABMP("INS",1),U),0)),U,11)="Y") S ABMR("SBR",60)=$P($G(^ABMDBILL(DUZ(2),ABMP("BDFN"),12)),U) ;abm*2.6*9 tribal self-insured
  1. Q:ABMP("EXP")'=22
  1. I $P(ABMP("INS",ABMPST),U,2)="R",(ABMPST'=1) S ABMR("SBR",60)=$P($G(^ABMDBILL(DUZ(2),ABMP("BDFN"),12)),U)
  1. I $P(ABMP("INS",ABMPST),U,2)="R",(ABMPST=1),($G(ABMLOOP)=2320) S ABMR("SBR",60)=$G(ABMP("SOP",ABMPST))
  1. I ($G(ABMR("SBR",60))=""),($G(ABMLOOP)=2320) S ABMR("SBR",60)=$G(ABMP("SOP",ABMPST))
  1. S:ABMR("SBR",60)="CI" ABMR("SBR",60)="C1"
  1. S:ABMR("SBR",60)="BL" ABMR("SBR",60)="C1"
  1. Q
  1. 70 ;SBR06 - Coordination of Benefits Code
  1. S ABMR("SBR",70)=""
  1. I ABMI=1,ABMP("EXP")=23 D
  1. .I $G(ABMP("INS",2)) S ABMR("SBR",70)=1
  1. .I '$G(ABMP("INS",2)) S ABMR("SBR",70)=6
  1. .;I ABMPST=1 S ABMR("SBR",70)="" ;abm*2.6*8 HEAT28632 - Removes "1" from SBR06 for primary payer when 2ndry payer billed ;abm*2.6*9 NOHEAT
  1. .I $G(ABMLOOP)=2320,ABMPST=1 S ABMR("SBR",70)="" ;Removes "1" from SBR06 for primary payer when 2ndry payer billed ;abm*2.6*9 NOHEAT
  1. Q
  1. 80 ;SBR07 - Yes/No Condition or Response Code
  1. S ABMR("SBR",80)=""
  1. Q
  1. 90 ;SBR08 - Employment Status Code
  1. S ABMR("SBR",90)=""
  1. Q
  1. 100 ;SBR09 - Claim Filing Indicator Code
  1. S ABMR("SBR",100)=$G(ABMP("SOP",ABMPST))
  1. S:ABMR("SBR",100)="SP" ABMR("SBR",100)="CI"
  1. Q