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

APCDCAF1.m

Go to the documentation of this file.
APCDCAF1 ; IHS/CMI/LAB - MENTAL HLTH ROUTINE 16-AUG-1994 ;
 ;;2.0;IHS PCC SUITE;**2,5,7,8,11**;MAY 14, 2009;Build 58
 ;; ;
 ;
DISP ;EP
 K DIR
 S DIR(0)="NO^1:"_APCDRCNT,DIR("A")="Which Visit"
 D ^DIR K DIR S:$D(DUOUT) DIRUT=1
 I Y="" W !,"No VISIT selected." D EOP G DISPX
 I $D(DIRUT) W !,"No VISIT selected." D EOP G DISPX
 S APCDVSIT=^TMP("APCDCAF",$J,"IDX",Y,Y)
 ;RELINKER?
 D ^XBFMK
 S APCDCAFV=APCDVSIT,APCDCAF="IN CAF" D EP^APCDKDE D ^APCDVD S APCDVSIT=APCDCAFV
 ;
DISPX ;
 K DIR,DIRUT,DUOUT,Y,APCDVSIT,APCDCAF,APCDCAFV
 D KILL^AUPNPAT
 D BACK
 Q
 ;
BACK ;EP - go back to listman
 D BACK^APCDCAF
 Q
 ;
MODIFY ;EP
 D FULL^VALM1
 K DIR
 S DIR(0)="NO^1:"_APCDRCNT,DIR("A")="Modify which Visit"
 D ^DIR K DIR S:$D(DUOUT) DIRUT=1
 I Y="" W !,"No VISIT selected." D EOP G MODIFYX
 I $D(DIRUT) W !,"No VISIT selected." D EOP G MODIFYX
 S APCDVSIT=^TMP("APCDCAF",$J,"IDX",Y,Y)
 ;RELINKER?
 S (Y,APCDPAT)=$P(^AUPNVSIT(APCDVSIT,0),U,5)
 D ^AUPNPAT
 S APCDVLK=APCDVSIT
 S APCDDATE=$P($P(^AUPNVSIT(APCDVSIT,0),U),".")
 S APCDCAT=$P(^AUPNVSIT(APCDVSIT,0),U,7)
 S APCDTYPE=$P(^AUPNVSIT(APCDVSIT,0),U,3)
 S APCDLOC=$P(^AUPNVSIT(APCDVSIT,0),U,6)
 S APCDCLN=$P(^AUPNVSIT(APCDVSIT,0),U,8)
 I AUPNDOB]"",$D(APCDDATE) S X2=AUPNDOB,X1=APCDDATE D ^%DTC S AUPNDAYS=X ; re-set days of age to visit date-dob
 S APCDFLG=0 D ^APCDEIN I APCDFLG W !!,"error in data entry modify mode" D EOP G MODIFYX
 S APCDMODE="M"
 S AUPNVSIT=APCDVSIT D MOD^AUPNVSIT
 D ^XBFMK
 S APCDCAFV=APCDVSIT,APCDCAF="IN CAF" D EP^APCDKDE D PROCESS^APCDEM S APCDVSIT=APCDCAFV
 K DIR S DIR(0)="Y",DIR("A")="Do you want to update the Chart Audit Status for this visit",DIR("B")="Y" KILL DA D ^DIR KILL DIR
 I $D(DIRUT) G MODIFYX
 I 'Y G MODIFYX
 D UPD0
 ;
MODIFYX ;
 K APCDVSIT,APCDPAT,X,Y,AUPNVSIT,AUPNDAYS,APCDCAF,APCDCAFV
 D EN^APCDEKL
 D EN2^APCDEKL
 D KILL^AUPNPAT
 D BACK
 Q
 ;
APPEND ;EP
 D FULL^VALM1
 K DIR
 S DIR(0)="NO^1:"_APCDRCNT,DIR("A")="APPEND to which Visit"
 D ^DIR K DIR S:$D(DUOUT) DIRUT=1
 I Y="" W !,"No VISIT selected." D EOP G APPENDX
 I $D(DIRUT) W !,"No VISIT selected." D EOP G APPENDX
 S APCDVSIT=^TMP("APCDCAF",$J,"IDX",Y,Y)
 ;RELINKER
 S (Y,APCDPAT)=$P(^AUPNVSIT(APCDVSIT,0),U,5)
 D ^AUPNPAT
 S APCDVLK=APCDVSIT
 S APCDDATE=$P($P(^AUPNVSIT(APCDVSIT,0),U),".")
 S APCDCAT=$P(^AUPNVSIT(APCDVSIT,0),U,7)
 S APCDTYPE=$P(^AUPNVSIT(APCDVSIT,0),U,3)
 S APCDLOC=$P(^AUPNVSIT(APCDVSIT,0),U,6)
 S APCDCLN=$P(^AUPNVSIT(APCDVSIT,0),U,8)
 I AUPNDOB]"",$D(APCDDATE) S X2=AUPNDOB,X1=APCDDATE D ^%DTC S AUPNDAYS=X ; re-set days of age to visit date-dob
 S APCDFLG=0 D ^APCDEIN I APCDFLG W !!,"error in data entry APPEND mode" D EOP G APPENDX
 S APCDMODE="A",APCDNOXV=""
 S AUPNVSIT=APCDVSIT D MOD^AUPNVSIT
 D ^XBFMK
 S APCDCAFV=APCDVSIT,APCDCAF="IN CAF" D EP^APCDKDE D MNEPROC^APCDEAP S APCDVSIT=APCDCAFV
 K DIR S DIR(0)="Y",DIR("A")="Do you want to update the Chart Audit Status for this visit",DIR("B")="Y" KILL DA D ^DIR KILL DIR
 I $D(DIRUT) G APPENDX
 I 'Y G APPENDX
 D UPD0
 ;
APPENDX ;
 K APCDVSIT,APCDPAT,X,Y,AUPNVSIT,AUPNDAYS,APCDCAF,APCDCAFD
 D EN^APCDEKL
 D EN2^APCDEKL
 D KILL^AUPNPAT
 D BACK
 Q
 ;
UPDATE ;EP
 D FULL^VALM1
 K DIR
 S DIR(0)="NO^1:"_APCDRCNT,DIR("A")="Update Chart Audit Status for which Visit"
 D ^DIR K DIR S:$D(DUOUT) DIRUT=1
 I Y="" W !,"No VISIT selected." D EOP G UPDATEX
 I $D(DIRUT) W !,"No VISIT selected." D EOP G UPDATEX
 S APCDVSIT=^TMP("APCDCAF",$J,"IDX",Y,Y)
 D MOD^AUPNVSIT
UPD0 ;EP
 K DIC,DD,D0,DO
 S X=$$NOW^XLFDT,DIC="^AUPNVCA(",DIC(0)="L",DIADD=1,DLAYGO=9000010.45
 S DIC("DR")=".02////"_$P(^AUPNVSIT(APCDVSIT,0),U,5)_";.03////"_APCDVSIT_";.05////"_DUZ_";1216////"_$$NOW^XLFDT D FILE^DICN
 I Y=-1 W !!,"updating status failed" D EOP G UPDATEX
 K DIC,DD,D0,DIADD,DLAYGO
 S (APCDVCA,DA)=+Y
UPD1 ;
 D ^XBFMK
 S DA=APCDVCA,DIE="^AUPNVCA(",DR=".04" D ^DIE K DA,DIE,DR
 D ^XBFMK
 S APCDCAR=$P(^AUPNVCA(APCDVCA,0),U,4)
 I APCDCAR="" W !!,"You must enter a status" G UPD1
 S APCDERR=$$ERRORCHK^APCDCAF(APCDVSIT)
 I APCDERR]"",APCDCAR="R" W !!,"This visit has the following error: ",APCDERR,!,"You cannot mark a visit as Reviewed/Completed if there is an error." S DA=APCDVCA,DIE="^AUPNVCA(",DR=".04///I" D ^DIE G UPD1
 S DIE="^AUPNVSIT(",DA=APCDVSIT,DR=".13////"_DT_";1111////"_APCDCAR D ^DIE K DIE,DA,DR
 I APCDCAR="R" D RNU^APCDCAF4 G UPDATEX
R ;
 D EN^APCDCAF6(APCDVSIT)
 I '$$FINDPEND^APCDCAF6(APCDVSIT),$$VALI^XBDIQ1(9000010,APCDVSIT,1111)'="R",$P(^APCDSITE(DUZ(2),0),U,32) W !!,"A chart Deficiency reason is required." H 3 G R
 ;PUT CHART AUDIT NOTE HERE
 ;K DIR S DIR(0)="Y",DIR("A")="Do you want to update the Chart Audit Notes for this visit",DIR("B")="N" KILL DA D ^DIR KILL DIR
 ;I $D(DIRUT) G UPDATEX
 ;I 'Y G UPDATEX
 ;I '$D(^AUPNCANT(APCDVSIT)) D ADDCANT
 ;I '$D(^AUPNCANT(APCDVSIT)) W !!,"adding entry to chart audit notes failed." H 3 G UPDATEX
 ;S DA=APCDVSIT,DIE="^AUPNCANT(",DR=1100 D ^DIE K DIE,DA,DR
 ;
 ;
UPDATEX ;
 K DIADD,DLAYGO
 D ^XBFMK
 K APCDCAR,APCDCVA,APCDVSIT
 D BACK
 Q
 ;
ADDCANT ;EP
 S ^AUPNCANT(APCDVSIT,0)=APCDVSIT_U_$P(^AUPNVSIT(APCDVSIT,0),U,5)
 S DA=APCDVSIT,DIK="^AUPNCANT(" D IX1^DIK
 Q
EOP ;EP - End of page.
 Q:$E(IOST)'="C"
 ;Q:$D(ZTQUEUED)!'(IOT="TRM")!$D(IO("S"))
 NEW DIR
 K DIRUT,DFOUT,DLOUT,DTOUT,DUOUT
 S DIR("A")="Press Enter to Continue",DIR(0)="E" D ^DIR
 Q
 ;----------
MERGE ;EP
 D FULL^VALM1
 K DIR
 S DIR(0)="NO^1:"_APCDRCNT,DIR("A")="Which Visit"
 D ^DIR K DIR S:$D(DUOUT) DIRUT=1
 I Y="" W !,"No VISIT selected." D EOP G MERGEX
 I $D(DIRUT) W !,"No VISIT selected." D EOP G MERGEX
 S APCDVSIT=^TMP("APCDCAF",$J,"IDX",Y,Y)
 S APCDVLDT=$P($P(^AUPNVSIT(APCDVSIT,0),U),"."),APCDPAT=$P(^AUPNVSIT(APCDVSIT,0),U,5)
 S (X,APCDIDT)=(9999999-APCDVLDT),C=0 F  S X=$O(^AUPNVSIT("AA",APCDPAT,X)) Q:X=""!($P(X,".")>APCDIDT)  D
 .S V=0 F  S V=$O(^AUPNVSIT("AA",APCDPAT,X,V)) Q:V'=+V  S C=C+1
 I C<2 W !!,"Patient only has 1 visit on that day, cannot do a merge." D EOP G MERGEX
 S Y=APCDPAT D ^AUPNPAT
 W !!,"Select 'From' visit.",!
 S APCDVV="APCDVMF" D GETVISIT
 I 'APCDVMF G MERGEX
 S APCDVLDT=+^AUPNVSIT(APCDVMF,0)\1
 W !!,"Select 'To' visit.",!
 S APCDVV="APCDVMT" D GETVISIT
 I 'APCDVMT G MERGEX
 I APCDVMF=APCDVMT W !!,"'From' and 'To' the same.  Bye!" D EOP G MERGEX Q
 I $D(^ABSBITMS(9002302,"AD",APCDVMF)) W !!,"Cannot merge from a visit that has a Claim associate with it." G MERGEX  ;IHS/CMI/LAB - patch 3 per FSI
 W !!,"*** FROM VISIT ***"
 K DR S APCDVDSP=APCDVMF D ^APCDVDSP
 W !!,"*** TO VISIT ***"
 K DR S APCDVDSP=APCDVMT D ^APCDVDSP
 S APCDCAF="IN CAF" D EN1^APCDVMRG
 ;
MERGEX ;
 K APCDVSIT,APCDPAT,X,Y,AUPNVSIT,AUPNDAYS,APCDCAF,APCDCAFD,APCDPAT,APCDVMT,APCDVMF
 D EN1^APCDEKL
 D EN2^APCDEKL
 D KILL^AUPNPAT
 D BACK
 Q
GETVISIT ;
 K APCDVLK
 S APCDLOOK=""
 D ^APCDVLK
 S @APCDVV=APCDLOOK
 K APCDLOOK
 Q
 ;
DEL ;EP
 I '$D(^XUSEC("APCDZDELETEVISIT",DUZ)) W !!,"You do not have the security key to delete a Visit.",!,"Please see your supervisor or program manager.",! G DELX
 K DIR
 S DIR(0)="NO^1:"_APCDRCNT,DIR("A")="Which Visit"
 D ^DIR K DIR S:$D(DUOUT) DIRUT=1
 I Y="" W !,"No VISIT selected." D EOP G DELX
 I $D(DIRUT) W !,"No VISIT selected." D EOP G DELX
 S APCDVSIT=^TMP("APCDCAF",$J,"IDX",Y,Y)
 D ^XBFMK
 ;DSPLY ;
 S APCDVDSP=APCDVSIT D ^APCDVDSP
 I '$$ALLRET(APCDVSIT) W !!,"All Notes must be retracted before you can delete this visit." D EOP G DELX
 W !!,"THE ABOVE VISIT AND RELATED V FILE ENTRIES WILL BE REMOVED FOREVER !!!"
DELETE ; DELETE VISIT AND RELATED V FILES
 W !,"Sure you want to delete" S %=2 D YN^DICN S %Y=$E(%Y)
 Q:%Y="^"
 I "Nn"[%Y G DELX
 S DIE="^AUPNVSIT(",DA=APCDVSIT,DR=2201 D ^DIE K DA,DIE,DR
 I $P($G(^AUPNVSIT(APCDVSIT,22)),U)="" S DA=APCDVSIT,DIE="^AUPNVSIT(",DR="2201///NO RESPONSE FROM OPERATOR" D ^DIE K DA,DIE,DR
 ;UPDATE DELETE LOG
 D UPDLOG^APCDVDEL(APCDVSIT)
 S APCDVDLT=APCDVSIT D ^APCDVDLT
DELX ;
 K DIR,DIRUT,DUOUT,Y,APCDVSIT,APCDCAF,APCDCAFV,APCDVDLT
 D KILL^AUPNPAT
 D BACK
 Q
ALLRET(V) ;EP - are all notes
 NEW A,B,C
 S C=1
 S A=0 F  S A=$O(^AUPNVNOT("AD",V,A)) Q:A'=+A  D
 .I $P($G(^AUPNVNOT(A,0)),U,4)="" S C=0
 .Q
 Q C
 ;
MERGEDD ;EP
 D FULL^VALM1
 K DIR
 S DIR(0)="NO^1:"_APCDRCNT,DIR("A")="Which Visit"
 D ^DIR K DIR S:$D(DUOUT) DIRUT=1
 I Y="" W !,"No VISIT selected." D EOP G MERGEDDX
 I $D(DIRUT) W !,"No VISIT selected." D EOP G MERGEDDX
 S APCDVSIT=^TMP("APCDCAF",$J,"IDX",Y,Y)
 ;S APCDVLDT=$P($P(^AUPNVSIT(APCDVSIT,0),U),".")
 S APCDPAT=$P(^AUPNVSIT(APCDVSIT,0),U,5)
 S Y=APCDPAT D ^AUPNPAT
 W !!,"Select 'From' visit.",!
 S APCDVV="APCDVMF" D GETVISIT
 I 'APCDVMF G MERGEX
 ;S APCDVLDT=+^AUPNVSIT(APCDVMF,0)\1
 W !!,"Select 'To' visit.",!
 S APCDVV="APCDVMT" D GETVISIT
 I 'APCDVMT G MERGEX
 I APCDVMF=APCDVMT W !!,"'From' and 'To' the same.  Bye!" D EOP G MERGEX
 I $D(^ABSBITMS(9002302,"AD",APCDVMF)) W !!,"Cannot merge from a visit that has a Claim associate with it." G MERGEX  ;IHS/CMI/LAB - patch 3 per FSI
 W !!!,"You will be merging the following 2 visits:"
 W !,"FROM VISIT:" S APCDAX=APCDVMF D WRITE
 W !,"TO VISIT:" S APCDAX=APCDVMT D WRITE
 W !! S DIR(0)="Y",DIR("A")="Do you want to continue",DIR("B")="N" KILL DA D ^DIR KILL DIR
 I $D(DIRUT) G MERGEDDX
 I 'Y G MERGEDDX
 W !!,"*** FROM VISIT ***"
 K DR S APCDVDSP=APCDVMF D ^APCDVDSP
 W !!,"*** TO VISIT ***"
 K DR S APCDVDSP=APCDVMT D ^APCDVDSP
 S APCDCAF="IN CAF" D EN1^APCDVMDD
 ;
MERGEDDX ;
 K APCDVSIT,APCDPAT,X,Y,AUPNVSIT,AUPNDAYS,APCDCAF,APCDCAFD,APCDPAT,APCDVMT,APCDVMF
 D EN1^APCDEKL
 D EN2^APCDEKL
 D KILL^AUPNPAT
 D BACK
 Q
WRITE ; WRITE VISITS FOR SELECT
 NEW APCDA11,APCDAT
 S APCDA11=$G(^AUPNVSIT(APCDAX,11)),APCDAX=^AUPNVSIT(APCDAX,0)
 S APCDAT=$P(+APCDAX,".",2),APCDAT=$S(APCDAT="":"<NONE>",$L(APCDAT)=1:APCDAT_"0:00 ",1:$E(APCDAT,1,2)_":"_$E(APCDAT,3,4)_$E("00",1,2-$L($E(APCDAT,3,4)))_" ")
 W !,$$FMTE^XLFDT($P($P(APCDAX,U),".")),"  TIME: ",APCDAT,"TYPE: ",$P(APCDAX,U,3),"  CATEGORY: ",$P(APCDAX,U,7)
 W "  CLINIC: ",$S($P(APCDAX,U,8)]"":$E($P(^DIC(40.7,$P(APCDAX,U,8),0),U),1,8),1:"<NONE>"),?56,"DEC: ",$S($P(APCDAX,U,9):$P(APCDAX,U,9),1:0)
 I $P(APCDA11,U,3)]"" W ?64,"VCN: ",$P(APCDA11,U,3)
 K APCDAT
 Q
MOVEVD ;EP
 D FULL^VALM1
 K DIR
 S DIR(0)="NO^1:"_APCDRCNT,DIR("A")="Which Visit"
 D ^DIR K DIR S:$D(DUOUT) DIRUT=1
 I Y="" W !,"No VISIT selected." D EOP G MOVEVDX
 I $D(DIRUT) W !,"No VISIT selected." D EOP G MOVEVDX
 S APCDVSIT=^TMP("APCDCAF",$J,"IDX",Y,Y)
 S APCDVLDT=$P($P(^AUPNVSIT(APCDVSIT,0),U),"."),APCDPAT=$P(^AUPNVSIT(APCDVSIT,0),U,5)
 S (X,APCDIDT)=(9999999-APCDVLDT),C=0 F  S X=$O(^AUPNVSIT("AA",APCDPAT,X)) Q:X=""!($P(X,".")>APCDIDT)  D
 .S V=0 F  S V=$O(^AUPNVSIT("AA",APCDPAT,X,V)) Q:V'=+V  S C=C+1
 I C<2 W !!,"Patient only has 1 visit on that day, cannot move data." D EOP G MOVEVDX
 S Y=APCDPAT D ^AUPNPAT
 W !!,"Select 'From' visit.",!
 S APCDVV="APCDVMF" D GETVISIT
 I 'APCDVMF G MOVEVDX
 S APCDVLDT=+^AUPNVSIT(APCDVMF,0)\1
 W !!,"Select 'To' visit.",!
 S APCDVV="APCDVMT" D GETVISIT
 I 'APCDVMT G MOVEVDX
 I APCDVMF=APCDVMT W !!,"'From' and 'To' the same.  Bye!" D EOP G MOVEVDX Q
 D EP1^APCDKUL
MOVEVDX ;
 K APCDVSIT,APCDPAT,X,Y,AUPNVSIT,AUPNDAYS,APCDCAF,APCDCAFD,APCDPAT,APCDVMT,APCDVMF
 D EN1^APCDEKL
 D EN2^APCDEKL
 D KILL^AUPNPAT
 D BACK
 Q
CVD ;EP
 K DIR
 S DIR(0)="NO^1:"_APCDRCNT,DIR("A")="Which Visit"
 D ^DIR K DIR S:$D(DUOUT) DIRUT=1
 I Y="" W !,"No VISIT selected." D EOP G CVDX
 I $D(DIRUT) W !,"No VISIT selected." D EOP G CVDX
 S APCDVSIT=^TMP("APCDCAF",$J,"IDX",Y,Y)
 D ^XBFMK
 ;DSPLY ;
 W !
 S DIC="^AUPNVSIT(",DA=APCDVSIT D EN^DIQ K DIC,DIQ,DA
CHANGEVD ; CHANGE VISIT DATE/TIME
 W !!,"The date and time of the VISIT is ",$$VAL^XBDIQ1(9000010,APCDVSIT,.01),!
 S %DT="ATRX",%DT("A")="Enter new date and time: " D ^%DT K %DT
 I Y<0 W !!,"Bye" G CVDX
 W !,"The new visit date and time will be: ",$$FMTE^XLFDT(Y,1)
 S X=Y D CHKVD
 I '$D(X) W !!,"Invalid Date/Time" D EOP G CVDX
 S APCDX=X
 S DIR(0)="Y",DIR("A")="Is this okay",DIR("B")="Y" KILL DA D ^DIR KILL DIR
 I $D(DIRUT) D EOP G CVDX
 I 'Y D EOP G CVDX
 W "  <WAIT>"
 S APCDCVDT("VISIT DFN")=APCDVSIT
 S APCDCVDT("VISIT DATE/TIME")=APCDX
 S APCDCVDT("TALK")=1
 D ^APCDCVDT
 I $D(Y) W !,"Updating the Date Last Modified failed!!"
CVDX ;
 K DIR,DIRUT,DUOUT,Y,APCDVSIT,APCDCAF,APCDCAFV,APCDVDLT,APCDCVDT,APCDX
 D KILL^AUPNPAT
 D BACK
 Q
CHKVD ; CHECK NEW VISIT DATE
 S Y=$P(^AUPNVSIT(APCDVSIT,0),U,5) D ^AUPNPAT
 D VSIT01^AUPNVSIT
 Q
MOVEVDD ;EP
 D FULL^VALM1
 K DIR
 S DIR(0)="NO^1:"_APCDRCNT,DIR("A")="Which Visit"
 D ^DIR K DIR S:$D(DUOUT) DIRUT=1
 I Y="" W !,"No VISIT selected." D EOP G MOVEVDDX
 I $D(DIRUT) W !,"No VISIT selected." D EOP G MOVEVDDX
 S APCDVSIT=^TMP("APCDCAF",$J,"IDX",Y,Y)
 S APCDPAT=$P(^AUPNVSIT(APCDVSIT,0),U,5)
 S Y=APCDPAT D ^AUPNPAT
 D GETFROM^APCDKULD
 I 'APCDVMF G MOVEVDDX
 D GETTO^APCDKULD
 I 'APCDVMT G MOVEVDDX
 I APCDVMF=APCDVMT W !!,"'From' and 'To' the same.  Bye!" D EOP G MOVEVDDX Q
 D EP1^APCDKULD
MOVEVDDX ;
 K APCDVSIT,APCDPAT,X,Y,AUPNVSIT,AUPNDAYS,APCDCAF,APCDCAFD,APCDPAT,APCDVMT,APCDVMF
 D EN1^APCDEKL
 D EN2^APCDEKL
 D KILL^AUPNPAT
 D BACK
 Q
 ;
ADDVISIT ;EP - ADD NEW VISIT CALLED FROM PROTOCOL ENTRY
 D FULL^VALM1
 D EN^XBNEW("^APCDEA","")
 D EN^APCDEKL
 D EN2^APCDEKL
 D BACK
 Q
RESEQ ;EP
 D FULL^VALM1
 K DIR
 S DIR(0)="NO^1:"_APCDRCNT,DIR("A")="Resequence POVs for which visit"
 D ^DIR K DIR S:$D(DUOUT) DIRUT=1
 I Y="" W !,"No VISIT selected." D EOP G RESEQX
 I $D(DIRUT) W !,"No VISIT selected." D EOP G RESEQX
 S APCDVSIT=^TMP("APCDCAF",$J,"IDX",Y,Y)
 D EN^APCDRPOV(APCDVSIT)
 D ^XBFMK
 K DIR S DIR(0)="Y",DIR("A")="Do you want to update the Chart Audit Status for this visit",DIR("B")="Y" KILL DA D ^DIR KILL DIR
 I $D(DIRUT) G RESEQX
 I 'Y G RESEQX
 D UPD0
 ;
RESEQX ;
 K APCDVSIT,APCDPAT,X,Y,AUPNVSIT,AUPNDAYS,APCDCAF,APCDCAFD
 D EN^APCDEKL
 D EN2^APCDEKL
 D KILL^AUPNPAT
 D BACK
 Q