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

LRLISTPS.m

Go to the documentation of this file.
  1. LRLISTPS ;JMC/DALOI Print patient LAB DATA file Summary ;09/16/15 17:12
  1. ;;5.2;LAB SERVICE;**458**;Sep 27, 1994;Build 10
  1. ;
  1. ; ZEXCEPT is used to identify variables which are external to a specific TAG
  1. ; used in conjunction with Eclipse M-editor.
  1. ;
  1. ;
  1. EN ; Print summary report based only on entry in file #63.
  1. ;
  1. N %ZIS,DA,DIC,DIR,DIRUT,DR,DX,IOP,LRDFN,LREDAT,LREDT,LREND,LRIDT,LRIDTE,LRIDTS,LRLONG,LRRAW,LRSDAT,LRSDT,LRSS,POP,X,Y
  1. ;
  1. D EN^LRPARAM
  1. D ^LRDPA Q:LRDFN<1
  1. ;
  1. S DIR(0)="SAO^CH:CHEM, HEM, TOX, RIA, SER, etc.;MI:MICROBIOLOGY;EM:ELECTRON MICROSCOPY;SP:SURGICAL PATHOLOGY;CY:CYTOLOGY;BB:BLOOD BANK"
  1. S DIR("A")="Select LR SUBSCRIPT: ",DIR("B")="CH"
  1. D ^DIR
  1. I $D(DIRUT) Q
  1. S LRSS=Y,LRSS(0)=Y(0)
  1. ;
  1. S (LREND,LRRAW)=0,LRLONG=1
  1. ;
  1. S LRSDT=$$STARTDT()
  1. I 'LRSDT S LREND=1 Q
  1. S LREDT=$$ENDDT(.LRSDT)
  1. I 'LREDT S LREND=1 Q
  1. S LRSDAT=$$FMTE^XLFDT(LRSDT,"1Z"),LREDAT=$$FMTE^XLFDT(LREDT,"1Z")
  1. ;
  1. I LRSS="CH" D Q:$D(DIRUT)
  1. . K DIR
  1. . S DIR(0)="YO",DIR("A")="Display an Extended Listing",DIR("B")="YES"
  1. . S DIR("?")="Extended provides result's demographics and normal ranges."
  1. . D ^DIR
  1. . I $D(DIRUT) Q
  1. . I Y S LRLONG=2
  1. ;
  1. K DIR
  1. S DIR(0)="YO",DIR("A")="Display associated global",DIR("B")="NO"
  1. S DIR("?")="Lists related global entry from file #63 where results are stored."
  1. D ^DIR
  1. I $D(DIRUT) Q
  1. I Y S LRRAW=1
  1. ;
  1. S %ZIS="MQ" D ^%ZIS
  1. I POP D HOME^%ZIS Q
  1. I $D(IO("Q")) D Q
  1. . N ZTDESC,ZTRTN,ZTSAVE,ZTSK
  1. . S ZTRTN="DQP^LLISTPS",ZTSAVE("LR*")="",ZTDESC="Print Lab Patient Summary Report"
  1. . D ^%ZTLOAD,^%ZISC
  1. . D EN^DDIOL("Request "_$S($G(ZTSK):"queued - Task #"_ZTSK,1:"NOT queued"),"","!")
  1. ;
  1. ;
  1. DQP ; Dequeue (TaskMan ) entry point and from above
  1. ;
  1. U IO
  1. I $E(IOST,1,2)'="P-" W @IOF
  1. D HEAD
  1. ;
  1. S DIC="^LR("_LRDFN_","""_LRSS_""","
  1. S (LRIDT,LRIDTE)=9999999-LRSDT,LRIDTS=9999999-LREDT
  1. F S LRIDT=$O(^LR(LRDFN,LRSS,LRIDT)) Q:LRIDT<1!(LRIDT>LRIDTS) D Q:LREND
  1. . S DA=LRIDT,DR="0:9999999"
  1. . K DX W ! D EN^LRDIQ
  1. . I $D(DIRUT) S LREND=1 Q
  1. . S DR="ORU:RF" D EN^LRDIQ
  1. . I $D(DIRUT) S LREND=1 Q
  1. . D WAIT
  1. . I LRRAW=1 D LRRAW(LRDFN,LRSS,LRIDT)
  1. ;
  1. D CLEAN
  1. Q
  1. ;
  1. ;
  1. LRRAW(LRDFN,LRSS,LRIDT) ; Display raw data from LR global.
  1. ;
  1. N LRNODE,LRQUIT,LRROOT
  1. ;
  1. W !!,"Related LAB DATA file (#63) global listing",!
  1. ;
  1. S LRROOT=$NA(^LR(LRDFN,LRSS,LRIDT))
  1. S LRNODE=LRROOT,LRQUIT=0
  1. F S LRNODE=$Q(@LRNODE) Q:LRNODE="" D Q:LRQUIT
  1. . I $QS(LRNODE,1)=LRDFN,$QS(LRNODE,2)=LRSS,$QS(LRNODE,3)=LRIDT W !,LRNODE," = ",@LRNODE
  1. . E S LRQUIT=1
  1. ;
  1. Q
  1. ;
  1. ;
  1. WAIT ; Check if continue display
  1. ;
  1. ;ZEXCEPT: LREND
  1. ;
  1. I '$D(ZTQUEUED),$E(IOST,1,2)="C-" D Q:LREND
  1. . N DIR,DIRUT,DTOUT,DUOUT,X,Y
  1. . S DIR(0)="E" D ^DIR
  1. . I Y'=1 S LREND=1
  1. ;
  1. I ($Y+2)>IOSL D HEAD
  1. Q
  1. ;
  1. ;
  1. ;ZEXCEPT: LREDAT,LRSDAT,LRSS,PNM,SEX,SSN
  1. ;
  1. I $E(IOST,1,2)="P-" W @IOF
  1. W !,"Patient Summary Report",?25,"WORK COPY ONLY - DO NOT FILE",?58,"Printed: ",$$FMTE^XLFDT(DT,"1Z")
  1. W !,PNM,?30,SSN,?45," Sex: ",SEX
  1. W !," For date range: "_LREDAT_" to "_LRSDAT_" for "_LRSS(0)
  1. Q
  1. ;
  1. ;
  1. CLEAN ; Clean up and quit
  1. I $E(IOST,1,2)'="C-" W @IOF
  1. I '$D(ZTQUEUED) D ^%ZISC
  1. E S ZTREQ="@"
  1. ;
  1. D KVA^VADPT
  1. Q
  1. ;
  1. ;
  1. STARTDT() ; Prompt for start date/time
  1. ;
  1. N LRSDT
  1. ;
  1. S LRSDT=$$DATE("Enter START date: ","TODAY","AET")
  1. Q LRSDT
  1. ;
  1. ;
  1. ENDDT(LRSDT) ; Prompt for end date/time
  1. ;
  1. ; LRSDT - Start Date/Time (Passed by reference)
  1. ;
  1. N LREDT,X
  1. ;
  1. S LREDT=$$DATE("Enter END date: ","T-1","AET")
  1. I 'LREDT Q 0
  1. ;
  1. I $G(LRSDT)="" Q
  1. ;
  1. I LREDT>LRSDT D
  1. . S X=LREDT
  1. . S LREDT=LRSDT
  1. . S LRSDT=X
  1. ;
  1. I '$P(LRSDT,".",2) S LRSDT=LRSDT+.24
  1. ;
  1. Q LREDT
  1. ;
  1. ;
  1. DATE(LRPROMPT,LRDEFAULT,LRFLAGS) ;
  1. ;
  1. N %DT,DTOUT,X,Y
  1. ;
  1. S %DT("A")=LRPROMPT
  1. S %DT("B")=LRDEFAULT
  1. S %DT=LRFLAGS
  1. D ^%DT
  1. I Y<0 Q 0
  1. Q Y