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

BQIMUTAB.m

Go to the documentation of this file.
BQIMUTAB ;VNGT/HS/ALA-MU Tables ; 25 Feb 2011  1:09 PM
 ;;2.3;ICARE MANAGEMENT SYSTEM;**3,4**;Apr 18, 2012;Build 66
 ;
 ;
ITM(DATA,TYPE,REPORT) ; EP -- BQI GET MU MEASURES
 ; Input Parameters
 ;   TYPE = E for Provider, H for Hospital, null for both
 NEW UID,II,MN,MDATA,TIP,TP,PGLOB,HDR
 S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
 S DATA=$NA(^TMP("BQIMUITM",UID))
 K @DATA
 S II=0,TYPE=$G(TYPE,""),REPORT=$G(REPORT,"")
 NEW $ESTACK,$ETRAP S $ETRAP="D ERR^BQIMUTAB D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
 ;
 S HDR="T00030ID^T00001TYPE^T00050NAME^T00001MEASTYPE^T00001SET^T01024TOOLTIP"
 S @DATA@(II)=HDR_$C(30)
 ;S PGLOB=$$CURPGL()
 S PGLOB=$$PRFPGL^BQIMUTAB(REPORT)
 S MN=0
 F  S MN=$O(@PGLOB@(MN)) Q:'MN  D
 . I TYPE'="",$P(@PGLOB@(MN,0),U,2)'=TYPE Q
 . S MDATA=@PGLOB@(MN,0)
 . ; Ignore attestation measures
 . I $P(MDATA,U,6)="A" Q
 . S TIP="",TP=0
 . F  S TP=$O(@PGLOB@(MN,23,TP)) Q:'TP  S TIP=TIP_@PGLOB@(MN,23,TP,0)_$C(10)
 . S TP=0,TIP=TIP_"TARGET: "_$C(10)
 . F  S TP=$O(@PGLOB@(MN,13,TP)) Q:'TP  S TIP=TIP_@PGLOB@(MN,13,TP,0)_$C(10)
 . S II=II+1,@DATA@(II)=$P(MDATA,U,1)_U_$P(MDATA,U,2)_U_$P(MDATA,U,5)_U_$P(MDATA,U,6)_U_$P(MDATA,U,3)_U_TIP_$C(30)
 ;
DONE ;
 S II=II+1,@DATA@(II)=$C(31)
 Q
 ;
MURP(DATA,TYPE) ; EP -- BQI MU PERF REPORT
 NEW UID,II,MN,REP
 S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
 S DATA=$NA(^TMP("BQIMURPT",UID))
 K @DATA
 S II=0,TYPE=$G(TYPE,"")
 NEW $ESTACK,$ETRAP S $ETRAP="D ERR^BQIMUTAB D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
 ;
 S HDR="T00030REPORT"
 S @DATA@(II)=HDR_$C(30)
 I '$$PATCH^XPDUTL("APCM*1.0*2") G DONE
 S MN=0
 F  S MN=$O(^APCMMUCN(MN)) Q:'MN  D
 . I TYPE="SITE" S II=II+1,@DATA@(II)=$P(^APCMMUCN(MN,0),U,1)_$C(30) Q
 . S REP=$P(^APCMMUCN(MN,0),U,1)
 . ;I '$D(^BQIPROV("AC",REP)) Q
 . S II=II+1,@DATA@(II)=REP_$C(30)
 S II=II+1,@DATA@(II)=$C(31)
 Q
 ;
GCUR(DATA,FAKE) ; EP -- BQI GET MU CURRENT PERF
 NEW UID,II,MN
 S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
 S DATA=$NA(^TMP("BQIMUCUR",UID))
 K @DATA
 S II=0
 NEW $ESTACK,$ETRAP S $ETRAP="D ERR^BQIMUTAB D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
 ;
 S HDR="T00030REPORT"
 S @DATA@(II)=HDR_$C(30)
 I '$$PATCH^XPDUTL("APCM*1.0*2") G DONE
 S II=II+1,@DATA@(II)=$P($G(^BQI(90508,1,9)),U,3)_$C(30)
 S II=II+1,@DATA@(II)=$C(31)
 Q
 ;
UCUR(DATA,REP) ; EP -- BQI SET MU CURRENT PERF
 NEW UID,II,ERROR
 S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
 S DATA=$NA(^TMP("BQIMUCUP",UID))
 K @DATA
 S II=0,REP=$G(REP,"")
 S @DATA@(II)="I00010RESULT^T00030MSG"_$C(30)
 ;
 NEW $ESTACK,$ETRAP S $ETRAP="D ERR^BQIMUTAB D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
 S BQIUPD(90508,"1,",9.03)=REP
 S RESULT=1,MSG=""
 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)
 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
 ;
MUDT(DATA,MUTYP) ;EP -- BQI GET MU DATES
 NEW UID,II
 S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
 S DATA=$NA(^TMP("BQIMUDT",UID))
 K @DATA
 S II=0,TYPE=$G(TYPE,"")
 NEW $ESTACK,$ETRAP S $ETRAP="D ERR^BQIMUTAB D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
 ;
 S HDR="T00010ID^T00030"
 S @DATA@(II)=HDR_$C(30)
 S II=II+1,@DATA@(II)="30^1 Month"_$C(30)
 S II=II+1,@DATA@(II)="90^90 Days"_$C(30)
 S II=II+1,@DATA@(II)="12^1 Year"_$C(30)
 S II=II+1,@DATA@(II)=$C(31)
 Q
 ;
CQM(DATA,TYPE) ; EP -- BQI GET MU CQ MEASURES
 ; Input Parameters
 ;   TYPE = E for Provider, H for Hospital, null for both
 NEW UID,II,MN,MDATA,TIP,TP,MTYPE,MSN,QFL,BQIDATA
 S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
 S DATA=$NA(^TMP("BQIMUCQM",UID))
 K @DATA
 S II=0,TYPE=$G(TYPE,"")
 NEW $ESTACK,$ETRAP S $ETRAP="D ERR^BQIMUTAB D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
 ;
 S HDR="T00030ID^T00001TYPE^T00050NAME^T01024TOOLTIP"
 S @DATA@(II)=HDR_$C(30)
 ;
 S MN=0
 F  S MN=$O(^BGPMUIND(90596.11,MN)) Q:'MN  D
 . I TYPE'="" S QFL=0 D  Q:QFL
 .. S MSN=$P(^BGPMUIND(90596.11,MN,0),U,1)
 .. I $G(^BGPMUIND(90595.11,MSN,0))="" Q
 .. I TYPE="E",$P(^BGPMUIND(90595.11,MSN,0),U,4)="H" S QFL=1 Q
 .. I TYPE="H",$P(^BGPMUIND(90595.11,MSN,0),U,4)'="H" S QFL=1 Q
 . ;
 . S MDATA=^BGPMUIND(90596.11,MN,0)
 . S MSN=$P(^BGPMUIND(90596.11,MN,0),U,1)
 . I $G(^BGPMUIND(90595.11,MSN,0))="" Q
 . S MTYPE=$$GET1^DIQ(90595.11,MSN_",",.04,"E")
 . S BQIDATA=$G(^BGPMUIND(90596.11,MN,17)) I BQIDATA="" Q
 . S TIP=$G(^BGPMUIND(90595.11,MSN,18,1,0))_$C(10),TP=0
 . F  S TP=$O(^BGPMUIND(90596.11,MN,18,TP)) Q:'TP  S TIP=TIP_^BGPMUIND(90596.11,MN,18,TP,0)_$C(10)
 . S II=II+1,@DATA@(II)=$P(MDATA,U,4)_U_MTYPE_U_$P(BQIDATA,U,3)_U_TIP_$C(30)
  S II=II+1,@DATA@(II)=$C(31)
  Q
  ;
CURPGL() ;EP - Get current performance report global
 NEW CURR,PCN,PGB,PGLOB
 S PGLOB="^APCMMUM"
 S CURR=$P($G(^BQI(90508,1,9)),U,3)
 I CURR'="" D
 . S PCN=$O(^APCMMUCN("B",CURR,"")) I PCN="" Q
 . S PGB=$P(^APCMMUCN(PCN,0),U,4)
 . S PGLOB=$$ROOT^DILFD(PGB,"",1)
 Q PGLOB
 ;
CURPRT() ;EP - Get current performance report routine
 NEW PROU,CURR,PCN
 S PROU="APCM11E1"
 S CURR=$P($G(^BQI(90508,1,9)),U,3)
 I CURR'="" D
 . S PCN=$O(^APCMMUCN("B",CURR,"")) I PCN="" Q
 . S PROU=$P(^APCMMUCN(PCN,0),U,3)
 Q PROU
 ;
CURREP() ;EP - Get current performance report
 NEW PREP,CURR
 I '$$PATCH^XPDUTL("APCM*1.0*2") Q ""
 S PREP="INTERIM STAGE 1 2013"
 S CURR=$P($G(^BQI(90508,1,9)),U,3)
 I CURR'="" S PREP=CURR
 Q PREP
 ;
PRFPGL(REPORT) ;EP - Get preferred performance report global
 I $G(REPORT)="" Q $$CURPGL()
 NEW PCN,PGB,PGLOB
 S PCN=$O(^APCMMUCN("B",REPORT,"")) I PCN="" Q $$CURPGL()
 S PGB=$P(^APCMMUCN(PCN,0),U,4)
 S PGLOB=$$ROOT^DILFD(PGB,"",1)
 Q PGLOB
 ;
PRFPRT(REPORT) ;EP - Get preferred performance report routine
 I $G(REPORT)="" Q $$CURPRT()
 NEW PCN,PROU
 S PCN=$O(^APCMMUCN("B",REPORT,"")) I PCN="" Q $$CURPRT()
 S PROU=$P(^APCMMUCN(PCN,0),U,3)
 Q PROU