LRAPC ;AVAMC/REG - ANAT TOPOGRAPHY COUNTS ;8/14/95 08:36 ;
;;5.2;LAB SERVICE;**72**;Sep 27, 1994
S LRDICS="SPCYEM" D ^LRAP G:'$D(Y) END W !!,LRO(68)," (",LRABV,") TOPOGRAPHY COUNTS",!!
D XR^LRU S S(1)=LRO(68)
K T S T="" W !!,"TOPOGRAPHY (Organ/Tissue)" F B=1:1 D ASK Q:X[U!(X="")
G:B<2&(T="") END S:T=""&(B=2) T=$O(T(-1)) W ! D B^LRU G:Y<0 END S LRSDT=LRSDT-.01,LRLDT=LRLDT+.99
S ZTRTN="QUE^LRAPC" D BEG^LRUTL G:POP!($D(ZTSK)) END
QUE U IO S (O,C,C(1),C(2))=0 K ^TMP($J) D L^LRU,S^LRU
F A=0:0 S LRSDT=$O(^LR(LRXR,LRSDT)) Q:'LRSDT!(LRSDT>LRLDT) D L
D H,TOT K ^TMP($J) D END^LRUTL,END Q
TOT S LR("F")=1,T=-1 F X=1:1 S T=$O(O(T)) Q:T=""!(LR("Q")) D:$Y>(IOSL-8) H Q:LR("Q") W !?2,"T-",T,$E(".....",1,5-$L(T)),?14,$J(O(T),5),?22 W:C(2) $J(O(T)/C(2)*100,5,2),"%"
S X=0 F A=0:1 S X=$O(^TMP($J,X)) Q:'X!(LR("Q"))
Q:LR("Q") W !!,"# Patients: ",A,!,"# accessions: ",C(1),!,"# organ/tissues: ",C(2),!,"% = % of organ/tissues" Q
L F LRDFN=0:0 S LRDFN=$O(^LR(LRXR,LRSDT,LRDFN)) Q:'LRDFN D I
Q
I F I=0:0 S I=$O(^LR(LRXR,LRSDT,LRDFN,I)) Q:'I D T
Q
T S X=$G(^LR(LRDFN,LRSS,I,0)) Q:$P($P(X,U,6)," ")'=LRABV S ^TMP($J,LRDFN)="",C(1)=C(1)+1 ;set pt in utility global C(1)= acc # count
S T=0 F B=0:1 S T=$O(^LR(LRDFN,LRSS,I,2,T)) Q:'T S W=+^(T,0) D TG
S C(2)=C(2)+B Q ;Number of organ/tissues
TG Q:'$D(^LAB(61,W,0)) S W(1)=^(0),X=$P(W(1),"^",2),Y=-1 F C=0:1 S Y=$O(T(Y)) Q:Y="" I $E(X,1,L(Y))=T(Y) S:'$D(O(Y)) O(Y)=0 S O(Y)=O(Y)+1
Q
ASK K A("B") W !,"Choice #",$J(B,2),": Select 1 or more characters of the code: " R X:DTIME Q:X=""!(X[U)
D CK^LRAUSM G:$D(A("B")) ASK S T(X)=X,L(X)=$L(X) Q
H I $D(LR("F")),IOST?1"C".E D M^LRU Q:LR("Q")
D F^LRU W !,LRO(68)," (",LRABV,") TOPOGRAPHY COUNTS"
W !,"Topography",?14,"Count",?22,"From:",LRSTR," To:",LRLST,!,LR("%") Q
;
END D V^LRU Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HLRAPC 1817 printed Dec 13, 2024@02:07:08 Page 2
LRAPC ;AVAMC/REG - ANAT TOPOGRAPHY COUNTS ;8/14/95 08:36 ;
+1 ;;5.2;LAB SERVICE;**72**;Sep 27, 1994
+2 SET LRDICS="SPCYEM"
DO ^LRAP
if '$DATA(Y)
GOTO END
WRITE !!,LRO(68)," (",LRABV,") TOPOGRAPHY COUNTS",!!
+3 DO XR^LRU
SET S(1)=LRO(68)
+4 KILL T
SET T=""
WRITE !!,"TOPOGRAPHY (Organ/Tissue)"
FOR B=1:1
DO ASK
if X[U!(X="")
QUIT
+5 if B<2&(T="")
GOTO END
if T=""&(B=2)
SET T=$ORDER(T(-1))
WRITE !
DO B^LRU
if Y<0
GOTO END
SET LRSDT=LRSDT-.01
SET LRLDT=LRLDT+.99
+6 SET ZTRTN="QUE^LRAPC"
DO BEG^LRUTL
if POP!($DATA(ZTSK))
GOTO END
QUE USE IO
SET (O,C,C(1),C(2))=0
KILL ^TMP($JOB)
DO L^LRU
DO S^LRU
+1 FOR A=0:0
SET LRSDT=$ORDER(^LR(LRXR,LRSDT))
if 'LRSDT!(LRSDT>LRLDT)
QUIT
DO L
+2 DO H
DO TOT
KILL ^TMP($JOB)
DO END^LRUTL
DO END
QUIT
TOT SET LR("F")=1
SET T=-1
FOR X=1:1
SET T=$ORDER(O(T))
if T=""!(LR("Q"))
QUIT
if $Y>(IOSL-8)
DO H
if LR("Q")
QUIT
WRITE !?2,"T-",T,$EXTRACT(".....",1,5-$LENGTH(T)),?14,$JUSTIFY(O(T),5),?22
if C(2)
WRITE $JUSTIFY(O(T)/C(2)*100,5,2),"%"
+1 SET X=0
FOR A=0:1
SET X=$ORDER(^TMP($JOB,X))
if 'X!(LR("Q"))
QUIT
+2 if LR("Q")
QUIT
WRITE !!,"# Patients: ",A,!,"# accessions: ",C(1),!,"# organ/tissues: ",C(2),!,"% = % of organ/tissues"
QUIT
L FOR LRDFN=0:0
SET LRDFN=$ORDER(^LR(LRXR,LRSDT,LRDFN))
if 'LRDFN
QUIT
DO I
+1 QUIT
I FOR I=0:0
SET I=$ORDER(^LR(LRXR,LRSDT,LRDFN,I))
if 'I
QUIT
DO T
+1 QUIT
T ;set pt in utility global C(1)= acc # count
SET X=$GET(^LR(LRDFN,LRSS,I,0))
if $PIECE($PIECE(X,U,6)," ")'=LRABV
QUIT
SET ^TMP($JOB,LRDFN)=""
SET C(1)=C(1)+1
+1 SET T=0
FOR B=0:1
SET T=$ORDER(^LR(LRDFN,LRSS,I,2,T))
if 'T
QUIT
SET W=+^(T,0)
DO TG
+2 ;Number of organ/tissues
SET C(2)=C(2)+B
QUIT
TG if '$DATA(^LAB(61,W,0))
QUIT
SET W(1)=^(0)
SET X=$PIECE(W(1),"^",2)
SET Y=-1
FOR C=0:1
SET Y=$ORDER(T(Y))
if Y=""
QUIT
IF $EXTRACT(X,1,L(Y))=T(Y)
if '$DATA(O(Y))
SET O(Y)=0
SET O(Y)=O(Y)+1
+1 QUIT
ASK KILL A("B")
WRITE !,"Choice #",$JUSTIFY(B,2),": Select 1 or more characters of the code: "
READ X:DTIME
if X=""!(X[U)
QUIT
+1 DO CK^LRAUSM
if $DATA(A("B"))
GOTO ASK
SET T(X)=X
SET L(X)=$LENGTH(X)
QUIT
H IF $DATA(LR("F"))
IF IOST?1"C".E
DO M^LRU
if LR("Q")
QUIT
+1 DO F^LRU
WRITE !,LRO(68)," (",LRABV,") TOPOGRAPHY COUNTS"
+2 WRITE !,"Topography",?14,"Count",?22,"From:",LRSTR," To:",LRLST,!,LR("%")
QUIT
+3 ;
END DO V^LRU
QUIT