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

BQISYPNL.m

Go to the documentation of this file.
BQISYPNL ;GDIT/HS/ALA-Users Panel Autopop Report ; 12 Aug 2015  7:24 AM
 ;;2.5;ICARE MANAGEMENT SYSTEM;;May 24, 2016;Build 27
 ;
 ;
EN(DATA,FAKE) ;EP -- BQI GET AUTOPOP REPORT
 NEW UID,II,HDR,DZ,CT,IEN,VALUE
 S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
 S DATA=$NA(^TMP("BQISYPNL",UID))
 K @DATA
 ;
 S II=0
 NEW $ESTACK,$ETRAP S $ETRAP="D ERR^BQISYPNL D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
 ;
 S HDR="T00030USER^D00030LAST_DATETIME^I00010ATLOG^I00010NIGHT"
 S @DATA@(II)=HDR_$C(30)
 ;
 S DZ=""
 F  S DZ=$O(^BQICARE("AC","A",DZ)) Q:DZ=""  D
 . S CT=0,IEN=""
 . S $P(VALUE(DZ),U,1)=$$FMTE^BQIUL1($P(^BQICARE(DZ,0),U,6)\1)
 . F  S IEN=$O(^BQICARE("AC","A",DZ,IEN)) Q:IEN=""  S CT=CT+1,$P(VALUE(DZ),"^",2)=CT
 . S $P(VALUE(DZ),U,3)=0
 ;
 S DZ=""
 F  S DZ=$O(^BQICARE("AC","N",DZ)) Q:DZ=""  D
 . S CT=0,IEN=""
 . S $P(VALUE(DZ),U,1)=$$FMTE^BQIUL1($P(^BQICARE(DZ,0),U,6)\1)
 . F  S IEN=$O(^BQICARE("AC","N",DZ,IEN)) Q:IEN=""  S CT=CT+1,$P(VALUE(DZ),"^",3)=CT
 . I $P(VALUE(DZ),"^",2)="" S $P(VALUE(DZ),"^",2)=0
 ;
 S DZ=""
 F  S DZ=$O(VALUE(DZ)) Q:DZ=""  D
 . S II=II+1,@DATA@(II)=$P($G(^VA(200,DZ,0)),U,1)_U_VALUE(DZ)_$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
 ;
REF(DATA,FAKE) ;EP -- BQI GET REFERRAL TEXT
 NEW UID,II,HDR,VALUE,RANGE
 S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
 S DATA=$NA(^TMP("BQISYRFP",UID))
 K @DATA
 ;
 S II=0
 NEW $ESTACK,$ETRAP S $ETRAP="D ERR^BQISYPNL D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
 ;
 S HDR="T00060REF_TEXT"
 S @DATA@(II)=HDR_$C(30)
 S VALUE=$P($G(^BQI(90508,1,16)),"^",4) I VALUE="" S VALUE="T-12M"
 S RANGE=$$FMTE^XLFDT($$DATE^BQIUL1(VALUE))_" - "_$$FMTE^XLFDT(DT,1)
 S II=II+1,@DATA@(II)="Referrals for the dates of "_RANGE_$C(30)
 G DONE
 ;
CON(DATA,FAKE) ;EP -- BQI GET CONSULT TEXT
 NEW UID,II,HDR,VALUE,RANGE
 S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
 S DATA=$NA(^TMP("BQISYCNP",UID))
 K @DATA
 ;
 S II=0
 NEW $ESTACK,$ETRAP S $ETRAP="D ERR^BQISYPNL D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
 ;
 S HDR="T00060CON_TEXT"
 S @DATA@(II)=HDR_$C(30)
 S VALUE=$P($G(^BQI(90508,1,16)),"^",5) I VALUE="" S VALUE="T-"_$$GET^XPAR("ALL","GMRC CONSULT LIST DAYS")
 S RANGE=$$FMTE^XLFDT($$DATE^BQIUL1(VALUE))_" - "_$$FMTE^XLFDT(DT,1)
 S II=II+1,@DATA@(II)="Consults for the dates of "_RANGE_$C(30)
 G DONE