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

BQIMUPER.m

Go to the documentation of this file.
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