DGMFR13 ;DAL/JCH - NDS DEMOGRAPHICS MASTER RELIGION ASSOCIATIONS REPORT ;15-AUG-2017
;;5.3;Registration;**933**;Aug 13, 1993;Build 44
;
; Available at Master File Reports [DGMF RMAIN] option, at the following menu path:
; Supervisor ADT Menu [DG SUPERVISOR MENU]
; ADT System Definition Menu [DG SYSTEM DEFINITION MENU]
; Master File Menu [DGMF MNU]
; Master File Reports [DGMF RMAIN]
Q
;
EN ; MMR Report Entry point
N DGOUT
S DGOUT=0
F Q:$G(DGOUT) D
.D MAIN Q:DGOUT
.N DIR W !!
.S DIR(0)="Y",DIR("B")="Y",DIR("A")="Run report again" D ^DIR
.S:X'="Y" DGOUT=1
Q
;
MAIN ; Driver loop
N DGSUM,DGMUA,DGSMR,DGOUTP
S DGSMR=0
;
D INFO
; Select (M)apped, (U)nmapped, or (A)ll entries from Religion (#13) file.
D MUA(.DGMUA) I '$D(DGMUA)!$G(DGOUT) S DGOUT=1 Q
S DGSUM=$$SUMMARY I 'DGSUM Q
;
; Select output format
S DGOUTP=$$OUT I DGSMR Q
;
; Select device
I $$SELDEV()!DGSMR Q
;
I DGOUTP="R" W !!,"<*> please wait <*>"
U IO D DQ
Q
;
DQ ; report (queue) starts here
N DGMRI,DGMMRI,DGMR0,DGMMR0
;
K ^TMP($J,"DGMFR13")
; build list of religions types
S DGMRI=0 F S DGMRI=$O(^DIC(13,DGMRI)) Q:'DGMRI D
.S DGMR0=$G(^DIC(13,DGMRI,0))
.S DGMMRI=+$G(^DIC(13,DGMRI,"MASTER"))
.I $G(DGMUA)="U",$G(DGMMRI) Q
.I $G(DGMUA)="M",'$G(DGMMRI) Q
.S DGMMR0=$S($G(DGMMRI):$G(^DGMR(13.99,+DGMMRI,0)),1:"Not Mapped")
.I DGMMRI S $P(DGMMR0,"^",4)=DGMMRI
.S ^TMP($J,"DGMFR13",DGMR0,DGMRI,"MR")=$G(DGMR0)
.S ^TMP($J,"DGMFR13",DGMR0,DGMRI,"MMRE")=$G(DGMMR0)
;
D PRINT
;
D ^%ZISC
K ^TMP($J,"DGMFR13")
Q
;
PRINT ; Print output
N MAXCNT,DGSMR,DGPGCNT,DGHDR,CRT,DGMR0,DGDELHD
I IOST["C-" S MAXCNT=IOSL-10,CRT=1
E S MAXCNT=IOSL-6,CRT=0
I DGSUM=1 S MAXCNT=MAXCNT+5
S DGPGCNT=0,DGSMR=0
;
I '$D(^TMP($J,"DGMFR13")) D HEADER W !!!?5,"No Data Found" Q
;
S DGMR0="" F S DGMR0=$O(^TMP($J,"DGMFR13",DGMR0)) Q:DGMR0="" D PRINT2(DGMR0)
Q
;
PRINT2(DGMR0) ; Get details
N DGMRI
S DGMRI=0 F S DGMRI=$O(^TMP($J,"DGMFR13",DGMR0,DGMRI)) Q:'DGMRI!DGSMR D
.N DGMMR0,DGCT,DGCTS,DGCTX,DGMRST,DGMRCOD
.N DGMTST,DGMTED,DGMMRI,DGMTEDI,DGMPAR,DGMPARX
.N DGMREPL,DGMREPX,DGMV0
.;
.I $G(DGOUTP)="E" D DELIM(DGMR0,DGMRI) Q
.;
.I ($Y+1>MAXCNT)!'DGPGCNT D HEADER Q:DGSMR
.S DGMR0=$G(^TMP($J,"DGMFR13",DGMR0,DGMRI,"MR"))
.S DGMRST=+$G(^TMP($J,"DGMFR13",DGMR0,DGMRI,"STATUS")),DGMRST=$S(DGMRST:"INACTIVE",1:"ACTIVE")
.D PRINMR(DGMRI)
.;
.Q:'DGMMRI
.I $G(DGSUM)=2 D
..S DGMTED=$$NOW^XLFDT,DGMTED=$O(^DGMR(13.99,DGMMRI,"TERMSTATUS","B",DGMTED),-1)
..I DGMTED D ; This should always be true, if data came from STS MFS process
...S DGMTEDI="",DGMTEDI=$O(^DGMR(13.99,DGMMRI,"TERMSTATUS","B",DGMTED,DGMTEDI))
...S DGMTST=$P(^DGMR(13.99,DGMMRI,"TERMSTATUS",DGMTEDI,0),"^",2)
...W ?30," Status: ",$S(DGMTST:"ACTIVE",1:"INACTIVE")
..S DGMV0=$G(^DGMR(13.99,DGMMRI,"VUID"))
..W !?3,"VUID: ",$P(DGMV0,"^")
Q
;
MUA(DGMUA) ; Select (M)apped, (U)nmapped, or(A)ll - entries from 13 mapped to 13.99
N DIR,DIRUT,Y
W ! S DIR(0)="SAO^M:(M)apped;U:(U)nmapped;A:(A)ll"
S DIR("?")="Enter ^ to exit"
S DIR("A",1)="Run the report for"
S DIR("A")="(M)apped, (U)nmapped, or (A)ll Religion entries: ",DIR("B")="A" D ^DIR
I $D(DIRUT) S DGOUT=1 Q
S DGMUA=Y
Q
;
SUMMARY() ; ask to print detailed or summary report
N DIR,DIRUT,X,Y
S DIR(0)="SOA^D:Detailed;S:Summary;",DIR("B")="Summary"
S DIR("A")="Type of report to print: "
W ! D ^DIR
I $D(DIRUT) S DGSMR=1 Q 0
Q $S(Y="S":1,Y="D":2,1:0)
;
OUT() ; select Excel or Report format
N DIR,DIROUT,DIRUT,DTOUT,DUOUT,X,Y
W !
S DIR(0)="SA^E:Excel;R:Report"
S DIR("A")="(E)xcel Format or (R)eport Format: "
S DIR("B")="Report"
D ^DIR I $D(DIRUT) S DGSMR=1 Q ""
Q Y
;
DELIM(DGMR0,DGMRI) ; Print output in "^" delimited format
; Print data in (E)xcel format, e.g., "data^data^data"
I '$G(DGDELHD) S DGDELHD=1 D
.I $G(DGSUM)=1 W !,"VA Religion^Mapped/Not Mapped^Master Religion Name"
.I $G(DGSUM)=2 W !,"VA Religion^VA Religion Code^Mapped/Not Mapped^Master Religion Name^Master Religion Code^Master Religion Status^VUID"
W !,$P(DGMR0,"^")
I $G(DGSUM)=2 W "^",$P(DGMR0,"^",4)
S DGMMR0=$G(^TMP($J,"DGMFR13",DGMR0,DGMRI,"MMRE"))
S DGMMRI=+$P(DGMMR0,"^",4)
W "^",$S(DGMMRI:"MAPPED",1:"NOT MAPPED")
Q:'DGMMRI
W "^",$P(^TMP($J,"DGMFR13",DGMR0,DGMRI,"MMRE"),"^")
I $G(DGSUM)=2 D
.W "^",$P(^TMP($J,"DGMFR13",DGMR0,DGMRI,"MMRE"),"^",2)
.S DGMTED=$$NOW^XLFDT,DGMTED=$O(^DGMR(13.99,DGMMRI,"TERMSTATUS","B",DGMTED),-1)
.I $G(DGMTED) D
..S DGMTEDI="",DGMTEDI=$O(^DGMR(13.99,DGMMRI,"TERMSTATUS","B",DGMTED,DGMTEDI))
..S DGMTST=$P(^DGMR(13.99,DGMMRI,"TERMSTATUS",DGMTEDI,0),"^",2)
..W "^",$S(DGMTST:"ACTIVE",1:"INACTIVE")
.S DGMV0=$G(^DGMR(13.99,DGMMRI,"VUID"))
.W "^",$P(DGMV0,"^")
Q
;
SELDEV() ; Prompt for output device, return 1 if queued
I DGOUTP="E" D
.N DIR,X,Y
.S DIR("A",1)=""
.S DIR("A",2)=" ************************************************************"
.S DIR("A",3)=" ** You selected a Delimited report. Please verify you **"
.S DIR("A",4)=" ** you have turned logging on to capture the output. **"
.S DIR("A",5)=" ** **"
.S DIR("A",6)=" ** To avoid undesired wrapping, enter '0;199;999' at **"
.S DIR("A",7)=" ** the 'DEVICE:' prompt. The Terminal Session display **"
.S DIR("A",8)=" ** may need to be set to 199 columns. **"
.S DIR("A",9)=" ************************************************************"
.S DIR("A",10)=""
.S DIR("A",11)="",DIR("A",12)=""
.S DIR("A")=" Press return to continue"
.S DIR(0)="EA" D ^DIR W !
;
N DGDONE
W !,"You may queue this report to print at a later time.",!
F Q:$G(DGSMR)!$G(DGDONE) D
.K %ZIS,IOP,POP,ZTSK N I S DGION=$I,%ZIS="QM"
.D ^%ZIS K %ZIS
.I POP S IOP=DGION D ^%ZIS K IOP,DGION D Q
..N DIR,X,Y
..S DIR(0)="YA",DIR("A",1)=" ** No Device Selected **",DIR("A")="Select a different device? (Y/N) " D ^DIR
..S:'Y DGSMR=1
.S DGDONE=1
I $D(IO("Q")) D Q 1
.N ZTDESC,ZTSAVE,ZTRTN
.S ZTDESC="Religion to Master Religion Mapping Report",ZTRTN="DQ^DGMFR13"
.S ZTSAVE("DATE*")="",ZTSAVE("DG*")="",ZTSAVE("ZTREQ")="@"
.K IO("Q") D ^%ZTLOAD W:$D(ZTSK) !,"Report is Queued to print!" K ZTSK
Q:$G(DGSMR) -1
Q 0
;
N DGHDR,DGTAB,DGSPACE
S DGSMR=0
I CRT,DGPGCNT>0,'$D(ZTQUEUED) D Q:DGSMR
.N DIR,LIN
.I MAXCNT<51 F LIN=1:1:(MAXCNT-$Y) W !
.W !
.S DIR(0)="E" D ^DIR K DIR
.I 'Y S DGSMR=1 Q
S DGPGCNT=DGPGCNT+1
W @IOF,!
S $P(DGSPACE," ",132)=""
S DGHDR=" Religion to Master Religion Report "
S DGHDR=DGHDR_"Page: "_DGPGCNT,DGTAB=132-$L(DGHDR)-1
W ?DGTAB,DGHDR
Q
;
PRINMR(DGMRI) ; Print Religion file (#13) entry
N DGCT2
W !!,"VA Religion: ",$P(DGMR0,"^")
I $G(DGSUM)=2 D
.W !,"VA Religion Code: ",$P(DGMR0,"^",4)
S DGMMR0=$G(^TMP($J,"DGMFR13",DGMR0,DGMRI,"MMRE"))
S DGMMRI=+$P(DGMMR0,"^",4)
W !,"Mapped to Master Religion: ",$S(DGMMRI:"YES",1:"NO")
Q:'DGMMRI
W !?3,"Master Religion Name: ",$P(^TMP($J,"DGMFR13",DGMR0,DGMRI,"MMRE"),"^")
I $G(DGSUM)=2 W !?3,"Master Code: ",$P(^TMP($J,"DGMFR13",DGMR0,DGMRI,"MMRE"),"^",2)
Q
;
INFO ; Display message, clear screen
N MSG
S MSG(1)=" This report prints Religions from the RELIGION"
S MSG(2)=" file (#13), and each Religion' relationship"
S MSG(3)=" to the Master Religion (#13.99) file."
S MSG(4)=""
D CLEAR^VALM1
D BMES^XPDUTL(.MSG)
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HDGMFR13 7590 printed Dec 13, 2024@02:44:12 Page 2
DGMFR13 ;DAL/JCH - NDS DEMOGRAPHICS MASTER RELIGION ASSOCIATIONS REPORT ;15-AUG-2017
+1 ;;5.3;Registration;**933**;Aug 13, 1993;Build 44
+2 ;
+3 ; Available at Master File Reports [DGMF RMAIN] option, at the following menu path:
+4 ; Supervisor ADT Menu [DG SUPERVISOR MENU]
+5 ; ADT System Definition Menu [DG SYSTEM DEFINITION MENU]
+6 ; Master File Menu [DGMF MNU]
+7 ; Master File Reports [DGMF RMAIN]
+8 QUIT
+9 ;
EN ; MMR Report Entry point
+1 NEW DGOUT
+2 SET DGOUT=0
+3 FOR
if $GET(DGOUT)
QUIT
Begin DoDot:1
+4 DO MAIN
if DGOUT
QUIT
+5 NEW DIR
WRITE !!
+6 SET DIR(0)="Y"
SET DIR("B")="Y"
SET DIR("A")="Run report again"
DO ^DIR
+7 if X'="Y"
SET DGOUT=1
End DoDot:1
+8 QUIT
+9 ;
MAIN ; Driver loop
+1 NEW DGSUM,DGMUA,DGSMR,DGOUTP
+2 SET DGSMR=0
+3 ;
+4 DO INFO
+5 ; Select (M)apped, (U)nmapped, or (A)ll entries from Religion (#13) file.
+6 DO MUA(.DGMUA)
IF '$DATA(DGMUA)!$GET(DGOUT)
SET DGOUT=1
QUIT
+7 SET DGSUM=$$SUMMARY
IF 'DGSUM
QUIT
+8 ;
+9 ; Select output format
+10 SET DGOUTP=$$OUT
IF DGSMR
QUIT
+11 ;
+12 ; Select device
+13 IF $$SELDEV()!DGSMR
QUIT
+14 ;
+15 IF DGOUTP="R"
WRITE !!,"<*> please wait <*>"
+16 USE IO
DO DQ
+17 QUIT
+18 ;
DQ ; report (queue) starts here
+1 NEW DGMRI,DGMMRI,DGMR0,DGMMR0
+2 ;
+3 KILL ^TMP($JOB,"DGMFR13")
+4 ; build list of religions types
+5 SET DGMRI=0
FOR
SET DGMRI=$ORDER(^DIC(13,DGMRI))
if 'DGMRI
QUIT
Begin DoDot:1
+6 SET DGMR0=$GET(^DIC(13,DGMRI,0))
+7 SET DGMMRI=+$GET(^DIC(13,DGMRI,"MASTER"))
+8 IF $GET(DGMUA)="U"
IF $GET(DGMMRI)
QUIT
+9 IF $GET(DGMUA)="M"
IF '$GET(DGMMRI)
QUIT
+10 SET DGMMR0=$SELECT($GET(DGMMRI):$GET(^DGMR(13.99,+DGMMRI,0)),1:"Not Mapped")
+11 IF DGMMRI
SET $PIECE(DGMMR0,"^",4)=DGMMRI
+12 SET ^TMP($JOB,"DGMFR13",DGMR0,DGMRI,"MR")=$GET(DGMR0)
+13 SET ^TMP($JOB,"DGMFR13",DGMR0,DGMRI,"MMRE")=$GET(DGMMR0)
End DoDot:1
+14 ;
+15 DO PRINT
+16 ;
+17 DO ^%ZISC
+18 KILL ^TMP($JOB,"DGMFR13")
+19 QUIT
+20 ;
PRINT ; Print output
+1 NEW MAXCNT,DGSMR,DGPGCNT,DGHDR,CRT,DGMR0,DGDELHD
+2 IF IOST["C-"
SET MAXCNT=IOSL-10
SET CRT=1
+3 IF '$TEST
SET MAXCNT=IOSL-6
SET CRT=0
+4 IF DGSUM=1
SET MAXCNT=MAXCNT+5
+5 SET DGPGCNT=0
SET DGSMR=0
+6 ;
+7 IF '$DATA(^TMP($JOB,"DGMFR13"))
DO HEADER
WRITE !!!?5,"No Data Found"
QUIT
+8 ;
+9 SET DGMR0=""
FOR
SET DGMR0=$ORDER(^TMP($JOB,"DGMFR13",DGMR0))
if DGMR0=""
QUIT
DO PRINT2(DGMR0)
+10 QUIT
+11 ;
PRINT2(DGMR0) ; Get details
+1 NEW DGMRI
+2 SET DGMRI=0
FOR
SET DGMRI=$ORDER(^TMP($JOB,"DGMFR13",DGMR0,DGMRI))
if 'DGMRI!DGSMR
QUIT
Begin DoDot:1
+3 NEW DGMMR0,DGCT,DGCTS,DGCTX,DGMRST,DGMRCOD
+4 NEW DGMTST,DGMTED,DGMMRI,DGMTEDI,DGMPAR,DGMPARX
+5 NEW DGMREPL,DGMREPX,DGMV0
+6 ;
+7 IF $GET(DGOUTP)="E"
DO DELIM(DGMR0,DGMRI)
QUIT
+8 ;
+9 IF ($Y+1>MAXCNT)!'DGPGCNT
DO HEADER
if DGSMR
QUIT
+10 SET DGMR0=$GET(^TMP($JOB,"DGMFR13",DGMR0,DGMRI,"MR"))
+11 SET DGMRST=+$GET(^TMP($JOB,"DGMFR13",DGMR0,DGMRI,"STATUS"))
SET DGMRST=$SELECT(DGMRST:"INACTIVE",1:"ACTIVE")
+12 DO PRINMR(DGMRI)
+13 ;
+14 if 'DGMMRI
QUIT
+15 IF $GET(DGSUM)=2
Begin DoDot:2
+16 SET DGMTED=$$NOW^XLFDT
SET DGMTED=$ORDER(^DGMR(13.99,DGMMRI,"TERMSTATUS","B",DGMTED),-1)
+17 ; This should always be true, if data came from STS MFS process
IF DGMTED
Begin DoDot:3
+18 SET DGMTEDI=""
SET DGMTEDI=$ORDER(^DGMR(13.99,DGMMRI,"TERMSTATUS","B",DGMTED,DGMTEDI))
+19 SET DGMTST=$PIECE(^DGMR(13.99,DGMMRI,"TERMSTATUS",DGMTEDI,0),"^",2)
+20 WRITE ?30," Status: ",$SELECT(DGMTST:"ACTIVE",1:"INACTIVE")
End DoDot:3
+21 SET DGMV0=$GET(^DGMR(13.99,DGMMRI,"VUID"))
+22 WRITE !?3,"VUID: ",$PIECE(DGMV0,"^")
End DoDot:2
End DoDot:1
+23 QUIT
+24 ;
MUA(DGMUA) ; Select (M)apped, (U)nmapped, or(A)ll - entries from 13 mapped to 13.99
+1 NEW DIR,DIRUT,Y
+2 WRITE !
SET DIR(0)="SAO^M:(M)apped;U:(U)nmapped;A:(A)ll"
+3 SET DIR("?")="Enter ^ to exit"
+4 SET DIR("A",1)="Run the report for"
+5 SET DIR("A")="(M)apped, (U)nmapped, or (A)ll Religion entries: "
SET DIR("B")="A"
DO ^DIR
+6 IF $DATA(DIRUT)
SET DGOUT=1
QUIT
+7 SET DGMUA=Y
+8 QUIT
+9 ;
SUMMARY() ; ask to print detailed or summary report
+1 NEW DIR,DIRUT,X,Y
+2 SET DIR(0)="SOA^D:Detailed;S:Summary;"
SET DIR("B")="Summary"
+3 SET DIR("A")="Type of report to print: "
+4 WRITE !
DO ^DIR
+5 IF $DATA(DIRUT)
SET DGSMR=1
QUIT 0
+6 QUIT $SELECT(Y="S":1,Y="D":2,1:0)
+7 ;
OUT() ; select Excel or Report format
+1 NEW DIR,DIROUT,DIRUT,DTOUT,DUOUT,X,Y
+2 WRITE !
+3 SET DIR(0)="SA^E:Excel;R:Report"
+4 SET DIR("A")="(E)xcel Format or (R)eport Format: "
+5 SET DIR("B")="Report"
+6 DO ^DIR
IF $DATA(DIRUT)
SET DGSMR=1
QUIT ""
+7 QUIT Y
+8 ;
DELIM(DGMR0,DGMRI) ; Print output in "^" delimited format
+1 ; Print data in (E)xcel format, e.g., "data^data^data"
+2 IF '$GET(DGDELHD)
SET DGDELHD=1
Begin DoDot:1
+3 IF $GET(DGSUM)=1
WRITE !,"VA Religion^Mapped/Not Mapped^Master Religion Name"
+4 IF $GET(DGSUM)=2
WRITE !,"VA Religion^VA Religion Code^Mapped/Not Mapped^Master Religion Name^Master Religion Code^Master Religion Status^VUID"
End DoDot:1
+5 WRITE !,$PIECE(DGMR0,"^")
+6 IF $GET(DGSUM)=2
WRITE "^",$PIECE(DGMR0,"^",4)
+7 SET DGMMR0=$GET(^TMP($JOB,"DGMFR13",DGMR0,DGMRI,"MMRE"))
+8 SET DGMMRI=+$PIECE(DGMMR0,"^",4)
+9 WRITE "^",$SELECT(DGMMRI:"MAPPED",1:"NOT MAPPED")
+10 if 'DGMMRI
QUIT
+11 WRITE "^",$PIECE(^TMP($JOB,"DGMFR13",DGMR0,DGMRI,"MMRE"),"^")
+12 IF $GET(DGSUM)=2
Begin DoDot:1
+13 WRITE "^",$PIECE(^TMP($JOB,"DGMFR13",DGMR0,DGMRI,"MMRE"),"^",2)
+14 SET DGMTED=$$NOW^XLFDT
SET DGMTED=$ORDER(^DGMR(13.99,DGMMRI,"TERMSTATUS","B",DGMTED),-1)
+15 IF $GET(DGMTED)
Begin DoDot:2
+16 SET DGMTEDI=""
SET DGMTEDI=$ORDER(^DGMR(13.99,DGMMRI,"TERMSTATUS","B",DGMTED,DGMTEDI))
+17 SET DGMTST=$PIECE(^DGMR(13.99,DGMMRI,"TERMSTATUS",DGMTEDI,0),"^",2)
+18 WRITE "^",$SELECT(DGMTST:"ACTIVE",1:"INACTIVE")
End DoDot:2
+19 SET DGMV0=$GET(^DGMR(13.99,DGMMRI,"VUID"))
+20 WRITE "^",$PIECE(DGMV0,"^")
End DoDot:1
+21 QUIT
+22 ;
SELDEV() ; Prompt for output device, return 1 if queued
+1 IF DGOUTP="E"
Begin DoDot:1
+2 NEW DIR,X,Y
+3 SET DIR("A",1)=""
+4 SET DIR("A",2)=" ************************************************************"
+5 SET DIR("A",3)=" ** You selected a Delimited report. Please verify you **"
+6 SET DIR("A",4)=" ** you have turned logging on to capture the output. **"
+7 SET DIR("A",5)=" ** **"
+8 SET DIR("A",6)=" ** To avoid undesired wrapping, enter '0;199;999' at **"
+9 SET DIR("A",7)=" ** the 'DEVICE:' prompt. The Terminal Session display **"
+10 SET DIR("A",8)=" ** may need to be set to 199 columns. **"
+11 SET DIR("A",9)=" ************************************************************"
+12 SET DIR("A",10)=""
+13 SET DIR("A",11)=""
SET DIR("A",12)=""
+14 SET DIR("A")=" Press return to continue"
+15 SET DIR(0)="EA"
DO ^DIR
WRITE !
End DoDot:1
+16 ;
+17 NEW DGDONE
+18 WRITE !,"You may queue this report to print at a later time.",!
+19 FOR
if $GET(DGSMR)!$GET(DGDONE)
QUIT
Begin DoDot:1
+20 KILL %ZIS,IOP,POP,ZTSK
NEW I
SET DGION=$IO
SET %ZIS="QM"
+21 DO ^%ZIS
KILL %ZIS
+22 IF POP
SET IOP=DGION
DO ^%ZIS
KILL IOP,DGION
Begin DoDot:2
+23 NEW DIR,X,Y
+24 SET DIR(0)="YA"
SET DIR("A",1)=" ** No Device Selected **"
SET DIR("A")="Select a different device? (Y/N) "
DO ^DIR
+25 if 'Y
SET DGSMR=1
End DoDot:2
QUIT
+26 SET DGDONE=1
End DoDot:1
+27 IF $DATA(IO("Q"))
Begin DoDot:1
+28 NEW ZTDESC,ZTSAVE,ZTRTN
+29 SET ZTDESC="Religion to Master Religion Mapping Report"
SET ZTRTN="DQ^DGMFR13"
+30 SET ZTSAVE("DATE*")=""
SET ZTSAVE("DG*")=""
SET ZTSAVE("ZTREQ")="@"
+31 KILL IO("Q")
DO ^%ZTLOAD
if $DATA(ZTSK)
WRITE !,"Report is Queued to print!"
KILL ZTSK
End DoDot:1
QUIT 1
+32 if $GET(DGSMR)
QUIT -1
+33 QUIT 0
+34 ;
+1 NEW DGHDR,DGTAB,DGSPACE
+2 SET DGSMR=0
+3 IF CRT
IF DGPGCNT>0
IF '$DATA(ZTQUEUED)
Begin DoDot:1
+4 NEW DIR,LIN
+5 IF MAXCNT<51
FOR LIN=1:1:(MAXCNT-$Y)
WRITE !
+6 WRITE !
+7 SET DIR(0)="E"
DO ^DIR
KILL DIR
+8 IF 'Y
SET DGSMR=1
QUIT
End DoDot:1
if DGSMR
QUIT
+9 SET DGPGCNT=DGPGCNT+1
+10 WRITE @IOF,!
+11 SET $PIECE(DGSPACE," ",132)=""
+12 SET DGHDR=" Religion to Master Religion Report "
+13 SET DGHDR=DGHDR_"Page: "_DGPGCNT
SET DGTAB=132-$LENGTH(DGHDR)-1
+14 WRITE ?DGTAB,DGHDR
+15 QUIT
+16 ;
PRINMR(DGMRI) ; Print Religion file (#13) entry
+1 NEW DGCT2
+2 WRITE !!,"VA Religion: ",$PIECE(DGMR0,"^")
+3 IF $GET(DGSUM)=2
Begin DoDot:1
+4 WRITE !,"VA Religion Code: ",$PIECE(DGMR0,"^",4)
End DoDot:1
+5 SET DGMMR0=$GET(^TMP($JOB,"DGMFR13",DGMR0,DGMRI,"MMRE"))
+6 SET DGMMRI=+$PIECE(DGMMR0,"^",4)
+7 WRITE !,"Mapped to Master Religion: ",$SELECT(DGMMRI:"YES",1:"NO")
+8 if 'DGMMRI
QUIT
+9 WRITE !?3,"Master Religion Name: ",$PIECE(^TMP($JOB,"DGMFR13",DGMR0,DGMRI,"MMRE"),"^")
+10 IF $GET(DGSUM)=2
WRITE !?3,"Master Code: ",$PIECE(^TMP($JOB,"DGMFR13",DGMR0,DGMRI,"MMRE"),"^",2)
+11 QUIT
+12 ;
INFO ; Display message, clear screen
+1 NEW MSG
+2 SET MSG(1)=" This report prints Religions from the RELIGION"
+3 SET MSG(2)=" file (#13), and each Religion' relationship"
+4 SET MSG(3)=" to the Master Religion (#13.99) file."
+5 SET MSG(4)=""
+6 DO CLEAR^VALM1
+7 DO BMES^XPDUTL(.MSG)
+8 QUIT