FSCFORMU ;SLC/STAFF-NOIS Format Utility ;8/25/94 09:05
;;1.1;NOIS;;Sep 06, 1998
;
SETUP(LISTNUM,CALLNUM,FORMAT,STYLE,LINECNT,TYPE) ; from FSCFORMB, FSCFORMC, FSCFORMD, FSCRS
N COLUMN,LINE,MULT,MULTCNT,SECTION,VIDEO
S STYLE=TYPE_STYLE
S SECTION=0 F S SECTION=$O(FORMAT(SECTION)) Q:SECTION<1 D
.I '$L(FORMAT(SECTION)) D Q
..F LINE=1:1 Q:$O(FORMAT(SECTION,LINE-.1))<1 D ; formats non sequential lines
...S LINECNT=LINECNT+1,^TMP(STYLE,$J,LISTNUM,LINECNT,0)=$G(FORMAT(SECTION,LINE)) I (LINECNT#10)=0,'$G(FSCDEV) W "."
...S COLUMN=0 F S COLUMN=$O(FORMAT(SECTION,LINE,COLUMN)) Q:COLUMN<1 D
....S VIDEO=FORMAT(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=FORMAT(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
Q
;
VIEW(LISTNUM,CALLNUM,FORMAT,STYLE,LINECNT,TYPE) ; from FSCFORMB, FSCFORMC, FSCFORMD, FSCRS
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(FORMAT(SECTION)) Q:SECTION<1 D
.I '$L(FORMAT(SECTION)) D Q
..F LINE=1:1 Q:$O(FORMAT(SECTION,LINE-.1))<1 D ; formats non sequential lines
...S LINECNT=LINECNT+1,^TMP(STYLE,$J,LINECNT,0)=$G(FORMAT(SECTION,LINE)) I (LINECNT#10)=0,'$G(FSCDEV) W "."
...S COLUMN=0 F S COLUMN=$O(FORMAT(SECTION,LINE,COLUMN)) Q:COLUMN<1 D
....S VIDEO=FORMAT(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=FORMAT(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)=""
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
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HFSCFORMU 2390 printed Dec 13, 2024@02:17:52 Page 2
FSCFORMU ;SLC/STAFF-NOIS Format Utility ;8/25/94 09:05
+1 ;;1.1;NOIS;;Sep 06, 1998
+2 ;
SETUP(LISTNUM,CALLNUM,FORMAT,STYLE,LINECNT,TYPE) ; from FSCFORMB, FSCFORMC, FSCFORMD, FSCRS
+1 NEW COLUMN,LINE,MULT,MULTCNT,SECTION,VIDEO
+2 SET STYLE=TYPE_STYLE
+3 SET SECTION=0
FOR
SET SECTION=$ORDER(FORMAT(SECTION))
if SECTION<1
QUIT
Begin DoDot:1
+4 IF '$LENGTH(FORMAT(SECTION))
Begin DoDot:2
+5 ; formats non sequential lines
FOR LINE=1:1
if $ORDER(FORMAT(SECTION,LINE-.1))<1
QUIT
Begin DoDot:3
+6 SET LINECNT=LINECNT+1
SET ^TMP(STYLE,$JOB,LISTNUM,LINECNT,0)=$GET(FORMAT(SECTION,LINE))
IF (LINECNT#10)=0
IF '$GET(FSCDEV)
WRITE "."
+7 SET COLUMN=0
FOR
SET COLUMN=$ORDER(FORMAT(SECTION,LINE,COLUMN))
if COLUMN<1
QUIT
Begin DoDot:4
+8 SET VIDEO=FORMAT(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=FORMAT(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 QUIT
+14 ;
VIEW(LISTNUM,CALLNUM,FORMAT,STYLE,LINECNT,TYPE) ; from FSCFORMB, FSCFORMC, FSCFORMD, FSCRS
+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(FORMAT(SECTION))
if SECTION<1
QUIT
Begin DoDot:1
+7 IF '$LENGTH(FORMAT(SECTION))
Begin DoDot:2
+8 ; formats non sequential lines
FOR LINE=1:1
if $ORDER(FORMAT(SECTION,LINE-.1))<1
QUIT
Begin DoDot:3
+9 SET LINECNT=LINECNT+1
SET ^TMP(STYLE,$JOB,LINECNT,0)=$GET(FORMAT(SECTION,LINE))
IF (LINECNT#10)=0
IF '$GET(FSCDEV)
WRITE "."
+10 SET COLUMN=0
FOR
SET COLUMN=$ORDER(FORMAT(SECTION,LINE,COLUMN))
if COLUMN<1
QUIT
Begin DoDot:4
+11 SET VIDEO=FORMAT(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=FORMAT(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 QUIT
+17 ;
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