Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: IBECUS

IBECUS.m

Go to the documentation of this file.
  1. IBECUS ;RLM/DVAMC - TRICARE PHARMACY ENGINE OPTIONS ; 14-AUG-96
  1. ;;2.0;INTEGRATED BILLING;**52,240**;21-MAR-94
  1. ;
  1. START ; Start the TRICARE Transaction and AWP Update engines.
  1. K IBERR D PAR
  1. ;
  1. ; - parameters are not set up completely
  1. I $O(IBERR(0)) D G STARTQ
  1. .W !!,"The TRICARE Billing engines cannot be started!",*7
  1. .W ! S I=0 F S I=$O(IBERR(I)) Q:'I W !,IBERR(I)
  1. .I IBAPORT="" W !!," *** Note that the AWP Update port has also not been defined."
  1. ;
  1. ; - AWP and billing ports must be unique
  1. I IBBPORT=IBAPORT W !!,"The Billing Transaction and AWP Update ports cannot be the same!" G STARTQ
  1. ;
  1. ; - only start the billing job if the AWP port is not defined
  1. I IBAPORT="" W !!,"The AWP Update port has not been defined. The AWP Update task will not start."
  1. ;
  1. I IBVOL]"" W !!,"Note that these jobs will be queued to run on ",IBVOL,"."
  1. ;
  1. ; - okay to queue these jobs?
  1. S DIR(0)="Y",DIR("A")="Is it okay to queue these jobs to run"
  1. S DIR("?",1)="Enter: 'Y' if you wish to task off this job, or"
  1. S DIR("?")=" 'N' or '^' to quit this option."
  1. W ! D ^DIR
  1. I 'Y W !!,"The jobs have not been queued to run." G STARTQ
  1. ;
  1. ; - turn off the 'shutdown filer' flag
  1. S $P(^IBE(350.9,1,9),"^",10)=0
  1. ;
  1. ; - queue the primary billing task
  1. S ZTRTN="BILLP^IBECUS1",ZTDTH=$H,ZTIO=""
  1. S ZTDESC="IB - TRICARE Primary Billing Task"
  1. I IBVOL]"" S ZTCPU=IBVOL
  1. F I="IBBPORT","IBCHAN","IBCHSET","IBPRESCR","IBVOL" S ZTSAVE(I)=""
  1. D ^%ZTLOAD
  1. I '$D(ZTSK) W !!,"Unable to queue the billing task!" G STARTQ
  1. ;
  1. W !!,"The TRICARE billing engine has been queued as task# ",ZTSK,"."
  1. S DA=1,DIE="^IBE(350.9,",DR="9.04////"_ZTSK_";9.05////@" D ^DIE
  1. ;
  1. ; - the AWP port must be defined to start that job
  1. I IBAPORT="" G STARTQ
  1. ;
  1. ; - queue the primary AWP update task
  1. K ZTSAVE,ZTCPU,ZTSK
  1. S ZTRTN="AWPP^IBECUS1",ZTDTH=$H,ZTIO=""
  1. S ZTDESC="IB - TRICARE Primary AWP Update Task"
  1. I IBVOL]"" S ZTCPU=IBVOL
  1. F I="IBAPORT","IBCHAN","IBCHSET","IBVOL" S ZTSAVE(I)=""
  1. D ^%ZTLOAD S IBATASK=$G(ZTSK)
  1. I '$D(ZTSK) W !!,"Unable to queue the AWP Update task!" G STARTQ
  1. ;
  1. W !!,"The AWP Update engine has been queued as task# ",ZTSK,"."
  1. S DA=1,DIE="^IBE(350.9,",DR="9.06////"_ZTSK_";9.07////@" D ^DIE
  1. ;
  1. STARTQ K DIROUT,DTOUT,DUOUT,IBERR,IBAPORT,IBBPORT,IBCHAN,IBVOL,ZTSK
  1. Q
  1. ;
  1. ;
  1. STOP ; Shut down the TRICARE Transaction and AWP Update engines.
  1. I '$P($G(^IBE(350.9,1,9)),"^",4) W !!,"The primary billing task does not appear to be running."
  1. ;
  1. ; - okay to shut down these jobs?
  1. S DIR(0)="Y",DIR("A")="Are you sure you wish to shut down these jobs"
  1. S DIR("?",1)="Enter: 'Y' if you wish to shut down these jobs, or"
  1. S DIR("?")=" 'N' or '^' to quit this option."
  1. W ! D ^DIR
  1. I 'Y W !!,"The jobs will not be shut down." G STOPQ
  1. ;
  1. ; - set the 'shutdown filer' flag
  1. S $P(^IBE(350.9,1,9),"^",10)=1
  1. ;
  1. W !!,"The TRICARE Billing and AWP Update engines will be shut down."
  1. ;
  1. STOPQ K DIR,DUOUT,DTOUT,DIROUT,X,Y
  1. Q
  1. ;
  1. ;
  1. PAR ; Retrieve the required engine parameters.
  1. N X,Y,ZTSK
  1. S X=$G(^IBE(350.9,1,9))
  1. S IBBPORT=$P(X,"^")
  1. I IBBPORT="" S IBERR(1)="The Billing transaction port has not been defined."
  1. S IBAPORT=$P(X,"^",2)
  1. S IBCHAN=$P(X,"^",3)
  1. I IBCHAN="" S IBERR(2)="The TCP/IP address has not been defined."
  1. S ZTSK=$P(X,"^",4)
  1. I ZTSK D
  1. .D STAT^%ZTLOAD
  1. .I ZTSK(1)=2 S IBERR(3)="This job appears to be running! Check task #"_ZTSK_"." Q
  1. .S $P(^IBE(350.9,1,9),"^",4)=""
  1. S IBCHSET=+$P(X,"^",12)
  1. 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."
  1. S IBPRESCR=$P(X,"^",13)
  1. I IBPRESCR="" S IBERR(5)="You must enter your Prescriber ID before this task can be started."
  1. S IBVOL=$P(X,"^",11)
  1. Q