source: cprs/branches/tmg-cprs/m_files/TMGRPC1B.m@ 809

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

Initial upload

File size: 3.2 KB
Line 
1TMGRPC1B ;TMG/kst-RPC Functions ;3/28/10
2 ;;1.0;TMG-LIB;**1**;3/28/10
3 ;
4 ;"TMG RPC FUNCTIONS
5 ;
6 ;"Copyright Kevin Toppenberg MD
7 ;"Released under GNU General Public License (GPL)
8 ;"
9 ;"=======================================================================
10 ;" RPC -- Public Functions.
11 ;"=======================================================================
12 ;"EVALTIUO
13 ;"INSTALL -- Add the RPC's to the OPTION record OR CPRS GUI CHART
14 ;"=======================================================================
15 ;"PRIVATE API FUNCTIONS
16 ;"=======================================================================
17 ;"INSTALL1(RPCNAME) -- Add 1 RPC to the OPTION record OR CPRS GUI CHART
18 ;
19 ;"=======================================================================
20 ;"=======================================================================
21 ;"Dependencies:
22 ;" DIC, TMGDEBUG
23 ;"=======================================================================
24 ;"=======================================================================
25 ;
26 ;"OK TO DELETE THIS FUNCTION LATER IF WANTED....
27EVALTIUO(TMGY,TMGOBJNM) ;"--- DEPRECIATED. Will use 'TIU TEMPLATE GETTEXT' RPC instead
28 ;"Purpose: To return the resolved text of a TIU Text Object.
29 ;"Input: TIUY -- This is output result for RPC caller
30 ;" TMGOBJNM -- This is the name of the TIU TEXT OBJECT to obtain.
31 ;"Note: lines wrapped at 200 chars length
32 ;"Results : none
33 ;
34 KILL ^TMG("TMP","TABLE")
35 zshow "*":^TMG("TMP","TABLE")
36 NEW TMGSTR
37 SET TMGOBJNM=$GET(TMGOBJNM)
38 IF TMGOBJNM["|" DO GOTO STOR
39 . SET TMGSTR="Passed TEXT OBJECT name should not contain '|' character"
40 SET TMGSTR="|"_TMGOBJNM_"|"
41 SET TMGSTR=$$BOIL^TIUSRVD(TMGSTR) ;" Execute Boilerplates
42 ;
43STOR NEW REF SET REF=$NAME(^TMP("TMG OBJ EVAL",$J))
44 NEW IDX SET IDX=0
45 KILL @REF
46 SET TMGY=REF
47 FOR DO QUIT:(TMGSTR="")
48 . NEW SA,SB
49 . SET (SA,SB)=""
50 . IF $LENGTH(TMGSTR)>200 DO
51 . . SET SB=$EXTRACT(TMGSTR,201,999)
52 . . SET TMGSTR=$EXTRACT(TMGSTR,1,200)
53 . SET IDX=IDX+1
54 . SET @REF@(IDX)=TMGSTR
55 . SET TMGSTR=SB
56 QUIT
57 ;
58 ;
59INSTALL ;
60 ;"Purpose: to add the RPC's to the OPTION record OR CPRS GUI CHART
61 DO INSTALL1("TMG EVAL TIU TEXT OBJECT")
62 QUIT
63 ;
64INSTALL1(RPCNAME) ;
65 ;"Purpose: to add 1 RPC to the OPTION record OR CPRS GUI CHART
66 NEW DIC,X,Y,DA
67 SET DIC="^DIC(19,",DIC(0)="M"
68 SET X="OR CPRS GUI CHART"
69 DO ^DIC
70 IF +Y'>0 DO QUIT
71 . WRITE "ERROR. Unable to find [OR CPRS GUI CHART] in file OPTION (#19)",!
72 . NEW TEMP READ "Press [ENTER] to continue...",TEMP:($GET(DTIME,3600))
73 . WRITE !
74 SET DA(1)=+Y
75 SET DIC=DIC_DA(1)_",""RPC"","
76 SET DIC(0)="ML" ;"LAYGO --> add entry if not found
77 SET X=RPCNAME
78 DO ^DIC
79 IF +Y'>0 DO
80 . WRITE "ERROR. Unable to add or find "_RPCNAME_" for subfile RPC in record",!
81 . WRITE "OR CPRS GUI CHART in file OPTION (#19)",!
82 . NEW TEMP READ "Press [ENTER] to continue...",TEMP:($GET(DTIME,3600))
83 . WRITE !
84 QUIT
Note: See TracBrowser for help on using the repository browser.