DGOREL ;ALB/MAC - PATIENT OUTPUT BY RELIGIOUS AFFILIATIONS ; 5 JUL 88@12:00
;;5.3;Registration;**1015**;Aug 13, 1993;Build 21
D QUIT1,DT^DICRW,ASK2^SDDIV G QUIT1:Y<0
DISP W !!,"Display report for (D)ATE RANGE or (C)URRENT DATE: CURRENT// " S Z="^CURRENT^DATE RANGE",X="" R X:DTIME G QUIT1:X["^"!('$T) S:X["d"!(X["c") X=$C($A(X)-32) I X="" S X="C" W X
S DGL=$E(X) D IN^DGHELP I %=-1 W !!?3,"You may display report for :" D HELP2 S %="" G DISP
D:DGL="D" BEG G:X="^" QUIT1
PRO W !!,"Do you want to select only one religion" S %=2 D YN^DICN I %=0 W !!?10,"Enter 'Y' for YES or 'N' for NO or '^' to EXIT" G PRO
G QUIT1:%=-1 I %=1 W ! S DIC="^DIC(13,",DIC(0)="AEQM" D ^DIC G QUIT1:Y'>0 S DGR=$P(Y,"^",2)
S VAUTNI=1 W ! D WARD^VAUTOMA G QUIT1:Y<0
ASK W !!,"List Report By (W)ARD or (R)ELIGION: RELIGION// " S Z="^WARD^RELIGION",X="" R X:DTIME G QUIT1:X["^"!('$T) S:X["w"!(X["r") X=$C($A(X)-32) I X="" S X="R" W X
S DGHOW=$E(X) D IN^DGHELP I %=-1 W !!?3,"You may list the report by either :" D HELP S %="" G ASK
SPEC S DGNON=0 I '$D(DGR) W !!,"Do you want patients with 'NOT SPECIFIED' religion displayed" S %=2 D YN^DICN G QUIT1:%=-1 S DGNON=% I %=0 D HELP1 G SPEC
S DGVAR="DGBEG^DGBEG1^DGEND1^DGEND^DGHOW^DGL^DGNON^DGR^VAUTD#^VAUTW#",DGPGM="START^DGOREL1" W ! D ZIS^DGUTQ I 'POP U IO G START^DGOREL1
QUIT1 K %,%DT,DGBEG,DGBEG1,DGEND,DGEND1,DGL,DGHOW,DGNON,DGPGM,DGR,DGVAR,DIC,POP,VAUTD,VAUTNI,X,Y,Z Q
BEG W ! S %DT="AETX",%DT("A")="Enter the beginning date: " D ^%DT S DGBEG=(Y-.0001),DGBEG1=Y Q:X="^" I X="" G BEG
END W ! S %DT("A")="Enter ending date: " D ^%DT Q:X="^" S DGEND=Y_.9999,DGEND1=Y I X="" G END
I DGEND<DGBEG W !!?5,"The ending date can not be before the beginning date" G END
Q
HELP W !!?10,"R for RELIGION - Major sort is by RELIGION. Within each religion",!?10,"patient names are further sorted by Ward.",!?25,"Prints each religion on a separate page."
W !!?10,"W for WARD - Major sort is by WARD. Within each ward",!?10,"patient names are further sorted by Religion.",!?25,"Prints each ward on separate page." Q
HELP1 W !!?10,"Enter 'Y' to list the patients who ",!?15,"have not specified a religion",!!?10,"Enter 'N' if you don't want to list patients who ",!?15,"have not specified a religion",!!?10,"Enter '^' to quit" Q
HELP2 W !!?10,"C for CURRENT DATE - Report will display only those patients that",!?10,"are inpatients in hospital today.",!!?10,"D for DATE RANGE - to display all patients that were admitted",!?10,"to the hospital during that period."
DGOREL ;ALB/MAC - PATIENT OUTPUT BY RELIGIOUS AFFILIATIONS ; 5 JUL 88@12:00
+1 ;;5.3;Registration;**1015**;Aug 13, 1993;Build 21
+2 DO QUIT1
DO DT^DICRW
DO ASK2^SDDIV
IF Y<0
GOTO QUIT1
DISP WRITE !!,"Display report for (D)ATE RANGE or (C)URRENT DATE: CURRENT// "
SET Z="^CURRENT^DATE RANGE"
SET X=""
READ X:DTIME
IF X["^"!('$TEST)
GOTO QUIT1
IF X["d"!(X["c")
SET X=$CHAR($ASCII(X)-32)
IF X=""
SET X="C"
WRITE X
+1 SET DGL=$EXTRACT(X)
DO IN^DGHELP
IF %=-1
WRITE !!?3,"You may display report for :"
DO HELP2
SET %=""
GOTO DISP
+2 IF DGL="D"
DO BEG
IF X="^"
GOTO QUIT1
PRO WRITE !!,"Do you want to select only one religion"
SET %=2
DO YN^DICN
IF %=0
WRITE !!?10,"Enter 'Y' for YES or 'N' for NO or '^' to EXIT"
GOTO PRO
+1 IF %=-1
GOTO QUIT1
IF %=1
WRITE !
SET DIC="^DIC(13,"
SET DIC(0)="AEQM"
DO ^DIC
IF Y'>0
GOTO QUIT1
SET DGR=$PIECE(Y,"^",2)
+2 SET VAUTNI=1
WRITE !
DO WARD^VAUTOMA
IF Y<0
GOTO QUIT1
ASK WRITE !!,"List Report By (W)ARD or (R)ELIGION: RELIGION// "
SET Z="^WARD^RELIGION"
SET X=""
READ X:DTIME
IF X["^"!('$TEST)
GOTO QUIT1
IF X["w"!(X["r")
SET X=$CHAR($ASCII(X)-32)
IF X=""
SET X="R"
WRITE X
+1 SET DGHOW=$EXTRACT(X)
DO IN^DGHELP
IF %=-1
WRITE !!?3,"You may list the report by either :"
DO HELP
SET %=""
GOTO ASK
SPEC SET DGNON=0
IF '$DATA(DGR)
WRITE !!,"Do you want patients with 'NOT SPECIFIED' religion displayed"
SET %=2
DO YN^DICN
IF %=-1
GOTO QUIT1
SET DGNON=%
IF %=0
DO HELP1
GOTO SPEC
+1 SET DGVAR="DGBEG^DGBEG1^DGEND1^DGEND^DGHOW^DGL^DGNON^DGR^VAUTD#^VAUTW#"
SET DGPGM="START^DGOREL1"
WRITE !
DO ZIS^DGUTQ
IF 'POP
USE IO
GOTO START^DGOREL1
QUIT1 KILL %,%DT,DGBEG,DGBEG1,DGEND,DGEND1,DGL,DGHOW,DGNON,DGPGM,DGR,DGVAR,DIC,POP,VAUTD,VAUTNI,X,Y,Z
QUIT
BEG WRITE !
SET %DT="AETX"
SET %DT("A")="Enter the beginning date: "
DO ^%DT
SET DGBEG=(Y-.0001)
SET DGBEG1=Y
IF X="^"
QUIT
IF X=""
GOTO BEG
END WRITE !
SET %DT("A")="Enter ending date: "
DO ^%DT
IF X="^"
QUIT
SET DGEND=Y_.9999
SET DGEND1=Y
IF X=""
GOTO END
+1 IF DGEND<DGBEG
WRITE !!?5,"The ending date can not be before the beginning date"
GOTO END
+2 QUIT
HELP WRITE !!?10,"R for RELIGION - Major sort is by RELIGION. Within each religion",!?10,"patient names are further sorted by Ward.",!?25,"Prints each religion on a separate page."
+1 WRITE !!?10,"W for WARD - Major sort is by WARD. Within each ward",!?10,"patient names are further sorted by Religion.",!?25,"Prints each ward on separate page."
QUIT
HELP1 WRITE !!?10,"Enter 'Y' to list the patients who ",!?15,"have not specified a religion",!!?10,"Enter 'N' if you don't want to list patients who ",!?15,"have not specified a religion",!!?10,"Enter '^' to quit"
QUIT
HELP2 WRITE !!?10,"C for CURRENT DATE - Report will display only those patients that",!?10,"are inpatients in hospital today.",!!?10,"D for DATE RANGE - to display all patients that were admitted",!?10,"to the hospital during that period."