source: WorldVistAEHR/trunk/r/IMAGING-MAG-ZMAG/MAGSDOFL.m@ 1578

Last change on this file since 1578 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 4.1 KB
Line 
1MAGSDOFL ;WOIFO/SF - Track Offline Images ; [ 12/27/2000 10:49 ]
2 ;;3.0;IMAGING;**18**;Mar 07, 2006
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 Class II medical device. As such, it may not be changed |
13 ;; | in any way. Modifications to this software may result in an |
14 ;; | adulterated medical device under 21CFR820, the use of which |
15 ;; | is considered to be a violation of US Federal Statutes. |
16 ;; +---------------------------------------------------------------+
17 ;;
18 Q
19ENTRY ;Interactive entry here
20 I '$D(DUZ) W !,"Use the MAG JB OFFLINE menu option to run this application" Q
21 N BOLD,NORMAL,N,R
22 D SETUP W @IOF
23LOOP ; main menu loop
24 D SETUP
25 W !!,$P($T(OPTIONS),";",2),!
26 S N=0 F I=1:1 S X=$P($T(OPTIONS+I),";",2,999) Q:X="" D ; list options
27 . I $P(X,";")="" Q
28 . S N=N+1 W !,?2,$J(N,2),?6,$P(X,";")
29 . Q
30 ;W BOLD
31 ;
32AGAIN ;
33 W !!,?2,"OPTION: " R " ",R:DTIME Q:R=""!(R="^")
34 I R["?" D HELP2 G AGAIN
35 I R?1N.N,R>0,R'>N D G LOOP
36 . S N=0 F I=1:1 D Q:X="" I R=N D @($P(X,";",2)),RETURN Q
37 . . S X=$P($T(OPTIONS+I),";",2,999) Q:X=""
38 . . S N=N+1
39 . Q
40 W " ??? -- Invalid option. Try agin." G AGAIN
41 ;
42SETUP ;
43 I ^%ZOSF("OS")?1"MSM".E S IOF="#"
44 E D HOME^%ZIS
45 S U="^"
46 S NORMAL=$C(27)_"[0;"_"44m" ; normal blue
47 S BOLD=$C(27)_"[1;"_"44m" ; bold blue
48 ;W BOLD
49 Q
50 ;
51RETURN ;
52 D SETUP
53 R !!,"Push <Enter> to continue...",X:DTIME
54 Q
55OFFLINE(MAGIN) ;Set images offline
56 N COUNT
57ASK1 I MAGIN="" R !!,"Enter file to read offline images from: ",X:DTIME
58 I X="" Q
59 I X="^" Q
60 I X["?" D HELP1 G ASK1
61 N IOP,MAGFDA,MAGFL
62 I MAGIN="" S MAGIN=X
63 S %ZIS="",%ZIS("HFSNAME")=MAGIN,%ZIS("HFSMODE")="R",IOP="HFS"
64 S X="ERROR^MAGSDOFL",@^%ZOSF("TRAP")
65 S MAGFL=2006.033
66 S COUNT=0
67 U 0 W !!,"Here goes nothing...",!
68 D ^%ZIS
69 F U IO R LN:5 D
70 . S COUNT=COUNT+1
71 . S LN=$$TRIM(LN)
72 . I LN["Media """ S MAGPLAT=$P(LN,"""",2) U 0 W !,MAGPLAT
73 . I COUNT#50=0 U 0 W "."
74 . S LN=$$FNAME(LN) Q:LN=""
75 . K MAGIEN S MAGIEN="?+1,"
76 . S MAGFDA(MAGFL,MAGIEN,.01)=LN
77 . S MAGFDA(MAGFL,MAGIEN,1)=MAGPLAT
78 . D UPDATE^DIE("","MAGFDA","MAGIEN","MAGERR")
79 . Q
80 W !,"Done."
81 Q
82FNAME(LN) ;Find img file name
83 ;OTG 4x
84 I LN["\" D Q XX
85 . F N=1:1 S XX=$P(LN,"\",N) Q:XX="" I XX?.E1"."3AN S LN=XX Q
86 ;OTG 3x
87 I $P(LN," ",1)'?.E1"."3AN Q ""
88 S LN=$P(LN," ")
89 Q LN
90ONLINE(MAGPLAT) ;Set images back online
91 ;
92ASK I MAGPLAT="" R !!,"Enter the name of the platter being inserted: ",X:DTIME
93 I X="" Q
94 I X="^" Q
95 I X["?" D HELP G ASK
96 N MAGENT
97 S MAGPLAT=X
98 I '$D(^MAGQUEUE(2006.033,"C",MAGPLAT)) W " Platter not on file..." Q
99 S DIK="^MAGQUEUE(2006.033,"
100 S MAGENT=""
101 F S MAGENT=$O(^MAGQUEUE(2006.033,"C",MAGPLAT,MAGENT)) Q:'MAGENT D
102 . S DA=MAGENT
103 . D ^DIK
104 . I $D(Y) W "."
105 . E W !,"Problem deleting entry# "_MAGENT
106 W !,"Done."
107 Q
108HELP ;List offline platters
109 W !,"Do you want to see a list of all offline platters? " R X:60
110 I "?"[$E(X) W !!,"Answer ""yes"" to see a list of platters currently marked offline"
111 I "?"[$E(X) W !,"Answer ""no"" to return",! G HELP
112 I "Yy"'[$E(X) Q
113 S MAGPLAT=""
114 F S MAGPLAT=$O(^MAGQUEUE(2006.033,"C",MAGPLAT)) D Q:MAGPLAT=""
115 . W !,MAGPLAT
116 Q
117HELP1 ;Help for offline
118 W !,"Enter the name of the file created by the jukebox media file report"
119 Q
120HELP2 ;Help for OPTION prompt
121 W !,"Select option 1 if you are marking images offline"
122 W !,"Select option 2 if you are marking images online"
123 W !,"Type ""^"" to quit"
124 Q
125 ;
126TRIM(X) ;
127 N I,J
128 F I=1:1:$L(X) Q:$E(X,I)'=" "
129 F J=$L(X):-1:I Q:$E(X,J)'=" "
130 Q $E(X,I,J)
131ERROR ;Trap Errors Here
132 D ^%ZISC
133 Q
134OPTIONS ; Offline Image Menu
135 ;Take images offline (Remove Jukebox Platter);OFFLINE("")
136 ;Put images back online (Insert Jukebox Platter);ONLINE("")
Note: See TracBrowser for help on using the repository browser.