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

BLRCCPED.m

Go to the documentation of this file.
BLRCCPED ; IHS/MSC/MKK - CC Parameter EDit  ; 22-Oct-2013 09:22 ; MKK
 ;;5.2;IHS LABORATORY;**1033**;NOV 01, 1997
 ;
EEP ; Ersatz EP
 D EEP^BLRGMENU
 Q
 ;
PEP ; EP
CHANGE ; EP
 NEW (DILOCKTM,DISYS,DT,DTIME,DUZ,IO,IOBS,IOF,IOM,ION,IOS,IOSL,IOST,IOT,IOXY,U,XPARSYS,XQXFLG)
 ;
 S HEADER(1)="IHS Laboratory"
 S HEADER(2)="BLR CC DATA Parameter"
 S HEADER(3)=$$CJ^XLFSTR("Modify Value",IOM)
 ;
 S RESULT=$$GET^XPAR("PKG","BLR CC DATA",1,"Q")
 S RESULT=$S(RESULT:"YES",RESULT=0:"NO",1:"")
 ;
 D HEADERDT^BLRGMENU
 ;
 D ^XBFMK
 S DIR(0)="YO"
 S DIR("A")="BLR CC DATA (YES/NO)"
 S:$L(RESULT) DIR("B")=RESULT
 D ^DIR
 ;
 I +$G(DIRUT)!($G(Y)="") D  Q
 . W !!,?4,"Invalid/No Entry/Quit. Routine Ends."
 . D PRESSKEY^BLRGMENU(9)
 ;
 S ANSWER=$S($E(X)="Y":"YES",1:"NO")
 ;
 D EN^XPAR("PKG","BLR CC DATA",,ANSWER,.ERRS)
 ;
 D:+$G(ERRS)>0 RPTERR(ERRS)
 ;
 Q
 ;
RPTERR(ERROR) ; EP
 NEW ERRDESC,ERRNUM,NOWH
 ;
 S ERRNUM=$P(ERROR,"^")
 S ERRDESC=$P(ERROR,"^",2)
 ;
 W !!,"*** ERROR Modifying BLR CC DATA paramter. ***",!!
 W ?4,"Error Number:",ERRNUM,!
 W:$L(ERRDESC)<50 ?9,"Description:",ERRDESC
 I $L(ERRDESC)>49 D LINEWRAP^BLRGMENU(9,ERRDESC,60)
 W !
 ;
 D PRESSKEY^BLRGMENU(9)
 ;
 S NOWH=$H
 S:$D(^XTMP("BLRCCPED"))<1 XTMP("BLRCCPED")="^"_$$DT^XLFDT_"^Errors Modifying BLR CC DATA Parameter"
 S $P(^XTMP("BLRCCPED"),"^")=$$HTFM^XLFDT(+$H+30)
 ;
 M ^XTMP("BLRCCPED",NOWH,"01","DUZ")=DUZ
 S ^XTMP("BLRCCPED",NOWH,"02","ERROR")=ERROR
 ;
 Q
 ;
GETCCDTO(LRODT,LRSP,LRTST) ; EP - Get CC Data; called from LROW2A
 NEW LRAA,LRAD,LRAN,LRDFN,LRSS,LRIDT
 ;
 S STR=$G(^LRO(69,LRODT,1,LRSP,2,LRTST,0))
 S LRAA=+$P(STR,"^",4)  Q:$L(LRAA)<1
 ;
 S LRSS=$$GET1^DIQ(68,LRAA,.02,"I")
 Q:$L(LRSS)<1
 ;
 S LRAD=+$P(STR,"^",3),LRAN=+$P(STR,"^",5)
 S LRDFN=+$G(^LRO(68,LRAA,1,LRAD,1,LRAN,0)),LRIDT=+$P($G(^(3)),"^",5)
 Q:LRDFN<1!(LRIDT<1)
 ;
 D GETCCDTA(LRDFN,LRSS,LRIDT)
 Q
 ;
GETCCDTA(LRDFN,LRSS,LRIDT) ; EP - Get CC Data; Called from LRVER4
 NEW CCIEN,CCNAME,CCSTR,FDA,ERRS,HEADER,IENS,RESULT,WOTSUBF
 ;
 ;
 ; S HEADER(1)="IHS Laboratory"
 ; S HEADER(2)="BLR CC DATA Parameter"
 ;
 S RESULT=+$$GET^XPAR("PKG","BLR CC DATA",1,"Q")
 Q:'RESULT
 ;
 D ^XBFMK
 S DIR(0)="YO"
 ; S DIR("A")="CC Patient's Accession Data"
 S DIR("A")="CC Patient Results"
 S DIR("B")="NO"
 D ^DIR
 Q:+$D(DIRUT)!(+$G(Y)<1)
 ;
 W !!
 ;
 D ^XBFMK
 S DIR(0)="PO^200:E"
 S DIR("A")="Provider to CC"
 D ^DIR
 I +$D(DIRUT)!($G(X)="") D
 . W !,?4,"Invalid/No/Quit Input.  Routine Ends."
 . D PRESSKEY^BLRGMENU(9)
 ;
 S CCIEN=+Y,CCNAME=$P(Y,"^",2)
 S CCSTR=CCNAME_"!"_CCIEN_"!"_DUZ_"!"_$$NOW^XLFDT
 ;
 ; Set Sub-File Number
 S WOTSUBF=$S(LRSS="CH":63.04,LRSS="MI":63.05)
 ;
 S IENS=","_LRIDT_","_LRDFN_","
 S FDA(WOTSUBF,IENS,9999992)=CCSTR
 D UPDATE^DIE("S","FDA",,"ERRS")
 ;
 Q
 ;
YEXPORTD(LRDFN,LRSS,LRIDT) ; EP - Put YES into EXPORTED DATA field in file 63
 NEW ERRS,FDA,IENS
 ;
 S IENS=LRIDT_","_LRDFN_","
 ;
 ; Set Sub-File Number
 S WOTSUBF=$S(LRSS="CH":63.04,LRSS="MI":63.05)
 ;
 S FDA(WOTSUBF,IENS,"EXPORTED DATA")="Y"
 D UPDATE^DIE("S","FDA",,"ERRS")
 Q
 ;
AYEXPORT(LRAS) ; EP - Given an accession number, call YEXPORTD
 NEW IENS,LRAA,LRAD,LRAN,LRDFN,LRIDT,LRSS
 ;
 Q:$$GETACCCP^BLRUTIL3(LRAS,.LRAA,.LRAD,.LRAN)<1
 ;
 S LRSS=$$GET1^DIQ(68,LRAA,"LR SUBSCRIPT","I")
 S IENS=LRAN_","_LRAD_","_LRAA
 S LRDFN=$$GET1^DIQ(68.02,IENS,"LRDFN")
 S LRIDT=$$GET1^DIQ(68.02,IENS,"INVERSE DATE","I")
 ;
 D YEXPORTD(LRDFN,LRSS,LRIDT)
 Q
 ;
UYEXPORT(UID) ; EP - Given an UID, call YEXPORTD
 NEW IENS,LRAA,LRAD,LRAN,LRDFN,LRIDT,LRSS
 D RETACCV^BLRUTIL4(UID,.LRAA,.LRAD,.LRAN,.LRDFN,.LRSS,.LRIDT)
 S LRSS=$$GET1^DIQ(68,LRAA,.02,"I")      ; Need to reset LRSS
 ;
 D YEXPORTD(LRDFN,LRSS,LRIDT)
 Q