AMHRBV ; IHS/CMI/LAB - print billable visits ;
;;4.0;IHS BEHAVIORAL HEALTH;;MAY 14, 2010
START ;
I '$G(DUZ(2)) W $C(7),$C(7),!!,"SITE NOT SET IN DUZ(2) - NOTIFY SITE MANAGER!!",! Q
W:$D(IOF) @IOF
W !!,"This Option prints who are a list of Potentially Billable Visits for all ",!,"patients registered at the Facility that you select who have been seen",!,"by Mental Health and Social Services.",!
W "The user will select which third party coverage type that they are interested",!,"in seeing billable visits for."
W !,"This report displays visits during a period when this patient had third",!,"party coverage, but does not consider the diagnostic category which may be",!,"excluded by some types of coverage.",!
D DBHUSR^AMHUTIL
F ;
S DIC("A")="Run the report for Patients registered at which Facility: ",DIC="^AUTTLOC(",DIC(0)="AEMQ" D ^DIC K DIC,DA G:Y<0 EOJ
S AMHSU=+Y
SD ;
W !
S Y=DT X ^DD("DD") S AMHDTP=Y
S %DT("A")="Starting Visit Date for Billable Visits: ",%DT="AEPX" W ! D ^%DT
I Y=-1 G F
S AMHSD=Y X ^DD("DD") S AMHSDY=Y
ED S %DT("A")="Ending Visit Date for Billable Visits: " W ! D ^%DT K %DT
I Y=-1 G SD
S AMHED=Y X ^DD("DD") S AMHEDY=Y
I AMHED<AMHSD W !!,"Ending Date cannot be before Starting Date! Please reenter.",! G SD
;
CT ;
S DIR(0)="SO^1:Commissioned Officers/Dependents;2:Medicare Part A;3:Medicare Part B;4:Medicaid;5:Private Insurance;6:Non-Indians",DIR("A")="Select Third Party Coverage" D ^DIR K DIR
G:$D(DIRUT) SD
S AMHPROC=Y,AMHNAR=Y(0)
ZIS ;
S DIR(0)="S^P:PRINT Output;B:BROWSE Output on Screen",DIR("A")="Do you wish to ",DIR("B")="P" K DA D ^DIR K DIR
I $D(DIRUT) G EOJ
I $G(Y)="B" D BROWSE,EOJ Q
S XBRP="^AMHRBV1",XBRC="^AMHRBV2",XBRX="EOJ^AMHRBV",XBNS="AMH"
D ^XBDBQUE
D EOJ
Q
BROWSE ;
S XBRP="VIEWR^XBLM(""^AMHRBV1"")"
S XBNS="AMH",XBRC="^AMHRBV2",XBRX="EOJ^AMHRBV",XBIOP=0 D ^XBDBQUE
Q
EOJ ;ENTRY POINT
K POP,ZTSK,ZTQUEUED,DFN,%DT,%,X,Y,DIRUT,DTOUT,J,K,%XX,%YY,DDBN,DDBX,HS,IX,C,IO("Q"),DIR,DIRUT,DIC,DA,DR,DIQ,H,M,S,TS,ABHN
K AMHSD,AMHSDY,AMHED,AMHEDY,AMHPROC,AMHNAR,AMH,AMHSU,AMHLENG,AMHDTP,AMHCAT,AMHMDFN,AMHGOT,AMHBT,AMHNAMEP,AMHJOB,AMHMIN
K AMHS,AMHCOAR,AMHCOPN,AMHVDFN,AMHVN0,AMHCOP,AMHPN,AMHVAL,AMHTRI,AMHTRIC
K AMHCHMP,AMH80E,AMH80D,AMHPG,AMHEOJ,AMHX,AMHVDFN,AMHVREC,AMHDATE,AMH1,AMH2,AMHAP,AMHDISC,AMHY,AMHSKIP,AMHMN,AMHMDOB,AMHMEDN,DOB,AMHHRN,AMHVAL
K AMHNDFN,AMHREC,AMHNREC,AMHACT,AMHINI,AMHRDFN
Q
AMHRBV ; IHS/CMI/LAB - print billable visits ;
+1 ;;4.0;IHS BEHAVIORAL HEALTH;;MAY 14, 2010
START ;
+1 IF '$GET(DUZ(2))
WRITE $CHAR(7),$CHAR(7),!!,"SITE NOT SET IN DUZ(2) - NOTIFY SITE MANAGER!!",!
QUIT
+2 IF $DATA(IOF)
WRITE @IOF
+3 WRITE !!,"This Option prints who are a list of Potentially Billable Visits for all ",!,"patients registered at the Facility that you select who have been seen",!,"by Mental Health and Social Services.",!
+4 WRITE "The user will select which third party coverage type that they are interested",!,"in seeing billable visits for."
+5 WRITE !,"This report displays visits during a period when this patient had third",!,"party coverage, but does not consider the diagnostic category which may be",!,"excluded by some types of coverage.",!
+6 DO DBHUSR^AMHUTIL
F ;
+1 SET DIC("A")="Run the report for Patients registered at which Facility: "
SET DIC="^AUTTLOC("
SET DIC(0)="AEMQ"
DO ^DIC
KILL DIC,DA
IF Y<0
GOTO EOJ
+2 SET AMHSU=+Y
SD ;
+1 WRITE !
+2 SET Y=DT
XECUTE ^DD("DD")
SET AMHDTP=Y
+3 SET %DT("A")="Starting Visit Date for Billable Visits: "
SET %DT="AEPX"
WRITE !
DO ^%DT
+4 IF Y=-1
GOTO F
+5 SET AMHSD=Y
XECUTE ^DD("DD")
SET AMHSDY=Y
ED SET %DT("A")="Ending Visit Date for Billable Visits: "
WRITE !
DO ^%DT
KILL %DT
+1 IF Y=-1
GOTO SD
+2 SET AMHED=Y
XECUTE ^DD("DD")
SET AMHEDY=Y
+3 IF AMHED<AMHSD
WRITE !!,"Ending Date cannot be before Starting Date! Please reenter.",!
GOTO SD
+4 ;
CT ;
+1 SET DIR(0)="SO^1:Commissioned Officers/Dependents;2:Medicare Part A;3:Medicare Part B;4:Medicaid;5:Private Insurance;6:Non-Indians"
SET DIR("A")="Select Third Party Coverage"
DO ^DIR
KILL DIR
+2 IF $DATA(DIRUT)
GOTO SD
+3 SET AMHPROC=Y
SET AMHNAR=Y(0)
ZIS ;
+1 SET DIR(0)="S^P:PRINT Output;B:BROWSE Output on Screen"
SET DIR("A")="Do you wish to "
SET DIR("B")="P"
KILL DA
DO ^DIR
KILL DIR
+2 IF $DATA(DIRUT)
GOTO EOJ
+3 IF $GET(Y)="B"
DO BROWSE
DO EOJ
QUIT
+4 SET XBRP="^AMHRBV1"
SET XBRC="^AMHRBV2"
SET XBRX="EOJ^AMHRBV"
SET XBNS="AMH"
+5 DO ^XBDBQUE
+6 DO EOJ
+7 QUIT
BROWSE ;
+1 SET XBRP="VIEWR^XBLM(""^AMHRBV1"")"
+2 SET XBNS="AMH"
SET XBRC="^AMHRBV2"
SET XBRX="EOJ^AMHRBV"
SET XBIOP=0
DO ^XBDBQUE
+3 QUIT
EOJ ;ENTRY POINT
+1 KILL POP,ZTSK,ZTQUEUED,DFN,%DT,%,X,Y,DIRUT,DTOUT,J,K,%XX,%YY,DDBN,DDBX,HS,IX,C,IO("Q"),DIR,DIRUT,DIC,DA,DR,DIQ,H,M,S,TS,ABHN
+2 KILL AMHSD,AMHSDY,AMHED,AMHEDY,AMHPROC,AMHNAR,AMH,AMHSU,AMHLENG,AMHDTP,AMHCAT,AMHMDFN,AMHGOT,AMHBT,AMHNAMEP,AMHJOB,AMHMIN
+3 KILL AMHS,AMHCOAR,AMHCOPN,AMHVDFN,AMHVN0,AMHCOP,AMHPN,AMHVAL,AMHTRI,AMHTRIC
+4 KILL AMHCHMP,AMH80E,AMH80D,AMHPG,AMHEOJ,AMHX,AMHVDFN,AMHVREC,AMHDATE,AMH1,AMH2,AMHAP,AMHDISC,AMHY,AMHSKIP,AMHMN,AMHMDOB,AMHMEDN,DOB,AMHHRN,AMHVAL
+5 KILL AMHNDFN,AMHREC,AMHNREC,AMHACT,AMHINI,AMHRDFN
+6 QUIT