source: WorldVistAEHR/trunk/r/CMOP-PSX/PSXYSTRT.m@ 1005

Last change on this file since 1005 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 2.9 KB
Line 
1PSXYSTRT ;BIR/HTW-Dual Start Interface ;[ 03/10/99 11:08 AM ]
2 ;;2.0;CMOP;**17**;11 Apr 97
3START ;Start here when queued
4 S:'$D(^PSX(553,1,"X",0)) ^PSX(553,1,"X",0)="^553.01DA^^"
5 S TERM=13,SOH=1,STX=2,ETB=23,ETX=3,EOT=4,ENQ=5,NAK=21,ACK=16
6 S PSXABORT=0,ZCNT=1 D NOW^%DTC S XCNT=% K %
7 D SETPAR,PURG G STRT^PSXJOB
8SETPAR ;Set parameters (TIMERS,LINE BID,RETRIES)
9 S PSXPAR0=$G(^PSX(553,1,0)),PSXPART=$G(^PSX(553,1,"T"))
10 S PSXDLTA=$P(PSXPART,"^"),PSXDLTB=$P(PSXPART,"^",2)
11 S PSXDLTD=$P(PSXPART,"^",3),PSXDLTE=$P(PSXPART,"^",4)
12 S PSXTRYM=$P(PSXPAR0,"^",6),PSXTRYL=$P(PSXPAR0,"^",5)
13 S PSXVNDR=$S(^PSX(553,1,0)["MURF":1,^PSX(553,1,0)["HIN":2,^PSX(553,1,0)["CHAR":2,1:0)
14 Q
15PURG ;Purge CMOP log file
16 S PSXPURG=0 F PSXCNT=1:1 S PSXPURG=$O(^PSX(553,1,"X",PSXPURG)) Q:'PSXPURG I PSXCNT>1000 S DA=PSXPURG,DA(1)=1,DIK="^PSX(553,"_DA(1)_",""X""," D ^DIK
17 K PSXCNT,PSXPURG,DA,DIK
18 Q
19QUE ;Entry point to queue interface background job
20 K PSXONE
21 I $G(^PSX(553,1,"P"))="R" W !!,"INTERFACE CANNOT BE STARTED WHILE LABELS ARE PRINTING!......TRY LATER." Q
22 ;L +^PSX(553,1,"S"):30 I '$T W !!,"The CMOP Interface file is in use, try later." Q
23 ;I $P(^PSX(553,1,"S"),"^",1)="R" W !!,"INTERFACE is already RUNNING, or PURGE is in progress!" Q
24 ;G ALL
25ASK S DIR(0)="SM^A:All Transmissions Queued;S:Single Transmission;P:Prioritize Queue",DIR("??")="^D HELP^PSXYSTRT",DIR("B")="A" D ^DIR K DIR G:$G(DTOUT)!($G(DUOUT)) EXIT G:"Aa"[X ALL G:"Pp"[X ^PSXQUE
26ONE K DIRUT,DUOUT,DTOUT,DIROUT,Y,X
27 S DIC(0)="AEOX",DIC("A")="Enter Transmission Number: ",DIC="^PSX(552.1,",DIC("S")="I $P(^PSX(552.1,+Y,0),U,4)>0&($P(^PSX(552.1,+Y,0),U,2)=""2""),($D(^PSX(552.1,""AQ"",$P(^PSX(552.1,+Y,0),U,4),X,+Y)))"
28 D ^DIC K DIC S TRAN=+Y,PSXONE=$G(X) I Y'>0!($D(DTOUT))!($D(DUOUT)) K PSXIN G EXIT
29 K DUOUT,DTOUT,Y
30 S DIR(0)="Y",DIR("A")="Download Transmission "_$G(X),DIR("B")="YES" D ^DIR K DIR I Y'>0!($G(DTOUT))!($D(DUOUT))!($D(DIROUT))!($D(DIRUT)) K PSXIN G EXIT
31 S ZTSAVE("PSXONE")=""
32 K DIR,DIRUT,DUOUT,DTOUT,DIROUT,Y,X,TRAN
33ALL S ^PSX(553,1,"S")="R",PSXIN=1
34 L -^PSX(553,1,"S")
35 U IO(0) W !!,?10,"*** Interface STARTED ***"
36 S ZTIO="CMOP",ZTRTN="START^PSXYSTRT",ZTDTH=$H,ZTREQ="@"
37 S ZTDESC="CMOP Interface"
38 D ^%ZTLOAD
39EXIT K ACK,ENQ,EOT,ETB,ETX,NAK,PSXABORT,PSXDLTA,PSXDLTB,PSXDLTD,PSXDLTE,LOG,PSXTME,PSXTMOUT,PSXTRASH,TRAN,PSXONE,DIR,DIRUT,DUOUT,DTOUT,DIROUT,X,Y,WAIT,INT,XZ,%,LQRYTM,NEXT,WAIT
40 G:$G(PSXIN)>0 ^PSXHSYS
41 Q
42HELP W !,"A - All Transmissions Queued. Sends all transmissions in the queue to the",!,"vendor. The interface will NOT stop after all transmissions have been sent to",!,"the vendor system."
43 W !!,"S - Single Transmission. Only sends the transmission selected to the vendor.",!,"The interface will stop when the transmission download has completed."
44 W !!,"P - Prioritize Queue. Allows the user to establish a priority for sending",!,"transmissions to the vendor. The interface will NOT stop after all transmissions",!,"have been sent to the vendor."
45 Q
Note: See TracBrowser for help on using the repository browser.