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

LRHYAFT.m

Go to the documentation of this file.
LRHYAFT ;DALOI/HOAK - HOWDY MAIN DRIVER WITH PPOC ADDON ;08/28/2005  ;12/13/10 11:19am
 ;;5.2;LAB SERVICE;**405,417,435**;Sep 27, 1994;Build 1
 ;
 ; TAKEN FROM LRHY0
PICK ;
 ;  pick the site from Howdy Site
 S LREND=0
 S DIC(0)="AEMQZ"
 S DIC=69.86
 D ^DIC
 I Y=-1 S LREND=1 QUIT
 S LRHYSITE=+Y
 K DIC
 ;
 ;
 ; Pick a printer
 I LRHYSITE=$O(^LRHY(69.86,"B","ALTERNATIVE",0)) ;QUIT
 S LRDEV=0
 K DIC
 S DIC(0)="EMQZ" K Y S LRHYCT2=1
 F  S LRDEV=$O(^LRHY(69.86,LRHYSITE,10,"B",LRDEV)) Q:+LRDEV'>0  D
 .  W !,LRHYCT2,". ",$P(^%ZIS(1,LRDEV,0),U)
 .  S LRX(LRHYCT2)=LRDEV S LRHYCT2=LRHYCT2+1
CHOOO W !,"Choose a label printer: " R X:DTIME W !
 I U[X S LREND=1 QUIT
 I 'X I $G(X)'="" W !,"enter the number please" G CHOOO
 S LRDEV=LRX(X)
 W ?11,$P(^%ZIS(1,LRDEV,0),U) H 2
 K DIC
 K LRHYCT2
 ;
 QUIT
 ;
VET ; Primary API for Howdy!  Called by [LRHY PATIENT CARD SCAN (PPOC)] option.
 K XX,LRAAX5,LRADX6,LRAN6,LRINFW,LRPREF,LRTOP,LR3UIDM,LRXL,ZTSAVE,ZTIO,ZTDTH,ZTDESC,ZTRTN
 K LR3CNT S LR3CNT=0
 S LR3CNT=1
 N LRDFN,PNM,LRSN,SSN,LRIDT,LRAA,LRAN,LRAD
 D KILL^%ZISS
 K LRSCAN
 K LRNOW,LRXCNT
 N LRNPZZX,LRNODUP,LRLLOC,LRTSTZ99,LRACC,LRCDT,LRDPF,LRI
 N LRORD3,LRHYFIX,LRPLICK,LRPR,LRPRAC,LRQUIET,LRRB,LRSAMP,LRSND
 N LRSS,LRST,LRSTATUS,LRSUB1,LRTIC,LRTIM,LRTN,LRTREA,LRTS,LRTSORU
 N LRTST6,LRTT,LRUN,LRWLO,LRWLC,LRWRD,LRXYZ,LR3DTIME,LR3DTN
 N LR3SN,LRDT0,LREAL,LRFUTURE,LRGOTIT,LRHOWDY,LRHYHOK,LRIENZZ
 N LRNOTST,LRLBLBP,LRLLOC66,LRMAX2,LRNLT,LRNODUP,LRNONE,LRNPZZX,LRODT
 N LRODT0,LRHYOK,LRORD24,LRORU3,LRPAST,LRPIX,LRAHEAD,LRCHK,LRHYCT,LRCOL99
 N LRDT0,LRDUPT,LRHT1,LRIX,LROLLOC,LRX,LR3X
 ;
VET1 ; Code below executes to handle Patient episode.
 K DIC
 I $G(LRHYSITE)="" S DIC=69.86,DIC(0)="AEMQZ" D ^DIC Q:'Y  S LRHYSITE=+Y
 I LRHYSITE=-1 W !,"No Howdy site selected. Goodbye. " K LRHYSITE,LRDEV,LRLABLIO QUIT
 ; Then, Howdy waits here for next Patient
 I $G(LRDEV)'="" G V2
 S DIC("A")="WHICH LABEL PRINTER:"
 S DIC="^%ZIS(2,"
 S DIC(0)="AEMQZ"
 S DIC=3.2
 S DIC="^%ZIS(1,"
 S DIC(0)="AEMQZN"
 I '$G(LRDEV) D ^DIC Q:+Y=0  S LRDEV=+Y S LRLABLIO=LRDEV
 I Y=-1 W !,"No device selected. Goodbye. " K LRLABLIO,LRDEV,LRHYSITE QUIT
 D ^LRHYBL1
 I $G(LRLABSTP)'="" S LRLABLIO=LRLABLIO_";"_LRLABSTP
 I '$G(LRDEV) D PICK Q:LREND
V2 ;
 ;
 K LRDFN,PNM,LRSN,SSN,LRIDT,LRAA,LRAN,LRAD
 D ^LRPARAM ; Set Howdy up as Lab user
 S LRHOWDY=1
 S LRHYCT=$G(LRHYCT,0)
 ;
 S LRODT=DT
 W @IOF
 K X
 ; 
 W !!,"Please swipe PATIENT ID CARD or Type SSN: "
 ; %ZOSF("EOFF") = U $I:NOECHO
 ; %ZOSF("EON") = U $I:ECHO
 R X:9999999 W !
 I X=U D SCROLOFF^LRHYBC9 QUIT
 ; Code is set to read all types of VIC card as of 9/05/2005
 ;I $E(X,1,9)["-" D
 ;.  S X=$P(X,"-")_$P(X,"-",2)_$P(X,"-",3)
 ;I $E(X,1,1)'=0 I '$E(X,1,1) S X=$E(X,2,10)
 ;I $L(X)>10 S X=$E(X,2,10)
 ;I $L(X)'=9 S LR3CNT=LR3CNT+1
 ;I $L(X)'=9 W !,"Didn't read that Partner. " W:LRHYCT'=2 "Try again." H 2 S LRHYCT=LRHYCT+1 G VET1
NSCN ;
 K DFN,LRDFN,LRDPA,LRDPF,PNM,LRHYCT
 ; 
 ;S DFN=$O(^DPT("SSN",X,0))
 ;
 ; NEW CODE FOR VHIC 4.0
 D RPCVIC^DPTLK(.DFN,X)
 I DFN<1 W !,"No record for this person." R X:15 G VET
 S LRDFN=$G(^DPT(DFN,"LR"))
 ;
 I LRDFN D PT^LRX
 I 'LRDFN W !,"No Lab Data Available... Please check with clerk at the Desk." H 5 D LOG K X G VET
 K ^TMP("LRHYDY",$J,"LRHYDY",$J,LRDFN)
 ;
 ; this call checks order against the 69.86
 W !,"I'M DOING THE BEST I CAN"
 ; HERE IS WHERE WE PRINT LABELS ACCESSIONED EARLIER 2/25/2009 DRH
PX ;
 N LRX,LRY
 I 'LRDFN S LRDFN=^DPT(DFN,"LR")
 W @IOF
 W !,PNM,?40,SSN,"   ",$$Y2K^LRX(DOB)
 S LRADD=$G(^DPT(DFN,.11))
 I LRADD'="" W !,$P(LRADD,U),?35," ",$P(LRADD,U,4)," ",$P(^DIC(5,$P(LRADD,U,5),0),U)
 S LRPHONE=$P($G(^DPT(DFN,.121)),U,10) I $G(LRPHONE) W " Ph#:",$G(LRPHONE)
 H 3
 S DIR("B")="NO",DIR(0)="Y",DIR("A")="PT CONFIRMATION PROMPT. Is this the correct Patient?"
 D ^DIR
 I Y[U D SCROLOFF^LRHYBC9 W @IOF QUIT
 I $G(Y(0))'="YES" W !!,"PT CONFIRMATION FAILED..." H 3 QUIT
 S LR3UID=""
 W @IOF
 D ENS^%ZISS
 W *27,*91,*109 W *27,*91,45,*109
 W IODHLT," ",PNM
 W !
 W IODHLB," ",PNM
 W !
 W !
 W IODHLT," ",SSN
 W !
 W IODHLB," ",SSN
 W *27,"[",40,";",37,"m",!
 W !
 W ! D LRGLIN^LRX W !
 S LRX=0
 S CNT=0
 K LRLABTIM S LRLABTIM=$O(^XTMP("LRHY LABELS",LRDFN,DT))
 I $G(LRLABTIM)="" W !,"NOTHING TO PRINT ON ",PNM H 2 QUIT
 D LRBOX^LRHYLRX(60,6,5,15," ")
 F  S LR3UID=$O(^XTMP("LRHY LABELS",LRDFN,LRLABTIM,LR3UID)) Q:LR3UID=""  D
 .  I $L(LR3UID)<10 W !,"UID < 10 CHRS. ACCESSION MANUALLY" H 2 QUIT
 .  K LRLABNO S LRLABNOD=$G(^XTMP("LRHY LABELS",LRDFN,LRLABTIM,LR3UID))
 .  S LRY=0
 .  S LRX=$O(^LRO(68,"C",LR3UID,0))
 .  I '$G(LRX) D MICRO
 .  Q:'$G(LRX)
 .  S LRY1=$O(^LRO(68,"C",LR3UID,LRX,0))
 .  S LRY=$O(^LRO(68,"C",LR3UID,LRX,LRY1,LRY))
 .  D
 ..  S LRLBL(LRX,LRY)=LRLABNOD
 ..  S CNT=CNT+1 S LABCNT(CNT)=LRLBL(LRX,LRY)
 ..  S LRXCNT(CNT)=LRX_U_LRY
 ..  S X=62,Y=5
 ..  S LRAD=$G(LRY1)
 ..  W !,CNT,") ",$P(LRLBL(LRX,LRY),U,6)
 ..  I '$G(LRAD) S LRAD=DT
 ..  W ?21,$P(^LAB(62,$P(^LRO(68,LRX,1,LRAD,1,LRY,5,1,0),U,2),0),U,3)
 S LRX=0
 S LRX=0
 S DY=5
 S DY=6
 F  S LRX=$O(LRLBL(LRX)) Q:+LRX'>0  S DX=62,LRC=$O(LRLBL(LRX,0)),LRAD=$P(LRLBL(LRX,LRC),U,2),DY=DY+1 X IOXY K LR3UID S LR3UID=$G(^LRO(68,LRX,1,LRAD,1,LRC,.3)) W LR3UID
 ;
 W !!
 W !! H 4
 D ENS^%ZISS S IOTM=16,IOBM=23
 ;
 W @IOSTBM
 W !!
 H 3
 W !
 S DX=0,DY=13 X IOXY
 S DX=0,DY=17 X IOXY
 W !!," Proceed with COLLECTION:" W *7
 W !!
 W !,"Select specimen(s) you actually collected to print corresponding labels:"
SL ;
 R LRS:DTIME W ! I LRS["-" G QQQ
QQQ ;
 F I=1:1:10 Q:+$P(LRS,",",I)'>0  S LRS3333=+$P(LRS,",",I) I '$D(LABCNT(LRS3333)) W !,"OUT OF RANGE" H 3 G PX
 K LRLBL
 I LRS["?" W !,"You may enter 1 OR 2 OR 1,2,3,etc NO DASHES(-) PLEASE " H 4 G PX
 I LRS["," F LRXX=1:1:CNT S I=$P(LRS,",",LRXX) Q:+I'>0  S LRX=$P(LRXCNT(I),U),LRY=$P(LRXCNT(I),U,2) D
 .  S LRAD=DT
 .  I $P(^LRO(68,LRX,0),U,3)="Y" S LRAD=$E(DT,1,3)_"0000"
 .  I $P(^LRO(68,LRX,0),U,3)="M" S LRAD=$E(DT,1,5)_"00"
 .  W !,"Sending to print: ",$P($G(^LRO(68,LRX,1,LRAD,1,LRY,.3)),U),"  ",$P(^LAB(62,$P(^LRO(68,LRX,1,LRAD,1,LRY,5,1,0),U,2),0),U,3)
 .  S LRORD=$G(^LRO(68,LRX,1,LRAD,1,LRY,.1))
 .  I $P($G(LRXCNT(I)),U,2)="" QUIT
 .  S LRLBL(LRX,$P(LRXCNT(I),U,2))=LABCNT(I)_$G(LRORD)
 .  S LR3UID=$P($G(^LRO(68,LRX,1,LRAD,1,LRY,.3)),U)
 .  D BCE^LRHYPH0
 .  K ^XTMP("LRHY LABELS",LRDFN,LRLABTIM,LR3UID)
 I LRS["-" W !,"DASHES ARE NOT PERMITTED. ENTER 1,2,3 ETC" H 1 G PX
 I $G(LRXCNT(+LRS))="" W !,"OUT OF RANGE. TRY AGAIN" H 2 G PX
 E  I $L(LRS)=1 I $G(LRXCNT(LRS))'="" S I=LRS Q:+I'>0  S LRX=$P(LRXCNT(I),U),LRY=$P(LRXCNT(I),U,2) D
 .  S LRAD=DT
 .  I $P(^LRO(68,LRX,0),U,3)="M" S LRAD=$E(DT,1,5)_"00"
 .  I $P(^LRO(68,LRX,0),U,3)="Y" S LRAD=$E(DT,1,3)_"0000"
 .  W !,"Sending to print: ",$P($G(^LRO(68,LRX,1,LRAD,1,LRY,.3)),U),"  ",$P(^LAB(62,$P(^LRO(68,LRX,1,LRAD,1,LRY,5,1,0),U,2),0),U,3)
 .  S LR3UID=$P($G(^LRO(68,LRX,1,LRAD,1,LRY,.3)),U)
 .  S LRORD=$G(^LRO(68,LRX,1,LRAD,1,LRY,.1))
 .  S LRLBL(LRX,$P(LRXCNT(LRS),U,2))=LABCNT(LRS)_$G(LRORD)
 .  W !,"REMOVING ",LR3UID H 2
 .  D BCE^LRHYPH0
 .  S LRSCAN=$G(LRLABTIM)
 .  K ^XTMP("LRHY LABELS",LRDFN,LRLABTIM,LR3UID)
 H 4
 I '$D(^XTMP("LRHY LABELS",LRDFN,LRLABTIM)) G VIE
 K DIR
 S DIR("A")="What shall we do with these?"
 ;
 S DIR(0)="S^1:Delete;C:Collect;"
 S DIR("B")="Delete"
 D ^DIR Q:X[U
 I Y="C" G PX
 I Y=1 D DEL7 W !,"Use Lab option > Accessioning Menu: Delete test from an accession [LRTSTOUT]" H 2
 ;
VIE ;
 D CONTROL^LRHYBC1
 H 3 W @IOF
 D SCROLOFF^LRHYBC9
 QUIT
MICRO ;
 S LRACNODE=^XTMP("LRHY LABELS",LRDFN,LRLABTIM,LR3UID)
 S LRACCXX=$P(LRACNODE,U,6)
 S LR68=$P(LRACCXX," ") S LRAA=$O(^LRO(68,"B",LR68,0))
 S LRAN=$P(LRACCXX," ",3)
 S LRAD=$P(LRACNODE,U,2)
 S LR3UIDM=$G(^LRO(68,LRAA,1,LRAD,1,LRAN,.3))
 S LRX=$O(^LRO(68,"C",LR3UID,0))
 QUIT
 ;
PRT1 ;
 ;
 W @IOF
 D SCRNON^LRHYUTL
 K PNMALL S PNMALL="Howdy "_$P(PNM,",",2)_" "_$P(PNM,",")
 W !
 W IODHLT,"     ",PNMALL
 W !
 W IODHLB,"     ",PNMALL
 W !
 W !,$$CJ^XLFSTR($G(^LRHY(69.86,LRHYSITE,40)),IOM)
 W !,$$CJ^XLFSTR($G(^LRHY(69.86,LRHYSITE,44)),IOM)
 W !
 W IODHLT,"    Orders for date: "_$$Y2K^LRX(DT)
 W !
 W IODHLB,"    Orders for date: "_$$Y2K^LRX(DT)
 W !
 S LRXYZ=0
 W *7 H 1 W *7 H 1 W *7
 ;
 H 5
QUITH ; 
 D SCRNOFF^LRHYUTL ; Turn off screen variables
 K LRDFN,PNM,LRSN,SSN,LRIDT,LRAA,LRAN,LRAD,LRHYCT
 K LRNPZZX,LRNODUP,LRLLOC,LRTSTZ99,LRACC,LRCDT,LRDPF,LRI
 K LRORD3,LRHYFIX,LRPLICK,LRPR,LRPRAC,LRQUIET,LRRB,LRSAMP,LRSND
 K LRSS,LRST,LRSTATUS,LRSUB1,LRTIC,LRTIM,LRTN,LRTREA,LRTS,LRTSORU
 K LRTST6,LRTT,LRUN,LRWLO,LRWLC,LRWRD,LRXYZ,LR3DTIME,LR3DTN
 K LR3SN,LRDT0,LREAL,LRFUTURE,LRGOTIT,LRHOWDY,LRHYHOK,LRIENZZ
 K LRNOTST,LRLBLBP,LRLLOC66,LRMAX2,LRNLT,LRNODUP,LRNONE,LRNPZZX,LRODT
 K LRODT0,LRHYOK,LRORD24,LRORU3,LRPAST,LRPIX,LRAHEAD,LRCHK,LRHYCT,LRCOL99
 K LRDT0,LRDUPT,LRHT1,LRIX,LROLLOC,LRX,LR3X
 K VAIN
 ;
 ;
 G VET
 ;
 ;
 ;
ORDCHK ; This block to be used for future version
 QUIT
LOG ; Howdy will default to the clerks judgement when multiple orders found.
 Q:$G(LRSKIPNO)
 ;
 W !,"NO ORDERS"
 ;
 K LRDPF,PNM
 D PT^LRX
 D NOW^%DTC
 I '$G(LRDFN) S ^TMP("LRHYDY",$J,"LR NO ORDERS",%)=$G(DFN) QUIT
 S ^TMP("LRHYDY",$J,"LR NO ORDERS",%)=$G(PNM)_U_$G(^LR(LRDFN,.1))_U_$G(SSN)
 QUIT
 ;
 ;
LOG1 ; Howdy will default to the clerks judgement when multiple orders found.
 K LRORD
 W !,"MULTIPLE ORDERS"
 K LRDPF,PNM
 D PT^LRX
 D NOW^%DTC
 S ^TMP("LRHYDY",$J,"LR MULTIPLE ORDERS",%)=$G(PNM)_U_$G(^LR(LRDFN,.1))_U_$G(SSN)
 K LRSKIPNO S LRSKIPNO=1
 QUIT
ORDERS ;
 QUIT
NOSCAN ;
 QUIT
DEL7 ;
 QUIT