Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: DGJTEE

DGJTEE.m

Go to the documentation of this file.
DGJTEE ;MAF,ESD/ALB - ENTER/EDIT OPTION AND MAIN LIST PROCESSOR RTN ; JUN 21 1992@800
 ;;5.3;Registration;**9,30,51,54,1015**;Aug 13, 1993;Build 21
START K XQORS,VALMEVL D EN^VALM("DGJ DEFICIENCY LIST")
 Q
START1 K XQORS,VALMEVL D EN^VALM("DGJ IRT RECORD LIST")
 Q
START2 K XQORS,VALMEVL D EN^VALM("DGJ DELETE SINGLE")
 Q
START3 S DGJTOPT=1 D EN^VALM("DGJ COMP EDIT SINGLE")
 Q
START4 D EN^VALM("DGJ COMP EDIT SUPER")
 Q
START5 D EN^VALM("DGJ DELETE SUPER")
 Q
START6 K XQORS,VALMEVL S DGJVIEW=1 D EN^VALM("DGJ IRT VIEW")
 K DGJVIEW Q
EN S (DGJTDD,DGJTDBY,DGJTTD,DGJTTBY,DGJTSDT,DGJTSBY,DGJTOUT,DGJT2PH)="",(DGJTFG,DGJTAT,DGJTFLAG,DGJTIOFL,DGJCNT1)=0 S DGJTCFLG=1
 I $D(^DG(43,1,"GL")) S X=$P(^DG(43,1,"GL"),"^",2) I X=1 S DIR(0)="393,.06",DIR("A")="Select DIVISION " D ^DIR S:Y="^"!($D(DTOUT)) VALMQUIT="",DGJTFLAG=1 G:DGJTFLAG INITQ S DGJTDV=Y K DIR("A")
 I '$D(DGJTDV) S X=$O(^DG(40.8,0)) S DGJTDV=X_"^"_$P(^DG(40.8,+X,0),"^")
 S DGJTDEL=^DG(40.8,+DGJTDV,"DT") I $P(DGJTDEL,"^",5)=0 W !!?10,"This facility not tracking for OUTPATIENT OP REPORTS!",! S DGJTIOFL=1
 S (VALMCNT,DGJCNT)=0,VALMBG=1
PAT K DGJTOA S DIC="^DPT(",DIC(0)="AQEMZ" D ^DIC
 I $D(DTOUT)!($D(DUOUT)) S VALMQUIT="" G INITQ
 I Y<0 G PAT
 S (DFN,DGJTPT)=+Y
 S DGJTNODE=^DPT(DFN,0) D PID^VADPT6 S DGJID=VA("PID")
 I DGJTIOFL S DGJTSR1=1 G INP
OUT1 S DGJFL=0 W !!,"Display for: (I)Inpatients, (O)Outpatients   INPATIENTS//  " R X:DTIME S:X="^"!('$T) VALMQUIT="" G:X="^"!('$T) INITQ D ZSET2 I X=""!("Ii"[X) S X=1
 S X=$S("Oo"[X:2,1:X)
 I X="?" D ZSET2,HELP2 G OUT1
 S DGJTSR1=$E(X) D IN^DGHELP W ! I %=-1 D ZSET2,HELP2 G OUT1
 I DGJTSR1=2 G EVDT
INP D WARN^DGJTUTL I '$D(^UTILITY("DGJTADM",$J)) I $P(DGJTDEL,"^",5)=0!(DGJTSR1=1) G PAT
 I '$D(^UTILITY("DGJTADM",$J)),$P(DGJTDEL,"^",5) D NUL Q
 S DGJTFG=0 D LIST^DGJTEE2 I DGJTFG S VALMQUIT="" G INITQ
EVDT D WAIT^DICD K ^TMP("DGJDEF",$J),DGJCAT,DGJDISD S (VALMCNT,DGJCNT,DGJCNT1,DGJTFG,DGJTFLG)=0 I DGJTSR1=2 S DGJTAIFN="" D SCR^DGJTEE3 D:'$O(^TMP("DGJDEF",$J,0)) NUL Q
 S DGJTDIV=$P(^DGPM(DGJTAIFN,0),"^",6),DGJTDIV=$P($G(^DIC(42,+DGJTDIV,0)),"^",11)
 S VALMBG=1,DGJTCT=0 F IFN=0:0 S IFN=$O(^VAS(393,"ADM",DGJTAIFN,IFN)) Q:'IFN  I $D(^VAS(393,IFN,0)) S DGJTYP=$P(^VAS(393,IFN,0),"^",2) S DGJTCDIS=$S(DGJTYP]"":$P(^VAS(393.41,$P(^VAS(393.3,DGJTYP,0),"^",6),0),"^",4),1:"NOT SPECIFIED") D UTIL
 N CC,CM,CW,DC,DW,EC,EW,PC,PW,RV,SC,SN,SW,TC,TW D INCSP^DGJTEE2 D LOOP^DGJTEE1 I '$O(^TMP("DGJDEF",$J,0)) D NUL
 Q
UTIL S ^TMP("DGJ",$J,DGJTCDIS,DGJTYP,IFN)="" S:$O(^VAS(393.3,"B","DISCHARGE SUMMARY",0))=DGJTYP DGJDISD=1 Q
INITQ Q
Q K DIC("A"),DIC("B"),DIC("S") S VALMBCK="R" Q
ZSET2 S Z="^1 INPATIENTS^2 OUTPATIENTS^" Q
HELP2 W !!,"Choose a number or first initial:" F K=2:1:3 W !?15,$P(Z,"^",K)
 W ! Q
DATA I 'DGJTEDT S X=DGJTAIFN D NEW1
 Q
NEW ;EDIT CODE
 N DGJVALM,DGJAT,VALMY
 S VALMBCK=""
 D SEL^VALM2 G ENQ:'$O(VALMY(0)) S DGJVALM=0
 D FULL^VALM1 S VALMBCK="R"
 F DGJVALM=0:0 S DGJVALM=$O(VALMY(DGJVALM)) Q:'DGJVALM  S DA=$P($G(^TMP("DGJIDX",$J,DGJVALM)),"^",2) I DA]"" S DGJTEDT="1^"_DA S DGJDFNO=DA,DIC="^VAS(393," D EN^DGJTEE2
ENQ D REP Q
FNL K DGJTDD,DGJTDBY,DGJTTD,DGJTTBY,DGJTSDT,DGJTSBY,DGJTOUT,DGJT2PH,DGJTFG,DGJTAT,DGJTFLAG,DGJTCFLG,DGJID,DGJTAIFN,DGJTDIV,DGJTDV,DGJTFLG,DGJTNODE,DGJTPT,VA,DGJTCT,DGJTIOFL,DGJTSR1,DGX,IFN,K,VALMQUIT,Z,DGJC,DGJFL,DGJTADTP,^TMP("DGJDEF",$J)
 K DGJTCNT,DGJTF,I,VAERR,DGJTOA,DGJDFNO,DGJI,DGJNOTY,DGJTFL,DGJTYP,DGJVAL,DGJTREC,DGJCAT,DGJCNT1,DGJTCAT,DGJTCDIS,DGJVAL1,DGJX,DGJCPDFN,DGJCPNOD,DGJCPSR1,DGJIFNO,^TMP("DGJ",$J),^TMP("DGJIDX",$J)
 K DGJTDT,DGJTDDT,DGJT1PH,DGJT,DGJTOPT,DGJTWD1,DGJTWD,DGJTSV,DGJTSP,DGJTPR,DIV,POP,S,VAIP,DGJCPTX,DGJDISD,DGJVIEW
QUIT K %,%Y,DA,DFN,DGA1,DGJTADN,DGJTAIFN,DGJTCH,DGJTCH1,DGJCNT,DGJTDEF,DGJTDEL,DGJTDLT,DGJTEDT,DGJTEDT1,DGJTFG,DGJTFLG,DGJTIFN,DGJTST,DGJTX,DGT,DIC,DIE,DIK,DIR,DR,I,X,Y,^TMP("DGJDEF",$J) Q
NEW1 ;ENTER CODE
 K DGJTEDT
 D FULL^VALM1
CAT I DGJTSR1=1&('$D(DGJTREC)) N DGJY S DIC="^VAS(393.41,",DIC(0)="AEMN" D ^DIC K DIC G:X["^" REP G:Y<0 CAT S DGJY=+Y
TYP I '$D(DGJTREC) S DIC("S")="I $P(^VAS(393.3,+Y,0),U,6)=+DGJY,$P(^VAS(393.3,+Y,0),U,7)=1" D CAT1
 I DGJTSR1=2 S DIC("S")="I $S(""^OP REPORT^""[$P(^VAS(393.3,+Y,0),U,1):1,1:0)"
 I DGJTSR1=1,$D(DGJTREC) S DIC("S")="I $S(""^OP REPORT^INTERIM SUMMARY^DISCHARGE SUMMARY^""[$P(^VAS(393.3,+Y,0),U,1):1,1:0)"
 S DIC="^VAS(393.3,",DIC("A")="Enter TYPE OF DEFICIENCY: ",DIC(0)="AEMQ" D ^DIC G Q:X["^"!($D(DTOUT)) S DGJTYP=+Y K DIC("S"),DIC("A"),DIC("B") I X']"" G TYP
 K DGJY D EDIT,REP Q
CAT1 I $D(DGJDISD) S DIC("S")=DIC("S")_",""^DISCHARGE SUMMARY^""'[$P(^VAS(393.3,+Y,0),U,1)"
 Q
EDIT D FULL^VALM1
 S DGJTDV=$P(DGJTDV,"^",1)
 D NEW^DGJTEE2
 Q
REP K DR D EVDT S VALMBG=1,VALMBCK="R" Q
HDR D HDR^DGJTEE1
 Q
NUL ;NULL MESSAGE
 K ^TMP("DGJDEF",$J) S ^TMP("DGJDEF",$J,1,0)=" ",^TMP("DGJDEF",$J,2,0)=$S($D(DGJTCOM):"There are no Completed IRTs for this patient",1:"There are no DEFICIENCIES that meet this action's criteria."),^TMP("DGJIDX",$J,1)=1,^TMP("DGJIDX",$J,2)=2
 Q