Index: FOIAVistA/tag/r/IMAGING-MAG-ZMAG/MAGGNTI1.m
===================================================================
--- FOIAVistA/trunk/r/IMAGING-MAG-ZMAG/MAGGNTI1.m	(revision 631)
+++ FOIAVistA/tag/r/IMAGING-MAG-ZMAG/MAGGNTI1.m	(revision 636)
@@ -1,4 +1,4 @@
-MAGGNTI1 ;WOIFO/GEK - Imaging interface to TIU. RPC Calls etc. ; 04 Apr 2002  2:37 PM
- ;;3.0;IMAGING;**46,59**;Nov 27, 2007;Build 20
+MAGGNTI1 ;WOIFO/GEK - Imaging interface to TIU RPC Calls etc. ; 20 Nov 2006  12:42 PM
+ ;;3.0;IMAGING;**46**;16-February-2007;;Build 1023
  ;; Per VHA Directive 2004-038, this routine should not be modified.
  ;; +---------------------------------------------------------------+
@@ -9,5 +9,4 @@
  ;; | Development Office of the Department of Veterans Affairs,     |
  ;; | telephone (301) 734-0100.                                     |
- ;; |                                                               |
  ;; | The Food and Drug Administration classifies this software as  |
  ;; | a medical device.  As such, it may not be changed in any way. |
@@ -16,5 +15,5 @@
  ;; | to be a violation of US Federal Statutes.                     |
  ;; +---------------------------------------------------------------+
- ;;      
+ ;;
  Q
 NEW(MAGRY,MAGDFN,MAGTITLE,MAGADCL,MAGMODE,MAGES,MAGESBY,MAGLOC,MAGDATE,MAGCNSLT,MAGTEXT) ;RPC [MAG3 TIU NEW]
@@ -37,5 +36,5 @@
  ;  MAGESBY  - The DUZ of the Signer (Defaults to DUZ)
  ;  MAGADCL  - 1 = Mark this Note as Administratively Closed
- ;  MAGMODE  - Mode of Admin Closure: "S" = Scanned Document 
+ ;  MAGMODE  - Mode of Admin Closure: "S" = Scanned Document
  ;             "M" = Manual closure, "E" = Electronically Filed
  ;  MAGDATE  - Date of the Note. For New Notes.
@@ -55,5 +54,5 @@
  I "MSE"'[MAGMODE S MAGRY="0^Invalid Mode of Closure: """_MAGMODE_"""" Q
  ;
- ;       Here if we have no Text, we'll add at least a line.
+ ; Here if we have no Text, we'll add at least a line.
  I $O(MAGTEXT(""))="" S MAGTEXT(.1)="   VistA Imaging - - Scanned Document"
  ;               Reformat Text - "TEXT",i,0)"   for TIU Call.
@@ -97,7 +96,6 @@
  I '$$VALID^MAGGSIV1(8925,1301,.MAGDATE,.MAGRES) S MAGRY=MAGRY_"  "_MAGRES
  E  S MTXT(1301)=MAGDATE
- ; - Fix in T30,  if DUZ isn't MAGESBY, we have Author different than User.
- I MAGESBY'=DUZ S MTXT("1202")=MAGESBY
- ;               Update and LINK TO CONSULT if needed.
+ ;
+ ; Update and LINK TO CONSULT if needed.
  I MAGISC S MTXT("1405")=MAGCNSLT_";GMR(123,"
  I $D(MTXT) D  I 'MUPD S MAGRY=MUPD Q
@@ -105,5 +103,5 @@
  . Q
  ;
- ;               If Admin Close, then We quit.
+ ; If Admin Close, then We quit.
  I MAGADCL="1" D  Q
  . D ADMNCLOS^MAGGNTI2(.MAGTY,MAGDFN,MAGTIUDA,MAGMODE)
@@ -111,5 +109,5 @@
  . Q
  ;
- ;               if caller sent esignature to Sign this Note.
+ ; if caller sent esignature to Sign this Note.
  I $L(MAGES) D
  . D SIGN^MAGGNTI3(.MAGTY,MAGDFN,MAGTIUDA,MAGES,MAGESBY)
@@ -143,5 +141,5 @@
  ;
  I '$$VALDATA^MAGGNTI2(.MAGRY,MAGDFN,MAGTIUDA) Q
- N MAGXT,I,CT,NEWTIUDA,MAGY,MAGRES,MAGUPD
+ N MAGXT,I,CT,NEWTIUDA,MAGY,MAGRES
  S CT=1,I=""
  S MAGXT("TEXT",1,0)="VistA Imaging  Scanned Document - Addendum."
@@ -153,20 +151,17 @@
  D MAKEADD^TIUSRVP(.MAGRY,MAGTIUDA,.MAGXT)
  ; MAGRY could be 0^error message
- ;       -1^message
- ;       TIUDA
+ ;                                -1^message
+ ;                                TIUDA
  I $P(MAGRY,"^")<0 S $P(MAGRY,"^")=0 Q
  S NEWTIUDA=+MAGRY
  S MAGRY=MAGRY_"^Addendum was created."
- ;
+ ;       
  ;Put in the Date that was sent.
- K MAGUPD
  I '$$VALID^MAGGSIV1(8925,1301,.MAGDATE,.MAGRES) S MAGRY=MAGRY_"  "_MAGRES
  E  D
- . S MAGUPD(1301)=MAGDATE
- . S MAGUPD(1211)=$$GET1^DIQ(8925,1211,MAGTIUDA,"I")
- ; - Fix in T30,  if DUZ isn't MAGESBY, we have Author different than User.
- I MAGESBY'=DUZ S MAGUPD("1202")=MAGESBY
- I $D(MAGUPD) D
- . D UPDATE^TIUSRVP(.MAGY,NEWTIUDA,.MAGUPD)
+ . K X
+ . S X(1301)=MAGDATE
+ . S X(1211)=$$GET1^DIQ(8925,1211,MAGTIUDA,"I")
+ . D UPDATE^TIUSRVP(.MAGY,NEWTIUDA,.X)
  . I 'MAGY S MAGRY=MAGRY_" TIU Data was Not Correctly Filed."
  . Q
@@ -185,6 +180,4 @@
  Q
 MOD(MAGRY,MAGDFN,MAGTIUDA,MAGADCL,MAGMODE,MAGES,MAGESBY,MAGTEXT) ; RPC [MAG3 TIU MODIFY NOTE]
- ; After a Note is filed, we call this to Modify the Note.  We do this to sign it.
- ;  That way the Signed Date is After the Image Association  Date/Time.
  N $ETRAP,$ESTACK S $ETRAP="D ERR^"_$T(+0)
  S MAGDFN=$G(MAGDFN),MAGTIUDA=$G(MAGTIUDA)
