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

LR7OGU.m

Go to the documentation of this file.
LR7OGU ;SLC/STAFF- Interim report rpc utility ;5/22/97  13:53
 ;;5.2;LAB SERVICE;**187,242,252**;Sep 27, 1994
 ;
DEMO(DFN,LRDFN,PNM,AGE,SEX) ; from LR7OGC, LR7OGG, LR7OGM, LR7OGMU
 N %,%H,%I,DOB,LRDPF,LREND,LRPRAC,LRRB,LRTREA,LRWRD,SSN,VA,VA200,VADM,VAERR,VAIN K %I,LRWRD,SSN,VA,VADM,VAIN
 S LRDFN=+$$LRDFN^LR7OR1(DFN)
 D PT^LRX
 Q
 ;
TESTSGET(TESTS,MICROSUB) ; from LR7OGM
 N MICROEC,TEST
 S TEST=0 F  S TEST=$O(TESTS(TEST)) Q:TEST<1  D
 .I $P(^LAB(60,TEST,0),U,4)="CH" D
 ..N PANEL,SEQ,TESTNUM,TESTSUB,TESTZERO K PANEL
 ..D TEST(TEST,.PANEL)
 ..S SEQ=0 F  S SEQ=$O(PANEL(SEQ)) Q:SEQ<1  D
 ...S TESTNUM=+PANEL(SEQ)
 ...S TESTZERO=^LAB(60,TESTNUM,0)
 ...S TESTSUB=$P($P(TESTZERO,U,5),";",2)
 ...S ^TMP("LR7OG",$J,"T",TESTNUM)=TESTZERO
 ...S ^TMP("LR7OG",$J,"TMP",TESTSUB)=TESTNUM
 .E  D
 ..S MICROEC=+$P(^LAB(60,TEST,0),U,14)
 ..S MICROEC=$G(^LAB(62.07,MICROEC,.1))
 ..I MICROEC["11.5" S MICROSUB(1)=""
 ..I MICROEC["11.6" S MICROSUB(2)=""
 ..I MICROEC["15" S MICROSUB(5)=""
 ..I MICROEC["19" S MICROSUB(8)=""
 ..I MICROEC["23" S MICROSUB(11)=""
 ..I MICROEC["34" S MICROSUB(16)=""
 Q
TEST(TEST,PANEL) ; from LR7OGO
 N CNT,DUP,NEWTEST K PANEL,DUP
 S CNT=0
 D TESTS(TEST)
 Q
 ;
TESTS(TEST) ;
 ; within scope of TEST
 I $P(^LAB(60,TEST,0),U,5)]"","BO"[$P(^(0),U,3),'$D(DUP(TEST)) S CNT=CNT+1,PANEL(CNT)=TEST,DUP(TEST)="" Q
 N NUM
 S NUM=0 F  S NUM=$O(^LAB(60,TEST,2,NUM)) Q:NUM<1  D
 .S NEWTEST=+^LAB(60,TEST,2,NUM,0)
 .D TESTS(NEWTEST)
 Q
 ;
STRIP(VALUE) ; $$(value) -> value with leading spaces removed
 N I
 F I=1:1:$L(VALUE) Q:$E(VALUE)'=" "  S VALUE=$E(VALUE,2,$L(VALUE))
 Q VALUE
 ;
URANGE(TEST,SPEC,AGE,SEX,UNITS,RANGE) ; from LR7OGC, LR7OGG, LR7OGMG
 N HIGH,LOW,LRCW,REFHIGH,REFLOW,TESTSPEC,THER,THERHIGH,THERLOW
 S (RANGE,UNITS)="",LRCW=8
 I '$G(SPEC) Q
 S TESTSPEC=$S($D(^LAB(60,TEST,1,SPEC,0)):^(0),1:"")
 I '$L(TESTSPEC) Q
 S REFLOW=$P(TESTSPEC,U,2),REFHIGH=$P(TESTSPEC,U,3),THERLOW=$P(TESTSPEC,U,11),THERHIGH=$P(TESTSPEC,U,12),UNITS=$P(TESTSPEC,U,7)
 S THER=$S($L(THERHIGH):1,$L(THERLOW):1,1:0)
 S LOW=$S(THER:THERLOW,1:REFLOW)
 S HIGH=$S(THER:THERHIGH,1:REFHIGH)
 S @("LOW="_$S($L(LOW):LOW,1:""""""))
 S @("HIGH="_$S($L(HIGH):HIGH,1:""""""))
 S RANGE=LOW
 I $L(HIGH) S RANGE=RANGE_" - "_HIGH
 I THER S RANGE=RANGE_" (Ther. range)"
 Q
 ;
ALLTEST ; test use only
 N TESTCNT,TESTNUM,TESTS
 S TESTNUM=0 F  S TESTNUM=$O(^LAB(60,TESTNUM)) Q:TESTNUM<1  D
 .I '$O(^LAB(60,TESTNUM,2,0)) Q
 .K TESTS
 .W ! D TEST(TESTNUM,.TESTS)
 .W !,TESTNUM,"  ",$P(^LAB(60,TESTNUM,0),U)
 .S TESTCNT=0 F  S TESTCNT=$O(TESTS(TESTCNT)) Q:TESTCNT<1  W !?5,TESTCNT,"  ",$P(^LAB(60,+TESTS(TESTCNT),0),U)
 Q