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

ABME8L2.m

Go to the documentation of this file.
ABME8L2 ; IHS/ASDST/DMJ - Header 
 ;;2.6;IHS 3P BILLING SYSTEM;**3,6**;NOV 12, 2009
 ;Header Segments
 ;
 ; IHS/SD/SDR - v2.5 p8 - IM14124/IM15667/IM16383
 ;    Added code to put REF segment for Medicaid and Kidscare
 ;
 ; IHS/SD/SDR - v2.5 p8 - IM14026/IM14883/IM16505
 ;    Modified to use Location DFN instead of DUZ(2)
 ;
 ; IHS/SD/SDR - v2.5 p8 - IM13693/IM17856/IM21870
 ;    Added code for REF segment for ID codes for 2010AA loop
 ;
 ; IHS/SD/SDR - v2.5 p10 - IM20454 - Added flag for what loop
 ; IHS/SD/SDR - v2.5 p11 - NPI
 ; IHS/SD/SDR - v2.5 p12 - IM24975 - Made changes for Value Options
 ; IHS/SD/SDR - abm*2.6*6 - HEAT7254 - add PRV segment to 837D claims
 ;
START ;START HERE
 K ABMHLCNT
 D EP^ABME8HL(20,1)
 D WR^ABMUTL8("HL")
 ;I ABMP("EXP")=21!((ABMRCID="NMMAD")&(ABMP("EXP")=22))!((ABMP("EXP")=22)&(ABMP("VTYP")=831)) D  ;abm*2.6*3 HEAT12845
 ;I ABMP("EXP")=21!((ABMRCID="NMMAD")&(ABMP("EXP")=22))!((ABMP("EXP")=22)&(ABMP("VTYP")=831))!($P($G(^AUTNINS(ABMP("INS"),0)),U)["WASHINGTON MEDICAID") D  ;abm*2.6*3 HEAT12845  ;abm*2.6*6 HEAT7254
 I ABMP("EXP")=21!((ABMRCID="NMMAD")&(ABMP("EXP")=22))!((ABMP("EXP")=22)&(ABMP("VTYP")=831))!($P($G(^AUTNINS(ABMP("INS"),0)),U)["WASHINGTON MEDICAID")!(ABMP("EXP")=23) D  ;abm*2.6*3 HEAT12845  ;abm*2.6*6 HEAT7254
 .D EP^ABME8PRV("BI",DUZ(2))
 .D WR^ABMUTL8("PRV")
 S ABMP("PAYDFN")=$P($G(^ABMDPARM(DUZ(2),1,2)),U,3)
 D EP^ABME8NM1(85)
 D WR^ABMUTL8("NM1")
 D EP^ABME8N3(4,DUZ(2))
 D WR^ABMUTL8("N3")
 D EP^ABME8N4(4,DUZ(2))
 D WR^ABMUTL8("N4")
 S ABMLOOP="2010AA"
 S ABMNPIU=$$NPIUSAGE^ABMUTLF(DUZ(2),ABMP("INS"))
 ;
 I ABMNPIU=""!(ABMNPIU="L")!(ABMNPIU="B") 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
 ..I ABMRCID="FHC&AFFILIATES" D
 ...D EP^ABME8REF("G2",9999999.06,ABMP("LDFN"))
 ..E  D EP^ABME8REF("1D",9999999.06,ABMP("LDFN"))
 ..D WR^ABMUTL8("REF")
 ..I ABMRCID="FHC&AFFILIATES" D
 ...D EP^ABME8REF("LU",9999999.06,ABMP("LDFN"))
 ...D WR^ABMUTL8("REF")
 .S ABMIDCD=""
 .D PIREFID
 .I ABMIDCD]"" D
 ..D EP^ABME8REF(ABMIDCD,9999999.06,DUZ(2))
 ..D WR^ABMUTL8("REF")
 ;
 I ABMNPIU="B"!(ABMNPIU="N") D
 .D EP^ABME8REF("EI",9999999.06,DUZ(2))
 .D WR^ABMUTL8("REF")
 K ABMIDCD
 I ABMP("PAYDFN")'=DUZ(2) D
 .Q:$P($G(^AUTNINS(ABMP("INS"),2)),U)="D"&($P($G(^AUTNINS(ABMP("INS"),0)),U)["OK")
 .S ABMLOOP="2010AB"
 .D EP^ABME8NM1(87)
 .D WR^ABMUTL8("NM1")
 .D EP^ABME8N3(9999999.06,ABMP("PAYDFN"))
 .D WR^ABMUTL8("N3")
 .D EP^ABME8N4(9999999.06,ABMP("PAYDFN"))
 .D WR^ABMUTL8("N4")
 .I ABMNPIU=""!(ABMNPIU="L")!(ABMNPIU="B") 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
 ...I ABMRCID="FHC&AFFILIATES" D
 ....D EP^ABME8REF("G2",9999999.06,ABMP("LDFN"))
 ....D WR^ABMUTL8("REF")
 ...E  D
 ....D EP^ABME8REF("1D",9999999.06,ABMP("LDFN"))
 ....D WR^ABMUTL8("REF")
 ...I ABMRCID="FHC&AFFILIATES" D
 ....D EP^ABME8REF("LU",9999999.06,ABMP("LDFN"))
 ....D WR^ABMUTL8("REF")
 .I ABMNPIU'="N" D
 ..S ABMIDCD=""
 ..D PIREFID
 ..I ABMIDCD]"" D
 ...D EP^ABME8REF(ABMIDCD,9999999.06,DUZ(2))
 ...D WR^ABMUTL8("REF")
 .I ABMNPIU="B"!(ABMNPIU="N") D
 ..D EP^ABME8REF("EI",9999999.06,DUZ(2))
 ..D WR^ABMUTL8("REF")
 .K ABMIDCD
 .K ABMLOOP
 Q
PIREFID ;EP - Find EMC Ref ID for Private Ins.
 S:ABMP("ITYPE")="H" ABMIDCD="BQ"
 S:ABMP("ITYPE")="C" ABMIDCD="1H"
 I "M^P^W^F"[ABMP("ITYPE") S ABMIDCD="G2"
 I ABMIDCD="G2",ABMP("ITYPE")'="M" D
 .I $P($G(^ABMNINS(DUZ(2),ABMP("INS"),1,ABMP("VTYP"),1)),U)]"" D
 ..S ABMIDCD=$P($G(^ABMNINS(DUZ(2),ABMP("INS"),1,ABMP("VTYP"),1)),U)
 ..S ABMIDCD=$P($G(^ABMREFID(ABMIDCD,0)),U)
 ..S:ABMIDCD="" ABMIDCD="G2"
 Q