source: FOIAVistA/trunk/r/CMOP-PSX/PSXSTRT.m@ 1722

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

initial load of FOIAVistA 6/30/08 version

File size: 3.4 KB
Line 
1PSXSTRT ;BIR/BAB-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 I $P($G(^PSX(553,1,0)),"^")["LEAVENWORTH" G QUE^PSXYSTRT
21 K PSXONE
22 I $G(^PSX(553,1,"P"))="R" W !!,"INTERFACE CANNOT BE STARTED WHILE LABELS ARE PRINTING!......TRY LATER." Q
23 L +^PSX(553,1,"S"):30 I '$T W !!,"The CMOP Interface file is in use, try later." Q
24 I $P(^PSX(553,1,"S"),"^",1)="R" W !!,"INTERFACE is already RUNNING, or PURGE is in progress!" Q
25 ;G ALL
26ASK S DIR(0)="SM^A:All Transmissions Queued;S:Single Transmission;P:Prioritize Queue;Q:Query Request",DIR("??")="^D HELP^PSXSTRT",DIR("B")="A" D ^DIR K DIR G:$G(DTOUT)!($G(DUOUT)) EXIT G:"Aa"[X ALL G:"Pp"[X ^PSXQUE G:"Qq"[X QUERY
27ONE K DIRUT,DUOUT,DTOUT,DIROUT,Y,X
28 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)))"
29 D ^DIC K DIC S TRAN=+Y,PSXONE=$G(X) I Y'>0!($D(DTOUT))!($D(DUOUT)) K PSXIN G EXIT
30 K DUOUT,DTOUT,Y
31 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
32 S ZTSAVE("PSXONE")=""
33 K DIR,DIRUT,DUOUT,DTOUT,DIROUT,Y,X,TRAN
34ALL S ^PSX(553,1,"S")="R",PSXIN=1
35 L -^PSX(553,1,"S")
36 U IO(0) W !!,?10,"*** Interface STARTED ***"
37 S ZTIO="CMOP",ZTRTN="START^PSXSTRT",ZTDTH=$H,ZTREQ="@"
38 S ZTDESC="CMOP Interface"
39 D ^%ZTLOAD
40EXIT 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
41 G:$G(PSXIN)>0 ^PSXHSYS
42 Q
43QUERY D NOW^%DTC S XZ=$P(^PSX(553.1,0),"^",3),INT=$P(^PSX(553,1,0),"^",9) S:$G(INT)'>0 INT=1
44 I $G(XZ) S LQRYTM=$P(^PSX(553.1,XZ,0),"^",2) S NEXT=$$FMADD^XLFDT(LQRYTM,0,$G(INT),0,0) I %'>NEXT S WAIT=$$FMDIFF^XLFDT(NEXT,%,2) W !!,"Another query can not be initiated for ",($G(WAIT)\60)," minutes." G EXIT
45 S PSXQRY=1,ZTSAVE("PSXQRY")="",PSXQRYA=1,ZTSAVE("PSXQRYA")="" G ALL
46 Q
47HELP 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."
48 W !!,"S - Single Transmission. Only sends the transmission selected to the vendor.",!,"The interface will stop when the transmission download has completed."
49 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."
50 W !!,"Q - Query Request. Allows the user to initiate a query request. Once the query",!,"request is complete the interface stops."
51 Q
Note: See TracBrowser for help on using the repository browser.