ABMMUPH1 ;IHS/SD/SDR - MU Patient Volume Hospital Report ;
;;2.6;IHS 3P BILLING SYSTEM;**7,8,9**;NOV 12, 2009
;
MET ;EP
W !!,"Patient Volume: ",+$P($G(^XTMP("ABM-PVH",$J,"LOC TOP",ABMVLOC)),U)_"%"
W !!,"Patient Volume for the Qualification Year was calculated using the Medicaid"
W !,"calculation method for the hospital and includes ER encounters"
W !!,"Total Patient Encounters "_ABMLOC_": ",?54,$J(+$G(^XTMP("ABM-PVH",$J,"LOC-DENOM",ABMSDT,ABMVLOC)),8)
W !,"Total Medicaid Encounters "_ABMLOC_": ",?54,$J(+$G(^XTMP("ABM-PVH",$J,"LOC ENC CNT",ABMSDT,ABMVLOC,"MCD")),8)
W !,"Total Kidscare/Chip Encounters "_ABMLOC_": ",?54,$J(+$G(^XTMP("ABM-PVH",$J,"LOC ENC CNT",ABMSDT,ABMVLOC,"CHIP")),8)
W !,"Total Other Encounters "_ABMLOC_": ",?54,$J(+$G(^XTMP("ABM-PVH",$J,"LOC ENC CNT",ABMSDT,ABMVLOC,"OTHR")),8)
Q
NOTMET ;EP
W !!,"The Patient Volume Threshold (10% for Hospitals) was not met for the MU"
W !,"Qualification year. Details for the volumes that were achieved are provided"
W !,"for your information."
W !!,"Highest Patient Volume Met: ",+$P($G(^XTMP("ABM-PVH",$J,"LOC TOP",ABMVLOC)),U)
W !,"First Day Highest Patient Volume Achieved: ",$$SDT^ABMDUTL(ABMSDT)
W !!,"Patient Volume for the Qualification Year was calculated using the Medicaid"
W !,"calculation method for the hospital and includes ER encounters"
S ABMTHPV=0
S:ABMSDT ABMTHPV=+$G(^XTMP("ABM-PVH",$J,"LOC-DENOM",ABMSDT,ABMVLOC))
S ABMMHPV=0
S:ABMSDT ABMMHPV=+$G(^XTMP("ABM-PVH",$J,"LOC-NUM",ABMSDT,ABMVLOC))
W !!,"Total Patient Encounters of First Highest Patient Volume Period: ",ABMTHPV
W !,"Total Hospital"_$S(+$G(ABMER)=1:"/ER",1:"")_" Encounters of First Highest Patient Volume Period: ",ABMMHPV
S ABMCNT=0
K ABMLN
;
I +$G(ABMY("TVDTS"))'=0 D
.S ABMCNT=0
.S ABMDT=0
.F S ABMDT=$O(^XTMP("ABM-PVH",$J,"LOC PERCENT",ABMDT)) Q:'ABMDT D
..S ABMLOC=0
..F S ABMLOC=$O(^XTMP("ABM-PVH",$J,"LOC PERCENT",ABMDT,ABMLOC)) Q:'ABMLOC D
...S ABMCNT=ABMCNT+1
...S ABMPRC($G(^XTMP("ABM-PVH",$J,"LOC PERCENT",ABMDT,ABMLOC)),ABMCNT)=ABMDT
...S ABMP=""
...S ABMSAV=ABMCNT-ABMY("TVDTS")
...F S ABMP=$O(ABMPRC(ABMP)) Q:ABMP="" D
....S ABMCNT=0,ABMC=0
....F S ABMCNT=$O(ABMPRC(ABMP,ABMCNT)) Q:'ABMCNT D Q:(ABMC=ABMSAV)
.....K ^XTMP("ABM-PVH",$J,"LOC PERCENT",$G(ABMPRC(ABMP,ABMCNT)))
.....S ABMC=ABMC+1
;
D NMHDR
S ABMSDT=0,ABMCNT=0
F S ABMSDT=$O(^XTMP("ABM-PVH",$J,"LOC-DENOM",ABMSDT)) Q:'ABMSDT D
.;start old code abm*2.6*8 NOHEAT
.;S X1=ABMSDT
.;S X2=89
.;D C^%DTC
.;S ABMEDT=X
.;end old code start new code
.;I +$G(ABMY("EDT"))=0 D ;abm*2.6*9 NOHEAT
.I +$G(ABMP("EDT"))=0 D ;abm*2.6*9 NOHEAT
..S X1=ABMSDT
..S X2=89
..D C^%DTC
..S ABMEDT=X
.;I +$G(ABMY("EDT"))'=0 S ABMEDT=ABMY("EDT") ;abm*2.6*9 NOHEAT
.I +$G(ABMP("EDT"))'=0 S ABMEDT=ABMP("EDT") ;abm*2.6*9 NOHEAT
.;end new code
.S ABMCNT=ABMCNT+1
.S ABMLN(ABMCNT)=$TR($P($$MDT^ABMDUTL(ABMSDT),"-",1,2),"-"," ")_" - "_$TR($P($$MDT^ABMDUTL(ABMEDT),"-",1,2),"-"," ") ;report period
.S $P(ABMLN(ABMCNT),U,2)=$J($G(^XTMP("ABM-PVH",$J,"LOC PERCENT",ABMSDT)),3)_"%" ;rate
.S $P(ABMLN(ABMCNT),U,3)=$J(+$G(^XTMP("ABM-PVH",$J,"LOC-DENOM",ABMSDT)),6) ;denominator
.S $P(ABMLN(ABMCNT),U,4)=$J(+$G(^XTMP("ABM-PVH",$J,"LOC-NUM",ABMSDT)),6) ;numerator
S ABMCUTOF=$S(ABMCNT#2=1:(ABMCNT+1)\2,1:ABMCNT\2)
S ABMMCNT=1
F ABMCUTOF=(ABMCUTOF+1):1:ABMCNT D
.S ABMLN(ABMMCNT)=ABMLN(ABMMCNT)_U_ABMLN(ABMCUTOF)
.K ABMLN(ABMCUTOF)
.S ABMMCNT=+$G(ABMMCNT)+1
S ABMCNT=0
F S ABMCNT=$O(ABMLN(ABMCNT)) Q:'ABMCNT D Q:(IOST["C")&((+$G(Y)=0)!($D(DIRUT)!$D(DIROUT)!$D(DTOUT)!$D(DUOUT)))
.I $Y+5>IOSL D HD^ABMMUPV3,NMHDR Q:(IOST["C")&((+$G(Y)=0)!($D(DIRUT)!$D(DIROUT)!$D(DTOUT)!$D(DUOUT)))
.S ABMPD=$P(ABMLN(ABMCNT),U)
.S ABMRT=$P(ABMLN(ABMCNT),U,2)
.S ABMDEN=$P(ABMLN(ABMCNT),U,3)
.S ABMNUM=$P(ABMLN(ABMCNT),U,4)
.S ABMPD2=$P(ABMLN(ABMCNT),U,5)
.S ABMRT2=$P(ABMLN(ABMCNT),U,6)
.S ABMDEN2=$P(ABMLN(ABMCNT),U,7)
.S ABMNUM2=$P(ABMLN(ABMCNT),U,8)
.W !,ABMPD,?16,ABMRT,?21,ABMDEN,?29,ABMNUM,?40,ABMPD2,?56,ABMRT2,?63,ABMDEN2,?71,ABMNUM2
Q
NMHDR ;EP
W !
F ABM=1:1:80 W "="
W !,"HOSPITAL"_$S($G(ABMER)=1:"/ER",1:"")_" PATIENT VOLUME - QUALIFICATION YEAR ",ABMY("QYR")
W !,"Report Period",?16,"Rate",?22,"Denom-",?31,"Numer-",?40,"Report Period",?56,"Rate",?63,"Denom-",?71,"Numer-"
W !?22,"inator",?31,"ator",?63,"inator",?71,"ator"
W !
F ABM=1:1:80 W "="
Q
PATIENT ;EP
S ABM("PG")=1
S ABMSDT=$P($G(^XTMP("ABM-PVH",$J,"LOC TOP",ABMVLOC)),U,2)
D HDR^ABMMUPV3
D PTHDR
S ABMITYP=""
F S ABMITYP=$O(^XTMP("ABM-PVH",$J,"PT LST",ABMSDT,ABMVLOC,ABMITYP)) Q:ABMITYP="" D Q:(IOST["C")&((+$G(Y)=0)!($D(DIRUT)!$D(DIROUT)!$D(DTOUT)!$D(DUOUT)))
.S ABMINS=""
.F S ABMINS=$O(^XTMP("ABM-PVH",$J,"PT LST",ABMSDT,ABMVLOC,ABMITYP,ABMINS)) Q:ABMINS="" D Q:(IOST["C")&((+$G(Y)=0)!($D(DIRUT)!$D(DIROUT)!$D(DTOUT)!$D(DUOUT)))
..S ABMPTL=""
..F S ABMPTL=$O(^XTMP("ABM-PVH",$J,"PT LST",ABMSDT,ABMVLOC,ABMITYP,ABMINS,ABMPTL)) Q:ABMPTL="" D Q:(IOST["C")&((+$G(Y)=0)!($D(DIRUT)!$D(DIROUT)!$D(DTOUT)!$D(DUOUT)))
...S ABMPTF=""
...F S ABMPTF=$O(^XTMP("ABM-PVH",$J,"PT LST",ABMSDT,ABMVLOC,ABMITYP,ABMINS,ABMPTL,ABMPTF)) Q:ABMPTF="" D Q:(IOST["C")&((+$G(Y)=0)!($D(DIRUT)!$D(DIROUT)!$D(DTOUT)!$D(DUOUT)))
....S ABMVDT=0
....F S ABMVDT=$O(^XTMP("ABM-PVH",$J,"PT LST",ABMSDT,ABMVLOC,ABMITYP,ABMINS,ABMPTL,ABMPTF,ABMVDT)) Q:'ABMVDT D Q:(IOST["C")&((+$G(Y)=0)!($D(DIRUT)!$D(DIROUT)!$D(DTOUT)!$D(DUOUT)))
.....S ABMVDFN=0
.....F S ABMVDFN=$O(^XTMP("ABM-PVH",$J,"PT LST",ABMSDT,ABMVLOC,ABMITYP,ABMINS,ABMPTL,ABMPTF,ABMVDT,ABMVDFN)) Q:'ABMVDFN D Q:(IOST["C")&((+$G(Y)=0)!($D(DIRUT)!$D(DIROUT)!$D(DTOUT)!$D(DUOUT)))
......S ABMPT=$P($G(^XTMP("ABM-PVH",$J,"PT LST",ABMSDT,ABMVLOC,ABMITYP,ABMINS,ABMPTL,ABMPTF,ABMVDT,ABMVDFN)),U,2)
......S ABMTRIEN=$P($G(^XTMP("ABM-PVH",$J,"PT LST",ABMSDT,ABMVLOC,ABMITYP,ABMINS,ABMPTL,ABMPTF,ABMVDT,ABMVDFN)),U,3)
......S IENS=ABMVLOC_","_ABMPT_","
......S ABMHRN=$$GET1^DIQ(9000001.41,IENS,.02)
......W !,$E(ABMPTL_", "_ABMPTF,1,16) ;pt name
......W ?18,ABMHRN ;HRN
......W ?25,$E($$GET1^DIQ(9000010,ABMVDFN,.07,"E"),1,3) ;Category
......W ?29,$E($$GET1^DIQ(9000010,ABMVDFN,.08,"E"),1,8) ;clinic
......W ?39,$S(ABMITYP="X":"",1:ABMITYP) ;insurer type
......W ?42,$S(ABMINS="NO BILL":"",1:$E(ABMINS,1,10)) ;insurer
......W ?53,$$CDT^ABMDUTL(ABMVDT) ;visit date
......W ?70,$S(+ABMTRIEN:$$SDTO^ABMDUTL(ABMTRIEN),1:"") ;dt paid
......I $P($G(^XTMP("ABM-PVH",$J,"PT LST",ABMSDT,ABMVLOC,ABMITYP,ABMINS,ABMPTL,ABMPTF,ABMVDT,ABMVDFN)),U,4)'="" W ?79,$P(^(ABMVDFN),U,4)
......I $Y+5>IOSL D HD^ABMMUPV3,PTHDR Q:(IOST["C")&((+$G(Y)=0)!($D(DIRUT)!$D(DIROUT)!$D(DTOUT)!$D(DUOUT)))
Q
PTHDR ;
W !,"VISIT LOCATION: ",$$GET1^DIQ(9999999.06,ABMVLOC,.02,"E"),!
F ABM=1:1:80 W "="
W !,?25,"Ser",?39,"I.",?42,"Billed",?53,"Date of",?70,"Date"
W !,"PATIENT NAME",?18,"CHART#",?25,"Cat",?29,"Clinic",?39,"T.",?42,"To",?53,"Service",?70,"Paid",!
F ABM=1:1:80 W "="
Q
ABMMUPH1 ;IHS/SD/SDR - MU Patient Volume Hospital Report ;
+1 ;;2.6;IHS 3P BILLING SYSTEM;**7,8,9**;NOV 12, 2009
+2 ;
MET ;EP
+1 WRITE !!,"Patient Volume: ",+$PIECE($GET(^XTMP("ABM-PVH",$JOB,"LOC TOP",ABMVLOC)),U)_"%"
+2 WRITE !!,"Patient Volume for the Qualification Year was calculated using the Medicaid"
+3 WRITE !,"calculation method for the hospital and includes ER encounters"
+4 WRITE !!,"Total Patient Encounters "_ABMLOC_": ",?54,$JUSTIFY(+$GET(^XTMP("ABM-PVH",$JOB,"LOC-DENOM",ABMSDT,ABMVLOC)),8)
+5 WRITE !,"Total Medicaid Encounters "_ABMLOC_": ",?54,$JUSTIFY(+$GET(^XTMP("ABM-PVH",$JOB,"LOC ENC CNT",ABMSDT,ABMVLOC,"MCD")),8)
+6 WRITE !,"Total Kidscare/Chip Encounters "_ABMLOC_": ",?54,$JUSTIFY(+$GET(^XTMP("ABM-PVH",$JOB,"LOC ENC CNT",ABMSDT,ABMVLOC,"CHIP")),8)
+7 WRITE !,"Total Other Encounters "_ABMLOC_": ",?54,$JUSTIFY(+$GET(^XTMP("ABM-PVH",$JOB,"LOC ENC CNT",ABMSDT,ABMVLOC,"OTHR")),8)
+8 QUIT
NOTMET ;EP
+1 WRITE !!,"The Patient Volume Threshold (10% for Hospitals) was not met for the MU"
+2 WRITE !,"Qualification year. Details for the volumes that were achieved are provided"
+3 WRITE !,"for your information."
+4 WRITE !!,"Highest Patient Volume Met: ",+$PIECE($GET(^XTMP("ABM-PVH",$JOB,"LOC TOP",ABMVLOC)),U)
+5 WRITE !,"First Day Highest Patient Volume Achieved: ",$$SDT^ABMDUTL(ABMSDT)
+6 WRITE !!,"Patient Volume for the Qualification Year was calculated using the Medicaid"
+7 WRITE !,"calculation method for the hospital and includes ER encounters"
+8 SET ABMTHPV=0
+9 IF ABMSDT
SET ABMTHPV=+$GET(^XTMP("ABM-PVH",$JOB,"LOC-DENOM",ABMSDT,ABMVLOC))
+10 SET ABMMHPV=0
+11 IF ABMSDT
SET ABMMHPV=+$GET(^XTMP("ABM-PVH",$JOB,"LOC-NUM",ABMSDT,ABMVLOC))
+12 WRITE !!,"Total Patient Encounters of First Highest Patient Volume Period: ",ABMTHPV
+13 WRITE !,"Total Hospital"_$SELECT(+$GET(ABMER)=1:"/ER",1:"")_" Encounters of First Highest Patient Volume Period: ",ABMMHPV
+14 SET ABMCNT=0
+15 KILL ABMLN
+16 ;
+17 IF +$GET(ABMY("TVDTS"))'=0
Begin DoDot:1
+18 SET ABMCNT=0
+19 SET ABMDT=0
+20 FOR
SET ABMDT=$ORDER(^XTMP("ABM-PVH",$JOB,"LOC PERCENT",ABMDT))
IF 'ABMDT
QUIT
Begin DoDot:2
+21 SET ABMLOC=0
+22 FOR
SET ABMLOC=$ORDER(^XTMP("ABM-PVH",$JOB,"LOC PERCENT",ABMDT,ABMLOC))
IF 'ABMLOC
QUIT
Begin DoDot:3
+23 SET ABMCNT=ABMCNT+1
+24 SET ABMPRC($GET(^XTMP("ABM-PVH",$JOB,"LOC PERCENT",ABMDT,ABMLOC)),ABMCNT)=ABMDT
+25 SET ABMP=""
+26 SET ABMSAV=ABMCNT-ABMY("TVDTS")
+27 FOR
SET ABMP=$ORDER(ABMPRC(ABMP))
IF ABMP=""
QUIT
Begin DoDot:4
+28 SET ABMCNT=0
SET ABMC=0
+29 FOR
SET ABMCNT=$ORDER(ABMPRC(ABMP,ABMCNT))
IF 'ABMCNT
QUIT
Begin DoDot:5
+30 KILL ^XTMP("ABM-PVH",$JOB,"LOC PERCENT",$GET(ABMPRC(ABMP,ABMCNT)))
+31 SET ABMC=ABMC+1
End DoDot:5
IF (ABMC=ABMSAV)
QUIT
End DoDot:4
End DoDot:3
End DoDot:2
End DoDot:1
+32 ;
+33 DO NMHDR
+34 SET ABMSDT=0
SET ABMCNT=0
+35 FOR
SET ABMSDT=$ORDER(^XTMP("ABM-PVH",$JOB,"LOC-DENOM",ABMSDT))
IF 'ABMSDT
QUIT
Begin DoDot:1
+36 ;start old code abm*2.6*8 NOHEAT
+37 ;S X1=ABMSDT
+38 ;S X2=89
+39 ;D C^%DTC
+40 ;S ABMEDT=X
+41 ;end old code start new code
+42 ;I +$G(ABMY("EDT"))=0 D ;abm*2.6*9 NOHEAT
+43 ;abm*2.6*9 NOHEAT
IF +$GET(ABMP("EDT"))=0
Begin DoDot:2
+44 SET X1=ABMSDT
+45 SET X2=89
+46 DO C^%DTC
+47 SET ABMEDT=X
End DoDot:2
+48 ;I +$G(ABMY("EDT"))'=0 S ABMEDT=ABMY("EDT") ;abm*2.6*9 NOHEAT
+49 ;abm*2.6*9 NOHEAT
IF +$GET(ABMP("EDT"))'=0
SET ABMEDT=ABMP("EDT")
+50 ;end new code
+51 SET ABMCNT=ABMCNT+1
+52 ;report period
SET ABMLN(ABMCNT)=$TRANSLATE($PIECE($$MDT^ABMDUTL(ABMSDT),"-",1,2),"-"," ")_" - "_$TRANSLATE($PIECE($$MDT^ABMDUTL(ABMEDT),"-",1,2),"-"," ")
+53 ;rate
SET $PIECE(ABMLN(ABMCNT),U,2)=$JUSTIFY($GET(^XTMP("ABM-PVH",$JOB,"LOC PERCENT",ABMSDT)),3)_"%"
+54 ;denominator
SET $PIECE(ABMLN(ABMCNT),U,3)=$JUSTIFY(+$GET(^XTMP("ABM-PVH",$JOB,"LOC-DENOM",ABMSDT)),6)
+55 ;numerator
SET $PIECE(ABMLN(ABMCNT),U,4)=$JUSTIFY(+$GET(^XTMP("ABM-PVH",$JOB,"LOC-NUM",ABMSDT)),6)
End DoDot:1
+56 SET ABMCUTOF=$SELECT(ABMCNT#2=1:(ABMCNT+1)\2,1:ABMCNT\2)
+57 SET ABMMCNT=1
+58 FOR ABMCUTOF=(ABMCUTOF+1):1:ABMCNT
Begin DoDot:1
+59 SET ABMLN(ABMMCNT)=ABMLN(ABMMCNT)_U_ABMLN(ABMCUTOF)
+60 KILL ABMLN(ABMCUTOF)
+61 SET ABMMCNT=+$GET(ABMMCNT)+1
End DoDot:1
+62 SET ABMCNT=0
+63 FOR
SET ABMCNT=$ORDER(ABMLN(ABMCNT))
IF 'ABMCNT
QUIT
Begin DoDot:1
+64 IF $Y+5>IOSL
DO HD^ABMMUPV3
DO NMHDR
IF (IOST["C")&((+$GET(Y)=0)!($DATA(DIRUT)!$DATA(DIROUT)!$DATA(DTOUT)!$DATA(DUOUT)))
QUIT
+65 SET ABMPD=$PIECE(ABMLN(ABMCNT),U)
+66 SET ABMRT=$PIECE(ABMLN(ABMCNT),U,2)
+67 SET ABMDEN=$PIECE(ABMLN(ABMCNT),U,3)
+68 SET ABMNUM=$PIECE(ABMLN(ABMCNT),U,4)
+69 SET ABMPD2=$PIECE(ABMLN(ABMCNT),U,5)
+70 SET ABMRT2=$PIECE(ABMLN(ABMCNT),U,6)
+71 SET ABMDEN2=$PIECE(ABMLN(ABMCNT),U,7)
+72 SET ABMNUM2=$PIECE(ABMLN(ABMCNT),U,8)
+73 WRITE !,ABMPD,?16,ABMRT,?21,ABMDEN,?29,ABMNUM,?40,ABMPD2,?56,ABMRT2,?63,ABMDEN2,?71,ABMNUM2
End DoDot:1
IF (IOST["C")&((+$GET(Y)=0)!($DATA(DIRUT)!$DATA(DIROUT)!$DATA(DTOUT)!$DATA(DUOUT)))
QUIT
+74 QUIT
NMHDR ;EP
+1 WRITE !
+2 FOR ABM=1:1:80
WRITE "="
+3 WRITE !,"HOSPITAL"_$SELECT($GET(ABMER)=1:"/ER",1:"")_" PATIENT VOLUME - QUALIFICATION YEAR ",ABMY("QYR")
+4 WRITE !,"Report Period",?16,"Rate",?22,"Denom-",?31,"Numer-",?40,"Report Period",?56,"Rate",?63,"Denom-",?71,"Numer-"
+5 WRITE !?22,"inator",?31,"ator",?63,"inator",?71,"ator"
+6 WRITE !
+7 FOR ABM=1:1:80
WRITE "="
+8 QUIT
PATIENT ;EP
+1 SET ABM("PG")=1
+2 SET ABMSDT=$PIECE($GET(^XTMP("ABM-PVH",$JOB,"LOC TOP",ABMVLOC)),U,2)
+3 DO HDR^ABMMUPV3
+4 DO PTHDR
+5 SET ABMITYP=""
+6 FOR
SET ABMITYP=$ORDER(^XTMP("ABM-PVH",$JOB,"PT LST",ABMSDT,ABMVLOC,ABMITYP))
IF ABMITYP=""
QUIT
Begin DoDot:1
+7 SET ABMINS=""
+8 FOR
SET ABMINS=$ORDER(^XTMP("ABM-PVH",$JOB,"PT LST",ABMSDT,ABMVLOC,ABMITYP,ABMINS))
IF ABMINS=""
QUIT
Begin DoDot:2
+9 SET ABMPTL=""
+10 FOR
SET ABMPTL=$ORDER(^XTMP("ABM-PVH",$JOB,"PT LST",ABMSDT,ABMVLOC,ABMITYP,ABMINS,ABMPTL))
IF ABMPTL=""
QUIT
Begin DoDot:3
+11 SET ABMPTF=""
+12 FOR
SET ABMPTF=$ORDER(^XTMP("ABM-PVH",$JOB,"PT LST",ABMSDT,ABMVLOC,ABMITYP,ABMINS,ABMPTL,ABMPTF))
IF ABMPTF=""
QUIT
Begin DoDot:4
+13 SET ABMVDT=0
+14 FOR
SET ABMVDT=$ORDER(^XTMP("ABM-PVH",$JOB,"PT LST",ABMSDT,ABMVLOC,ABMITYP,ABMINS,ABMPTL,ABMPTF,ABMVDT))
IF 'ABMVDT
QUIT
Begin DoDot:5
+15 SET ABMVDFN=0
+16 FOR
SET ABMVDFN=$ORDER(^XTMP("ABM-PVH",$JOB,"PT LST",ABMSDT,ABMVLOC,ABMITYP,ABMINS,ABMPTL,ABMPTF,ABMVDT,ABMVDFN))
IF 'ABMVDFN
QUIT
Begin DoDot:6
+17 SET ABMPT=$PIECE($GET(^XTMP("ABM-PVH",$JOB,"PT LST",ABMSDT,ABMVLOC,ABMITYP,ABMINS,ABMPTL,ABMPTF,ABMVDT,ABMVDFN)),U,2)
+18 SET ABMTRIEN=$PIECE($GET(^XTMP("ABM-PVH",$JOB,"PT LST",ABMSDT,ABMVLOC,ABMITYP,ABMINS,ABMPTL,ABMPTF,ABMVDT,ABMVDFN)),U,3)
+19 SET IENS=ABMVLOC_","_ABMPT_","
+20 SET ABMHRN=$$GET1^DIQ(9000001.41,IENS,.02)
+21 ;pt name
WRITE !,$EXTRACT(ABMPTL_", "_ABMPTF,1,16)
+22 ;HRN
WRITE ?18,ABMHRN
+23 ;Category
WRITE ?25,$EXTRACT($$GET1^DIQ(9000010,ABMVDFN,.07,"E"),1,3)
+24 ;clinic
WRITE ?29,$EXTRACT($$GET1^DIQ(9000010,ABMVDFN,.08,"E"),1,8)
+25 ;insurer type
WRITE ?39,$SELECT(ABMITYP="X":"",1:ABMITYP)
+26 ;insurer
WRITE ?42,$SELECT(ABMINS="NO BILL":"",1:$EXTRACT(ABMINS,1,10))
+27 ;visit date
WRITE ?53,$$CDT^ABMDUTL(ABMVDT)
+28 ;dt paid
WRITE ?70,$SELECT(+ABMTRIEN:$$SDTO^ABMDUTL(ABMTRIEN),1:"")
+29 IF $PIECE($GET(^XTMP("ABM-PVH",$JOB,"PT LST",ABMSDT,ABMVLOC,ABMITYP,ABMINS,ABMPTL,ABMPTF,ABMVDT,ABMVDFN)),U,4)'=""
WRITE ?79,$PIECE(^(ABMVDFN),U,4)
+30 IF $Y+5>IOSL
DO HD^ABMMUPV3
DO PTHDR
IF (IOST["C")&((+$GET(Y)=0)!($DATA(DIRUT)!$DATA(DIROUT)!$DATA(DTOUT)!$DATA(DUOUT)))
QUIT
End DoDot:6
IF (IOST["C")&((+$GET(Y)=0)!($DATA(DIRUT)!$DATA(DIROUT)!$DATA(DTOUT)!$DATA(DUOUT)))
QUIT
End DoDot:5
IF (IOST["C")&((+$GET(Y)=0)!($DATA(DIRUT)!$DATA(DIROUT)!$DATA(DTOUT)!$DATA(DUOUT)))
QUIT
End DoDot:4
IF (IOST["C")&((+$GET(Y)=0)!($DATA(DIRUT)!$DATA(DIROUT)!$DATA(DTOUT)!$DATA(DUOUT)))
QUIT
End DoDot:3
IF (IOST["C")&((+$GET(Y)=0)!($DATA(DIRUT)!$DATA(DIROUT)!$DATA(DTOUT)!$DATA(DUOUT)))
QUIT
End DoDot:2
IF (IOST["C")&((+$GET(Y)=0)!($DATA(DIRUT)!$DATA(DIROUT)!$DATA(DTOUT)!$DATA(DUOUT)))
QUIT
End DoDot:1
IF (IOST["C")&((+$GET(Y)=0)!($DATA(DIRUT)!$DATA(DIROUT)!$DATA(DTOUT)!$DATA(DUOUT)))
QUIT
+31 QUIT
PTHDR ;
+1 WRITE !,"VISIT LOCATION: ",$$GET1^DIQ(9999999.06,ABMVLOC,.02,"E"),!
+2 FOR ABM=1:1:80
WRITE "="
+3 WRITE !,?25,"Ser",?39,"I.",?42,"Billed",?53,"Date of",?70,"Date"
+4 WRITE !,"PATIENT NAME",?18,"CHART#",?25,"Cat",?29,"Clinic",?39,"T.",?42,"To",?53,"Service",?70,"Paid",!
+5 FOR ABM=1:1:80
WRITE "="
+6 QUIT