IBECUS ;RLM/DVAMC - TRICARE PHARMACY ENGINE OPTIONS ; 14-AUG-96
;;2.0;INTEGRATED BILLING;**52,240**;21-MAR-94
;
START ; Start the TRICARE Transaction and AWP Update engines.
K IBERR D PAR
;
; - parameters are not set up completely
I $O(IBERR(0)) D G STARTQ
.W !!,"The TRICARE Billing engines cannot be started!",*7
.W ! S I=0 F S I=$O(IBERR(I)) Q:'I W !,IBERR(I)
.I IBAPORT="" W !!," *** Note that the AWP Update port has also not been defined."
;
; - AWP and billing ports must be unique
I IBBPORT=IBAPORT W !!,"The Billing Transaction and AWP Update ports cannot be the same!" G STARTQ
;
; - only start the billing job if the AWP port is not defined
I IBAPORT="" W !!,"The AWP Update port has not been defined. The AWP Update task will not start."
;
I IBVOL]"" W !!,"Note that these jobs will be queued to run on ",IBVOL,"."
;
; - okay to queue these jobs?
S DIR(0)="Y",DIR("A")="Is it okay to queue these jobs to run"
S DIR("?",1)="Enter: 'Y' if you wish to task off this job, or"
S DIR("?")=" 'N' or '^' to quit this option."
W ! D ^DIR
I 'Y W !!,"The jobs have not been queued to run." G STARTQ
;
; - turn off the 'shutdown filer' flag
S $P(^IBE(350.9,1,9),"^",10)=0
;
; - queue the primary billing task
S ZTRTN="BILLP^IBECUS1",ZTDTH=$H,ZTIO=""
S ZTDESC="IB - TRICARE Primary Billing Task"
I IBVOL]"" S ZTCPU=IBVOL
F I="IBBPORT","IBCHAN","IBCHSET","IBPRESCR","IBVOL" S ZTSAVE(I)=""
D ^%ZTLOAD
I '$D(ZTSK) W !!,"Unable to queue the billing task!" G STARTQ
;
W !!,"The TRICARE billing engine has been queued as task# ",ZTSK,"."
S DA=1,DIE="^IBE(350.9,",DR="9.04////"_ZTSK_";9.05////@" D ^DIE
;
; - the AWP port must be defined to start that job
I IBAPORT="" G STARTQ
;
; - queue the primary AWP update task
K ZTSAVE,ZTCPU,ZTSK
S ZTRTN="AWPP^IBECUS1",ZTDTH=$H,ZTIO=""
S ZTDESC="IB - TRICARE Primary AWP Update Task"
I IBVOL]"" S ZTCPU=IBVOL
F I="IBAPORT","IBCHAN","IBCHSET","IBVOL" S ZTSAVE(I)=""
D ^%ZTLOAD S IBATASK=$G(ZTSK)
I '$D(ZTSK) W !!,"Unable to queue the AWP Update task!" G STARTQ
;
W !!,"The AWP Update engine has been queued as task# ",ZTSK,"."
S DA=1,DIE="^IBE(350.9,",DR="9.06////"_ZTSK_";9.07////@" D ^DIE
;
STARTQ K DIROUT,DTOUT,DUOUT,IBERR,IBAPORT,IBBPORT,IBCHAN,IBVOL,ZTSK
Q
;
;
STOP ; Shut down the TRICARE Transaction and AWP Update engines.
I '$P($G(^IBE(350.9,1,9)),"^",4) W !!,"The primary billing task does not appear to be running."
;
; - okay to shut down these jobs?
S DIR(0)="Y",DIR("A")="Are you sure you wish to shut down these jobs"
S DIR("?",1)="Enter: 'Y' if you wish to shut down these jobs, or"
S DIR("?")=" 'N' or '^' to quit this option."
W ! D ^DIR
I 'Y W !!,"The jobs will not be shut down." G STOPQ
;
; - set the 'shutdown filer' flag
S $P(^IBE(350.9,1,9),"^",10)=1
;
W !!,"The TRICARE Billing and AWP Update engines will be shut down."
;
STOPQ K DIR,DUOUT,DTOUT,DIROUT,X,Y
Q
;
;
PAR ; Retrieve the required engine parameters.
N X,Y,ZTSK
S X=$G(^IBE(350.9,1,9))
S IBBPORT=$P(X,"^")
I IBBPORT="" S IBERR(1)="The Billing transaction port has not been defined."
S IBAPORT=$P(X,"^",2)
S IBCHAN=$P(X,"^",3)
I IBCHAN="" S IBERR(2)="The TCP/IP address has not been defined."
S ZTSK=$P(X,"^",4)
I ZTSK D
.D STAT^%ZTLOAD
.I ZTSK(1)=2 S IBERR(3)="This job appears to be running! Check task #"_ZTSK_"." Q
.S $P(^IBE(350.9,1,9),"^",4)=""
S IBCHSET=+$P(X,"^",12)
I $G(^IBE(363.1,IBCHSET,0))="" S IBERR(4)="You must define a Charge Set in the Charge Master so the drug AWP can be found."
S IBPRESCR=$P(X,"^",13)
I IBPRESCR="" S IBERR(5)="You must enter your Prescriber ID before this task can be started."
S IBVOL=$P(X,"^",11)
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HIBECUS 3773 printed Dec 13, 2024@02:21:44 Page 2
IBECUS ;RLM/DVAMC - TRICARE PHARMACY ENGINE OPTIONS ; 14-AUG-96
+1 ;;2.0;INTEGRATED BILLING;**52,240**;21-MAR-94
+2 ;
START ; Start the TRICARE Transaction and AWP Update engines.
+1 KILL IBERR
DO PAR
+2 ;
+3 ; - parameters are not set up completely
+4 IF $ORDER(IBERR(0))
Begin DoDot:1
+5 WRITE !!,"The TRICARE Billing engines cannot be started!",*7
+6 WRITE !
SET I=0
FOR
SET I=$ORDER(IBERR(I))
if 'I
QUIT
WRITE !,IBERR(I)
+7 IF IBAPORT=""
WRITE !!," *** Note that the AWP Update port has also not been defined."
End DoDot:1
GOTO STARTQ
+8 ;
+9 ; - AWP and billing ports must be unique
+10 IF IBBPORT=IBAPORT
WRITE !!,"The Billing Transaction and AWP Update ports cannot be the same!"
GOTO STARTQ
+11 ;
+12 ; - only start the billing job if the AWP port is not defined
+13 IF IBAPORT=""
WRITE !!,"The AWP Update port has not been defined. The AWP Update task will not start."
+14 ;
+15 IF IBVOL]""
WRITE !!,"Note that these jobs will be queued to run on ",IBVOL,"."
+16 ;
+17 ; - okay to queue these jobs?
+18 SET DIR(0)="Y"
SET DIR("A")="Is it okay to queue these jobs to run"
+19 SET DIR("?",1)="Enter: 'Y' if you wish to task off this job, or"
+20 SET DIR("?")=" 'N' or '^' to quit this option."
+21 WRITE !
DO ^DIR
+22 IF 'Y
WRITE !!,"The jobs have not been queued to run."
GOTO STARTQ
+23 ;
+24 ; - turn off the 'shutdown filer' flag
+25 SET $PIECE(^IBE(350.9,1,9),"^",10)=0
+26 ;
+27 ; - queue the primary billing task
+28 SET ZTRTN="BILLP^IBECUS1"
SET ZTDTH=$HOROLOG
SET ZTIO=""
+29 SET ZTDESC="IB - TRICARE Primary Billing Task"
+30 IF IBVOL]""
SET ZTCPU=IBVOL
+31 FOR I="IBBPORT","IBCHAN","IBCHSET","IBPRESCR","IBVOL"
SET ZTSAVE(I)=""
+32 DO ^%ZTLOAD
+33 IF '$DATA(ZTSK)
WRITE !!,"Unable to queue the billing task!"
GOTO STARTQ
+34 ;
+35 WRITE !!,"The TRICARE billing engine has been queued as task# ",ZTSK,"."
+36 SET DA=1
SET DIE="^IBE(350.9,"
SET DR="9.04////"_ZTSK_";9.05////@"
DO ^DIE
+37 ;
+38 ; - the AWP port must be defined to start that job
+39 IF IBAPORT=""
GOTO STARTQ
+40 ;
+41 ; - queue the primary AWP update task
+42 KILL ZTSAVE,ZTCPU,ZTSK
+43 SET ZTRTN="AWPP^IBECUS1"
SET ZTDTH=$HOROLOG
SET ZTIO=""
+44 SET ZTDESC="IB - TRICARE Primary AWP Update Task"
+45 IF IBVOL]""
SET ZTCPU=IBVOL
+46 FOR I="IBAPORT","IBCHAN","IBCHSET","IBVOL"
SET ZTSAVE(I)=""
+47 DO ^%ZTLOAD
SET IBATASK=$GET(ZTSK)
+48 IF '$DATA(ZTSK)
WRITE !!,"Unable to queue the AWP Update task!"
GOTO STARTQ
+49 ;
+50 WRITE !!,"The AWP Update engine has been queued as task# ",ZTSK,"."
+51 SET DA=1
SET DIE="^IBE(350.9,"
SET DR="9.06////"_ZTSK_";9.07////@"
DO ^DIE
+52 ;
STARTQ KILL DIROUT,DTOUT,DUOUT,IBERR,IBAPORT,IBBPORT,IBCHAN,IBVOL,ZTSK
+1 QUIT
+2 ;
+3 ;
STOP ; Shut down the TRICARE Transaction and AWP Update engines.
+1 IF '$PIECE($GET(^IBE(350.9,1,9)),"^",4)
WRITE !!,"The primary billing task does not appear to be running."
+2 ;
+3 ; - okay to shut down these jobs?
+4 SET DIR(0)="Y"
SET DIR("A")="Are you sure you wish to shut down these jobs"
+5 SET DIR("?",1)="Enter: 'Y' if you wish to shut down these jobs, or"
+6 SET DIR("?")=" 'N' or '^' to quit this option."
+7 WRITE !
DO ^DIR
+8 IF 'Y
WRITE !!,"The jobs will not be shut down."
GOTO STOPQ
+9 ;
+10 ; - set the 'shutdown filer' flag
+11 SET $PIECE(^IBE(350.9,1,9),"^",10)=1
+12 ;
+13 WRITE !!,"The TRICARE Billing and AWP Update engines will be shut down."
+14 ;
STOPQ KILL DIR,DUOUT,DTOUT,DIROUT,X,Y
+1 QUIT
+2 ;
+3 ;
PAR ; Retrieve the required engine parameters.
+1 NEW X,Y,ZTSK
+2 SET X=$GET(^IBE(350.9,1,9))
+3 SET IBBPORT=$PIECE(X,"^")
+4 IF IBBPORT=""
SET IBERR(1)="The Billing transaction port has not been defined."
+5 SET IBAPORT=$PIECE(X,"^",2)
+6 SET IBCHAN=$PIECE(X,"^",3)
+7 IF IBCHAN=""
SET IBERR(2)="The TCP/IP address has not been defined."
+8 SET ZTSK=$PIECE(X,"^",4)
+9 IF ZTSK
Begin DoDot:1
+10 DO STAT^%ZTLOAD
+11 IF ZTSK(1)=2
SET IBERR(3)="This job appears to be running! Check task #"_ZTSK_"."
QUIT
+12 SET $PIECE(^IBE(350.9,1,9),"^",4)=""
End DoDot:1
+13 SET IBCHSET=+$PIECE(X,"^",12)
+14 IF $GET(^IBE(363.1,IBCHSET,0))=""
SET IBERR(4)="You must define a Charge Set in the Charge Master so the drug AWP can be found."
+15 SET IBPRESCR=$PIECE(X,"^",13)
+16 IF IBPRESCR=""
SET IBERR(5)="You must enter your Prescriber ID before this task can be started."
+17 SET IBVOL=$PIECE(X,"^",11)
+18 QUIT