source: WorldVistAEHR/trunk/r/MAILMAN-XM/XMRPCTS1.m@ 648

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

initial load of WorldVistAEHR

File size: 3.9 KB
Line 
1XMRPCTS1 ;(KC-VAMC)/XXX-Simple PCTS front end to MailMan ;02/06/99 10:32
2 ;;8.0;MailMan;;Jun 28, 2002
3 N XMUS,XMFM,XMSTR,XMRI,XMTO,XMABORT
4 ;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
5 ;All should be sent to XXX@VHA.DMIA the local PCTS Domain
6 ;Edit these for your site.
7 S XMUS="XXXX" ;Local routing indicator
8 S XMFM="YYYY" ;from line
9 I XMUS="XXXX"!(XMFM="YYYY") S %="FIX Routing codes !!!"_XMPCTS0("ERR")
10 ;-------------------------------------------------------------
11 S XMABORT=0
12 D INIT(.XMDUZ,XMUS,.XMSTR,.XMRI,.XMTO,.XMABORT) Q:XMABORT
13 D CRE8XMZ^XMXSEND("Local PCTS Transmission.",.XMZ,1) I XMZ<1 S XMABORT=1 Q
14 D EDITON^XMJMS(XMDUZ,XMZ)
15 D PROCESS(XMDUZ,XMSTR,XMFM,XMRI,XMTO,.XMZ,.XMABORT)
16 D EDITOFF^XMJMS(XMDUZ)
17 Q:'XMABORT
18 W !!,"TWIX Send aborted !",$C(7)
19 H 2
20 D KILLMSG^XMXUTIL(XMZ)
21 Q
22INIT(XMDUZ,XMUS,XMSTR,XMRI,XMTO,XMABORT) ;
23 N XMSEQ
24 I '$D(DUZ)#2 D Q
25 . W !!,"DUZ not defined..."
26 . S XMABORT=1
27 D EN^XM
28 W !!,"Create PCTS/AMS message.",!
29 ;Making this the pseudo-sequence number - meaningless.
30 S XMSEQ=$P(^XMB(3.9,0),U,3),XMSEQ=$$RJ^XLFSTR($E(XMSEQ,$L(XMSEQ)-3,99),4,"0")
31 ;Build the Header
32 S XMSTR="PAAUIJAZ "_XMUS_XMSEQ_" "_$$JD^XMRPCTS0_"-UUUU--"
33 D RI(.XMRI,.XMABORT) Q:XMABORT
34 D TO(.XMTO,.XMABORT)
35 Q
36RI(XMRI,XMABORT) ;
37 N DIR,DIRUT,Y,X,DTOUT,DUOUT
38 S DIR(0)="FO^3:30^K X'?1UP.UP X"
39 S DIR("A")="Destination RI"
40 S DIR("?")="Enter the Destination Routing Indicator, like RUCHJBO."
41 D ^DIR I $D(DTOUT)!$D(DUOUT) S XMABORT=1 Q
42 I Y="" S Y="<RI>" W "<blank>"
43 S XMRI=Y
44 S:$E(XMRI,$L(XMRI))'="." XMRI=XMRI_"."
45 Q
46TO(XMTO,XMABORT) ;
47 N DIR,DIRUT,Y,X,DTOUT,DUOUT
48 S DIR(0)="F^3:60"
49 S DIR("A")="Destination TO line"
50 S DIR("?")="Enter the content of the TO line of the message."
51 D ^DIR I $D(DTOUT)!$D(DUOUT) S XMABORT=1 Q
52 S XMTO=Y
53 Q
54PROCESS(XMDUZ,XMSTR,XMFM,XMRI,XMTO,XMZ,XMABORT) ;
55 N I,%,XMTEXT,XMINSTR,XMRESTR
56 S %="ZNR UUUUU"
57 F I="RUCH","RUEV","RUWL","RUGS" I XMRI[I S %="VADM"
58 S I=0
59 S I=I+1,XMTEXT(I)=XMSTR_XMRI ;header line
60 S I=I+1,XMTEXT(I)=%
61 S I=I+1,XMTEXT(I)="FM "_XMFM ;from line
62 S I=I+1,XMTEXT(I)="TO "_XMTO ;to line
63 S I=I+1,XMTEXT(I)="BT"
64 S I=I+1,XMTEXT(I)=""
65 S I=I+1,XMTEXT(I)="<text>"
66 S I=I+1,XMTEXT(I)=""
67 S I=I+1,XMTEXT(I)="BT"
68 S I=I+1,XMTEXT(I)=""
69 S I=I+1,XMTEXT(I)="NNNN"
70 D MOVEBODY^XMXSEND(XMZ,"XMTEXT")
71 D E Q:XMABORT
72 D INIT^XMXADDR
73 D READY(XMDUZ,.XMINSTR,.XMRESTR,.XMABORT) Q:XMABORT
74 W !,"You may add recipients to this message."
75 D TOWHOM^XMJMT(XMDUZ,"Send",.XMINSTR,.XMRESTR,.XMABORT)
76 D:'XMABORT XMIT(XMDUZ,XMZ,.XMINSTR,.XMABORT)
77 D CLEANUP^XMXADDR
78 Q
79XMIT(XMDUZ,XMZ,XMINSTR,XMABORT) ;
80 N DIR,Y,X,DIRUT,XMFINISH
81 S XMFINISH=0
82 F D Q:XMFINISH!XMABORT
83 . S DIR(0)="SAM^E:Edit Text;T:Transmit now"
84 . S DIR("A")="Select Message option: "
85 . S DIR("B")="Transmit now"
86 . S DIR("??")="^D Q^XMRPCTS1"
87 . D ^DIR I $D(DIRUT) S XMABORT=1 Q
88 . D @Y
89 Q
90E ; Edit Text
91 F D BODY^XMJMS(XMDUZ,XMZ,.XMRESTR,.XMABORT) Q:XMABORT!$$NCHECK(XMZ)
92 Q
93NCHECK(XMZ) ; If "NNNN" found in text, issue error
94 N NCNT,I
95 S (NCNT,I)=0
96 F S I=$O(^XMB(3.9,XMZ,2,I)) Q:'I I ^XMB(3.9,XMZ,2,I,0)["NNNN" S NCNT=NCNT+1
97 Q:NCNT'>1 1
98 W !!,"<< 4 CONSECUTIVE N's ARE NOT ALLOWED IN THE MSG TEXT !!! >>",!!,$C(7)
99 H 5
100 Q 0
101T ; Transmit
102 S XMFINISH=1
103 D BLDNSND^XMXSEND(XMDUZ,XMZ,.XMINSTR)
104 Q
105Q W !,"Answer: ",!
106 W !,"T (or just return) to PERMANENTLY transmit the message."
107 W !,"E to Edit the text of the message."
108 W !,"'^' to cancel the message."
109 Q
110READY(XMDUZ,XMINSTR,XMRESTR,XMABORT) ;
111 N DIR,DIRUT,Y
112 S DIR(0)="Y"
113 S DIR("A")="Ready to send to the Austin AMS System"
114 S DIR("?",1)="'YES' will place the message in the queue for transmission through the AMS System."
115 S DIR("?")="'NO' will place the message only in your IN basket."
116 D ^DIR I $D(DIRUT) S XMABORT=1 Q
117 Q:'Y
118 W !,"Send to: XXX@VHA.DMIA"
119 D ADDR^XMXADDR(XMDUZ,"XXX@VHA.DMIA",.XMINSTR,.XMRESTR)
120 Q
121EXIT ;
122 K I,XMTO,XMFM,XMSTR,XMUS,XMTM,XMRI,DIC,XCNP,XMXUSEC,ZTPAR,XMSEQ,XMOUT,DTOUT
123 K ^TMP("XMY",$J),^TMP("XMY0",$J)
124 Q
Note: See TracBrowser for help on using the repository browser.