DGJPDEF ;ALB/MAF - PHYSICIAN DEFICIENCY PRINT ROUTINE ; NOV 10 1992@300
;;1.0;Incomplete Records Tracking;;Jun 25, 2001
OUT S (DGJFL,DGJTMESS)=0 W !!,"Sort output by: PATIENT// " D ZSET1 S X="" R X:DTIME G QUIT:X="^"!('$T) I X=""!("Pp"[X) S X="3"
S X=$S("Dd"[X:1,"Ss"[X:2,1:X)
I X="?" D ZSET1,HELP1 G OUT
S DGJTSR=$E(X) D IN^DGJHELP W ! I %=-1 D ZSET1,HELP1 G OUT
OUT1 S DGJFL=0 W !!,"Print report for: (I)Inpatients, (O)Outpatients, (B)Both// " D ZSET2 S X="" R X:DTIME G QUIT:X="^"!('$T) I X=""!("Bb"[X) S X=3
S X=$S("Ii"[X:1,"Oo"[X:2,1:X)
I X="?" D ZSET2,HELP2 G OUT1
S DGJTSR1=$E(X) D IN^DGJHELP W ! I %=-1 D ZSET2,HELP2 G OUT1
I $D(^DG(43,1,"GL")) S DGJTMUL=$P(^DG(43,1,"GL"),"^",2)
S DGJTLPG=1
I $D(^DG(43,1,"GL")) S DGJTMUL=$P(^DG(43,1,"GL"),"^",2)
S DGJTL=$S(DGJTSR=1:"PHY",DGJTSR=2:"SER",DGJTSR=3:"PAT",1:"QUIT")
G ^DGJPDEF1
DAT ;DATE RANGE
BEG W ! S %DT="AEX",%DT("A")="START WITH EVENT DATE: " D ^%DT S DGJTBG=Y,DGJTBEG=Y-.0001 S:X="^"!(X="") Y=-1 Q:Y=-1
END W ! S %DT("A")="END WITH EVENT DATE: " D ^%DT S:X="^"!(X="") Y=-1 Q:Y=-1 I Y<1 D HELP^%DTC G END
S DGJTEND=Y_.9999
I DGJTEND\1<DGJTBG W !!?5,"The ending date cannot be before the beginning date" G END
Q
ASK1 S DGJDSC=0 W !!,"Display Summary Deficiencies if patient has not been discharged?" S %=1 D YN^DICN I '% D HLP G ASK1
I %=-1 S Y=% Q
I %=2 S DGJDSC=1
Q
QUIT K %,BY,DHD,DIC,DIOEND,DIS,DIR,DTOUT,DUOUT,FR,FLDS,IFN,K,L,TO,DGJTCK,DGJTDIR,DGJTL,DGJTLPG,DGJTMESS,DGPGM,DGJTMUL,DGJTSR,DGJTSTAT,DGJTUN,POP,DGU,DGJTQF,DGJTDEL,VAUTN,DGJFL,DGJTSR1,DGJ(0),RT,RTDATA,RTE,RTYPE,VAERR,VADATE,VAUTD,VAUTT,X,Y,Z
K DGJDSC,DFN,DGFLAG,DGJ,DGJADM,DGJJ,DGJTDAT,DGJTDIV,DGJTDL,DGJTDT,DGJTDV,DGJTDV1,DGJTDVN,DGJTF,DGJTFF,DGJTLN,DGJTNODE,DGJTOT,DGJTPAG,DGJTPHY,DGJTPT,DGJTSP,DGJTSV,DGJY,DGVAR,VA,VADAT,VAUTY,^TMP("VAS",$J),DGJTBG,DGJTBEG,DGJTEND,%DT
D CLOSE^DGJUTQ Q
HELP1 W !!,"Choose a number or first initial :" F K=2:1:4 W !?15,$P(Z,"^",K)
W ! Q
HELP2 W !!,"Choose a number or first initial:" F K=2:1:4 W !?15,$P(Z,"^",K)
W ! Q
HLP W !!,"ENTER:"
W !?10,"Y - YES, if you would like the report to print Deficiencies under",!?10," the category SUMMARY if the patient has not been discharged."
W !!?10,"N - NO, if you would not like the report to print Deficiencies under",!?10," the category SUMMARY if the patient has not been discharged."
Q
ZSET1 S Z="^1 DOCTOR^2 SERVICE/TREATING SPECIALTY^3 PATIENT^" Q
ZSET2 S Z="^1 INPATIENTS ONLY^2 OUTPATIENTS ONLY^3 BOTH INPATIENT and OUTPATIENTS^" Q
SEL S DIR("A")="Select INCOMPLETE RECORD STATUS: ",DIR(0)="SA^A:ALL;D:UNDICTATED;T:NOT TRANSCRIBED;S:UNSIGNED;R:NOT REVIEWED",DIR("B")="ALL"
S DIR("?")="Enter desired status that you would like to have listed on the report"
S DIR("?",1)="CHOOSE FROM: "
S DIR("?",2)=" A FOR ALL",DIR("?",3)=" D FOR UNDICTATED",DIR("?",4)=" T FOR NOT TRANSCRIBED",DIR("?",5)=" S FOR UNSIGNED",DIR("?",6)=" R FOR NOT REVIEWED" D ^DIR
I $D(DTOUT)!$D(DUOUT) Q
I Y="A" S DGJTSTAT="^"_$O(^DG(393.2,"B","INCOMPLETE",0))_"^"_$O(^DG(393.2,"B","DICTATED",0))_"^"_$O(^DG(393.2,"B","TRANSCRIBED",0))_"^"_$O(^DG(393.2,"B","SIGNED",0))_"^" Q
S DGJTSTAT="^"
D SET
S $P(DIR(0),"^",1)=$P(DIR(0),"^",1)_"O",$P(DIR(0),"^",2)=$E($P(DIR(0),"^",2),7,999) K DIR("B")
F I=2:1:6 S DIR("?",I)=$S($D(DIR("?",I+1)):DIR("?",I+1),1:"")
S DIR("A")="Select another STATUS: "
ASK D ^DIR I $D(DUOUT)!$D(DTOUT) Q
I X]"" D SET G ASK
Q
SET S X=$S(Y="D":"INCOMPLETE",Y="T":"DICTATED",Y="S":"TRANSCRIBED",Y="R":"SIGNED",Y="C":"r",1:"INCOMPLETE")
S X=$O(^DG(393.2,"B",X,0))
S DGJTSTAT=DGJTSTAT_X_"^"
Q
CK S X=Y Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HDGJPDEF 3616 printed Dec 13, 2024@02:00:43 Page 2
DGJPDEF ;ALB/MAF - PHYSICIAN DEFICIENCY PRINT ROUTINE ; NOV 10 1992@300
+1 ;;1.0;Incomplete Records Tracking;;Jun 25, 2001
OUT SET (DGJFL,DGJTMESS)=0
WRITE !!,"Sort output by: PATIENT// "
DO ZSET1
SET X=""
READ X:DTIME
if X="^"!('$TEST)
GOTO QUIT
IF X=""!("Pp"[X)
SET X="3"
+1 SET X=$SELECT("Dd"[X:1,"Ss"[X:2,1:X)
+2 IF X="?"
DO ZSET1
DO HELP1
GOTO OUT
+3 SET DGJTSR=$EXTRACT(X)
DO IN^DGJHELP
WRITE !
IF %=-1
DO ZSET1
DO HELP1
GOTO OUT
OUT1 SET DGJFL=0
WRITE !!,"Print report for: (I)Inpatients, (O)Outpatients, (B)Both// "
DO ZSET2
SET X=""
READ X:DTIME
if X="^"!('$TEST)
GOTO QUIT
IF X=""!("Bb"[X)
SET X=3
+1 SET X=$SELECT("Ii"[X:1,"Oo"[X:2,1:X)
+2 IF X="?"
DO ZSET2
DO HELP2
GOTO OUT1
+3 SET DGJTSR1=$EXTRACT(X)
DO IN^DGJHELP
WRITE !
IF %=-1
DO ZSET2
DO HELP2
GOTO OUT1
+4 IF $DATA(^DG(43,1,"GL"))
SET DGJTMUL=$PIECE(^DG(43,1,"GL"),"^",2)
+5 SET DGJTLPG=1
+6 IF $DATA(^DG(43,1,"GL"))
SET DGJTMUL=$PIECE(^DG(43,1,"GL"),"^",2)
+7 SET DGJTL=$SELECT(DGJTSR=1:"PHY",DGJTSR=2:"SER",DGJTSR=3:"PAT",1:"QUIT")
+8 GOTO ^DGJPDEF1
DAT ;DATE RANGE
BEG WRITE !
SET %DT="AEX"
SET %DT("A")="START WITH EVENT DATE: "
DO ^%DT
SET DGJTBG=Y
SET DGJTBEG=Y-.0001
if X="^"!(X="")
SET Y=-1
if Y=-1
QUIT
END WRITE !
SET %DT("A")="END WITH EVENT DATE: "
DO ^%DT
if X="^"!(X="")
SET Y=-1
if Y=-1
QUIT
IF Y<1
DO HELP^%DTC
GOTO END
+1 SET DGJTEND=Y_.9999
+2 IF DGJTEND\1<DGJTBG
WRITE !!?5,"The ending date cannot be before the beginning date"
GOTO END
+3 QUIT
ASK1 SET DGJDSC=0
WRITE !!,"Display Summary Deficiencies if patient has not been discharged?"
SET %=1
DO YN^DICN
IF '%
DO HLP
GOTO ASK1
+1 IF %=-1
SET Y=%
QUIT
+2 IF %=2
SET DGJDSC=1
+3 QUIT
QUIT KILL %,BY,DHD,DIC,DIOEND,DIS,DIR,DTOUT,DUOUT,FR,FLDS,IFN,K,L,TO,DGJTCK,DGJTDIR,DGJTL,DGJTLPG,DGJTMESS,DGPGM,DGJTMUL,DGJTSR,DGJTSTAT,DGJTUN,POP,DGU,DGJTQF,DGJTDEL,VAUTN,DGJFL,DGJTSR1,DGJ(0),RT,RTDATA,RTE,RTYPE,VAERR,VADATE,VAUTD,VAUTT,X,Y,Z
+1 KILL DGJDSC,DFN,DGFLAG,DGJ,DGJADM,DGJJ,DGJTDAT,DGJTDIV,DGJTDL,DGJTDT,DGJTDV,DGJTDV1,DGJTDVN,DGJTF,DGJTFF,DGJTLN,DGJTNODE,DGJTOT,DGJTPAG,DGJTPHY,DGJTPT,DGJTSP,DGJTSV,DGJY,DGVAR,VA,VADAT,VAUTY,^TMP("VAS",$JOB),DGJTBG,DGJTBEG,DGJTEND,%DT
+2 DO CLOSE^DGJUTQ
QUIT
HELP1 WRITE !!,"Choose a number or first initial :"
FOR K=2:1:4
WRITE !?15,$PIECE(Z,"^",K)
+1 WRITE !
QUIT
HELP2 WRITE !!,"Choose a number or first initial:"
FOR K=2:1:4
WRITE !?15,$PIECE(Z,"^",K)
+1 WRITE !
QUIT
HLP WRITE !!,"ENTER:"
+1 WRITE !?10,"Y - YES, if you would like the report to print Deficiencies under",!?10," the category SUMMARY if the patient has not been discharged."
+2 WRITE !!?10,"N - NO, if you would not like the report to print Deficiencies under",!?10," the category SUMMARY if the patient has not been discharged."
+3 QUIT
ZSET1 SET Z="^1 DOCTOR^2 SERVICE/TREATING SPECIALTY^3 PATIENT^"
QUIT
ZSET2 SET Z="^1 INPATIENTS ONLY^2 OUTPATIENTS ONLY^3 BOTH INPATIENT and OUTPATIENTS^"
QUIT
SEL SET DIR("A")="Select INCOMPLETE RECORD STATUS: "
SET DIR(0)="SA^A:ALL;D:UNDICTATED;T:NOT TRANSCRIBED;S:UNSIGNED;R:NOT REVIEWED"
SET DIR("B")="ALL"
+1 SET DIR("?")="Enter desired status that you would like to have listed on the report"
+2 SET DIR("?",1)="CHOOSE FROM: "
+3 SET DIR("?",2)=" A FOR ALL"
SET DIR("?",3)=" D FOR UNDICTATED"
SET DIR("?",4)=" T FOR NOT TRANSCRIBED"
SET DIR("?",5)=" S FOR UNSIGNED"
SET DIR("?",6)=" R FOR NOT REVIEWED"
DO ^DIR
+4 IF $DATA(DTOUT)!$DATA(DUOUT)
QUIT
+5 IF Y="A"
SET DGJTSTAT="^"_$ORDER(^DG(393.2,"B","INCOMPLETE",0))_"^"_$ORDER(^DG(393.2,"B","DICTATED",0))_"^"_$ORDER(^DG(393.2,"B","TRANSCRIBED",0))_"^"_$ORDER(^DG(393.2,"B","SIGNED",0))_"^"
QUIT
+6 SET DGJTSTAT="^"
+7 DO SET
+8 SET $PIECE(DIR(0),"^",1)=$PIECE(DIR(0),"^",1)_"O"
SET $PIECE(DIR(0),"^",2)=$EXTRACT($PIECE(DIR(0),"^",2),7,999)
KILL DIR("B")
+9 FOR I=2:1:6
SET DIR("?",I)=$SELECT($DATA(DIR("?",I+1)):DIR("?",I+1),1:"")
+10 SET DIR("A")="Select another STATUS: "
ASK DO ^DIR
IF $DATA(DUOUT)!$DATA(DTOUT)
QUIT
+1 IF X]""
DO SET
GOTO ASK
+2 QUIT
SET SET X=$SELECT(Y="D":"INCOMPLETE",Y="T":"DICTATED",Y="S":"TRANSCRIBED",Y="R":"SIGNED",Y="C":"r",1:"INCOMPLETE")
+1 SET X=$ORDER(^DG(393.2,"B",X,0))
+2 SET DGJTSTAT=DGJTSTAT_X_"^"
+3 QUIT
CK SET X=Y
QUIT