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

LRMIPSZ.m

Go to the documentation of this file.
LRMIPSZ ;DALIO/STAFF - MICRO PRINT/SINGLE SPECIMEN REPORT ;08/26/10  14:16
 ;;5.2;LAB SERVICE;**104,350**;Sep 27, 1994;Build 230
 ;
 ;from option LRMIPSZ
BEGIN ;
 N LRACC
 S LRACC=""
 D EN^LRPARAM
 W !!?23,"MICROBIOLOGY SINGLE SPECIMEN REPORT"
 S LREND=0,LRNL=1,LRPG=0
 D CHOOSE
 ;
END ;
 K ^TMP("LR",$J)
 K %,AGE,DFN,DIC,DOB,I,J,K,PNM,SSN,X,Y
 K LRAA,LRACC,LRAD,LRAN,LRANOK,LRCMNT,LRCNT,LRDFN,LRDPF,LREND,LREP,LRIDT,LRLIDT,LRLLT,LRNL,LRONESPC,LRONETST,LRPG,LRPRAC,LRRB,LRSB,LRSMP,LRSTOP,LRUID
 Q
 ;
 ;
CHOOSE ; Choose the method of selecting the report to print.
 N DIR,DIROUT,DIRUT,DTOUT,DUOUT,X,Y
 S DIR(0)="SO^1:Accession Number or UID;2:Name/SSN"
 S DIR("A")="Look-up by"
 S DIR("B")=1
 D ^DIR
 I $D(DIRUT) Q
 S LREP=+Y
 F  K LRAN,DIC D @$S(LREP=1:"ACC",1:"PAT") Q:LREND  I LRANOK S ZTRTN="DQ^LRMIPSZ",%ZIS="MQ" D IO^LRWU Q:LREND
 Q
 ;
 ;
DQ ;dequeued
 S:$D(ZTQUEUED) ZTREQ="@" U IO
 S LRONETST="",LRONESPC="" D EN^LRMIPSZ1 K LRONETST,LRONESPC
 Q
 ;
 ;
ACC ; Lookup by accession number/UID
 ;
 D ENA^LRWU4("MI")
 I LRAN<1 S LREND=1 Q
 S LRANOK=1,LRPG=0 D ACC1
 Q
 ;
 ;
ACC1 ;
 S LRDFN=+^LRO(68,LRAA,1,LRAD,1,LRAN,0),LRIDT=$P(^(3),U,5)
 S LRLLT=^LR(LRDFN,"MI",LRIDT,0),LRACC=$P(LRLLT,U,6),LRCMNT=$G(^LR(LRDFN,"MI",LRIDT,99))
 S LRDPF=$P(^LR(LRDFN,0),U,2),DFN=$P(^(0),U,3)
 D PT^LRX
 W !?20,PNM,?40,SSN
 F  W !,?20,"OK" S %=1 D YN^DICN Q:%  W !,"Answer 'Y'es or 'N'o"
 S:%=-1 LREND=1 S:%=2 LRANOK=0
 Q
 ;
 ;
 ;
PAT ;
 S LRANOK=1
 D ^LRDPA
 I LRDFN=-1 S LREND=1,LRANOK=0 Q
 D PAST
 I '$D(LRLLT) S LREND=1,LRANOK=0 Q
 S LRAN=^LR(LRDFN,"MI",LRIDT,0),LRACC=$P(LRAN,U,6),LRAD=$E(LRAN)_$P(LRACC," ",2)_"0000",LRAN=+$P(LRACC," ",3)
 S X=$P(LRACC," "),DIC=68,DIC(0)="M"
 D ^DIC
 I Y<1 S LREND=1,LRANOK=0 Q
 S LRAA=+Y
 Q
 ;
 ;
PAST ;
 W ! K LRAN
 S (LRSTOP,LRIDT)=0 F LRCNT=1:1 S LRIDT=+$O(^LR(LRDFN,"MI",LRIDT)) Q:LRIDT<1  D:'(LRCNT#5) WAIT Q:LRSTOP  D PAST1
 I LRCNT=1 W !,"Nothing accessioned" K LRLLT Q
 S:LRCNT=2 LRIDT=LRLIDT I LRCNT'=2 D SELECT Q:X=""!(X[U)
 S LRLLT=^LR(LRDFN,"MI",LRIDT,0),LRCMNT=$S($D(^(99)):^(99),1:"")
 Q
 ;
 ;
WAIT ;
 R !,"PRESS '^' TO STOP ",X:DTIME S:X="" X=1 S LRSTOP=".^"[X
 Q
 ;
 ;
PAST1 ;
 S LRAN=$P(^LR(LRDFN,"MI",LRIDT,0),U,6),LRAN(LRCNT)=LRIDT,LRLIDT=LRIDT
 W !?13,LRCNT S Y=$P(^(0),U),LRSMP=$P(^(0),U,5)
 D D^LRU W ?20,Y,"  "
 W:LRSMP ?41,$P(^LAB(61,LRSMP,0),U),?60,"Acc ",LRAN
 Q
 ;
 ;
SELECT ;
 K LRLLT S LRSTOP=0
 F  R !!,"Select #: ",X:DTIME Q:X=""!(X[U)  Q:$D(LRAN(X))  W !,"Doesn't exist."
 I X'="",X'[U S LRIDT=LRAN(X)
 Q