ABMDRXC1 ; IHS/SD/SDR - Closed claims listing-80 Width ;
;;2.6;IHS 3P BILLING SYSTEM;;NOV 12, 2009
;
PRINT ;EP for printing data
S ABM("PG")=0 D HDB
S (ABM("CNT1"),ABM("CNT2"),ABM("CNT"),ABM("TOT1"),ABM("TOT2"),ABM("TOT"))=0
S (ABM("CLOS"),ABM("LOC"),ABM("VT"))=""
S ABM("Z")="TMP(""ABM-CLS"","_$J,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) D SUBHD W " (cont)"
.S ABM("T")=$P(ABM,"ABM-CLS",2),ABM("TXT")=$P($P(ABM("T"),",",3,99),"""",2),ABM("TXT")=+$P(ABM("T"),",",3)_U_ABM("TXT")
.S ABM("PDFN")=$P($G(^ABMDCLM(DUZ(2),+$P(ABM("TXT"),U,7),0)),U) Q:ABM("PDFN")=""
.I ABM("CLOS")'=$P(ABM("TXT"),U,2) S ABM("CLOS")="" D SUB,SUBHD S ABM("LOC")=""
.I ABM("LOC")'=$P(ABM("TXT"),U,3) D SUB:ABM("LOC")]"" W:(ABM("LOC")'="") ! W !?3,"Visit Location: ",$P(ABM("TXT"),U,3) S ABM("VT")=""
.S ABM("CLOS")=$P(ABM("TXT"),U,2)
.S ABM("LOC")=$P(ABM("TXT"),U,3)
.I ABM("VT")'=$P(ABM("TXT"),U,4) D SUB2:ABM("VT")]"" W:ABM("VT")]"" ! W !?7,$S(ABMY("SORT")="C":" Clinic: "_$P(^DIC(40.7,$P(ABM("TXT"),U,4),0),U),1:"Visit Type: "_$P(^ABMDVTYP($P(ABM("TXT"),U,4),0),U))
.S ABM("VT")=$P(ABM("TXT"),U,4)
.W !
.W $E($P(^DPT($P(ABM("PDFN"),U),0),U),1,16) ;pat name
.S ABM("HRN")=$P($G(^AUPNPAT($P(ABM("PDFN"),U),41,ABM("LOC"),0)),U,2) ;HRN
.S:ABM("HRN")="" ABM("HRN")=$P($G(^AUPNPAT($P(ABM("PDFN"),U),41,DUZ(2),0)),U,2) ;HRN
.W ?18,ABM("HRN")
.W ?25,$E($P(^AUTNINS($P($G(^ABMDCLM(DUZ(2),+$P(ABM("TXT"),U,7),0)),U,8),0),U),1,12) ;ins
.W ?39,$P(ABM("TXT"),U,7) ;claim number
.W ?47,$$SDT^ABMDUTL($P($G(^ABMDCLM(DUZ(2),+$P(ABM("TXT"),U,7),0)),U,2)) ;visit date
.W:$P(ABM("TXT"),U,5)'="" ?59,$E($P($G(^ABMCLCLM($P(ABM("TXT"),U,5),0)),U),1,18) ;reason
.S ABM("CNT1")=ABM("CNT1")+1,ABM("CNT2")=ABM("CNT2")+1,ABM("CNT")=ABM("CNT")+1,ABM("TOT")=ABM("TOT")+ABM("T")
.S ABM("TOT1")=ABM("TOT1")+ABM("T"),ABM("TOT2")=ABM("TOT2")+ABM("T")
D SUB
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 !,"An ""*"" beside the claim number means the claim has been closed multiple times"
W !?25,"Active",?39,"Claim",?50,"Visit"
W !?2,"Patient",?18,"HRN",?25,"Insurer",?39,"Number",?50,"Date",?63,"Reason"
W !,"-------------------------------------------------------------------------------"
Q
;
SUBHD ;
W !!,"Closing Official: ",$P(^VA(200,$P(ABM("TXT"),U,2),0),U)
Q
;
SUB2 Q:'ABM("CNT2")
W !?27,"------"
W !?16,"Subcount:",?27,ABM("CNT2")
S ABM("CNT2")=0,ABM("TOT2")=0,ABM("I")=""
Q
;
SUB Q:'ABM("CNT1") D SUB2:ABM("CNT1")'=ABM("CNT2")
W !?27,"------"
W !?19,"Count:",?27,ABM("CNT1")
S ABM("CNT1")=0,ABM("TOT1")=0,ABM("CNT2")=0,ABM("TOT2")=0,ABM("I")=""
Q
XIT ;EXIT POINT
Q
ABMDRXC1 ; IHS/SD/SDR - Closed claims listing-80 Width ;
+1 ;;2.6;IHS 3P BILLING SYSTEM;;NOV 12, 2009
+2 ;
PRINT ;EP for printing data
+1 SET ABM("PG")=0
DO HDB
+2 SET (ABM("CNT1"),ABM("CNT2"),ABM("CNT"),ABM("TOT1"),ABM("TOT2"),ABM("TOT"))=0
+3 SET (ABM("CLOS"),ABM("LOC"),ABM("VT"))=""
+4 SET ABM("Z")="TMP(""ABM-CLS"","_$JOB
SET ABM="^"_ABM("Z")_")"
IF '$DATA(@ABM)
QUIT
+5 FOR
SET ABM=$QUERY(@ABM)
IF ABM'[ABM("Z")
QUIT
Begin DoDot:1
+6 IF $Y>(IOSL-5)
DO HD
IF $DATA(DTOUT)!$DATA(DUOUT)!$DATA(DIROUT)
QUIT
DO SUBHD
WRITE " (cont)"
+7 SET ABM("T")=$PIECE(ABM,"ABM-CLS",2)
SET ABM("TXT")=$PIECE($PIECE(ABM("T"),",",3,99),"""",2)
SET ABM("TXT")=+$PIECE(ABM("T"),",",3)_U_ABM("TXT")
+8 SET ABM("PDFN")=$PIECE($GET(^ABMDCLM(DUZ(2),+$PIECE(ABM("TXT"),U,7),0)),U)
IF ABM("PDFN")=""
QUIT
+9 IF ABM("CLOS")'=$PIECE(ABM("TXT"),U,2)
SET ABM("CLOS")=""
DO SUB
DO SUBHD
SET ABM("LOC")=""
+10 IF ABM("LOC")'=$PIECE(ABM("TXT"),U,3)
IF ABM("LOC")]""
DO SUB
IF (ABM("LOC")'="")
WRITE !
WRITE !?3,"Visit Location: ",$PIECE(ABM("TXT"),U,3)
SET ABM("VT")=""
+11 SET ABM("CLOS")=$PIECE(ABM("TXT"),U,2)
+12 SET ABM("LOC")=$PIECE(ABM("TXT"),U,3)
+13 IF ABM("VT")'=$PIECE(ABM("TXT"),U,4)
IF ABM("VT")]""
DO SUB2
IF ABM("VT")]""
WRITE !
WRITE !?7,$SELECT(ABMY("SORT")="C":" Clinic: "_$PIECE(^DIC(40.7,$PIECE(ABM("TXT"),U,4),0),U),1:"Visit Type: "_$PIECE(^ABMDVTYP($PIECE(ABM("TXT"),U,4),0),U))
+14 SET ABM("VT")=$PIECE(ABM("TXT"),U,4)
+15 WRITE !
+16 ;pat name
WRITE $EXTRACT($PIECE(^DPT($PIECE(ABM("PDFN"),U),0),U),1,16)
+17 ;HRN
SET ABM("HRN")=$PIECE($GET(^AUPNPAT($PIECE(ABM("PDFN"),U),41,ABM("LOC"),0)),U,2)
+18 ;HRN
IF ABM("HRN")=""
SET ABM("HRN")=$PIECE($GET(^AUPNPAT($PIECE(ABM("PDFN"),U),41,DUZ(2),0)),U,2)
+19 WRITE ?18,ABM("HRN")
+20 ;ins
WRITE ?25,$EXTRACT($PIECE(^AUTNINS($PIECE($GET(^ABMDCLM(DUZ(2),+$PIECE(ABM("TXT"),U,7),0)),U,8),0),U),1,12)
+21 ;claim number
WRITE ?39,$PIECE(ABM("TXT"),U,7)
+22 ;visit date
WRITE ?47,$$SDT^ABMDUTL($PIECE($GET(^ABMDCLM(DUZ(2),+$PIECE(ABM("TXT"),U,7),0)),U,2))
+23 ;reason
IF $PIECE(ABM("TXT"),U,5)'=""
WRITE ?59,$EXTRACT($PIECE($GET(^ABMCLCLM($PIECE(ABM("TXT"),U,5),0)),U),1,18)
+24 SET ABM("CNT1")=ABM("CNT1")+1
SET ABM("CNT2")=ABM("CNT2")+1
SET ABM("CNT")=ABM("CNT")+1
SET ABM("TOT")=ABM("TOT")+ABM("T")
+25 SET ABM("TOT1")=ABM("TOT1")+ABM("T")
SET ABM("TOT2")=ABM("TOT2")+ABM("T")
End DoDot:1
IF $DATA(DTOUT)!$DATA(DUOUT)!$DATA(DIROUT)
GOTO XIT
+26 DO SUB
+27 QUIT
+28 ;
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 !,"An ""*"" beside the claim number means the claim has been closed multiple times"
+2 WRITE !?25,"Active",?39,"Claim",?50,"Visit"
+3 WRITE !?2,"Patient",?18,"HRN",?25,"Insurer",?39,"Number",?50,"Date",?63,"Reason"
+4 WRITE !,"-------------------------------------------------------------------------------"
+5 QUIT
+6 ;
SUBHD ;
+1 WRITE !!,"Closing Official: ",$PIECE(^VA(200,$PIECE(ABM("TXT"),U,2),0),U)
+2 QUIT
+3 ;
SUB2 IF 'ABM("CNT2")
QUIT
+1 WRITE !?27,"------"
+2 WRITE !?16,"Subcount:",?27,ABM("CNT2")
+3 SET ABM("CNT2")=0
SET ABM("TOT2")=0
SET ABM("I")=""
+4 QUIT
+5 ;
SUB IF 'ABM("CNT1")
QUIT
IF ABM("CNT1")'=ABM("CNT2")
DO SUB2
+1 WRITE !?27,"------"
+2 WRITE !?19,"Count:",?27,ABM("CNT1")
+3 SET ABM("CNT1")=0
SET ABM("TOT1")=0
SET ABM("CNT2")=0
SET ABM("TOT2")=0
SET ABM("I")=""
+4 QUIT
XIT ;EXIT POINT
+1 QUIT