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

BQIMULST.m

Go to the documentation of this file.
BQIMULST ;VNGT/HS/ALA-Provider List ; 28 Apr 2011  12:23 PM
 ;;2.3;ICARE MANAGEMENT SYSTEM;**1**;Apr 18, 2012;Build 43
 ;
 ;
EN(DATA,FAKE) ; EP -- BQI GET LIST MU PROV
 NEW UID,II,PR
 S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
 S DATA=$NA(^TMP("BQIMULST",UID))
 K @DATA
 S II=0,TYPE=$G(TYPE,"")
 NEW $ESTACK,$ETRAP S $ETRAP="D ERR^BQIMULST D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
 ;
 S HDR="I00010IEN^T00050"
 S @DATA@(II)=HDR_$C(30)
 S PR=0
 F  S PR=$O(^BQI(90508,1,14,"B",PR)) Q:'PR  D
 . S USN="",TYPE=""
 . F  S USN=$O(^USR(8930.3,"B",PR,USN),-1) Q:USN=""  D
 .. I '$$CURRENT^USRLM(USN) Q
 .. S TYPE=$P(^USR(8930.3,USN,0),U,2)
 .. ;I $O(^BQI(90508,1,13,"B",TYPE,""))="" S TYPE="" Q
 .. I TYPE'="" S TYPE=$S($P($G(^USR(8930,TYPE,0)),U,4)'="":$P($G(^USR(8930,TYPE,0)),U,4),1:$P($G(^USR(8930,TYPE,0)),U,1))
 . S II=II+1,@DATA@(II)=PR_U_$P(^VA(200,PR,0),U,1)_" ("_TYPE_")"_$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 MU PROV
 ;
 NEW RESULT,ERROR,LIST,BN,BQ,PDATA,NAME,VALUE,BI,BQIUPD
 S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
 S DATA=$NA(^TMP("BQIUMULS",UID))
 K @DATA
 ;
 S II=0
 NEW $ESTACK,$ETRAP S $ETRAP="D ERR^BQIMULST D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
 S @DATA@(II)="I00010RESULT^T001024ERROR"_$C(30)
 ;
 NEW DA,DIK
 S DA(1)=1,DIK="^BQI(90508,"_DA(1)_",14,",DA=0
 F  S DA=$O(^BQI(90508,DA(1),14,DA)) Q:'DA  D ^DIK
 K ^XTMP("BQIPROV")
 ;
 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 PRV=$P(PLIST,$C(29),BQ) Q:PRV=""
 . S DA=$O(^BQI(90508,0))
 . I $G(^BQI(90508,DA,14,0))="" S ^BQI(90508,DA,14,0)="^90508.014P^^"
 . S DA(1)=DA,DIC(0)="LNZ",DLAYGO=90508.014,DIC="^BQI(90508,"_DA(1)_",14,"
 . I $P($G(^VA(200,PRV,0)),U,11)'="",$P($G(^VA(200,PRV,0)),U,11)<3090101 S RESULT=-1 Q
 . I PRV=1,$P($G(^VA(200,PRV,0)),U,1)["ADAM" Q
 . S X=PRV
 . K DO,DD D FILE^DICN
 . I Y=-1 S RESULT=-1 Q
 . I $G(^BQIPROV(PRV,0))="" S ^BQIPROV(PRV,0)=PRV,^BQIPROV("B",PRV,PRV)="",^XTMP("BQIPROV",PRV)=""
 . I $G(^BQIPROV(PRV,50,0))="" S ^BQIPROV(PRV,50,0)="^90505.45D^^",^XTMP("BQIPROV",PRV)=""
 ;
 S II=II+1,@DATA@(II)=RESULT_U_$C(30)
 S II=II+1,@DATA@(II)=$C(31)
 Q
 ;
 I $D(^XTMP("BQIPROV")),$P($G(^BQI(90508,1,12)),U,6)="" D
 . NEW DESC,BJOB,BCJOB,BQPROH,BQIMUDTM,BQIMUDT,BQIMUTIM,CDOW
 . S BQPROH=+$P(^BQI(90508,1,12),U,7)
 . S BQIMUDTM=$$NOW^XLFDT(),BQIMUDT=$P(BQIMUDTM,".",1),BQIMUTIM=$P(BQIMUDTM,".",2)
 . S CDOW=$$DOW^XLFDT(BQIMUDT,1)
 . I CDOW'=6,CDOW'=0,BQPROH,$E(BQIMUTIM,1,2)+3>6,$E(BQIMUTIM,1,2)+3<18 D  Q
 .. S ZTDTH=BQIMUDT_".183"
 .. S ZTDESC="MU CQ Provider Update",ZTRTN="PROV^BQITASK6",ZTIO=""
 .. S ZTSAVE("BGPPROV")=BGPPROV
 .. D ^%ZTLOAD
 .. S BQIUPD(90508,"1,",12.06)=ZTSK
 .. D FILE^DIE("","BQIUPD","ERROR")
 .. K ZTDESC,ZTRTN,ZTIO,ZTDTH,ZTSK
 Q