AMQQHELP ; IHS/CMI/THL - HELP MESSAGES FORQUERY UTILITY ;
;;2.0;IHS PCC SUITE;**11**;MAY 14, 2009;Build 58
;-----
RUN ; - EP -
N Y,Z,I,%,A,B,C,AMQQLNO
S AMQQLNO=0
EN1 ; - EP - FROM ^AMQQHEL2 AND ^AMQQSQA0
N S,J,Y,Z,I,%,A,B,C,AMQQLNO
S S=X
S AMQQLNO=0
I S["~" D MULT W !! Q
D L0
W !!
Q
;
L0 S A=$P(X,U)
S C=$P(X,U,2)
F I=1:1 S B=$P(C,";",I) Q:B="" S Y="" F S Y=$O(^AMQQ(5,A,B,Y)) Q:Y="" D L1 I Y=999999999 G LISTX
LISTX Q
;
L1 I X="AF^51",'$$WHP(Y) Q
S AMQQLNO=AMQQLNO+1
I AMQQLNO=1 W !!,"Possible choices:" D TYPE
I $D(AMQQMSPF) K AMQQMSPF S AMQQLNO=4 W !?3,"ALL",!?3,"ANY",!?3,"EXISTS",!?3,"NULL" G L1
I AMQQLNO#(IOSL-4)=1,AMQQLNO>1 D L2 I Y=999999999 Q
W !,?3,Y
Q
;
L2 W !!,"Enter '^' to stop listing or any other key to see more <>"
R Z:DTIME E S Y=999999999 Q
I Z=U S Y=999999999 Q
W @IOF
Q
;
LISTG ; ENTRY POINT FROM AMQQ1
N Y,Z,I,%,AMQQLNO
S Y=""
S AMQQLNO=0
F S Y=$O(^AMQQ(5,"GOAL",Y)) Q:Y="" D L1
W !!
Q
;
MULT F J=1:1 S X=$P(S,"~",J) Q:X="" D L0
W !!
Q
;
ITEM ; - EP - FROM ^AMQQATA AND ^AMQQSQA0
W @IOF,?20,"***** ATTRIBUTE CATEGORIES *****"
ATTS S DIR(0)="SO^1:DEMOGRAPHICS;2:DENTAL CODES;3:DIAGNOSES;4:EXAMS;5:INPATIENT;6:IMMUNIZATIONS;7:LAB;8:MEASUREMENTS;9:MEDICATIONS;10:PATIENT ED;11:PROCEDURES;13:SKIN TESTS;14:TREATMENTS;15:VISIT INFO;16:WOMEN'S HEALTH"
S DIR("A")="Your choice"
D ^DIR
K DIR
I X=U S AMQQQUIT=""
I "^"[X K DIRUT,DTOUT,DUOUT Q
I Y=1 S X="AF^11" D RUN Q
I Y=2 W !,"Type ""ADA CODE"" and the enter the code number or procedure name",! Q
I Y=3 W !,"Type ""DX""<RETURN> and then enter the ICD code or diagnosis",! Q
I Y=14 W !,"Type ""TREATMENT""<RETURN> and then enter the name of the treatment",! Q
I Y=9 W !,"Type ""RX""<RETURN> and then enter the name of the prescription",! Q
I Y=11 W !,"Type ""PROCEDURE""<RETURN> and then enter the procedure code or name",! Q
I Y=12 S X="AF^16" D RUN Q
I Y=7 S X="AF^3" D RUN Q
I Y=6 S X="AF^1" D RUN Q
I Y=8 S X="AF^5" D RUN Q
I Y=13 S X="AF^18" D RUN Q
I Y=4 S X="AF^22" D RUN Q
I Y=15 S X="AF^17" D RUN Q
I Y=16 S X="AF^48" D RUN Q
W !,"Sorry, these attributes are not currently available",!
Q
;
TYPE I $G(AMQQSQST)="Q" S AMQQLNO=4 W !!,?3,"POSITIVE",!?3,"NEGATIVE",! Q
I $G(AMQQSQST)="S" W ! S AMQQLNO=2 N %,I,X D W ! Q
.S %=$P($G(^AMQQ(5,AMQQSQSN,0)),U,5) I % S %=$P($G(^AMQQ(1,%,0)),U,6) I % S %="^DD("_%_",0)" I $D(@%) S %=$P(^(0),U,3) F I=1:1 S X=$P(%,";",I) Q:X="" W !?3,$P(X,":",2) S AMQQLNO=AMQQLNO+1
Q
;
WHP(Y) ; SCREEN WH PROCEDURE ATTRIBUTES
I '$D(^BWAA("AC")) Q 1
N %,Z,T
; DON'T SCREEN IF THERE IS MORE THAN ONE PROCEDURE SELECTED
S T=$O(^UTILITY("AMQQ TAX",$J,+$G(AMQQTAX),0)) I $O(^(T)) Q 1
S %=$O(^AMQQ(5,"B",Y,0))
I '% Q 1
S Z=+$P($G(^AMQQ(1,%,0)),U,4)
I Z="" Q 1
I $D(^BWAA("AC",Z,T)) Q 1
Q 0
;
AMQQHELP ; IHS/CMI/THL - HELP MESSAGES FORQUERY UTILITY ;
+1 ;;2.0;IHS PCC SUITE;**11**;MAY 14, 2009;Build 58
+2 ;-----
RUN ; - EP -
+1 NEW Y,Z,I,%,A,B,C,AMQQLNO
+2 SET AMQQLNO=0
EN1 ; - EP - FROM ^AMQQHEL2 AND ^AMQQSQA0
+1 NEW S,J,Y,Z,I,%,A,B,C,AMQQLNO
+2 SET S=X
+3 SET AMQQLNO=0
+4 IF S["~"
DO MULT
WRITE !!
QUIT
+5 DO L0
+6 WRITE !!
+7 QUIT
+8 ;
L0 SET A=$PIECE(X,U)
+1 SET C=$PIECE(X,U,2)
+2 FOR I=1:1
SET B=$PIECE(C,";",I)
IF B=""
QUIT
SET Y=""
FOR
SET Y=$ORDER(^AMQQ(5,A,B,Y))
IF Y=""
QUIT
DO L1
IF Y=999999999
GOTO LISTX
LISTX QUIT
+1 ;
L1 IF X="AF^51"
IF '$$WHP(Y)
QUIT
+1 SET AMQQLNO=AMQQLNO+1
+2 IF AMQQLNO=1
WRITE !!,"Possible choices:"
DO TYPE
+3 IF $DATA(AMQQMSPF)
KILL AMQQMSPF
SET AMQQLNO=4
WRITE !?3,"ALL",!?3,"ANY",!?3,"EXISTS",!?3,"NULL"
GOTO L1
+4 IF AMQQLNO#(IOSL-4)=1
IF AMQQLNO>1
DO L2
IF Y=999999999
QUIT
+5 WRITE !,?3,Y
+6 QUIT
+7 ;
L2 WRITE !!,"Enter '^' to stop listing or any other key to see more <>"
+1 READ Z:DTIME
IF '$TEST
SET Y=999999999
QUIT
+2 IF Z=U
SET Y=999999999
QUIT
+3 WRITE @IOF
+4 QUIT
+5 ;
LISTG ; ENTRY POINT FROM AMQQ1
+1 NEW Y,Z,I,%,AMQQLNO
+2 SET Y=""
+3 SET AMQQLNO=0
+4 FOR
SET Y=$ORDER(^AMQQ(5,"GOAL",Y))
IF Y=""
QUIT
DO L1
+5 WRITE !!
+6 QUIT
+7 ;
MULT FOR J=1:1
SET X=$PIECE(S,"~",J)
IF X=""
QUIT
DO L0
+1 WRITE !!
+2 QUIT
+3 ;
ITEM ; - EP - FROM ^AMQQATA AND ^AMQQSQA0
+1 WRITE @IOF,?20,"***** ATTRIBUTE CATEGORIES *****"
ATTS SET DIR(0)="SO^1:DEMOGRAPHICS;2:DENTAL CODES;3:DIAGNOSES;4:EXAMS;5:INPATIENT;6:IMMUNIZATIONS;7:LAB;8:MEASUREMENTS;9:MEDICATIONS;10:PATIENT ED;11:PROCEDURES;13:SKIN TESTS;14:TREATMENTS;15:VISIT INFO;16:WOMEN'S HEALTH"
+1 SET DIR("A")="Your choice"
+2 DO ^DIR
+3 KILL DIR
+4 IF X=U
SET AMQQQUIT=""
+5 IF "^"[X
KILL DIRUT,DTOUT,DUOUT
QUIT
+6 IF Y=1
SET X="AF^11"
DO RUN
QUIT
+7 IF Y=2
WRITE !,"Type ""ADA CODE"" and the enter the code number or procedure name",!
QUIT
+8 IF Y=3
WRITE !,"Type ""DX""<RETURN> and then enter the ICD code or diagnosis",!
QUIT
+9 IF Y=14
WRITE !,"Type ""TREATMENT""<RETURN> and then enter the name of the treatment",!
QUIT
+10 IF Y=9
WRITE !,"Type ""RX""<RETURN> and then enter the name of the prescription",!
QUIT
+11 IF Y=11
WRITE !,"Type ""PROCEDURE""<RETURN> and then enter the procedure code or name",!
QUIT
+12 IF Y=12
SET X="AF^16"
DO RUN
QUIT
+13 IF Y=7
SET X="AF^3"
DO RUN
QUIT
+14 IF Y=6
SET X="AF^1"
DO RUN
QUIT
+15 IF Y=8
SET X="AF^5"
DO RUN
QUIT
+16 IF Y=13
SET X="AF^18"
DO RUN
QUIT
+17 IF Y=4
SET X="AF^22"
DO RUN
QUIT
+18 IF Y=15
SET X="AF^17"
DO RUN
QUIT
+19 IF Y=16
SET X="AF^48"
DO RUN
QUIT
+20 WRITE !,"Sorry, these attributes are not currently available",!
+21 QUIT
+22 ;
TYPE IF $GET(AMQQSQST)="Q"
SET AMQQLNO=4
WRITE !!,?3,"POSITIVE",!?3,"NEGATIVE",!
QUIT
+1 IF $GET(AMQQSQST)="S"
WRITE !
SET AMQQLNO=2
NEW %,I,X
Begin DoDot:1
+2 SET %=$PIECE($GET(^AMQQ(5,AMQQSQSN,0)),U,5)
IF %
SET %=$PIECE($GET(^AMQQ(1,%,0)),U,6)
IF %
SET %="^DD("_%_",0)"
IF $DATA(@%)
SET %=$PIECE(^(0),U,3)
FOR I=1:1
SET X=$PIECE(%,";",I)
IF X=""
QUIT
WRITE !?3,$PIECE(X,":",2)
SET AMQQLNO=AMQQLNO+1
End DoDot:1
WRITE !
QUIT
+3 QUIT
+4 ;
WHP(Y) ; SCREEN WH PROCEDURE ATTRIBUTES
+1 IF '$DATA(^BWAA("AC"))
QUIT 1
+2 NEW %,Z,T
+3 ; DON'T SCREEN IF THERE IS MORE THAN ONE PROCEDURE SELECTED
+4 SET T=$ORDER(^UTILITY("AMQQ TAX",$JOB,+$GET(AMQQTAX),0))
IF $ORDER(^(T))
QUIT 1
+5 SET %=$ORDER(^AMQQ(5,"B",Y,0))
+6 IF '%
QUIT 1
+7 SET Z=+$PIECE($GET(^AMQQ(1,%,0)),U,4)
+8 IF Z=""
QUIT 1
+9 IF $DATA(^BWAA("AC",Z,T))
QUIT 1
+10 QUIT 0
+11 ;