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

BLRF60SR.m

Go to the documentation of this file.
BLRF60SR ; IHS/MSC/MKK - File 60 line item SeaRch; 18-Apr-2016 12:02 ; MKK
 ;;5.2;IHS LABORATORY;**1039**;NOV 01, 1997;Build 38
 ;
EEP ; Ersatz EP
 D EEP^BLRGMENU
 Q
 ;
EP ; EP
PEP ; EP
 NEW (DILOCKTM,DISYS,DT,DTIME,DUZ,IO,IOBS,IOF,IOM,ION,IOS,IOSL,IOST,IOT,IOXY,U,XPARSYS,XQXFLG)
 ;
 Q:$$GETINIT()="Q"
 ;
 F  S F60IEN=$O(^LAB(60,F60IEN))  Q:F60IEN<1!(QFLG="Q")  D SEARCH(SRCHSTR,F60IEN,.F60CNT,.CNT)
 ;
 W !!,?4,F60CNT," File 60 entries analyzed."
 W !!,?9,$S(CNT:CNT,1:"No")," File 60 entr",$S(CNT=1:"y",1:"ies")," matched."
 ;
 D ^%ZISC
 ;
 D PRESSKEY^BLRGMENU
 Q
 ;
GETINIT() ; EP - Initialization
 D SETBLRVS
 ;
 S HEADER(1)="File 60 Line Item Search"
 ;
 D HEADERDT^BLRGMENU
 D ^XBFMK
 S DIR(0)="FO"
 S DIR("A")="Search String"
 D ^DIR
 I +$G(DIRUT)!(+$L(Y)<1)  Q $$BADSTUFQ^BLRUTIL7("No/Invalid Search string.")
 ;
 S SRCHSTR=$$UP^XLFSTR($G(X))
 I $L(SRCHSTR)<51 S HEADER(2)="Search String:"_SRCHSTR,NEXTLINE=3
 E  S HEADER(2)="Search String",HEADER(3)=$$CJ^XLFSTR(SCRCHSTR),NEXTLINE=4
 ;
 D HEADERDT^BLRGMENU
 D ^%ZIS
 U IO
 ;
 S HEADER(NEXTLINE)=" ",NEXTLINE=NEXTLINE+1
 S $E(HEADER(NEXTLINE),15)="Panel"
 S $E(HEADER(NEXTLINE),21)="Type"
 S $E(HEADER(NEXTLINE),31)="Description"
 S $E(HEADER(NEXTLINE),70)="LOINC"
 S MAXLINES=IOSL-4,LINES=MAXLINES+10
 S (CNT,F60CNT,PG)=0
 S QFLG="NO"
 S F60IEN=.9999999
 Q "OK"
 ;
 ;
 S F60CNT=F60CNT+1
 S GLOVAR="^LAB(60,"_F60IEN_")"
 S FRSTPART=$P(GLOVAR,")")
 S STR1=$Q(@GLOVAR@(""))
 S FOUNDIT=0
 I $$UP^XLFSTR(STR1)[SRCHSTR D FOUNDIT(F60IEN,.FOUNDIT,.CNT)  Q
 I $$UP^XLFSTR(@(STR1))[SRCHSTR D FOUNDIT(F60IEN,.FOUNDIT,.CNT)  Q
 ;
 S FOUNDIT=0
 F  S STR1=$Q(@STR1)  Q:STR1=""!(STR1'[FRSTPART)!(QFLG="Q")!(FOUNDIT)  D
 . I $$UP^XLFSTR(STR1)[SRCHSTR D FOUNDIT(F60IEN,.FOUNDIT,.CNT)
 . I $$UP^XLFSTR(@(STR1))[SRCHSTR D FOUNDIT(F60IEN,.FOUNDIT,.CNT)  Q
 ;
 Q:FOUNDIT
 ;
 ; If a Cosmic test, search Atomic tests' names as well
 Q:$$ISPANEL^BLRPOC(F60IEN)<1
 ;
 NEW F602IEN,F602DESC,F60PANEL
 S F60PANEL=0
 F  S F60PANEL=$O(^LAB(60,F60IEN,2,F60PANEL))  Q:F60PANEL<1!(FOUNDIT)  D
 . S F60IEN2=$$GET1^DIQ(60.02,F60PANEL_","_F60IEN,.01,"I")
 . S F602DESC=$$GET1^DIQ(60.02,F60PANEL_","_F60IEN,.01)
 . I $$UP^XLFSTR(F602DESC)[SRCHSTR D FOUNDIT(F60IEN,.FOUNDIT,.CNT)
 Q
 ;
FOUNDIT(F60IEN,FOUNDIT,CNT) ; EP - Write out the entry
 I LINES>MAXLINES D HEADERPG^BLRGMENU(.PG,.QFLG,"NO")  Q:QFLG="Q"
 ;
 W ?4,F60IEN
 W ?14,$S($$ISPANEL^BLRPOC(F60IEN):"YES",1:"")
 W ?20,$$TRIM^XLFSTR($P($$GET1^DIQ(60,F60IEN,3),"("),"LR"," ")
 W ?29,$E($$GET1^DIQ(60,F60IEN,.01),1,38)
 W ?69,$$GET1^DIQ(60.01,+$O(^LAB(60,F60IEN,1,0))_","_F60IEN,95.3)
 W !
 S LINES=LINES+1
 S FOUNDIT=FOUNDIT+1
 S CNT=CNT+1
 Q
 ;
SETBLRVS(TWO) ; EP - Set the BLRVERN variable(s)
 S BLRVERN=$TR($P($T(+1),";")," ")
 S:$G(TWO)'="" BLRVERN2=TWO
 Q