ABME8L9 ; IHS/ASDST/DMJ - Header
;;2.6;IHS 3P BILLING SYSTEM;**9**;NOV 12, 2009
;Header Segments
;
; IHS/SD/SDR - v2.5 p8 - IM14722
; Added code to check for FL override for FL32
;
; IHS/SD/SDR - V2.5 P8 - IM12418/IM14732/IM16264/IM16363/IM16618
; Treat rendering/attending the same
;
; IHS/SD/SDR - v2.5 p8 - task 6
; Don't send rendering if ambulance; send 77 for ambulance
;
; IHS/SD/SDR - v2.5 p9 - IM19291
; UPIN for Supervising Provider
;
; IHS/SD/SDR - v2.5 p9 - IM16962
; Removed check for Medicare Part B
;
; IHS/SD/SDR - v2.5 p10 - IM20111
; Added quit if POS=12
;
; IHS/SD/SDR - v2.5 p11 - NPI
;
; IHS/SD/SDR - v2.5 p11 - IM24200
;
; IHS/SD/SDR - v2.5 p12 - IM24898
; Change qualifier for supervising provider to 1G
;
; IHS/SD/SDR - v2.5 p12 - IM25247
; Add missing REF segment for TIN if NPI ONLY
;
EP ;START HERE
N ABM
K ABMP("PRV") ;reset provider array
D GETPRV^ABMEEPRV ; Build Claim Level Provider array
S ABMPAYER=ABMP("INS")
;
; Loop 2310A - Referring Physician Name
I $D(ABMP("PRV","F")) D
.S ABM("PRV")=$O(ABMP("PRV","F",0))
.S ABMLOOP="2310A"
.D EP^ABME8NM1("DN")
.D WR^ABMUTL8("NM1")
.I $$PTAX^ABMEEPRV(ABM("PRV"))'="" D
..D EP^ABME8PRV("RF",ABM("PRV"))
..D WR^ABMUTL8("PRV")
.I ABMNPIU="N" D
..D EP^ABME8REF("EI",9999999.06,DUZ(2))
..D WR^ABMUTL8("REF")
.I ABMNPIU'="N" D
..D EP^ABME8REF($S($P($G(ABMB8),U,18)'="":$P(ABMB8,U,18),1:ABMP("RTYPE")),200,ABM("PRV"))
..D WR^ABMUTL8("REF")
;
; Loop 2310B - Rendering Physician Name
I $D(ABMP("PRV","R"))!($D(ABMP("PRV","A"))) D
.Q:$G(ABMP("VTYP"))=831 ;don't write provider info for ASC
.Q:$G(ABMP("CLIN"))="A3"
.S ABM("PRV")=$S($D(ABMP("PRV","R")):$O(ABMP("PRV","R",0)),1:$O(ABMP("PRV","A",0)))
.S ABMLOOP="2310B"
.D EP^ABME8NM1("82")
.D WR^ABMUTL8("NM1")
.D EP^ABME8PRV("PE",ABM("PRV"))
.D WR^ABMUTL8("PRV")
.Q:$P($G(^AUTNINS(ABMP("INS"),0)),U)["OKLAHOMA MEDICAID"
.I ABMNPIU="N" D
..D EP^ABME8REF("EI",9999999.06,DUZ(2))
..Q:((ABMRCID="99999")!(ABMRCID="AHCCCS866004791")) ;AZ Medicaid
..D WR^ABMUTL8("REF")
.I ABMNPIU'="N" D
..D EP^ABME8REF(ABMP("RTYPE"),200,ABM("PRV"))
..D WR^ABMUTL8("REF")
.K ABMLOOP
;
; Loop 2310C - Purchased Service Physician Name
I $D(ABMP("PRV","P")) D
.S ABM("PRV")=$O(ABMP("PRV","P",0))
.D EP^ABME8NM1("QB")
.D WR^ABMUTL8("NM1")
.I ABMNPIU="N" D
..D EP^ABME8REF("EI",9999999.06,DUZ(2))
..D WR^ABMUTL8("REF")
.I ABMNPIU'="N" D
..D EP^ABME8REF(ABMP("RTYPE"),200,ABM("PRV"))
..D WR^ABMUTL8("REF")
;
;
; Loop 2310D - Service Facility Name
S ABMLOOP="2310D"
S ABMTRUE=(ABMP("LDFN")'=DUZ(2))
S:$G(ABMTRUE)="" ABMTRUE=(ABMP("CLIN"))="A3"
I 'ABMTRUE D
.Q:$$POS^ABMERUTL<12
.Q:$$POS^ABMERUTL=12
.S ABMTRUE=1
I ABMTRUE D
.D EP^ABME8NM1($S($G(ABMP("CLIN"))="A3":77,1:"FA"))
.D OVER^ABMUTLP(51)
.D WR^ABMUTL8("NM1")
.I $G(ABMP("CLIN"))="A3" S ABMFILE=9002274.4,ABMIEN=ABMP("BDFN")
.E S ABMFILE=4,ABMIEN=ABMP("LDFN")
.D EP^ABME8N3(ABMFILE,ABMIEN)
.D OVER^ABMUTLP(52)
.D WR^ABMUTL8("N3")
.I $G(ABMP("CLIN"))="A3" S ABMFILE=9002274.4,ABMIEN=ABMP("BDFN")
.E S ABMFILE=4,ABMIEN=ABMP("LDFN")
.D EP^ABME8N4(ABMFILE,ABMIEN)
.D OVER^ABMUTLP(53)
.D WR^ABMUTL8("N4")
.Q:$G(ABMP("CLIN"))="A3"
.I ABMNPIU'="N" D
..I ABMP("ITYPE")="R" D
...D EP^ABME8REF("1C",9999999.06,ABMP("LDFN"))
...D WR^ABMUTL8("REF")
..I ABMP("ITYPE")="D"!(ABMP("ITYPE")="K") D
...D EP^ABME8REF("1D",9999999.06,ABMP("LDFN"))
...D WR^ABMUTL8("REF")
;
; Loop 2310E - Supervising Physician Name
I $D(ABMP("PRV","S")) D
.S ABM("PRV")=$O(ABMP("PRV","S",0))
.D EP^ABME8NM1("DQ")
.D WR^ABMUTL8("NM1")
.I ABMNPIU="N" D
..D EP^ABME8REF("EI",9999999.06,DUZ(2))
..D WR^ABMUTL8("REF")
.I ABMNPIU'="N" D
..D EP^ABME8REF("1G",200,ABM("PRV"))
..D WR^ABMUTL8("REF")
Q
ABME8L9 ; IHS/ASDST/DMJ - Header
+1 ;;2.6;IHS 3P BILLING SYSTEM;**9**;NOV 12, 2009
+2 ;Header Segments
+3 ;
+4 ; IHS/SD/SDR - v2.5 p8 - IM14722
+5 ; Added code to check for FL override for FL32
+6 ;
+7 ; IHS/SD/SDR - V2.5 P8 - IM12418/IM14732/IM16264/IM16363/IM16618
+8 ; Treat rendering/attending the same
+9 ;
+10 ; IHS/SD/SDR - v2.5 p8 - task 6
+11 ; Don't send rendering if ambulance; send 77 for ambulance
+12 ;
+13 ; IHS/SD/SDR - v2.5 p9 - IM19291
+14 ; UPIN for Supervising Provider
+15 ;
+16 ; IHS/SD/SDR - v2.5 p9 - IM16962
+17 ; Removed check for Medicare Part B
+18 ;
+19 ; IHS/SD/SDR - v2.5 p10 - IM20111
+20 ; Added quit if POS=12
+21 ;
+22 ; IHS/SD/SDR - v2.5 p11 - NPI
+23 ;
+24 ; IHS/SD/SDR - v2.5 p11 - IM24200
+25 ;
+26 ; IHS/SD/SDR - v2.5 p12 - IM24898
+27 ; Change qualifier for supervising provider to 1G
+28 ;
+29 ; IHS/SD/SDR - v2.5 p12 - IM25247
+30 ; Add missing REF segment for TIN if NPI ONLY
+31 ;
EP ;START HERE
+1 NEW ABM
+2 ;reset provider array
KILL ABMP("PRV")
+3 ; Build Claim Level Provider array
DO GETPRV^ABMEEPRV
+4 SET ABMPAYER=ABMP("INS")
+5 ;
+6 ; Loop 2310A - Referring Physician Name
+7 IF $DATA(ABMP("PRV","F"))
Begin DoDot:1
+8 SET ABM("PRV")=$ORDER(ABMP("PRV","F",0))
+9 SET ABMLOOP="2310A"
+10 DO EP^ABME8NM1("DN")
+11 DO WR^ABMUTL8("NM1")
+12 IF $$PTAX^ABMEEPRV(ABM("PRV"))'=""
Begin DoDot:2
+13 DO EP^ABME8PRV("RF",ABM("PRV"))
+14 DO WR^ABMUTL8("PRV")
End DoDot:2
+15 IF ABMNPIU="N"
Begin DoDot:2
+16 DO EP^ABME8REF("EI",9999999.06,DUZ(2))
+17 DO WR^ABMUTL8("REF")
End DoDot:2
+18 IF ABMNPIU'="N"
Begin DoDot:2
+19 DO EP^ABME8REF($SELECT($PIECE($GET(ABMB8),U,18)'="":$PIECE(ABMB8,U,18),1:ABMP("RTYPE")),200,ABM("PRV"))
+20 DO WR^ABMUTL8("REF")
End DoDot:2
End DoDot:1
+21 ;
+22 ; Loop 2310B - Rendering Physician Name
+23 IF $DATA(ABMP("PRV","R"))!($DATA(ABMP("PRV","A")))
Begin DoDot:1
+24 ;don't write provider info for ASC
IF $GET(ABMP("VTYP"))=831
QUIT
+25 IF $GET(ABMP("CLIN"))="A3"
QUIT
+26 SET ABM("PRV")=$SELECT($DATA(ABMP("PRV","R")):$ORDER(ABMP("PRV","R",0)),1:$ORDER(ABMP("PRV","A",0)))
+27 SET ABMLOOP="2310B"
+28 DO EP^ABME8NM1("82")
+29 DO WR^ABMUTL8("NM1")
+30 DO EP^ABME8PRV("PE",ABM("PRV"))
+31 DO WR^ABMUTL8("PRV")
+32 IF $PIECE($GET(^AUTNINS(ABMP("INS"),0)),U)["OKLAHOMA MEDICAID"
QUIT
+33 IF ABMNPIU="N"
Begin DoDot:2
+34 DO EP^ABME8REF("EI",9999999.06,DUZ(2))
+35 ;AZ Medicaid
IF ((ABMRCID="99999")!(ABMRCID="AHCCCS866004791"))
QUIT
+36 DO WR^ABMUTL8("REF")
End DoDot:2
+37 IF ABMNPIU'="N"
Begin DoDot:2
+38 DO EP^ABME8REF(ABMP("RTYPE"),200,ABM("PRV"))
+39 DO WR^ABMUTL8("REF")
End DoDot:2
+40 KILL ABMLOOP
End DoDot:1
+41 ;
+42 ; Loop 2310C - Purchased Service Physician Name
+43 IF $DATA(ABMP("PRV","P"))
Begin DoDot:1
+44 SET ABM("PRV")=$ORDER(ABMP("PRV","P",0))
+45 DO EP^ABME8NM1("QB")
+46 DO WR^ABMUTL8("NM1")
+47 IF ABMNPIU="N"
Begin DoDot:2
+48 DO EP^ABME8REF("EI",9999999.06,DUZ(2))
+49 DO WR^ABMUTL8("REF")
End DoDot:2
+50 IF ABMNPIU'="N"
Begin DoDot:2
+51 DO EP^ABME8REF(ABMP("RTYPE"),200,ABM("PRV"))
+52 DO WR^ABMUTL8("REF")
End DoDot:2
End DoDot:1
+53 ;
+54 ;
+55 ; Loop 2310D - Service Facility Name
+56 SET ABMLOOP="2310D"
+57 SET ABMTRUE=(ABMP("LDFN")'=DUZ(2))
+58 IF $GET(ABMTRUE)=""
SET ABMTRUE=(ABMP("CLIN"))="A3"
+59 IF 'ABMTRUE
Begin DoDot:1
+60 IF $$POS^ABMERUTL<12
QUIT
+61 IF $$POS^ABMERUTL=12
QUIT
+62 SET ABMTRUE=1
End DoDot:1
+63 IF ABMTRUE
Begin DoDot:1
+64 DO EP^ABME8NM1($SELECT($GET(ABMP("CLIN"))="A3":77,1:"FA"))
+65 DO OVER^ABMUTLP(51)
+66 DO WR^ABMUTL8("NM1")
+67 IF $GET(ABMP("CLIN"))="A3"
SET ABMFILE=9002274.4
SET ABMIEN=ABMP("BDFN")
+68 IF '$TEST
SET ABMFILE=4
SET ABMIEN=ABMP("LDFN")
+69 DO EP^ABME8N3(ABMFILE,ABMIEN)
+70 DO OVER^ABMUTLP(52)
+71 DO WR^ABMUTL8("N3")
+72 IF $GET(ABMP("CLIN"))="A3"
SET ABMFILE=9002274.4
SET ABMIEN=ABMP("BDFN")
+73 IF '$TEST
SET ABMFILE=4
SET ABMIEN=ABMP("LDFN")
+74 DO EP^ABME8N4(ABMFILE,ABMIEN)
+75 DO OVER^ABMUTLP(53)
+76 DO WR^ABMUTL8("N4")
+77 IF $GET(ABMP("CLIN"))="A3"
QUIT
+78 IF ABMNPIU'="N"
Begin DoDot:2
+79 IF ABMP("ITYPE")="R"
Begin DoDot:3
+80 DO EP^ABME8REF("1C",9999999.06,ABMP("LDFN"))
+81 DO WR^ABMUTL8("REF")
End DoDot:3
+82 IF ABMP("ITYPE")="D"!(ABMP("ITYPE")="K")
Begin DoDot:3
+83 DO EP^ABME8REF("1D",9999999.06,ABMP("LDFN"))
+84 DO WR^ABMUTL8("REF")
End DoDot:3
End DoDot:2
End DoDot:1
+85 ;
+86 ; Loop 2310E - Supervising Physician Name
+87 IF $DATA(ABMP("PRV","S"))
Begin DoDot:1
+88 SET ABM("PRV")=$ORDER(ABMP("PRV","S",0))
+89 DO EP^ABME8NM1("DQ")
+90 DO WR^ABMUTL8("NM1")
+91 IF ABMNPIU="N"
Begin DoDot:2
+92 DO EP^ABME8REF("EI",9999999.06,DUZ(2))
+93 DO WR^ABMUTL8("REF")
End DoDot:2
+94 IF ABMNPIU'="N"
Begin DoDot:2
+95 DO EP^ABME8REF("1G",200,ABM("PRV"))
+96 DO WR^ABMUTL8("REF")
End DoDot:2
End DoDot:1
+97 QUIT