source: FOIAVistA/trunk/r/NOIS-FSC/FSCRPCUD.m@ 1250

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

initial load of FOIAVistA 6/30/08 version

File size: 2.5 KB
Line 
1FSCRPCUD ;SLC/STAFF-NOIS RPC User Defaults ;4/16/98 15:18
2 ;;1.1;NOIS;;Sep 06, 1998
3 ;
4USER(IN,OUT) ; from FSCRPX (RPCUserDefaults)
5 N USER
6 S USER=+$G(^TMP("FSCRPC",$J,"INPUT",1))
7 I 'USER Q
8 S ^TMP("FSCRPC",$J,"OUTPUT",1)=USER_U_$P($G(^VA(200,+USER,0)),U)
9 Q
10 ;
11DUZ(IN,OUT) ; from FSCRPX (RPCCurrentUser)
12 N PFUNC,PMOD,PPRI,PSPEC,PTASK,SPEC,PREF,NAME,PHONE
13 S (PFUNC,PMOD,PPRI,PSPEC,PTASK)=0
14 S SPEC=$$ACCESS^FSCU(DUZ,"SPEC")
15 S PPRI=+$O(^FSC("PRI","B","ROUTINE",0))
16 S NAME=$P($G(^VA(200,+DUZ,0)),U),PHONE=$P($G(^(.13)),U,2)
17 I SPEC D
18 .S PREF=$$FUNC^FSCEUD(DUZ) I $P(PREF,U)'="I" D
19 ..I $L($P(PREF,U,2)) S PFUNC=+$O(^FSC("FUNC","B",$P(PREF,U,2),0))
20 .S PREF=$$TASK^FSCEUD(DUZ) I $P(PREF,U)'="I" D
21 ..I $L($P(PREF,U,2)) S PTASK=+$O(^FSC("TASK","B",$P(PREF,U,2),0))
22 .S PREF=$$PRIORITY^FSCEUD(DUZ) I $P(PREF,U)'="I" D
23 ..I $L($P(PREF,U,2)) S PPRI=+$O(^FSC("PRI","B",$P(PREF,U,2),0))
24 .S PREF=$$MOD^FSCEUD(DUZ) I $P(PREF,U)'="I" D
25 ..I $L($P(PREF,U,2)) S PMOD=+$O(^FSC("MOD","B",$P(PREF,U,2),0))
26 .S PREF=$$SPEC^FSCEUD(DUZ) I $P(PREF,U)'="I" D
27 ..S PSPEC=DUZ
28 S ^TMP("FSCRPC",$J,"OUTPUT",1)=DUZ_U_NAME_U_SPEC_U_PFUNC_U_PPRI_U_PSPEC_U_PTASK_U_PMOD_U_PHONE
29 Q
30 ;
31DUZTEMP(IN,OUT) ; from FSCRPX (RPCUserTempFiles)
32 N CNT,NUM,ZERO
33 S CNT=0
34 S NUM=0 F S NUM=$O(^FSC("LIST","C",DUZ,NUM)) Q:NUM<1 S ZERO=$G(^FSC("LIST",NUM,0)) I $L(ZERO) D
35 .I $P(ZERO,U,3)'="S" Q
36 .S CNT=CNT+1
37 .S ^TMP("FSCRPC",$J,"OUTPUT",CNT)=NUM_U_ZERO
38 Q
39 ;
40NEWTEMP(IN,OUT) ; from FSCRPX (RPCNewTempList)
41 N CNT,DA,DIC,DIE,DLAYGO,DR,LISTNAME,NEWNAME,X,Y K DIC,DLAYGO
42 S LISTNAME="TEMP-"_$P($P(^VA(200,DUZ,0),U),",")
43 S LISTNAME=$E(LISTNAME,1,28)
44 S NEWNAME=LISTNAME
45 S CNT=0
46 F Q:'$O(^FSC("LIST","B",NEWNAME,0)) S CNT=CNT+1,NEWNAME=LISTNAME_CNT
47 S (DIC,DLAYGO)=7107.1,DIC(0)="XL",X=NEWNAME
48 D ^DIC K DIC,DLAYGO
49 I '$P(Y,U,3) Q
50 S DA=+Y,DIE=7107.1,DR="1///`"_DUZ_";2///S"
51 D ^DIE
52 S ^TMP("FSCRPC",$J,"OUTPUT",1)=DA_U_^FSC("LIST",DA,0)
53 Q
54 ;
55CONTACT(IN,OUT) ; from FSCRPX (RPCContact)
56 N CONTACT,PHONE,SITE
57 S SITE=+$G(^TMP("FSCRPC",$J,"INPUT",1))
58 S CONTACT=+$P($G(^FSC("SITE",SITE,0)),U,6)
59 S PHONE=$$PH(SITE,CONTACT)
60 I 'CONTACT,'$L(PHONE) Q
61 S ^TMP("FSCRPC",$J,"OUTPUT",1)=CONTACT_U_PHONE
62 Q
63 ;
64PHONE(IN,OUT) ; from FSCRPX (RPCPhone)
65 N PHONE,SITE,USER
66 S SITE=$P($G(^TMP("FSCRPC",$J,"INPUT",1)),U),USER=$P($G(^(1)),U,2)
67 S PHONE=$$PH(SITE,USER)
68 S ^TMP("FSCRPC",$J,"OUTPUT",1)=PHONE
69 Q
70 ;
71PH(SITE,USER) ; $$(site,user) -> phone #
72 N PHONE S PHONE=""
73 I USER S PHONE=$P($G(^VA(200,USER,.13)),U,2)
74 I $L(PHONE) Q PHONE
75 I 'SITE Q ""
76 S PHONE=$P($G(^FSC("SITE",SITE,0)),U,7)
77 I $L(PHONE) Q PHONE
78 Q $P($G(^FSC("SITE",SITE,0)),U,8)
Note: See TracBrowser for help on using the repository browser.