source: WorldVistAEHR/trunk/r/NOIS-FSC/FSCRPCEF.m@ 619

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

initial load of WorldVistAEHR

File size: 4.1 KB
Line 
1FSCRPCEF ;SLC/STAFF-NOIS RPC Edit Fields ;6/13/98 14:46
2 ;;1.1;NOIS;;Sep 06, 1998
3 ;
4FIELDS(CALL,FIELDS,EDITED) ; from FSCRPCEB
5 N CDATE,CSTATUS,DR,KEYWORDS,OK,ONETWO,REOPEN,STATUS,WOLDV,WNEWV,ZERO K WOLDV,WNEWV
6 S ZERO=^FSCD("CALL",CALL,0),ONETWO=$G(^(120))
7 S CSTATUS=+$P(ZERO,U,2)
8 S REOPEN=+$G(FIELDS("REOPEN"))
9 I 'REOPEN,(CSTATUS=2)!(CSTATUS=99) Q
10 I REOPEN D
11 .I CSTATUS=2 Q
12 .I CSTATUS=99 Q
13 .S REOPEN=0
14 I $O(^TMP("FSC WP",$J,"DESC",0)) D
15 .D REOPEN(CALL,.REOPEN,.EDITED)
16 .D DESC^FSCRPCNC(CALL)
17 .S WOLDV("DESC")=1,WNEWV("DESC")=2
18 .D DESC^FSCAUDIT(CALL,.WOLDV,.WNEWV) ; forces audit update
19 .S EDITED=1
20 I $O(^TMP("FSC WP",$J,"NOTE",0)) D
21 .D REOPEN(CALL,.REOPEN,.EDITED)
22 .D NOTE^FSCRPCNC(CALL)
23 .S EDITED=1
24 S DR=""
25 I $D(FIELDS("SUBJECT")) D
26 .S SUBJECT=$G(^FSCD("CALL",CALL,1))
27 .I FIELDS("SUBJECT")=SUBJECT Q
28 .S EDITED=1
29 .I $L(FIELDS("SUBJECT")) S DR=DR_";1///"_FIELDS("SUBJECT") Q
30 .S DR=DR_";1///@"
31 I $D(FIELDS("PHONE")) D
32 .S PHONE=$P(ZERO,U,7)
33 .I FIELDS("PHONE")=PHONE Q
34 .S EDITED=1
35 .I $L(FIELDS("PHONE")) S DR=DR_";2.2///"_FIELDS("PHONE") Q
36 .S DR=DR_";2.2///@"
37 I $D(FIELDS("PATCH")) D
38 .S PATCH=$P(ONETWO,U,14)
39 .I FIELDS("PATCH")=PATCH Q
40 .S EDITED=1
41 .I $L(FIELDS("PATCH")) S DR=DR_";7///"_FIELDS("PATCH") Q
42 .S DR=DR_";7///@"
43 I $D(FIELDS("KEYWORDS")) D
44 .S KEYWORDS=$P($G(^FSCD("CALL",CALL,1.5)),U)
45 .I FIELDS("KEYWORDS")=KEYWORDS Q
46 .I $L(FIELDS("KEYWORDS")),KEYWORDS[FIELDS("KEYWORDS") Q
47 .S EDITED=1
48 .I '$L(FIELDS("KEYWORDS")) S DR=DR_";1.5///@" Q
49 .I $L(KEYWORDS),$G(FIELDS("APPENDKEY")) S DR=DR_";1.5///"_$E(KEYWORDS_", "_FIELDS("KEYWORDS"),1,60) Q
50 .S DR=DR_";1.5///"_FIELDS("KEYWORDS")
51 I $L(DR)>100 D
52 .D REOPEN(CALL,.REOPEN,.EDITED)
53 .D SETUP^FSCRPCEC(CALL,"^FSCD(""CALL"",",.DR,.EDITED)
54 I $D(FIELDS("MOD")) D
55 .S MOD=$P(ZERO,U,8)
56 .I MOD=FIELDS("MOD") Q
57 .S EDITED=1
58 .I '$D(FIELDS("DEVSUB")) D
59 ..I $P(ONETWO,U,9)=$P($G(^FSC("MOD",+FIELDS("MOD"),0)),U,8) Q
60 ..S DR=DR_";3.2///@"
61 .I FIELDS("MOD") S DR=DR_";3///`"_+FIELDS("MOD") Q
62 .S DR=DR_";3///@"
63 I $D(FIELDS("IRM")) D
64 .S IRM=$P(ZERO,U,6)
65 .I IRM=FIELDS("IRM") Q
66 .S EDITED=1
67 .I FIELDS("IRM") S DR=DR_";2.1///`"_+FIELDS("IRM") Q
68 .S DR=DR_";2.1///@"
69 I $D(FIELDS("PRI")) D
70 .S PRI=$P(ZERO,U,10)
71 .I PRI=FIELDS("PRI") Q
72 .S EDITED=1
73 .I FIELDS("PRI") S DR=DR_";6///`"_+FIELDS("PRI") Q
74 .S DR=DR_";6///@"
75 I $D(FIELDS("SPEC")) D
76 .S SPEC=$P(ZERO,U,9)
77 .I SPEC=FIELDS("SPEC") Q
78 .S EDITED=1
79 .I FIELDS("SPEC") S DR=DR_";5///`"_+FIELDS("SPEC") Q
80 .S DR=DR_";5///@"
81 I $D(FIELDS("SPECD")) D
82 .S SPECD=$P(ZERO,U,21)
83 .I SPECD=FIELDS("SPECD") Q
84 .S EDITED=1
85 .I FIELDS("SPECD") S DR=DR_";5.1///`"_+FIELDS("SPECD") Q
86 .S DR=DR_";5.1///@"
87 I $D(FIELDS("DEVSUB")) D
88 .S DEVSUB=$P(ONETWO,U,11)
89 .I DEVSUB=FIELDS("DEVSUB") Q
90 .S EDITED=1
91 .I FIELDS("DEVSUB") S DR=DR_";3.2///`"_+FIELDS("DEVSUB") Q
92 .S DR=DR_";3.2///@"
93 I $L(DR) D
94 .D REOPEN(CALL,.REOPEN,.EDITED)
95 .D SETUP^FSCRPCEC(CALL,"^FSCD(""CALL"",",.DR,.EDITED)
96 S STATUS=+$G(FIELDS("STATUS"))
97 S ZERO=^FSCD("CALL",CALL,0)
98 S CSTATUS=+$P(ZERO,U,17)
99 I CSTATUS<2 S CSTATUS=+$P(ZERO,U,2)
100 I STATUS=CSTATUS Q
101 I STATUS,(CSTATUS=2)!(CSTATUS=99) D
102 .D REOPEN(CALL,.REOPEN,.EDITED)
103 .S ZERO=^FSCD("CALL",CALL,0)
104 .S CSTATUS=+$P(ZERO,U,17)
105 .I CSTATUS<2 S CSTATUS=+$P(ZERO,U,2)
106 I STATUS=CSTATUS Q
107 I $P($G(^FSC("STATUS",STATUS,0)),U,2)="D",CSTATUS'=3,$P($G(^FSC("STATUS",CSTATUS,0)),U,2)'="D" D
108 .D STATUS^FSCRPCEC(CALL,3,.EDITED)
109 I STATUS=2 D I 'OK Q
110 .S OK=1
111 .S DR="81///`"_DUZ
112 .I $G(FIELDS("FUNC")) S DR=DR_";8///`"_+FIELDS("FUNC")
113 .I $G(FIELDS("TASK")) S DR=DR_";9///`"_+FIELDS("TASK")
114 .S CDATE=$G(FIELDS("DATEC"))
115 .I 'CDATE S CDATE=DT
116 .I CDATE<$P($G(^FSCD("CALL",CALL,120)),U,4) S CDATE=$P($G(^(120)),U,4)\1
117 .S DR=DR_";82///"_CDATE
118 .I $L(DR) D I 'OK Q
119 ..N DA,DIE,X,Y
120 ..I $E(DR)=";" S DR=$E(DR,2,245)
121 ..S DA=CALL,DIE="^FSCD(""CALL"","
122 ..L +^FSCD("CALL",DA):30 I '$T S OK=0 Q ; *** needs ok
123 ..D ^DIE
124 ..L -^FSCD("CALL",DA)
125 ..D PICKUP^FSCES(DA)
126 ..S DR=""
127 .D RES^FSCRPCNC(CALL)
128 I STATUS D STATUS^FSCRPCEC(CALL,STATUS,.EDITED)
129 Q
130 ;
131REOPEN(CALL,REOPEN,EDITED) ;
132 I 'REOPEN Q
133 S REOPEN=0,EDITED=1
134 S OLDSTAT=+$P(^FSCD("CALL",CALL,0),U,2)
135 I '(OLDSTAT=2!(OLDSTAT=99)) Q
136 D STATUS^FSCES(CALL,OLDSTAT,1,1)
137 D UPDATE^FSCTASK(CALL)
138 Q
Note: See TracBrowser for help on using the repository browser.