DGRPCP ;ALB/MRL/BAJ - CONSISTENCY PRINT ; OCT 25, 2005
 ;;5.3;Registration;**653**;Aug 13, 1993;Build 2
 ;
 ;DG*5.3*653  BAJ  10/25/2005
 ;modified code to prompt for and process inconsistencies found during Z07 build
 ;Also modified format of report.  Changed to print inconsistency descriptions instead
 ;of numbers.  See DGRPCP1 for detail.
 ;
 ;
 D ON^DGRPC G Q^DGRPCP1:DGER
1 K ^UTILITY($J) D DT^DICRW S Z="^" W !!,"Generate a listing of inconsistent data elements by:",! F I=1:1:3 S J=$P($T(T+I),";;",2),Z=Z_$P(J,"^",1)_"^" W !?4,$P(J,"^",1)
 R !!,"CHOOSE OUTPUT METHOD OR ENTER '^' TO QUIT:  ",X:DTIME S:'$T X="^" D IN^DGHELP G Q^DGRPCP1:X["^"!(X']"") I %=-1 W !!,"The available choices are:",! X "F I=1:1:3 S J=$P($T(T+I),"";;"",2) W !,$P(J,""^"",1),"" - "",$P(J,""^"",2)" G 1
 S DGHOW=X_"^"_$S(X="A":"ADMISSION",X="R":"REGISTRATION",1:"IDENTIFICATION")_" DATE"
D W !! S %DT="EAX",%DT(0)=-DT,%DT("A")="Start with "_$P(DGHOW,"^",2)_":  " D ^%DT G Q^DGRPCP1:Y'>0 S DGFRD=Y
 S Y=DGFRD X ^DD("DD") S %DT("A")="     Go To "_$P(DGHOW,"^",2)_":  "_Y_"// " D ^%DT I X']"" S DGTOD=DGFRD_".9999" G H
 G Q^DGRPCP1:Y'>0 S DGTOD=Y_".9999" I DGFRD>DGTOD W !?4,"TO DATE CAN'T BE BEFORE FROM DATE!!",*7 G D
H K %DT S Z="^NAME^TERMINAL DIGIT" R !!,"List by (N)ame or (T)erminal Digit:  ",X:DTIME S:'$T X="^" D IN^DGHELP G Q^DGRPCP1:X["^"
 I %=-1 W !!?4,"N - To generate listing in Alphabetical Order",!?4,"T - To generate listing in Terminal Digit Order." G H
Z07 S DGHOW1=X,Z="^Registration^Z07 Messages^All" R !!,"List (R)egistration, (Z)07 Messages or (A)ll Inconsistencies:  ",X:DTIME S:'$T X="^" D IN^DGHELP G Q^DGRPCP1:X["^"
 I %=-1 D  G Z07
 . W !!?4,"R - Generate a list of inconsistencies found during Registration"
 . W !?4,"Z - Generate a list of inconsistencies found during Z07 Message build"
 . W !?4,"A - Generate a list of all inconsistencies found"
 S DGFILT=$S("RZ"[X:X,1:"A")
 W !!,*7,"THIS OUTPUT REQUIRES 132 COLUMN OUTPUT" S DGVAR="DUZ^DGHOW^DGHOW1^DGFRD^DGTOD^DGFILT",DGPGM="^DGRPCP1" D ZIS^DGUTQ G Q^DGRPCP1:POP U IO G ^DGRPCP1
T ;
 ;;ADMISSION DATE^Patients admitted during a specified date range.
 ;;IDENTIFICATION DATE^Inconsistencies identified during a specified date range.
 ;;REGISTRATION DATE^Patients registered during a specified date range.
 
--- Routine Detail   --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HDGRPCP   2296     printed  Sep 23, 2025@20:31:57                                                                                                                                                                                                      Page 2
DGRPCP    ;ALB/MRL/BAJ - CONSISTENCY PRINT ; OCT 25, 2005
 +1       ;;5.3;Registration;**653**;Aug 13, 1993;Build 2
 +2       ;
 +3       ;DG*5.3*653  BAJ  10/25/2005
 +4       ;modified code to prompt for and process inconsistencies found during Z07 build
 +5       ;Also modified format of report.  Changed to print inconsistency descriptions instead
 +6       ;of numbers.  See DGRPCP1 for detail.
 +7       ;
 +8       ;
 +9        DO ON^DGRPC
           if DGER
               GOTO Q^DGRPCP1
1          KILL ^UTILITY($JOB)
           DO DT^DICRW
           SET Z="^"
           WRITE !!,"Generate a listing of inconsistent data elements by:",!
           FOR I=1:1:3
               SET J=$PIECE($TEXT(T+I),";;",2)
               SET Z=Z_$PIECE(J,"^",1)_"^"
               WRITE !?4,$PIECE(J,"^",1)
 +1        READ !!,"CHOOSE OUTPUT METHOD OR ENTER '^' TO QUIT:  ",X:DTIME
           if '$TEST
               SET X="^"
           DO IN^DGHELP
           if X["^"!(X']"")
               GOTO Q^DGRPCP1
           IF %=-1
               WRITE !!,"The available choices are:",!
               XECUTE "F I=1:1:3 S J=$P($T(T+I),"";;"",2) W !,$P(J,""^"",1),"" - "",$P(J,""^"",2)"
               GOTO 1
 +2        SET DGHOW=X_"^"_$SELECT(X="A":"ADMISSION",X="R":"REGISTRATION",1:"IDENTIFICATION")_" DATE"
D          WRITE !!
           SET %DT="EAX"
           SET %DT(0)=-DT
           SET %DT("A")="Start with "_$PIECE(DGHOW,"^",2)_":  "
           DO ^%DT
           if Y'>0
               GOTO Q^DGRPCP1
           SET DGFRD=Y
 +1        SET Y=DGFRD
           XECUTE ^DD("DD")
           SET %DT("A")="     Go To "_$PIECE(DGHOW,"^",2)_":  "_Y_"// "
           DO ^%DT
           IF X']""
               SET DGTOD=DGFRD_".9999"
               GOTO H
 +2        if Y'>0
               GOTO Q^DGRPCP1
           SET DGTOD=Y_".9999"
           IF DGFRD>DGTOD
               WRITE !?4,"TO DATE CAN'T BE BEFORE FROM DATE!!",*7
               GOTO D
H          KILL %DT
           SET Z="^NAME^TERMINAL DIGIT"
           READ !!,"List by (N)ame or (T)erminal Digit:  ",X:DTIME
           if '$TEST
               SET X="^"
           DO IN^DGHELP
           if X["^"
               GOTO Q^DGRPCP1
 +1        IF %=-1
               WRITE !!?4,"N - To generate listing in Alphabetical Order",!?4,"T - To generate listing in Terminal Digit Order."
               GOTO H
Z07        SET DGHOW1=X
           SET Z="^Registration^Z07 Messages^All"
           READ !!,"List (R)egistration, (Z)07 Messages or (A)ll Inconsistencies:  ",X:DTIME
           if '$TEST
               SET X="^"
           DO IN^DGHELP
           if X["^"
               GOTO Q^DGRPCP1
 +1        IF %=-1
               Begin DoDot:1
 +2                WRITE !!?4,"R - Generate a list of inconsistencies found during Registration"
 +3                WRITE !?4,"Z - Generate a list of inconsistencies found during Z07 Message build"
 +4                WRITE !?4,"A - Generate a list of all inconsistencies found"
               End DoDot:1
               GOTO Z07
 +5        SET DGFILT=$SELECT("RZ"[X:X,1:"A")
 +6        WRITE !!,*7,"THIS OUTPUT REQUIRES 132 COLUMN OUTPUT"
           SET DGVAR="DUZ^DGHOW^DGHOW1^DGFRD^DGTOD^DGFILT"
           SET DGPGM="^DGRPCP1"
           DO ZIS^DGUTQ
           if POP
               GOTO Q^DGRPCP1
           USE IO
           GOTO ^DGRPCP1
T         ;
 +1       ;;ADMISSION DATE^Patients admitted during a specified date range.
 +2       ;;IDENTIFICATION DATE^Inconsistencies identified during a specified date range.
 +3       ;;REGISTRATION DATE^Patients registered during a specified date range.