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

BRNRDLT.m

Go to the documentation of this file.
BRNRDLT ; IHS/PHXAO/TMJ - REFERRAL DELETE ;  
 ;;2.0;RELEASE OF INFO SYSTEM;;APR 10, 2003
 ;
 S U="^"
 Q:'$D(BRNRDLT)
 Q:'BRNRDLT
 Q:'$D(^BRNREC(BRNRDLT,0))
 ;
 ;Quit Deletion -reason to quit, ie CHS, ETC.
 ;Q:$D(^BRNREC(BRNRDSP,41,0))  ;  Quit if CHS Authorization Multiple
 ;Q:$P($G(^BRNREC(BRNRDSP,11)),U,12)]""  ; Quit if CHS Flds 1112 TO 1122
 ;Q:$P($G(^BRNREC(BRNRDSP,11)),U,13)]""
 ;Q:$P($G(^BRNREC(BRNRDSP,11)),U,14)]""
 ;Q:$P($G(^BRNREC(BRNRDSP,11)),U,15)]""
 ;Q:$P($G(^BRNREC(BRNRDSP,11)),U,16)]""
 ;Q:$P($G(^BRNREC(BRNRDSP,11)),U,17)]""
 ;Q:$P($G(^BRNREC(BRNRDSP,11)),U,18)]""
 ;Q:$P($G(^BRNREC(BRNRDSP,11)),U,19)]""
 ;Q:$P($G(^BRNREC(BRNRDSP,11)),U,20)]""
 ;Q:$P($G(^BRNREC(BRNRDSP,11)),U,21)]""
 ;Q:$P($G(^BRNREC(BRNRDSP,11)),U,22)]""
 ;Q:$P($G(^BRNREC(BRNRDSP,0)),U,29)]""  ; Quit if PCC Visit Entry
 D DELETE
 D EOJ
 Q
 ;
DELETE ;
 ;S BRNVFLE=90001 F BRNVL=0:0 S BRNVFLE=$O(^DIC(BRNVFLE)) Q:BRNVFLE>90264!(BRNVFLE'=+BRNVFLE)  D DELETE2
 ;S BRNREF=BRNRDLT D DEL^BRNREF K BRNREF
 ;Do not need above line to set Delete Flag but do need to Delete Disclosure
 ;
 S DA=BRNRDSP,DIK="^BRNREC(" D ^DIK K DIK
 S BRNNUM=$P($G(^BRNREC(BRNRDSP,0)),U,2)
 Q:'$D(BRNNUM)
 W !!,"Disclosure Record Deleted - "_BRNNUM
 Q
 ;
DELETE2 ;
 Q
 S BRNVNM=$P(^DIC(BRNVFLE,0),U)
 S BRNVDG=^DIC(BRNVFLE,0,"GL"),BRNVIGR=BRNVDG_"""AD"",BRNRDLT,BRNVDFN)"
 S BRNVDFN="" F BRNVI=1:1 S BRNVDFN=$O(@BRNVIGR) Q:BRNVDFN=""  W:'$D(ZTQUEUED) "." S DIK=BRNVDG,DA=BRNVDFN D ^DIK
 Q
 ;
EOJ ; EOJ CLEANUP
 K BRNVDFN,BRNVDG,BRNRDLT,BRNVFLE,BRNVI,BRNVIGR,BRNVL,BRNVNM,BRNCTR,BRNH,BRNRIO,BRNRREC,BRNRSTAT,BRNSTR
 K %,X
 K D,D0,DA,DIC,DICR,DIE,DIG,DIH,DIU,DIV,DIW,DQ,DR
 Q