source: cprs/branches/tmg-cprs/m_files/TMGRPC3.m@ 1531

Last change on this file since 1531 was 894, checked in by Kevin Toppenberg, 14 years ago

interval update

File size: 10.2 KB
Line 
1TMGRPC3 ;TMG/kst/RPC Functions for GUI_Config ;07/20/08, 7/7/10
2 ;;1.0;TMG-LIB;**1**;08/31/08
3 ;
4 ;"TMG RPC FUNCTIONS for a GUI config program
5 ;
6 ;"Kevin Toppenberg MD
7 ;"GNU Lessor General Public License (LGPL) applies
8 ;"7/20/08
9 ;
10 ;"=======================================================================
11 ;" RPC -- Public Functions.
12 ;"=======================================================================
13 ;"CHANNEL(TMGRESULT,INPUT) -- general purpose channel RPC from a GUI config program
14 ;
15 ;"=======================================================================
16 ;"Dependencies:
17 ;" TMGRPC3* only
18 ;
19 ;"=======================================================================
20 ;
21CHANNEL(TMGRESULT,INPUT) ;
22 ;"Purpose: This will be a general purpose channel RPC from a GUI config program
23 ;"Input: TMGRESULT -- this is an OUT parameter, and it is always passed by reference
24 ;" INPUT -- this will be array of data sent from the GUI client. Defined below:
25 ;" <Stuff will go here>
26 ;" INPUT("REQUEST")="cmd^params" Valid values for "cmd" are:
27 ;" "GET USER LIST"
28 ;" params: <empty> or NODISUSER
29 ;" "GET RECORDS LIST" -- get list of all .01 fields for file.
30 ;" params: FileNumber (e.g. 'GET RECORDS LIST^8989.3')
31 ;" "GET ONE USER"
32 ;" params: IEN (e.g. 'GET ONE USER^12345')
33 ;" "GET ONE RECORD"
34 ;" params: FileNum^IENS (e.g. 'GET ONE RECORD^200^73,')
35 ;" "GET ONE WP FIELD"
36 ;" params: FileNum^Field^IENS^ (e.g. 'GET ONE WP FIELD^200^2^73,')
37 ;" "FILE ENTRY SUBSET"
38 ;" params: FileNum^ListStartValue^direction^MaxCount(optional, def=44)
39 ;" "GET SUB RECS LIST" -- get all .01 sub record entries for a subfile
40 ;" params: SubFileNum^ParentIENS
41 ;" "POST DATA"
42 ;" params: (not used)
43 ;" INPUT(0)=FileNum^IENS^FieldNum^FieldName^newValue^oldValue
44 ;" INPUT(1)=FileNum^IENS^FieldNum^FieldName^newValue^oldValue
45 ;" ... (note: FieldName and oldValue are not used)
46 ;" "POST WP FIELD"
47 ;" params: FileNum^FieldNum^IENS (e.g. 'POST WP FIELD^200^2^73,')
48 ;" WP field itself is stored as follows:
49 ;" INPUT(0)=0TH line
50 ;" INPUT(1)=1st line
51 ;" INPUT(2)=2nd line
52 ;" ...
53 ;" Note: don't include INPUT("REQUEST") with text.
54 ;" "GET EMPTY ENTRY" -- getting stub entries for subfiles typically
55 ;" params: file entry (file or subfile number)
56 ;" "GET CURRENT USER NAME" -- return name of DUZ (current) user
57 ;" (params: not used)
58 ;" "CLONE USER"
59 ;" params: SourceIENS^New.01Value
60 ;" "CLONE RECORD"
61 ;" params: FileNum^SourceIENS^New.01Value
62 ;" "GET HELP MSG"
63 ;" params : FileNum^FieldNum^HelpType^IENS
64 ;" "IS WP FIELD"
65 ;" params: FileNum^FieldNum
66 ;" "GET ONE WP FIELD" -- retrieve on word processing (WP) field entry
67 ;" param -- FileNum^Field^IENS (e.g. 'GET ONE WP FIELD^200^2^73,')
68 ;" "REGISTER PATIENT"
69 ;" param -- FieldNum1^FieldValue1^FieldNum2^FieldValue2^FieldNum3^FieldValue3^...
70 ;"Output: results of this function should be put into TMGRESULTS array.
71 ;" For cmd:
72 ;" "GET USER LIST"
73 ;" TMGRESULT(0)="1^Success" or "-1^Message"
74 ;" TMGRESULT(1)=Name^IEN^200^DISUSER DISUSER will be 1 for "Y" or 0 for "N"
75 ;" TMGRESULT(2)=Name^IEN^200^DISUSER
76 ;" etc ...
77 ;" "GET RECORDS LIST"
78 ;" TMGRESULT(0)="1^Success" or "-1^Message"
79 ;" TMGRESULT(1)=.01Value^IEN^FileNum
80 ;" TMGRESULT(2)=.01Value^IEN^FileNum
81 ;" etc ...
82 ;" "GET ONE USER"
83 ;" TMGRESULT(0)="1^Success" or "-1^Message"
84 ;" TMGRESULT(1)=File^IENS^FieldNum^ExternalValue^DDInfo...
85 ;" TMGRESULT(2)=File^IENS^FieldNum^ExternalValue^DDInfo...
86 ;" etc ...
87 ;" "GET ONE RECORD"
88 ;" TMGRESULT(0)="1^Success" or "-1^Message"
89 ;" TMGRESULT(1)=File^IENS^FieldNum^ExternalValue^DDInfo...
90 ;" TMGRESULT(2)=File^IENS^FieldNum^ExternalValue^DDInfo...
91 ;" ...
92 ;" "GET ONE WP FIELD"
93 ;" TMGRESULT(0): "1^Success" or "-1^Message"
94 ;" TMGRESULT(1) will contain Fileman error, if any
95 ;" - or to return WP array -
96 ;" TMGRESULT(1)=1st line of text
97 ;" TMGRESULT(2)=2nd line of text
98 ;" etc..
99 ;" "FILE ENTRY SUBSET"
100 ;" TMGRESULT(0)="1^Success" or "-1^Message"
101 ;" TMGRESULT(1)=Value
102 ;" TMGRESULT(2)=Value
103 ;" etc ...
104 ;" "GET SUB RECS LIST"
105 ;" TMGRESULT(0)="1^Success" or "-1^Message"
106 ;" TMGRESULT(1)=IEN^Value
107 ;" TMGRESULT(2)=IEN^Value
108 ;" ...
109 ;" "POST DATA"
110 ;" TMGRESULT(0)="1^Success" or "-1^Message"
111 ;" TMGRESULT(1)=Fileman message (long) (if generated)
112 ;" -or (if +1 etc values used)-
113 ;" TMGRESULT(1)=+5^1234 <-- results of IEN array returned (+5 converted to record 1234)
114 ;" TMGRESULT(2)=+3^2341 <-- results of IEN array returned (+3 converted to record 2341)
115 ;" ...
116 ;" "GET EMPTY ENTRY"
117 ;" TMGRESULT(0)="1^Success" or "-1^Message"
118 ;" TMGRESULT(1)=File^^FieldNum^^DDInfo...
119 ;" TMGRESULT(2)=File^^FieldNum^^DDInfo...
120 ;" etc ...
121 ;" "GET CURRENT USER NAME" -- return name of DUZ (current) user
122 ;" TMGRESULT(0)="1^Success^UserName" or "-1^Message"
123 ;" "CLONE USER"
124 ;" TMGRESULT(0)="1^Success^NewIENS" or "-1^Message"
125 ;" TMGRESULT(1)=Long Fileman message (if -1 error)
126 ;" "CLONE RECORD"
127 ;" TMGRESULT(0)="1^Success^NewIENS" or "-1^Message"
128 ;" TMGRESULT(1)=Fileman message (long) (if generated)
129 ;" "GET HELP MSG"
130 ;" TMGRESULT(0)="1^Success^NewIENS" or "-1^Message"
131 ;" TMGRESULT(1)=Fileman message (long) (if generated)
132 ;" "IS WP FIELD"
133 ;" TMGRESULT(0)="1^Success^YES/NO" or "-1^Message"
134 ;" "YES" if is a WP subfile, otherwise "NO"
135 ;" TMGRESULT(1)=Fileman message (long) (if generated)
136 ;" "REGISTER PATIENT"
137 ;" TMGRESULT(0)="1^Success^NewIEN" or
138 ;" "-1^Message" Frank failure... or
139 ;" "0^BoolAndMessage^NewIEN". Format:
140 ;" [Bool1;Bool2;Bool3;Bool4;Bool5*MessageText] (e.g. '1;0;1;0;0*ErrorMsg')
141 ;" (for Bool fields, 0=no or 1=yes)
142 ;" Bool1 -- patient had previously been registered
143 ;" Bool2 -- patient registered during this Fn
144 ;" Bool3 -- problem filing data into non-identifier fields
145 ;" Bool4 -- problem filing data into sub-file fields
146 ;" Bool5 -- problem with filing HRN
147 ;" TMGRESULT(1)=Long Fileman message (if -1 error, or perhaps 0 code)
148
149 ;
150 ;"Result: none
151 ;
152 NEW TMGCOMMAND,TMGCOMMAND
153 SET TMGCOMMAND=$$TRIM^XLFSTR($$UP^XLFSTR($PIECE($GET(INPUT("REQUEST")),"^",1)))
154 SET TMGPARAMS=$$UP^XLFSTR($PIECE($GET(INPUT("REQUEST")),"^",2,199))
155 SET TMGRESULT(0)="-1^No command requested." ;"default to error state.
156 IF TMGCOMMAND="GET USER LIST" DO
157 . DO GETUSRLT^TMGRPC3B(.TMGRESULT,TMGPARAMS)
158 IF TMGCOMMAND="GET RECORDS LIST" DO
159 . DO GETRECLT^TMGRPC3B(.TMGRESULT,TMGPARAMS)
160 ELSE IF TMGCOMMAND="GET ONE USER" DO
161 . DO GET1USER^TMGRPC3B(.TMGRESULT,TMGPARAMS)
162 ELSE IF TMGCOMMAND="GET ONE RECORD" DO
163 . DO GET1REC^TMGRPC3B(.TMGRESULT,TMGPARAMS)
164 ELSE IF TMGCOMMAND="FILE ENTRY SUBSET" DO
165 . DO GFLSUBST^TMGRPC3B(.TMGRESULT,TMGPARAMS)
166 ELSE IF TMGCOMMAND="GET SUB RECS LIST" DO
167 . DO GETSRLST^TMGRPC3D(.TMGRESULT,TMGPARAMS)
168 ELSE IF TMGCOMMAND="POST DATA" DO
169 . KILL INPUT("REQUEST")
170 . DO POSTDATA^TMGRPC3C(.TMGRESULT,.INPUT)
171 ELSE IF TMGCOMMAND="GET EMPTY ENTRY" DO
172 . DO GETEMPTY^TMGRPC3E(.TMGRESULT,TMGPARAMS)
173 ELSE IF TMGCOMMAND="GET CURRENT USER NAME" DO
174 . SET TMGRESULT(0)="1^Success^"_$PIECE($GET(^VA(200,DUZ,0)),"^",1)
175 ELSE IF TMGCOMMAND="CLONE RECORD" DO
176 . DO CLONEREC^TMGRPC3D(.TMGRESULT,TMGPARAMS)
177 ELSE IF TMGCOMMAND="CLONE USER" DO
178 . DO CLONEUSR^TMGRPC3D(.TMGRESULT,TMGPARAMS)
179 ELSE IF TMGCOMMAND="GET HELP MSG" DO
180 . DO GETHELPM^TMGRPC3E(.TMGRESULT,TMGPARAMS)
181 ELSE IF TMGCOMMAND="IS WP FIELD" DO
182 . DO GETIFWP^TMGRPC3E(.TMGRESULT,TMGPARAMS)
183 ELSE IF TMGCOMMAND="GET ONE WP FIELD" DO
184 . DO GETWPFLD^TMGRPC3E(.TMGRESULT,TMGPARAMS)
185 ELSE IF TMGCOMMAND="POST WP FIELD" DO
186 . KILL INPUT("REQUEST")
187 . DO PSTWPFLD^TMGRPC3E(.TMGRESULT,TMGPARAMS,.INPUT)
188 ELSE IF TMGCOMMAND="REGISTER PATIENT" DO
189 . DO REGPAT^TMGRPC3F(.TMGRESULT,TMGPARAMS)
190 ;
191 ;
192 QUIT
193 ;
Note: See TracBrowser for help on using the repository browser.