FSCRU ;SLC/STAFF-NOIS Report Utility ;8/29/94 10:20
;;1.1;NOIS;;Sep 06, 1998
;
DISPLAY(DISPLAY,OK) ; from FSCOPT, FSCRPTS
N DIR,X,Y K DIR S DISPLAY="",OK=1
S DIR(0)="SAMO^DEVICE:DEVICE;VIEW:VIEW",DIR("A")="Select (D)evice or (V)iew: ",DIR("B")="View"
S DIR("?",1)="Enter DEVICE to display the report to the screen or queue to a device."
S DIR("?",2)="Enter VIEW to display the report on the NOIS View Screen using List Manager."
S DIR("?")="^D HELP^FSCU(.DIR)"
S DIR("??")="FSC U1 NOIS"
D ^DIR K DIR
I $D(DIRUT) S OK=0 Q
S DISPLAY=Y
Q
;
PT ; from FSCLMP
D DEV("VALM*",VALMAR,"DQPT^FSCRUDQ","NOIS - Print Text",.OK)
Q
;
PS ; from FSCLMP
D DEV("VALM*",VALMAR,"DQPS^FSCRUDQ","NOIS - Print Screen",.OK)
Q
;
DEV(SAVE,SAVEG,RTN,DESC,OK) ; from FSCOPT, FSCRPTS
I '$L($G(RTN)) Q
N %ZIS,FIRST,FSCDEV,PAGEBRK,POP,ZTDESC,ZTIO,ZTRTN,ZTSAVE,ZTSK K %ZIS,ZTSAVE S (FSCDEV,OK)=1,PAGEBRK=0
I $P($G(FSCSTYLE(0)),U,8),$L($G(DESC)),DESC'["Print Screen" S OK=1 D I 'OK Q
.I DESC="NOIS Report" D PAGEBRK(.PAGEBRK,.OK) Q
.I $L($G(VALMAR)),@VALMAR>1 D PAGEBRK(.PAGEBRK,.OK) Q
.I $G(SAVEG)="^TMP(""FSC LIST"",$J," S FIRST=$O(^TMP("FSC LIST",$J,0)) I FIRST,$O(^(FIRST)) D PAGEBRK(.PAGEBRK,.OK)
D
.S %ZIS="Q",%ZIS("B")=""
.D ^%ZIS I POP S OK=0 Q
.I $G(IO("Q"))'=1 D @RTN Q
.S ZTIO=ION_";"_IOST I $L($G(IO("DOC"))) S ZTIO=ZTIO_";"_IO("DOC")
.S ZTSAVE("FSC*")="",ZTSAVE("PAGEBRK")=""
.I $L($G(SAVE)) S ZTSAVE(SAVE)=""
.I $L($G(SAVEG)) S ZTSAVE(SAVEG)="",SAVEG=$E(SAVEG,1,$L(SAVEG)-1)_",",ZTSAVE(SAVEG)=""
.S ZTRTN=RTN
.S ZTDESC=$G(DESC)
.D ^%ZTLOAD
.W !,$S($D(ZTSK):"Request queued",1:"Request cancelled")
.D HOME^%ZIS
W ! D ^%ZISC
Q
;
PAGEBRK(PAGEBRK,OK) ;
N DIR,X,Y K DIR S PAGEBRK=0
S DIR(0)="YAO",DIR("A")="Start each call on a new page: ",DIR("B")="NO"
S DIR("?",1)="Enter YES to have each call begin on a new page."
S DIR("?",2)="Enter NO to simply print the display text."
S DIR("?")="^D HELP^FSCU(.DIR)"
S DIR("??")="FSC U1 NOIS"
D ^DIR K DIR
I $D(DIRUT) S OK=0 Q
I Y=1 S PAGEBRK=1
Q
;
REPLACE(STR,CHAR,WITH) ; $$(string,replace characters,with characters) -> new string
N ARRAY K ARRAY
S ARRAY(CHAR)=WITH
Q $$REPLACE^XLFSTR(STR,.ARRAY)
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HFSCRU 2235 printed Dec 13, 2024@02:20:08 Page 2
FSCRU ;SLC/STAFF-NOIS Report Utility ;8/29/94 10:20
+1 ;;1.1;NOIS;;Sep 06, 1998
+2 ;
DISPLAY(DISPLAY,OK) ; from FSCOPT, FSCRPTS
+1 NEW DIR,X,Y
KILL DIR
SET DISPLAY=""
SET OK=1
+2 SET DIR(0)="SAMO^DEVICE:DEVICE;VIEW:VIEW"
SET DIR("A")="Select (D)evice or (V)iew: "
SET DIR("B")="View"
+3 SET DIR("?",1)="Enter DEVICE to display the report to the screen or queue to a device."
+4 SET DIR("?",2)="Enter VIEW to display the report on the NOIS View Screen using List Manager."
+5 SET DIR("?")="^D HELP^FSCU(.DIR)"
+6 SET DIR("??")="FSC U1 NOIS"
+7 DO ^DIR
KILL DIR
+8 IF $DATA(DIRUT)
SET OK=0
QUIT
+9 SET DISPLAY=Y
+10 QUIT
+11 ;
PT ; from FSCLMP
+1 DO DEV("VALM*",VALMAR,"DQPT^FSCRUDQ","NOIS - Print Text",.OK)
+2 QUIT
+3 ;
PS ; from FSCLMP
+1 DO DEV("VALM*",VALMAR,"DQPS^FSCRUDQ","NOIS - Print Screen",.OK)
+2 QUIT
+3 ;
DEV(SAVE,SAVEG,RTN,DESC,OK) ; from FSCOPT, FSCRPTS
+1 IF '$LENGTH($GET(RTN))
QUIT
+2 NEW %ZIS,FIRST,FSCDEV,PAGEBRK,POP,ZTDESC,ZTIO,ZTRTN,ZTSAVE,ZTSK
KILL %ZIS,ZTSAVE
SET (FSCDEV,OK)=1
SET PAGEBRK=0
+3 IF $PIECE($GET(FSCSTYLE(0)),U,8)
IF $LENGTH($GET(DESC))
IF DESC'["Print Screen"
SET OK=1
Begin DoDot:1
+4 IF DESC="NOIS Report"
DO PAGEBRK(.PAGEBRK,.OK)
QUIT
+5 IF $LENGTH($GET(VALMAR))
IF @VALMAR>1
DO PAGEBRK(.PAGEBRK,.OK)
QUIT
+6 IF $GET(SAVEG)="^TMP(""FSC LIST"",$J,"
SET FIRST=$ORDER(^TMP("FSC LIST",$JOB,0))
IF FIRST
IF $ORDER(^(FIRST))
DO PAGEBRK(.PAGEBRK,.OK)
End DoDot:1
IF 'OK
QUIT
+7 Begin DoDot:1
+8 SET %ZIS="Q"
SET %ZIS("B")=""
+9 DO ^%ZIS
IF POP
SET OK=0
QUIT
+10 IF $GET(IO("Q"))'=1
DO @RTN
QUIT
+11 SET ZTIO=ION_";"_IOST
IF $LENGTH($GET(IO("DOC")))
SET ZTIO=ZTIO_";"_IO("DOC")
+12 SET ZTSAVE("FSC*")=""
SET ZTSAVE("PAGEBRK")=""
+13 IF $LENGTH($GET(SAVE))
SET ZTSAVE(SAVE)=""
+14 IF $LENGTH($GET(SAVEG))
SET ZTSAVE(SAVEG)=""
SET SAVEG=$EXTRACT(SAVEG,1,$LENGTH(SAVEG)-1)_","
SET ZTSAVE(SAVEG)=""
+15 SET ZTRTN=RTN
+16 SET ZTDESC=$GET(DESC)
+17 DO ^%ZTLOAD
+18 WRITE !,$SELECT($DATA(ZTSK):"Request queued",1:"Request cancelled")
+19 DO HOME^%ZIS
End DoDot:1
+20 WRITE !
DO ^%ZISC
+21 QUIT
+22 ;
PAGEBRK(PAGEBRK,OK) ;
+1 NEW DIR,X,Y
KILL DIR
SET PAGEBRK=0
+2 SET DIR(0)="YAO"
SET DIR("A")="Start each call on a new page: "
SET DIR("B")="NO"
+3 SET DIR("?",1)="Enter YES to have each call begin on a new page."
+4 SET DIR("?",2)="Enter NO to simply print the display text."
+5 SET DIR("?")="^D HELP^FSCU(.DIR)"
+6 SET DIR("??")="FSC U1 NOIS"
+7 DO ^DIR
KILL DIR
+8 IF $DATA(DIRUT)
SET OK=0
QUIT
+9 IF Y=1
SET PAGEBRK=1
+10 QUIT
+11 ;
REPLACE(STR,CHAR,WITH) ; $$(string,replace characters,with characters) -> new string
+1 NEW ARRAY
KILL ARRAY
+2 SET ARRAY(CHAR)=WITH
+3 QUIT $$REPLACE^XLFSTR(STR,.ARRAY)