AQAOUTIL ; IHS/ORDC/LJF - QI MANAGEMENT UTILITY RTN ;
;;1.01;QAI MANAGEMENT;;OCT 05, 1995
;
;This rtn contains frequently used subrtns. They include the
;initialization of varialbes for printing reports, end-of-page
;control, a basic report heading, the question of printing a report
;in ASCII format, and the killing of local variables.
;
Q
INIT ;ENTRY POINT >>> initialize variables <<<
S:'$D(AQAOIOMX) AQAOIOMX=$S($D(IOM):IOM,1:80)
S AQAOPAGE=0,AQAOSTOP="",AQAODUZ=$P(^VA(200,DUZ,0),U,2)
S AQAOSITE=$P(^DIC(4,DUZ(2),0),U) ;set site
S AQAOLINE="",$P(AQAOLINE,"=",AQAOIOMX)=""
S AQAOLIN2="",$P(AQAOLIN2,"-",AQAOIOMX)=""
Q
;
;
NEWPG ;ENTRY POINT >>> SUBRTN for end of page control
I IOST'?1"C-".E D HEADING S AQAOSTOP="" Q
I AQAOPAGE>0 K DIR S DIR(0)="E" D ^DIR S AQAOSTOP=X
I AQAOSTOP'=U D HEADING
Q
;
;
HEADING ;ENTRY POINT >>> SUBRTN to print heading
W:(AQAOPAGE>0) @IOF I AQAOPAGE=0,(IOST["C-") W @IOF
W !,AQAOLINE S AQAOPAGE=AQAOPAGE+1
I $D(AQAOHCON) D
.S X="*****Confidential "_AQAOHCON_" Data Covered by Privacy Act*****"
.W !?AQAOIOMX-$L(X)/2,X
W !,AQAODUZ,?AQAOIOMX-$L(AQAOSITE)/2,AQAOSITE
W ! D TIME
W ?AQAOIOMX-$L(AQAOTY)/2,AQAOTY,?AQAOIOMX-10,"Page: ",AQAOPAGE
S Y=DT X ^DD("DD") W !,Y
Q
;
;
TIME ;ENTRY POINT to print time only
N X
S X=$E($$HTFM^XLFDT($H),1,12)
W $P($$FMTE^XLFDT(X,"2P")," ",2,3)
Q
;
;
EXPORT ;ENTRY POINT for help text and questions about sending ASCII files
;called just prior to %ZIS calls in selected reports
W !! K DIR S DIR(0)="YO",DIR("B")="NO"
S DIR("A")="Do you wish to capture the data into an ASCII file"
S DIR("?",1)=" You can send this report to your personal computer"
S DIR("?",2)=" in ASCII format which is readable to many statistical"
S DIR("?",3)=" PC applications. You must choose a DELIMITER that"
S DIR("?",4)=" your application can understand. This could be a "
S DIR("?",5)=" comma, a slash, a semicolon, or other punctuation to"
S DIR("?",6)=" separate each piece of data. Check the PC software"
S DIR("?",7)=" user manual for your possible choices."
S DIR("?",8)=" Remember to answer the DEVICE question with HOME. The"
S DIR("?",9)=" data file will be displayed on your screen as it is"
S DIR("?",10)=" captured.",DIR("?")=" "
D ^DIR Q:$D(DIRUT) Q:Y'=1
;
DELIM ;ask for delimiter
W !! K DIR S DIR(0)="F^1:1^I Y'?1P S Y=-1"
S DIR("?")="Enter punctuation mark to separate data fields in file."
S DIR("A")="Type in DELIMITER" D ^DIR Q:$D(DIRUT)
I Y=-1 W *7," ??" G DELIM
S AQAODLM=Y
W !!?10,"Start the capture at the device prompt.",!
Q
;
;
DLMHDG ;ENTRY POINT >>> SUBRTN to print ASCII heading
W !
I $D(AQAOHCON) D
.W "*****Confidential "_AQAOHCON_" Data Covered by Privacy Act*****"
W !,AQAODUZ,AQAODLM,AQAOSITE,AQAODLM D TIME
W !,AQAOTY,AQAODLM
S Y=DT X ^DD("DD") W $P(Y,",")," ",$P(Y,",",2),AQAODLM
Q
;
;
KILL ;ENTRY POINT >>> kill statement for options
;
; >>> kill ztsk variables
I $D(ZTQUEUED) S ZTREQ="@" Q
;
; >> kill namespaced variables
D ^AQAOVKL0
;S X="AQAO"
;F S X=$O(@X) Q:X'?1"AQAO".E D
;.K Y F I=1:1:4 I $P($T(SYS+I),";;",2)=X S Y=""
;.Q:$D(Y)
;.K @X
;K AQAO
;
; >>> kill fileman variables
D ^XBFMK
;
; >>> kill non-namespaced variables
K DFN
;
; >> kill single character variables
K X,Y,Z,I,J,K,S,L,N,W
;
Q
;
SYS ;;SYSTEM-WIDE VARIABLES
;;AQAOCHK
;;AQAOENTR
;;AQAOINAC
;;AQAOUA
;;AQAOXYZ
AQAOUTIL ; IHS/ORDC/LJF - QI MANAGEMENT UTILITY RTN ;
+1 ;;1.01;QAI MANAGEMENT;;OCT 05, 1995
+2 ;
+3 ;This rtn contains frequently used subrtns. They include the
+4 ;initialization of varialbes for printing reports, end-of-page
+5 ;control, a basic report heading, the question of printing a report
+6 ;in ASCII format, and the killing of local variables.
+7 ;
+8 QUIT
INIT ;ENTRY POINT >>> initialize variables <<<
+1 IF '$DATA(AQAOIOMX)
SET AQAOIOMX=$SELECT($DATA(IOM):IOM,1:80)
+2 SET AQAOPAGE=0
SET AQAOSTOP=""
SET AQAODUZ=$PIECE(^VA(200,DUZ,0),U,2)
+3 ;set site
SET AQAOSITE=$PIECE(^DIC(4,DUZ(2),0),U)
+4 SET AQAOLINE=""
SET $PIECE(AQAOLINE,"=",AQAOIOMX)=""
+5 SET AQAOLIN2=""
SET $PIECE(AQAOLIN2,"-",AQAOIOMX)=""
+6 QUIT
+7 ;
+8 ;
NEWPG ;ENTRY POINT >>> SUBRTN for end of page control
+1 IF IOST'?1"C-".E
DO HEADING
SET AQAOSTOP=""
QUIT
+2 IF AQAOPAGE>0
KILL DIR
SET DIR(0)="E"
DO ^DIR
SET AQAOSTOP=X
+3 IF AQAOSTOP'=U
DO HEADING
+4 QUIT
+5 ;
+6 ;
HEADING ;ENTRY POINT >>> SUBRTN to print heading
+1 IF (AQAOPAGE>0)
WRITE @IOF
IF AQAOPAGE=0
IF (IOST["C-")
WRITE @IOF
+2 WRITE !,AQAOLINE
SET AQAOPAGE=AQAOPAGE+1
+3 IF $DATA(AQAOHCON)
Begin DoDot:1
+4 SET X="*****Confidential "_AQAOHCON_" Data Covered by Privacy Act*****"
+5 WRITE !?AQAOIOMX-$LENGTH(X)/2,X
End DoDot:1
+6 WRITE !,AQAODUZ,?AQAOIOMX-$LENGTH(AQAOSITE)/2,AQAOSITE
+7 WRITE !
DO TIME
+8 WRITE ?AQAOIOMX-$LENGTH(AQAOTY)/2,AQAOTY,?AQAOIOMX-10,"Page: ",AQAOPAGE
+9 SET Y=DT
XECUTE ^DD("DD")
WRITE !,Y
+10 QUIT
+11 ;
+12 ;
TIME ;ENTRY POINT to print time only
+1 NEW X
+2 SET X=$EXTRACT($$HTFM^XLFDT($HOROLOG),1,12)
+3 WRITE $PIECE($$FMTE^XLFDT(X,"2P")," ",2,3)
+4 QUIT
+5 ;
+6 ;
EXPORT ;ENTRY POINT for help text and questions about sending ASCII files
+1 ;called just prior to %ZIS calls in selected reports
+2 WRITE !!
KILL DIR
SET DIR(0)="YO"
SET DIR("B")="NO"
+3 SET DIR("A")="Do you wish to capture the data into an ASCII file"
+4 SET DIR("?",1)=" You can send this report to your personal computer"
+5 SET DIR("?",2)=" in ASCII format which is readable to many statistical"
+6 SET DIR("?",3)=" PC applications. You must choose a DELIMITER that"
+7 SET DIR("?",4)=" your application can understand. This could be a "
+8 SET DIR("?",5)=" comma, a slash, a semicolon, or other punctuation to"
+9 SET DIR("?",6)=" separate each piece of data. Check the PC software"
+10 SET DIR("?",7)=" user manual for your possible choices."
+11 SET DIR("?",8)=" Remember to answer the DEVICE question with HOME. The"
+12 SET DIR("?",9)=" data file will be displayed on your screen as it is"
+13 SET DIR("?",10)=" captured."
SET DIR("?")=" "
+14 DO ^DIR
IF $DATA(DIRUT)
QUIT
IF Y'=1
QUIT
+15 ;
DELIM ;ask for delimiter
+1 WRITE !!
KILL DIR
SET DIR(0)="F^1:1^I Y'?1P S Y=-1"
+2 SET DIR("?")="Enter punctuation mark to separate data fields in file."
+3 SET DIR("A")="Type in DELIMITER"
DO ^DIR
IF $DATA(DIRUT)
QUIT
+4 IF Y=-1
WRITE *7," ??"
GOTO DELIM
+5 SET AQAODLM=Y
+6 WRITE !!?10,"Start the capture at the device prompt.",!
+7 QUIT
+8 ;
+9 ;
DLMHDG ;ENTRY POINT >>> SUBRTN to print ASCII heading
+1 WRITE !
+2 IF $DATA(AQAOHCON)
Begin DoDot:1
+3 WRITE "*****Confidential "_AQAOHCON_" Data Covered by Privacy Act*****"
End DoDot:1
+4 WRITE !,AQAODUZ,AQAODLM,AQAOSITE,AQAODLM
DO TIME
+5 WRITE !,AQAOTY,AQAODLM
+6 SET Y=DT
XECUTE ^DD("DD")
WRITE $PIECE(Y,",")," ",$PIECE(Y,",",2),AQAODLM
+7 QUIT
+8 ;
+9 ;
KILL ;ENTRY POINT >>> kill statement for options
+1 ;
+2 ; >>> kill ztsk variables
+3 IF $DATA(ZTQUEUED)
SET ZTREQ="@"
QUIT
+4 ;
+5 ; >> kill namespaced variables
+6 DO ^AQAOVKL0
+7 ;S X="AQAO"
+8 ;F S X=$O(@X) Q:X'?1"AQAO".E D
+9 ;.K Y F I=1:1:4 I $P($T(SYS+I),";;",2)=X S Y=""
+10 ;.Q:$D(Y)
+11 ;.K @X
+12 ;K AQAO
+13 ;
+14 ; >>> kill fileman variables
+15 DO ^XBFMK
+16 ;
+17 ; >>> kill non-namespaced variables
+18 KILL DFN
+19 ;
+20 ; >> kill single character variables
+21 KILL X,Y,Z,I,J,K,S,L,N,W
+22 ;
+23 QUIT
+24 ;
SYS ;;SYSTEM-WIDE VARIABLES
+1 ;;AQAOCHK
+2 ;;AQAOENTR
+3 ;;AQAOINAC
+4 ;;AQAOUA
+5 ;;AQAOXYZ