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

APCDVDLT.m

Go to the documentation of this file.
APCDVDLT ; IHS/CMI/LAB - VISIT DELETE ;
 ;;2.0;IHS PCC SUITE;;MAY 14, 2009
 ;
 ;
EN ;PEP - can be called with APCDVDLT set to visit to delete
 S U="^"
 Q:'$D(APCDVDLT)
 Q:'APCDVDLT
 Q:'$D(^AUPNVSIT(APCDVDLT,0))
 D DELETE
 D EOJ
 Q
 ;
DELETE ;
 S APCDVFLE=9000010 F APCDVL=0:0 S APCDVFLE=$O(^DIC(APCDVFLE)) Q:APCDVFLE>9000010.99!(APCDVFLE'=+APCDVFLE)  D DELETE2
 S AUPNVSIT=APCDVDLT D DEL^AUPNVSIT K AUPNVSIT
 ;
 ;call module pcc control
 ;     APCDVDLT= Deleted visit ien
 ;
 F APCDVM=0:0 S APCDVM=$O(^APCDLINK(APCDVM)) Q:APCDVM'=+APCDVM  X:$D(^(APCDVM,3)) ^(3)
 K APCDVM
 I $D(ZTQUEUED) S ZTREQ="@"
 Q
 ;
DELETE2 ;
 S APCDVNM=$P(^DIC(APCDVFLE,0),U)
 S APCDVDG=^DIC(APCDVFLE,0,"GL"),APCDVIGR=APCDVDG_"""AD"",APCDVDLT,APCDVDFN)"
 S APCDVDFN="" F APCDVI=1:1 S APCDVDFN=$O(@APCDVIGR) Q:APCDVDFN=""  W:'$D(ZTQUEUED) "." S DIK=APCDVDG,DA=APCDVDFN D ^DIK
 Q
 ;
EOJ ; EOJ CLEANUP
 K APCDVDFN,APCDVDG,APCDVDLT,APCDVFLE,APCDVI,APCDVIGR,APCDVL,APCDVNM
 K %,X
 K D,D0,DA,DIC,DICR,DIE,DIG,DIH,DIU,DIV,DIW,DQ,DR
 Q