Index: FOIAVistA/tag/r/RADIOLOGY_NUCLEAR_MEDICINE-RA/RAUTL1.m
===================================================================
--- FOIAVistA/trunk/r/RADIOLOGY_NUCLEAR_MEDICINE-RA/RAUTL1.m	(revision 631)
+++ FOIAVistA/tag/r/RADIOLOGY_NUCLEAR_MEDICINE-RA/RAUTL1.m	(revision 636)
@@ -1,11 +1,6 @@
 RAUTL1 ;HISC/CAH,FPT,GJC AISC/MJK,RMO-Utility Routine ;10/22/97  13:54
- ;;5.0;Radiology/Nuclear Medicine;**5,9,18,71,82,81,84**;Mar 16, 1998;Build 13
+ ;;5.0;Radiology/Nuclear Medicine;**5,9,18,71,82**;Mar 16, 1998;Build 8
  ;last modification by SS for P18 June 19,00
  ;02/10/2006 BAY/KAM RA*5*71 Add ability to update exam data to V/R
- ;
- ;Integration Agreements
- ;----------------------
- ;DIC(10006); DIE(10018); FILE^DIE(2053); UPDATE^DIE(2053); EN^ORB3(1362); NOTE^ORX3(868)
- ;
  I "IOSCR"'[X!(X="") S X="Unknown" Q
  G @($E(X))
@@ -36,5 +31,5 @@
  ;Variable Y is returned as either an elapsed time in the form DD:HH:MM where DD=days, HH=hours, MM=minutes or as the string 'Neg. Time' indicating a negative elapsed time
  ;Variable Y1 is returned as the # of minutes of elapsed time
- I '$D(RAMTIME) S DIC="^DD(""FUNC"",",DIC(0)="FX",RAX=X,X="MINUTES" D ^DIC K DIC S X=RAX S:$D(^DD("FUNC",+Y,1)) RAMTIME=^(1) I '$D(RAMTIME) W $C(7),!!,"Can't continue --- No 'MINUTES' function found in File Manager" K Y,Y1 G Q
+ I '$D(RAMTIME) S DIC="^DD(""FUNC"",",DIC(0)="FX",RAX=X,X="MINUTES" D ^DIC K DIC S X=RAX S:$D(^DD("FUNC",+Y,1)) RAMTIME=^(1) I '$D(RAMTIME) W *7,!!,"Can't continue --- No 'MINUTES' function found in File Manager" K Y,Y1 G Q
  X RAMTIME S Y1=X I X<0 S Y="Neg. Time" G Q
 MINUTS S X(1)=X\1440,X=X-(1440*X(1)),X(2)=X\60,X(3)=X-(60*X(2)),Y=$E(100+X(1),2,3)_":"_$E(100+X(2),2,3)_":"_$E(100+X(3),2,3)
@@ -46,9 +41,9 @@
  I $G(RAIMGTY)="" K XQUIT Q  ; didn't sign-on to an imaging location
  D ^RACNLU G UPQ:"^"[X
- I $D(^RA(72,"AA",RAIMGTY,9,+RAST)),'$D(^XUSEC("RA MGR",DUZ)) W !!?3,$C(7),"You do not have the appropriate access privileges to act on completed exams." G UPDATE
- I $D(^RA(72,"AA",RAIMGTY,0,+RAST)) W !!?3,$C(7),"Exam has been 'cancelled' therefore the status cannot be changed." G UPDATE
+ I $D(^RA(72,"AA",RAIMGTY,9,+RAST)),'$D(^XUSEC("RA MGR",DUZ)) W !!?3,*7,"You do not have the appropriate access privileges to act on completed exams." G UPDATE
+ I $D(^RA(72,"AA",RAIMGTY,0,+RAST)) W !!?3,*7,"Exam has been 'cancelled' therefore the status cannot be changed." G UPDATE
  ;D UP1 I RAOR>0 S DA(2)=RADFN,DA(1)=RADTI,DA=RACNI,DIE="^RADPT("_DA(2)_",""DT"","_DA(1)_",""P"",",DR="100///""NOW""",DR(2,70.07)="2///U;3////"_$S($G(RADUZ):RADUZ,1:DUZ) D ^DIE
  D UP1 I RAOR>0 D
- .L +^RADPT(RADFN,"DT",RADTI,"P",RACNI):$G(DILOCKTM,3)
+ .L +^RADPT(RADFN,"DT",RADTI,"P",RACNI)
  .N RAIEN
  .S RAIENS="+1,"_RACNI_","_RADTI_","_RADFN_","
@@ -56,11 +51,10 @@
  .K RAERR D UPDATE^DIE("E","RAFDA","RAIEN","RAERR")
  .K RAFDA,RAIENS
- .I $D(RAERR) S RAERR="Error in update of 70.07, .01 "_$G(RAERR("DIERR",1,"TEXT",1)) K RAERR("DIERR") L -^RADPT(RADFN,"DT",RADTI,"P",RACNI) K RAIEN Q
+ .I $D(RAERR) L -^RADPT(RADFN,"DT",RADTI,"P",RACNI) K RAIEN Q
  .S RAIENS=RAIEN(1)_","_RACNI_","_RADTI_","_RADFN_","
  .S RAFDA(70.07,RAIENS,2)="U"
  .S RAFDA(70.07,RAIENS,3)=$S($G(RADUZ):RADUZ,1:DUZ)
- .D FILE^DIE(,"RAFDA","RAERR")
+ .D FILE^DIE(,"RAFDA")
  .L -^RADPT(RADFN,"DT",RADTI,"P",RACNI)
- .I $D(RAERR) S RAERR="Error in update of 70.07, 2,3 "_$G(RAERR("DIERR",1,"TEXT",1)) K RAERR("DIERR")
 UPQ K RAFDA,RAIENS
  K %,D,DA,DE,DIC,DIE,DQ,DR,I,J,POP,RACS,RAEND,RAF5,RAFL,RAFST,RAI,RAIX,RAJ1,RAORDIFN,RAPRIT,RAHEAD,RASN,RAOR,RASTI,RASSN,RADATE,RAST,RACN,RACNI,RADFN,RADTE,RADTI,RANME,RAPRC,RARPT,X,Y,Z,^TMP($J,"RAEX"),C,DIPGM Q
@@ -96,17 +90,15 @@
  ;S DR(2,70.05)=$S($P(RAMDV,"^",11)&('$D(ZTQUEUED)):".01;",1:"")_"2////"_RASTI_";3////"_$S($G(RADUZ):RADUZ,1:DUZ)
  ;D ^DIE
- L +^RADPT(RADFN,"DT",RADTI,"P",RACNI):$G(DILOCKTM,3)
+ L +^RADPT(RADFN,"DT",RADTI,"P",RACNI)
  N RAIEN
  S RAIENS=RACNI_","_RADTI_","_RADFN_","
  S RAFDA(70.03,RAIENS,3)=RASTI
  K RAERR D FILE^DIE(,"RAFDA","RAERR")
- I $D(RAERR) S RAERR="Error in update of 70.03 "_$G(RAERR("DIERR",1,"TEXT",1)) K RAERR("DIERR") L -^RADPT(RADFN,"DT",RADTI,"P",RACNI) G UP2K ;L - P18
+ I $D(RAERR) L -^RADPT(RADFN,"DT",RADTI,"P",RACNI) G UP2K ;L - P18
  I $P(RAMDV,"^",10) D
- .N RAERR2
  .S RAIENS="+1,"_RACNI_","_RADTI_","_RADFN_","
  .S RAFDA(70.05,RAIENS,.01)=$$MIDNGHT^RAUTL5($$NOW^XLFDT())
- .D UPDATE^DIE(,"RAFDA","RAIEN","RAERR")
+ .D UPDATE^DIE(,"RAFDA","RAIEN")
  .K RAFDA,RAIENS
- .I $D(RAERR) S RAERR="Error in update of 70.05, .01 "_$G(RAERR("DIERR",1,"TEXT",1)) K RAERR("DIERR")
  .Q:'$D(RAIEN(1))
  .I $P(RAMDV,"^",11),('$D(ZTQUEUED)) D
@@ -117,8 +109,7 @@
  .S RAFDA(70.05,RAIENS,2)=RASTI
  .S RAFDA(70.05,RAIENS,3)=$S($G(RADUZ):RADUZ,1:DUZ)
- .K RAERR2 D FILE^DIE(,"RAFDA","RAERR2")
- .I $D(RAERR2) S RAERR2="Error in update of 70.05 2,3 "_$G(RAERR2("DIERR",1,"TEXT",1)),RAERR=$S($D(RAERR):RAERR_";"_RAERR2,1:RAERR2)
+ .K RAERR2 D FILE^DIE(,"RAFDA")
  ;Patch RA*5*82 added next line send EXM message after status update, not before the update
- D:'$D(RAERR) EXM^RAHLRPC
+ D EXM^RAHLRPC
  L -^RADPT(RADFN,"DT",RADTI,"P",RACNI)
  ;
