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

LRAPLG.m

Go to the documentation of this file.
LRAPLG ;AVAMC/REG/WTY - AP LOG-IN ;01/23/17  03:16
 ;;5.2;LAB SERVICE;**72,201,259,462,479,490**;Sep 27, 1994;Build 2
EN ;
 ;;*
 D END
 N LREND,D0,DD S LREND=0
 ;
 N LRADD
 N LRAPLGX,DOD,FDAIEN,H8,LR6802,LRACC,LRCDT,LRCNT,LREAL,LRORDR
 N LRFDA,LRIENLOC,LRNLT,LRNT,LROT,LRPCEVSO,LRPROVL,LRSAMP
 N LRSF515,LRSPEC,LRSPTOP,LRTSORU,LRTST,LRUID,ORGMDATZ
 N ORIFN,SS,TEST,X,X11,Y,OCXSEG,LRLWC
 S LRAPLGX=1,(LRORDR,LRLWC)="WC"
 ;
 D:$G(^LAB(69.9,1,21661)) EN1^LRAPKOE
 I $G(LRAPDIAL) K LRAPDIAL D END G EN
 D ^LRAP I '$D(Y) D END Q
 ;;;*
 S LR("L")=LRSS_"^LRAP" I LRCAPA,"AUSP"[LRSS S X=$S(LRSS="SP":"H & E STAIN",1:"AUTOPSY H & E") D X^LRUWK G:'$D(X) END S LRW("H&E")=LRT K LRT
 I LRCAPA,LRSS="EM" S X="THICK SECTION EM" D X^LRUWK G:'$D(X) END S X=11 D SET S LRW("SS")=LRT_U_X S X="GRID EM" D X^LRUWK G:'$D(X) END S X=12 D SET S LRW("G")=LRT_U_X K LRT
 I LRCAPA D @(LRSS_"^LRAPSWK") G:'$D(X) END
 D:"SPEMCY"[LRSS A^LRAPWU W !!,"Log-In for ",LRH(0)," " S %=1 D YN^LRU Q:%<1  S LRAA(3)=1 D XR^LRU
 I %=2 S %DT="AE",%DT(0)="-N",%DT("A")="Enter YEAR: " D ^%DT K %DT Q:Y<1  S LRAD=$E(Y,1,3)_"0000",Y=LRAD D D^LRU S LRH(0)=Y
 S LRH(2)=$E(LRAD,1,3),LRWHN=$E(LRAD,2,3)
 S:'$D(^LRO(68,LRAA,1,0)) ^(0)="^68.01DA^^0"
 S:'$D(^LRO(68,LRAA,1,LRAD,0)) ^(0)=LRAD,^LRO(68,LRAA,1,0)=$P(^LRO(68,LRAA,1,0),"^",1,2)_"^"_LRAD_"^"_($P(^(0),"^",4)+1)
 S:'$D(^LRO(68,LRAA,1,LRAD,1,0)) ^(0)="^68.02PA^^"
 S %DT="",X="T-4" D ^%DT S LRDTI=9999999-Y
GETP W ! S LRSIT="",LRDPAF=1 K DIC
 D ^LRDPA G:LRDFN<1 END
 S:'+$G(LRPRAC) LRPRAC(1)=""
 I +$G(LRPRAC) S X=LRPRAC D D^LRUA S LRPRAC(1)=X
 I LRSS="SP" S X=0 F  S X=$O(^LR(LRDFN,LRSS,X)) Q:'X!(X>LRDTI)  D
 .S Y=^LR(LRDFN,LRSS,X,0)
 .W $C(7),!?6,"Accession number assigned for ",$$FMTE^XLFDT(Y,"D")
 .W " is: ",$P(Y,"^",6)
 ;
 I LRSS="SP" S X="SROSPLG" X ^%ZOSF("TEST") I $T D ^SROSPLG
 ;
 D ADD G GETP
ADD I LRSS="AU",'$D(LREXP) W $C(7),!!,"NO DATE DIED ENTERED IN ",LRFNAM," FILE",! Q:+LRDPF=2  S DIE=+LRDPF,DA=DFN,DR=.351 D ^DIE Q:$D(Y)  S LREXP=X
 I LRSS="AU",$D(^LR(LRDFN,"AU")),$P(^("AU"),U,6) S Y=^("AU"),X=+$P(Y,U,6),Y(1)=$E(Y,1,3)_"0000" W !,"Yr:",1700+$E(Y,1,3)," Acc#:",X," IN LAB FILE FOR ",$P(@(LRPF_DFN_",0)"),U)," SSN:",$P(^(0),U,9) D CK Q
 D:LRPF="^DPT(" ^LRAPPOW ; for AFIP studies
 D ^LRAPLG1 K LRMD,DIC,DIE,DR,LRAPDIAL Q
CK I +$G(^LRO(68,LRAA,1,Y(1),1,X,0))=LRDFN W $C(7),!!?20,"Also in accession file" Q
 W !,"Enter in Accession File " S %=2 D YN^LRU D:%=1 ^LRAPLG2 Q
SET S X=$P($G(^LRO(69.2,LRAA,0)),"^",X) S:'X X=1 Q
END D V^LRU
 ;;*
 K LRAPLGX,DOD,FDAIEN,H8,LR6802,LRACC,LRCDT,LRCNT,LREAL
 K LRFDA,LRIENLOC,LRNLT,LRNT,LROT,LRPCEVSO,LRPROVL,LRSAMP
 K LRSF515,LRSPEC,LRSPTOP,LRTSORU,LRTST,LRUID,ORGMDAT
 K ORIFN,SS,TEST,X,X11,Y
 K DA,DFN,DIC,DIE,DR,LR,LRAA,LRAD,LRAPDIAL,LRCAPA,LRDFN,LRDPAF
 K LRDPF,LRDTI,LREXP,LRFNAM,LRH,LRMD,LRPF,LRPRAC
 K LRSIT,LRSS,LRT,LRW,LRWHN
 ;;;*
 Q