AMQQOPT ;IHS/CMI/THL - QUERY OPTIONS ;
;;2.0;IHS PCC SUITE;**2,4,5**;MAY 14, 2009
;-----
ADAM I $D(AMQQADAM) D SEL G EXIT
I $D(AMQQAGIN) D SEL G EXIT
HELLO W @IOF,!!,?12,"***** WELCOME TO Q-MAN: THE PCC QUERY UTILITY *****"
RUN D WARN
D SEC
I $D(AMQQQUIT) G EXIT
S DIR(0)="E"
D ^DIR
K DIR
I $D(DUOUT)+$D(DTOUT) K DTOUT,DIRUT,DUOUT S AMQQQUIT="" G EXIT
D SEL
EXIT K X,%,Y
Q
;
WARN S X=""
S $P(X,"*",80)=""
W !!!,X,!
W1 W "** WARNING...Q-Man produces confidential patient information. **"
W !,"** View only in private. Keep all printed reports in a secure area. **",!
W "** Ask your site manager for the current Q-Man Users Guide. **",!,X,!!!
Q
;
SEC I '($D(DUZ)#2) D NOUSER Q
I 'DUZ D NOUSER Q
I '$D(DUZ(2)) D NOSITE Q
I 'DUZ(2) D NOSITE Q
W !,"Query utility: IHS PCC SUITE Q-MAN Ver. ",AMQQVER
S %=$P(@AMQQ200(3)@(DUZ,0),U)
S %=$P(%,",",2,9)_" "_$P(%,",")
W !,"Current user: ",%
W !,"Chart numbers will be displayed for: ",$P(^DIC(4,DUZ(2),0),U)
W !,"Access to demographic data: PERMITTED"
W !,"Access to clinical data: "
S %=$$KEYCHECK^AMQQUTIL("AMQQZCLIN")
W $S(%:"PERMITTED",1:"DENIED"),!
S %=$$KEYCHECK^AMQQUTIL("AMQQZPROG")
W "Programmer privileges: ",$S(%:"YES",1:"NO"),!!!
Q
;
NOUSER W !!,"USER NOT IDENTIFIED...SESSION ABORTED",!!,*7 G NO1
NOSITE W !!,"LOCATION NOT IDENTIFIED...SESSION ABORTED",!!,*7
NO1 S AMQQQUIT=""
H 3
Q
;
CHECK Q ;S %=$$KEYCHECK^AMQQUTIL("AMQQZPROG") ;IHS/CMI/THL PATCH XXX
I '% K AMQQOPT W "Sorry...Programmer privileges are required for this option",!!,*7 H 3 W @IOF
Q
;
SEL W @IOF,!!?25,"***** Q-MAN OPTIONS *****",!!!
SEL1 S DIR(0)="SO^1:SEARCH PCC Database (dialogue interface);2:FAST Facts (natural language interface);3:RUN Search Logic;4:VIEW/DELETE Taxonomies and Search Templates;5:FILEMAN Print;9:HELP;0:EXIT"
S DIR("A")=$C(10)_" Your choice"
S DIR("B")="SEARCH"
S DIR("?")="Select an option or type '??' for more information"
S DIR("??")="AMQQMENU"
D ^DIR
K DIR,AMQQDLIM
I $G(DUOUT)+$G(DTOUT)+'Y K DTOUT,DIRUT,DUOUT S AMQQQUIT="" Q
OUT1 W !!
I Y=1 S AMQQOPT="SEARCH" Q
I Y=2 S AMQQOPT="FAST" Q
I Y=3 S AMQQOPT="SAVE" D CHECK G:'$D(AMQQOPT) SEL1 Q
I Y=4 S AMQQOPT="VIEW" D VIEW G SEL
I Y=5 S %=$$KEYCHECK^AMQQUTIL("AMQQZCLIN") I '% W "Sorry...Clinical privileges are required for this option",!!,*7 H 3 G SEL
I Y=5 D ^DIP G SEL
I Y=9 S XQH=$O(^DIC(9.2,"B","AMQQMENU","")),DIC(0)="X" D EN^XQH G SEL
Q
;
OUT ; ENTRY POINT FROM AMQQCMPL
I $D(AMQQEN31) S AMQV("OPTION")="COHORT" Q
K AMQV("OPTION")
D OUTPUT
I $D(AMQQQUIT) G OUTEXIT
I Y=-1 D Q
.I $D(AMQV("OPTION")),$D(AMQQQUIT),"AGEHSUMMAILMONTHTIMEWORK"[AMQV("OPTION") S AMQQOPT("SPEC")=""
S AMQV("OPTION")=$P("LIST^PRINT^COUNT^COHORT^STORE^RMAN",U,Y)
OUTEXIT K X,POP,DTOUT
S AMQQ("AGIN")=""
Q
;
OUTPUT ; - EP - FROM AMQQQE1
K AMQQDVQU
I $D(AMQQOPT("ASCII")) S Y=6 K AMQQOPT("ASCII") G RMAN
I $D(AMQQOPT("SPEC")) S Y=6 G RMAN
W @IOF,!!,?20,"***** Q-MAN OUTPUT OPTIONS *****",!!
OS S DIR(0)="SO^1:DISPLAY results on the screen;2:PRINT results on paper;3:COUNT 'hits';4:STORE results of a search in a FM search template;5:SAVE search logic for future use;6:R-MAN special report generator"
S DIR(0)=DIR(0)_";7:DELIMITED file via screen capture;9:HELP;0:EXIT"
S DIR("??")="AMQQOUTPUT"
S DIR("?")="Enter a code from the list or '??' for more information on each choice"
S DIR("A")=$C(10)_" Your choice"
S DIR("B")="DISPLAY"
D ^DIR
K DIR
I $D(DUOUT)+$D(DTOUT) K DIRUT,DUOUT,DTOUT S AMQQQUIT="" Q
I Y=9 S XQH="AMQQOUTPUT",DIC(0)="X" D EN^XQH G OUTPUT
I 'Y S AMQQQUIT="" Q
I Y=7 S AMQQDLIM=1 S Y=1
I Y=5,$D(AMQQCPLF) W " (Already selected...try again)",*7,! G OS
RMAN I Y=6 D RMAN^AMQQOPT1 G:'$D(AMQV("OPTION")) OS I '$D(AMQQQUIT) D @(AMQV("OPTION")_"^AMQQRMAN") S Y=-1 I $D(AMQQRERF) K AMQQRERF D G OUTPUT
.I $D(AMQV("OPTION")),$D(AMQQQUIT),"AGEHSUMMAILMONTHTIMEWORK"[AMQV("OPTION") S AMQQOPT("SPEC")=""
Q
;
VIEW D VIEW^AMQQOPT1
Q
;
AMQQOPT ;IHS/CMI/THL - QUERY OPTIONS ;
+1 ;;2.0;IHS PCC SUITE;**2,4,5**;MAY 14, 2009
+2 ;-----
ADAM IF $DATA(AMQQADAM)
DO SEL
GOTO EXIT
+1 IF $DATA(AMQQAGIN)
DO SEL
GOTO EXIT
HELLO WRITE @IOF,!!,?12,"***** WELCOME TO Q-MAN: THE PCC QUERY UTILITY *****"
RUN DO WARN
+1 DO SEC
+2 IF $DATA(AMQQQUIT)
GOTO EXIT
+3 SET DIR(0)="E"
+4 DO ^DIR
+5 KILL DIR
+6 IF $DATA(DUOUT)+$DATA(DTOUT)
KILL DTOUT,DIRUT,DUOUT
SET AMQQQUIT=""
GOTO EXIT
+7 DO SEL
EXIT KILL X,%,Y
+1 QUIT
+2 ;
WARN SET X=""
+1 SET $PIECE(X,"*",80)=""
+2 WRITE !!!,X,!
W1 WRITE "** WARNING...Q-Man produces confidential patient information. **"
+1 WRITE !,"** View only in private. Keep all printed reports in a secure area. **",!
+2 WRITE "** Ask your site manager for the current Q-Man Users Guide. **",!,X,!!!
+3 QUIT
+4 ;
SEC IF '($DATA(DUZ)#2)
DO NOUSER
QUIT
+1 IF 'DUZ
DO NOUSER
QUIT
+2 IF '$DATA(DUZ(2))
DO NOSITE
QUIT
+3 IF 'DUZ(2)
DO NOSITE
QUIT
+4 WRITE !,"Query utility: IHS PCC SUITE Q-MAN Ver. ",AMQQVER
+5 SET %=$PIECE(@AMQQ200(3)@(DUZ,0),U)
+6 SET %=$PIECE(%,",",2,9)_" "_$PIECE(%,",")
+7 WRITE !,"Current user: ",%
+8 WRITE !,"Chart numbers will be displayed for: ",$PIECE(^DIC(4,DUZ(2),0),U)
+9 WRITE !,"Access to demographic data: PERMITTED"
+10 WRITE !,"Access to clinical data: "
+11 SET %=$$KEYCHECK^AMQQUTIL("AMQQZCLIN")
+12 WRITE $SELECT(%:"PERMITTED",1:"DENIED"),!
+13 SET %=$$KEYCHECK^AMQQUTIL("AMQQZPROG")
+14 WRITE "Programmer privileges: ",$SELECT(%:"YES",1:"NO"),!!!
+15 QUIT
+16 ;
NOUSER WRITE !!,"USER NOT IDENTIFIED...SESSION ABORTED",!!,*7
GOTO NO1
NOSITE WRITE !!,"LOCATION NOT IDENTIFIED...SESSION ABORTED",!!,*7
NO1 SET AMQQQUIT=""
+1 HANG 3
+2 QUIT
+3 ;
CHECK ;S %=$$KEYCHECK^AMQQUTIL("AMQQZPROG") ;IHS/CMI/THL PATCH XXX
QUIT
+1 IF '%
KILL AMQQOPT
WRITE "Sorry...Programmer privileges are required for this option",!!,*7
HANG 3
WRITE @IOF
+2 QUIT
+3 ;
SEL WRITE @IOF,!!?25,"***** Q-MAN OPTIONS *****",!!!
SEL1 SET DIR(0)="SO^1:SEARCH PCC Database (dialogue interface);2:FAST Facts (natural language interface);3:RUN Search Logic;4:VIEW/DELETE Taxonomies and Search Templates;5:FILEMAN Print;9:HELP;0:EXIT"
+1 SET DIR("A")=$CHAR(10)_" Your choice"
+2 SET DIR("B")="SEARCH"
+3 SET DIR("?")="Select an option or type '??' for more information"
+4 SET DIR("??")="AMQQMENU"
+5 DO ^DIR
+6 KILL DIR,AMQQDLIM
+7 IF $GET(DUOUT)+$GET(DTOUT)+'Y
KILL DTOUT,DIRUT,DUOUT
SET AMQQQUIT=""
QUIT
OUT1 WRITE !!
+1 IF Y=1
SET AMQQOPT="SEARCH"
QUIT
+2 IF Y=2
SET AMQQOPT="FAST"
QUIT
+3 IF Y=3
SET AMQQOPT="SAVE"
DO CHECK
IF '$DATA(AMQQOPT)
GOTO SEL1
QUIT
+4 IF Y=4
SET AMQQOPT="VIEW"
DO VIEW
GOTO SEL
+5 IF Y=5
SET %=$$KEYCHECK^AMQQUTIL("AMQQZCLIN")
IF '%
WRITE "Sorry...Clinical privileges are required for this option",!!,*7
HANG 3
GOTO SEL
+6 IF Y=5
DO ^DIP
GOTO SEL
+7 IF Y=9
SET XQH=$ORDER(^DIC(9.2,"B","AMQQMENU",""))
SET DIC(0)="X"
DO EN^XQH
GOTO SEL
+8 QUIT
+9 ;
OUT ; ENTRY POINT FROM AMQQCMPL
+1 IF $DATA(AMQQEN31)
SET AMQV("OPTION")="COHORT"
QUIT
+2 KILL AMQV("OPTION")
+3 DO OUTPUT
+4 IF $DATA(AMQQQUIT)
GOTO OUTEXIT
+5 IF Y=-1
Begin DoDot:1
+6 IF $DATA(AMQV("OPTION"))
IF $DATA(AMQQQUIT)
IF "AGEHSUMMAILMONTHTIMEWORK"[AMQV("OPTION")
SET AMQQOPT("SPEC")=""
End DoDot:1
QUIT
+7 SET AMQV("OPTION")=$PIECE("LIST^PRINT^COUNT^COHORT^STORE^RMAN",U,Y)
OUTEXIT KILL X,POP,DTOUT
+1 SET AMQQ("AGIN")=""
+2 QUIT
+3 ;
OUTPUT ; - EP - FROM AMQQQE1
+1 KILL AMQQDVQU
+2 IF $DATA(AMQQOPT("ASCII"))
SET Y=6
KILL AMQQOPT("ASCII")
GOTO RMAN
+3 IF $DATA(AMQQOPT("SPEC"))
SET Y=6
GOTO RMAN
+4 WRITE @IOF,!!,?20,"***** Q-MAN OUTPUT OPTIONS *****",!!
OS SET DIR(0)="SO^1:DISPLAY results on the screen;2:PRINT results on paper;3:COUNT 'hits';4:STORE results of a search in a FM search template;5:SAVE search logic for future use;6:R-MAN special report generator"
+1 SET DIR(0)=DIR(0)_";7:DELIMITED file via screen capture;9:HELP;0:EXIT"
+2 SET DIR("??")="AMQQOUTPUT"
+3 SET DIR("?")="Enter a code from the list or '??' for more information on each choice"
+4 SET DIR("A")=$CHAR(10)_" Your choice"
+5 SET DIR("B")="DISPLAY"
+6 DO ^DIR
+7 KILL DIR
+8 IF $DATA(DUOUT)+$DATA(DTOUT)
KILL DIRUT,DUOUT,DTOUT
SET AMQQQUIT=""
QUIT
+9 IF Y=9
SET XQH="AMQQOUTPUT"
SET DIC(0)="X"
DO EN^XQH
GOTO OUTPUT
+10 IF 'Y
SET AMQQQUIT=""
QUIT
+11 IF Y=7
SET AMQQDLIM=1
SET Y=1
+12 IF Y=5
IF $DATA(AMQQCPLF)
WRITE " (Already selected...try again)",*7,!
GOTO OS
RMAN IF Y=6
DO RMAN^AMQQOPT1
IF '$DATA(AMQV("OPTION"))
GOTO OS
IF '$DATA(AMQQQUIT)
DO @(AMQV("OPTION")_"^AMQQRMAN")
SET Y=-1
IF $DATA(AMQQRERF)
KILL AMQQRERF
Begin DoDot:1
+1 IF $DATA(AMQV("OPTION"))
IF $DATA(AMQQQUIT)
IF "AGEHSUMMAILMONTHTIMEWORK"[AMQV("OPTION")
SET AMQQOPT("SPEC")=""
End DoDot:1
GOTO OUTPUT
+2 QUIT
+3 ;
VIEW DO VIEW^AMQQOPT1
+1 QUIT
+2 ;