ABMDPST1 ; IHS/SD/SDR - Pending Claims Status Report ; JUN 29, 2005
;;2.6;IHS 3P BILLING SYSTEM;;NOV 12, 2009
;
PRINT ;EP for printing data
K ABM("LOCATION TEMP"),ABM("PS UPDATER TEMP"),ABM("VISIT TEMP")
K ABM("CLINIC TEMP"),ABM("ACTIVE INSURER TEMP")
S ABM("PG")=0
D HDB
S ABM("SUB CNT")=0
S ABM("TOTAL CNT")=0
S ABM("Z")="TMP(""ABM-ICS"","_$J
S ABM="^"_ABM("Z")_")"
I '$D(@ABM) Q
F S ABM=$Q(@ABM) Q:ABM'[ABM("Z") D G:$D(DTOUT)!$D(DUOUT)!$D(DIROUT) XIT
.I $Y>(IOSL-5) D HD Q:$D(DTOUT)!$D(DUOUT)!$D(DIROUT) W " (cont)"
.S ABM("T")=$P(ABM,"ABM-ICS",2),ABM("TXT")=$P($P(ABM("T"),",",3,99),"""",2),ABM("TXT")=+$P(ABM("T"),",",3)_U_ABM("TXT")
.S ABM("LOCATION NAME")=$P(ABM("TXT"),U,2)
.S ABM("SORT")=$P(ABM("TXT"),U,3)
.S ABM("PATIENT")=$P(ABM("TXT"),U,4)
.S ABM("HRN")=$P(ABM("TXT"),U,5)
.S ABM("CLAIM")=$P(ABM("TXT"),U,6)
.S ABM("VISIT TYPE")=$P(ABM("TXT"),U,7)
.S ABM("CLINIC")=$P(ABM("TXT"),U,8)
.S ABM("CLINIC")=$S(ABM("CLAIM")'="":$E($P($G(^DIC(40.7,ABM("CLINIC"),0)),U),1,12),1:"UNDEFINED")
.S ABM("PS REASON")=$P(ABM("TXT"),U,9)
.S ABM("VISIT DATE")=$P(ABM("TXT"),U,10)
.S ABM("I")=$P(ABM("TXT"),U,11)
.S:ABM("I")="" ABM("I")="UNDEFINED"
.S ABM("PS UPDATER")=$P(ABM("TXT"),U,12)
.I ABM("PS UPDATER")="" S ABM("PS UPDATER")="UNDEFINED"
.E S ABM("PS UPDATER")=$P($G(^VA(200,ABM("PS UPDATER"),0)),U)
.;
.;DO SUB HEADERS
.I $G(ABM("LOCATION TEMP"))'=ABM("LOCATION NAME") D:$G(ABM("LOCATION TEMP"))'="" SUBHDR,TOTHDR W !?3,"Visit Location: ",$G(ABM("LOCATION NAME")) S ABM("LOCATION TEMP")=ABM("LOCATION NAME")
.I $G(ABM("PS UPDATER TEMP"))'=ABM("PS UPDATER") W !?6,"Status Updater: ",$G(ABM("PS UPDATER")) S ABM("PS UPDATER TEMP")=ABM("PS UPDATER")
.I ABMY("SORT")="V" I $G(ABM("VISIT TEMP"))'=ABM("VISIT TYPE") D:$G(ABM("VISIT TEMP"))'="" SUBHDR W !?5,"Visit Type: "_$P(^ABMDVTYP(ABM("VISIT TYPE"),0),U) S ABM("VISIT TEMP")=ABM("VISIT TYPE")
.I ABMY("SORT")="C" I $G(ABM("CLINIC TEMP"))'=ABM("CLINIC") D:$G(ABM("CLINIC TEMP"))'="" SUBHDR W !?5," Clinic: "_$G(ABM("CLINIC")) S ABM("CLINIC TEMP")=ABM("CLINIC")
.I $G(ABM("ACTIVE INSURER TEMP"))'=$G(ABM("I")) W !?11,"Active Insurer: ",$P($G(^AUTNINS(ABM("I"),0)),U) S ABM("ACTIVE INSURER TEMP")=ABM("I")
.W !!
.W $E(ABM("PATIENT"),1,16) ;pat name
.W ?18,ABM("HRN") ;hrn
.W ?26,ABM("CLAIM") ;claim number
.W ?34,$$SDT^ABMDUTL(ABM("VISIT DATE")) ;visit date
.W ?46,ABM("CLINIC") ;clinic
.K ^UTILITY($J,"W")
.S DIWL=60,DIWR=79
.S DIWF="WC19"
.S X=ABM("PS REASON") ;reason
.D ^DIWP
.D ^DIWW
.S ABM("SUB CNT")=$G(ABM("SUB CNT"))+1
.S ABM("TOTAL CNT")=$G(ABM("TOTAL CNT"))+1
D SUBHDR
D TOTHDR
W !!,"E N D O F R E P O R T"
D PAZ^ABMDRUTL
Q
;
HD D PAZ^ABMDRUTL Q:$D(DTOUT)!$D(DUOUT)!$D(DIROUT)
HDB S ABM("PG")=ABM("PG")+1,ABM("I")="" D WHD^ABMDRHD
W !?26,"Claim",?34,"Visit"
W !?2,"Patient",?18,"HRN",?26,"Number",?34,"Date",?46,"Clinic",?60,"Reason"
W !,"-------------------------------------------------------------------------------"
Q
;
SUBHDR Q:'ABM("SUB CNT")
W !?27,"------"
W !?16,"Subtotal:",?27,ABM("SUB CNT")
S ABM("SUB CNT")=0
Q
;
TOTHDR Q:'ABM("TOTAL CNT")
W !?27,"------"
W !?19,"Total:",?27,ABM("TOTAL CNT")
S ABM("TOTAL CNT")=0
Q
XIT ;EXIT POINT
K ^TMP("ABM-ICS",$J)
Q
ABMDPST1 ; IHS/SD/SDR - Pending Claims Status Report ; JUN 29, 2005
+1 ;;2.6;IHS 3P BILLING SYSTEM;;NOV 12, 2009
+2 ;
PRINT ;EP for printing data
+1 KILL ABM("LOCATION TEMP"),ABM("PS UPDATER TEMP"),ABM("VISIT TEMP")
+2 KILL ABM("CLINIC TEMP"),ABM("ACTIVE INSURER TEMP")
+3 SET ABM("PG")=0
+4 DO HDB
+5 SET ABM("SUB CNT")=0
+6 SET ABM("TOTAL CNT")=0
+7 SET ABM("Z")="TMP(""ABM-ICS"","_$JOB
+8 SET ABM="^"_ABM("Z")_")"
+9 IF '$DATA(@ABM)
QUIT
+10 FOR
SET ABM=$QUERY(@ABM)
IF ABM'[ABM("Z")
QUIT
Begin DoDot:1
+11 IF $Y>(IOSL-5)
DO HD
IF $DATA(DTOUT)!$DATA(DUOUT)!$DATA(DIROUT)
QUIT
WRITE " (cont)"
+12 SET ABM("T")=$PIECE(ABM,"ABM-ICS",2)
SET ABM("TXT")=$PIECE($PIECE(ABM("T"),",",3,99),"""",2)
SET ABM("TXT")=+$PIECE(ABM("T"),",",3)_U_ABM("TXT")
+13 SET ABM("LOCATION NAME")=$PIECE(ABM("TXT"),U,2)
+14 SET ABM("SORT")=$PIECE(ABM("TXT"),U,3)
+15 SET ABM("PATIENT")=$PIECE(ABM("TXT"),U,4)
+16 SET ABM("HRN")=$PIECE(ABM("TXT"),U,5)
+17 SET ABM("CLAIM")=$PIECE(ABM("TXT"),U,6)
+18 SET ABM("VISIT TYPE")=$PIECE(ABM("TXT"),U,7)
+19 SET ABM("CLINIC")=$PIECE(ABM("TXT"),U,8)
+20 SET ABM("CLINIC")=$SELECT(ABM("CLAIM")'="":$EXTRACT($PIECE($GET(^DIC(40.7,ABM("CLINIC"),0)),U),1,12),1:"UNDEFINED")
+21 SET ABM("PS REASON")=$PIECE(ABM("TXT"),U,9)
+22 SET ABM("VISIT DATE")=$PIECE(ABM("TXT"),U,10)
+23 SET ABM("I")=$PIECE(ABM("TXT"),U,11)
+24 IF ABM("I")=""
SET ABM("I")="UNDEFINED"
+25 SET ABM("PS UPDATER")=$PIECE(ABM("TXT"),U,12)
+26 IF ABM("PS UPDATER")=""
SET ABM("PS UPDATER")="UNDEFINED"
+27 IF '$TEST
SET ABM("PS UPDATER")=$PIECE($GET(^VA(200,ABM("PS UPDATER"),0)),U)
+28 ;
+29 ;DO SUB HEADERS
+30 IF $GET(ABM("LOCATION TEMP"))'=ABM("LOCATION NAME")
IF $GET(ABM("LOCATION TEMP"))'=""
DO SUBHDR
DO TOTHDR
WRITE !?3,"Visit Location: ",$GET(ABM("LOCATION NAME"))
SET ABM("LOCATION TEMP")=ABM("LOCATION NAME")
+31 IF $GET(ABM("PS UPDATER TEMP"))'=ABM("PS UPDATER")
WRITE !?6,"Status Updater: ",$GET(ABM("PS UPDATER"))
SET ABM("PS UPDATER TEMP")=ABM("PS UPDATER")
+32 IF ABMY("SORT")="V"
IF $GET(ABM("VISIT TEMP"))'=ABM("VISIT TYPE")
IF $GET(ABM("VISIT TEMP"))'=""
DO SUBHDR
WRITE !?5,"Visit Type: "_$PIECE(^ABMDVTYP(ABM("VISIT TYPE"),0),U)
SET ABM("VISIT TEMP")=ABM("VISIT TYPE")
+33 IF ABMY("SORT")="C"
IF $GET(ABM("CLINIC TEMP"))'=ABM("CLINIC")
IF $GET(ABM("CLINIC TEMP"))'=""
DO SUBHDR
WRITE !?5," Clinic: "_$GET(ABM("CLINIC"))
SET ABM("CLINIC TEMP")=ABM("CLINIC")
+34 IF $GET(ABM("ACTIVE INSURER TEMP"))'=$GET(ABM("I"))
WRITE !?11,"Active Insurer: ",$PIECE($GET(^AUTNINS(ABM("I"),0)),U)
SET ABM("ACTIVE INSURER TEMP")=ABM("I")
+35 WRITE !!
+36 ;pat name
WRITE $EXTRACT(ABM("PATIENT"),1,16)
+37 ;hrn
WRITE ?18,ABM("HRN")
+38 ;claim number
WRITE ?26,ABM("CLAIM")
+39 ;visit date
WRITE ?34,$$SDT^ABMDUTL(ABM("VISIT DATE"))
+40 ;clinic
WRITE ?46,ABM("CLINIC")
+41 KILL ^UTILITY($JOB,"W")
+42 SET DIWL=60
SET DIWR=79
+43 SET DIWF="WC19"
+44 ;reason
SET X=ABM("PS REASON")
+45 DO ^DIWP
+46 DO ^DIWW
+47 SET ABM("SUB CNT")=$GET(ABM("SUB CNT"))+1
+48 SET ABM("TOTAL CNT")=$GET(ABM("TOTAL CNT"))+1
End DoDot:1
IF $DATA(DTOUT)!$DATA(DUOUT)!$DATA(DIROUT)
GOTO XIT
+49 DO SUBHDR
+50 DO TOTHDR
+51 WRITE !!,"E N D O F R E P O R T"
+52 DO PAZ^ABMDRUTL
+53 QUIT
+54 ;
HD DO PAZ^ABMDRUTL
IF $DATA(DTOUT)!$DATA(DUOUT)!$DATA(DIROUT)
QUIT
HDB SET ABM("PG")=ABM("PG")+1
SET ABM("I")=""
DO WHD^ABMDRHD
+1 WRITE !?26,"Claim",?34,"Visit"
+2 WRITE !?2,"Patient",?18,"HRN",?26,"Number",?34,"Date",?46,"Clinic",?60,"Reason"
+3 WRITE !,"-------------------------------------------------------------------------------"
+4 QUIT
+5 ;
SUBHDR IF 'ABM("SUB CNT")
QUIT
+1 WRITE !?27,"------"
+2 WRITE !?16,"Subtotal:",?27,ABM("SUB CNT")
+3 SET ABM("SUB CNT")=0
+4 QUIT
+5 ;
TOTHDR IF 'ABM("TOTAL CNT")
QUIT
+1 WRITE !?27,"------"
+2 WRITE !?19,"Total:",?27,ABM("TOTAL CNT")
+3 SET ABM("TOTAL CNT")=0
+4 QUIT
XIT ;EXIT POINT
+1 KILL ^TMP("ABM-ICS",$JOB)
+2 QUIT