AQAQPR1 ;IHS/ANMC/LJF - ADMITS BY PROVIDER(ADT DATA); [ 09/28/92 1:08 PM ]
;;2.2;STAFF CREDENTIALS;;01 OCT 1992
;
W @IOF,!!?25,"ADMISSIONS BY PROVIDER",!!
W !,"This report gives you a listing (with subcounts) of admissions "
W !,"grouped by admitting provider for the date range specified."
W !,"ICU admissions will be listed and counted separately. This"
W !,"data is entered by the ADT package. You must be running ADT to"
W !,"run this report.",!!
;
;***> select date range
DATE S %DT="AEQ",%DT("A")="Beginning date: ",X="" D ^%DT
G END:Y=-1 S AQAQBDT=Y
DATE2 S %DT="AEQ",%DT("A")="Ending date: ",X="" D ^%DT
G DATE:Y=-1 S AQAQEDT=Y
I AQAQEDT<AQAQBDT W *7,!!?5,"Ending date MUST NOT be before beginning date",! G DATE2
I AQAQEDT'<DT S X1=DT,X2=-1 D C^%DTC S AQAQEDT=X
;
;***> select one provider, one class or all
PRV K DIR S DIR(0)="N^1:3",DIR("A")="Choose One"
S DIR("A",1)="1. Print admissions for ONE PROVIDER"
S DIR("A",2)="2. Print admissions for ONE PROVIDER CLASS"
S DIR("A",3)="3. Print admissions for ALL PROVIDERS"
D ^DIR G DATE2:X="",END:$D(DIRUT) S AQAQTYP=+Y
I AQAQTYP=3 S AQAQPROV=0 G DEV ;all providers
S DIC=$S(AQAQTYP=1:6,1:7),DIC(0)="AEQMZ" D ^DIC G PRV:Y<0 S AQAQPROV=Y
;
;***> select print device
DEV S %ZIS="PQ" D ^%ZIS G END:POP,QUE:$D(IO("Q")) U IO G ^AQAQPR11
QUE K IO("Q") S ZTRTN="^AQAQPR11" S ZTDESC="ADMISSIONS BY PROVIDER"
F AQAQI="AQAQBDT","AQAQEDT","AQAQTYP","AQAQPROV" S ZTSAVE(AQAQI)=""
D ^%ZTLOAD D ^%ZISC K ZTSK
;
END K Y,AQAQBDT,AQAQEDT,AQAQI,AQAQTYP,AQAQPROV D HOME^%ZIS Q
;
;
ERR ;EP;***> entry point if error occurs
X ^%ZOSF("NBRK")
;if OS is DSM or MSM, don't kill variables if not an interrupt
;APPROVED EXCEPTION TO STANDARDS - USE OF $ZE
I $D(^%ZOSF("OS")),(($P(^%ZOSF("OS"),U)["MSM")!($P(^("OS"),U)["DSM")) I $ZE?1"<INRPT>".E D ^%ZISC W *7,!!?30,"Interrupt Acknowledged",!! H 3 I 1
E D ^%ET
D END^AQAQPR12 Q
AQAQPR1 ;IHS/ANMC/LJF - ADMITS BY PROVIDER(ADT DATA); [ 09/28/92 1:08 PM ]
+1 ;;2.2;STAFF CREDENTIALS;;01 OCT 1992
+2 ;
+3 WRITE @IOF,!!?25,"ADMISSIONS BY PROVIDER",!!
+4 WRITE !,"This report gives you a listing (with subcounts) of admissions "
+5 WRITE !,"grouped by admitting provider for the date range specified."
+6 WRITE !,"ICU admissions will be listed and counted separately. This"
+7 WRITE !,"data is entered by the ADT package. You must be running ADT to"
+8 WRITE !,"run this report.",!!
+9 ;
+10 ;***> select date range
DATE SET %DT="AEQ"
SET %DT("A")="Beginning date: "
SET X=""
DO ^%DT
+1 IF Y=-1
GOTO END
SET AQAQBDT=Y
DATE2 SET %DT="AEQ"
SET %DT("A")="Ending date: "
SET X=""
DO ^%DT
+1 IF Y=-1
GOTO DATE
SET AQAQEDT=Y
+2 IF AQAQEDT<AQAQBDT
WRITE *7,!!?5,"Ending date MUST NOT be before beginning date",!
GOTO DATE2
+3 IF AQAQEDT'<DT
SET X1=DT
SET X2=-1
DO C^%DTC
SET AQAQEDT=X
+4 ;
+5 ;***> select one provider, one class or all
PRV KILL DIR
SET DIR(0)="N^1:3"
SET DIR("A")="Choose One"
+1 SET DIR("A",1)="1. Print admissions for ONE PROVIDER"
+2 SET DIR("A",2)="2. Print admissions for ONE PROVIDER CLASS"
+3 SET DIR("A",3)="3. Print admissions for ALL PROVIDERS"
+4 DO ^DIR
IF X=""
GOTO DATE2
IF $DATA(DIRUT)
GOTO END
SET AQAQTYP=+Y
+5 ;all providers
IF AQAQTYP=3
SET AQAQPROV=0
GOTO DEV
+6 SET DIC=$SELECT(AQAQTYP=1:6,1:7)
SET DIC(0)="AEQMZ"
DO ^DIC
IF Y<0
GOTO PRV
SET AQAQPROV=Y
+7 ;
+8 ;***> select print device
DEV SET %ZIS="PQ"
DO ^%ZIS
IF POP
GOTO END
IF $DATA(IO("Q"))
GOTO QUE
USE IO
GOTO ^AQAQPR11
QUE KILL IO("Q")
SET ZTRTN="^AQAQPR11"
SET ZTDESC="ADMISSIONS BY PROVIDER"
+1 FOR AQAQI="AQAQBDT","AQAQEDT","AQAQTYP","AQAQPROV"
SET ZTSAVE(AQAQI)=""
+2 DO ^%ZTLOAD
DO ^%ZISC
KILL ZTSK
+3 ;
END KILL Y,AQAQBDT,AQAQEDT,AQAQI,AQAQTYP,AQAQPROV
DO HOME^%ZIS
QUIT
+1 ;
+2 ;
ERR ;EP;***> entry point if error occurs
+1 XECUTE ^%ZOSF("NBRK")
+2 ;if OS is DSM or MSM, don't kill variables if not an interrupt
+3 ;APPROVED EXCEPTION TO STANDARDS - USE OF $ZE
+4 IF $DATA(^%ZOSF("OS"))
IF (($PIECE(^%ZOSF("OS"),U)["MSM")!($PIECE(^("OS"),U)["DSM"))
IF $ZE?1"<INRPT>".E
DO ^%ZISC
WRITE *7,!!?30,"Interrupt Acknowledged",!!
HANG 3
IF 1
+5 IF '$TEST
DO ^%ET
+6 DO END^AQAQPR12
QUIT