source: FOIAVistA/trunk/r/NOIS-FSC/FSCRPCOC.m@ 1688

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

initial load of FOIAVistA 6/30/08 version

File size: 4.2 KB
Line 
1FSCRPCOC ;SLC/STAFF-NOIS RPC Other Contacts ;6/3/98 11:00
2 ;;1.1;NOIS;;Sep 06, 1998
3 ;
4CONTACTS(IN,OUT) ; from FSCRPX (RPCCallContacts)
5 N CALL,CONTACT,CONTPH,CNT,DEVSP,MOD,NUM,PACK,PACKNAME,PIECE,SITE,SPEC,STINFO,STSITE,UNUM,USER,USERS K USERS
6 S CALL=+$G(^TMP("FSCRPC",$J,"INPUT",1))
7 I 'CALL S ^TMP("FSCRPC",$J,"OUTPUT",1)="no information" Q
8 S NUM=0
9 S SITE=$P(^FSCD("CALL",CALL,0),U,5),CONTACT=$P(^(0),U,6),CONTPH=$P(^(0),U,7),MOD=$P(^(0),U,8),SPEC=$P(^(0),U,9),DEVSP=$P(^(0),U,21)
10 I SPEC S NUM=NUM+1,^TMP("FSCRPC",$J,"OUTPUT",NUM)="Specialist: "_$$VALUE^FSCGET(SPEC,7100,5)_" "_$$PH(SPEC)
11 I DEVSP S NUM=NUM+1,^TMP("FSCRPC",$J,"OUTPUT",NUM)="Referred Specialist: "_$$VALUE^FSCGET(DEVSP,7100,5.1)_" "_$$PH(DEVSP)
12 S NUM=NUM+1,^TMP("FSCRPC",$J,"OUTPUT",NUM)=""
13 S NUM=NUM+1,^TMP("FSCRPC",$J,"OUTPUT",NUM)="Contact: "_$$VALUE^FSCGET(CONTACT,7100,2.1)_" "_CONTPH
14 S NUM=NUM+1,^TMP("FSCRPC",$J,"OUTPUT",NUM)="NOIS contact information for this location: "_$$NOISINFO(SITE)
15 I 'MOD Q
16 S PACK=+$P(^FSC("MOD",MOD,0),U,8),PACKNAME=$P($G(^FSC("PACK",PACK,0)),U)
17 I '$L(PACKNAME) Q
18 S STSITE=$$STSITE(SITE) I STSITE D
19 .S NUM=NUM+1,^TMP("FSCRPC",$J,"OUTPUT",NUM)=""
20 .S NUM=NUM+1,^TMP("FSCRPC",$J,"OUTPUT",NUM)="IRM Chief and phone: "_$$IRMINFO(STSITE)
21 .S NUM=NUM+1,^TMP("FSCRPC",$J,"OUTPUT",NUM)=PACKNAME_" ADPAC and phone: "_$$APINFO(STSITE,PACK)
22 .S NUM=NUM+1,^TMP("FSCRPC",$J,"OUTPUT",NUM)="Information on "_$P(^FSC("SITE",SITE,0),U)_":"
23 .S STINFO=$G(^NTS(2050,STSITE,1))
24 .F PIECE=1:1:3 S NUM=NUM+1,^TMP("FSCRPC",$J,"OUTPUT",NUM)=" "_$P(STINFO,U,PIECE)
25 .S NUM=NUM+1,^TMP("FSCRPC",$J,"OUTPUT",NUM)=", "_$$VALUE^FSCGET($P(STINFO,U,4),2050,7)_" "_$P(STINFO,U,5)
26 .S NUM=NUM+1,^TMP("FSCRPC",$J,"OUTPUT",NUM)=" FTS #: "_$P(STINFO,U,6)
27 .S NUM=NUM+1,^TMP("FSCRPC",$J,"OUTPUT",NUM)=" COMM #: "_$P(STINFO,U,7)
28 S NUM=NUM+1,^TMP("FSCRPC",$J,"OUTPUT",NUM)=""
29 S NUM=NUM+1,^TMP("FSCRPC",$J,"OUTPUT",NUM)="Those affiliated with "_PACKNAME_":"
30 D AFFIL(PACK,.USERS)
31 S CNT=16,USER="" F S USER=$O(USERS(USER)) Q:USER="" D
32 .S UNUM=0 F S UNUM=$O(USERS(USER,UNUM)) Q:UNUM<1 D
33 ..S NUM=NUM+1,^TMP("FSCRPC",$J,"OUTPUT",NUM)=USER_" "_USERS(USER,UNUM)
34 ..S CNT=CNT+1
35 Q
36 ;
37AFFIL(PACK,USERS) ;
38 N DUTIES,FUNC,PACKGP,USER,USERNAME K USERS
39 S PACKGP=+$P(^FSC("PACK",PACK,0),U,2)
40 S USER=0 F S USER=$O(^FSC("SPEC","AG",PACKGP,USER)) Q:USER<.1 D
41 .I '$$ACCESS^FSCU(USER,"SPEC") Q
42 .S USERNAME=$P(^VA(200,USER,0),U)
43 .I $P($G(^FSC("SPEC",USER,20,+$O(^FSC("SPEC","AG",PACKGP,USER,0)),0)),U,3) D
44 ..S DUTIES=$P($G(^FSC("SPEC",USER,20,+$O(^FSC("SPEC","AG",PACKGP,USER,0)),0)),U,2)
45 ..S FUNC=$$VALUE^FSCGET($P(^FSC("SPEC",USER,0),U,4),7105.2,4) I $L(FUNC) S FUNC="("_FUNC_")"
46 ..S USERS(USERNAME,USER)=FUNC_" "_DUTIES_" "_$$PH(USER)
47 S USER=0 F S USER=$O(^FSC("SPEC","AP",PACK,USER)) Q:USER<.1 D
48 .I '$$ACCESS^FSCU(USER,"SPEC") Q
49 .S USERNAME=$P(^VA(200,USER,0),U)
50 .S DUTIES=$P($G(^FSC("SPEC",USER,30,+$O(^FSC("SPEC","AP",PACK,USER,0)),0)),U,2)
51 .S FUNC=$$VALUE^FSCGET($P(^FSC("SPEC",USER,0),U,4),7105.2,4) I $L(FUNC) S FUNC="("_FUNC_")"
52 .S USERS(USERNAME,USER)=FUNC_" "_DUTIES_" "_$$PH(USER)
53 Q
54 ;
55NOISINFO(SITE) ; $$(site) -> contact & phone #
56 N INFO
57 S INFO=$P($G(^FSC("SITE",SITE,0)),U,6) I 'INFO Q ""
58 S INFO=$$VALUE^FSCGET(INFO,7100,2.1)
59 S INFO=INFO_" "_$S($L($P(^FSC("SITE",SITE,0),U,7)):$P(^(0),U,7),1:$P(^(0),U,8))
60 Q INFO
61 ;
62PH(PERSON) ; $$(person) -> phone # from file 200
63 Q $P($G(^VA(200,PERSON,.13)),U,2)
64 ;
65IRMINFO(STSITE) ; $$(site) -> irm chief & phone #
66 N INFO,IRM
67 S IRM=$G(^NTS(2050,STSITE,21))
68 S INFO=$P(IRM,U)_" "_$P(IRM,U,2) I $L(INFO)=2 Q ""
69 Q INFO
70 ;
71APINFO(STSITE,PACK) ; $$(site, pack) -> adpac & phone #
72 N ADPAC,INFO,STPACK
73 S STPACK=$$STPACK(PACK) I 'STPACK Q ""
74 S ADPAC=$G(^NTS(2050,STSITE,8,STPACK,0))
75 S INFO=$P(ADPAC,U,2)_" "_$P(ADPAC,U,3) I $L(INFO)=2 Q ""
76 Q INFO
77 ;
78STSITE(SITE) ; $$(site) -> site tracking site
79 N DOMAIN,STSITE
80 S DOMAIN=+$P(^FSC("SITE",SITE,0),U,14) I 'DOMAIN Q ""
81 S DOMAIN=$$VALUE^FSCGET(DOMAIN,7105.1,9)
82 S STSITE=+$O(^NTS(2050,"AE",DOMAIN,0)) I 'STSITE Q ""
83 Q STSITE
84 ;
85STPACK(PACK) ; $$(package) -> site tracking package
86 N OPACK,STPACK
87 I '$L(PACK) Q ""
88 S OPACK=+$P($G(^FSC("PACK",PACK,0)),U,3) I 'OPACK Q ""
89 S STPACK=+$O(^DIC(120102,"AP",OPACK,0)) I 'STPACK Q ""
90 Q STPACK
Note: See TracBrowser for help on using the repository browser.