ONCSED03 ;Hines OIFO/SG - EDITS 'RUN BATCH' (REPORT) ; 2/14/07 10:21am
;;2.2;ONCOLOGY;**1**;Jul 31, 2013;Build 8
;
Q
;
;***** PRINTS ADDITIONAL EDIT INFO
;
; EDIEN Internal number of the edit in the list of parsed
; error messages generated by the RBQEXEC^ONCSED0101
;
EDINFO(EDIEN) ;
N DA,DIR,DIROUT,DIRUT,DTOUT,DUOUT,EDTNDX,ESIEN,ESNAME,I,NODE,RC,SL,TMP,X,Y
S RC=0
S ESIEN=+$G(@ONC8MSG@("ES",EDIEN)) Q:ESIEN'>0
S ESNAME=$G(@ONC8MSG@(ESIEN,1)) Q:ESNAME=""
S EDTNDX=+$P($G(@ONC8MSG@(ESIEN,"E",EDIEN,0)),U,3) Q:EDTNDX<0
S SL=$$REPEAT^XLFSTR("- ",$G(IOM,80)\2-1)
;--- Header
S $Y=0 W @IOF,SL
W !,"Additional info on '"_$G(@ONC8MSG@(ESIEN,"E",EDIEN,1))_"'"
W !,SL
;--- Description
S NODE=$$GETEDESC^ONCSED04(.ONCSAPI,ESNAME,EDTNDX)
I NODE'<0 W ! D Q:RC
. S I=0
. F S I=$O(@NODE@(I)) Q:I'>0 D Q:RC
. . W !,@NODE@(I) S RC=$$PAGE1()
;--- Help
S NODE=$$GETEDHLP^ONCSED04(.ONCSAPI,ESNAME,EDTNDX)
I NODE'<0 W ! D Q:RC
. S I=0
. F S I=$O(@NODE@(I)) Q:I'>0 D Q:RC
. . W !,@NODE@(I) S RC=$$PAGE1()
;--- Trailer
W !,SL
S RC=$$PAGE1(,1)
Q
;
;***** PRINTS THE MESSAGES
;
; [.ONCSAPI] Reference to the API descriptor (see ^ONCSAPI)
;
; ONC8MSG Closed root of the list of parsed error messages
; (generated by the RBQEXEC^ONCSED0101)
;
; [FLAGS] Flags that control the output
;
; Return values:
;
; <0 Error Descriptor (see ^ONCSAPI for details)
; 0 Ok
; 1 User canceled the output ('^' was entered)
; 2 Timeout
;
MESSAGES(ONCSAPI,ONC8MSG,FLAGS) ;
N ONCMNL ; Maximum number of lines per page
N ONCPAGE ; Pointers to the beginning of the current page
N ONCESIEN ; Internal number of the current edit set
N ONCEDIEN ; Internal number of the current edit
;
N EDTNDX,ESNAME,IEN,NODE,RC,REPRINT,TMP
S RC=0,REPRINT=1,ONCMNL=$S($G(IOSL)>10:+IOSL,1:24)
;=== Set the pointers to the beginning of the list
S ONCESIEN=$O(@ONC8MSG@(0)),ONCEDIEN=""
S ONCPAGE=ONCESIEN_U_ONCEDIEN
;
;=== Print the messages and process user input
F D Q:RC!(ONCESIEN'>0)
. F Q:ONCESIEN'>0 D Q:RC S ONCESIEN=$O(@ONC8MSG@(ONCESIEN)),ONCEDIEN=""
. . ;--- Edit set name
. . S ESNAME=@ONC8MSG@(ONCESIEN,1)
. . I ONCEDIEN'>0 D Q:RC
. . . I REPRINT S REPRINT=0
. . . E S RC=$$PAGE(3) Q:RC W !!
. . . S TMP=ESNAME_" (Metafile Version: "_$P(@ONC8MSG@(0),U,4)_")"
. . . W TMP,!,$$REPEAT^XLFSTR("-",$L(TMP))
. . . S ONCEDIEN=$O(@ONC8MSG@(ONCESIEN,"E",0))
. . ;---
. . F Q:ONCEDIEN'>0 D Q:RC S ONCEDIEN=$O(@ONC8MSG@(ONCESIEN,"E",ONCEDIEN))
. . . ;--- Edit name
. . . I REPRINT S REPRINT=0
. . . E S RC=$$PAGE(2) Q:RC W !!
. . . W ?2,ONCEDIEN_". "_@ONC8MSG@(ONCESIEN,"E",ONCEDIEN,1)
. . . S NODE=$NA(@ONC8MSG@(ONCESIEN,"E",ONCEDIEN))
. . . ;--- Messages generated by the edit
. . . S IEN=0
. . . F S IEN=$O(@NODE@("M",IEN)) Q:IEN'>0 D Q:RC
. . . . S RC=$$PRTMSG($P(@NODE@("M",IEN,0),U,2),@NODE@("M",IEN,1),5)
. . . Q:RC
. . . ;--- Fields validated by the edit
. . . S IEN=0
. . . F S IEN=$O(@NODE@("F",IEN)) Q:IEN'>0 D Q:RC
. . . . S TMP=$E(@NODE@("F",IEN,1),1,25) ; Name
. . . . S TMP=TMP_" ("_(+$P(@NODE@("F",IEN,0),U))_")" ; Position
. . . . S RC=$$PRTFLD(TMP,$G(@NODE@("F",IEN,2)),9,35)
. ;--- Force the "end of page" prompt after the last
. ;--- portion of the data
. I 'RC,$E(IOST,1,2)="C-",ONCESIEN'>0,$P(ONCPAGE,U,3) D
. . S RC=$$PAGE(,1)
. Q:+RC'=3
. ;--- Display the additional edit info
. D EDINFO(+$P(RC,U,2))
. ;--- Initiate the current page re-print
. W @IOF S ($Y,RC)=0,REPRINT=1
. S ONCESIEN=$P(ONCPAGE,U),ONCEDIEN=$P(ONCPAGE,U,2)
;
;=== Cleanup
K ^UTILITY($J,"W")
Q RC
;
;***** CHECKS IS NEW PAGE OF MESSAGES SHOULD BE STARTED
;
; [RESERVE] Number of additional reserved lines (0, by default).
; If the current page does not have so many lines
; available, a new page will be started.
;
; [FORCE] Force the "end of page" prompt.
;
; Return values:
;
; 0 Ok
; 1 User canceled the output ('^' was entered)
; 2 Timeout
; 3 Display the edit info
;
PAGE(RESERVE,FORCE) ;
N RC,TRM
S RC=0,TRM=($E(IOST,1,2)="C-"),$P(ONCPAGE,U,3)=1
I ($Y'<(ONCMNL-$S(TRM:3,1:1)-$G(RESERVE)))!$G(FORCE) D
. I 'TRM W @IOF S $Y=0 Q
. N DA,DIR,DIROUT,DIRUT,DTOUT,DUOUT,X,Y
. S DIR(0)="FAO^^K:X'?.N X"
. S DIR("A")="RETURN to continue, '^' to exit, or Edit# for help:"
. S DIR("?",1)="Press RETURN key to continue the output, enter '^'"
. S DIR("?",2)="to stop it, or enter the number printed to the left"
. S DIR("?",3)="of the edit name to get additional information about"
. S DIR("?")="this edit."
. W ! D ^DIR
. S RC=$S($D(DUOUT):1,$D(DTOUT):2,1:0) Q:RC
. I X>0 S RC=3_U_(+X) Q
. S $Y=0 W !
. ;--- Mark the beginning of the new page
. S ONCPAGE=ONCESIEN_U_ONCEDIEN
Q RC
;
;***** CHECKS IS NEW PAGE OF THE EDIT INFO SHOULD BE STARTED
;
; [RESERVE] Number of additional reserved lines (0, by default).
; If the current page does not have so many lines
; available, a new page will be started.
;
; [FORCE] Force the prompt
;
; Return values:
;
; 0 Ok
; 1 User canceled the output ('^' was entered)
; 2 Timeout
;
PAGE1(RESERVE,FORCE) ;
N RC,TRM
S RC=0,TRM=($E(IOST,1,2)="C-")
I ($Y'<(ONCMNL-$S(TRM:3,1:1)-$G(RESERVE)))!$G(FORCE) D
. I 'TRM W @IOF S $Y=0 Q
. N DA,DIR,DIROUT,DIRUT,DTOUT,DUOUT,I,X,Y
. S DIR(0)="EA"
. S DIR("A")="Enter RETURN to continue or '^' to return to messages:"
. W ! D ^DIR
. S RC=$S($D(DUOUT):1,$D(DTOUT):2,1:0)
. I 'RC S $Y=0 W !
Q RC
;
;***** PRINTS THE FIELD (INTERNAL)
;
; NAME Field name
; X Field value
; DIWL Left margin for the output
; MNL Maximum length of the field name
;
; Return values:
;
; 0 Ok
; 1 User canceled the output ('^' was entered)
; 2 Timeout
;
PRTFLD(NAME,X,DIWL,MNL) ;
N DIWF,DIWR,I,L,RC,TMP
S DIWF="|",L=MNL+3,DIWR=$G(IOM,80)-L-1
K ^UTILITY($J,"W")
D ^DIWP
;--- Write the name and the first piece of the value
S TMP=DIWL-1,L=L+TMP
W !?TMP,$$LJ^XLFSTR(NAME,MNL)_" = "_$G(^UTILITY($J,"W",DIWL,1,0))
S RC=$$PAGE() Q:RC RC
;--- Write remaining pieces of the value (if any)
S I=1
F S I=$O(^UTILITY($J,"W",DIWL,I)) Q:I'>0 D Q:RC
. W !?L,$G(^UTILITY($J,"W",DIWL,I,0))
. S RC=$$PAGE()
Q RC
;
;***** PRINTS THE MESSAGE (INTERNAL)
;
; TYPE Message type
; X Message text
; DIWL Left margin for the output
;
; Return values:
;
; 0 Ok
; 1 User canceled the output ('^' was entered)
; 2 Timeout
;
PRTMSG(TYPE,X,DIWL) ;
N DIWF,DIWR,I,L,RC,TMP
S DIWF="|",L=$L(TYPE)+1,DIWR=$G(IOM,80)-L-1
K ^UTILITY($J,"W")
D ^DIWP
;--- Write the type and first piece of the name
S TMP=DIWL-1,L=L+TMP
W !?TMP,TYPE_":"_$G(^UTILITY($J,"W",DIWL,1,0))
S RC=$$PAGE() Q:RC RC
;--- Write remaing pieces of the name (if any)
S I=1
F S I=$O(^UTILITY($J,"W",DIWL,I)) Q:I'>0 D Q:RC
. W !?L,$G(^UTILITY($J,"W",DIWL,I,0))
. S RC=$$PAGE()
Q RC
;
;***** PRINTS THE TOTALS
;
; [.ONCSAPI] Reference to the API descriptor (see ^ONCSAPI)
;
; ONC8MSG Closed root of the list of parsed error messages
; (generated by the RBQEXEC^ONCSED0101)
;
; [FLAGS] Flags that control the output
;
; Return values:
;
; <0 Error Descriptor (see ^ONCSAPI for details)
; 0 Ok
; 1 User canceled the output ('^' was entered)
; 2 Timeout
;
TOTALS(ONCSAPI,ONC8MSG,FLAGS) ;
N EDIEN,ESIEN,IEN,ONCMNL,RC,TMP
S RC=0,ONCMNL=$S($G(IOSL)>10:+IOSL,1:20)
;--- Header
S RC=$$PAGE(3) Q:RC RC
W !!,$$LJ^XLFSTR("Edit Set","50T")_" Errors Warnings"
W !,$$REPEAT^XLFSTR("-",50)_" ------ --------"
;--- Edit set totals
S ESIEN=0
F S ESIEN=$O(@ONC8MSG@(ESIEN)) Q:ESIEN'>0 D Q:RC
. W !,$$LJ^XLFSTR(@ONC8MSG@(ESIEN,1),"50T")
. S TMP=$G(@ONC8MSG@(ESIEN,0))
. W " "_$J($P(TMP,U,1),6)_" "_$J($P(TMP,U,2),8)
. S RC=$$PAGE() Q:RC
Q RC
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HONCSED03 8381 printed Dec 13, 2024@02:28:15 Page 2
ONCSED03 ;Hines OIFO/SG - EDITS 'RUN BATCH' (REPORT) ; 2/14/07 10:21am
+1 ;;2.2;ONCOLOGY;**1**;Jul 31, 2013;Build 8
+2 ;
+3 QUIT
+4 ;
+5 ;***** PRINTS ADDITIONAL EDIT INFO
+6 ;
+7 ; EDIEN Internal number of the edit in the list of parsed
+8 ; error messages generated by the RBQEXEC^ONCSED0101
+9 ;
EDINFO(EDIEN) ;
+1 NEW DA,DIR,DIROUT,DIRUT,DTOUT,DUOUT,EDTNDX,ESIEN,ESNAME,I,NODE,RC,SL,TMP,X,Y
+2 SET RC=0
+3 SET ESIEN=+$GET(@ONC8MSG@("ES",EDIEN))
if ESIEN'>0
QUIT
+4 SET ESNAME=$GET(@ONC8MSG@(ESIEN,1))
if ESNAME=""
QUIT
+5 SET EDTNDX=+$PIECE($GET(@ONC8MSG@(ESIEN,"E",EDIEN,0)),U,3)
if EDTNDX<0
QUIT
+6 SET SL=$$REPEAT^XLFSTR("- ",$GET(IOM,80)\2-1)
+7 ;--- Header
+8 SET $Y=0
WRITE @IOF,SL
+9 WRITE !,"Additional info on '"_$GET(@ONC8MSG@(ESIEN,"E",EDIEN,1))_"'"
+10 WRITE !,SL
+11 ;--- Description
+12 SET NODE=$$GETEDESC^ONCSED04(.ONCSAPI,ESNAME,EDTNDX)
+13 IF NODE'<0
WRITE !
Begin DoDot:1
+14 SET I=0
+15 FOR
SET I=$ORDER(@NODE@(I))
if I'>0
QUIT
Begin DoDot:2
+16 WRITE !,@NODE@(I)
SET RC=$$PAGE1()
End DoDot:2
if RC
QUIT
End DoDot:1
if RC
QUIT
+17 ;--- Help
+18 SET NODE=$$GETEDHLP^ONCSED04(.ONCSAPI,ESNAME,EDTNDX)
+19 IF NODE'<0
WRITE !
Begin DoDot:1
+20 SET I=0
+21 FOR
SET I=$ORDER(@NODE@(I))
if I'>0
QUIT
Begin DoDot:2
+22 WRITE !,@NODE@(I)
SET RC=$$PAGE1()
End DoDot:2
if RC
QUIT
End DoDot:1
if RC
QUIT
+23 ;--- Trailer
+24 WRITE !,SL
+25 SET RC=$$PAGE1(,1)
+26 QUIT
+27 ;
+28 ;***** PRINTS THE MESSAGES
+29 ;
+30 ; [.ONCSAPI] Reference to the API descriptor (see ^ONCSAPI)
+31 ;
+32 ; ONC8MSG Closed root of the list of parsed error messages
+33 ; (generated by the RBQEXEC^ONCSED0101)
+34 ;
+35 ; [FLAGS] Flags that control the output
+36 ;
+37 ; Return values:
+38 ;
+39 ; <0 Error Descriptor (see ^ONCSAPI for details)
+40 ; 0 Ok
+41 ; 1 User canceled the output ('^' was entered)
+42 ; 2 Timeout
+43 ;
MESSAGES(ONCSAPI,ONC8MSG,FLAGS) ;
+1 ; Maximum number of lines per page
NEW ONCMNL
+2 ; Pointers to the beginning of the current page
NEW ONCPAGE
+3 ; Internal number of the current edit set
NEW ONCESIEN
+4 ; Internal number of the current edit
NEW ONCEDIEN
+5 ;
+6 NEW EDTNDX,ESNAME,IEN,NODE,RC,REPRINT,TMP
+7 SET RC=0
SET REPRINT=1
SET ONCMNL=$SELECT($GET(IOSL)>10:+IOSL,1:24)
+8 ;=== Set the pointers to the beginning of the list
+9 SET ONCESIEN=$ORDER(@ONC8MSG@(0))
SET ONCEDIEN=""
+10 SET ONCPAGE=ONCESIEN_U_ONCEDIEN
+11 ;
+12 ;=== Print the messages and process user input
+13 FOR
Begin DoDot:1
+14 FOR
if ONCESIEN'>0
QUIT
Begin DoDot:2
+15 ;--- Edit set name
+16 SET ESNAME=@ONC8MSG@(ONCESIEN,1)
+17 IF ONCEDIEN'>0
Begin DoDot:3
+18 IF REPRINT
SET REPRINT=0
+19 IF '$TEST
SET RC=$$PAGE(3)
if RC
QUIT
WRITE !!
+20 SET TMP=ESNAME_" (Metafile Version: "_$PIECE(@ONC8MSG@(0),U,4)_")"
+21 WRITE TMP,!,$$REPEAT^XLFSTR("-",$LENGTH(TMP))
+22 SET ONCEDIEN=$ORDER(@ONC8MSG@(ONCESIEN,"E",0))
End DoDot:3
if RC
QUIT
+23 ;---
+24 FOR
if ONCEDIEN'>0
QUIT
Begin DoDot:3
+25 ;--- Edit name
+26 IF REPRINT
SET REPRINT=0
+27 IF '$TEST
SET RC=$$PAGE(2)
if RC
QUIT
WRITE !!
+28 WRITE ?2,ONCEDIEN_". "_@ONC8MSG@(ONCESIEN,"E",ONCEDIEN,1)
+29 SET NODE=$NAME(@ONC8MSG@(ONCESIEN,"E",ONCEDIEN))
+30 ;--- Messages generated by the edit
+31 SET IEN=0
+32 FOR
SET IEN=$ORDER(@NODE@("M",IEN))
if IEN'>0
QUIT
Begin DoDot:4
+33 SET RC=$$PRTMSG($PIECE(@NODE@("M",IEN,0),U,2),@NODE@("M",IEN,1),5)
End DoDot:4
if RC
QUIT
+34 if RC
QUIT
+35 ;--- Fields validated by the edit
+36 SET IEN=0
+37 FOR
SET IEN=$ORDER(@NODE@("F",IEN))
if IEN'>0
QUIT
Begin DoDot:4
+38 ; Name
SET TMP=$EXTRACT(@NODE@("F",IEN,1),1,25)
+39 ; Position
SET TMP=TMP_" ("_(+$PIECE(@NODE@("F",IEN,0),U))_")"
+40 SET RC=$$PRTFLD(TMP,$GET(@NODE@("F",IEN,2)),9,35)
End DoDot:4
if RC
QUIT
End DoDot:3
if RC
QUIT
SET ONCEDIEN=$ORDER(@ONC8MSG@(ONCESIEN,"E",ONCEDIEN))
End DoDot:2
if RC
QUIT
SET ONCESIEN=$ORDER(@ONC8MSG@(ONCESIEN))
SET ONCEDIEN=""
+41 ;--- Force the "end of page" prompt after the last
+42 ;--- portion of the data
+43 IF 'RC
IF $EXTRACT(IOST,1,2)="C-"
IF ONCESIEN'>0
IF $PIECE(ONCPAGE,U,3)
Begin DoDot:2
+44 SET RC=$$PAGE(,1)
End DoDot:2
+45 if +RC'=3
QUIT
+46 ;--- Display the additional edit info
+47 DO EDINFO(+$PIECE(RC,U,2))
+48 ;--- Initiate the current page re-print
+49 WRITE @IOF
SET ($Y,RC)=0
SET REPRINT=1
+50 SET ONCESIEN=$PIECE(ONCPAGE,U)
SET ONCEDIEN=$PIECE(ONCPAGE,U,2)
End DoDot:1
if RC!(ONCESIEN'>0)
QUIT
+51 ;
+52 ;=== Cleanup
+53 KILL ^UTILITY($JOB,"W")
+54 QUIT RC
+55 ;
+56 ;***** CHECKS IS NEW PAGE OF MESSAGES SHOULD BE STARTED
+57 ;
+58 ; [RESERVE] Number of additional reserved lines (0, by default).
+59 ; If the current page does not have so many lines
+60 ; available, a new page will be started.
+61 ;
+62 ; [FORCE] Force the "end of page" prompt.
+63 ;
+64 ; Return values:
+65 ;
+66 ; 0 Ok
+67 ; 1 User canceled the output ('^' was entered)
+68 ; 2 Timeout
+69 ; 3 Display the edit info
+70 ;
PAGE(RESERVE,FORCE) ;
+1 NEW RC,TRM
+2 SET RC=0
SET TRM=($EXTRACT(IOST,1,2)="C-")
SET $PIECE(ONCPAGE,U,3)=1
+3 IF ($Y'<(ONCMNL-$SELECT(TRM:3,1:1)-$GET(RESERVE)))!$GET(FORCE)
Begin DoDot:1
+4 IF 'TRM
WRITE @IOF
SET $Y=0
QUIT
+5 NEW DA,DIR,DIROUT,DIRUT,DTOUT,DUOUT,X,Y
+6 SET DIR(0)="FAO^^K:X'?.N X"
+7 SET DIR("A")="RETURN to continue, '^' to exit, or Edit# for help:"
+8 SET DIR("?",1)="Press RETURN key to continue the output, enter '^'"
+9 SET DIR("?",2)="to stop it, or enter the number printed to the left"
+10 SET DIR("?",3)="of the edit name to get additional information about"
+11 SET DIR("?")="this edit."
+12 WRITE !
DO ^DIR
+13 SET RC=$SELECT($DATA(DUOUT):1,$DATA(DTOUT):2,1:0)
if RC
QUIT
+14 IF X>0
SET RC=3_U_(+X)
QUIT
+15 SET $Y=0
WRITE !
+16 ;--- Mark the beginning of the new page
+17 SET ONCPAGE=ONCESIEN_U_ONCEDIEN
End DoDot:1
+18 QUIT RC
+19 ;
+20 ;***** CHECKS IS NEW PAGE OF THE EDIT INFO SHOULD BE STARTED
+21 ;
+22 ; [RESERVE] Number of additional reserved lines (0, by default).
+23 ; If the current page does not have so many lines
+24 ; available, a new page will be started.
+25 ;
+26 ; [FORCE] Force the prompt
+27 ;
+28 ; Return values:
+29 ;
+30 ; 0 Ok
+31 ; 1 User canceled the output ('^' was entered)
+32 ; 2 Timeout
+33 ;
PAGE1(RESERVE,FORCE) ;
+1 NEW RC,TRM
+2 SET RC=0
SET TRM=($EXTRACT(IOST,1,2)="C-")
+3 IF ($Y'<(ONCMNL-$SELECT(TRM:3,1:1)-$GET(RESERVE)))!$GET(FORCE)
Begin DoDot:1
+4 IF 'TRM
WRITE @IOF
SET $Y=0
QUIT
+5 NEW DA,DIR,DIROUT,DIRUT,DTOUT,DUOUT,I,X,Y
+6 SET DIR(0)="EA"
+7 SET DIR("A")="Enter RETURN to continue or '^' to return to messages:"
+8 WRITE !
DO ^DIR
+9 SET RC=$SELECT($DATA(DUOUT):1,$DATA(DTOUT):2,1:0)
+10 IF 'RC
SET $Y=0
WRITE !
End DoDot:1
+11 QUIT RC
+12 ;
+13 ;***** PRINTS THE FIELD (INTERNAL)
+14 ;
+15 ; NAME Field name
+16 ; X Field value
+17 ; DIWL Left margin for the output
+18 ; MNL Maximum length of the field name
+19 ;
+20 ; Return values:
+21 ;
+22 ; 0 Ok
+23 ; 1 User canceled the output ('^' was entered)
+24 ; 2 Timeout
+25 ;
PRTFLD(NAME,X,DIWL,MNL) ;
+1 NEW DIWF,DIWR,I,L,RC,TMP
+2 SET DIWF="|"
SET L=MNL+3
SET DIWR=$GET(IOM,80)-L-1
+3 KILL ^UTILITY($JOB,"W")
+4 DO ^DIWP
+5 ;--- Write the name and the first piece of the value
+6 SET TMP=DIWL-1
SET L=L+TMP
+7 WRITE !?TMP,$$LJ^XLFSTR(NAME,MNL)_" = "_$GET(^UTILITY($JOB,"W",DIWL,1,0))
+8 SET RC=$$PAGE()
if RC
QUIT RC
+9 ;--- Write remaining pieces of the value (if any)
+10 SET I=1
+11 FOR
SET I=$ORDER(^UTILITY($JOB,"W",DIWL,I))
if I'>0
QUIT
Begin DoDot:1
+12 WRITE !?L,$GET(^UTILITY($JOB,"W",DIWL,I,0))
+13 SET RC=$$PAGE()
End DoDot:1
if RC
QUIT
+14 QUIT RC
+15 ;
+16 ;***** PRINTS THE MESSAGE (INTERNAL)
+17 ;
+18 ; TYPE Message type
+19 ; X Message text
+20 ; DIWL Left margin for the output
+21 ;
+22 ; Return values:
+23 ;
+24 ; 0 Ok
+25 ; 1 User canceled the output ('^' was entered)
+26 ; 2 Timeout
+27 ;
PRTMSG(TYPE,X,DIWL) ;
+1 NEW DIWF,DIWR,I,L,RC,TMP
+2 SET DIWF="|"
SET L=$LENGTH(TYPE)+1
SET DIWR=$GET(IOM,80)-L-1
+3 KILL ^UTILITY($JOB,"W")
+4 DO ^DIWP
+5 ;--- Write the type and first piece of the name
+6 SET TMP=DIWL-1
SET L=L+TMP
+7 WRITE !?TMP,TYPE_":"_$GET(^UTILITY($JOB,"W",DIWL,1,0))
+8 SET RC=$$PAGE()
if RC
QUIT RC
+9 ;--- Write remaing pieces of the name (if any)
+10 SET I=1
+11 FOR
SET I=$ORDER(^UTILITY($JOB,"W",DIWL,I))
if I'>0
QUIT
Begin DoDot:1
+12 WRITE !?L,$GET(^UTILITY($JOB,"W",DIWL,I,0))
+13 SET RC=$$PAGE()
End DoDot:1
if RC
QUIT
+14 QUIT RC
+15 ;
+16 ;***** PRINTS THE TOTALS
+17 ;
+18 ; [.ONCSAPI] Reference to the API descriptor (see ^ONCSAPI)
+19 ;
+20 ; ONC8MSG Closed root of the list of parsed error messages
+21 ; (generated by the RBQEXEC^ONCSED0101)
+22 ;
+23 ; [FLAGS] Flags that control the output
+24 ;
+25 ; Return values:
+26 ;
+27 ; <0 Error Descriptor (see ^ONCSAPI for details)
+28 ; 0 Ok
+29 ; 1 User canceled the output ('^' was entered)
+30 ; 2 Timeout
+31 ;
TOTALS(ONCSAPI,ONC8MSG,FLAGS) ;
+1 NEW EDIEN,ESIEN,IEN,ONCMNL,RC,TMP
+2 SET RC=0
SET ONCMNL=$SELECT($GET(IOSL)>10:+IOSL,1:20)
+3 ;--- Header
+4 SET RC=$$PAGE(3)
if RC
QUIT RC
+5 WRITE !!,$$LJ^XLFSTR("Edit Set","50T")_" Errors Warnings"
+6 WRITE !,$$REPEAT^XLFSTR("-",50)_" ------ --------"
+7 ;--- Edit set totals
+8 SET ESIEN=0
+9 FOR
SET ESIEN=$ORDER(@ONC8MSG@(ESIEN))
if ESIEN'>0
QUIT
Begin DoDot:1
+10 WRITE !,$$LJ^XLFSTR(@ONC8MSG@(ESIEN,1),"50T")
+11 SET TMP=$GET(@ONC8MSG@(ESIEN,0))
+12 WRITE " "_$JUSTIFY($PIECE(TMP,U,1),6)_" "_$JUSTIFY($PIECE(TMP,U,2),8)
+13 SET RC=$$PAGE()
if RC
QUIT
End DoDot:1
if RC
QUIT
+14 QUIT RC