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

LRKDIFF1.m

Go to the documentation of this file.
LRKDIFF1 ;SLC/RWF,LL/RES- KEYBOARD DIFF PART 2 ; 7/14/87  08:02 ; [ 10/14/90  8:56 PM ]
 ;;V~5.0~;LAB;;02/27/90 17:09
 ;WBC DIFF CELL COUNTER
A K KEY,NC,TY,T1,T2 S KEY="" F I=0:0 S I=$O(^UTILITY($J,"W",I)) Q:I=""  S K=^(I),KEY(K)=I,KEY=KEY_K,TY(K)="" S:$D(^UTILITY($J,"NC",I)) NC(K)=""
 F I=1:1:27 S X=$S($D(^UTILITY("LA",$J,I,4)):^(4),1:""),Y=$S($D(^UTILITY("LA",$J,I,.1)):^(.1),1:""),^UTILITY($J,"A",I\9+1,I#9)=X_"^"_Y,T2=I Q:$O(^UTILITY($J,"W",I))=""
 S T1=1,(T1(1),T2(1))="" F I=1:1:T2 S X=^UTILITY($J,"A",I\9+1,I#9),T1(T1)=T1(T1)_$J($P(X,U,1),8),T2(T1)=T2(T1)_$J($P(X,U,2),8) I '(I#9) S T1=T1+1,(T1(T1),T2(T1))=""
 S (TOTAL,FLAG,STORE)=0,A=-1 D HD1,HD4,HD2
 F J=0:0 Q:TOTAL=200!FLAG!STORE  S DX=0,DY=21 X XY W !,"WBC: " R TYPE#1:DTIME D CHECK
 D STORE:(TOTAL=200)!(STORE)
 K TEMP,T1,T2,KEY,NC,A,CONT,J,L,TOTAL,CHK,STORE Q
CHECK I '$T!(TYPE=U) S FLAG=1 Q
 S LINE=$S(TYPE="":"STOP",TYPE="-":"MINUS",TYPE="!":"COM",KEY'[TYPE:"HELP",1:"COUNT") D @LINE Q
COUNT I '$D(NC(TYPE)) S TOTAL=TOTAL+1,DX=25,DY=22 X XY W $J(TOTAL,3)
 S TY(TYPE)=TY(TYPE)+1 D:TOTAL=100!(TOTAL=200) EVAL Q
HELP I TYPE'="?" W *7 Q
 S DX=0,DY=LRDY X XY F I1=1:9:T2 W !!!!,?7 F I=I1:1:I1+8 Q:I>T2  S X=$S($D(^UTILITY($J,"W",I)):^(I),1:"^") S K=$S($D(TY(X)):TY(X),1:"") W $J(K,8)
 Q
STOP D EVAL W:TOTAL<100 *7 W !!!,"* YOU HAVE COUNTED ",TOTAL," CELLS *"
DONE R !,"ARE YOU FINISHED WITH THE WBC CELL COUNT: (Y/N) Y//",X:DTIME I '$T S FLAG=1 Q
 S:X="" X="Y" I "YyNn^"'[X W *7,"  ??" G DONE
 S:TOTAL=0 X=U S:"Yy"[X STORE=1 S:U[X FLAG=1 D:FLAG=STORE HD1,HD2 Q
 Q
EVAL W *7 D HD1
 I TOTAL<100 W *7,!,"NOTE:  ONLY ",TOTAL," CELLS COUNTED",!! Q:TOTAL=0
 W !,"TEST",?12,"Count Value" F I=0:0 S I=$O(^UTILITY($J,"W",I)) Q:I=""  S K=^(I) W !?2,^UTILITY("LA",$J,I,.1),": ",?12 S V=TY(K) W $J(V,3),"   " X ^UTILITY("LA",$J,I,2) W $J(V,3)
 W !,"TOTAL: ",TOTAL,! Q:'(TOTAL=100!(TOTAL=200))  D TWO:TOTAL=100 Q:'STORE
 Q
TWO F I=0:0 R X#1:1 Q:'$T  W *7 ;Flush buffer
 W *7,!!!,"100 CELLS COUNTED, CONTINUE COUNTING TO 200 OR STOP (C/S) S//" R X:DTIME S:'$T!(X="^") FLAG=1 Q:FLAG  S:X="" X="S" I "SsCc"'[X W *7,"  ??" G TWO
 S:"Ss"[X STORE=1 Q
STORE F I=0:0 S I=$O(^UTILITY($J,"W",I)) Q:I=""  S K=^(I),V=TY(K) X ^UTILITY("LA",$J,I,2) S @^UTILITY("LA",$J,I,1)=V
 Q
MINUS S DX=0,DY=21 X XY R !,"SUBTRACT WHICH CELL TYPE: ",TYPE#1:DTIME I '$T S FLAG=1 Q
 G MI2:TYPE="" I U[TYPE S FLAG=1 Q
 I KEY'[TYPE W *7,"  ??" G MINUS
 I TY(TYPE)>0 S TY(TYPE)=TY(TYPE)-1 I '$D(NC(TYPE)),TOTAL>0 S TOTAL=TOTAL-1
MI2 D HD3 Q
HD1 W @IOF,!!,"Patient name: ",PNM,?45,"HRCN: ",HRCN Q  ;IHS/ANMC/CLS 1O/14/90 HRCN
HD2 S LRDY=$Y,DX=0,DY=$Y X XY W !,?3,"WBC MORPHOLOGY ('?' = DISPLAY, '!' = COMMENTS, '-' = MINUS, <RETURN> = EXIT)" F I=1:1:T1 W !,"KEY",?7,T1(I),!,"TEST",?7,T2(I),!!
HD3 S DX=0,DY=21 X XY W !,?18,"TOTAL:",$J(TOTAL,3),"       " Q
HD4 W !!,?34,"> CBC PROFILE <",!
 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
 Q
COM W !,"Comment: ",RMK,! I RMK="" R RMK:DTIME G COM2
 S Y=RMK D RW^LRDIED S RMK=$S(X="@":"",1:Y)
COM2 D HD1,HD4,HD2 Q