ABMDRCHK ; IHS/ASDST/DMJ - Report Utility to Check Parms ;
;;2.6;IHS Third Party Billing;**1,9,10,14,21**;NOV 12, 2009;Build 379
;Original;TMD;10/17/95 12:45 PM
;
; IHS/SD/SDR - v2.5 p8 - Added code to check cancelled claim file
; IHS/SD/SDR,TPF - v2.5 p8 - added code for pending status (12)
; IHS/SD/SDR - v2.5 p9 - IM17380 - Split out line and added $G
; IHS/SD/SDR - v2.5 p10 - IM21520 - Fixed report so it would allow selection of one insurer
;
; IHS/SD/SDR - v2.6 CSV
; IHS/SD/SDR - abm*2.6*1 - HEAT7633 - didn't work when V-codes were selected
; IHS/SD/SDR - 2.6*9 - HEAT43507 - Closed claim report doesn't run by visit date
;IHS/SD/SDR - 2.6*14 - ICD10 009 - Updated so reports will check for ICD-10 codes
;IHS/SD/SDR - 2.6*14 - Updated DX^ABMCVAPI to be numeric
;IHS/SD/SDR - 2.6*14 - HEAT165197 (CR3109) - Updated check for DX range to use $$NUM
;IHS/SD/SDR - 2.6*21 - HEAT184442 - Made change for programming error <UNDEF>DX+22^ABMDRCHK. Occurs when user selects BOTH
; but doesn't enter any ICD10 codes, just hits return.
;IHS/SD/SDR - 2.6*21 - HEAT186137 - Fixed check for pending claims report if a specific visit type is selected.
;IHS/SD/SDR - 2.6*21 - VMBP RQMT_96 - Updated checked to look at new insurer type field
;
BILL ;EP for checking Bill File data parameters
Q:'$D(^ABMDBILL(DUZ(2),ABM,0))!('$D(^(1)))
Q:$P(^ABMDBILL(DUZ(2),ABM,0),"^",4)="X"
;ABM("L") is piece 3 of bill file
S ABM("V")=$P($G(^ABMDBILL(DUZ(2),ABM,0)),U,7)
S ABM("L")=$P($G(^ABMDBILL(DUZ(2),ABM,0)),U,3)
S ABM("I")=$P($G(^ABMDBILL(DUZ(2),ABM,0)),U,8)
S ABM("P")=$P($G(^ABMDBILL(DUZ(2),ABM,0)),U,5)
S ABM("D")=$P($G(^ABMDBILL(DUZ(2),ABM,7)),U)
S ABM("A")=$P($G(^ABMDBILL(DUZ(2),ABM,1)),U,4)
S ABM("C")=$P($G(^ABMDBILL(DUZ(2),ABM,0)),U,10)
S ABM("AD")=$P($G(^ABMDBILL(DUZ(2),ABM,1)),U,5)
S ABM("XD")=$P($G(^ABMDBILL(DUZ(2),ABM,1)),U,7)
Q:ABM("L")=""!(ABM("I")="")!(ABM("P")="")!(ABM("D")="")
Q:($D(ABMY("VYTP"))&(ABM("V")=""))
Q:($D(ABMY("CLIN"))&(ABM("C")=""))
Q:'$D(^AUTNINS(ABM("I"),0))
I $D(ABMP("TYP")),ABMP("TYP")=0 Q:+$O(^ABMDBILL(DUZ(2),ABM,3,0))
I $D(ABMP("TYP")),ABMP("TYP")=1,'+$O(^ABMDBILL(DUZ(2),ABM,3,0)) Q
I $G(ABMP("COMPL")) Q:$P(^ABMDBILL(DUZ(2),ABM,0),U,4)="C"
I $D(ABMY("LOC")),ABMY("LOC")'=ABM("L") Q
I $D(ABMY("PAT")),ABMY("PAT")'=ABM("P") Q
I $D(ABMP("FORM")),+ABMP("FORM")'=$P(^ABMDBILL(DUZ(2),ABM,0),U,6) Q
I $D(ABMY("PRV")),'$D(^ABMDBILL(DUZ(2),ABM,41,"B",ABMY("PRV"))) Q
I $D(ABMY("DX")) S ABM("DX","HIT")=0,ABM("DX")="BILL" D DX Q:'ABM("DX","HIT")
I $D(ABMY("PX")) S ABM("PX","HIT")=0,ABM("PX")="BILL" D PX Q:'ABM("PX","HIT")
I $D(ABMY("APPR")),ABMY("APPR")'=ABM("A") Q
I $G(ABMY("PTYP"))=2,$P($G(^AUPNPAT(ABM("P"),11)),U,12)'="I" Q
I $G(ABMY("PTYP"))=1,$P($G(^AUPNPAT(ABM("P"),11)),U,12)="I" Q
I $D(ABMY("INS")),ABMY("INS")'=ABM("I") Q
;I $D(ABMY("TYP")) Q:ABMY("TYP")'[$P($G(^AUTNINS(ABM("I"),2)),U) ;abm*2.6*10 HEAT73780
;I $D(ABMY("TYP")) Q:ABMY("TYP")'[$$GET1^DIQ(9999999.181,$$GET1^DIQ(9999999.18,ABM("I"),".211","I"),1,"I") ;abm*2.6*10 HEAT73780 ;abm*2.6*21 IHS/SD/SDR VMBP RQMT_96
I $D(ABMY("TYP")) Q:("^"_ABMY("TYP")_"^")'[("^"_$$GET1^DIQ(9999999.181,$$GET1^DIQ(9999999.18,ABM("I"),".211","I"),1,"I")_"^") ;abm*2.6*10 HEAT73780 ;abm*2.6*21 IHS/SD/SDR VMBP RQMT_96
I $D(ABMY("CLIN")),'$D(ABMY("CLIN",+$P(^ABMDBILL(DUZ(2),ABM,0),"^",10))) Q
I $D(ABMY("VTYP")),'$D(ABMY("VTYP",+$P(^ABMDBILL(DUZ(2),ABM,0),"^",7))) Q
K ABM("QUIT")
I $G(ABMY("DT"))="V" D Q:$G(ABM("QUIT"))
.S:$P(ABM("D"),".")<ABMY("DT",1) ABM("QUIT")=1
.S:$P(ABM("D"),".")>ABMY("DT",2) ABM("QUIT")=1
I $G(ABMY("DT"))="A" D Q:$G(ABM("QUIT"))
.S:$P(ABM("AD"),".")<ABMY("DT",1) ABM("QUIT")=1
.S:$P(ABM("AD"),".")>ABMY("DT",2) ABM("QUIT")=1
S ABMP("HIT")=1
Q
;
CLM ;EP for checking Claim file data parameters
Q:'$D(^ABMDCLM(DUZ(2),ABM,0))
I ABM("STA")'="",$P(^ABMDCLM(DUZ(2),ABM,0),U,4)'=ABM("STA") Q
S ABM("V")=$P(^ABMDCLM(DUZ(2),ABM,0),U,7) ;visit type
S ABM("L")=$P(^ABMDCLM(DUZ(2),ABM,0),U,3) ;visit location
S ABM("I")=$P(^ABMDCLM(DUZ(2),ABM,0),U,8) ;active insurer
S ABM("P")=$P(^ABMDCLM(DUZ(2),ABM,0),U) ;patient
S ABM("D")=$P(^ABMDCLM(DUZ(2),ABM,0),U,2) ;encounter date
S ABM("C")=$P(^ABMDCLM(DUZ(2),ABM,0),U,6) ;clinic
Q:ABM("L")=""!(ABM("I")="")!(ABM("P")="")!(ABM("D")="")!(ABM("V")="")!(ABM("C")="")
Q:'$D(^AUTNINS(ABM("I"),0))
I $D(ABMY("DX")) S ABM("DX","HIT")=0,ABM("DX")="CLM" D DX
I $D(ABMY("PX")) S ABM("PX","HIT")=0,ABM("PX")="CLM" D PX
I $D(ABMY("PRV")),'$D(^ABMDCLM(DUZ(2),ABM,41,"B",ABMY("PRV"))) Q
I $D(ABMY("PAT")),ABMY("PAT")'=ABM("P") Q
I $D(ABMY("LOC")),ABMY("LOC")'=ABM("L") Q
I $D(ABMY("INS")),ABMY("INS")'=ABM("I") Q
I $G(ABMY("PTYP"))=2,$P($G(^AUPNPAT(ABM("P"),11)),U,12)'="I" Q
I $G(ABMY("PTYP"))=1,$P($G(^AUPNPAT(ABM("P"),11)),U,12)="I" Q
;I $D(ABMY("TYP")) Q:ABMY("TYP")'[$P($G(^AUTNINS(ABM("I"),2)),U) ;abm*2.6*10 HEAT73780
;I $D(ABMY("TYP")) Q:ABMY("TYP")'[$$GET1^DIQ(9999999.181,$$GET1^DIQ(9999999.18,ABM("I"),".211","I"),1,"I") ;abm*2.6*10 HEAT73780 ;abm*2.6*21 IHS/SD/SDR VMBP RQMT_96
I $D(ABMY("TYP")) Q:ABMY("TYP")'[("^"_$$GET1^DIQ(9999999.181,$$GET1^DIQ(9999999.18,ABM("I"),".211","I"),1,"I")_"^") ;abm*2.6*10 HEAT73780 ;abm*2.6*21 IHS/SD/SDR VMBP RQMT_96
I $D(ABMY("DT")),$G(ABMY("DT"))'="X",ABM("D")<ABMY("DT",1)!(ABM("D")>ABMY("DT",2)) Q
I $D(ABMY("CLIN")),'$D(ABMY("CLIN",+$P(^ABMDCLM(DUZ(2),ABM,0),"^",6))) Q
I $D(ABMY("VTYP")),'$D(ABMY("VTYP",+$P(^ABMDCLM(DUZ(2),ABM,0),"^",7))) Q
I ABM("STA")'="X" S ABMP("HIT")=1 Q ;stop here if not closed claims
;I ABM("STA")="X",ABMY("DT")="V" S ABMP("HIT")=1 ;abm*2.6*9 HEAT43507 ;abm*2.6*10 HEAT80275
I ABM("STA")="X",$G(ABMY("DT"))="V" S ABMP("HIT")=1 ;abm*2.6*9 HEAT43507 ;abm*2.6*10 HEAT80275
S ABMXFLG=0,ABMDFLG=0
I '$D(ABMY("CLOS")) S ABMXFLG=1
I '$D(ABMY("DT")) S ABMDFLG=1
S ABMY("CIEN")=99999
F S ABMY("CIEN")=$O(^ABMDCLM(DUZ(2),ABM,69,ABMY("CIEN")),-1) Q:+ABMY("CIEN")=0 D Q:ABMXFLG=1
.Q:$P($G(^ABMDCLM(DUZ(2),ABM,69,ABMY("CIEN"),0)),U,3)'="C" ;closed only
.S ABMY("CLOSER")=$P($G(^ABMDCLM(DUZ(2),ABM,69,ABMY("CIEN"),0)),U,2)
.I $D(ABMY("CLOS")),ABMY("CLOSER")=ABMY("CLOS") S ABMXFLG=1
.S ABM("REAS")=$P($G(^ABMDCLM(DUZ(2),ABM,69,ABMY("CIEN"),0)),U,4)
.S ABMY("CLDT")=$P($P($G(^ABMDCLM(DUZ(2),ABM,69,ABMY("CIEN"),0)),U),".")
.I $D(ABMY("DT")),($G(ABMY("DT"))="X") D
..Q:(ABMY("CLDT")<ABMY("DT",1)!(ABMY("CLDT")>ABMY("DT",2)))
..S ABMDFLG=1
.;the below code counts how many times it has been closed, if we are looking for closed
S ABMY("CIEN")=0
F S ABMY("CIEN")=$O(^ABMDCLM(DUZ(2),ABM,69,ABMY("CIEN"))) Q:+ABMY("CIEN")=0 D
.Q:$P($G(^ABMDCLM(DUZ(2),ABM,69,ABMY("CIEN"),0)),U,3)'="C" ;closed only
.S ABMCLSCT=+$G(ABMCLSCT)+1
Q:ABMXFLG=0
Q:ABMDFLG=0
S ABMP("HIT")=1 ;we want this one!
Q
;
DX ;EP
;I 'ABMY("DX",1)!'ABMY("DX",2) G DX2 ;abm*2.6*1 HEAT7633
;I $G(ABMY("DX",1))=""!($G(ABMY("DX",2))="") G DX2 ;abm*2.6*1 HEAT7633 ;abm*2.6*14 ICD10 009
I (+$G(ABMY("DXANS"))'=10)&($G(ABMY("DX",1))=""!($G(ABMY("DX",2))="")) G DX2 ;abm*2.6*14 ICD10 009
;I (+$G(ABMY("DXANS"))'=9)&($G(ABMY("DX",3))=""!($G(ABMY("DX",4))="")) G DX2 ;abm*2.6*14 ICD10 009
;S ABM("DX")=0,ABM("DX","HIT")=0,ABM("LP")=$S($D(ABMY("DX","ALL")):10,1:1) ;abm*2.6*14 ICD10 009
S ABM("DX")=0 ;abm*2.6*14 ICD10 009
S ABM("DX","HIT")=0 ;abm*2.6*14 ICD10 009
S ABM("LP")=$S($D(ABMY("DX","ALL"))!$D(ABMY("DX10","ALL")):10,1:1) ;abm*2.6*14 ICD10 009
F ABM("II")=1:1:ABM("LP") S ABM("DX")=$O(^ABMDBILL(DUZ(2),ABM,17,"C",ABM("DX"))) Q:'ABM("DX") D Q:ABM("DX","HIT")
.S ABM("DX")=$O(^ABMDBILL(DUZ(2),ABM,17,"C",ABM("DX"),""))
.Q:'$D(^ABMDBILL(DUZ(2),ABM,17,ABM("DX"),0)) S ABM("DX",0)=$P(^(0),U)
.;S ABM("DX",0)=$P($$DX^ABMCVAPI(ABM("DX"),ABM("D")),U,2) ;CSV-c ;abm*2.6*14 updated API call
.S ABM("DX",0)=$$NUM^ABMCVAPI($P($$DX^ABMCVAPI(+ABM("DX"),ABM("D")),U,2)) ;CSV-c ;abm*2.6*14 updated API call and added NUM (HEAT165197 - CR3109)
.;I ABM("DX",0)'>ABMY("DX",2),ABM("DX",0)'<ABMY("DX",1) S ABM("DX","HIT")=1 ;abm*2.6*14 ICD10 009
.;start new code abm*2.6*14 ICD10 009 and CR3108
.S ABMDXTYP=+$P($G(^ABMDBILL(DUZ(2),ABM,17,ABM("DX"),0)),U,6)
.I ABMDXTYP=1,$G(ABMY("DXANS"))=9 Q
.I ABMDXTYP=0,$G(ABMY("DXANS"))=10 Q
.I (ABMDXTYP=0) D
..I (ABM("DX",0)'>ABMY("DX",2)),(ABM("DX",0)'<ABMY("DX",1)) S ABM("DX","HIT")=1
.I (ABMDXTYP=1) D
..I '$D(ABMY("DX",3)) Q ;stop here if no data at ABMY("DX",3) ;abm*2.6*21 IHS/SD/SDR HEAT184442
..I (ABM("DX",0)'>ABMY("DX",4)),(ABM("DX",0)'<ABMY("DX",3)) S ABM("DX","HIT")=1
.;end new code ICD10 009 and CR3108
Q
;
DX2 ;EP
Q
;
PX I '+ABMY("PX",1)!'+ABMY("PX",2) Q
I ABM("PX")="BILL" S ABM("PX","HIT")=0 N I F I=21,27,35,37,39 D Q:ABM("PX","HIT")
.N J S J=0 F S J=$O(^ABMDBILL(DUZ(2),ABM,I,J)) Q:'J D
..S ABM("CPT")=$P(^ABMDBILL(DUZ(2),ABM,I,J,0),U)
..Q:ABM("CPT")>+ABMY("PX",2)
..Q:ABM("CPT")<+ABMY("PX",1)
..S ABM("PX","HIT")=1
I ABM("PX")="CLM" S ABM("PX")=0,ABM("PX","HIT")=0 S ABM("PX")=$O(^ABMDCLM(DUZ(2),ABM,21,"C",ABM("PX"))) Q:'ABM("PX") D Q:ABM("PX","HIT")
.S ABM("PX")=$O(^ABMDCLM(DUZ(2),ABM,21,"C",ABM("PX"),""))
.Q:'$D(^ABMDCLM(DUZ(2),ABM,21,ABM("PX"),0)) S ABM("PX",0)=$P(^(0),U)
.Q:+ABM("PX",0)>ABMY("PX",2)
.Q:+ABM("PX",0)<ABMY("PX",1)
.S ABM("PX","HIT")=1
Q
CANCEL ;EP for checking Claim file data parameters
Q:'$D(^ABMCCLMS(DUZ(2),ABM,0))
S ABMCREC=$G(^ABMCCLMS(DUZ(2),ABM,0))
S ABM("VT")=$P(ABMCREC,U,7)
S ABM("VLOC")=$P(ABMCREC,U,3)
S ABM("AINS")=$P(ABMCREC,U,8)
S ABM("PDFN")=$P(ABMCREC,U)
S ABM("CL")=$P(ABMCREC,U,6)
S ABM("CANC")=$P($G(^ABMCCLMS(DUZ(2),ABM,1)),U,4)
S ABM("CDT")=$P($P($G(^ABMCCLMS(DUZ(2),ABM,1)),U,5),".")
S ABM("CR")=$P($G(^ABMCCLMS(DUZ(2),ABM,1)),U,8)
I $D(ABMY("REASON")) Q:'$D(ABMY("REASON",ABM("CR")))
Q:ABM("VLOC")=""!(ABM("AINS")="")!(ABM("PDFN")="")!(ABM("CDT")="")!(ABM("VT")="")!(ABM("CL")="")
Q:'$D(^AUTNINS(ABM("AINS"),0))
I $D(ABMY("DX")) S ABM("DX","HIT")=0,ABM("DX")="CLM" D DX
I $D(ABMY("PX")) S ABM("PX","HIT")=0,ABM("PX")="CLM" D PX
I $D(ABMY("PRV")),'$D(^ABMCCLMS(DUZ(2),ABM,41,"B",ABMY("PRV"))) Q
I $D(ABMY("PAT")),ABMY("PAT")'=ABM("PDFN") Q
I $D(ABMY("LOC")),ABMY("LOC")'=ABM("VLOC") Q
I $D(ABMY("INS")),ABMY("INS")'=ABM("AINS") Q
I $G(ABMY("PTYP"))=2,$P($G(^AUPNPAT(ABM("PDFN"),11)),U,12)'="I" Q
I $G(ABMY("PTYP"))=1,$P($G(^AUPNPAT(ABM("PDFN"),11)),U,12)="I" Q
;I $D(ABMY("TYP")) Q:ABMY("TYP")'[$P($G(^AUTNINS(ABM("AINS"),2)),U) ;abm*2.6*10 HEAT73780
I $D(ABMY("TYP")) Q:ABMY("TYP")'[$$GET1^DIQ(9999999.181,$$GET1^DIQ(9999999.18,ABM("AINS"),".211","I"),1,"I") ;abm*2.6*10 HEAT73780
I $D(ABMY("DT")),ABM("CDT")<ABMY("DT",1)!(ABM("CDT")>ABMY("DT",2)) Q
I $D(ABMY("CLIN")),'$D(ABMY("CLIN",+$P(^ABMCCLMS(DUZ(2),ABM,0),"^",6))) Q
I $D(ABMY("VTYP")),'$D(ABMY("VTYP",+$P(^ABMCCLMS(DUZ(2),ABM,0),"^",7))) Q
I $D(ABMY("CANC")),(ABM("CANC")'=ABMY("CANC")) Q
S ABMP("HIT")=1
Q
INCOM(ABM,ABMTEMP,ABMYTEMP) ;EP - determine parameters for claims with pending status
Q:$P($G(^ABMDCLM(DUZ(2),ABM,0)),U,4)'="P"
;is the provider involved with this claim?
I $D(ABMY("PRV")),'$D(^ABMDCLM(DUZ(2),ABM,41,"B",ABMY("PRV"))) Q
S ABMREC0=$G(^ABMDCLM(DUZ(2),ABM,0))
S ABMREC7=$G(^ABMDCLM(DUZ(2),ABM,7))
S ABMTEMP("PATIENT")=$P(ABMREC0,U) Q:ABMTEMP("PATIENT")=""
I $G(ABMY("PAT"))'="" Q:ABMY("PAT")'=ABMTEMP("PATIENT")
S ABMTEMP("ELIGIBILITY STATUS")=$P($G(^AUPNPAT(ABMTEMP("PATIENT"),11)),U,11)
I $G(ABMY("PTYP"))'="" Q:ABMTEMP("ELIGIBILITY STATUS")'=ABMY("PTYP")
S ABMTEMP("ENCOUNTER DATE")=$P(ABMREC0,U,2)
S ABMTEMP("LOCATION")=$P(ABMREC0,U,3)
I $G(ABMY("LOC"))'="" Q:ABMTEMP("LOCATION")'=ABMY("LOC")
S ABMTEMP("CLINIC")=$P(ABMREC0,U,6)
I ABMTEMP("CLINIC")'="",$D(ABMY("CLIN")) Q:'$D(ABMY("CLIN",ABMTEMP("CLINIC")))
S ABMTEMP("VISIT TYPE")=$P(ABMREC0,U,7)
;I ABMTEMP("VISIT TYPE"),$D(ABMY("VTYP")) Q:'$D(ABMY("CLIN",ABMTEMP("VISIT TYPE"))) ;abm*2.6*21 IHS/SD/SDR HEAT186137
I ABMTEMP("VISIT TYPE"),$D(ABMY("VTYP")) Q:'$D(ABMY("VTYP",ABMTEMP("VISIT TYPE"))) ;abm*2.6*21 IHS/SD/SDR HEAT186137
S ABMTEMP("ACTIVE INSURER")=$P(ABMREC0,U,8)
I $G(ABMY("INS"))'="" Q:ABMY("INS")'=ABMTEMP("ACTIVE INSURER")
;I ABMTEMP("ACTIVE INSURER")'="" S ABMTEMP("BILLING ENTITY")=$P($G(^AUTNINS(ABMTEMP("ACTIVE INSURER"),2)),U) ;abm*2.6*10 HEAT73780
I ABMTEMP("ACTIVE INSURER")'="" S ABMTEMP("BILLING ENTITY")=$$GET1^DIQ(9999999.181,$$GET1^DIQ(9999999.18,ABMTEMP("ACTIVE INSURER"),".211","I"),1,"I") ;abm*2.6*10 HEAT73780
S:ABMTEMP("ACTIVE INSURER")="" ABMTEMP("ACTIVE INSURER")="NO COVERAGE FOUND"
I $G(ABMYTEMP("TYP"))'="" Q:ABMYTEMP("TYP")'[(ABMTEMP("BILLING ENTITY"))
S ABMTEMP("PS")=$P(ABMREC0,U,18)
I $D(ABMY("REASON")) Q:'$D(ABMY("REASON",ABMTEMP("PS")))
S ABMTEMP("PS UPDATER")=$P(ABMREC0,U,19)
I $G(ABMY("STATUS UPDATER"))'="" Q:ABMTEMP("PS UPDATER")'=$G(ABMY("STATUS UPDATER"))
S ABMTEMP("VISIT DATE")=$P(ABMREC7,U)
S ABMTEMP("PS REASON")=$S(ABMTEMP("PS")'="":$P($G(^ABMPSTAT(ABMTEMP("PS"),0)),U),1:"UNDEFINED")
S ABMP("HIT")=1
Q
ABMDRCHK ; IHS/ASDST/DMJ - Report Utility to Check Parms ;
+1 ;;2.6;IHS Third Party Billing;**1,9,10,14,21**;NOV 12, 2009;Build 379
+2 ;Original;TMD;10/17/95 12:45 PM
+3 ;
+4 ; IHS/SD/SDR - v2.5 p8 - Added code to check cancelled claim file
+5 ; IHS/SD/SDR,TPF - v2.5 p8 - added code for pending status (12)
+6 ; IHS/SD/SDR - v2.5 p9 - IM17380 - Split out line and added $G
+7 ; IHS/SD/SDR - v2.5 p10 - IM21520 - Fixed report so it would allow selection of one insurer
+8 ;
+9 ; IHS/SD/SDR - v2.6 CSV
+10 ; IHS/SD/SDR - abm*2.6*1 - HEAT7633 - didn't work when V-codes were selected
+11 ; IHS/SD/SDR - 2.6*9 - HEAT43507 - Closed claim report doesn't run by visit date
+12 ;IHS/SD/SDR - 2.6*14 - ICD10 009 - Updated so reports will check for ICD-10 codes
+13 ;IHS/SD/SDR - 2.6*14 - Updated DX^ABMCVAPI to be numeric
+14 ;IHS/SD/SDR - 2.6*14 - HEAT165197 (CR3109) - Updated check for DX range to use $$NUM
+15 ;IHS/SD/SDR - 2.6*21 - HEAT184442 - Made change for programming error <UNDEF>DX+22^ABMDRCHK. Occurs when user selects BOTH
+16 ; but doesn't enter any ICD10 codes, just hits return.
+17 ;IHS/SD/SDR - 2.6*21 - HEAT186137 - Fixed check for pending claims report if a specific visit type is selected.
+18 ;IHS/SD/SDR - 2.6*21 - VMBP RQMT_96 - Updated checked to look at new insurer type field
+19 ;
BILL ;EP for checking Bill File data parameters
+1 IF '$DATA(^ABMDBILL(DUZ(2),ABM,0))!('$DATA(^(1)))
QUIT
+2 IF $PIECE(^ABMDBILL(DUZ(2),ABM,0),"^",4)="X"
QUIT
+3 ;ABM("L") is piece 3 of bill file
+4 SET ABM("V")=$PIECE($GET(^ABMDBILL(DUZ(2),ABM,0)),U,7)
+5 SET ABM("L")=$PIECE($GET(^ABMDBILL(DUZ(2),ABM,0)),U,3)
+6 SET ABM("I")=$PIECE($GET(^ABMDBILL(DUZ(2),ABM,0)),U,8)
+7 SET ABM("P")=$PIECE($GET(^ABMDBILL(DUZ(2),ABM,0)),U,5)
+8 SET ABM("D")=$PIECE($GET(^ABMDBILL(DUZ(2),ABM,7)),U)
+9 SET ABM("A")=$PIECE($GET(^ABMDBILL(DUZ(2),ABM,1)),U,4)
+10 SET ABM("C")=$PIECE($GET(^ABMDBILL(DUZ(2),ABM,0)),U,10)
+11 SET ABM("AD")=$PIECE($GET(^ABMDBILL(DUZ(2),ABM,1)),U,5)
+12 SET ABM("XD")=$PIECE($GET(^ABMDBILL(DUZ(2),ABM,1)),U,7)
+13 IF ABM("L")=""!(ABM("I")="")!(ABM("P")="")!(ABM("D")="")
QUIT
+14 IF ($DATA(ABMY("VYTP"))&(ABM("V")=""))
QUIT
+15 IF ($DATA(ABMY("CLIN"))&(ABM("C")=""))
QUIT
+16 IF '$DATA(^AUTNINS(ABM("I"),0))
QUIT
+17 IF $DATA(ABMP("TYP"))
IF ABMP("TYP")=0
IF +$ORDER(^ABMDBILL(DUZ(2),ABM,3,0))
QUIT
+18 IF $DATA(ABMP("TYP"))
IF ABMP("TYP")=1
IF '+$ORDER(^ABMDBILL(DUZ(2),ABM,3,0))
QUIT
+19 IF $GET(ABMP("COMPL"))
IF $PIECE(^ABMDBILL(DUZ(2),ABM,0),U,4)="C"
QUIT
+20 IF $DATA(ABMY("LOC"))
IF ABMY("LOC")'=ABM("L")
QUIT
+21 IF $DATA(ABMY("PAT"))
IF ABMY("PAT")'=ABM("P")
QUIT
+22 IF $DATA(ABMP("FORM"))
IF +ABMP("FORM")'=$PIECE(^ABMDBILL(DUZ(2),ABM,0),U,6)
QUIT
+23 IF $DATA(ABMY("PRV"))
IF '$DATA(^ABMDBILL(DUZ(2),ABM,41,"B",ABMY("PRV")))
QUIT
+24 IF $DATA(ABMY("DX"))
SET ABM("DX","HIT")=0
SET ABM("DX")="BILL"
DO DX
IF 'ABM("DX","HIT")
QUIT
+25 IF $DATA(ABMY("PX"))
SET ABM("PX","HIT")=0
SET ABM("PX")="BILL"
DO PX
IF 'ABM("PX","HIT")
QUIT
+26 IF $DATA(ABMY("APPR"))
IF ABMY("APPR")'=ABM("A")
QUIT
+27 IF $GET(ABMY("PTYP"))=2
IF $PIECE($GET(^AUPNPAT(ABM("P"),11)),U,12)'="I"
QUIT
+28 IF $GET(ABMY("PTYP"))=1
IF $PIECE($GET(^AUPNPAT(ABM("P"),11)),U,12)="I"
QUIT
+29 IF $DATA(ABMY("INS"))
IF ABMY("INS")'=ABM("I")
QUIT
+30 ;I $D(ABMY("TYP")) Q:ABMY("TYP")'[$P($G(^AUTNINS(ABM("I"),2)),U) ;abm*2.6*10 HEAT73780
+31 ;I $D(ABMY("TYP")) Q:ABMY("TYP")'[$$GET1^DIQ(9999999.181,$$GET1^DIQ(9999999.18,ABM("I"),".211","I"),1,"I") ;abm*2.6*10 HEAT73780 ;abm*2.6*21 IHS/SD/SDR VMBP RQMT_96
+32 ;abm*2.6*10 HEAT73780 ;abm*2.6*21 IHS/SD/SDR VMBP RQMT_96
IF $DATA(ABMY("TYP"))
IF ("^"_ABMY("TYP")_"^")'[("^"_$$GET1^DIQ(9999999.181,$$GET1^DIQ(9999999.18,ABM("I"),".211","I"),1,"I")_"^")
QUIT
+33 IF $DATA(ABMY("CLIN"))
IF '$DATA(ABMY("CLIN",+$PIECE(^ABMDBILL(DUZ(2),ABM,0),"^",10)))
QUIT
+34 IF $DATA(ABMY("VTYP"))
IF '$DATA(ABMY("VTYP",+$PIECE(^ABMDBILL(DUZ(2),ABM,0),"^",7)))
QUIT
+35 KILL ABM("QUIT")
+36 IF $GET(ABMY("DT"))="V"
Begin DoDot:1
+37 IF $PIECE(ABM("D"),".")<ABMY("DT",1)
SET ABM("QUIT")=1
+38 IF $PIECE(ABM("D"),".")>ABMY("DT",2)
SET ABM("QUIT")=1
End DoDot:1
IF $GET(ABM("QUIT"))
QUIT
+39 IF $GET(ABMY("DT"))="A"
Begin DoDot:1
+40 IF $PIECE(ABM("AD"),".")<ABMY("DT",1)
SET ABM("QUIT")=1
+41 IF $PIECE(ABM("AD"),".")>ABMY("DT",2)
SET ABM("QUIT")=1
End DoDot:1
IF $GET(ABM("QUIT"))
QUIT
+42 SET ABMP("HIT")=1
+43 QUIT
+44 ;
CLM ;EP for checking Claim file data parameters
+1 IF '$DATA(^ABMDCLM(DUZ(2),ABM,0))
QUIT
+2 IF ABM("STA")'=""
IF $PIECE(^ABMDCLM(DUZ(2),ABM,0),U,4)'=ABM("STA")
QUIT
+3 ;visit type
SET ABM("V")=$PIECE(^ABMDCLM(DUZ(2),ABM,0),U,7)
+4 ;visit location
SET ABM("L")=$PIECE(^ABMDCLM(DUZ(2),ABM,0),U,3)
+5 ;active insurer
SET ABM("I")=$PIECE(^ABMDCLM(DUZ(2),ABM,0),U,8)
+6 ;patient
SET ABM("P")=$PIECE(^ABMDCLM(DUZ(2),ABM,0),U)
+7 ;encounter date
SET ABM("D")=$PIECE(^ABMDCLM(DUZ(2),ABM,0),U,2)
+8 ;clinic
SET ABM("C")=$PIECE(^ABMDCLM(DUZ(2),ABM,0),U,6)
+9 IF ABM("L")=""!(ABM("I")="")!(ABM("P")="")!(ABM("D")="")!(ABM("V")="")!(ABM("C")="")
QUIT
+10 IF '$DATA(^AUTNINS(ABM("I"),0))
QUIT
+11 IF $DATA(ABMY("DX"))
SET ABM("DX","HIT")=0
SET ABM("DX")="CLM"
DO DX
+12 IF $DATA(ABMY("PX"))
SET ABM("PX","HIT")=0
SET ABM("PX")="CLM"
DO PX
+13 IF $DATA(ABMY("PRV"))
IF '$DATA(^ABMDCLM(DUZ(2),ABM,41,"B",ABMY("PRV")))
QUIT
+14 IF $DATA(ABMY("PAT"))
IF ABMY("PAT")'=ABM("P")
QUIT
+15 IF $DATA(ABMY("LOC"))
IF ABMY("LOC")'=ABM("L")
QUIT
+16 IF $DATA(ABMY("INS"))
IF ABMY("INS")'=ABM("I")
QUIT
+17 IF $GET(ABMY("PTYP"))=2
IF $PIECE($GET(^AUPNPAT(ABM("P"),11)),U,12)'="I"
QUIT
+18 IF $GET(ABMY("PTYP"))=1
IF $PIECE($GET(^AUPNPAT(ABM("P"),11)),U,12)="I"
QUIT
+19 ;I $D(ABMY("TYP")) Q:ABMY("TYP")'[$P($G(^AUTNINS(ABM("I"),2)),U) ;abm*2.6*10 HEAT73780
+20 ;I $D(ABMY("TYP")) Q:ABMY("TYP")'[$$GET1^DIQ(9999999.181,$$GET1^DIQ(9999999.18,ABM("I"),".211","I"),1,"I") ;abm*2.6*10 HEAT73780 ;abm*2.6*21 IHS/SD/SDR VMBP RQMT_96
+21 ;abm*2.6*10 HEAT73780 ;abm*2.6*21 IHS/SD/SDR VMBP RQMT_96
IF $DATA(ABMY("TYP"))
IF ABMY("TYP")'[("^"_$$GET1^DIQ(9999999.181,$$GET1^DIQ(9999999.18,ABM("I"),".211","I"),1,"I")_"^")
QUIT
+22 IF $DATA(ABMY("DT"))
IF $GET(ABMY("DT"))'="X"
IF ABM("D")<ABMY("DT",1)!(ABM("D")>ABMY("DT",2))
QUIT
+23 IF $DATA(ABMY("CLIN"))
IF '$DATA(ABMY("CLIN",+$PIECE(^ABMDCLM(DUZ(2),ABM,0),"^",6)))
QUIT
+24 IF $DATA(ABMY("VTYP"))
IF '$DATA(ABMY("VTYP",+$PIECE(^ABMDCLM(DUZ(2),ABM,0),"^",7)))
QUIT
+25 ;stop here if not closed claims
IF ABM("STA")'="X"
SET ABMP("HIT")=1
QUIT
+26 ;I ABM("STA")="X",ABMY("DT")="V" S ABMP("HIT")=1 ;abm*2.6*9 HEAT43507 ;abm*2.6*10 HEAT80275
+27 ;abm*2.6*9 HEAT43507 ;abm*2.6*10 HEAT80275
IF ABM("STA")="X"
IF $GET(ABMY("DT"))="V"
SET ABMP("HIT")=1
+28 SET ABMXFLG=0
SET ABMDFLG=0
+29 IF '$DATA(ABMY("CLOS"))
SET ABMXFLG=1
+30 IF '$DATA(ABMY("DT"))
SET ABMDFLG=1
+31 SET ABMY("CIEN")=99999
+32 FOR
SET ABMY("CIEN")=$ORDER(^ABMDCLM(DUZ(2),ABM,69,ABMY("CIEN")),-1)
IF +ABMY("CIEN")=0
QUIT
Begin DoDot:1
+33 ;closed only
IF $PIECE($GET(^ABMDCLM(DUZ(2),ABM,69,ABMY("CIEN"),0)),U,3)'="C"
QUIT
+34 SET ABMY("CLOSER")=$PIECE($GET(^ABMDCLM(DUZ(2),ABM,69,ABMY("CIEN"),0)),U,2)
+35 IF $DATA(ABMY("CLOS"))
IF ABMY("CLOSER")=ABMY("CLOS")
SET ABMXFLG=1
+36 SET ABM("REAS")=$PIECE($GET(^ABMDCLM(DUZ(2),ABM,69,ABMY("CIEN"),0)),U,4)
+37 SET ABMY("CLDT")=$PIECE($PIECE($GET(^ABMDCLM(DUZ(2),ABM,69,ABMY("CIEN"),0)),U),".")
+38 IF $DATA(ABMY("DT"))
IF ($GET(ABMY("DT"))="X")
Begin DoDot:2
+39 IF (ABMY("CLDT")<ABMY("DT",1)!(ABMY("CLDT")>ABMY("DT",2)))
QUIT
+40 SET ABMDFLG=1
End DoDot:2
+41 ;the below code counts how many times it has been closed, if we are looking for closed
End DoDot:1
IF ABMXFLG=1
QUIT
+42 SET ABMY("CIEN")=0
+43 FOR
SET ABMY("CIEN")=$ORDER(^ABMDCLM(DUZ(2),ABM,69,ABMY("CIEN")))
IF +ABMY("CIEN")=0
QUIT
Begin DoDot:1
+44 ;closed only
IF $PIECE($GET(^ABMDCLM(DUZ(2),ABM,69,ABMY("CIEN"),0)),U,3)'="C"
QUIT
+45 SET ABMCLSCT=+$GET(ABMCLSCT)+1
End DoDot:1
+46 IF ABMXFLG=0
QUIT
+47 IF ABMDFLG=0
QUIT
+48 ;we want this one!
SET ABMP("HIT")=1
+49 QUIT
+50 ;
DX ;EP
+1 ;I 'ABMY("DX",1)!'ABMY("DX",2) G DX2 ;abm*2.6*1 HEAT7633
+2 ;I $G(ABMY("DX",1))=""!($G(ABMY("DX",2))="") G DX2 ;abm*2.6*1 HEAT7633 ;abm*2.6*14 ICD10 009
+3 ;abm*2.6*14 ICD10 009
IF (+$GET(ABMY("DXANS"))'=10)&($GET(ABMY("DX",1))=""!($GET(ABMY("DX",2))=""))
GOTO DX2
+4 ;I (+$G(ABMY("DXANS"))'=9)&($G(ABMY("DX",3))=""!($G(ABMY("DX",4))="")) G DX2 ;abm*2.6*14 ICD10 009
+5 ;S ABM("DX")=0,ABM("DX","HIT")=0,ABM("LP")=$S($D(ABMY("DX","ALL")):10,1:1) ;abm*2.6*14 ICD10 009
+6 ;abm*2.6*14 ICD10 009
SET ABM("DX")=0
+7 ;abm*2.6*14 ICD10 009
SET ABM("DX","HIT")=0
+8 ;abm*2.6*14 ICD10 009
SET ABM("LP")=$SELECT($DATA(ABMY("DX","ALL"))!$DATA(ABMY("DX10","ALL")):10,1:1)
+9 FOR ABM("II")=1:1:ABM("LP")
SET ABM("DX")=$ORDER(^ABMDBILL(DUZ(2),ABM,17,"C",ABM("DX")))
IF 'ABM("DX")
QUIT
Begin DoDot:1
+10 SET ABM("DX")=$ORDER(^ABMDBILL(DUZ(2),ABM,17,"C",ABM("DX"),""))
+11 IF '$DATA(^ABMDBILL(DUZ(2),ABM,17,ABM("DX"),0))
QUIT
SET ABM("DX",0)=$PIECE(^(0),U)
+12 ;S ABM("DX",0)=$P($$DX^ABMCVAPI(ABM("DX"),ABM("D")),U,2) ;CSV-c ;abm*2.6*14 updated API call
+13 ;CSV-c ;abm*2.6*14 updated API call and added NUM (HEAT165197 - CR3109)
SET ABM("DX",0)=$$NUM^ABMCVAPI($PIECE($$DX^ABMCVAPI(+ABM("DX"),ABM("D")),U,2))
+14 ;I ABM("DX",0)'>ABMY("DX",2),ABM("DX",0)'<ABMY("DX",1) S ABM("DX","HIT")=1 ;abm*2.6*14 ICD10 009
+15 ;start new code abm*2.6*14 ICD10 009 and CR3108
+16 SET ABMDXTYP=+$PIECE($GET(^ABMDBILL(DUZ(2),ABM,17,ABM("DX"),0)),U,6)
+17 IF ABMDXTYP=1
IF $GET(ABMY("DXANS"))=9
QUIT
+18 IF ABMDXTYP=0
IF $GET(ABMY("DXANS"))=10
QUIT
+19 IF (ABMDXTYP=0)
Begin DoDot:2
+20 IF (ABM("DX",0)'>ABMY("DX",2))
IF (ABM("DX",0)'<ABMY("DX",1))
SET ABM("DX","HIT")=1
End DoDot:2
+21 IF (ABMDXTYP=1)
Begin DoDot:2
+22 ;stop here if no data at ABMY("DX",3) ;abm*2.6*21 IHS/SD/SDR HEAT184442
IF '$DATA(ABMY("DX",3))
QUIT
+23 IF (ABM("DX",0)'>ABMY("DX",4))
IF (ABM("DX",0)'<ABMY("DX",3))
SET ABM("DX","HIT")=1
End DoDot:2
+24 ;end new code ICD10 009 and CR3108
End DoDot:1
IF ABM("DX","HIT")
QUIT
+25 QUIT
+26 ;
DX2 ;EP
+1 QUIT
+2 ;
PX IF '+ABMY("PX",1)!'+ABMY("PX",2)
QUIT
+1 IF ABM("PX")="BILL"
SET ABM("PX","HIT")=0
NEW I
FOR I=21,27,35,37,39
Begin DoDot:1
+2 NEW J
SET J=0
FOR
SET J=$ORDER(^ABMDBILL(DUZ(2),ABM,I,J))
IF 'J
QUIT
Begin DoDot:2
+3 SET ABM("CPT")=$PIECE(^ABMDBILL(DUZ(2),ABM,I,J,0),U)
+4 IF ABM("CPT")>+ABMY("PX",2)
QUIT
+5 IF ABM("CPT")<+ABMY("PX",1)
QUIT
+6 SET ABM("PX","HIT")=1
End DoDot:2
End DoDot:1
IF ABM("PX","HIT")
QUIT
+7 IF ABM("PX")="CLM"
SET ABM("PX")=0
SET ABM("PX","HIT")=0
SET ABM("PX")=$ORDER(^ABMDCLM(DUZ(2),ABM,21,"C",ABM("PX")))
IF 'ABM("PX")
QUIT
Begin DoDot:1
+8 SET ABM("PX")=$ORDER(^ABMDCLM(DUZ(2),ABM,21,"C",ABM("PX"),""))
+9 IF '$DATA(^ABMDCLM(DUZ(2),ABM,21,ABM("PX"),0))
QUIT
SET ABM("PX",0)=$PIECE(^(0),U)
+10 IF +ABM("PX",0)>ABMY("PX",2)
QUIT
+11 IF +ABM("PX",0)<ABMY("PX",1)
QUIT
+12 SET ABM("PX","HIT")=1
End DoDot:1
IF ABM("PX","HIT")
QUIT
+13 QUIT
CANCEL ;EP for checking Claim file data parameters
+1 IF '$DATA(^ABMCCLMS(DUZ(2),ABM,0))
QUIT
+2 SET ABMCREC=$GET(^ABMCCLMS(DUZ(2),ABM,0))
+3 SET ABM("VT")=$PIECE(ABMCREC,U,7)
+4 SET ABM("VLOC")=$PIECE(ABMCREC,U,3)
+5 SET ABM("AINS")=$PIECE(ABMCREC,U,8)
+6 SET ABM("PDFN")=$PIECE(ABMCREC,U)
+7 SET ABM("CL")=$PIECE(ABMCREC,U,6)
+8 SET ABM("CANC")=$PIECE($GET(^ABMCCLMS(DUZ(2),ABM,1)),U,4)
+9 SET ABM("CDT")=$PIECE($PIECE($GET(^ABMCCLMS(DUZ(2),ABM,1)),U,5),".")
+10 SET ABM("CR")=$PIECE($GET(^ABMCCLMS(DUZ(2),ABM,1)),U,8)
+11 IF $DATA(ABMY("REASON"))
IF '$DATA(ABMY("REASON",ABM("CR")))
QUIT
+12 IF ABM("VLOC")=""!(ABM("AINS")="")!(ABM("PDFN")="")!(ABM("CDT")="")!(ABM("VT")="")!(ABM("CL")="")
QUIT
+13 IF '$DATA(^AUTNINS(ABM("AINS"),0))
QUIT
+14 IF $DATA(ABMY("DX"))
SET ABM("DX","HIT")=0
SET ABM("DX")="CLM"
DO DX
+15 IF $DATA(ABMY("PX"))
SET ABM("PX","HIT")=0
SET ABM("PX")="CLM"
DO PX
+16 IF $DATA(ABMY("PRV"))
IF '$DATA(^ABMCCLMS(DUZ(2),ABM,41,"B",ABMY("PRV")))
QUIT
+17 IF $DATA(ABMY("PAT"))
IF ABMY("PAT")'=ABM("PDFN")
QUIT
+18 IF $DATA(ABMY("LOC"))
IF ABMY("LOC")'=ABM("VLOC")
QUIT
+19 IF $DATA(ABMY("INS"))
IF ABMY("INS")'=ABM("AINS")
QUIT
+20 IF $GET(ABMY("PTYP"))=2
IF $PIECE($GET(^AUPNPAT(ABM("PDFN"),11)),U,12)'="I"
QUIT
+21 IF $GET(ABMY("PTYP"))=1
IF $PIECE($GET(^AUPNPAT(ABM("PDFN"),11)),U,12)="I"
QUIT
+22 ;I $D(ABMY("TYP")) Q:ABMY("TYP")'[$P($G(^AUTNINS(ABM("AINS"),2)),U) ;abm*2.6*10 HEAT73780
+23 ;abm*2.6*10 HEAT73780
IF $DATA(ABMY("TYP"))
IF ABMY("TYP")'[$$GET1^DIQ(9999999.181,$$GET1^DIQ(9999999.18,ABM("AINS"),".211","I"),1,"I")
QUIT
+24 IF $DATA(ABMY("DT"))
IF ABM("CDT")<ABMY("DT",1)!(ABM("CDT")>ABMY("DT",2))
QUIT
+25 IF $DATA(ABMY("CLIN"))
IF '$DATA(ABMY("CLIN",+$PIECE(^ABMCCLMS(DUZ(2),ABM,0),"^",6)))
QUIT
+26 IF $DATA(ABMY("VTYP"))
IF '$DATA(ABMY("VTYP",+$PIECE(^ABMCCLMS(DUZ(2),ABM,0),"^",7)))
QUIT
+27 IF $DATA(ABMY("CANC"))
IF (ABM("CANC")'=ABMY("CANC"))
QUIT
+28 SET ABMP("HIT")=1
+29 QUIT
INCOM(ABM,ABMTEMP,ABMYTEMP) ;EP - determine parameters for claims with pending status
+1 IF $PIECE($GET(^ABMDCLM(DUZ(2),ABM,0)),U,4)'="P"
QUIT
+2 ;is the provider involved with this claim?
+3 IF $DATA(ABMY("PRV"))
IF '$DATA(^ABMDCLM(DUZ(2),ABM,41,"B",ABMY("PRV")))
QUIT
+4 SET ABMREC0=$GET(^ABMDCLM(DUZ(2),ABM,0))
+5 SET ABMREC7=$GET(^ABMDCLM(DUZ(2),ABM,7))
+6 SET ABMTEMP("PATIENT")=$PIECE(ABMREC0,U)
IF ABMTEMP("PATIENT")=""
QUIT
+7 IF $GET(ABMY("PAT"))'=""
IF ABMY("PAT")'=ABMTEMP("PATIENT")
QUIT
+8 SET ABMTEMP("ELIGIBILITY STATUS")=$PIECE($GET(^AUPNPAT(ABMTEMP("PATIENT"),11)),U,11)
+9 IF $GET(ABMY("PTYP"))'=""
IF ABMTEMP("ELIGIBILITY STATUS")'=ABMY("PTYP")
QUIT
+10 SET ABMTEMP("ENCOUNTER DATE")=$PIECE(ABMREC0,U,2)
+11 SET ABMTEMP("LOCATION")=$PIECE(ABMREC0,U,3)
+12 IF $GET(ABMY("LOC"))'=""
IF ABMTEMP("LOCATION")'=ABMY("LOC")
QUIT
+13 SET ABMTEMP("CLINIC")=$PIECE(ABMREC0,U,6)
+14 IF ABMTEMP("CLINIC")'=""
IF $DATA(ABMY("CLIN"))
IF '$DATA(ABMY("CLIN",ABMTEMP("CLINIC")))
QUIT
+15 SET ABMTEMP("VISIT TYPE")=$PIECE(ABMREC0,U,7)
+16 ;I ABMTEMP("VISIT TYPE"),$D(ABMY("VTYP")) Q:'$D(ABMY("CLIN",ABMTEMP("VISIT TYPE"))) ;abm*2.6*21 IHS/SD/SDR HEAT186137
+17 ;abm*2.6*21 IHS/SD/SDR HEAT186137
IF ABMTEMP("VISIT TYPE")
IF $DATA(ABMY("VTYP"))
IF '$DATA(ABMY("VTYP",ABMTEMP("VISIT TYPE")))
QUIT
+18 SET ABMTEMP("ACTIVE INSURER")=$PIECE(ABMREC0,U,8)
+19 IF $GET(ABMY("INS"))'=""
IF ABMY("INS")'=ABMTEMP("ACTIVE INSURER")
QUIT
+20 ;I ABMTEMP("ACTIVE INSURER")'="" S ABMTEMP("BILLING ENTITY")=$P($G(^AUTNINS(ABMTEMP("ACTIVE INSURER"),2)),U) ;abm*2.6*10 HEAT73780
+21 ;abm*2.6*10 HEAT73780
IF ABMTEMP("ACTIVE INSURER")'=""
SET ABMTEMP("BILLING ENTITY")=$$GET1^DIQ(9999999.181,$$GET1^DIQ(9999999.18,ABMTEMP("ACTIVE INSURER"),".211","I"),1,"I")
+22 IF ABMTEMP("ACTIVE INSURER")=""
SET ABMTEMP("ACTIVE INSURER")="NO COVERAGE FOUND"
+23 IF $GET(ABMYTEMP("TYP"))'=""
IF ABMYTEMP("TYP")'[(ABMTEMP("BILLING ENTITY"))
QUIT
+24 SET ABMTEMP("PS")=$PIECE(ABMREC0,U,18)
+25 IF $DATA(ABMY("REASON"))
IF '$DATA(ABMY("REASON",ABMTEMP("PS")))
QUIT
+26 SET ABMTEMP("PS UPDATER")=$PIECE(ABMREC0,U,19)
+27 IF $GET(ABMY("STATUS UPDATER"))'=""
IF ABMTEMP("PS UPDATER")'=$GET(ABMY("STATUS UPDATER"))
QUIT
+28 SET ABMTEMP("VISIT DATE")=$PIECE(ABMREC7,U)
+29 SET ABMTEMP("PS REASON")=$SELECT(ABMTEMP("PS")'="":$PIECE($GET(^ABMPSTAT(ABMTEMP("PS"),0)),U),1:"UNDEFINED")
+30 SET ABMP("HIT")=1
+31 QUIT