source: WorldVistAEHR/trunk/r/NOIS-FSC/FSCRPCEC.m@ 1744

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

initial load of WorldVistAEHR

File size: 4.1 KB
Line 
1FSCRPCEC ;SLC/STAFF-NOIS RPC Edit Call ;9/6/98 21:56
2 ;;1.1;NOIS;;Sep 06, 1998
3 ;
4EDIT(IN,OUT) ; from FSCRPX (RPCEditCall)
5 N CALL,EDITED,FIELDS K FIELDS
6 K ^TMP("FSC WP",$J)
7 D PROCESS^FSCRPCNC(.FIELDS)
8 S CALL=+$G(FIELDS("CALL"))
9 I 'CALL Q
10 I $O(^TMP("FSCRPC",$J,"INPUT",1)) D
11 .D FIELDS(CALL,.FIELDS,.EDITED)
12 .I EDITED D MRE^FSCMR(DUZ,CALL),UPDATE^FSCAUDIT(CALL)
13 S ^TMP("FSCRPC",$J,"OUTPUT",1)=CALL_U_$$SHORT^FSCRPXUS(CALL,DUZ)
14 K ^TMP("FSC WP",$J)
15 Q
16 ;
17FIELDS(CALL,FIELDS,EDITED) ; from FSCRPCEN
18 N DR,OK,STATUS,WOLDV,WNEWV K WOLDV,WNEWV
19 S EDITED=0
20 I $O(^TMP("FSC WP",$J,"DESC",0)) D
21 .D DESC^FSCRPCNC(CALL)
22 .S WOLDV("DESC")=1,WNEWV("DESC")=2
23 .D DESC^FSCAUDIT(CALL,.WOLDV,.WNEWV) ; forces audit update
24 D NOTE^FSCRPCNC(CALL)
25 S DR=""
26 I $L($G(FIELDS("SUBJECT"))) S DR=DR_";1///"_$$FIX(FIELDS("SUBJECT"))
27 I $D(FIELDS("SUBJECT")),FIELDS("SUBJECT")="" S DR=DR_";1///@"
28 I $L($G(FIELDS("PHONE"))) S DR=DR_";2.2///"_$$FIX(FIELDS("PHONE"))
29 I $D(FIELDS("PHONE")),FIELDS("PHONE")="" S DR=DR_";2.2///@"
30 I $L($G(FIELDS("PATCH"))) S DR=DR_";7///"_$$FIX(FIELDS("PATCH"))
31 I $D(FIELDS("PATCH")),FIELDS("PATCH")="" S DR=DR_";7///@"
32 I $L($G(FIELDS("KEYWORDS"))) S DR=DR_";1.5///"_$$FIX(FIELDS("KEYWORDS"))
33 I $D(FIELDS("KEYWORDS")),FIELDS("KEYWORDS")="" S DR=DR_";1.5///@"
34 I $L(DR)>100 D SETUP(CALL,"^FSCD(""CALL"",",.DR,.EDITED)
35 I $G(FIELDS("MOD")) S DR=DR_";3///`"_+FIELDS("MOD")
36 I $D(FIELDS("MOD")),FIELDS("MOD")="" S DR=DR_";3///@"
37 I $G(FIELDS("IRM")) S DR=DR_";2.1///`"_+FIELDS("IRM")
38 I $D(FIELDS("IRM")),FIELDS("IRM")="" S DR=DR_";2.1///@"
39 I $G(FIELDS("PRI")) S DR=DR_";6///`"_+FIELDS("PRI")
40 I $D(FIELDS("PRI")),FIELDS("PRI")="" S DR=DR_";6///@"
41 I $G(FIELDS("SPEC")) S DR=DR_";5///`"_+FIELDS("SPEC")
42 I $D(FIELDS("SPEC")),FIELDS("SPEC")="" S DR=DR_";5///@"
43 I $G(FIELDS("SPECD")) S DR=DR_";5.1///`"_+FIELDS("SPECD")
44 I $D(FIELDS("SPECD")),FIELDS("SPECD")="" S DR=DR_";5.1///@"
45 I $G(FIELDS("DEVSUB")) S DR=DR_";3.2///`"_+FIELDS("DEVSUB")
46 I $D(FIELDS("DEVSUB")),FIELDS("DEVSUB")="" S DR=DR_";3.2///@"
47 D SETUP(CALL,"^FSCD(""CALL"",",.DR,.EDITED)
48 S STATUS=+$G(FIELDS("STATUS"))
49 I STATUS=2 D I 'OK Q
50 .S OK=1
51 .S DR="81///`"_DUZ
52 .I $G(FIELDS("FUNC")) S DR=DR_";8///`"_+FIELDS("FUNC")
53 .I $G(FIELDS("TASK")) S DR=DR_";9///`"_+FIELDS("TASK")
54 .I $L($G(FIELDS("DATEC"))) S DR=DR_";82///"_FIELDS("DATEC")
55 .I $L(DR) D I 'OK Q
56 ..N DA,DIE,X,Y
57 ..I $E(DR)=";" S DR=$E(DR,2,245)
58 ..S DA=CALL,DIE="^FSCD(""CALL"","
59 ..L +^FSCD("CALL",DA):30 I '$T S OK=0 Q ; *** needs ok
60 ..D ^DIE
61 ..L -^FSCD("CALL",DA)
62 ..D PICKUP^FSCES(DA)
63 ..S DR=""
64 .D RES^FSCRPCNC(CALL)
65 D STATUS(CALL,STATUS,.EDITED)
66 Q
67 ;
68FIX(VALUE) ; $$(input) -> correct for invalid characters
69 N NEWVALUE
70 S NEWVALUE=$TR(VALUE,";""^","~~~")
71 I $E(NEWVALUE)="-" S NEWVALUE="~"_$E(NEWVALUE,2,245)
72 I VALUE="?" S NEWVALUE="@"
73 Q NEWVALUE
74 ;
75SETUP(DA,DIE,DR,EDITED) ; from FSCRPCEF
76 N ABBREV,CALLNUM,NEWV,OLDV,X,Y K NEWV,OLDV
77 S CALLNUM=DA
78 I '$L(DR),$O(^TMP("FSC WP",$J,"NOTE",0)) D Q
79 .D UPDATE^FSCTASK(CALLNUM) S EDITED=1
80 I '$L(DR) Q
81 I $E(DR)=";" S DR=$E(DR,2,245)
82 F ABBREV="SUBJECT","IRM","PHONE","MOD","SPEC","SPECD","PRI","PATCH","DEVSUB","KEYWORDS" S OLDV(ABBREV)=""
83 D GET^FSCGET("CUSTOM",CALLNUM,.OLDV)
84 L +^FSCD("CALL",DA):30 I '$T Q ; *** needs ok
85 D ^DIE
86 L -^FSCD("CALL",DA)
87 D PICKUP^FSCES(DA)
88 M NEWV=OLDV D GET^FSCGET("CUSTOM",CALLNUM,.NEWV)
89 D AUDIT^FSCAUDIT(CALLNUM,.OLDV,.NEWV)
90 D UPDATE^FSCTASK(CALLNUM) S EDITED=1
91 S DR=""
92 Q
93 ;
94STATUS(CALL,STATUS,EDITED) ; from FSCRPCEF
95 I 'STATUS Q
96 N PREVSTAT
97 S PREVSTAT=+$P(^FSCD("CALL",+CALL,0),U,17)
98 I PREVSTAT<2 S PREVSTAT=+$P(^FSCD("CALL",+CALL,0),U,2)
99 I PREVSTAT=0 D Q
100 .D STATUS^FSCES(CALL,"",1)
101 .D UPDATE^FSCTASK(CALL) S EDITED=1
102 .I STATUS'=1 D
103 ..D STATUS^FSCES(CALL,1,STATUS)
104 ..D UPDATE^FSCTASK(CALL) S EDITED=1
105 I STATUS,PREVSTAT=STATUS Q
106 D STATUS^FSCES(CALL,PREVSTAT,STATUS)
107 D UPDATE^FSCTASK(CALL) S EDITED=1
108 Q
109 ;
110REOPEN(IN,OUT) ; from FSCRPX (RPCReopenCall)
111 N CALL,OLDSTAT
112 S CALL=+$G(^TMP("FSCRPC",$J,"INPUT",1))
113 I 'CALL Q
114 S OLDSTAT=+$P($G(^FSCD("CALL",CALL,0)),U,2)
115 I '(OLDSTAT=2!(OLDSTAT=99)) Q
116 D STATUS^FSCES(CALL,OLDSTAT,1,1)
117 D UPDATE^FSCTASK(CALL)
118 D MRE^FSCMR(DUZ,CALL)
119 D UPDATE^FSCAUDIT(CALL)
120 S ^TMP("FSCRPC",$J,"OUTPUT",1)=CALL_U_$$SHORT^FSCRPXUS(CALL,DUZ)
121 Q
Note: See TracBrowser for help on using the repository browser.