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

ABME5L8.m

Go to the documentation of this file.
ABME5L8 ; IHS/ASDST/DMJ - Header 
 ;;2.6;IHS 3P BILLING SYSTEM;**6,8,9,10,11**;NOV 12, 2009;Build 133
 ;Header Segments
START ;START HERE
 D PAYED^ABMUTLP
 N ABMI
 S ABMI=0
 F  S ABMI=$O(ABMP("INS",ABMI)) Q:'ABMI  D
 .S ABMLINE=ABMP("INS",ABMI)
 .;I $P(ABMLINE,U)=ABMP("INS"),$P(ABMLINE,"^",3)="I" Q  ;abm*2.6*10 HEAT58915
 .I $S($P(ABMLINE,U,11):$P(ABMLINE,U,11),1:$P(ABMLINE,U))=ABMP("INS"),$P(ABMLINE,"^",3)="I" Q  ;abm*2.6*10 HEAT58915
 .; Loop 2320 - Other Subscriber Information
 .S ABMLOOP=2320
 .;abm*2.6*8 start new code
 .I $G(ABMSBR(ABMI)) D
 ..S ABMSFILE=$P(ABMSBR(ABMI),"-",1)
 ..S ABMSIEN=$P(ABMSBR(ABMI),"-",2)
 .;abm*2.6*8 end new code
 .D EP^ABME5SBR(ABMI)
 .D WR^ABMUTL8("SBR")
 .F ABML="OA","PR" D
 ..Q:'$D(ABMP(+ABMLINE,ABML))  ;quit if no data for insurer in ABMP adj array
 ..D EP^ABME5CAS
 ..D WR^ABMUTL8("CAS")
 .;I $G(ABMP("PAYED",+ABMLINE)) D  ;abm*2.6*9 tribal self-insured
 .I $G(ABMP("PAYED",+ABMLINE))!($P($G(^ABMNINS(ABMP("LDFN"),+ABMLINE,0)),U,11)="Y") D  ;abm*2.6*9 tribal self-insured
 ..D EP^ABME5AMT("D")
 ..D WR^ABMUTL8("AMT")
 .;start new code abm*2.6*10 COB billing
 .;I ABMPSQ'=1,$$GET1^DIQ(9999999.181,$$GET1^DIQ(9999999.18,+ABMP("INS"),".211","I"),1,"I")="R" D
 ..S ABMAMT=0
 ..D EP^ABME5AMT("B6")
 ..D WR^ABMUTL8("AMT")
 ..;end new code abm*2.6*10 COB billing
 .D ^ABME5OI
 .D WR^ABMUTL8("OI")
 .; Loop 2330A - Other Subscriber Name
 .S ABMLOOP="2330A"
 .D EP^ABME5NM1("IL")
 .D WR^ABMUTL8("NM1")
 .D EP^ABME5N3(ABMSFILE,ABMSIEN)
 .D WR^ABMUTL8("N3")
 .D EP^ABME5N4(ABMSFILE,ABMSIEN)
 .D WR^ABMUTL8("N4")
 .; Loop 2330B - Other Payer Name
 .S ABMLOOP="2330B"
 .D EP^ABME5NM1("PR",+ABMLINE)
 .D WR^ABMUTL8("NM1")
 .;I $G(ABMP("PAYED",+ABMLINE)) D  ;abm*2.6*9 tribal self-insured
 .I $G(ABMP("PAYED",+ABMLINE))'="" D  ;abm*2.6*9 tribal self-insured
 ..;S ABMPDT=$G(ABMP("PDT",+ABMLINE))  ;abm*2.6*9 tribal self-insured
 ..;S ABMPDT=$S($P($G(ABMP("PAYED",+ABMLINE)),U,2)'="":$P(ABMP("PAYED",+ABMLINE),U,2),$G(ABMP("PDT",+ABMLINE))'="":ABMP("PDT",+ABMLINE),1:"")  ;abm*2.6*9 tribal self-insured  ;abm*2.6*10 COB billing
 ..S ABMPDT=$S($P($G(ABMP("PAYED",+ABMLINE)),U,2)'="":$P(ABMP("PAYED",+ABMLINE),U,2),$G(ABMP("PDT",+ABMLINE))'="":ABMP("PDT",+ABMLINE),1:DT)  ;abm*2.6*9 tribal self-insured  ;abm*2.6*10 COB billing
 ..D EP^ABME5DTP(573,"D8",ABMPDT)
 ..D WR^ABMUTL8("DTP")
 ..K ABMPDT
 .I $G(ABMP("PNUM",ABMI))'="" D
 ..;D EP^ABME5NM2("QC",ABMI)
 ..;D WR^ABMUTL8("NM1")
 .;D OTHR
 Q
OTHR ;other payer info
 ; Loops 2330C - 2330I 0 Other Payer Info
 N J
 F J=1:1:4 D
 .S ABMPTYP=$E("AOTR",J)
 .S ABMPROV=$O(ABMP("PRV",ABMPTYP,0))
 .I ABMPROV D
 ..S ABMPNBR=$$NPI^ABMEEPRV(ABMPROV,ABMP("LDFN"),+ABMLINE)
 ..Q:ABMPNBR=""
 ..D EP^ABME5NM2($P("71^72^ZZ^DN","^",J))
 ..D WR^ABMUTL8("NM1")
 ..S ABMITYP=$P(ABMLINE,"^",2)
 ..S ABMITYP=$S(ABMITYP="R":"1C",ABMITYP="D":"1D",1:"G2")
 ..I ABMITYP="G2",$$BCBS1^ABMERUTL(+ABMLINE) S ABMITYP="1A"
 ..D EP^ABME5RF2(ABMITYP)
 ..D WR^ABMUTL8("REF")
 Q