MAGXCVR ;WOIFO/SEB,MLH - Image File Conversion Reports ; 05/18/2007 11:23
;;3.0;IMAGING;**17,25,31,54**;03-July-2009;;Build 1424
;; Per VHA Directive 2004-038, this routine should not be modified.
;; +---------------------------------------------------------------+
;; | Property of the US Government. |
;; | No permission to copy or redistribute this software is given. |
;; | Use of unreleased versions of this software requires the user |
;; | to execute a written test agreement with the VistA Imaging |
;; | 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. |
;; | Modifications to this software may result in an adulterated |
;; | medical device under 21CFR820, the use of which is considered |
;; | to be a violation of US Federal Statutes. |
;; +---------------------------------------------------------------+
;;
Q
;
; Entry point for the detail report option (MAG IMAGE INDEX DETAIL REPORT)
REPORT N START,END S (START,END)=0
D BOUNDS^MAGXCVP(.START,.END) I START="^" Q
W !!,"Are you sure that you want to run this report for ",(END-START+1)," images? Y // " R RUN:DTIME
I "Yy"'[RUN W !,"OK, report not printed." G DONE
N ZTSAVE S ZTSAVE("START")=START,ZTSAVE("END")=END
U IO(0) W !,"This report must be run on a device at least 132 columns wide."
D EN^XUTMDEVQ("REPORT1^"_$T(+0),"Print Image Index Detail Report",.ZTSAVE)
G DONE
;
REPORT1 N MAGIEN,LINENUM,PAGE,RET,STARTDT,ENDDT
I IOM<132 W !,"This report must be run on a device at least 132 columns wide. Goodbye!" Q
S STARTDT=$$HTE^XLFDT($H,1)
S LINENUM=0,PAGE=0,RET="" D HEADER(1)
S START=+$G(START),END=+$G(END)
I END=0 S END=+$P($G(^MAG(2005,0)),U,3)
S MAGIEN=START-1 I MAGIEN=-1 S MAGIEN=0
F S MAGIEN=$O(^MAG(2005,MAGIEN)) Q:MAGIEN>END!(+MAGIEN'=MAGIEN) D REPONE(MAGIEN,1) I RET="^" Q
S ENDDT=$$HTE^XLFDT($H,1)
Q
;
; Print data for one image (IEN=MAGIEN)
REPONE(MAGIEN,TYPE) N MAGTMP,MAGVALS,GRPIEN,UTYPE,INDXDATA,CHILD1
N GRPFLG ; ------- true (1) if this image is part of a group
;
S GRPIEN=$$GET1^DIQ(2005,MAGIEN_",",14,"I"),GRPFLG=1
; NEW: Skip child images (for MRs, CTs, etc.)
I GRPIEN]"" Q
I GRPIEN="" S GRPIEN=MAGIEN,GRPFLG=0
S LINENUM=LINENUM+1 I LINENUM>(IOSL-2) D HEADER(TYPE) I RET="^" Q
W !,MAGIEN
I '$D(^MAG(2005,GRPIEN)) D Q
. W ?9,"<<< "_$S(GRPFLG:"PARENT ",1:"")_"IMAGE RECORD DOES NOT EXIST! >>>"
. Q
K MAGTMP
D GETS^DIQ(2005,GRPIEN_",","3;6;8;10;16;100","EI","MAGTMP")
K MAGVALS M MAGVALS=MAGTMP(2005,GRPIEN_",")
S CHILD1=$G(^MAG(2005,GRPIEN,1,1,0))
I CHILD1'="" S MAGVALS(3,"E")=$$GET1^DIQ(2005,CHILD1_",",3,"E")
S UTYPE="" I $G(MAGVALS(8,"I"))]"" S UTYPE=$$GET1^DIQ(200,MAGVALS(8,"I")_",",29,"E")
W ?9,$E($G(MAGVALS(6,"E")),1,16),?27,$E($G(MAGVALS(10,"E")),1,27),?56,$E($G(MAGVALS(16,"E")),1,20)
W ?78,$E($G(MAGVALS(100,"E")),1,23),?103,$E($G(MAGVALS(3,"E")),1,17),?120,$E(UTYPE,1,10)
S INDXDATA=$G(^XTMP("MAGIXCVGEN",MAGIEN)) I INDXDATA="" Q
I TYPE=1 D INDICES(INDXDATA,TYPE) ;I RET'="^" W ! S LINENUM=LINENUM+1 I LINENUM>(IOSL-3) D HEADER(TYPE) I RET="^" Q
Q
;
; Print index values for the current image
INDICES(INDXDATA,TYPE) N D0,INDXVAL,INDXNUM,TAB,LEN,SPACES
S SPACES="",$P(SPACES," ",21)=""
W !
F D0=1:1:5 D
. S INDXVAL=$P(INDXDATA,U,D0+1)
. S INDXNUM=$S(D0=2:2005.82,D0=3:2005.83,D0=4:2005.85,D0=5:2005.84,1:"")
. I D0>1,INDXVAL]"" S INDXVAL=$$GET1^DIQ(INDXNUM,INDXVAL,.01,"E")
. S TAB=$P("9^27^36^56^78",U,D0),LEN=$P("20^7^18^20^20",U,D0)
. I TYPE=1 W ?TAB,$E(INDXVAL,1,LEN)," "
. I TYPE=2 W $P("Package^Class^Type^Procedure^Specialty",U,D0),": ",$E(INDXVAL,1,LEN),$E(SPACES,1,LEN-$L(INDXVAL))
. Q
S LINENUM=LINENUM+1 I LINENUM>(IOSL-3) D HEADER(TYPE) I RET="^" Q
Q
;
; Entry point for the summary report option (MAG IMAGE INDEX SUMMARY REPORT)
SUMMARY N ZTSAVE,DETAIL
ALL R !!,"Display data for all images? N // ",DETAIL:DTIME
S DETAIL=$$UCASE^MAGXCVP(DETAIL) I DETAIL="^" G DONE
I DETAIL'="Y" S DETAIL="N"
S ZTSAVE("DETAIL")=DETAIL
D EN^XUTMDEVQ("SUMMARY1^"_$T(+0),"Print Image Index Summary Report",.ZTSAVE)
G DONE
;
SUMMARY1 N SUMMARY,SUMDATA,PAGE,LINENUM,RET,MAGIEN
I IOM'=132 W !,"This report must be run on a 132-column device. Goodbye!" Q
S SUMMARY="",PAGE=0,LINENUM=0,RET="" D HEADER(2)
F S SUMMARY=$O(^XTMP("MAG30P25","SUMMARY",SUMMARY)) Q:SUMMARY=""!(RET="^") D
. S SUMDATA=$G(^XTMP("MAG30P25","SUMMARY",SUMMARY))
. D INDICES(U_SUMMARY,2) I RET="^" Q
. W ! S LINENUM=LINENUM+1 I LINENUM>(IOSL-3) D HEADER(2) I RET="^" Q
. I DETAIL="Y" D DETL(SUMMARY) I RET="^" Q
. I DETAIL="N" D SUMM(SUMDATA) I RET="^" Q
. W ! F I=1:1:132 W "-"
. S LINENUM=LINENUM+1 I LINENUM>(IOSL-3) D HEADER(2) I RET="^" Q
. Q
I RET="^" Q
W !!,"Index Commit History:" S LINENUM=LINENUM+1 I LINENUM>(IOSL-3) D HEADER(2) I RET="^" Q
F I=1:1:+$G(^XTMP("MAG30P25","HISTORY")) Q:I="" D
. S SUMDATA=$G(^XTMP("MAG30P25","HISTORY",I))
. W !?2,I,?8,$P(SUMDATA,U),"-",$P(SUMDATA,U,3)," started on ",$P(SUMDATA,U,2),", finished on ",$P(SUMDATA,U,4)
. S LINENUM=LINENUM+1 I LINENUM>(IOSL-3) D HEADER(2) I RET="^" Q
. Q
Q
;
; Print the header of the report
S STATUS=$G(^XTMP("MAG30P25","SUMMARY"))
I PAGE>0,IOT="TRM"!(IOT="VTRM") R !!,"Press <RETURN> to continue, or '^' to exit: ",RET:DTIME I RET="^" Q
S LINENUM=$P("6^5",U,TYPE),PAGE=PAGE+1
W:PAGE>0 # W ! F I=1:1:132 W "-"
W !?53,"Image Index Report ",$S(TYPE=1:"Detail",1:"Summary"),?106,"Page #",PAGE
I TYPE=1 D
. W !,"Img ID",?9,"Procedure",?27,"Short Description",?56,"Parent Data File"
. W ?78,"Document Category",?103,"Obj. Type",?120,"User Type"
. W !?9,"Package",?27,"Class",?36,"Type",?56,"Procedure/Event",?78,"Specialty"
. Q
I TYPE=2 D
. W !?40,"Compiled: ",$P(STATUS,U,2),"-",$P(STATUS,U,4)
. W !?(132-11-$L($P(STATUS,U))-$L($P(STATUS,U,3))/2),"Image IDs: ",$P(STATUS,U),"-",$P(STATUS,U,3)
. Q
W ! F I=1:1:132 W "-"
Q
;
SUMM(SUMDATA) W !,"Total: ",$P(SUMDATA,U),?15,"First IEN: ",$P(SUMDATA,U,2),?35,"Last IEN: ",$P(SUMDATA,U,3)
S LINENUM=LINENUM+2 I LINENUM>(IOSL-3) D HEADER(2) I RET="^" Q
W !,"Img ID",?9,"Procedure",?27,"Short Description",?56,"Parent Data File"
W ?78,"Document Category",?103,"Obj. Type",?120,"User Type"
S LINENUM=LINENUM+1 I LINENUM>(IOSL-3) D HEADER(2) I RET="^" Q
;D REPONE($P(SUMDATA,U,2),2) I RET="^" Q
I $P(SUMDATA,U,2)'=$P(SUMDATA,U,3) D I RET="^" Q
. ;D REPONE($P(SUMDATA,U,3),2) I RET="^" Q
. Q
Q
;
DETL(SUMMARY) N MAGIEN
W !,"Img ID",?9,"Procedure",?27,"Short Description",?56,"Parent Data File"
W ?78,"Document Category",?103,"Obj. Type",?120,"User Type"
S LINENUM=LINENUM+2 I LINENUM>(IOSL-3) D HEADER(2) I RET="^" Q
S MAGIEN="" F S MAGIEN=$O(^XTMP("MAG30P25","SUMMARY",SUMMARY,MAGIEN)) Q:MAGIEN=""!(RET="^") D
. D REPONE(MAGIEN,2) I RET="^" Q
. Q
Q
;
DONE W !!,"Done!"
Q
;
; Entry point for the status report option (MAG IMAGE INDEX STATUS)
STATUS N STDATA,STFLAG,TASKNUM
S STDATA=$G(^XTMP("MAG30P25","STATUS")),STFLAG=$P(STDATA,U,13),TASKNUM=$P(STDATA,U,14)
W ! F CT=1:1:80 W "-"
W !,"Current status: ",$$ST I TASKNUM>0 W " (#",TASKNUM,")"
W ?60,"Current IEN: ",$P(STDATA,U,((STFLAG>3)+1)*6)
W !!,"Last generation started on: ",$P(STDATA,U,3),?53,"Starting IEN: ",$P(STDATA,U,2)
W !?18,"ended on: ",$P(STDATA,U,5),?55,"Ending IEN: ",$P(STDATA,U,4)
W !!?4,"Last commit started on: ",$P(STDATA,U,9),?53,"Starting IEN: ",$P(STDATA,U,8)
W !?18,"ended on: ",$P(STDATA,U,11),?55,"Ending IEN: ",$P(STDATA,U,10)
W ! F CT=1:1:80 W "-"
Q
;
ST() N STDATA,STFLAG,STATUS
S STDATA=$G(^XTMP("MAG30P25","STATUS"))
S STFLAG=$P(STDATA,U,13)
I +STFLAG=0 Q "Image index conversion not started yet"
S STATUS="Image index "_$S(STFLAG<4:"generation",1:"commit")_" "_$S(STFLAG#3=0:"done",STFLAG#3=1:"in progress",1:"aborted")
Q STATUS
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HMAGXCVR 8154 printed Dec 13, 2024@02:10:45 Page 2
MAGXCVR ;WOIFO/SEB,MLH - Image File Conversion Reports ; 05/18/2007 11:23
+1 ;;3.0;IMAGING;**17,25,31,54**;03-July-2009;;Build 1424
+2 ;; Per VHA Directive 2004-038, this routine should not be modified.
+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 ;; | The Food and Drug Administration classifies this software as |
+11 ;; | a medical device. As such, it may not be changed in any way. |
+12 ;; | Modifications to this software may result in an adulterated |
+13 ;; | medical device under 21CFR820, the use of which is considered |
+14 ;; | to be a violation of US Federal Statutes. |
+15 ;; +---------------------------------------------------------------+
+16 ;;
+17 QUIT
+18 ;
+19 ; Entry point for the detail report option (MAG IMAGE INDEX DETAIL REPORT)
REPORT NEW START,END
SET (START,END)=0
+1 DO BOUNDS^MAGXCVP(.START,.END)
IF START="^"
QUIT
+2 WRITE !!,"Are you sure that you want to run this report for ",(END-START+1)," images? Y // "
READ RUN:DTIME
+3 IF "Yy"'[RUN
WRITE !,"OK, report not printed."
GOTO DONE
+4 NEW ZTSAVE
SET ZTSAVE("START")=START
SET ZTSAVE("END")=END
+5 USE IO(0)
WRITE !,"This report must be run on a device at least 132 columns wide."
+6 DO EN^XUTMDEVQ("REPORT1^"_$TEXT(+0),"Print Image Index Detail Report",.ZTSAVE)
+7 GOTO DONE
+8 ;
REPORT1 NEW MAGIEN,LINENUM,PAGE,RET,STARTDT,ENDDT
+1 IF IOM<132
WRITE !,"This report must be run on a device at least 132 columns wide. Goodbye!"
QUIT
+2 SET STARTDT=$$HTE^XLFDT($HOROLOG,1)
+3 SET LINENUM=0
SET PAGE=0
SET RET=""
DO HEADER(1)
+4 SET START=+$GET(START)
SET END=+$GET(END)
+5 IF END=0
SET END=+$PIECE($GET(^MAG(2005,0)),U,3)
+6 SET MAGIEN=START-1
IF MAGIEN=-1
SET MAGIEN=0
+7 FOR
SET MAGIEN=$ORDER(^MAG(2005,MAGIEN))
if MAGIEN>END!(+MAGIEN'=MAGIEN)
QUIT
DO REPONE(MAGIEN,1)
IF RET="^"
QUIT
+8 SET ENDDT=$$HTE^XLFDT($HOROLOG,1)
+9 QUIT
+10 ;
+11 ; Print data for one image (IEN=MAGIEN)
REPONE(MAGIEN,TYPE) NEW MAGTMP,MAGVALS,GRPIEN,UTYPE,INDXDATA,CHILD1
+1 ; ------- true (1) if this image is part of a group
NEW GRPFLG
+2 ;
+3 SET GRPIEN=$$GET1^DIQ(2005,MAGIEN_",",14,"I")
SET GRPFLG=1
+4 ; NEW: Skip child images (for MRs, CTs, etc.)
+5 IF GRPIEN]""
QUIT
+6 IF GRPIEN=""
SET GRPIEN=MAGIEN
SET GRPFLG=0
+7 SET LINENUM=LINENUM+1
IF LINENUM>(IOSL-2)
DO HEADER(TYPE)
IF RET="^"
QUIT
+8 WRITE !,MAGIEN
+9 IF '$DATA(^MAG(2005,GRPIEN))
Begin DoDot:1
+10 WRITE ?9,"<<< "_$SELECT(GRPFLG:"PARENT ",1:"")_"IMAGE RECORD DOES NOT EXIST! >>>"
+11 QUIT
End DoDot:1
QUIT
+12 KILL MAGTMP
+13 DO GETS^DIQ(2005,GRPIEN_",","3;6;8;10;16;100","EI","MAGTMP")
+14 KILL MAGVALS
MERGE MAGVALS=MAGTMP(2005,GRPIEN_",")
+15 SET CHILD1=$GET(^MAG(2005,GRPIEN,1,1,0))
+16 IF CHILD1'=""
SET MAGVALS(3,"E")=$$GET1^DIQ(2005,CHILD1_",",3,"E")
+17 SET UTYPE=""
IF $GET(MAGVALS(8,"I"))]""
SET UTYPE=$$GET1^DIQ(200,MAGVALS(8,"I")_",",29,"E")
+18 WRITE ?9,$EXTRACT($GET(MAGVALS(6,"E")),1,16),?27,$EXTRACT($GET(MAGVALS(10,"E")),1,27),?56,$EXTRACT($GET(MAGVALS(16,"E")),1,20)
+19 WRITE ?78,$EXTRACT($GET(MAGVALS(100,"E")),1,23),?103,$EXTRACT($GET(MAGVALS(3,"E")),1,17),?120,$EXTRACT(UTYPE,1,10)
+20 SET INDXDATA=$GET(^XTMP("MAGIXCVGEN",MAGIEN))
IF INDXDATA=""
QUIT
+21 ;I RET'="^" W ! S LINENUM=LINENUM+1 I LINENUM>(IOSL-3) D HEADER(TYPE) I RET="^" Q
IF TYPE=1
DO INDICES(INDXDATA,TYPE)
+22 QUIT
+23 ;
+24 ; Print index values for the current image
INDICES(INDXDATA,TYPE) NEW D0,INDXVAL,INDXNUM,TAB,LEN,SPACES
+1 SET SPACES=""
SET $PIECE(SPACES," ",21)=""
+2 WRITE !
+3 FOR D0=1:1:5
Begin DoDot:1
+4 SET INDXVAL=$PIECE(INDXDATA,U,D0+1)
+5 SET INDXNUM=$SELECT(D0=2:2005.82,D0=3:2005.83,D0=4:2005.85,D0=5:2005.84,1:"")
+6 IF D0>1
IF INDXVAL]""
SET INDXVAL=$$GET1^DIQ(INDXNUM,INDXVAL,.01,"E")
+7 SET TAB=$PIECE("9^27^36^56^78",U,D0)
SET LEN=$PIECE("20^7^18^20^20",U,D0)
+8 IF TYPE=1
WRITE ?TAB,$EXTRACT(INDXVAL,1,LEN)," "
+9 IF TYPE=2
WRITE $PIECE("Package^Class^Type^Procedure^Specialty",U,D0),": ",$EXTRACT(INDXVAL,1,LEN),$EXTRACT(SPACES,1,LEN-$LENGTH(INDXVAL))
+10 QUIT
End DoDot:1
+11 SET LINENUM=LINENUM+1
IF LINENUM>(IOSL-3)
DO HEADER(TYPE)
IF RET="^"
QUIT
+12 QUIT
+13 ;
+14 ; Entry point for the summary report option (MAG IMAGE INDEX SUMMARY REPORT)
SUMMARY NEW ZTSAVE,DETAIL
ALL READ !!,"Display data for all images? N // ",DETAIL:DTIME
+1 SET DETAIL=$$UCASE^MAGXCVP(DETAIL)
IF DETAIL="^"
GOTO DONE
+2 IF DETAIL'="Y"
SET DETAIL="N"
+3 SET ZTSAVE("DETAIL")=DETAIL
+4 DO EN^XUTMDEVQ("SUMMARY1^"_$TEXT(+0),"Print Image Index Summary Report",.ZTSAVE)
+5 GOTO DONE
+6 ;
SUMMARY1 NEW SUMMARY,SUMDATA,PAGE,LINENUM,RET,MAGIEN
+1 IF IOM'=132
WRITE !,"This report must be run on a 132-column device. Goodbye!"
QUIT
+2 SET SUMMARY=""
SET PAGE=0
SET LINENUM=0
SET RET=""
DO HEADER(2)
+3 FOR
SET SUMMARY=$ORDER(^XTMP("MAG30P25","SUMMARY",SUMMARY))
if SUMMARY=""!(RET="^")
QUIT
Begin DoDot:1
+4 SET SUMDATA=$GET(^XTMP("MAG30P25","SUMMARY",SUMMARY))
+5 DO INDICES(U_SUMMARY,2)
IF RET="^"
QUIT
+6 WRITE !
SET LINENUM=LINENUM+1
IF LINENUM>(IOSL-3)
DO HEADER(2)
IF RET="^"
QUIT
+7 IF DETAIL="Y"
DO DETL(SUMMARY)
IF RET="^"
QUIT
+8 IF DETAIL="N"
DO SUMM(SUMDATA)
IF RET="^"
QUIT
+9 WRITE !
FOR I=1:1:132
WRITE "-"
+10 SET LINENUM=LINENUM+1
IF LINENUM>(IOSL-3)
DO HEADER(2)
IF RET="^"
QUIT
+11 QUIT
End DoDot:1
+12 IF RET="^"
QUIT
+13 WRITE !!,"Index Commit History:"
SET LINENUM=LINENUM+1
IF LINENUM>(IOSL-3)
DO HEADER(2)
IF RET="^"
QUIT
+14 FOR I=1:1:+$GET(^XTMP("MAG30P25","HISTORY"))
if I=""
QUIT
Begin DoDot:1
+15 SET SUMDATA=$GET(^XTMP("MAG30P25","HISTORY",I))
+16 WRITE !?2,I,?8,$PIECE(SUMDATA,U),"-",$PIECE(SUMDATA,U,3)," started on ",$PIECE(SUMDATA,U,2),", finished on ",$PIECE(SUMDATA,U,4)
+17 SET LINENUM=LINENUM+1
IF LINENUM>(IOSL-3)
DO HEADER(2)
IF RET="^"
QUIT
+18 QUIT
End DoDot:1
+19 QUIT
+20 ;
+21 ; Print the header of the report
NEW I,STATUS
+1 SET STATUS=$GET(^XTMP("MAG30P25","SUMMARY"))
+2 IF PAGE>0
IF IOT="TRM"!(IOT="VTRM")
READ !!,"Press <RETURN> to continue, or '^' to exit: ",RET:DTIME
IF RET="^"
QUIT
+3 SET LINENUM=$PIECE("6^5",U,TYPE)
SET PAGE=PAGE+1
+4 if PAGE>0
WRITE #
WRITE !
FOR I=1:1:132
WRITE "-"
+5 WRITE !?53,"Image Index Report ",$SELECT(TYPE=1:"Detail",1:"Summary"),?106,"Page #",PAGE
+6 IF TYPE=1
Begin DoDot:1
+7 WRITE !,"Img ID",?9,"Procedure",?27,"Short Description",?56,"Parent Data File"
+8 WRITE ?78,"Document Category",?103,"Obj. Type",?120,"User Type"
+9 WRITE !?9,"Package",?27,"Class",?36,"Type",?56,"Procedure/Event",?78,"Specialty"
+10 QUIT
End DoDot:1
+11 IF TYPE=2
Begin DoDot:1
+12 WRITE !?40,"Compiled: ",$PIECE(STATUS,U,2),"-",$PIECE(STATUS,U,4)
+13 WRITE !?(132-11-$LENGTH($PIECE(STATUS,U))-$LENGTH($PIECE(STATUS,U,3))/2),"Image IDs: ",$PIECE(STATUS,U),"-",$PIECE(STATUS,U,3)
+14 QUIT
End DoDot:1
+15 WRITE !
FOR I=1:1:132
WRITE "-"
+16 QUIT
+17 ;
SUMM(SUMDATA) WRITE !,"Total: ",$PIECE(SUMDATA,U),?15,"First IEN: ",$PIECE(SUMDATA,U,2),?35,"Last IEN: ",$PIECE(SUMDATA,U,3)
+1 SET LINENUM=LINENUM+2
IF LINENUM>(IOSL-3)
DO HEADER(2)
IF RET="^"
QUIT
+2 WRITE !,"Img ID",?9,"Procedure",?27,"Short Description",?56,"Parent Data File"
+3 WRITE ?78,"Document Category",?103,"Obj. Type",?120,"User Type"
+4 SET LINENUM=LINENUM+1
IF LINENUM>(IOSL-3)
DO HEADER(2)
IF RET="^"
QUIT
+5 ;D REPONE($P(SUMDATA,U,2),2) I RET="^" Q
+6 IF $PIECE(SUMDATA,U,2)'=$PIECE(SUMDATA,U,3)
Begin DoDot:1
+7 ;D REPONE($P(SUMDATA,U,3),2) I RET="^" Q
+8 QUIT
End DoDot:1
IF RET="^"
QUIT
+9 QUIT
+10 ;
DETL(SUMMARY) NEW MAGIEN
+1 WRITE !,"Img ID",?9,"Procedure",?27,"Short Description",?56,"Parent Data File"
+2 WRITE ?78,"Document Category",?103,"Obj. Type",?120,"User Type"
+3 SET LINENUM=LINENUM+2
IF LINENUM>(IOSL-3)
DO HEADER(2)
IF RET="^"
QUIT
+4 SET MAGIEN=""
FOR
SET MAGIEN=$ORDER(^XTMP("MAG30P25","SUMMARY",SUMMARY,MAGIEN))
if MAGIEN=""!(RET="^")
QUIT
Begin DoDot:1
+5 DO REPONE(MAGIEN,2)
IF RET="^"
QUIT
+6 QUIT
End DoDot:1
+7 QUIT
+8 ;
DONE WRITE !!,"Done!"
+1 QUIT
+2 ;
+3 ; Entry point for the status report option (MAG IMAGE INDEX STATUS)
STATUS NEW STDATA,STFLAG,TASKNUM
+1 SET STDATA=$GET(^XTMP("MAG30P25","STATUS"))
SET STFLAG=$PIECE(STDATA,U,13)
SET TASKNUM=$PIECE(STDATA,U,14)
+2 WRITE !
FOR CT=1:1:80
WRITE "-"
+3 WRITE !,"Current status: ",$$ST
IF TASKNUM>0
WRITE " (#",TASKNUM,")"
+4 WRITE ?60,"Current IEN: ",$PIECE(STDATA,U,((STFLAG>3)+1)*6)
+5 WRITE !!,"Last generation started on: ",$PIECE(STDATA,U,3),?53,"Starting IEN: ",$PIECE(STDATA,U,2)
+6 WRITE !?18,"ended on: ",$PIECE(STDATA,U,5),?55,"Ending IEN: ",$PIECE(STDATA,U,4)
+7 WRITE !!?4,"Last commit started on: ",$PIECE(STDATA,U,9),?53,"Starting IEN: ",$PIECE(STDATA,U,8)
+8 WRITE !?18,"ended on: ",$PIECE(STDATA,U,11),?55,"Ending IEN: ",$PIECE(STDATA,U,10)
+9 WRITE !
FOR CT=1:1:80
WRITE "-"
+10 QUIT
+11 ;
ST() NEW STDATA,STFLAG,STATUS
+1 SET STDATA=$GET(^XTMP("MAG30P25","STATUS"))
+2 SET STFLAG=$PIECE(STDATA,U,13)
+3 IF +STFLAG=0
QUIT "Image index conversion not started yet"
+4 SET STATUS="Image index "_$SELECT(STFLAG<4:"generation",1:"commit")_" "_$SELECT(STFLAG#3=0:"done",STFLAG#3=1:"in progress",1:"aborted")
+5 QUIT STATUS
+6 ;