FSCFORMY ;SLC/STAFF-NOIS Format Utility Statistics ;1/11/98 15:49
;;1.1;NOIS;;Sep 06, 1998
;
SETUP(LISTNUM,CALLNUM,STYLE,LINECNT,TYPE) ; from FSCFORMX
N COLUMN,LINE,MULT,MULTCNT,SECTION,VIDEO
S STYLE=TYPE_STYLE
S SECTION=0 F S SECTION=$O(^TMP("FSC STAT FORMAT",$J,SECTION)) Q:SECTION<1 D
.I '$L(^TMP("FSC STAT FORMAT",$J,SECTION)) D Q
..F LINE=1:1 Q:$O(^TMP("FSC STAT FORMAT",$J,SECTION,LINE-.1))<1 D ; formats non sequential lines
...S LINECNT=LINECNT+1,^TMP(STYLE,$J,LISTNUM,LINECNT,0)=$G(^TMP("FSC STAT FORMAT",$J,SECTION,LINE)) I (LINECNT#10)=0,'$G(FSCDEV) W "."
...S COLUMN=0 F S COLUMN=$O(^TMP("FSC STAT FORMAT",$J,SECTION,LINE,COLUMN)) Q:COLUMN<1 D
....S VIDEO=^TMP("FSC STAT FORMAT",$J,SECTION,LINE,COLUMN) I $L(VIDEO),$D(VALMAR),$D(VALMCC) D CNTRL^VALM10(LINECNT,COLUMN,$P(VIDEO,U),$P(VIDEO,U,2),$P(VIDEO,U,3))
.S MULT=^TMP("FSC STAT FORMAT",$J,SECTION),MULTCNT=0,LINE=$$START(CALLNUM,STYLE,MULT) F S LINE=$O(@MULT@(LINE)) Q:LINE<1 D
..S MULTCNT=MULTCNT+1
..S LINECNT=LINECNT+1,^TMP(STYLE,$J,LISTNUM,LINECNT,0)=$G(@MULT@(LINE,0)) I (LINECNT#10)=0,'$G(FSCDEV) W "."
S ^TMP(STYLE,$J,LISTNUM)="1^"_LINECNT ; used as VALMCNT for this style
K ^TMP("FSC STAT FORMAT",$J)
Q
;
VIEW(LISTNUM,CALLNUM,STYLE,LINECNT,TYPE) ; from FSCFORMX
N COLUMN,LINE,MULT,MULTCNT,SECTION,VIDEO
S STYLE=TYPE_STYLE
S LINECNT=LINECNT+1
S ^TMP(STYLE,$J,LINECNT,0)=$S(STYLE'["STAT":$G(^TMP("FSC LIST CALLS",$J,LISTNUM,0)),1:"COUNTS OF ITEMS")
S ^TMP(STYLE,$J,"IDX",LISTNUM,LINECNT)=""
S SECTION=0 F S SECTION=$O(^TMP("FSC STAT FORMAT",$J,SECTION)) Q:SECTION<1 D
.I '$L(^TMP("FSC STAT FORMAT",$J,SECTION)) D Q
..F LINE=1:1 Q:$O(^TMP("FSC STAT FORMAT",$J,SECTION,LINE-.1))<1 D ; formats non sequential lines
...S LINECNT=LINECNT+1,^TMP(STYLE,$J,LINECNT,0)=$G(^TMP("FSC STAT FORMAT",$J,SECTION,LINE)) I (LINECNT#10)=0,'$G(FSCDEV) W "."
...S COLUMN=0 F S COLUMN=$O(^TMP("FSC STAT FORMAT",$J,SECTION,LINE,COLUMN)) Q:COLUMN<1 D
....S VIDEO=^TMP("FSC STAT FORMAT",$J,SECTION,LINE,COLUMN) I $L(VIDEO),$D(VALMAR),$D(VALMCC) D CNTRL^VALM10(LINECNT,COLUMN,$P(VIDEO,U),$P(VIDEO,U,2),$P(VIDEO,U,3))
.S MULT=^TMP("FSC STAT FORMAT",$J,SECTION),MULTCNT=0,LINE=$$START(CALLNUM,STYLE,MULT) F S LINE=$O(@MULT@(LINE)) Q:LINE<1 D
..S MULTCNT=MULTCNT+1
..S LINECNT=LINECNT+1,^TMP(STYLE,$J,LINECNT,0)=$G(@MULT@(LINE,0)) I (LINECNT#10)=0,'$G(FSCDEV) W "."
S LINECNT=LINECNT+1,$P(^TMP(STYLE,$J,LINECNT,0),"=",80)=""
K ^TMP("FSC STAT FORMAT",$J)
Q
;
START(CALLNUM,STYLE,MULT) ; determines start of text
I STYLE'["BRIEF" Q 0
I MULT'[",50)" Q 0
Q $P($G(^FSCD("CALL",CALLNUM,120)),U,6)-1 ; first line of last note
;
SETTEXT(SECTION,LINE,COLUMN,TEXT,ON,OFF) ; from FSCFORMX
S ^TMP("FSC STAT FORMAT",$J,SECTION)="",^TMP("FSC STAT FORMAT",$J,SECTION,LINE)=$$SETSTR^VALM1(TEXT,$G(^TMP("FSC STAT FORMAT",$J,SECTION,LINE)),COLUMN,$L(TEXT))
I $L($G(ON))!$L($G(OFF)) S ^TMP("FSC STAT FORMAT",$J,SECTION,LINE,COLUMN)=$L(TEXT)_U_$G(ON)_U_$G(OFF)
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HFSCFORMY 2994 printed Nov 22, 2024@17:27:55 Page 2
FSCFORMY ;SLC/STAFF-NOIS Format Utility Statistics ;1/11/98 15:49
+1 ;;1.1;NOIS;;Sep 06, 1998
+2 ;
SETUP(LISTNUM,CALLNUM,STYLE,LINECNT,TYPE) ; from FSCFORMX
+1 NEW COLUMN,LINE,MULT,MULTCNT,SECTION,VIDEO
+2 SET STYLE=TYPE_STYLE
+3 SET SECTION=0
FOR
SET SECTION=$ORDER(^TMP("FSC STAT FORMAT",$JOB,SECTION))
if SECTION<1
QUIT
Begin DoDot:1
+4 IF '$LENGTH(^TMP("FSC STAT FORMAT",$JOB,SECTION))
Begin DoDot:2
+5 ; formats non sequential lines
FOR LINE=1:1
if $ORDER(^TMP("FSC STAT FORMAT",$JOB,SECTION,LINE-.1))<1
QUIT
Begin DoDot:3
+6 SET LINECNT=LINECNT+1
SET ^TMP(STYLE,$JOB,LISTNUM,LINECNT,0)=$GET(^TMP("FSC STAT FORMAT",$JOB,SECTION,LINE))
IF (LINECNT#10)=0
IF '$GET(FSCDEV)
WRITE "."
+7 SET COLUMN=0
FOR
SET COLUMN=$ORDER(^TMP("FSC STAT FORMAT",$JOB,SECTION,LINE,COLUMN))
if COLUMN<1
QUIT
Begin DoDot:4
+8 SET VIDEO=^TMP("FSC STAT FORMAT",$JOB,SECTION,LINE,COLUMN)
IF $LENGTH(VIDEO)
IF $DATA(VALMAR)
IF $DATA(VALMCC)
DO CNTRL^VALM10(LINECNT,COLUMN,$PIECE(VIDEO,U),$PIECE(VIDEO,U,2),$PIECE(VIDEO,U,3))
End DoDot:4
End DoDot:3
End DoDot:2
QUIT
+9 SET MULT=^TMP("FSC STAT FORMAT",$JOB,SECTION)
SET MULTCNT=0
SET LINE=$$START(CALLNUM,STYLE,MULT)
FOR
SET LINE=$ORDER(@MULT@(LINE))
if LINE<1
QUIT
Begin DoDot:2
+10 SET MULTCNT=MULTCNT+1
+11 SET LINECNT=LINECNT+1
SET ^TMP(STYLE,$JOB,LISTNUM,LINECNT,0)=$GET(@MULT@(LINE,0))
IF (LINECNT#10)=0
IF '$GET(FSCDEV)
WRITE "."
End DoDot:2
End DoDot:1
+12 ; used as VALMCNT for this style
SET ^TMP(STYLE,$JOB,LISTNUM)="1^"_LINECNT
+13 KILL ^TMP("FSC STAT FORMAT",$JOB)
+14 QUIT
+15 ;
VIEW(LISTNUM,CALLNUM,STYLE,LINECNT,TYPE) ; from FSCFORMX
+1 NEW COLUMN,LINE,MULT,MULTCNT,SECTION,VIDEO
+2 SET STYLE=TYPE_STYLE
+3 SET LINECNT=LINECNT+1
+4 SET ^TMP(STYLE,$JOB,LINECNT,0)=$SELECT(STYLE'["STAT":$GET(^TMP("FSC LIST CALLS",$JOB,LISTNUM,0)),1:"COUNTS OF ITEMS")
+5 SET ^TMP(STYLE,$JOB,"IDX",LISTNUM,LINECNT)=""
+6 SET SECTION=0
FOR
SET SECTION=$ORDER(^TMP("FSC STAT FORMAT",$JOB,SECTION))
if SECTION<1
QUIT
Begin DoDot:1
+7 IF '$LENGTH(^TMP("FSC STAT FORMAT",$JOB,SECTION))
Begin DoDot:2
+8 ; formats non sequential lines
FOR LINE=1:1
if $ORDER(^TMP("FSC STAT FORMAT",$JOB,SECTION,LINE-.1))<1
QUIT
Begin DoDot:3
+9 SET LINECNT=LINECNT+1
SET ^TMP(STYLE,$JOB,LINECNT,0)=$GET(^TMP("FSC STAT FORMAT",$JOB,SECTION,LINE))
IF (LINECNT#10)=0
IF '$GET(FSCDEV)
WRITE "."
+10 SET COLUMN=0
FOR
SET COLUMN=$ORDER(^TMP("FSC STAT FORMAT",$JOB,SECTION,LINE,COLUMN))
if COLUMN<1
QUIT
Begin DoDot:4
+11 SET VIDEO=^TMP("FSC STAT FORMAT",$JOB,SECTION,LINE,COLUMN)
IF $LENGTH(VIDEO)
IF $DATA(VALMAR)
IF $DATA(VALMCC)
DO CNTRL^VALM10(LINECNT,COLUMN,$PIECE(VIDEO,U),$PIECE(VIDEO,U,2),$PIECE(VIDEO,U,3))
End DoDot:4
End DoDot:3
End DoDot:2
QUIT
+12 SET MULT=^TMP("FSC STAT FORMAT",$JOB,SECTION)
SET MULTCNT=0
SET LINE=$$START(CALLNUM,STYLE,MULT)
FOR
SET LINE=$ORDER(@MULT@(LINE))
if LINE<1
QUIT
Begin DoDot:2
+13 SET MULTCNT=MULTCNT+1
+14 SET LINECNT=LINECNT+1
SET ^TMP(STYLE,$JOB,LINECNT,0)=$GET(@MULT@(LINE,0))
IF (LINECNT#10)=0
IF '$GET(FSCDEV)
WRITE "."
End DoDot:2
End DoDot:1
+15 SET LINECNT=LINECNT+1
SET $PIECE(^TMP(STYLE,$JOB,LINECNT,0),"=",80)=""
+16 KILL ^TMP("FSC STAT FORMAT",$JOB)
+17 QUIT
+18 ;
START(CALLNUM,STYLE,MULT) ; determines start of text
+1 IF STYLE'["BRIEF"
QUIT 0
+2 IF MULT'[",50)"
QUIT 0
+3 ; first line of last note
QUIT $PIECE($GET(^FSCD("CALL",CALLNUM,120)),U,6)-1
+4 ;
SETTEXT(SECTION,LINE,COLUMN,TEXT,ON,OFF) ; from FSCFORMX
+1 SET ^TMP("FSC STAT FORMAT",$JOB,SECTION)=""
SET ^TMP("FSC STAT FORMAT",$JOB,SECTION,LINE)=$$SETSTR^VALM1(TEXT,$GET(^TMP("FSC STAT FORMAT",$JOB,SECTION,LINE)),COLUMN,$LENGTH(TEXT))
+2 IF $LENGTH($GET(ON))!$LENGTH($GET(OFF))
SET ^TMP("FSC STAT FORMAT",$JOB,SECTION,LINE,COLUMN)=$LENGTH(TEXT)_U_$GET(ON)_U_$GET(OFF)
+3 QUIT