source: WorldVistAEHR/trunk/r/BAR_CODE_MED_ADMIN-ALPB-PSB/PSBRPCXM.m@ 703

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

initial load of WorldVistAEHR

File size: 1.3 KB
Line 
1PSBRPCXM ;BIRMINGHAM/EFC-VISTA MAILMAN INTERFACE ;Mar 2004
2 ;;3.0;BAR CODE MED ADMIN;;Mar 2004
3 ;
4RPC(RESULTS,PSBCMD,PSBDATA) ; Main RPC point
5 S RESULTS=$NA(^TMP("PSBMSG",$J)),^TMP("PSBMSG",$J,0)="-1^Unknown Error"
6 I PSBCMD="CREATE" K ^TMP("PSBMAIL",$J) S ^TMP($J,0)="1^Message '"_$J_"' created."
7 D:PSBCMD="APPEND"
8 .I $G(PSBDATA)]"" S Y=$O(^TMP("PSBMAIL",$J,"TEXT",""),-1)+1,^TMP("PSBMAIL",$J,"TEXT",Y,0)=PSBDATA
9 .S X="PSBDATA"
10 .F S X=$Q(@X) Q:X="" S Y=$O(^TMP("PSBMAIL",$J,"TEXT",""),-1)+1,^TMP("PSBMAIL",$J,"TEXT",Y,0)=@X
11 .S Y=+$O(^TMP("PSBMAIL",$J,"TEXT",""),-1)
12 .S ^TMP("PSBMAIL",$J,"TEXT",0)="^^"_Y
13 .S ^TMP($J,0)="1^Text appended."
14 I PSBCMD="SUBJECT" S ^TMP("PSBMAIL",$J,"SUBJECT")=PSBDATA,^TMP($J,0)="1^Message subject set to '"_PSBDATA_"'"
15 D:PSBCMD="SENDTO"
16 .I $G(PSBDATA)]"" S Y=$O(^TMP("PSBMAIL",$J,"SENDTO",""),-1)+1,^TMP("PSBMAIL",$J,"SENDTO",Y)=PSBDATA
17 .S X="PSBDATA"
18 .F S X=$Q(@X) Q:X="" S Y=$O(^TMP("PSBMAIL",$J,"SENDTO",""),-1)+1,^TMP("PSBMAIL",$J,"SENDTO",Y)=@X
19 .S ^TMP($J,0)="1^Recipients Added."
20 D:PSBCMD="EXECUTE"
21 .S XMSUB=$G(^TMP("PSBMAIL",$J,"SUBJECT"),"No subject")
22 .S XMTEXT="^TMP(""PSBMAIL"",$J,""TEXT"","
23 .F X=0:0 S X=$O(^TMP("PSBMAIL",$J,"SENDTO",X)) Q:'X S XMY(^(X))=""
24 .D ^XMD
25 .S ^TMP($J,0)="1^Message Sent. ID: "_+$G(XMZ)
26 Q
27 ;
Note: See TracBrowser for help on using the repository browser.