source: WorldVistAEHR/trunk/r/AUTOMATED_LAB_INSTRUMENTS-LA/LAKUR1.m@ 901

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

initial load of WorldVistAEHR

File size: 3.2 KB
Line 
1LAKUR1 ;SLC/RWF - URINALYSIS Part 2 ; 9/19/87 18:36 ;
2 ;;5.2;AUTOMATED LAB INSTRUMENTS;;Sep 27, 1994
3 K TY S T3=0 D INIT F N1=0:0 S N1=$O(^TMP("LA",$J,N1)) Q:N1>30!(N1'>0) S I3=^(N1,3),I4=^(4) I I3 S TYPE=I4 W ! D RESULT
4 D HD1,HD4,HD2
5L F J=0:0 Q:FLAG!DONE S DX=0,DY=22 X XY W !,?40,*13,"URINE: " R TYPE#1:DTIME D CHECK
6 D STORE:DONE
7 K X,A,DATYP,X,DD,DA,CODE,TYPE,CONT,DONE,J,K,T1,T2,T3,KEY,TY Q
8CHECK I '$T!(TYPE=U) S FLAG=1 Q
9 S LINE=$S(TYPE="":"STOP",TYPE="!":"COM","\[]"[TYPE:"PAGE",KEY'[TYPE:"HELP",1:"RESULT") D @LINE Q
10RESULT S Y=KEY(TYPE) W *13,$P(^LAB(60,^TMP("LA",$J,Y,0),0),U,1) W:$D(TY(T3,TYPE)) " ",TY(T3,TYPE),"//" R " ",X:DTIME I '$T!(X=U) S FLAG=1 Q
11DELETE Q:X="" I X="@"&$D(TY(T3,TYPE)) K TY(T3,TYPE) Q
12 S DD=^TMP("LA",$J,Y,"DD") D SET:$P(DD,U,2)["S" X $P(DD,U,5,99) I $D(X) S TY(T3,TYPE)=X Q
13HELP2 S DX=0,DY=22 W !,$C(7),$S($D(^DD(63.04,DA,3)):^(3),1:"") I $P(DD,U,2)'["S" R X:2 Q
14 F K=1:1 Q:$P(LRSET,";",K)="" W !,"You can enter '",$P($P(LRSET,";",K),":",1),"' which stands for ",$P($P(LRSET,";",K),":",2)
15 R !,"Press return to continue ",X:DTIME D HD1,HD2 Q
16 Q
17HELP I TYPE'="?" W *13,$C(7)," INVALID KEY" R X:2 Q
18 S DX=0,DY=LRDY,X=0 X XY F I1=T3*30+1:9:T2 W !!!!,?7 F I=I1:1:I1+8 Q:I>T2 S X=$S($D(^TMP($J,T3,I)):^(I),1:"^"),K=$S($D(TY(T3,X)):TY(T3,X),1:"") W $J(K,8)
19 Q
20SET S LRSET=$P(DD,U,3),%=$P($P(";"_LRSET,";"_X_":",2),";",1) I %]"" W " ",% Q
21 F I=1:1 S LRSUBS=$P(LRSET,";",I),Y=$F(LRSUBS,":"_X) G HUH:LRSUBS="" IF Y S X=$P(LRSUBS,":",1) W $E(LRSUBS,Y,255) Q
22 Q
23HUH K X Q
24 W:X'["?" " ??" W $C(7) K X F K=1:1 Q:$P(CODE,";",K)="" W !,"YOU CAN ENTER ",$P($P(CODE,";",K),":")," WHICH STANDS FOR ",$P($P(CODE,";",K),":",2)
25 Q
26PAGE S T3=$S(TYPE="\":0,TYPE="[":1,TYPE="]":2,1:0) D INIT Q
27STOP D EVAL S T3=0
28DONE R !,"ARE YOU FINISHED WITH THIS PATIENT (Y/N) Y//",X:DTIME I '$T S FLAG=1 Q
29 S:X="" X="Y" I "YyNn^"'[X W $C(7)," ??" G DONE
30 S:"Yy"[X DONE=1 S:U[X FLAG=1 D:FLAG=DONE INIT Q
31 Q
32EVAL D HD1
33 F T3=0:1:2 F I=0:0 S I=$O(^TMP($J,T3,I)) Q:I="" S Y=^(I) I $D(TY(T3,Y)) W !?2,^TMP("LA",$J,I,.1),": ",?12 S V=TY(T3,Y) X ^TMP("LA",$J,I,2) W $J(V,3)
34 Q
35STORE F T3=0:1:2 F I=0:0 S I=$O(^TMP($J,T3,I)) Q:I="" S Y=^(I) I $D(TY(T3,Y)) S V=TY(T3,Y) X ^TMP("LA",$J,I,2) S @^TMP("LA",$J,I,1)=V
36 Q
37HD1 W @IOF,!!,"Patient name: ",PNM,?45,"SSN: ",SSN Q
38HD2 W !,?10,"URINALYSIS Screen ",$P("MAIN$CAST's$CRYSTAL's","$",T3+1)
39 S LRDY=$Y W !,"'?'=DISPLAY, '!'=COMMENTS, '\'=MAIN, '['=CASTS, ']'=CRYSTALS, <RETURN>=EXIT" F I=1:1:T1 W !,"KEY",?7,T1(I),!,"TEST",?7,T2(I),!!
40HD3 S TYPE="?" D HELP Q
41HD4 Q:$O(^LR(LRDFN,"CH",LRDAT,1))<1 W !,?24,"> Urine Chem profile <",!
42 S I=1 F C=1:0 S C=$O(^LR(LRDFN,"CH",LRDAT,C)) Q:C'>0 S V=^(C),X=$O(^LAB(60,"C","CH;"_C_";1",0)) I X>0 W $P(^LAB(60,X,0),U,1),": ",$P(V,U,1)_" "_$P(V,U,2),?(I*25) S I=I+1 I I>3 W ! S I=1
43 Q
44COM W !,"Comment: ",RMK,! I RMK="" R RMK:DTIME G COM2
45 S Y=RMK D RW^LRDIED S RMK=$S(X="@":"",1:Y)
46COM2 D HD1,HD4,HD2 Q
47INIT K KEY,T1,T2 S KEY="",N1=T3*30,N2=N1+27,T1=1,(T1(T1),T2(T1))=""
48 F I=0:0 S I=$O(^TMP($J,T3,I)) Q:I="" S X=^(I),KEY(X)=I,KEY=KEY_X
49 F I=N1+1:1:N2 S X=$S($D(^TMP("LA",$J,I,4)):^(4),1:""),Y=$S($D(^(.1)):^(.1),1:""),T1(T1)=T1(T1)_$J(X,8),T2(T1)=T2(T1)_$J(Y,8) Q:$O(^TMP($J,T3,I))="" I '(I-N1#9) S T1=T1+1,(T1(T1),T2(T1))=""
50 S T2=I,DONE=0,FLAG=0 D HD1,HD2 Q
Note: See TracBrowser for help on using the repository browser.