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

BLREMERA.m

Go to the documentation of this file.
BLREMERA ; IHS/MSC/MKK - BLR EMERgency Alert parameter edit  ; 02-May-2016 15:50 ; MKK
 ;;5.2;IHS LABORATORY;**1039**;NOV 01, 1997;Build 38
 ;
EEP ; Ersatz EP
 D EEP^BLRGMENU
 Q
 ;
PEP ; EP
 D CHANGE("BLR EMERGENCY ALERT")
 Q
 ;
COLDTACC ; EP - Collection Date visit Creation parameter
 D CHANGE("BLR COLL DT PCC VISIT CREATION")
 Q
 ;
 ;
CHANGE(PARAMETER) ; EP
 NEW (DILOCKTM,DISYS,DT,DTIME,DUZ,IO,IOBS,IOF,IOM,ION,IOS,IOSL,IOST,IOT,IOXY,PARAMETER,U,XPARSYS,XQXFLG)
 ;
 D SETBLRVS
 ;
 S HEADER(1)="IHS Laboratory"
 S HEADER(2)=PARAMETER_" Parameter"
 S HEADER(3)=$$CJ^XLFSTR("Modify Value",IOM)
 ;
 S RESULT=$$GET^XPAR("PKG",PARAMETER,1,"Q")
 S RESULT=$S(RESULT:"YES",RESULT=0:"NO",1:"")
 ;
 D HEADERDT^BLRGMENU
 ;
 D ^XBFMK
 S DIR(0)="YO"
 S DIR("A")=PARAMETER_" (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($$UP^XLFSTR(X))="Y":"YES",1:"NO")
 ;
 D EN^XPAR("PKG",PARAMETER,,ANSWER,.ERRS)
 ;
 I +$G(ERRS)<1 D
 . S RESULT=$$GET^XPAR("PKG",PARAMETER,1,"Q")
 . W !!,?4,PARAMETER," Parameter is currently ",$S(RESULT:"YES",RESULT=0:"NO",1:"")
 . D PRESSKEY^BLRGMENU(9)
 ;
 D:+$G(ERRS)>0 RPTERR(.ERRS,PARAMETER)
 ;
 Q
 ;
RPTERR(ERROR,PARAMETER) ; EP
 NEW ERRDESC,ERRNUM,NOWH
 ;
 S ERRNUM=$P(ERROR,"^")
 S ERRDESC=$P(ERROR,"^",2)
 ;
 W !!,"*** ERROR Modifying ",PARAMETER," paramter. ***",!!
 W ?4,"Error Number:",ERRNUM,!
 D LINEWRAP^BLRGMENU(9,ERRDESC,60)
 W !
 ;
 D PRESSKEY^BLRGMENU(9)
 ;
 D STORERRS(ERROR,PARAMETER)
 Q
 ;
STORERRS(ERROR,PARAMETER) ; EP - Store Error(s)
 NEW (ERROR,DILOCKTM,DISYS,DT,DTIME,DUZ,IO,IOBS,IOF,IOM,ION,IOS,IOSL,IOST,IOT,IOXY,PARAMETER,U,XPARSYS,XQXFLG)
 ;
 D SETBLRVS
 S:$D(^XTMP(BLRVERN))<1 XTMP(BLRVERN)="^"_$$DT^XLFDT_"^Error(s) Modifying "_PARAMETER_" Parameter"
 S $P(^XTMP(BLRVERN),"^")=$$HTFM^XLFDT(+$H+90)
 ;
 S NOWH=$H
 S ^XTMP(BLRVERN,NOWH)=$$HTE^XLFDT(NOWH,"5Z")
 M ^XTMP(BLRVERN,NOWH,"01","DUZ")=DUZ
 S ^XTMP(BLRVERN,NOWH,"02","ERROR")=ERROR
 ;
 Q
 ;
EDITMGRP ; EP - Edit the LAB HIGH URGENCY NOTIFICATION Mail Group
 D MAILGRPE("LAB HIGH URGENCY NOTIFICATION")
 Q
 ;
MAILGRPE(MGROUP) ; EP - Mail Group Edit
 NEW (DILOCKTM,DISYS,DT,DTIME,DUZ,IO,IOBS,IOF,IOM,ION,IOS,IOSL,IOST,IOT,IOXY,MGROUP,U,XPARSYS,XQXFLG)
 ;
 D SETBLRVS
 ;
 D ADDTMENU^BLRGMENU("ADDTMGRP^BLREMERA","Add User to Mail Group")
 D ADDTMENU^BLRGMENU("DELFMGRP^BLREMERA","Delete User From Mail Group")
 D ADDTMENU^BLRGMENU("LISTMGRP^BLREMERA","List Users on Mail Group")
 ;
 D MENUDRVR^BLRGMENU("RPMS Lab",MGROUP,$$CJ^XLFSTR("Mail Group Modifications",IOM))
 Q
 ;
ADDTMGRP ; EP - ADD user(s) To Mail GRouP
 NEW (DILOCKTM,DISYS,DT,DTIME,DUZ,IO,IOBS,IOF,IOM,ION,IOS,IOSL,IOST,IOT,IOXY,MGROUP,U,XPARSYS,XQXFLG)
 ;
 D SETBLRVS
 ;
 S HEADER(1)="IHS Laboratory"
 S HEADER(2)=MGROUP
 S HEADER(3)=$$CJ^XLFSTR("Add User to Mail Group",IOM)
 ;
 S ONGO="YES",(NUMADD,NUMERRS)=0
 F  Q:ONGO="NO"  D
 . D HEADERDT^BLRGMENU
 . D ^XBFMK
 . S DIR(0)="PO^200:EMZ"
 . D ^DIR
 . I +$G(DIRUT) D PROMPTO^BLRUTIL7("Exit/No Entry.")  S ONGO="NO"  Q
 . ;
 . S NEWMEM=+Y,NEWMEMN=$P(Y,U,2)
 . ;
 . K XMY
 . S XMY(+Y)=""
 . S SUCCESS=$$MG^XMBGRP(MGROUP,,,,.XMY,,1)
 . W !!
 . I SUCCESS  W ?4,NEWMEMN," added to ",MGROUP  S NUMADD=NUMADD+1
 . E  W ?4,NEWMEMN," *NOT* added to ",MGROUP  S NUMERRS=NUMERRS+1
 . W !
 . D PRESSKEY^BLRGMENU(9)
 ;
 W !!,?4,NUMADD," Users added to ",MGROUP,!
 W !,?4,NUMERRS," Errors when trying to add users to ",MGROUP,!
 D PRESSKEY^BLRGMENU(9)
 Q
 ;
DELFMGRP ; EP - DELete user(s) From Mail GRouP
 NEW (DILOCKTM,DISYS,DT,DTIME,DUZ,IO,IOBS,IOF,IOM,ION,IOS,IOSL,IOST,IOT,IOXY,MGROUP,U,XPARSYS,XQXFLG)
 ;
 D SETBLRVS
 ;
 S HEADER(1)="IHS Laboratory"
 S HEADER(2)=MGROUP
 S HEADER(3)=$$CJ^XLFSTR("Delete User from Mail Group",IOM)
 ;
 S MGIEN=$$FIND1^DIC(3.8,,,MGROUP)
 ;
 S ONGO="YES",(NUMDEL,NUMERRS)=0
 F  Q:ONGO="NO"  D
 . D HEADERDT^BLRGMENU
 . D ^XBFMK
 . Q:$$GETMEMS()<1
 . D ^DIR
 . I +$G(DIRUT) D PROMPTO^BLRUTIL7("Exit/No Entry.")  S ONGO="NO"  Q
 . ;
 . S DELMEM=+SELECTED(Y),DELMEMN=$P($G(SELECTED(Y)),U,2)
 . K XMY
 . S XMY(DELMEM)=""
 . S SUCCESS=$$DM^XMBGRP(MGROUP,.XMY,1)
 . W !!
 . I SUCCESS  W ?4,DELMEMN," deleted from ",MGROUP," Mail Group"  S NUMDEL=NUMDEL+1
 . E  W ?4,DELMEMN," *NOT* deleted from ",MGROUP," Mail Group"  S NUMERRS=NUMERRS+1
 . W !
 . D PRESSKEY^BLRGMENU(9)
 ;
 W !!,?4,$S(NUMDEL:NUMDEL,1:"No")," User",$S(NUMDEL>1:"s",1:"")," deleted from ",MGROUP,!
 W:NUMDEL !,?4,NUMERRS," Errors when trying to delete users from ",MGROUP,!
 D PRESSKEY^BLRGMENU(9)
 Q
 ;
GETMEMS() ; EP - GET the MEMberS of the Mail Group and setup DIR array
 K MEMBER
 S (MEMBER,MGMEMIEN)=0
 F  S MGMEMIEN=$O(^XMB(3.8,MGIEN,1,"B",MGMEMIEN))  Q:MGMEMIEN<1  D
 . S MEMBER($$GET1^DIQ(200,MGMEMIEN,.01))=MGMEMIEN
 . S MEMBER=MEMBER+1
 ;
 Q:MEMBER<1 0
 ;
 K DIR,SELECTED
 S DIR(0)="SO^",TAB=$J("",5)
 S MEMNAME="",MEMCNT=0
 F  S MEMNAME=$O(MEMBER(MEMNAME))  Q:MEMNAME=""  D
 . S MEMCNT=MEMCNT+1
 . S:MEMCNT=1 DIR(0)=$G(DIR(0))_MEMCNT_":"
 . S:MEMCNT>1 DIR(0)=$G(DIR(0))_";"_MEMCNT_":"
 . S DIR("L",MEMCNT+3)=TAB_MEMCNT_" "_MEMNAME
 . S SELECTED(MEMCNT)=$G(MEMBER(MEMNAME))_U_MEMNAME
 S DIR("L")=""
 S DIR("L",1)="Select one of the users below to delete:"
 S DIR("L",2)=""
 S DIR("A")="Enter Number"
 Q 1
 ;
LISTMGRP ; EP - LIST all the users on a Mail GRouP
 NEW (DILOCKTM,DISYS,DT,DTIME,DUZ,IO,IOBS,IOF,IOM,ION,IOS,IOSL,IOST,IOT,IOXY,MGROUP,U,XPARSYS,XQXFLG)
 ;
 D SETBLRVS
 ;
 S HEADER(1)="IHS Laboratory"
 S HEADER(2)=MGROUP
 S HEADER(3)=$$CJ^XLFSTR("Mail Group Members",IOM)
 ;
 D HEADERDT^BLRGMENU
 D HEADONE^BLRGMENU(.HDRONE)
 ;
 S HEADER(4)=" "
 S $E(HEADER(5),5)="DUZ"
 S $E(HEADER(5),15)="Name"
 S MAXLINES=IOSL-4,LINES=MAXLINES+10
 S PG=0,QFLG="NO"
 ;
 S MGIEN=+$$FIND1^DIC(3.8,,,MGROUP)
 S MEMBER=.9999999,CNT=0
 F  S MEMBER=$O(^XMB(3.8,MGIEN,1,MEMBER))  Q:MEMBER<1!(QFLG="Q")  D
 . I LINES>MAXLINES D HEADERPG^BLRGMENU(.PG,.QFLG,HDRONE)  Q:QFLG="Q"
 . S MEMIEN=MEMBER_","_MGIEN
 . W ?4,$$GET1^DIQ(3.81,MEMIEN,.01,"I")
 . W ?14,$$GET1^DIQ(3.81,MEMIEN,.01)
 . W !
 . S LINES=LINES+1
 . S CNT=CNT+1
 ;
 W !!,?9,CNT," Members"
 D PRESSKEY^BLRGMENU(14)
 Q
 ;
 ;
SETBLRVS(TWO) ; EP - Set the BLRVERN variable
 K BLRVERN
 ;
 S BLRVERN=$P($P($T(+1),";")," ")
 Q