BQIMUPER ;GDIT/HS/ALA-MU MONTHLY PERIODS ; 12 Oct 2011 3:07 PM
;;2.3;ICARE MANAGEMENT SYSTEM;**1,3,4**;Apr 18, 2012;Build 66
;
;
GET(DATA,FAKE) ;EP -- BQI MU GET MU PERIODS
;
; Get specific MU PERIODS
NEW UID,II,IEN,BQIN,BQILST,DATE
S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
S DATA=$NA(^TMP("BQIMUPER",UID))
K @DATA
;
S II=0
NEW $ESTACK,$ETRAP S $ETRAP="D ERR^BQIMUSIT D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
;
S @DATA@(II)="T00030PERIOD^T00010TIMEFRAME^T00001ACTIVE"_$C(30)
;
S BQIN=$$SPM^BQIGPUTL()
;
S IEN=0
F S IEN=$O(^BQI(90508,BQIN,19,IEN)) Q:'IEN D
. NEW DA,IENS,ACT
. S DA(1)=BQIN,DA=IEN,IENS=$$IENS^DILF(.DA)
. S ACT=$S(+$P(^BQI(90508,BQIN,19,IEN,0),U,5)=1:"Y",1:"N")
. S DATE=$$DATE^BQIUL1($P(^BQI(90508,BQIN,19,IEN,0),U,1))
. S BQILST(DATE)=$$GET1^DIQ(90508.019,IENS,.01,"E")_U_$$GET1^DIQ(90508.019,IENS,.04,"I")_U_ACT
;
S DATE=""
F S DATE=$O(BQILST(DATE)) Q:DATE="" D
. S II=II+1,@DATA@(II)=BQILST(DATE)_$C(30)
;
S II=II+1,@DATA@(II)=$C(31)
Q
;
PPER(DATA,REPORT) ;EP -- BQI MU GET PERF PERIODS
NEW UID,II,IEN,BQIN,BQILST,DATE
S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
S DATA=$NA(^TMP("BQIMUPER",UID))
K @DATA
;
S II=0
NEW $ESTACK,$ETRAP S $ETRAP="D ERR^BQIMUSIT D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
;
S @DATA@(II)="T00030PERIOD^T00010TIMEFRAME^T00001ACTIVE"_$C(30)
;
S REPORT=$G(REPORT,"") I REPORT="" S REPORT=$$CURREP^BQIMUTAB()
S DATE=""
F S DATE=$O(^BQIPROV("AC",REPORT,DATE)) Q:DATE="" D
. S BQIN=$$SPM^BQIGPUTL()
. S BQDATE=$$FMTE^BQIUL1(DATE)
. S IEN=$O(^BQI(90508,BQIN,19,"B",BQDATE,""))
. NEW DA,IENS,ACT
. S DA(1)=BQIN,DA=IEN,IENS=$$IENS^DILF(.DA)
. S ACT=$S(+$P(^BQI(90508,BQIN,19,IEN,0),U,5)=1:"Y",1:"N")
. S DATE=$$DATE^BQIUL1($P(^BQI(90508,BQIN,19,IEN,0),U,1))
. S BQILST(DATE)=$$GET1^DIQ(90508.019,IENS,.01,"E")_U_$$GET1^DIQ(90508.019,IENS,.04,"I")_U_ACT
;
S DATE=""
F S DATE=$O(BQILST(DATE)) Q:DATE="" D
. S II=II+1,@DATA@(II)=BQILST(DATE)_$C(30)
;
S II=II+1,@DATA@(II)=$C(31)
Q
BQIMUPER ;GDIT/HS/ALA-MU MONTHLY PERIODS ; 12 Oct 2011 3:07 PM
+1 ;;2.3;ICARE MANAGEMENT SYSTEM;**1,3,4**;Apr 18, 2012;Build 66
+2 ;
+3 ;
GET(DATA,FAKE) ;EP -- BQI MU GET MU PERIODS
+1 ;
+2 ; Get specific MU PERIODS
+3 NEW UID,II,IEN,BQIN,BQILST,DATE
+4 SET UID=$SELECT($GET(ZTSK):"Z"_ZTSK,1:$JOB)
+5 SET DATA=$NAME(^TMP("BQIMUPER",UID))
+6 KILL @DATA
+7 ;
+8 SET II=0
+9 ; SAC 2006 2.2.3.3.2
NEW $ESTACK,$ETRAP
SET $ETRAP="D ERR^BQIMUSIT D UNWIND^%ZTER"
+10 ;
+11 SET @DATA@(II)="T00030PERIOD^T00010TIMEFRAME^T00001ACTIVE"_$CHAR(30)
+12 ;
+13 SET BQIN=$$SPM^BQIGPUTL()
+14 ;
+15 SET IEN=0
+16 FOR
SET IEN=$ORDER(^BQI(90508,BQIN,19,IEN))
IF 'IEN
QUIT
Begin DoDot:1
+17 NEW DA,IENS,ACT
+18 SET DA(1)=BQIN
SET DA=IEN
SET IENS=$$IENS^DILF(.DA)
+19 SET ACT=$SELECT(+$PIECE(^BQI(90508,BQIN,19,IEN,0),U,5)=1:"Y",1:"N")
+20 SET DATE=$$DATE^BQIUL1($PIECE(^BQI(90508,BQIN,19,IEN,0),U,1))
+21 SET BQILST(DATE)=$$GET1^DIQ(90508.019,IENS,.01,"E")_U_$$GET1^DIQ(90508.019,IENS,.04,"I")_U_ACT
End DoDot:1
+22 ;
+23 SET DATE=""
+24 FOR
SET DATE=$ORDER(BQILST(DATE))
IF DATE=""
QUIT
Begin DoDot:1
+25 SET II=II+1
SET @DATA@(II)=BQILST(DATE)_$CHAR(30)
End DoDot:1
+26 ;
+27 SET II=II+1
SET @DATA@(II)=$CHAR(31)
+28 QUIT
+29 ;
PPER(DATA,REPORT) ;EP -- BQI MU GET PERF PERIODS
+1 NEW UID,II,IEN,BQIN,BQILST,DATE
+2 SET UID=$SELECT($GET(ZTSK):"Z"_ZTSK,1:$JOB)
+3 SET DATA=$NAME(^TMP("BQIMUPER",UID))
+4 KILL @DATA
+5 ;
+6 SET II=0
+7 ; SAC 2006 2.2.3.3.2
NEW $ESTACK,$ETRAP
SET $ETRAP="D ERR^BQIMUSIT D UNWIND^%ZTER"
+8 ;
+9 SET @DATA@(II)="T00030PERIOD^T00010TIMEFRAME^T00001ACTIVE"_$CHAR(30)
+10 ;
+11 SET REPORT=$GET(REPORT,"")
IF REPORT=""
SET REPORT=$$CURREP^BQIMUTAB()
+12 SET DATE=""
+13 FOR
SET DATE=$ORDER(^BQIPROV("AC",REPORT,DATE))
IF DATE=""
QUIT
Begin DoDot:1
+14 SET BQIN=$$SPM^BQIGPUTL()
+15 SET BQDATE=$$FMTE^BQIUL1(DATE)
+16 SET IEN=$ORDER(^BQI(90508,BQIN,19,"B",BQDATE,""))
+17 NEW DA,IENS,ACT
+18 SET DA(1)=BQIN
SET DA=IEN
SET IENS=$$IENS^DILF(.DA)
+19 SET ACT=$SELECT(+$PIECE(^BQI(90508,BQIN,19,IEN,0),U,5)=1:"Y",1:"N")
+20 SET DATE=$$DATE^BQIUL1($PIECE(^BQI(90508,BQIN,19,IEN,0),U,1))
+21 SET BQILST(DATE)=$$GET1^DIQ(90508.019,IENS,.01,"E")_U_$$GET1^DIQ(90508.019,IENS,.04,"I")_U_ACT
End DoDot:1
+22 ;
+23 SET DATE=""
+24 FOR
SET DATE=$ORDER(BQILST(DATE))
IF DATE=""
QUIT
Begin DoDot:1
+25 SET II=II+1
SET @DATA@(II)=BQILST(DATE)_$CHAR(30)
End DoDot:1
+26 ;
+27 SET II=II+1
SET @DATA@(II)=$CHAR(31)
+28 QUIT