Index: cprs/branches/tmg-cprs/m_files/TMGRPC1B.m
===================================================================
--- cprs/branches/tmg-cprs/m_files/TMGRPC1B.m	(revision 796)
+++ cprs/branches/tmg-cprs/m_files/TMGRPC1B.m	(revision 894)
@@ -1,3 +1,3 @@
-TMGRPC1B ;TMG/kst-RPC Functions ;3/28/10
+TMGRPC1B ;TMG/kst-RPC Functions ;3/28/10, 7/11/10
          ;;1.0;TMG-LIB;**1**;3/28/10
  ;
@@ -10,58 +10,56 @@
  ;" RPC -- Public Functions.
  ;"=======================================================================
- ;"EVALTIUO
- ;"INSTALL -- Add the RPC's to the OPTION record OR CPRS GUI CHART
+ ;"ENSUREALL -- Ensure all needed TMG RPC entries have been added
+ ;
  ;"=======================================================================
  ;"PRIVATE API FUNCTIONS
  ;"=======================================================================
- ;"INSTALL1(RPCNAME) -- Add 1 RPC to the OPTION record OR CPRS GUI CHART
+ ;"ENSURE1(RPCNAME) -- ensure 1 RPC is in OPTION record OR CPRS GUI CHART
  ;
  ;"=======================================================================
  ;"=======================================================================
  ;"Dependencies:
- ;" DIC, TMGDEBUG
+ ;" DIC
  ;"=======================================================================
  ;"=======================================================================
  ;
- ;"OK TO DELETE THIS FUNCTION LATER IF WANTED....
-EVALTIUO(TMGY,TMGOBJNM) ;"--- DEPRECIATED.  Will use 'TIU TEMPLATE GETTEXT' RPC instead
-        ;"Purpose: To return the resolved text of a TIU Text Object.
-        ;"Input: TIUY -- This is output result for RPC caller
-        ;"       TMGOBJNM -- This is the name of the TIU TEXT OBJECT to obtain.
-        ;"Note: lines wrapped at 200 chars length
-        ;"Results : none
+ENSUREAL
+        ;"Ensure all needed TMG RPC entries have been added
+L1      ;;TMG ADD PATIENT
+        ;;TMG AUTOSIGN TIU DOCUMENT
+        ;;TMG BARCODE DECODE
+        ;;TMG BARCODE ENCODE
+        ;;TMG CHANNEL
+        ;;TMG CPRS GET URL LIST
+        ;;TMG DOWNLOAD FILE
+        ;;TMG DOWNLOAD FILE DROPBOX
+        ;;TMG GET BLANK TIU DOCUMENT
+        ;;TMG GET DFN
+        ;;TMG GET IMAGE LONG DESCRIPTION
+        ;;TMG GET PATIENT DEMOGRAPHICS
+        ;;TMG INIFILE GET
+        ;;TMG INIFILE SET
+        ;;TMG MSGLINK CHANNEL
+        ;;TMG SEARCH CHANNEL
+        ;;TMG SET PATIENT DEMOGRAPHICS
+        ;;TMG UPLOAD FILE
+        ;;TMG UPLOAD FILE DROPBOX
+        ;;TMG IMAGE DELETE
+        ;;MAGGADDIMAGE
+        ;;MAG3 TIU IMAGE
+        ;;MAG3 CPRS TIU NOTE
+        ;;<END>
         ;
-        KILL ^TMG("TMP","TABLE")
-        zshow "*":^TMG("TMP","TABLE")
-        NEW TMGSTR
-        SET TMGOBJNM=$GET(TMGOBJNM)
-        IF TMGOBJNM["|" DO  GOTO STOR
-        . SET TMGSTR="Passed TEXT OBJECT name should not contain '|' character"
-        SET TMGSTR="|"_TMGOBJNM_"|"
-        SET TMGSTR=$$BOIL^TIUSRVD(TMGSTR) ;" Execute Boilerplates
+        NEW TMGI
+        NEW DONE SET DONE=0
+        FOR TMGI=0:1 DO  QUIT:DONE
+        . NEW RPC SET RPC=$PIECE($TEXT(L1+TMGI^TMGRPC1B),";;",2)
+        . IF (RPC="")!(RPC="<END>") SET DONE=1 QUIT
+        . DO ENSURE1(RPC)
+        QUIT
         ;
-STOR    NEW REF SET REF=$NAME(^TMP("TMG OBJ EVAL",$J))
-        NEW IDX SET IDX=0
-        KILL @REF
-        SET TMGY=REF
-        FOR  DO  QUIT:(TMGSTR="")
-        . NEW SA,SB
-        . SET (SA,SB)=""
-        . IF $LENGTH(TMGSTR)>200 DO
-        . . SET SB=$EXTRACT(TMGSTR,201,999)
-        . . SET TMGSTR=$EXTRACT(TMGSTR,1,200)
-        . SET IDX=IDX+1
-        . SET @REF@(IDX)=TMGSTR
-        . SET TMGSTR=SB
-        QUIT
- ;
- ;
-INSTALL ;
-        ;"Purpose: to add the RPC's to the OPTION record OR CPRS GUI CHART
-        DO INSTALL1("TMG EVAL TIU TEXT OBJECT")
-        QUIT
- ;
-INSTALL1(RPCNAME) ;
-        ;"Purpose: to add 1 RPC to the OPTION record OR CPRS GUI CHART
+ENSURE1(RPCNAME) ;
+        ;"Purpose: to ensure 1 RPC is in OPTION record OR CPRS GUI CHART
+        ;"         (add if needed)
         NEW DIC,X,Y,DA
         SET DIC="^DIC(19,",DIC(0)="M"
@@ -83,2 +81,4 @@
         . WRITE !
         QUIT
+        
+        
