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

AZXARDLT.m

Go to the documentation of this file.
AZXARDLT ; IHS/PHXAO/TMJ - REFERRAL DELETE ;
 ;;2.0;RELEASE OF INFORMATION;;FEB 21, 2002
 ;
 S U="^"
 Q:'$D(AZXARDLT)
 Q:'AZXARDLT
 Q:'$D(^AZXAREC(AZXARDLT,0))
 ;
 ;Quit Deletion -reason to quit, ie CHS, ETC.
 ;Q:$D(^AZXAREC(AZXARDSP,41,0))  ;  Quit if CHS Authorization Multiple
 ;Q:$P($G(^AZXAREC(AZXARDSP,11)),U,12)]""  ; Quit if CHS Flds 1112 TO 1122
 ;Q:$P($G(^AZXAREC(AZXARDSP,11)),U,13)]""
 ;Q:$P($G(^AZXAREC(AZXARDSP,11)),U,14)]""
 ;Q:$P($G(^AZXAREC(AZXARDSP,11)),U,15)]""
 ;Q:$P($G(^AZXAREC(AZXARDSP,11)),U,16)]""
 ;Q:$P($G(^AZXAREC(AZXARDSP,11)),U,17)]""
 ;Q:$P($G(^AZXAREC(AZXARDSP,11)),U,18)]""
 ;Q:$P($G(^AZXAREC(AZXARDSP,11)),U,19)]""
 ;Q:$P($G(^AZXAREC(AZXARDSP,11)),U,20)]""
 ;Q:$P($G(^AZXAREC(AZXARDSP,11)),U,21)]""
 ;Q:$P($G(^AZXAREC(AZXARDSP,11)),U,22)]""
 ;Q:$P($G(^AZXAREC(AZXARDSP,0)),U,29)]""  ; Quit if PCC Visit Entry
 D DELETE
 D EOJ
 Q
 ;
DELETE ;
 ;S AZXAVFLE=90001 F AZXAVL=0:0 S AZXAVFLE=$O(^DIC(AZXAVFLE)) Q:AZXAVFLE>1991075!(AZXAVFLE'=+AZXAVFLE)  D DELETE2
 ;S AZXAREF=AZXARDLT D DEL^AZXAREF K AZXAREF
 ;Do not need above line to set Delete Flag but do need to Delete Referral
 ;
 S DA=AZXARDSP,DIK="^AZXAREC(" D ^DIK K DIK
 S AZXANUM=$P($G(^AZXAREC(AZXARDSP,0)),U,2)
 Q:'$D(AZXANUM)
 W !!,"Disclosure Record Deleted - "_AZXANUM
 Q
 ;
DELETE2 ;
 Q
 S AZXAVNM=$P(^DIC(AZXAVFLE,0),U)
 S AZXAVDG=^DIC(AZXAVFLE,0,"GL"),AZXAVIGR=AZXAVDG_"""AD"",AZXARDLT,AZXAVDFN)"
 S AZXAVDFN="" F AZXAVI=1:1 S AZXAVDFN=$O(@AZXAVIGR) Q:AZXAVDFN=""  W:'$D(ZTQUEUED) "." S DIK=AZXAVDG,DA=AZXAVDFN D ^DIK
 Q
 ;
EOJ ; EOJ CLEANUP
 K AZXAVDFN,AZXAVDG,AZXARDLT,AZXAVFLE,AZXAVI,AZXAVIGR,AZXAVL,AZXAVNM,AZXACTR,AZXAH,AZXARIO,AZXARREC,AZXARSTAT,AZXASTR
 K %,X
 K D,D0,DA,DIC,DICR,DIE,DIG,DIH,DIU,DIV,DIW,DQ,DR
 Q