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

BLRALBR.m

Go to the documentation of this file.
BLRALBR ;MTK/CR,ALA-List Template for Lab ESIG 
 ;;5.2T9;LR;**1018**;Nov 17, 2004
 ;;5.2;LR;**1013,1015**;Nov 18, 2002
 ;
EN ;
 ;
 I '$D(^BLRALAB(9009027.1,DUZ)) D  Q
 . W !!,"YOU ARE NOT SET UP AS A PARTICIPATING PHYSICIAN FOR THE LAB ELECTRONIC",!
 . W "SIGNATURE MODULE.  PLEASE CONTACT YOUR SITE MANAGER.",!!
 ;
 ;  Sign electronic signature
 W !!,"You have 60 seconds before timeout to enter your electronic"
 W !,"signature for verification!!",!!
 ;
 D SIG^XUSESIG
 I X1="" Q
 ;
 I $P($G(^BLRALAB(9009027.1,DUZ,0)),U,7)="I" D  Q
 . W !!,"     YOU ARE AN INACTIVE PHYSICIAN FOR THE LAB ESIG MODULE.",!
 . W "          PLEASE CONTACT YOUR SITE MANAGER.",!!
 D ^BLRALBL  ; Setup data into ^TMP("BLRA",$J) for list
 S BLRASCR="F" K BLRASUB
 D EN^BLRAL1  ; Call the list template to list labs
 ;
 K BENDT,BLRA0,BLRAAB,BLRABC,BLRACCN,BLRADATA,BLRADT,BLRADTT
 K BLRADUZ,BLRALINE,BLRALNUM,BLRALVAR,BLRANC,BLRAOPH,BLRAP
 K BLRAPD,BLRAPFL,BLRAPIEN,BLRAPNM,BLRAPRG,BLRAQFL,BLRARPHY
 K BLRAS,BLRASCR,BLRASRT,BLRASTA,BLRASTAT,BLRCRC,BLRCRTL
 K BLRIDT,BLRSS,BLRVD,BSTDT,DTOUT
 Q
 ;
REV ; Review Selected Lab Result
 S BLRAQFL=0
 N DIR
 S DIR("A")="Please select a lab result to view, by line #"
 S DIR(0)="L^1:"_VALMCNT D ^DIR K DIR
 I $D(DIRUT) K DIRUT D EXT Q
 I $G(DUOUT)!($G(DTOUT)) D EXT Q
 I $G(Y)<1 D EXT Q
 ;
 ;  Set up scratch global to perform next and previous
 K ^TMP("BLRASEL",$J)
 S CC="" F  S CC=$O(Y(CC)) Q:CC=""  D
 . S BB=Y(CC) F JJ=1:1 S AA=$P(BB,",",JJ) Q:AA=""  D
 .. S ^TMP("BLRASEL",$J,AA,0)=""
 .. I JJ=1 S BLRAFN=AA
 .. S BLRALFN=AA
 ;
 ;  Start with first one
 S BLRAV=0
AGN S BLRAV=$O(^TMP("BLRASEL",$J,BLRAV)) I BLRAV="" D RBLD Q
 I $G(BLRAQFL)=1 S BLRAV=BLRALFN G AGN
 K BLRASUB
 D BLD
 D EN^BLRASP
 D BLD1
 G AGN
 ;
BLD ;S ACC=$E($G(^TMP("BLRALST1",$J,BLRAV,0)),5,18)
 ;D FIX
 ;S ACN=BB
 K BLRAT,BLRADATE,BLRAPT,BLRAFLG
 S (BLRAT,BLRADATE,BLRAPT)="",BLRAFLG=0
 F  S BLRAT=$O(^TMP("BLRA",$J,BLRAT)) Q:BLRAT=""!(BLRAT="ZNODE")  D
 . F  S BLRADATE=$O(^TMP("BLRA",$J,BLRAT,BLRADATE)) Q:BLRADATE=""!(BLRAFLG>0)  D
 .. F  S BLRAPT=$O(^TMP("BLRA",$J,BLRAT,BLRADATE,BLRAPT)) Q:BLRAPT=""!(BLRAFLG>0)  D
 ... ;----- BEGIN IHS MODIFICATIONS LR*5.2*1018
 ... S BLRSS=""
 ... F  S BLRSS=$O(^TMP("BLRA",$J,BLRAT,BLRADATE,BLRAPT,BLRSS)) Q:BLRSS=""!(BLRAFLG>0)  D
 .... ;----- END IHS MODIFICATIONS
 .... I $P($G(^TMP("BLRA",$J,BLRAT,BLRADATE,BLRAPT,BLRSS)),U,7)=BLRAV D
 ..... S ACN=$P($G(^TMP("BLRA",$J,BLRAT,BLRADATE,BLRAPT,BLRSS)),U)
 ..... S BLRAFLG=1
 S BLDATA=$G(^TMP("BLRA",$J,"ZNODE",ACN))
 S LRDFN=$P(BLDATA,U,1),LRSS=$P(BLDATA,U,2),LRIDT=$P(BLDATA,U,3)
 K LRDPF,BLRAT,BLRADATE,BLRAPT,BLRAFLG
 I $E(LRSS,1,2)="CH" D CH^BLRALBD
 I $E(LRSS,1,2)="MI" D MI^BLRALBD
 S VALMCNT=+$G(BLRADSP)
 Q
 ;
BLD1 ;  Set the reviewed flag
 D REVW^BLRALFN1
 ;
 I '$G(BLRASUB) D
 . K ^TMP("BLRALST1",$J)
 . D INIT^BLRAL1
 K BLRASUB
 Q
COTH ; Check Other Provider Results
 ;
 K ^TMP("BLRA",$J)
 S BLRASCR="O"
 D PSUR^BLRALBL
 D EN^BLRAL1
 Q
 ;
CSUB ; Check Subordinate Provider Results
 ;
 K ^TMP("BLRA",$J)
 S BLRASCR="S"
 D CSUP^BLRALBL
 D EN^BLRAL1
 Q
 ;
PATS ;  Patient Sort Display
 K ^TMP("BLRA",$J)
 S BLRASCR="P"
 D PATS^BLRALBL
 D EN^BLRAL1
 Q
 ;
EXT ;exit without update      ;
 S VALMBCK=""
 S EXIT=1
 Q
FIX ;FIX ACC NUMBER
 S LEN=$L(ACC)
FIX1 S AA=$E(ACC,LEN)
 I AA=" " S LEN=LEN-1 G FIX1
 S BB=$E(ACC,1,LEN)
 Q
 ;
NEXT ;  Get the next accession from the list
 S BLRAV=$O(^TMP("BLRASEL",$J,BLRAV)),BLRASUB=1
 I BLRAV="" S VALMSG="No Next Accession",VALMBCK="",BLRAV=BLRALFN D RE^VALM4 Q
 K VALMHDR,LRDPF
 D BLD
 S VALMBG=1
 D RE^VALM4
 Q
 ;
PREV ;  Get the previous accession from the list
 S BLRAV=$O(^TMP("BLRASEL",$J,BLRAV),-1),BLRASUB=1
 I (BLRAV<BLRAFN)!(BLRAV=BLRALFN) S VALMSG="No Previous Accession",VALMBCK="",BLRAV=BLRAFN D RE^VALM4 Q
 K VALMHDR,LRDPF
 D BLD
 S VALMBG=1
 D RE^VALM4
 Q
EXIT D BLD1
 Q
QUT ;  Quit
 S BLRAQFL=1,DTOUT=U
 Q
 ;
RBLD ;  Rebuild list
 K BLRAFN,BLRALFN
 S BLRAPRG=$S(BLRASCR="S":"D CSUP^BLRALBL",BLRASCR="O":"D PSUR^BLRALBL",BLRASCR="P":"D PATS^BLRALBL",1:"D SELF^BLRALBL")
 X BLRAPRG
 I '$G(BLRASUB) D
 . K ^TMP("BLRALST1",$J)
 . D INIT^BLRAL1
 Q