source: WorldVistAEHR/trunk/r/LAB_SERVICE-LR-LS/LR7OFAA.m@ 1258

Last change on this file since 1258 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 1.3 KB
Line 
1LR7OFAA ;slc/dcm - Setup Accession for AP orders ;8/11/97
2 ;;5.2;LAB SERVICE;**121,187**;Sep 27, 1994
3 ;
4EN D DT K ZTSK S LRORDR=LRXZ
5 F LRSAMP=-1:0 S LRSAMP=$O(^TMP("OR",$J,"LROT",LRSDT,LRXZ,LRSAMP)) Q:LRSAMP="" S ORIFN=^(LRSAMP,0) D ZX
6 K ZTSK Q
7ZX ;
8 S J=0 F LRJ=1:1 S J=$O(^TMP("OR",$J,"LROT",LRSDT,LRXZ,LRSAMP,J)) Q:J<1 D
9 . S LRTSTS=+^TMP("OR",$J,"LROT",LRSDT,LRXZ,LRASMP,J),LRORIFN=^(J,0) D
10 .. Q:'$D(DUZ(2)) Q:'$D(^LAB(60,+LRTSTS,8,+DUZ(2),0)) S LRAA=$P(^(0),"^",2)
11 .. I 'LRAA D ACK^LR7OF0("DE","","Missing accession area for lab test: "_LRTSTS) Q
12 .. S LRAD=$E(LRSDT,1,3)_"0000",LRH(2)=$E(LRSDT,1,3)
13 .. S:'$D(^LRO(68,LRAA,1,0)) ^(0)="^68.01DA^^0"
14 .. 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)
15 .. S:'$D(^LRO(68,LRAA,1,LRAD,1,0)) ^(0)="^68.02PA^^"
16 .. F L +^LRO(68,LRAA,1,LRAD):360 Q:$T
17 .. S LRAN=$P(^LRO(68,LRAA,1,LRAD,1,0),"^",3) F X=0:0 S LRAN=LRAN+1 Q:'$D(^LRO(68,LRAA,1,LRAD,1,LRAN,0))
18 .. I $D(^LR(LRXREF,LRH(2),LRAN)) F X=0:0 S LRAN=LRAN+1 Q:'$D(^LR(LRXREF,LRH(2),LRAN))
19 .. S X=^LRO(68,LRAA,1,LRAD,1,0),^(0)=$P(X,"^",1,2)_"^"_LRAN_"^"_($P(X,"^",4)+1),^LRO(68,LRAA,1,LRAD,1,LRAN,0)=LRDFN
20 .. L -^LRO(68,LRAA,1,LRAD)
21 Q
22DT S DT=$$DT^XLFDT()
23 S LRNT=$P($H,",",2),LRNT=LRNT\3600*100+(LRNT\60#60)/10000+DT
24 Q
Note: See TracBrowser for help on using the repository browser.