source: WorldVistAEHR/trunk/r/NOIS-FSC/FSCRPCPF.m@ 1005

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

initial load of WorldVistAEHR

File size: 2.9 KB
Line 
1FSCRPCPF ;SLC/STAFF-NOIS RPC Personal Fields ;5/18/98 15:42
2 ;;1.1;NOIS;;Sep 06, 1998
3 ;
4SAVE(IN,OUT) ; from FSCRPX (RPCSavePersonalFields)
5 N CALL,CNT,DA,DIE,DIK,DR,LINE,LONG,NUM,NUMBER,OK,SHORT,X,Y
6 S CALL=$G(^TMP("FSCRPC",$J,"INPUT",1)),SHORT=$G(^(2)),NUMBER=$G(^(3)),LONG=$G(^(4))
7 S CALL=$P(CALL,"CALL^",2)
8 I 'CALL Q
9 S SHORT=$P(SHORT,"SHORT^",2)
10 S NUMBER=$P(NUMBER,"NUMBER^",2)
11 S LONG=$P(LONG,"LONG^",2)
12 S DA=+$G(^FSCD("CALL USER","AUC",DUZ,CALL))
13 I DA D
14 .I '$L(SHORT) S SHORT="@"
15 .I 'NUMBER S NUMBER="@"
16 .I '$L(LONG) S LONG="@"
17 .S DR="2///"_$$FIX^FSCRPCEC(SHORT)_";3///"_NUMBER_";4///"_$$FIX^FSCRPCEC(LONG)
18 .S DIE="^FSCD(""CALL USER"","
19 .D ^DIE
20 E D
21 .L +^FSCD("CALL USER",0):5 I '$T Q
22 .S DA=1+$P(^FSCD("CALL USER",0),U,3)
23 .F Q:'$D(^FSCD("CALL USER",DA,0)) S DA=DA+1
24 .S $P(^FSCD("CALL USER",0),U,3)=DA,$P(^(0),U,4)=$P(^(0),U,4)+1
25 .S ^FSCD("CALL USER",DA,0)=CALL_U_DUZ_U_SHORT_U_NUMBER
26 .I $L(LONG) S ^FSCD("CALL USER",DA,1)=LONG
27 .L -^FSCD("CALL USER",0)
28 .S DIK="^FSCD(""CALL USER"","
29 .D IX1^DIK
30 D MRE^FSCMR(DUZ,CALL)
31 I $G(^TMP("FSCRPC",$J,"INPUT",5))'="{NOTE}" Q
32 K ^FSCD("CALL USER",DA,2)
33 S CNT=0
34 S NUM=5 F S NUM=$O(^TMP("FSCRPC",$J,"INPUT",NUM)) Q:NUM<1 S LINE=^(NUM) Q:LINE="{{{}}}" D
35 .S CNT=CNT+1
36 .S ^FSCD("CALL USER",DA,2,CNT,0)=LINE
37 I CNT S ^FSCD("CALL USER",DA,2,0)="^^"_CNT_U_CNT_U_DT_U
38 S OK=1 D
39 .Q:$L($P(^FSCD("CALL USER",DA,0),U,3)) Q:$L($P(^(0),U,4)) Q:$L($G(^(1))) Q:$O(^(2,0))
40 .S OK=0
41 I 'OK D DEL^FSCUCD("^FSCD(""CALL USER"",",DA)
42 Q
43 ;
44GET(IN,OUT) ; from FSCRPX (RPCGetPersonalFields)
45 N CALL,CNT,IEN,LINE,LONG,NUM,NUMBER,SHORT
46 S CALL=+$G(^TMP("FSCRPC",$J,"INPUT",1))
47 S IEN=+$G(^FSCD("CALL USER","AUC",DUZ,CALL))
48 I 'IEN Q
49 S ZERO=$G(^FSCD("CALL USER",IEN,0))
50 S SHORT=$P(ZERO,U,3)
51 S NUMBER=$P(ZERO,U,4)
52 S LONG=$G(^FSCD("CALL USER",IEN,1))
53 S ^TMP("FSCRPC",$J,"OUTPUT",1)="SHORT^"_SHORT
54 S ^TMP("FSCRPC",$J,"OUTPUT",2)="NUMBER^"_NUMBER
55 S ^TMP("FSCRPC",$J,"OUTPUT",3)="LONG^"_LONG
56 S CNT=3
57 S NUM=0 F S NUM=$O(^FSCD("CALL USER",IEN,2,NUM)) Q:NUM<1 S LINE=$G(^(NUM,0)) D
58 .S CNT=CNT+1
59 .S ^TMP("FSCRPC",$J,"OUTPUT",CNT)=LINE
60 Q
61 ;
62CALL(IN,OUT) ; from FSCRPX (RPCCallPersonal)
63 N CALL,CNT,IEN,LINE,LONG,NUM,NUMBER,SHORT
64 S CALL=+$G(^TMP("FSCRPC",$J,"INPUT",1))
65 S CALLID=$P($G(^FSCD("CALL",CALL,0)),U)
66 S IEN=+$G(^FSCD("CALL USER","AUC",DUZ,CALL))
67 I 'IEN D Q
68 .S ^TMP("FSCRPC",$J,"OUTPUT",1)="No information in personal fields for "_CALLID_"."
69 S ^TMP("FSCRPC",$J,"OUTPUT",1)="Personal Fields for "_CALLID_":"
70 S ZERO=$G(^FSCD("CALL USER",IEN,0))
71 S SHORT=$P(ZERO,U,3)
72 S NUMBER=$P(ZERO,U,4)
73 S LONG=$G(^FSCD("CALL USER",IEN,1))
74 S ^TMP("FSCRPC",$J,"OUTPUT",2)="Short Text: "_SHORT
75 S ^TMP("FSCRPC",$J,"OUTPUT",3)="Number: "_NUMBER
76 S ^TMP("FSCRPC",$J,"OUTPUT",4)="Long Text: "_LONG
77 S ^TMP("FSCRPC",$J,"OUTPUT",5)="Note:"
78 S CNT=5
79 S NUM=0 F S NUM=$O(^FSCD("CALL USER",IEN,2,NUM)) Q:NUM<1 S LINE=$G(^(NUM,0)) D
80 .S CNT=CNT+1
81 .S ^TMP("FSCRPC",$J,"OUTPUT",CNT)=LINE
Note: See TracBrowser for help on using the repository browser.