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

LRACSUM1.m

Go to the documentation of this file.
LRACSUM1 ;SLC/DCM - INDIVIDUAL PATIENT SUMMARY CONT. ; 10/8/87  11:14 ;
 ;;5.2;LAB SERVICE;**225**;Sep 27, 1994
LRIDT ;from LRACSUM
 F  S LRIDT=$O(^LR(LRDFN,"CH",LRIDT)) Q:LRIDT<1!(LRIDT>LROUT)  S X=^(LRIDT,0) D LRIIDT
 Q
LRIIDT S (LRIIDT,LRVIDT)=$P(X,U,1),LRSUB=1,LRTNN=1
 S LRSPM=$P(X,U,5),LRTLOC=$E($P(X,U,11),1,7),LRVDT=$P(X,U,3),LRAN=$P(X,U,6)
 Q:'$L(LRVDT)  D LRSUB Q
LRSUB S LRSUB=1 F  S LRSUB=$O(^LR(LRDFN,"CH",LRIDT,LRSUB)) Q:LRSUB<1  S X=^(LRSUB) D SUB1
 Q
SUB1 S LRTSTVAL=$P(X,U,1),X1=$P(X,U,2),LRNOFL=""
 S LRTST=$O(^LAB(60,"C","CH;"_LRSUB_";"_1,0)) Q:LRTST=""
 Q:"IN"[$P(^LAB(60,LRTST,0),U,3)
 I '$D(^LAB(64.5,"AC",LRSUB)) D MISC Q
 K LRNON D LRMH I '$D(LRNON) D MISC Q
LRMH S LRMH=0 F  S LRMH=$O(^LAB(64.5,"AC",LRSUB,1,LRMH)) Q:LRMH<1  D LRSH
 Q
LRSH S LRSH=0 F  S LRSH=$O(^LAB(64.5,"AC",LRSUB,1,LRMH,LRSH)) Q:LRSH<1  D TST
 Q
TST S LRTSTS=0 F  S LRTSTS=$O(^LAB(64.5,"AC",LRSUB,1,LRMH,LRSH,LRTSTS)) Q:'LRTSTS  S LRSPM1=^(LRTSTS) D TST1
 Q
TST1 Q:LRSPM'=LRSPM1
SBSET S LRMHN=$P(^LAB(64.5,1,1,LRMH,0),U,1),LRTF=^(1,LRSH,0),$P(LRTF,U,4)=$P(LRTF,U,3),$P(LRTF,U,3)=$P(^(1,0),U,4),LRNON=1
 ;**LRTE=Total minor headings,LRMHN=Major heading name^TE^Lab performing tests,LRTF=Minor header^Profile specimen^Total tests^Type of display**
 S LRIIDT=LRVIDT
 S:'$D(^TMP($J,LRDFN,LRMH)) ^(LRMH)=LRMHN S:'$D(^TMP($J,LRDFN,LRMH,LRSH))!($D(^(LRSH))=10) ^(LRSH)=LRTF_U S:'$D(^TMP($J,LRDFN,LRMH,LRSH,LRIIDT,0)) ^(0)=LRTLOC_U_LRVIDT_U_LRVDT_U_LRAN_U_LRIDT
LRTSTVAL S ^TMP($J,LRDFN,LRMH,LRSH,LRIIDT,LRTSTS)=LRTSTVAL_U_X1
 I $D(^LR(LRDFN,"CH",LRIDT,1,0)),'$D(^TMP($J,LRDFN,LRMH,LRSH,LRIIDT,"TX",0)) D TEXT
 Q
MISC S LRTST=$O(^LAB(60,"C","CH;"_LRSUB_";"_1,0)) Q:LRTST=""
 Q:"IN"[$P(^LAB(60,LRTST,0),U,3)
 S LRTOP=LRSPM
 S:'$D(^TMP($J,LRDFN,"MISC",LRIIDT,0)) ^(0)=LRIDT_U_LRVIDT_U_LRVDT_U_LRAN_U_LRSPM S ^(LRTNN)=LRTSTVAL_U_LRSPM_U_LRTST_U_X1_U_LRSUB
 I $D(^LR(LRDFN,"CH",LRIDT,1,0)),'$D(^TMP($J,LRDFN,"MISC",LRIIDT,"TX",0)) S ^TMP($J,LRDFN,"MISC",LRIIDT,"TX",0)="" S L=0 F  S L=$O(^LR(LRDFN,"CH",LRIDT,1,L)) Q:'L  S ^TMP($J,LRDFN,"MISC",LRIIDT,"TX",L,0)=^LR(LRDFN,"CH",LRIDT,1,L,0)
 S LRTNN=LRTNN+1
 Q
TEXT S LRYESCOM=0
 S M=0 F  S M=$O(^LR(LRDFN,"CH",LRIDT,1,M)) Q:'M!(LRYESCOM)  F N=1:1:$L(^LR(LRDFN,"CH",LRIDT,1,M,0)) Q:LRYESCOM  S:$E(^(0),N)'[$C(32) LRYESCOM=1
 Q:'LRYESCOM
 S L=0 F  S L=$O(^LR(LRDFN,"CH",LRIDT,1,L)) Q:'L  S ^TMP($J,LRDFN,LRMH,LRSH,LRIIDT,"TX",L,0)=^LR(LRDFN,"CH",LRIDT,1,L,0)
 Q
LRCALE ;from LRACSUM
 S A7=0 F  S A7=$O(^LAB(64.5,1,1,A7)) Q:A7<1  D A7
 K A7,B3 Q
A7 S B3=0 F  S B3=$O(^LAB(64.5,1,1,A7,1,B3)) Q:B3<1  D B3
 Q
B3 S:$P(^LAB(64.5,1,1,A7,1,B3,0),U,4) LRCALE(A7,B3)=1
 Q
MICRO ;from LRACSUM
 Q:'$D(^LR(LRDFN,"MI"))  S:'$D(LRUNKNOW) LRUNKNOW=$P(^LAB(69.9,1,1),U,5) S (LRONESPC,LRONETST)="",LREND=0
 S LRWRDVEW="",LRSB=0,LRIDT=LRIN F  S LRIDT=$O(^LR(LRDFN,"MI",LRIDT)) Q:LRIDT<1!(LRIDT>LROUT)  S LRNLOC=LRLLOC D EN1^LRMIPC S LRLLOC=LRNLOC
 K %,A,A1,AGE,B,B1,DFN,DOB,DZ,I,J,LR2ORMOR,LRAA,LRACC,LRACN,LRAD,LRADM,LRADX,LRAFS,LRAX,LRBUG,LRCMNT,LRCS,LRDCOM,LREF,LREND,LRIFN,LRLLT,LRMD,LRNLOC,LRNS,LROK,LRONESPC,LRONETST,LRORG,LRPRE,LRPRINT
 Q