PSXDUAL ;BIR/HTW - Host Interface Startup ;Compiled 1998-12-05 11:25AM for M/WNT [ 02/16/99 10:15 AM ]
;;2.0;CMOP;**17**;11 Apr 97
K PSXONE
S PSXQRY=$P($G(^PSX(553,1,"Q")),"^")
I (PSXQRY="S")!(PSXQRY="") W !,"The Query Interface is stopped!!",! G QUERY
I PSXQRY="R" W !,"The Query Interface is already running!!",!
S DIR("A")="Do you want to Stop the Query",DIR("B")="NO"
S DIR(0)="SB^Y:YES;N:NO",DIR("?")="The Query interface is running. Answer Yes to stop it."
D ^DIR K DIR G:$D(DIRUT) EXIT
K DIR I "Yy"[$E(Y) S ^PSX(553,1,"Q")="S" G EXIT
Q
QUERY S DIR("A")="Do you want to Start the Query",DIR("B")="YES"
S DIR(0)="SB^Y:YES;N:NO",DIR("?")="The Query interface is stopped. Answer Yes to start it."
D ^DIR K DIR G:$D(DIRUT) EXIT
I "Nn"[$E(Y) G EXIT
I "Yy"[$E(Y) S ^PSX(553,1,"Q")="R"
S ZTIO="CMOPQ",ZTRTN="EN^PSXDUAL",ZTDTH=$H,ZTDESC="CMOP Query" D ^%ZTLOAD
I $D(ZTSK) W !,"JOB QUEUED ",ZTSK
G EXIT
Q
EN S:'$D(^PSX(553,1,"X",0)) ^PSX(553,1,"X",0)="^553.01DA^^"
S TERM=13,SOH=1,STX=2,ETB=23,ETX=3,EOT=4,ENQ=5,NAK=21,ACK=16
S PSXABORT=0,ZCNT=1 D NOW^%DTC S XCNT=% K %
SETPAR ;Set parameters (TIMERS,LINE BID,RETRIES)
S PSXPAR0=$G(^PSX(553,1,0)),PSXPART=$G(^PSX(553,1,"T"))
S PSXDLTA=$P(PSXPART,"^"),PSXDLTB=$P(PSXPART,"^",2)
S PSXDLTD=$P(PSXPART,"^",3),PSXDLTE=$P(PSXPART,"^",4)
S PSXTRYM=$P(PSXPAR0,"^",6),PSXTRYL=$P(PSXPAR0,"^",5)
S PSXQRYA=1
;change PSXVNDR to be the vendor system name, change the set on the MSH,BHS,QRD to use this variable
S PSXVNDR=$S(^PSX(553,1,0)["MURF":2,^PSX(553,1,0)["HIN":2,^PSX(553,1,0)["CHAR":2,^PSX(553,1,0)["LEAV":1,1:0)
D FLUSH1^PSXUTL
G ^PSXYQRY
EXIT K PSXQRY Q
PSXDUAL ;BIR/HTW - Host Interface Startup ;Compiled 1998-12-05 11:25AM for M/WNT [ 02/16/99 10:15 AM ]
+1 ;;2.0;CMOP;**17**;11 Apr 97
+2 KILL PSXONE
+3 SET PSXQRY=$PIECE($GET(^PSX(553,1,"Q")),"^")
+4 IF (PSXQRY="S")!(PSXQRY="")
WRITE !,"The Query Interface is stopped!!",!
GOTO QUERY
+5 IF PSXQRY="R"
WRITE !,"The Query Interface is already running!!",!
+6 SET DIR("A")="Do you want to Stop the Query"
SET DIR("B")="NO"
+7 SET DIR(0)="SB^Y:YES;N:NO"
SET DIR("?")="The Query interface is running. Answer Yes to stop it."
+8 DO ^DIR
KILL DIR
IF $DATA(DIRUT)
GOTO EXIT
+9 KILL DIR
IF "Yy"[$EXTRACT(Y)
SET ^PSX(553,1,"Q")="S"
GOTO EXIT
+10 QUIT
QUERY SET DIR("A")="Do you want to Start the Query"
SET DIR("B")="YES"
+1 SET DIR(0)="SB^Y:YES;N:NO"
SET DIR("?")="The Query interface is stopped. Answer Yes to start it."
+2 DO ^DIR
KILL DIR
IF $DATA(DIRUT)
GOTO EXIT
+3 IF "Nn"[$EXTRACT(Y)
GOTO EXIT
+4 IF "Yy"[$EXTRACT(Y)
SET ^PSX(553,1,"Q")="R"
+5 SET ZTIO="CMOPQ"
SET ZTRTN="EN^PSXDUAL"
SET ZTDTH=$HOROLOG
SET ZTDESC="CMOP Query"
DO ^%ZTLOAD
+6 IF $DATA(ZTSK)
WRITE !,"JOB QUEUED ",ZTSK
+7 GOTO EXIT
+8 QUIT
EN IF '$DATA(^PSX(553,1,"X",0))
SET ^PSX(553,1,"X",0)="^553.01DA^^"
+1 SET TERM=13
SET SOH=1
SET STX=2
SET ETB=23
SET ETX=3
SET EOT=4
SET ENQ=5
SET NAK=21
SET ACK=16
+2 SET PSXABORT=0
SET ZCNT=1
DO NOW^%DTC
SET XCNT=%
KILL %
SETPAR ;Set parameters (TIMERS,LINE BID,RETRIES)
+1 SET PSXPAR0=$GET(^PSX(553,1,0))
SET PSXPART=$GET(^PSX(553,1,"T"))
+2 SET PSXDLTA=$PIECE(PSXPART,"^")
SET PSXDLTB=$PIECE(PSXPART,"^",2)
+3 SET PSXDLTD=$PIECE(PSXPART,"^",3)
SET PSXDLTE=$PIECE(PSXPART,"^",4)
+4 SET PSXTRYM=$PIECE(PSXPAR0,"^",6)
SET PSXTRYL=$PIECE(PSXPAR0,"^",5)
+5 SET PSXQRYA=1
+6 ;change PSXVNDR to be the vendor system name, change the set on the MSH,BHS,QRD to use this variable
+7 SET PSXVNDR=$SELECT(^PSX(553,1,0)["MURF":2,^PSX(553,1,0)["HIN":2,^PSX(553,1,0)["CHAR":2,^PSX(553,1,0)["LEAV":1,1:0)
+8 DO FLUSH1^PSXUTL
+9 GOTO ^PSXYQRY
EXIT KILL PSXQRY
QUIT