source: FOIAVistA/trunk/r/LAB_SERVICE-LR-LS/LRWLST.m@ 1717

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

initial load of FOIAVistA 6/30/08 version

File size: 5.1 KB
Line 
1LRWLST ;FHS/DALOI - ACCESSION SETUP. LROE1,LRSTIK & LRFAST CALL HERE ; Aug 9, 2004
2 ;;5.2;LAB SERVICE;**46,65,100,121,153,202,290**;Sep 27, 1994
3 N LRPWL,LRPWDT,LRPWLE
4 D DT^LRX
5 Q:$G(LRKIL)
6 D:$D(XRTL) T0^%ZOSV ; START RESPONSE TIME LOGGING
7 S LRCDT=+^LRO(69,LRODT,1,LRSN,1),LREAL=$P(^(1),U,2),X=^(0),LRLLOC=$P(X,U,7),LROLLOC=$P(X,U,9),LRORIFN=$P(X,"^",11)
8 D LRAA,^LRWLST1
9 S LRCDT=(+LRCDT)_"^"_LREAL
10 I '$L($P($G(^LRO(69,LRODT,1,LRSN,1)),"^",7)) S CONTROL=$S($L(LRORIFN):"SC",1:"SN") D NEW^LR7OB1(LRODT,LRSN,CONTROL,,,6)
11 K LRTSTS,^TMP("LR",$J,"TMP"),LRNM,DIC,I,LRORIFN,LRBACK
12 I $D(XRT0) S XRTN=$T(+0) D T1^%ZOSV ; STOP RESPONSE TIME LOGGING
13 Q
14 ;
15LRAA ;
16 K LRTSTS,^TMP("LR",$J,"TMP")
17 S LRTSTS=0,LRIX=0,S5=0,LRTN=0
18 F S LRTN=$O(^LRO(69,LRODT,1,LRSN,2,LRTN)) Q:LRTN<1 D
19 . N LRX
20 . S LRX=^(LRTN,0) I '$P(LRX,U,3),'$P(LRX,U,6),'$P(LRX,U,8),'$P(LRX,U,11) S LRORIFN=$P(LRX,"^",7),LRBACK=$P(LRX,"^",14) D SET
21WL1 ;
22 ; LRDAA is used by POC interface to specify the POC accession area.
23 S LRIX=0
24 F S LRIX=$O(^TMP("LR",$J,"TMP",LRIX)) Q:LRIX<1 D
25 . S X=^(LRIX),LRTSTS=+X,LRURG=$P(X,"^",2),LRORIFN=$P(X,"^",4),LRBACK=$P(X,"^",5)
26 . S LRST=^LAB(60,LRTSTS,0)
27 . S LRAA=$S($G(LRDAA)>0:LRDAA,$D(^LAB(60,LRTSTS,8,$S($G(LRDUZ(2))>0:LRDUZ(2),1:DUZ(2)),0)):$P(^(0),U,2),1:"")
28 . S LRNM=$P(LRST,U),LRUNQ=+$P(LRST,U,7)
29 . D WL2
30 Q
31 ;
32WL2 ;
33 D FWL:$G(LRAA)="" Q:LRAA=""
34 S LRWL0=^LRO(68,LRAA,0),LRSS=$P(LRWL0,U,2),LRIDIV=$S($L($P(LRWL0,U,19)):$P(LRWL0,U,19),1:"CP")
35 I '$D(LRPHSET),$D(LRNCWL) W !,LRNM," TO ",$P(^LRO(68,LRAA,0),U)," accessions","? Y//" D YN Q:X="^" IF X["N" S LRAA="" G WL2
36 ;added following line to support unique ID/DALISC/JRR
37 I $P($G(^LRO(68,LRAA,.4)),U)="" D S LRAA="" Q
38 . W:'$D(LRPHSET) !!?5,"You must enter a 'Numeric Identifier' in field .4 of the Accession file!!",!?10,"Accession Area ",$P($G(^LRO(68,+$G(LRAA),0)),U),!
39 . D UNDO
40 S LRPWL=$P($G(^LRO(68,LRAA,0)),U,4)
41 I LRPWL,$P($G(^LRO(68,LRPWL,.4)),U)="" D S LRAA="" Q
42 . I $G(LRQUIET) D UNDO Q
43 . W:'$D(LRPHSET) !!?5,"You must enter a 'Numeric Identifier' in field .4 of the Accession file!!"
44 . W !?10,"COMMON Accession Area ",$P($G(^LRO(68,+$G(LRPWL),0)),U),!
45 . D UNDO
46 ;
47 S LRWLC=$P(LRWL0,U,4)
48 S:'LRWLC LRWLC=LRAA
49 S LRTSTS(LRWLC,LRUNQ,LRAA)=LRSS_U_$P(LRWL0,U,12),LRTSTS(LRWLC,LRUNQ,LRAA,LRIX)=^TMP("LR",$J,"TMP",LRIX)
50 Q
51SET ;
52 I $G(LRORDRR)="R" S LRTEST(LRTN)=$G(^LRO(69,LRODT,1,LRSN,2,LRTN,0))
53 S S5=S5+1,I5=$G(^LRO(69,LRODT,1,LRSN,2,LRTN,0))
54 I I5 S ^TMP("LR",$J,"TMP",S5)=$P(I5,U)_U_$P(I5,U,2)_U_LRTN_U_LRORIFN_U_LRBACK_U_$S($G(LRTSP):LRTSP,1:$P(I5,U)),I5=LRTN
55 Q
56FWL ;
57 I $O(^LAB(60,LRTSTS,2,0))>0 D EXP S $P(^LRO(69,LRODT,1,LRSN,2,$P(^TMP("LR",$J,"TMP",LRIX),U,3),0),U,8)=1 Q
58 I '$D(LRNCWL),$D(LRPHSET),LRPHSET W !,"NO ACCESSION AREA FOR ORDER NUMBER ",^LRO(69,LRODT,1,LRSN,.1)," TEST ",$P(^LAB(60,LRTSTS,0),U),! D UNDO Q
59 I '$D(LRNCWL) W !,LRNM," does not have an appropriate accession area.",!,"ORDER # ",LRORD," IS NOT ACCESSIONED",! S LRAA="" D UNDO Q
60 W !,"For test: ",LRNM
61 K DIC
62 S DIC("S")="I '$L($P(^(0),U,17))",DIC="^LRO(68,",DIC(0)="AEFOQZ"
63 D ^DIC
64 K DIC
65 I $D(DUOUT) S LRAA="" Q
66 G:Y<1 FWL
67 S LRAA=+Y
68 Q
69EXP ;
70 S I=0
71 F S I=$O(^LAB(60,LRTSTS,2,I)) Q:I<1 S J=+^(I,0) I $D(^LAB(60,J,8,DUZ(2),0)) S S5=S5+1,I5=I5+1,^TMP("LR",$J,"TMP",S5)=J_"^"_LRURG_"^"_I5_"^"_LRORIFN_"^"_LRBACK_"^"_$S($G(LRTSP):LRTSP,1:LRTSTS)
72 Q
73PRESET ;
74 I '($D(^LRO(68,LRAA,1,LRAD,1,LRAN,0))#2) K ^LRO(68,LRAA,1,LRAD,1,LRAN) Q
75 S LROLRDFN=+^LRO(68,LRAA,1,LRAD,1,LRAN,0)
76 I $L($P(^LRO(68,LRAA,1,LRAD,1,LRAN,0),U,5)) S LRDPF=$P(^LR(LROLRDFN,0),U,2),DFN=$P(^(0),U,3) D PT^LRX W !,PNM," ",SSN," has that log #." S LREND=1 Q ;W !," OK to change it? N//" D YN I X=""!(X'["Y") S LREND=1 Q
77 S LRIDT=9999999-^LRO(68,LRAA,1,LRAD,1,LRAN,3)
78 Q:'$D(^LR(LROLRDFN,LRSS,LRIDT,0))
79PR2 ;
80 S LRNIDT=9999999-LRCDT
81 F Q:'$D(^LR(LRDFN,LRSS,LRNIDT,0)) D
82 . S LRCDT=$$FMADD^XLFDT(LRCDT,,,,1)
83 . S LRNIDT=9999999-LRCDT
84 I $P(^LR(LROLRDFN,LRSS,LRIDT,0),U,3) S LREND=1 W !,$C(7),"CAN'T DO IT. The data has been verified for that log number." Q
85 S ^LR(LRDFN,LRSS,LRNIDT,0)=LRCDT_U_LREAL_U_$P(^LR(LROLRDFN,LRSS,LRIDT,0),U,3,4)_U_U_$P(^(0),U,6,99)
86 S J=0 F S J=$O(^LR(LROLRDFN,LRSS,LRIDT,J)) Q:J<1 S ^LR(LRDFN,LRSS,LRNIDT,J)=^LR(LROLRDFN,LRSS,LRIDT,J)
87 S X=^LRO(68,LRAA,1,LRAD,1,LRAN,0),LROSN=$P(X,U,5),LROID=$P(X,U,6),LROCN=$S($D(^(.1)):$P(^(.1),U),1:"")
88 K:$L(LROID) ^LRO(68,LRAA,1,LRAD,1,"C",LROID,LRAN)
89 K:$L(LROCN) ^LRO(68,LRAA,1,LRAD,1,"D",LROCN,LRAN)
90 K ^LRO(68,LRAA,1,LRAD,1,LRAN),^LR(LROLRDFN,LRSS,LRIDT)
91 Q
92YN ;
93 R X:DTIME
94 S:'$T DTOUT=1
95 Q:X=""!(X["N")!(X["Y")
96 W !,"Answer 'Y' or 'N': " G YN
97UNDO ;Clean up ^LRO(69
98 N X,TST
99 S LRIFN=+$O(^LRO(69,LRODT,1,LRSN,2,"B",LRTSTS,0)) Q:LRIFN<1
100 S $P(^LRO(69,LRODT,1,LRSN,2,LRIFN,0),"^",3,6)="^^^"
101 S $P(^LRO(69,LRODT,1,LRSN,1),U,4)="U" ;,$P(^(1),U,6)=LRNM_" NOT ACCESSIONED - TEST DEFINITION INCOMPLETE"
102 Q
103 S X=$G(^LRO(69,LRODT,1,LRSN,2,LRIFN,0)) Q:'X S TST(+X)=""
104 S X=$S($D(^LRO(69,LRODT,1,LRSN,2,LRIFN,1.1,0)):$P(^(0),"^",3),1:0)+1,^(0)="^^"_X_"^"_X_"^"_DT,^(X,0)="Not accessioned - Test definition incomplete"
105 D NEW^LR7OB1(LRODT,LRSN,"OC",,.TST)
106 S $P(^LRO(69,LRODT,1,LRSN,2,LRIFN,0),"^",3,6)="^^^",$P(^(0),"^",9,11)="CA^L^"_DUZ
107 Q
108OR ;from LRPHITEM
109 I $G(LRORDRR)="R" S LRTEST(LRTN)=$G(^LRO(69,LRODT,1,LRSN,2,LRTN,0)) Q
110 Q
Note: See TracBrowser for help on using the repository browser.