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

LRSPT.m

Go to the documentation of this file.
  1. LRSPT ;AVAMC/REG/WTY - AP PRELIMINARY REPORTS ;10/16/01
  1. ;;5.2;LAB SERVICE;**1,72,248,259,373**;Sep 27, 1994;Build 1
  1. ;
  1. ;Reference to ^%DT supported by IA #10003
  1. ;Reference to ^DPT supported by IA #918
  1. ;Reference to ^DIWP suppported by IA #10011
  1. ;Reference to ^DIWW suppported by IA #10029
  1. ;Reference to EN^DDIOL supported by IA #10142
  1. ;
  1. S X="T",%DT="" D ^%DT,D^LRU S LRTOD=Y D EN2^LRUA
  1. W !!,"Preliminary reports for ",LRO(68)
  1. G END:LRAPX=2,SGL:LRAPX=3,CH:LRAPX=4
  1. GETP D EN1^LRUPS Q:LRAN=-1
  1. G:$D(^LRO(69.2,LRAA,1,LRAN,0)) GETP
  1. L +^LRO(69.2,LRAA,1):5 I '$T D G GETP
  1. .S MSG(1)="The preliminary reports queue is in use by another person. "
  1. .S MSG(1,"F")="!!"
  1. .S MSG(2)="You will need to add this accession to the queue later."
  1. .D EN^DDIOL(.MSG) K MSG
  1. S ^LRO(69.2,LRAA,1,LRAN,0)=LRDFN_"^"_LRI
  1. S X=^LRO(69.2,LRAA,1,0),^(0)=$P(X,"^",1,2)_"^"_LRAN_"^"_($P(X,"^",4)+1)
  1. L -^LRO(69.2,LRAA,1)
  1. G GETP
  1. CH S LRAPX(1)=1 D EN^LRSPRPT2 Q:%<1
  1. W !!,"Save preliminary reports for reprinting "
  1. S %=2 D YN^LRU S:%=1 LRSAV=1
  1. ;Variable LR("DVD") is used to divide reports displayed in the browser
  1. K LR("DVD")
  1. S $P(LR("DVD"),"|",IOM)=""
  1. DEV ;
  1. W !
  1. S %ZIS="Q" D ^%ZIS
  1. I POP W ! Q
  1. I $D(IO("Q")) D Q
  1. .S ZTDESC="ANAT PATH PRELIM REPORT"
  1. .S ZTSAVE("LR*")="",ZTRTN="QUE^LRSPT"
  1. .D ^%ZTLOAD W:$D(ZTSK) !,"Request Queued, #",ZTSK W !
  1. .K ZTSK,IO("Q") D HOME^%ZIS
  1. QUE ;
  1. U IO
  1. ;LRSF515=1 means this is generating and SF515.
  1. S:'$D(LRSF515) LRSF515=0
  1. D L^LRU,L1^LRU,S^LRU,SET^LRUA
  1. S LR("SPSM")=1 ;Set flag to suppress printing of SNOMED codes
  1. S LRS(5)=1,LRQ(2)=1,LRA=$S($D(^LRO(69.2,LRAA,0)):$P(^(0),U,9),1:1)
  1. S:LRA="" LRA=1
  1. S LR("DIWF")=$S($P(^LRO(69.2,LRAA,0),"^",6)="D":"D",1:"")_"W"
  1. I $D(LRAP) S LRDFN=$P(LRAP,"^"),LRI=$P(LRAP,"^",2) D D G K
  1. S LRAN=0 F S LRAN=$O(^LRO(69.2,LRAA,1,LRAN)) Q:'LRAN!(LR("Q")) D
  1. .S X=^LRO(69.2,LRAA,1,LRAN,0),LRDFN=+X,LRI=$P(X,"^",2) D D
  1. .W:IOST["BROWSER" !!,LR("DVD")
  1. K K:'$D(LRSAV) ^LRO(69.2,LRAA,1) K P,S,LRAN
  1. S ^LRO(69.2,LRAA,1,0)="^69.21A^^"
  1. I 'LR("Q"),$D(LR("F")),IOST?1"C".E D CONT
  1. K LRSAV
  1. W:IOST?1"P-".E @IOF D ^%ZISC S:$D(ZTQUEUED) ZTREQ="@"
  1. K %,DIR,DTOUT,DUOUT,DIRUT,X,Y
  1. Q
  1. D K ^UTILITY($J) I '$D(^LR(LRDFN,0)) K ^LRO(69.2,LRAA,1,LRAN) Q
  1. N LRPRE S LRPRE=1 ;Notifies EN^LRSPRPT that this is a prelim report
  1. D EN^LRSPRPT Q:LR("Q")
  1. I $P($G(^LR(LRDFN,0)),"^",2)=2 D Q:LR("Q")
  1. .D ^LRAPPOW
  1. G:'$D(^LR(LRDFN,"SP",0))&('$D(^LR(LRDFN,"CY",0)))&('$D(^LR(LRDFN,"EM",0))) AU
  1. D ^LRAPT1 Q:LR("Q")
  1. AU I $D(^LR(LRDFN,"AU")),$L($P(^LR(LRDFN,"AU"),"^")) D ^LRAPT2 Q:LR("Q")
  1. K ^UTILITY($J) S DIWR=IOM-5,DIWF="W",LR("A")=0
  1. W ! F LRZ=0:1 S LR("A")=$O(^LRO(69.2,LRAA,10,LR("A"))) Q:'LR("A") D
  1. .D:$Y>(IOSL-13) F^LRAPF,H S X=^LRO(69.2,LRAA,10,LR("A"),0) D ^DIWP
  1. D:LRZ ^DIWW
  1. S LRO=1 D F^LRAPF
  1. Q
  1. H ;from LRAPPF1
  1. D F^LRU W !,"ANATOMIC PATHOLOGY",!,LR("%") Q
  1. END W $C(7),!!,"OK TO DELETE THE ",LRO(68)," PRELIMINARY REPORT LIST" S %=2 D YN^LRU I %=1 K ^LRO(69.2,LRAA,1) S ^LRO(69.2,LRAA,1,0)="^69.21A^0^0" W $C(7),!,"LIST DELETED !" Q
  1. W !!,"FINE, LET'S FORGET IT",! Q
  1. ;
  1. SGL D EN1^LRUPS Q:LRAN=-1 S LRAP=LRDFN_"^"_LRI,LRSAV=1 D EN2^LRUA G DEV
  1. CONT ;
  1. K DIR S DIR(0)="E"
  1. D ^DIR W !
  1. S:$D(DTOUT)!(X[U) LR("Q")=1
  1. Q