Index: FOIAVistA/tag/r/IMAGING-MAG-ZMAG/MAGGTAU.m
===================================================================
--- FOIAVistA/trunk/r/IMAGING-MAG-ZMAG/MAGGTAU.m	(revision 631)
+++ FOIAVistA/tag/r/IMAGING-MAG-ZMAG/MAGGTAU.m	(revision 636)
@@ -1,5 +1,4 @@
 MAGGTAU ;WOIFO/GEK - RPC Calls to Update the Imaging Windows Workstation file ; [ 03/25/2001 11:20 ]
- ;;3.0;IMAGING;**7,16,8,59**;Nov 27, 2007;Build 20
- ;;Per VHA Directive 2004-038, this routine should not be modified.
+ ;;3.0;IMAGING;**7,16,8**;Sep 15, 2004
  ;; +---------------------------------------------------------------+
  ;; | Property of the US Government.                                |
@@ -18,16 +17,16 @@
  ;;
  Q
-UPD(MAGRY,DATA) ;RPC [MAGG WRKS UPDATES]
- ; Called after User login. Local and RIV.
- ; Updates information in the IMAGING WINDOWS WORKSTATION
+UPD(MAGRY,DATA) ;RPC [MAGG WRKS UPDATES] 
+ ; Call from workstation updating it's exe's Date/Time
+ ; and other Workstation information into IMAGING WINDOWS WORKSTATION
+ ; at logon of user.
  ;
  ; DATA is '^' delimited piece
  ; 1 Workstation name            2 Date/Time of capture app.
  ; 3 Date/Time of Display App.
- ; 4 Location of workstation      5 Date/Time of MAGSETUP
+ ; 4 Location of worksation      5 Date/Time of MAGSETUP
  ; 6 Version of Display          7 Version of Capture
  ; 8  1=Normal startup 2=Started by CPRS 3=Import API
  ; 9 OS Version                 10 VistaRad Version
- ; 11 RPCBroker Server    12 RPCBroker Port
  N X,Y,Z
  N MAGNAME,MAGCDT,MAGDDT,MAG0,MAGLOC,MAGIEN,MAGSETUP,MAGSTART,MAGSRV
@@ -40,12 +39,8 @@
  S MAGSETUP=$P(DATA,U,5)
  S MAGVERSD=$P(DATA,U,6)
- I MAGVERSD S MAGJOB("DISPLAY")=""
  S MAGVERSC=$P(DATA,U,7)
- I MAGVERSC S MAGJOB("CAPTURE")=""
  S MAGMODE=$P(DATA,U,8)
  S MAGOSVER=$P(DATA,U,9)
  S MAGVERVR=$P(DATA,U,10)
- I $P(DATA,U,11)]"" S MAGJOB("RPCSERVER")=$P(DATA,U,11)
- I $P(DATA,U,12)]"" S MAGJOB("RPCPORT")=$P(DATA,U,12)
  S MAGIEN=0
  I $L(MAGNAME) S MAGIEN=$O(^MAG(2006.81,"B",MAGNAME,""))
@@ -59,5 +54,5 @@
  L +^MAG(2006.81,"LOCK",MAGIEN):0
  S MAGIEN=+MAGIEN_","
- S MAGGFDA(2006.81,MAGIEN,.01)=MAGNAME ; Computer Name
+ S MAGGFDA(2006.81,MAGIEN,.01)=MAGNAME ; Compter Name
  I MAGCDT>-1 S MAGGFDA(2006.81,MAGIEN,4)=MAGCDT ;TELE19N.EXE dttm
  I MAGDDT>-1 S MAGGFDA(2006.81,MAGIEN,5)=MAGDDT ;IMGVWP10.EXE dttm
@@ -65,5 +60,5 @@
  S MAGGFDA(2006.81,MAGIEN,8)=1 ; Active or not.
  S MAGGFDA(2006.81,MAGIEN,6)=MAGLOC ; location free text from .INI
- S MAGGFDA(2006.81,MAGIEN,3)="@" ; delete logoff time for this job.
+ S MAGGFDA(2006.81,MAGIEN,3)="@" ; delete logff time for this job.
  S MAGGFDA(2006.81,MAGIEN,10)="@" ; delete session pointer
  S MAGGFDA(2006.81,MAGIEN,11)="@" ; reset the session error count.
@@ -75,5 +70,5 @@
  S X=$P(MAG0,U,12)
  S MAGGFDA(2006.81,MAGIEN,12)=X+1 ; Sess count for wrks.
- ; Keep PLACE that this wrks logged in.
+ ; Keep the last PLACE that this wrks logged in.
  S MAGPL=0 I $D(DUZ(2)) S MAGPL=+$$PLACE^MAGBAPI(DUZ(2)) ; DBI
  I MAGPL S MAGGFDA(2006.81,MAGIEN,.04)=MAGPL ; DBI
@@ -87,8 +82,9 @@
  D UPDATE^DIE("S","MAGGFDA","MAGXIEN","MAGXERR")
  I $D(DIERR) D RTRNERR(.MAGRY) Q
- ; The MAGJOB( array is used by Imaging routines that are
+ ; The " MAGJOB(" array is used by Imaging routines that are
  ; called from the Delphi App. 
+ ; We use nodes of the Array MAGJ0B to organize the shared partition variables.
  ; 
- ; 3.0.8 Whatever App calls this, we'll use that Version number.
+ ; 3.O.8 Whatever App calls this, we'll use that Version number.
  S MAGVERX=$S(MAGVERSD]"":MAGVERSD,MAGVERSC]"":MAGVERSC,MAGVERVR]"":MAGVERVR,1:0)
  S MAGJOB("WRKSIEN")=+MAGIEN
@@ -96,5 +92,5 @@
  S MAGRY="1^"
  ;
- ; SESSION : Create new session entry
+ ; SESSION : Now we create new session entry
  D GETS^DIQ(200,DUZ_",","29","I","Z","") ; service/section
  S MAGSRV=$G(Z(200,DUZ_",",29,"I"))
@@ -158,5 +154,5 @@
  ; $P(9) is Vrad REMOTE Read flag (1/0; 1=REMOTE)
  ; $P(TXT,"$$",2) is Tracking ID from an Imported Image.  From this we compute Session #, to log actions.
- ; LOGTM   - [1|0] Flag to indicate whether or not to log the time of the Action.  Default = 0
+ ; LOGTM   - [1|0] Flag to indicate wheter or not to log the time of the Action.  Default = 0
  ; MAGSESS - Session IEN where the action should be logged.  Default to MAGJOB("SESSION")
  ;
@@ -202,4 +198,5 @@
  ;   and marks the session closed.
  ;
+ K ^TMP("MAGGTAU","LOGOFF",$J)
  S MAGRY=1
  N MAGGFDA,MAGXERR,MAGXIEN,MAGIEN,MAGSESS,MAGEND,MAGCON
