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

LRGEN.m

Go to the documentation of this file.
LRGEN ;SLC/RWF - GENERAL REPORT FOR SELECTED TESTS ;8/11/97 [ 04/14/2003  8:08 AM ]
 ;;5.2T9;LR;**1003,1006,1018**;Nov 17, 2004
 ;;5.2;LAB SERVICE;**121,201,202,242**;Sep 27, 1994
 ;from option LRGEN
BEGIN D ^LRPARAM W !!?20,"GENERAL LAB DATA DISPLAY"
 K DIC,LRTP S (LRTP,LREND)=0 D ^LRDPA I LRDFN'=-1 D GEN
END K ^TMP("LR",$J),A8,C,DFN,DOB,DTOUT,DUOUT,I,II,IOBS,J,LRAA,LRAAC,LRAD,LRAN,LRCMNT,LRCW,LRDAT,LRDFN,LRDPF,LREDT,LREND,LREX,LREXPD,LRFFLG,LRFOOT,LRHDR,LRHI,LRIDT,LRIDT1,LRIX,LRLLT,LRLO,LRND,LRNG,LRNON,LRNOP,LRNOTE,LRONESPC,LRONETST
 ;K LRORD,LRPAGE,LRPG,LRPP,LRPR,LRPS,LRSC,LRSDT,LRSSP,LRSUB,LRSV,LRTEST,LRTHER,LRTN,LRTP,LRTSTS,LRWPL,LRWRD,LRX,LRY,PNM,POP,S,S1,S2,SSN,T,X,Y,Z
 ;----- BEGIN IHS MODIFICATIONS LR*5.2*1018
 K LRORD,LRPAGE,LRPG,LRPP,LRPR,LRPS,LRSC,LRSDT,LRSSP,LRSUB,LRSV,LRTEST,LRTHER,LRTN,LRTP,LRTSTS,LRWPL,LRWRD,LRX,LRY,PNM,POP,S,S1,S2,SSN,HRCN,T,X,Y,Z  ;IHS/ANMC/CLS 11/1/95
 ;----- END IHS MODIFICATIONS
 K LRODT0
 Q
GEN I $O(^LR(LRDFN,0))="" W !,"NO LAB DATA ON THIS PATIENT!",$C(7) Q
 S LRCW=10,LRPAGE=0 K ^TMP("LR",$J),LRTSTS,LRORD,LRTEST,LRSUB,LRHDR,LRSSP,LRHI,LRLO
 D TESTS^LRGEN2 K DIC Q:LREND!'LRTSTS  I LRTSTS>18 D GEN^LRRP2 Q
DATE S LREDT="T-14" D ^LRWU3 Q:LREND  S LREDT=9999999-LREDT K LRSV,DIC
 Q:LRIX=0  S LREND=0,LRWPL=IOSL-(3*LRIX)\LRIX,LRSC=LRIX,LRIDT=9999999-LRSDT
 F II=1:1:LRIX S LRIDT(II)=LRIDT
 S %ZIS="MQ",ZTRTN="DQ^LRGEN1" D IO^LRWU
 Q
EN2 ;from LRSOR1
 D DATE
 Q
OR ;OE/RR entry point
 Q:'$D(ORVP)  S KILL=1 I '$D(LRPARAM) D EN^LRPARAM S KILL=0
 D DT^LRX K DIC,LRTP S (LRTP,LREND)=0,DFN=+ORVP,LRDPF=+$P(@("^"_$P(ORVP,";",2)_"0)"),"^",2)_"^"_$P(ORVP,";",2) D END^LRDPA Q:LRDFN<1
 D GEN,END
 I 'KILL K LRBLOOD,LRDT0,LRPARAM,LRPLASMA,LRSERUM,LRUNKNOW,LRURINE
 K KILL Q
SET ;Initial Set up for CPRS call
 N LRDONT
 S (LRTP,LRPAGE,LREND)=0,LRCW=10,LRDONT=1
 D SET^LRRP4,TESTS^LRGEN2
 Q
SET1 ;Print patient report for CPRS
 I '$D(^DPT(DFN,"LR")) W !,"No Lab Data for: "_$P(^(0),"^") Q
 S LRDFN=$$LRDFN^LR7OR1(DFN) I 'LRDFN W !,"No Lab Data for: "_$P(^DPT(DFN,0),"^") Q
 I '$D(^LR(LRDFN,0)) W !,"No Lab Data for: "_$P(^DPT(DFN,0),"^") Q
 I $D(LRPRETTY),$O(LRTEST(0)) S X=LRTEST($O(LRTEST(0))) I $L(X) D @X Q
 I LRTSTS>18 W !!,"Too many tests!  Will use alternate format.  May show extra tests." S (LREND,LRFOOT,LRSTOP)=0,LRCW=8,LRHF=1,(LRONESPC,LRONETST)="" D GDQ^LRRP2 Q
 S LRWPL=IOSL-(3*LRIX)\LRIX,LRSC=LRIX,LRIDT=LRSDT
 F II=1:1:LRIX S LRIDT(II)=LRIDT
 U IO S LRCW=LRCW-3,LRDPF=$P(^LR(LRDFN,0),U,2),DFN=$P(^(0),U,3),LRY=2 D DT^LRX,PT^LRX
 D HEAD^LRGEN1
 F I=0:0 D NX^LRGEN1 Q:LREND
 Q