source: WorldVistAEHR/trunk/r/ZZREGIONAL-A1C-A5C-CRHD-RGED-RGUT-RGWB-RG/RGUTUSR.m@ 836

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

initial load of WorldVistAEHR

File size: 1.7 KB
Line 
1RGUTUSR ;CAIRO/DKM - Parse recipient list;04-Sep-1998 11:26;DKM
2 ;;2.1;RUN TIME LIBRARY;;Mar 22, 1999
3 ;=================================================================
4 ; Takes a list of recipients (which may be DUZ #'s, names,
5 ; mail groups, or special tokens) as input and produces an
6 ; array of DUZ's as output. If a list element is found in
7 ; in the token list RGLST, the value of the token entry will
8 ; be substituted.
9 ; Inputs:
10 ; RGUSR = Semicolon-delimited list of recipients
11 ; RGLST = Special token list
12 ; Outputs:
13 ; RGOUT = Local array to receive DUZ list
14 ;=================================================================
15ENTRY(RGUSR,RGOUT,RGLST) ;
16 N RGZ,RGZ1,RGZ2
17 K RGOUT
18 F RGZ=1:1:$L(RGUSR,";") S RGZ1=$P(RGUSR,";",RGZ) D:RGZ1'="" S:RGZ1 RGOUT(+RGZ1)=""
19 .S:$D(RGLST(RGZ1)) RGZ1=RGLST(RGZ1)
20 .Q:RGZ1?.N
21 .I RGZ1?1"-"1.N D MGRP(-RGZ1) S RGZ1=0 Q
22 .S RGZ2=$E(RGZ1,1,2)
23 .I RGZ2="G." D MGRP($E(RGZ1,3,999)) Q
24 .I RGZ2="L." D LIST($E(RGZ1,3,999)) Q
25 .S RGZ1=$$LKP(RGZ1)
26 Q
27LKP(RGNAME) ;
28 N RGZ,RGZ1
29 I $D(^VA(200,"B",RGNAME)) S RGZ=RGNAME G L1
30 S RGZ=$O(^(RGNAME)),RGZ1=$O(^(RGZ))
31 Q:(RGZ="")!(RGNAME'=$E(RGZ,1,$L(RGNAME))) 0
32 Q:(RGZ1'="")&(RGNAME=$E(RGZ1,1,$L(RGNAME))) 0
33L1 S RGZ1=$O(^(RGZ,0)),RGZ=$O(^(RGZ1))
34 Q:'RGZ1!RGZ 0
35 Q RGZ1
36LIST(RGLIST) ;
37 Q:RGLIST=""
38 S:RGLIST'=+RGLIST RGLIST=+$O(^RGCDSS(993.6,"B",RGLIST,0))
39 S @$$TRAP^RGZOSF("LERR^RGUTUSR")
40 X:$D(^RGCDSS(993.6,RGLIST,1)) ^(1)
41LERR Q
42MGRP(RGMGRP) ;
43 N RGX
44 S RGX(0)=""
45 D MGRP2(RGMGRP)
46 Q
47MGRP2(RGMGRP) ;
48 N RGZ,RGZ1
49 Q:RGMGRP=""
50 S:RGMGRP'=+RGMGRP RGMGRP=+$O(^XMB(3.8,"B",RGMGRP,0))
51 Q:$D(RGX(RGMGRP))
52 S RGX(RGMGRP)=""
53 F RGZ=0:0 S RGZ=+$O(^XMB(3.8,RGMGRP,1,RGZ)) Q:'RGZ S RGOUT(+^(RGZ,0))=""
54 F RGZ=0:0 S RGZ=+$O(^XMB(3.8,RGMGRP,5,RGZ)) Q:'RGZ D MGRP2(^(RGZ,0))
55 Q
Note: See TracBrowser for help on using the repository browser.