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

LRAPLG1.m

Go to the documentation of this file.
  1. LRAPLG1 ;AVAMC/REG/WTY/KLL - LOG-IN CONT. ;07/30/04
  1. ;;5.2;LAB SERVICE;**1002,1003,1018,1031**;NOV 1, 1997
  1. ;
  1. ;;VA LR Patche(s): 72,121,248,308
  1. ;
  1. ;Reference to ^%ZOSF("TEST" supported by IA #10096
  1. ;Reference to ^VA(200 supported by IA #10060
  1. ;Reference to ^%DT supported by IA #10003
  1. ;Reference to EN^DDIOL supported by IA #10142
  1. ;Reference to ^DIE supported by IA #10018
  1. ;Reference to DISP^SROSPLG supported by IA #893
  1. ;
  1. L +^LRO(68,LRAA,1,LRAD):5 I '$T D Q
  1. .S MSG="Someone else is logging in specimens. "
  1. .S MSG=MSG_"Please wait and try again."
  1. .D EN^DDIOL(MSG,"","!!") K MSG
  1. S LRAN=$P(^LRO(68,LRAA,1,LRAD,1,0),"^",3)
  1. F X=0:0 S LRAN=LRAN+1 Q:'$D(^LRO(68,LRAA,1,LRAD,1,LRAN,0))
  1. I $D(^LR(LRXREF,LRH(2),LRABV,LRAN)) F X=0:0 S LRAN=LRAN+1 Q:'$D(^LR(LRXREF,LRH(2),LRABV,LRAN))
  1. W !!,"Assign ",LRO(68)," (",LRABV,") accession #: ",LRAN," " S %=1 D YN^LRU
  1. I %<1 L -^LRO(68,LRAA,1,LRAD) G OUT
  1. I %=2 D OS G:'$D(LRFND) AU K LRFND L -^LRO(68,LRAA,1,LRAD) G OUT
  1. S X=^LRO(68,LRAA,1,LRAD,1,0),X(2)=$P(X,"^",4)+1
  1. S ^LRO(68,LRAA,1,LRAD,1,0)=$P(X,"^",1,2)_"^"_LRAN_"^"_X(2)
  1. S ^LRO(68,LRAA,1,LRAD,1,LRAN,0)=LRDFN,X=LRAN
  1. L -^LRO(68,LRAA,1,LRAD)
  1. AU S LRAN=X,LRAC=LRABV_" "_$E(LRAD,2,3)_" "_LRAN I LRSS="AU" D ^LRAUAW Q
  1. S DA(1)=LRDFN S:'$D(^LR(LRDFN,LRSS,0)) ^(0)="^"_LRSF_"DA^0^0"
  1. DT W !,"Date/time Specimen taken: "
  1. W $S($E(LRAD,1,3)=$E(DT,1,3):"NOW// ",1:"")
  1. R X:DTIME G:X[U!('$T) END
  1. ; S:X=""&($E(LRAD,1,3)=$E(DT,1,3)) X="N"
  1. ; S %DT="ETX",%DT(0)="-N" D ^%DT K %DT
  1. ; G:X["?" DT G:Y=-1 END
  1. ;----- BEGIN IHS MODIFICATIONS LR*5.2*1018
  1. S:X=""&($E(LRAD,1,3)=$E(DT,1,3)) X="T" S %DT="ETX",%DT(0)="-NOW" D ^%DT K %DT G:X["?" DT G:Y=-1 END ;IHS/ANMC/CLS
  1. ;----- END IHS MODIFICATIONS
  1. S LRSD=Y,LRI=9999999-Y
  1. L +^LR(LRDFN,LRSS):5 I '$T D Q
  1. .S MSG="This record is locked by another user. "
  1. .S MSG=MSG_"Please wait and try again."
  1. .D EN^DDIOL(MSG,"","!!"),X K MSG
  1. F I $D(^LR(LRDFN,LRSS,LRI,0)) S LRI=LRI-.00001 G F
  1. S ^LR(LRDFN,LRSS,LRI,0)=LRSD
  1. S X=^LR(LRDFN,LRSS,0),^(0)=$P(X,"^",1,2)_"^"_LRI_"^"_($P(X,"^",4)+1)
  1. L -^LR(LRDFN,LRSS)
  1. S LR(.07)=$S($D(SRDOC):SRDOC,1:"") K SRDOC
  1. S:LR(.07) LR(.07)=$P($G(^VA(200,LR(.07),0)),"^")
  1. S DIC(0)="EQLMF",DLAYGO=63,DA=LRI,DIE="^LR(LRDFN,LRSS,"
  1. D @LR("L"),^DIE K DLAYGO
  1. I $D(Y)!($D(DTOUT)) D Q
  1. .W $C(7),!!,"All Prompts not answered <ENTRY DELETED>"
  1. .K ^LR(LRDFN,LRSS,DA)
  1. .S X=^LR(LRDFN,LRSS,0),X(1)=$O(^(0))
  1. .S ^LR(LRDFN,LRSS,0)=$P(X,"^",1,2)_"^"_X(1)_"^"_($P(X,"^",4)-1)
  1. .D X
  1. I LRSS="CY",LRCAPA D CK^LRAPCWK
  1. I LRSS="SP" S X="SROSPLG" X ^%ZOSF("TEST") I $T D DISP^SROSPLG
  1. D ^LRUWLF D:LRSS="CY"&LRCAPA ^LRAPCWK D:"SPEM"[LRSS&LRCAPA ^LRAPSWK D:"SPCYEM"[LRSS ^LRSPGD
  1. D OERR^LR7OB63D
  1. Q
  1. X ;from LRAUAW
  1. K:"CYEMSP"[LRSS ^LR(LRXREF,LRH(2),LRABV,LRAN)
  1. I LRSS="AU",$D(LRRC) D
  1. .K ^LR("AAUA",+$E(LRRC,1,3),LRABV,LRAN),^LR("AAU",+LRRC,LRDFN)
  1. I $D(LRRC),LRRC>1 K:"CYEMSP"[LRSS ^LR(LRXR,LRRC,LRDFN,LRI)
  1. K LRRC
  1. END ;from LRAUAW, LRAPLG2
  1. L +^LRO(68,LRAA,1,LRAD):5 I '$T D Q
  1. .S MSG="Someone else is logging in specimens. "
  1. .S MSG=MSG_"Please wait and try again."
  1. .D EN^DDIOL(MSG,"","!!") K MSG
  1. K ^LRO(68,LRAA,1,LRAD,1,LRAN),^LRO(68,LRAA,1,"AC",DUZ(2),LRAD,LRAN)
  1. S X=^LRO(68,LRAA,1,LRAD,1,0),X(1)=$O(^(0)),X(2)=$P(X,"^",4)-1
  1. S ^LRO(68,LRAA,1,LRAD,1,0)=$P(X,"^",1,2)_"^"_X(1)_"^"_X(2)
  1. L -^LRO(68,LRAA,1,LRAD)
  1. Q
  1. OS R !!,"Enter Accession # : ",X:DTIME I X=""!(X[U) S LRFND=1 Q
  1. I X'?1N.N!(X<1)!(X>99999) W $C(7),!!,"ENTER A WHOLE NUMBER FROM 1 TO 99999",! G OS
  1. I $D(^LRO(68,LRAA,1,LRAD,1,X,0)),$P(^(0),U) D ^LRUTELL G OS
  1. S ^LRO(68,LRAA,1,LRAD,1,X,0)=LRDFN I $D(LRXREF),$D(^LR(LRXREF,LRH(2),LRABV,X)) D ^LRAPLG2 S LRFND=1
  1. Q
  1. OUT Q