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