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

BQIMUHLP.m

Go to the documentation of this file.
BQIMUHLP ;VNGT/HS/BEE-Get MU Glossary Information ; 08 Oct 2007  3:58 PM
 ;;2.2;ICARE MANAGEMENT SYSTEM;;Jul 28, 2011;Build 37
 ;
 Q
 ;
GLOS(DATA,TYP,OBJ) ;EP -- BQI GET MU GLOSSARY
 ;
 ;Input
 ;  TYP - E (EP) or H (Hospital/CAH)
 ;  OBJ - A specific objective.  If null, gets all objectives
 ;
 NEW UID,II,OIEN,TYPE
 ;
 S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
 S DATA=$NA(^TMP("BQIMUHLP",UID))
 K @DATA
 ;
 S II=0
 NEW $ESTACK,$ETRAP S $ETRAP="D ERR^BQIMUHLP D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
 ;
 S OBJ=$G(OBJ,"")
 S TYP=$G(TYP,""),TYPE=$S(TYP="E":"EP",TYP="H":"HOSPITAL/CAH",1:"")
 ;
 S @DATA@(II)="T00050OBJ_SNAME^T00008CMSET^T01024STAGE1_OBJECTIVE^T01024STAGE1_DEN_DESC^T01024STAGE1_NUM_DESC^"
 S @DATA@(II)=@DATA@(II)_"T01024STAGE1_LOGIC^T01024STAGE1_TARGET"_$C(30)
 ;
 ;Process single APCM MU OBJECTIVE
 I OBJ]"" D  G XGLOS
 . S OIEN="" F  S OIEN=$O(^APCMMUM("C",OBJ,OIEN)) Q:OIEN=""  D GETOBJ(OIEN,TYP)
 ;
 ;Loop through APCM MU OBJECTIVES
 S OBJ="" F  S OBJ=$O(^APCMMUM("C",OBJ)) Q:OBJ=""  D
 . S OIEN="" F  S OIEN=$O(^APCMMUM("C",OBJ,OIEN)) Q:OIEN=""  D GETOBJ(OIEN,TYP)
 ;
XGLOS ;
 S II=II+1,@DATA@(II)=$C(31)
 Q
 ;
GETOBJ(OIEN,TYP) N N,CT,APCM,OBJSNM,CMSET,S1OBJ,DENDSC,NUMDSC,S1LOG,S1TRG
 ;
 ;Pull information for the entry
 D GETS^DIQ(9001300.02,OIEN_",","**","","APCM")
 ;
 ;Pull EP or Hospital
 I TYPE]"",$G(APCM(9001300.02,OIEN_",",.02))'=TYPE Q
 ;
 ;Pull OBJECTIVE SHORT NAME
 S OBJSNM=$G(APCM(9001300.02,OIEN_",",.05))
 ;
 ;Pull CORE OR MENU SET
 S CMSET=$G(APCM(9001300.02,OIEN_",",.03))
 ;
 S II=II+1,@DATA@(II)=OBJSNM_U_CMSET_U
 ;
 ;Stage 1 Objective
 S N=0,CT=1 F  S N=$O(APCM(9001300.02,OIEN_",",1100,N)) Q:'N  S CT=CT+1,S1OBJ(CT)=APCM(9001300.02,OIEN_",",1100,N)
 S N=0 F  S N=$O(S1OBJ(N)) Q:'N  S II=II+1,@DATA@(II)=S1OBJ(N)_$S($O(S1OBJ(N))]"":$C(10),1:"")
 S @DATA@(II)=@DATA@(II)_"^"
 ;
 ;Stage 1 Denominator Description
 S N=0,CT=1 F  S N=$O(APCM(9001300.02,OIEN_",",1400,N)) Q:'N  S CT=CT+1,DENDSC(CT)=APCM(9001300.02,OIEN_",",1400,N)
 S N=0 F  S N=$O(DENDSC(N)) Q:'N  S II=II+1,@DATA@(II)=DENDSC(N)_$S($O(DENDSC(N))]"":$C(10),1:"")
 S @DATA@(II)=@DATA@(II)_"^"
 ;
 ;Stage 1 Numerator Description
 S N=0,CT=1 F  S N=$O(APCM(9001300.02,OIEN_",",1600,N)) Q:'N  S CT=CT+1,NUMDSC(CT)=APCM(9001300.02,OIEN_",",1600,N)
 S N=0 F  S N=$O(NUMDSC(N)) Q:'N  S II=II+1,@DATA@(II)=NUMDSC(N)_$S($O(NUMDSC(N))]"":$C(10),1:"")
 S @DATA@(II)=@DATA@(II)_"^"
 ;
 ;Stage 1 Logic
 S N=0,CT=1 F  S N=$O(APCM(9001300.02,OIEN_",",1800,N)) Q:'N  S CT=CT+1,S1LOG(CT)=APCM(9001300.02,OIEN_",",1800,N)
 S N=0 F  S N=$O(S1LOG(N)) Q:'N  S II=II+1,@DATA@(II)=S1LOG(N)_$S($O(S1LOG(N))]"":$C(10),1:"")
 S @DATA@(II)=@DATA@(II)_"^"
 ;
 ;Stage 1 Target
 S N=0,CT=1 F  S N=$O(APCM(9001300.02,OIEN_",",1300,N)) Q:'N  S CT=CT+1,S1TRG(CT)=APCM(9001300.02,OIEN_",",1300,N)
 S N=0 F  S N=$O(S1TRG(N)) Q:'N  S II=II+1,@DATA@(II)=S1TRG(N)_$S($O(S1TRG(N))]"":$C(10),1:"")
 ;
 S @DATA@(II)=@DATA@(II)_$C(30)
 ;
 Q
 ;
CQGLOS(DATA,TYP) ;EP -- BQI GET MU CQ GLOSSARY
 ;
 ;Input
 ;  TYP - E (Eligible Providers CQ - ie all Non-HOSPITAL MEASURES entries - C/A/M)
 ;        H (HOSPITAL MEASURES)
 ;        C (CORE MEASURES)
 ;        A (ALTERNATE CORE MEASURES)
 ;        M (MENU SET MEASURES)
 ;        
 NEW UID,II,OIEN,TYPE,OTYP
 ;
 S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
 S DATA=$NA(^TMP("BQIMUHLP",UID))
 K @DATA
 ;
 S II=0
 NEW $ESTACK,$ETRAP S $ETRAP="D ERR^BQIMUHLP D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
 ;
 S TYP=$G(TYP,""),TYPE=""
 I TYP]"" S TYPE=$S(TYP="E":"EP",1:$$STC^BQIUL2(90595.11,.04,TYP))
 ;
 S @DATA@(II)="T00005MEAS_NUMB^T00075TITLE^T01024MEAS_DESC^T01024DENOMINATOR^T01024NUMERATOR^T01024EXCL_LOGIC"_$C(30)
 ;
 ;Loop through BGPMU 11 MEASURES
 S OTYP="" F  S OTYP=$O(^BGPMUIND(90595.11,"AMS",OTYP)) Q:OTYP=""  D
 . S OIEN="" F  S OIEN=$O(^BGPMUIND(90595.11,"AMS",OTYP,OIEN)) Q:OIEN=""  D GETCQ(OIEN,TYP)
 ;
XCQGLOS ;
 S II=II+1,@DATA@(II)=$C(31)
 Q
 ;
GETCQ(OIEN,TYP) N N,CT,BGPM,TFLG,MDESC,MDEN,MNUM,MEXC
 ;
 ;Pull information for the entry
 D GETS^DIQ(90595.11,OIEN_",","**","","BGPM")
 ;
 ;Pull MEASURE SET
 I TYPE]"" D  I $G(TFLG)=1 Q
 . N MSET
 . S MSET=$G(BGPM(90595.11,OIEN_",",.04)) I MSET="" S TFLG=1 Q
 . I TYP="E",MSET="HOSPITAL MEASURES" S TFLG=1 Q
 . I TYP'="E",TYPE'=MSET S TFLG=1 Q
 ;
 ;MEASURE NUMBER
 S II=II+1,@DATA@(II)=$G(BGPM(90595.11,OIEN_",",.01))
 ;
 ;TITLE/SELECTION TITLE
 S @DATA@(II)=@DATA@(II)_U_$G(BGPM(90595.11,OIEN_",",.03))_U
 ;
 ;MEASURE DESCRIPTION
 S N=0,CT=1 F  S N=$O(BGPM(90595.11,OIEN_",",1200,N)) Q:'N  S CT=CT+1,MDESC(CT)=BGPM(90595.11,OIEN_",",1200,N)
 S N=0 F  S N=$O(MDESC(N)) Q:'N  S II=II+1,@DATA@(II)=MDESC(N)_$S($O(MDESC(N))]"":$C(10),1:"")
 S @DATA@(II)=@DATA@(II)_"^"
 ;
 ;DENOMINATOR
 S N=0,CT=1 F  S N=$O(BGPM(90595.11,OIEN_",",1400,N)) Q:'N  S CT=CT+1,MDEN(CT)=BGPM(90595.11,OIEN_",",1400,N)
 S N=0 F  S N=$O(MDEN(N)) Q:'N  S II=II+1,@DATA@(II)=MDEN(N)_$S($O(MDEN(N))]"":$C(10),1:"")
 S @DATA@(II)=@DATA@(II)_"^"
 ;
 ;NUMERATOR
 S N=0,CT=1 F  S N=$O(BGPM(90595.11,OIEN_",",1500,N)) Q:'N  S CT=CT+1,MNUM(CT)=BGPM(90595.11,OIEN_",",1500,N)
 S N=0 F  S N=$O(MNUM(N)) Q:'N  S II=II+1,@DATA@(II)=MNUM(N)_$S($O(MNUM(N))]"":$C(10),1:"")
 S @DATA@(II)=@DATA@(II)_"^"
 ;
 ;EXCLUSION LOGIC
 S N=0,CT=1 F  S N=$O(BGPM(90595.11,OIEN_",",1600,N)) Q:'N  S CT=CT+1,MEXC(CT)=BGPM(90595.11,OIEN_",",1600,N)
 S N=0 F  S N=$O(MEXC(N)) Q:'N  S II=II+1,@DATA@(II)=MEXC(N)_$S($O(MEXC(N))]"":$C(10),1:"")
 S @DATA@(II)=@DATA@(II)
 ; 
 S @DATA@(II)=@DATA@(II)_$C(30)
 ;
 Q
 ;
TGET(DATA,FAKE) ;EP -- BQI MU GET TIP DEF
 ;Input
 ;  FAKE - Null, needed for BMXNET
 ;
 NEW UID,II,HDR,PPRF,HPRF,PCQ,HCQ
 S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
 S DATA=$NA(^TMP("BQIMUHLP",UID))
 K @DATA
 ;
 S II=0
 NEW $ESTACK,$ETRAP S $ETRAP="D ERR^BQIMUHLP D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
 ;
 S HDR="T00001PRV_PERF^T00001HSP_PERF^T00001PRV_CQ^T00001HSP_CQ"
 S @DATA@(II)=HDR_$C(30)
 ;
 S PPRF=$$GET1^DIQ(90505,DUZ_",",2.01,"I") S:PPRF="" PPRF="S"
 S HPRF=$$GET1^DIQ(90505,DUZ_",",2.02,"I") S:HPRF="" HPRF="S"
 S PCQ=$$GET1^DIQ(90505,DUZ_",",2.03,"I") S:PCQ="" PCQ="S"
 S HCQ=$$GET1^DIQ(90505,DUZ_",",2.04,"I") S:HCQ="" HCQ="S"
 S II=II+1,@DATA@(II)=PPRF_U_HPRF_U_PCQ_U_HCQ_$C(30)
 S II=II+1,@DATA@(II)=$C(31)
 Q
 ;
TUPD(DATA,PPRF,HPRF,PCQ,HCQ) ;EP -- BQI MU SET TIP DEF
 ;
 ;Description
 ;  Set the user's MU Tip display defaults
 ;
 ;Input
 ;  PPRF - Provider Performance Tip
 ;  HPRF - Hospital Performance Tip
 ;   PCQ - Provider CQ Tip
 ;   HCQ - Hospital CQ Tip
 ;   
 ;Output
 ;  Returns 1-Successful save/-1 - Unsuccessful save
 ;
 ;Expects
 ;  DUZ - the internal entry number of the person signed on
 ;
 NEW UID,II,BQIUPD,ERROR
 S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
 S DATA=$NA(^TMP("BQIMUHLP",UID))
 K @DATA
 ;
 S II=0
 S @DATA@(II)="I00010RESULT"_$C(30)
 ;
 NEW $ESTACK,$ETRAP S $ETRAP="D ERR^BQIPLUSR D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
 ;
 S:PPRF]"" BQIUPD(90505,DUZ_",",2.01)=PPRF
 S:HPRF]"" BQIUPD(90505,DUZ_",",2.02)=HPRF
 S:PCQ]"" BQIUPD(90505,DUZ_",",2.03)=PCQ
 S:HCQ]"" BQIUPD(90505,DUZ_",",2.04)=HCQ
 ;
 D FILE^DIE("","BQIUPD","ERROR")
 K BQIUPD
 S II=II+1
 I '$D(ERROR) S @DATA@(II)="1"_$C(30)
 I $D(ERROR) S @DATA@(II)="-1"_$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