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

LRTSTJAN.m

Go to the documentation of this file.
LRTSTJAN ;VA/SLC/RWF,DCN-JAM TESTS ONTO (OR OFF) ACCESSIONS PART2 ;8/11/97
 ;;5.2;LAB SERVICE;**1031**;NOV 1, 1997
 ;
 ;;VA LR Patch(s): 67,100,121,128,202,221,337
 ;
DELOG ;This tag is no longer available - Routine LRTSTOUT replaces this call.
 ;----- BEGIN IHS MODIFICATIONS LR*5.2*1018
 S BLROPT="REMACC"
 ;----- END IHS MODIFICATIONS
 W @IOF,!,$$CJ^XLFSTR(" The ability to DELETE an entire ORDER/ACCESSION ",80)
 W $$CJ^XLFSTR("has been REPLACED. The test(s) will now be marked",80)
 W $$CJ^XLFSTR("as Not Performed and a reason for 'NP' will be stored",80)
 W $$CJ^XLFSTR("with each test. Accession numbers can't be reused",80)
 W $$CJ^XLFSTR("after it has been assigned to a specimen.",80)
EN D ^LRPARAM G:$G(LREND) END
 I '$D(LRLABKY) W !?5,"You are not authorized to change test status.",! G END
 K LRSCNXB
EN1 ;
 N LRTOTL,LRIFN
 S (LREND,LRNOP)=0 K LRNATURE
 D FIX^LRTSTOUT G END:$G(LREND) I $G(LRNOP) D END G EN1
 W ! K DIR S DIR(0)="Y",DIR("A")="  Change Entire accession to Not Perform !! ",DIR("B")="NO" D ^DIR K DIR
 I $D(DIRUT) G EN1
 S LRTOTL=Y,LRIFN=0
 I LRTOTL>0 D
 .F  S LRIFN=$O(^LR(LRDFN,LRSS,LRIDT,LRIFN)) Q:LRIFN=""  S:$P($G(^LR(LRDFN,LRSS,LRIDT,LRIFN)),U)="pending" $P(^LR(LRDFN,LRSS,LRIDT,LRIFN),U)=""
 ;I Y=0 D CHG^LRTSTOUT W !!! G EN1
 I LRTOTL=0 D CHG^LRTSTOUT W !!! G EN1
 D FX2^LRTSTOUT I $G(LREND) D END W @IOF G EN1
 D
 . N LRTSTS
 . S LRTSTS=0,LRNOW=$$NOW^XLFDT F  S LRTSTS=+$O(^LRO(68,LRAA,1,LRAD,1,LRAN,4,LRTSTS)) Q:LRTSTS<1  I $D(^(LRTSTS,0))#2,'$P(^(0),U,5) D
 . . I $D(^LAB(60,LRTSTS,0)) S LRTNM=$P(^(0),U) D SET^LRTSTOUT
 L -^LRO(68,LRAA,1,LRAD,1,LRAN)
 I $L($G(LRSS)) L -^LR(+$G(LRDFN),LRSS,+$G(LRIDT))
 W @IOF,!!,"All accessioned test(s) changed",!!
 ;----- BEGIN IHS MODIFICATIONS LR*5.2*1018
 D:BLRLOG ^BLREVTQ("M","D",$G(BLROPT),,LRACN)
 ;----- END IHS MODIFICATIONS
 D END G EN1
 Q
END K LRWRD,LRWDT1,LRTREA,LRRB,LRPRAC,LREND,LRAA,LRAD,LRAN,LRACC,LRTEST,LRTSTN,LRNATURE,LRX,LRIDIV,LRSAMP,LRGCOM,LRCOM,LRTCOM,LRDFN,LRDPF,LRACD,LRACN,LRACN0,LRDOC,LRLL,LROD0,LROD1,LROD3,LRODT,LROOS,LROS,LROSD,LROT,LRROD,LRSN,LRTSTS,LRTT,LRWL1
 K LRF,LRI,LRJ,LRMSTATI
 K I,X,X1,X2,X3,X4,DA,DR,DIC,DFN,AGE,DOB,PNM,SSN,VAIN,VADM,VAERR,VA,VA200,SSN,SEX
 K HRCN                           ; IHS/MSC/MKK - LR*5.2*1031
 D END^LRTSTOUT
 Q
ULK ;Unlock ^LRO(68,
 I ($G(LRAA)&($G(LRAD))&($G(LRAN))) L -^LRO(68,LRAA,1,LRAD,1,LRAN)
 Q
NEWSTART ;Set new starting accession #
 N LRAA,LRAD,LRAN,LRIDIV,LRX,LRACC,LREND,LRNEW
 S LREND=0
 D ^LRWU4 Q:LRAD<1
N1 G NEWSTART:'$D(^LRO(68,LRAA,1,LRAD,1,0))
 R !,"""Next"" accession number: ",LRNEW:DTIME
 G NEWSTART:LRNEW="^"!(LRNEW="")
 K:(LRNEW<1)!(LRNEW>999999)!(LRNEW'=+LRNEW) LRNEW S:$D(LRNEW) LRNEW=LRNEW-1
 I '$D(LRNEW) W !,"Must be whole number between 1 and 999999, accession remains unchanged." G N1
 S $P(^LRO(68,LRAA,1,LRAD,1,0),U,3)=LRNEW
 G NEWSTART
US ;ck if units selected
 S A=0 F  S A=$O(^LR(LRDFN,1.8,A)) Q:A<1!($D(C))  S B=0 F  S B=$O(^LR(LRDFN,1.8,A,1,B)) Q:B<1!($D(C))  I $P(^(B,0),"^",2)=LRIDT S C=1 Q
 Q
OE ;
 I $$VER^LR7OU1<3 S ORIFN=$P(LRTS,"^",7) I ORIFN D DC^LRCENDE1
 I $L($G(LRGCOM)),$L($P($G(LRNATURE),"^",5)),$P(LRNATURE,"^",5)'["=>" S $P(LRNATURE,"^",5)=LRCM
 N I S:$G(LRTS) I(+LRTS)="" D NEW^LR7OB1(LRODT,LRSN,$S($G(LRMSTATI)=""!($G(LRMSTATI)=1):"OC",1:"SC"),$G(LRNATURE),.I,$G(LRMSTATI))
 Q
LRACC S LREND=0 D ^LRWU4 S DA(2)=LRAA,DA(1)=LRAD
 Q