| 1 | MAGDROUT ;WOIFO/EdM - Copy routine code ; 01/29/2004  11:59
 | 
|---|
| 2 |  ;;3.0;IMAGING;**10,36**;13-February-2004
 | 
|---|
| 3 |  ;; +---------------------------------------------------------------+
 | 
|---|
| 4 |  ;; | Property of the US Government.                                |
 | 
|---|
| 5 |  ;; | No permission to copy or redistribute this software is given. |
 | 
|---|
| 6 |  ;; | Use of unreleased versions of this software requires the user |
 | 
|---|
| 7 |  ;; | to execute a written test agreement with the VistA Imaging    |
 | 
|---|
| 8 |  ;; | Development Office of the Department of Veterans Affairs,     |
 | 
|---|
| 9 |  ;; | telephone (301) 734-0100.                                     |
 | 
|---|
| 10 |  ;; |                                                               |
 | 
|---|
| 11 |  ;; | The Food and Drug Administration classifies this software as  |
 | 
|---|
| 12 |  ;; | a medical device.  As such, it may not be changed in any way. |
 | 
|---|
| 13 |  ;; | Modifications to this software may result in an adulterated   |
 | 
|---|
| 14 |  ;; | medical device under 21CFR820, the use of which is considered |
 | 
|---|
| 15 |  ;; | to be a violation of US Federal Statutes.                     |
 | 
|---|
| 16 |  ;; +---------------------------------------------------------------+
 | 
|---|
| 17 |  ;;
 | 
|---|
| 18 |  ; This routine can be used to copy code from the VistA system
 | 
|---|
| 19 |  ; to a DICOM Gateway computer.
 | 
|---|
| 20 |  ;
 | 
|---|
| 21 |  ; The entry point VISTA collects the software from the live system
 | 
|---|
| 22 |  ; and stores it in ^MAGD.
 | 
|---|
| 23 |  ;
 | 
|---|
| 24 |  ; The entry point DICOM takes the software from the global variable
 | 
|---|
| 25 |  ; and stores it in the local system.
 | 
|---|
| 26 |  Q
 | 
|---|
| 27 |  ;
 | 
|---|
| 28 | VISTA D SAVE(1)
 | 
|---|
| 29 |  Q
 | 
|---|
| 30 |  ;
 | 
|---|
| 31 | SILENT D SAVE(0)
 | 
|---|
| 32 |  Q
 | 
|---|
| 33 |  ;
 | 
|---|
| 34 | SAVE(VERBOSE) ; Collect active code
 | 
|---|
| 35 |  N D0,D1,I,N,R,X
 | 
|---|
| 36 |  S VERBOSE=+$G(VERBOSE),N=0
 | 
|---|
| 37 |  ;
 | 
|---|
| 38 |  ; From Kernel:
 | 
|---|
| 39 |  F R="XLFDT","XUSRB1","XUMF333" S R(R)=""
 | 
|---|
| 40 |  ; From Radiology 5.0
 | 
|---|
| 41 |  F R="RARIC","RARTE2","RAUTL","RAUTL1","RAUTL2","RAUTL20","RAUTL3","RAUTL5","RAXREF" S R(R)=""
 | 
|---|
| 42 |  ; From MAS
 | 
|---|
| 43 |  F R="VADPT","VADPT0","VADPT1","VADPT2","VADPT3","VADPT30","VADPT31","VADPT32","VADPT4","VADPT5","VADPT6","VADPT60","VADPT61","VADPT62" S R(R)=""
 | 
|---|
| 44 |  ; From TIU
 | 
|---|
| 45 |  F R="TIULC1","TIULS","TIUSRVPL" S R(R)=""
 | 
|---|
| 46 |  ; From Medicine
 | 
|---|
| 47 |  S R="MCUIMAG0",R(R)=""
 | 
|---|
| 48 |  ;
 | 
|---|
| 49 |  ; Store the code from the routines:
 | 
|---|
| 50 |  W !!,"Saving source code for Imaging..."
 | 
|---|
| 51 |  W:VERBOSE !!,"Now copying:",!
 | 
|---|
| 52 |  S R="" F  S R=$O(R(R)) Q:R=""  D
 | 
|---|
| 53 |  . N %
 | 
|---|
| 54 |  . W:VERBOSE !,R,?15 S N=N+1
 | 
|---|
| 55 |  . D NOW^%DTC
 | 
|---|
| 56 |  . S D0=$O(^MAGD(2006.79,"B",R,"")) D:'D0
 | 
|---|
| 57 |  . . L +^MAGD(2006.79)
 | 
|---|
| 58 |  . . S X=$G(^MAGD(2006.79,0)),$P(X,"^",1,2)="DICOM ROUTINE COPY^2006.79"
 | 
|---|
| 59 |  . . S D0=$O(^MAGD(2006.79," "),-1)+1
 | 
|---|
| 60 |  . . S ^MAGD(2006.79,D0,0)=R_"^"_%,^MAGD(2006.79,"B",R,D0)=""
 | 
|---|
| 61 |  . . S $P(X,"^",3)=D0,$P(X,"^",4)=$P(X,"^",4)+1
 | 
|---|
| 62 |  . . S ^MAGD(2006.79,0)=X
 | 
|---|
| 63 |  . . L -^MAGD(2006.79)
 | 
|---|
| 64 |  . . Q
 | 
|---|
| 65 |  . S X=$G(^MAGD(2006.79,D0,0)),$P(X,"^",2)=%
 | 
|---|
| 66 |  . L +^MAGD(2006.79,D0)
 | 
|---|
| 67 |  . K ^MAGD(2006.79,D0,1)
 | 
|---|
| 68 |  . S D1=0 F I=1:1 S X=$T(+I^@R) Q:X=""  S D1=D1+1,^MAGD(2006.79,D0,1,D1,0)=X
 | 
|---|
| 69 |  . S ^MAGD(2006.79,D0,1,0)="^2006.791^"_D1_"^"_D1
 | 
|---|
| 70 |  . L -^MAGD(2006.79,D0)
 | 
|---|
| 71 |  . I VERBOSE W $J(D1,4)," line" W:D1'=1 "s"
 | 
|---|
| 72 |  . Q
 | 
|---|
| 73 |  W !,"Code saved for ",N," routine" W:N'=1 "s" W "."
 | 
|---|
| 74 |  Q
 | 
|---|
| 75 |  ;
 | 
|---|
| 76 | DICOM ; Restore routines in DICOM environment
 | 
|---|
| 77 |  ;N D0,D1,L,N,R,S,X
 | 
|---|
| 78 |  S R="" F  S R=$O(^MAGD(2006.79,"B",R)) Q:R=""  D
 | 
|---|
| 79 |  . S D0="" F  S D0=$O(^MAGD(2006.79,"B",R,D0)) Q:D0=""  D
 | 
|---|
| 80 |  . . W !,R,?15
 | 
|---|
| 81 |  . . S X="ZR  S D1=0 F  S D1=$O(^MAGD(2006.79,D0,1,D1)),L="""" S:D1 L=^MAGD(2006.79,D0,1,D1,0),N=D1 ZI:L'="""" L I 'D1 ZS "_R_" ZL "_$T(+0)_" Q"
 | 
|---|
| 82 |  . . X X
 | 
|---|
| 83 |  . . W $J(N,4)," line" W:N'=1 "s"
 | 
|---|
| 84 |  . . Q
 | 
|---|
| 85 |  . Q
 | 
|---|
| 86 |  Q
 | 
|---|