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

BPCBHDEL.m

Go to the documentation of this file.
BPCBHDEL ; IHS/OIT/MJL - GUI V FILE VISIT CREATION ;
 ;;1.5;BPC;;MAY 26, 2005
 ;;
TEST ;
 D EN(.RETVAL,24609)
 Q
EN(BPCARRAY,AMHR) ;EP CALL
 S BPCERR="",ZTQUEUED=""
 ;AMHR must be ien of MHSS RECORD that is to be deleted
 D
 .NEW AMHACTN
 .S AMHACTN=4
 .D CHECKREC Q:BPCERR'=""
 .D DELETE
 I BPCERR="" D MSG("1") Q
 I BPCERR'="" D ERROR(BPCERR)
 D KILL
 Q
 ;
CHECKREC ;
 I '$G(AMHR) S BPCERR="IEN MISSING" Q
 I '$D(^AMHREC(AMHR)) S BPCERR="INVALID RECORD IEN PASSED" Q
 Q
DELETE ;
 S AMHVDLT=$P(^AMHREC(AMHR,0),U,16)
 S AMHRDEL=AMHR
 S AMHVFLE=9002011 F AMHVL=0:0 S AMHVFLE=$O(^DIC(AMHVFLE)) Q:AMHVFLE>9002011.49!(AMHVFLE'=+AMHVFLE)  D DELETE2
 S DA=$O(^AMHRCDST("B",AMHRDEL,0)) I DA S DIK="^AMHRCDST(" D ^DIK ;delete staging tool
 S DIK="^AMHREC(",DA=AMHRDEL,X=2 D ^DIK K DA,DIK
 D EOJ
 D PCCCHECK
 D PCCLINK
 Q
 ;
DELETE2 ;
 S AMHVNM=$P(^DIC(AMHVFLE,0),U)
 S AMHVDG=^DIC(AMHVFLE,0,"GL"),AMHVIGR=AMHVDG_"""AD"",AMHRDEL,AMHVDFN)"
 S AMHVDFN="" F AMHVI=1:1 S AMHVDFN=$O(@AMHVIGR) Q:AMHVDFN=""  W:'$D(ZTQUEUED) "." S DIK=AMHVDG,DA=AMHVDFN D ^DIK
 Q
 ;
EOJ ; EOJ CLEANUP
 K AMHVDFN,AMHVDG,AMHRDEL,AMHVFLE,AMHVI,AMHVIGR,AMHVL,AMHVNM
 K %,X
 K D,D0,DA,DIC,DICR,DIE,DIG,DIH,DIU,DIV,DIW,DQ,DR,DIK
 Q
PCCCHECK ;check to see if link to pcc active, set AMHLPCC IF SO
 K AMHLPCC
 S (AMHLPCC,AMHLPCCT)=$P(^AMHSITE(DUZ(2),0),U,12) I AMHLPCC S AMHLPCC=AMHLPCC-1
 I AMHLPCC="" S AMHLPCC=0 Q
 Q:'AMHLPCC
 I $D(^AUTTSITE(1,0)),$P(^(0),U,8)="Y",'$D(^APCCCTRL(DUZ(2),0))#2 S AMHLPCC=0 Q
 S AMHPKG=$O(^DIC(9.4,"C","AMH",""))
 I '$D(^APCCCTRL(DUZ(2),11,AMHPKG,0))#2 S AMHLPCC=0 Q
 I $D(^AUTTSITE(1,0)),$P(^(0),U,8)="Y",$D(^APCCCTRL(DUZ(2),0))#2,$D(^APCCCTRL(DUZ(2),11,AMHPKG,0))#2,$P(^(0),U,2) S AMHLPCC=AMHLPCC
 E  S AMHLPCC=0
 K AMHPKG
 Q
 Q:'AMHLPCC  ;quit if no pcc link
 I $G(AMHVDLT)="",AMHACTN=4 Q
 S AMHBL=1
 S APCDVDLT=$G(AMHVDLT) I APCDVDLT="" Q
 D ^APCDVDLT K APCDVDLT,AMHBL
 Q
 ;
ERROR(BPCX) ;
 D MSG("-1"_$C(30)_BPCX)
 Q
 ;
MSG(BPCX) ;
 S BPCARRAY=BPCX
 Q
 ;
 ;
KILL ;
 K APCDALVR,BPCPARM,BPCERR,BPCVAL,AMHR,AMHACTN,AMHBL,AMHLPCC,AMHVDLT,AMHLPCCT,AMHVISIT
 Q