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

BQISYPRM.m

Go to the documentation of this file.
BQISYPRM ;VNGT/HS/ALA-ICARE Site Parameters ; 18 Aug 2011  2:09 PM
 ;;2.5;ICARE MANAGEMENT SYSTEM;;May 24, 2016;Build 27
 ;
 ;
EN(DATA,FAKE) ; EP -- BQI GET LIST EMPLOYERS
 NEW UID,II,EM
 S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
 S DATA=$NA(^TMP("BQISYPRM",UID))
 K @DATA
 S II=0,TYPE=$G(TYPE,"")
 NEW $ESTACK,$ETRAP S $ETRAP="D ERR^BQISYPRM D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
 ;
 S HDR="I00010IEN^T00050"
 S @DATA@(II)=HDR_$C(30)
 S EM=""
 F  S EM=$O(^BQI(90508,1,18,"B",EM)) Q:EM=""  D
 . S II=II+1,@DATA@(II)=EM_U_$P($G(^AUTNEMPL(EM,0)),U,1)_$C(30)
 ;
DONE ;
 S II=II+1,@DATA@(II)=$C(31)
 Q
 ;
ERR ;
 D ^%ZTER
 NEW Y,ERRDTM
 S Y=$$NOW^XLFDT() X ^DD("DD") S ERRDTM=Y
 S BMXSEC="Recording that an error occurred at "_ERRDTM
 I $D(II),$D(DATA) S II=II+1,@DATA@(II)=$C(31)
 Q
 ;
UPD(DATA,PLIST) ; EP -- BQI UPDATE LIST EMPLOYERS
 ;
 NEW RESULT,ERROR,LIST,BN,BQ,PDATA,NAME,VALUE,BI,BQIUPD,EMP
 S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
 S DATA=$NA(^TMP("BQIUSYPRM",UID))
 K @DATA
 ;
 S II=0
 NEW $ESTACK,$ETRAP S $ETRAP="D ERR^BQISYPRM D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
 S @DATA@(II)="I00010RESULT^T01024ERROR"_$C(30)
 ;
 NEW DA,DIK
 S DA(1)=1,DIK="^BQI(90508,"_DA(1)_",18,",DA=0
 F  S DA=$O(^BQI(90508,DA(1),18,DA)) Q:'DA  D ^DIK
 ;
 S PLIST=$G(PLIST,"")
 I PLIST="" D
 . S LIST="",BN=""
 . F  S BN=$O(PLIST(BN)) Q:BN=""  S LIST=LIST_PLIST(BN)
 . K PLIST
 . S PLIST=LIST
 . K LIST
 ;
 S RESULT=1
 F BQ=1:1:$L(PLIST,$C(29)) D  Q:$G(BMXSEC)'=""
 . S EMP=$P(PLIST,$C(29),BQ) Q:EMP=""
 . S DA=$O(^BQI(90508,0))
 . I $G(^BQI(90508,DA,18,0))="" S ^BQI(90508,DA,18,0)="^90508.018P^^"
 . S DA(1)=DA,DIC(0)="LNZ",DLAYGO=90508.018,DIC="^BQI(90508,"_DA(1)_",18,"
 . S X=EMP
 . K DO,DD D FILE^DICN
 . I Y=-1 S RESULT=-1
 ;
 S II=II+1,@DATA@(II)=RESULT_U_$C(30)
 S II=II+1,@DATA@(II)=$C(31)
 Q
 ;
GPP(DATA,FAKE) ;EP -- BQI GET PREG PARMS
 NEW UID,II,DA,TYPE,TMFRAME
 S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
 S DATA=$NA(^TMP("BQISYGPP",UID))
 K @DATA
 S II=0,TYPE=$G(TYPE,"")
 NEW $ESTACK,$ETRAP S $ETRAP="D ERR^BQISYPRM D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
 ;
 S HDR="T00030TYPE^T00001TMFRAME"
 S @DATA@(II)=HDR_$C(30)
 S DA=$$SPM^BQIGPUTL()
 S TYPE=$$GET1^DIQ(90508,DA_",",16.01,"E")
 S TMFRAME=$$GET1^DIQ(90508,DA_",",16.02,"E")
 S II=II+1,@DATA@(II)=TYPE_U_TMFRAME_$C(30)
 S II=II+1,@DATA@(II)=$C(31)
 Q
 ;
UPGP(DATA,TYPE,TMFRAME) ;EP -- BQI SET PREG PARMS
 NEW RESULT,ERROR,RESULT,BQIUPD,MSG,DA
 S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
 S DATA=$NA(^TMP("BQIUSYPRM",UID))
 K @DATA
 ;
 S II=0
 NEW $ESTACK,$ETRAP S $ETRAP="D ERR^BQISYPRM D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
 S @DATA@(II)="I00010RESULT^T01024ERROR"_$C(30)
 ;
 S RESULT=1,TYPE=$G(TYPE,""),TMFRAME=$G(TMFRAME,""),MSG=""
 S DA=$$SPM^BQIGPUTL()
 I TYPE'="" S BQIUPD(90508,DA_",",16.01)=TYPE
 I TMFRAME'="" S BQIUPD(90508,DA_",",16.02)=TMFRAME
 I $D(BQIUPD) D FILE^DIE("E","BQIUPD","ERROR")
 I $D(ERROR) S RESULT=-1,MSG=$G(ERROR("DIERR",1,"TEXT",1))
 ;
 S II=II+1,@DATA@(II)=RESULT_U_MSG_$C(30)
 S II=II+1,@DATA@(II)=$C(31)
 I RESULT=1 D JB^BQITASK4
 Q
 ;
DMA(DATA,FAKE) ;EP -- BQI GET DM AUDIT REGISTER
 NEW UID,II,DA,RIEN,REG
 S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
 S DATA=$NA(^TMP("BQISYDMA",UID))
 K @DATA
 S II=0,TYPE=$G(TYPE,"")
 NEW $ESTACK,$ETRAP S $ETRAP="D ERR^BQISYPRM D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
 ;
 S HDR="I00010SUBREG_IEN^T00030REGISTER"
 S @DATA@(II)=HDR_$C(30)
 S DA=$$SPM^BQIGPUTL()
 S RIEN=$$GET1^DIQ(90508,DA_",",21.02,"I")
 S REG=$$GET1^DIQ(90508,DA_",",21.02,"E")
 S II=II+1,@DATA@(II)=RIEN_U_REG_$C(30)
 S II=II+1,@DATA@(II)=$C(31)
 Q
 ;
UDMA(DATA,SUBREG) ;EP -- BQI SET DM AUDIT REGISTER
 NEW RESULT,ERROR,RESULT,BQIUPD,MSG,DA
 S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
 S DATA=$NA(^TMP("BQIUDMA",UID))
 K @DATA
 ;
 S II=0
 NEW $ESTACK,$ETRAP S $ETRAP="D ERR^BQISYPRM D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
 S @DATA@(II)="I00010RESULT^T01024ERROR"_$C(30)
 ;
 S RESULT=1,SUBREG=$G(SUBREG,""),MSG=""
 S DA=$$SPM^BQIGPUTL()
 I SUBREG'="" S BQIUPD(90508,DA_",",21.02)=SUBREG
 I $D(BQIUPD) D FILE^DIE("","BQIUPD","ERROR")
 I $D(ERROR) S RESULT=-1,MSG=$G(ERROR("DIERR",1,"TEXT",1))
 ;
 S II=II+1,@DATA@(II)=RESULT_U_MSG_$C(30)
 S II=II+1,@DATA@(II)=$C(31)
 I RESULT=1 D JBDM^BQITASK2
 Q
 ;
GORD(DATA,FAKE) ;EP -- BQI GET GRP ORD PARM
 NEW UID,II,DA,GORD
 S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
 S DATA=$NA(^TMP("BQISYGPP",UID))
 K @DATA
 S II=0
 NEW $ESTACK,$ETRAP S $ETRAP="D ERR^BQISYPRM D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
 ;
 S HDR="T00001GRP_ORD_ENABLED"
 S @DATA@(II)=HDR_$C(30)
 S DA=$$SPM^BQIGPUTL()
 S GORD=$$GET1^DIQ(90508,DA_",",.2,"I")
 ; temporary disable of group order
 S GORD=""
 S II=II+1,@DATA@(II)=GORD_$C(30)
 S II=II+1,@DATA@(II)=$C(31)
 Q
 ;
UORD(DATA,ENABLE) ;EP -- BQI SET GRP ORD PARM
 NEW UID,II,RESULT,DA,BQIUPD,ERROR,MSG
 S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
 S DATA=$NA(^TMP("BQIUSYPRM",UID))
 K @DATA
 ;
 S II=0
 NEW $ESTACK,$ETRAP S $ETRAP="D ERR^BQISYPRM D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
 S @DATA@(II)="I00010RESULT^T01024ERROR"_$C(30)
 ;
 S RESULT=1,MSG=""
 S DA=$$SPM^BQIGPUTL()
 S:$G(ENABLE)="" ENABLE="@"
 S BQIUPD(90508,DA_",",.2)=ENABLE
 I $D(BQIUPD) D FILE^DIE("E","BQIUPD","ERROR")
 I $D(ERROR) S RESULT=-1,MSG=$G(ERROR("DIERR",1,"TEXT",1))
 ;
 S II=II+1,@DATA@(II)=RESULT_U_MSG_$C(30)
 S II=II+1,@DATA@(II)=$C(31)
 Q
 ;
INACTT(DATA,TIMEOUT) ;EP -- BQI SET INACTIVE TIMEOUT
 NEW UID,II,RESULT,DA,BQIUPD,ERROR,MSG
 S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
 S DATA=$NA(^TMP("BQIUSYPRM",UID))
 K @DATA
 ;
 S II=0
 NEW $ESTACK,$ETRAP S $ETRAP="D ERR^BQISYPRM D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
 S @DATA@(II)="I00010RESULT^T01024ERROR"_$C(30)
 ;
 S RESULT=1,MSG=""
 S DA=$$SPM^BQIGPUTL()
 S:$G(TIMEOUT)="" TIMEOUT="@"
 S BQIUPD(90508,DA_",",.21)=TIMEOUT
 I $D(BQIUPD) D FILE^DIE("E","BQIUPD","ERROR")
 I $D(ERROR) S RESULT=-1,MSG=$G(ERROR("DIERR",1,"TEXT",1))
 ;
 S II=II+1,@DATA@(II)=RESULT_U_MSG_$C(30)
 S II=II+1,@DATA@(II)=$C(31)
 Q
 ;
WARNT(DATA,TIMEOUT) ;EP -- BQI SET WARNING TIMEOUT
 NEW UID,II,RESULT,DA,BQIUPD,ERROR,MSG
 S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
 S DATA=$NA(^TMP("BQIUSYPRM",UID))
 K @DATA
 ;
 S II=0
 NEW $ESTACK,$ETRAP S $ETRAP="D ERR^BQISYPRM D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
 S @DATA@(II)="I00010RESULT^T01024ERROR"_$C(30)
 ;
 S RESULT=1,MSG=""
 S DA=$$SPM^BQIGPUTL()
 S:$G(TIMEOUT)="" TIMEOUT="@"
 S BQIUPD(90508,DA_",",.22)=TIMEOUT
 I $D(BQIUPD) D FILE^DIE("E","BQIUPD","ERROR")
 I $D(ERROR) S RESULT=-1,MSG=$G(ERROR("DIERR",1,"TEXT",1))
 ;
 S II=II+1,@DATA@(II)=RESULT_U_MSG_$C(30)
 S II=II+1,@DATA@(II)=$C(31)
 Q
 ;
SHUTT(DATA,TIMEOUT) ;EP -- BQI SET SHUTDOWN TIMEOUT
 NEW UID,II,RESULT,DA,BQIUPD,ERROR,MSG
 S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
 S DATA=$NA(^TMP("BQIUSYPRM",UID))
 K @DATA
 ;
 S II=0
 NEW $ESTACK,$ETRAP S $ETRAP="D ERR^BQISYPRM D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
 S @DATA@(II)="I00010RESULT^T01024ERROR"_$C(30)
 ;
 S RESULT=1,MSG=""
 S DA=$$SPM^BQIGPUTL()
 S:$G(TIMEOUT)="" TIMEOUT="@"
 S BQIUPD(90508,DA_",",.23)=TIMEOUT
 I $D(BQIUPD) D FILE^DIE("E","BQIUPD","ERROR")
 I $D(ERROR) S RESULT=-1,MSG=$G(ERROR("DIERR",1,"TEXT",1))
 ;
 S II=II+1,@DATA@(II)=RESULT_U_MSG_$C(30)
 S II=II+1,@DATA@(II)=$C(31)
 Q
 ;
GINTT(DATA,FAKE) ;EP -- BQI GET INACTIVE TIMEOUT
 NEW UID,II,DA,GORD
 S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
 S DATA=$NA(^TMP("BQISYGPP",UID))
 K @DATA
 S II=0
 NEW $ESTACK,$ETRAP S $ETRAP="D ERR^BQISYPRM D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
 ;
 S HDR="T00001INACTIVE_TIMEOUT"
 S @DATA@(II)=HDR_$C(30)
 S DA=$$SPM^BQIGPUTL()
 S GORD=$$GET1^DIQ(90508,DA_",",.21,"I")
 S II=II+1,@DATA@(II)=GORD_$C(30)
 S II=II+1,@DATA@(II)=$C(31)
 Q
 ;
GWARNT(DATA,FAKE) ;EP -- BQI GET WARNING TIMEOUT
 NEW UID,II,DA,GORD
 S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
 S DATA=$NA(^TMP("BQISYGPP",UID))
 K @DATA
 S II=0
 NEW $ESTACK,$ETRAP S $ETRAP="D ERR^BQISYPRM D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
 ;
 S HDR="T00001WARNING_TIMEOUT"
 S @DATA@(II)=HDR_$C(30)
 S DA=$$SPM^BQIGPUTL()
 S GORD=$$GET1^DIQ(90508,DA_",",.22,"I")
 S II=II+1,@DATA@(II)=GORD_$C(30)
 S II=II+1,@DATA@(II)=$C(31)
 Q
 ;
GSHUTT(DATA,FAKE) ;EP -- BQI GET SHUTDOWN TIMEOUT
 NEW UID,II,DA,GORD
 S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
 S DATA=$NA(^TMP("BQISYGPP",UID))
 K @DATA
 S II=0
 NEW $ESTACK,$ETRAP S $ETRAP="D ERR^BQISYPRM D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
 ;
 S HDR="T00001SHUTDOWN_TIMEOUT"
 S @DATA@(II)=HDR_$C(30)
 S DA=$$SPM^BQIGPUTL()
 S GORD=$$GET1^DIQ(90508,DA_",",.23,"I")
 S II=II+1,@DATA@(II)=GORD_$C(30)
 S II=II+1,@DATA@(II)=$C(31)
 Q