source: WorldVistAEHR/trunk/r/AUTOMATED_LAB_INSTRUMENTS-LA/LAKUR.m@ 1361

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

initial load of WorldVistAEHR

File size: 2.8 KB
Line 
1LAKUR ;SLC/RWF - KEYBOARD URINE COUNTER ;8/16/90 10:39 ;
2 ;;5.2;AUTOMATED LAB INSTRUMENTS;;Sep 27, 1994
3 ;CROSS LINK BY ID = ACCESSION
4LA1 S:$D(ZTQUEUED) ZTREQ="@" S LANM=$T(+0),TSK=$O(^LAB(62.4,"C",LANM,0)),U="^" I TSK<1 W !,"AUTO INSTRUMENT FILE NOT SETUP RIGHT" G QUIT
5 W !!?20,"KEYBOARD URINALYSIS ENTRY",!!
6 S LRTOP=$P(^LAB(69.9,1,1),U,1) D ^LASET G:'TSK QUIT K ^LA("LOCK",TSK)
7 S SS="CH",IOP="HOME",%ZIS="" S:'$D(DTIME) DTIME=300 D ^%ZIS S XY=$P(^%ZIS(2,IOST(0),1),U,5)
8 S LRAN=0,LRAA=WL,LRAD=DT,LAOVER=1 D INT
9LA2 K Y,TV S (A,TOUT)=0,RMK="" D NEXT,WLN G QUIT:LRAN<1
10 S FLAG=0 D ^LAKUR1 G LA2:FLAG
11SAVE ;G LOST:'$D(Y(2)) F I=0:0 S I=$O(TC(I)) Q:I<1 X TC(I,2) S:$D(V) @TC(I,1)=V
12 S ID=LRAN,TRAY=1,CUP=ID,IDE=0
13LA3 X LAGEN G LA2:'ISQN ;Can be changed by the cross-link code
14 S Z=TSK_">" F I=0:0 S I=$O(TV(I)) Q:I<1 S:TV(I,1)]"" ^LAH(LWL,1,ISQN,I)=TV(I,1),Z=Z_TV(I,1)_" "
15 I $D(RMK),$L(RMK) D RMK^LASET
16 D WRITE G LA2
17WLN W !,"Accession NUMBER: ",LRAN R "//",X:DTIME S:X="" X=LRAN G LW:X["?",END:X["^"!'$T,WLN:+X'=X!(X<0)!(X>99999)!(X[".") S:X'="" LRAN=X IF '$D(^LRO(68,LRAA,1,LRAD,1,LRAN,0)) W !,"NOT ON FILE" D NEXT G WLN
18 S LRDFN=+^LRO(68,LRAA,1,LRAD,1,LRAN,0),LRACC=$S($D(^(.2)):^(.2),1:""),LRDAT=9999999-$S($D(^(3)):^(3),1:0),LRODT=$S($P(^(0),U,4):$P(^(0),U,4),1:$P(^(0),U,3)),LRSN=$P(^(0),U,5)
19 S LRDPF=$P(^LR(LRDFN,0),U,2),DFN=$P(^(0),U,3) D PT^LRX
20PR W !!,"Patine name: ",PNM," SSN: ",SSN," Acc: ",LRACC
21 W !,"Is this the correct patient:" S %=1 D YN^DICN G PR:%=0,WLN:%=2 S:%=-1 LRAN=-1 Q
22 Q
23LW W !,"Enter an accession number to enter URINALYSIS results on." G WLN
24NEXT S LRAN=$O(^LRO(68,LRAA,1,LRAD,1,LRAN)) S:LRAN'>0 LRAN="^" Q
25END S LRAN=-1 Q
26 Q
27INT K KEY F I=0:0 S I=$O(^TMP("LA",$J,I)) Q:I'>0 S J=I+29\30-1,I3=^(I,3),I4=^(4),X=^(0) D INT2
28 S ^TMP("LA",$J,99)="" Q
29INT2 S I1=$P(^LAB(60,X,.1),U,1),DA=+^(.2),DD=^DD(63.04,DA,0),^TMP("LA",$J,I,.1)=I1,^("DD")=DD
30 I $D(KEY(J,I4)) W $C(7),!!,">> The same KEY (",I4,") is set for more than one TEST (",I1," screen ",$S(J=0:"main",J=1:"cast",1:"crystal"),")<<",!!,$C(7) Q
31 S ^TMP($J,J,I)=I4,KEY(J,I4)="" S:I3=2 ^TMP($J,"NC",I)=""
32 Q
33IN S CNT=^LA(TSK,"I",0)+1 IF '$D(^(CNT)) S TOUT=TOUT+1 Q:TOUT>9 H 9 G IN
34 S ^LA(TSK,"I",0)=CNT,IN=^(CNT),TOUT=0
35 Q
36OUT S CNT=^LAB(TQ,"O")+1,^("O")=CNT,^("O",CNT)=TSK_OUT
37 LOCK ^LAB("Q") S Q=^LAB("Q")+1,^("Q")=Q,^("Q",Q)=TQ LOCK
38 Q
39WRITE W !,Z
40 Q
41QUIT K %,A,ACK,ASK,BASE,C,CENUM,CHK,CNT,CODE,CONT,CUP,DA,DATYP,DD,DFN,DONE,DPF,DX,DY,ECHOALL,ER,FLAG,HDR,HOME,HRD,I,I1,I3,I4,ID,IDE,IDENT,IDT,IN,ISQN,J,K,KEY,L,LAGEN,LACT,LALCT,LANM,LINE
42 K LINK,LOG,LRAA,LRACC,LRAD,LRAN,LRDAT,LRDFN,LRDPF,LRDY,LRIO,LRODT,LROVER,LRPGM,LRSET,LRSN,LRSUBS,LRTIME,LRTOP,LRTST,LWL,M,METH,NAK,NC,NOW,OUT,PNM,Q,RMK,RT,SS
43 K SSN,STORE,T,T1,T2,TC,TEMP,TOTAL,TOUT,TP,TQ,TRAP,TRAY,TRY,TSK,TV,TY,TYPE,V,WDT,WL,X,XY,Y,YY,Z,ZTSK,^TMP($J),^("LA",$J)
44 Q
45TRAP D ^LABERR S T=TSK D SET^LAB G @("LA2^"_LANM) ;ERROR TRAP
Note: See TracBrowser for help on using the repository browser.