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

RABTCH3.m

Go to the documentation of this file.
  1. RABTCH3 ;HISC/GJC-Delete Batch Reports ;8/2/94 10:08
  1. ;;5.0;Radiology/Nuclear Medicine;;Mar 16, 1998
  1. ; The user accessing this option will only be able to delete
  1. ; Report Batches he/she has created through the RA BTCHNEW option.
  1. ; For the option: RA BTCHDEL
  1. ;
  1. ; ***** Variable List *****
  1. ; ^TMP($J,"RA BTCHDEL",xternal fmat of .01,ien of record)=""
  1. ;
  1. DEL ; Does this user have data to delete?
  1. Q:'$D(^RABTCH(74.2,"C",DUZ))
  1. N A,B,C,I,RADIC,RAHEAD,RALINE,RAOUT,RAPAGE,RATDAY
  1. S (RAOUT,RAPAGE)=0,Y=DT X ^DD("DD") S RATDAY=Y
  1. K ^TMP($J,"RA BTCHDEL"),^TMP($J,"RA BTCHDEL SEL")
  1. S RADIC="^RABTCH(74.2,",RADIC(0)="QEAMZ",RAUTIL="RA BTCHDEL"
  1. S RADIC("A")="Select Batch Name: ",RADIC("S")="I +$P(^(0),U,3)=DUZ"
  1. S RADIC("W")="D DICW^RABTCH3"
  1. D EN1^RASELCT(.RADIC,RAUTIL)
  1. I $G(RAQUIT)!('$D(^TMP($J,"RA BTCHDEL"))) D KILL Q
  1. S $P(RALINE,"*",(IOM+1))=""
  1. S RAHEAD="<<< Report Batches To Be Deleted >>>"
  1. D HDR
  1. S A="" F S A=$O(^TMP($J,"RA BTCHDEL",A)) Q:A']"" D
  1. . S Y=0 F S Y=$O(^TMP($J,"RA BTCHDEL",A,Y)) Q:Y'>0 D
  1. .. S C=+$G(C)+1
  1. .. W !,C_"]",?5,A D DICW
  1. .. Q
  1. . I $Y>(IOSL-4) D
  1. .. S RAOUT=$$EOS^RAUTL5()
  1. .. D:'RAOUT HDR
  1. .. Q
  1. . Q
  1. W ! K DIR S DIR(0)="YA"
  1. S DIR("A")="Do you wish to delete all the above Report Batches? "
  1. S DIR("?",1)="Enter 'Y' to delete all the above report batches or 'N' to"
  1. S DIR("?")="bypass the deletion of the report batches." D ^DIR K DIR
  1. I '+Y D KILL Q
  1. W !!?5,"Beginning the interactive deletion process."
  1. W !?5,"<Deleting>"
  1. K DA,DIK S A="",DIK="^RABTCH(74.2,"
  1. F S A=$O(^TMP($J,"RA BTCHDEL",A)) Q:A']"" D
  1. . S B=0 F S B=$O(^TMP($J,"RA BTCHDEL",A,B)) Q:B'>0 D
  1. .. S DA=B W:DA>0 "." D:DA>0 ^DIK
  1. .. Q
  1. . Q
  1. W !?5,"Deletion process has successfully completed."
  1. KILL ; Kill and quit
  1. K %,DA,DDH,DIC,DIK,DIR,DIROUT,DIRUT,DTOUT,DUOUT,RAQUIT,RAUTIL,X,Y,POP
  1. Q
  1. DICW ; Display data
  1. N RAY S RAY=+Y
  1. N RA,RABTCHC,RABTCHP,Y
  1. S RA=$G(^RABTCH(74.2,RAY,0))
  1. S RABTCHC=$P(RA,U,2),RABTCHP=$P(RA,U,4)
  1. S Y=RABTCHC X:Y]"" ^DD("DD") S RABTCHC=Y
  1. S Y=RABTCHP X:Y]"" ^DD("DD") S RABTCHP=Y
  1. W ?40,"<Batch Created>: ",RABTCHC,!?40,"<Batch Printed>: ",RABTCHP
  1. Q
  1. HDR ; Header
  1. S RAPAGE=RAPAGE+1
  1. W @IOF,!?$S(IOM=132:104,1:63),"Date: ",RATDAY
  1. W !?$S(IOM=132:104,1:63),"Page: ",RAPAGE
  1. W !?(IOM-$L(RAHEAD)\2),RAHEAD,!,RALINE
  1. Q