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

LRVRW.m

Go to the documentation of this file.
  1. LRVRW ;DALOI/STAFF - LAB ROUTINE DATA VERIFICATION BY WORKLIST ;06/24/10 16:53
  1. ;;5.2;LAB SERVICE;**153,221,350**;Sep 27, 1994;Build 230
  1. ;
  1. ;
  1. 1 D INIT^LRVR
  1. N LRBETST,LRBEY
  1. I $G(LREND) D QUIT Q
  1. S LRTRAY=1,LRCUP=0
  1. D NEXT
  1. ;
  1. L10 ;
  1. K LRTEST,C5,LRSET,LRLDT,DIC,LRNM,LRNG,LRDEL,T,LRFP,LRAB,LRVER,Y,Z
  1. D WLN
  1. I $G(LREND) D END Q
  1. S X=^LRO(68.2,LRLL,1,LRTRAY,1,LRCUP,0),LRAA=+X,LRAD=$P(X,U,2),LRAN=$P(X,U,3)
  1. I '$D(^LRO(68,LRAA,1,LRAD,1,LRAN,0)) W " ACCESSION MISSING" G L10
  1. D FIND I '$D(LRPRGSQ) D ISEQ
  1. I $D(^LAH(LRLL,1,LRSQ,0)),$P(^(0),U,3),($P(^(0),U,5)'=LRAN) W !!,"Can't use. Entry has data from accession # ",$P(^(0),U,5),!,"Suggest you Clear instrument/worklist data." D NEXT G L10
  1. S X=^LRO(68,LRAA,1,LRAD,1,LRAN,0),LRORU3=$G(^(.3))
  1. S LRODT=$P(X,U,4),LRSN=$P(X,U,5),LRDFN=+X,LRDPF=$P(^LR(LRDFN,0),U,2),DFN=$P(^(0),U,3) D PT^LRX
  1. I $G(LREND) S LREND=0 W !?5," Error in Patient Lookup",! D NEXT G L10
  1. W !,PNM,?40,SSN
  1. D VER^LRVR1 G END:$G(LREND) D NEXT
  1. G L10
  1. ;
  1. ;
  1. YN R X:DTIME Q:X=""!(X["N")!(X["Y") W !,"Answer 'Y' or 'N': " G YN
  1. ;
  1. ;
  1. WLN ;
  1. G WLN2:LRTYPE
  1. S LRTRAY=1 W !!!,"SEQUENCE #: ",LRCUP,"//" R X3:DTIME S:X3="" X3=LRCUP S:X3[U LREND=1 Q:LREND
  1. I X3["?" W !,"ENTER A VALID SEQUENCE NUMBER" G WLN
  1. I '$D(^LRO(68.2,LRLL,1,LRTRAY,1,X3,0)) W !,"SEQUENCE NUMBER DOESN'T EXIST" G WLN
  1. S LRCUP=X3
  1. Q
  1. ;
  1. WLN2 ;
  1. W !!!,"TRAY: ",LRTRAY,"//" R X2:DTIME S:X2="" X2=LRTRAY S:X2[U LREND=1 Q:LREND
  1. W " CUP: ",LRCUP,"//" R X3:DTIME S:X3="" X3=LRCUP S:X3[U LREND=1 Q:LREND
  1. I X2_X3["?" W !,"ENTER A VALID TRAY, CUP FROM THE LOAD/WORK LIST" G WLN2
  1. I '$D(^LRO(68.2,LRLL,1,X2,1,X3,0)) W !,"TRAY, CUP DOESN'T EXIST" G WLN2
  1. S LRTRAY=X2,LRCUP=X3
  1. Q
  1. ;
  1. ;
  1. END ;
  1. I $D(LRAN),$D(LRAD) S:'$D(^LRO(68,LRAA,1,LRAD,2)) ^(2)="^^" S ^(2)=$P(^(2),U,1,3)_U_LRAN_U_$P(^(2),U,5,99),LREND=1
  1. D QUIT
  1. Q
  1. ;
  1. ;
  1. NEXT S X2=LRTRAY,X3=LRCUP
  1. NX2 S X3=$O(^LRO(68.2,LRLL,1,X2,1,X3)) I X3<1 S X3=0,X2=$O(^LRO(68.2,LRLL,1,X2)) G:X2>0 NX2
  1. I X3<1&(X2<1) W !,"LAST IN LIST" S (LRTRAY,LRCUP)=U Q
  1. S:X2>0 LRTRAY=X2 S:X3>0 LRCUP=X3
  1. Q
  1. ;
  1. ;
  1. LIST W " the following tests: " S I=0 F S I=$O(LRTST(I)) Q:I<1 W !,?10,$P(LRTST(I),"^",1)
  1. Q
  1. ;
  1. ;
  1. STOP ;
  1. S LREND=1
  1. Q
  1. ;
  1. ;
  1. ISEQ ;
  1. L +^LAH(LRLL):99
  1. S (^LAH(LRLL),LRSQ)=1+$G(^LAH(LRLL))
  1. S ^LAH(LRLL,1,LRSQ,0)=LRTRAY_U_LRCUP_U_LRAA_U_LRAD_U_LRAN_"^^MANUAL"
  1. D UID^LAGEN(LRLL,LRSQ,$P($G(^LRO(68,LRAA,1,LRAD,1,LRAN,.3)),"^"))
  1. D UPDT^LAGEN(LRLL,LRSQ)
  1. S ^LAH(LRLL,1,"B",(+LRTRAY)_";"_(+LRCUP),LRSQ)=""
  1. S ^LAH(LRLL,1,"C",LRAN,LRSQ)=""
  1. L -^LAH(LRLL)
  1. S ^LRO(68.2,LRLL,1,LRTRAY,1,LRCUP,4,LRSQ)=""
  1. Q
  1. ;
  1. ;
  1. FIND ;
  1. K LRPRGSQ
  1. S N=0,LRTRCP=LRTRAY_";"_LRCUP,I=0
  1. F S I=$O(^LAH(LRLL,1,"B",LRTRCP,I)) Q:I="" S N=N+1,LRSQ=I,LRPRGSQ(I)="" W !,?5,I
  1. S I=0
  1. F S I=$O(^LRO(68.2,LRLL,1,LRTRAY,1,LRCUP,4,I)) Q:I="" I $D(^LAH(LRLL,1,I,0)),'$D(LRPRGSQ(I)) S N=N+1,LRSQ=I,LRPRGSQ(I)=""
  1. T3 S X=N I N=0 W !,"No data for that tray & cup" Q
  1. I N>1 R !,"Choose sequence number: ",X:DTIME Q:'$T I X["?"!(X'?.N) W !,"Enter a number" G T3
  1. I X["^"!(X="") K LRPRGSQ Q
  1. S:N'=1 LRSQ=X I '$D(^LAH(LRLL,1,LRSQ,0)) K LRPRGSQ(LRSQ) W !,"No data there"
  1. Q
  1. ;
  1. ;
  1. QUIT ;
  1. I $D(LRCSQ),'$O(^XTMP("LRCAP",LRCSQ,DUZ,0)) K ^XTMP("LRCAP",LRCSQ,DUZ)
  1. E I $D(LRAA) D:$P(LRPARAM,U,14)&($P($G(^LRO(68,+LRAA,0)),U,16)) STD^LRCAPV
  1. K LRORU3
  1. D ^LRGVK,^LRCAPV2
  1. Q