source: cprs/branches/tmg-cprs/m_files/TMGRPC4.m@ 1166

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

Initial upload

File size: 3.0 KB
Line 
1TMGRPC4 ;TMG/kst/RPC Functions for DxLink ;11/16/08
2 ;;1.0;TMG-LIB;**1**;11/16/08
3 ;
4 ;"TMG RPC FUNCTIONS for working with DxLink GUI application (for extracting
5 ;" PCE data, i.e. CPT codes, ICD9 codes etc.
6 ;
7 ;"Kevin Toppenberg MD
8 ;"GNU General Public License (GPL) applies
9 ;"11/16/08
10 ;"=======================================================================
11 ;" RPC -- Public Functions.
12 ;"=======================================================================
13 ;"CHANNEL(TMGRESULT,INPUT) -- general purpose channel RPC from a DxLink GUI program
14 ;
15 ;"=======================================================================
16 ;"Dependencies:
17 ;" ...
18 ;
19 ;"=======================================================================
20 ;
21CHANNEL(TMGRESULT,INPUT) ;
22 ;"Purpose: This will be a general purpose channel RPC from a DxLink 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 ;" "LOOKUP PATIENT"
28 ;" params: LNAME,FName^DOB^SequelPMSAccount#
29 ;" "ENSURE VISIT"
30 ;" params: DFN^Date@Time^DurationMins^Reason^Location^Provider^Comments
31 ;" "APPT LIST"
32 ;" params: Date^Location^Provider(Optional)
33 ;"Output: results of this function should be put into TMGRESULTS array.
34 ;" For cmd:
35 ;" "LOOKUP PATIENT"
36 ;" TMGRESULT(0)="1^Success" or "-1^Message"
37 ;" TMGRESULT(1)=DFN (or 0 if not found)
38 ;" "ENSURE VISIT"
39 ;" TMGRESULT(0)="1^Success" or "-1^Message"
40 ;" TMGRESULT(1)=IEN or (or 0 if not found)
41 ;" "APPT LIST"
42 ;" TMGRESULT(0)="1^Success" or "-1^Message"
43 ;" TMGRESULT(1)=0 if not found
44 ;" TMGRESULT(1)=DateTime^PatientName^DFN^DOB^SeqHRN^Location(Sequel ShortName)^CPTList^ICD9List
45 ;" CPTList format: 'Code#|CodeName;Code#|CodeName;Code#|CodeName...;'
46 ;" ICD9List format: 'Code#|CodeName;Code#|CodeName;Code#|CodeName...;'
47 ;"Result: none
48 ;
49 NEW TMGCOMMAND,TMGCOMMAND
50 SET TMGCOMMAND=$$TRIM^XLFSTR($$UP^XLFSTR($PIECE($GET(INPUT("REQUEST")),"^",1)))
51 SET TMGPARAMS=$$UP^XLFSTR($PIECE($GET(INPUT("REQUEST")),"^",2,199))
52 SET TMGRESULT(0)="-1^No valid command requested: '"_TMGCOMMAND_"'" ;"default to error state.
53 IF TMGCOMMAND="LOOKUP PATIENT" DO
54 . DO LOOKUPAT^TMGRPC4B(.TMGRESULT,TMGPARAMS)
55 ELSE IF TMGCOMMAND="ENSURE VISIT" DO
56 . DO ENSURVST^TMGRPC4B(.TMGRESULT,TMGPARAMS)
57 ELSE IF TMGCOMMAND="APPT LIST" DO
58 . DO APPTLST^TMGRPC4B(.TMGRESULT,TMGPARAMS)
59 ;
60 QUIT
61 ;
Note: See TracBrowser for help on using the repository browser.