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

LR7OFAO.m

Go to the documentation of this file.
  1. LR7OFAO ; IHS/DIR/AAB - Setup file 69 for AP orders ; [ 8/11/97 ]
  1. ;;5.2;LR;**1003**;JUN 01, 1998
  1. ;
  1. ;;5.2;LAB SERVICE;**121**;Sep 27, 1994
  1. EN(LRODT,LRDFN,LRSAMP,LRORDR,LRNT,LRPRAC,LRLLOC,LRSDT,ORIFN,LRSPEC,LRSS) ;Start here
  1. ;LRODT=Order date
  1. ;LRDFN=Patient Lab ID
  1. ;LRSAMP=Sample ptr to 62
  1. ;LRORDR=Collection type
  1. ;LRNT=d/t Ordered
  1. ;LRSDT=Start date
  1. ;ORIFN=OE/RR #
  1. ;LRSPEC=Specimen ptr to 61
  1. ;LRSS=Test subscript
  1. N X,LRSN,LRSUM
  1. S ZTQUEUED=1 D ORDER^LROW2 K ZTSK,ZTQUEUED,ZTREQ
  1. S:'$D(^LRO(69,LRODT,0)) ^(0)=$P(^LRO(69,0),"^",1,2)_"^"_LRODT_"^"_(1+$P(^(0),"^",4)),^LRO(69,LRODT,0)=LRODT,^LRO(69,"B",LRODT,LRODT)=""
  1. LOCK L +^LRO(69,LRODT,1):360 G:'$T LOCK
  1. S LRSN=1+$S($D(^LRO(69,LRODT,1,0)):$P(^(0),"^",3),1:0),LRSUM=1+$S($D(^LRO(69,LRODT,1,0)):$P(^(0),"^",4),1:0)
  1. ZSN IF $D(^LRO(69,LRODT,1,LRSN,0)) S LRSN=LRSN+1 G ZSN
  1. S ^LRO(69,LRODT,1,LRSN,0)=LRDFN_"^"_DUZ_"^"_LRSAMP_"^"_LRORDR_"^"_LRNT_"^"_LRPRAC_"^"_LRLLOC_"^"_LRSDT_"^"_LRLLOC_"^^"_ORIFN,^(2,0)="^69.03PA^",^LRO(69,LRODT,1,0)="^69.01PA^"_LRSN_"^"_LRSUM
  1. L -^LRO(69,LRODT,1)
  1. S ^LRO(69,LRODT,1,"AA",LRDFN,LRSN)="",^LRO(69,"D",LRDFN,LRODT,LRSN)="" S:$L(LRLLOC) ^LRO(69,LRODT,1,"AC",LRLLOC,LRSN)=""
  1. S ^LRO(69,LRODT,1,LRSN,.1)=LRORD,^LRO(69,"C",+LRORD,LRODT,LRSN)=""
  1. S $P(^LRO(68,LRAA,1,LRAD,1,LRAN,0),"^",4,5)=LRODT_"^"_LRSN,^(.1)=LRORD,^LRO(68,LRAA,1,LRAD,1,"D",LRORD,LRAN)=""
  1. I $L(LRSPEC) S ^LRO(69,LRODT,1,LRSN,4,0)="^69.02PA^1^1",^(1,0)=LRSPEC
  1. I LRSS="SP" S X=$O(^LAB(60,"B","SURGICAL PATHOLOGY",0)) I X D TST
  1. I LRSS="EM" S X=$O(^LAB(60,"B","ELECTRON MICROSCOPY",0)) I X D TST
  1. I LRSS="CY" S X=$O(^LAB(60,"B","CYTOPATHOLOGY",0)) I X D TST
  1. I LRSS="AU" S X=$O(^LAB(60,"B","AUTOPSY",0)) I X D TST
  1. Q
  1. TST ;Set test in file 69
  1. S ^LRO(69,LRODT,1,LRSN,2,0)="^69.03PA^1^1",^(1,0)=X_"^^"_LRAD_"^"_LRAA_"^"_LRAN,^LRO(69,LRODT,1,LRSN,2,"B",X,1)="" S:LRSPEC ^LRO(69,"AT",LRDFN,X,LRSPEC,LRODT)="",^(-LRODT)=""
  1. S ^LRO(68,LRAA,1,LRAD,1,LRAN,4,0)="^68.04PA^"_X_"^1",^(X,0)=X,^LRO(68,LRAA,1,LRAD,1,LRAN,4,"B",X,X)=""
  1. Q