BKMVQCR4 ;PRXM/HC/BWF - BKMV Quality of Care Report; [ 1/19/2005 7:16 PM ] ; 13 Apr 2005 4:47 PM
;;2.1;HIV MANAGEMENT SYSTEM;;Feb 07, 2011
; Quality of Care Audit Report
Q
ARVM03 ; EP - ARV Therapy
; M.03 TAXONOMIES
N ARVM03DT,SITETAX,NDCTAX,GLOBAL,TOTPTS,DFN
S ARVM03DT=$$FMADD^XLFDT(EDATE,-183)
S SITETAX="BKMV NRTI MEDS"
S NDCTAX="BKMV NRTI MED NDCS"
S GLOBAL="^TMP(""BKMVQCR"",$J,""HIVCHK"",DFN,""ARVM03"",VSTDT,TEST)"
S TOTPTS="^TMP(""BKMVQCR"",$J,""HIVCHK"",""ARVM03CNT"")"
S DFN=0,@TOTPTS=0
F S DFN=$O(^TMP("BKMVQCR",$J,"HIVCHK",DFN)) Q:'DFN D
.D MEDTAX^BKMIXX(DFN,SITETAX,EDATE,ARVM03DT,GLOBAL)
.D NDCTAX^BKMIXX1(DFN,NDCTAX,EDATE,ARVM03DT,GLOBAL)
.; Store Medication refusals in same global as regular Medications.
.D REFUSAL^BKMIXX2(DFN,50,SITETAX,EDATE,ARVM03DT,GLOBAL)
.D REFUSAL^BKMIXX2(DFN,50,NDCTAX,EDATE,ARVM03DT,GLOBAL)
.I $D(^TMP("BKMVQCR",$J,"HIVCHK",DFN,"ARVM03")) S @TOTPTS=@TOTPTS+1
Q
ARVM02 ; EP - ARV Therapy
; M.02 TAXONOMIES
N ARVM02DT,SITETAX,NDCTAX,GLOBAL,TOTPTS,DFN
S ARVM02DT=$$FMADD^XLFDT(EDATE,-183)
S SITETAX="BKMV NNRTI MEDS"
S NDCTAX="BKMV NNRTI MED NDCS"
S GLOBAL="^TMP(""BKMVQCR"",$J,""HIVCHK"",DFN,""ARVM02"",VSTDT,TEST)"
S TOTPTS="^TMP(""BKMVQCR"",$J,""HIVCHK"",""ARVM02CNT"")"
S DFN=0,@TOTPTS=0
F S DFN=$O(^TMP("BKMVQCR",$J,"HIVCHK",DFN)) Q:'DFN D
.D MEDTAX^BKMIXX(DFN,SITETAX,EDATE,ARVM02DT,GLOBAL)
.D NDCTAX^BKMIXX1(DFN,NDCTAX,EDATE,ARVM02DT,GLOBAL)
.; Store Medication refusals in same global as regular Medications.
.D REFUSAL^BKMIXX2(DFN,50,SITETAX,EDATE,ARVM02DT,GLOBAL)
.D REFUSAL^BKMIXX2(DFN,50,NDCTAX,EDATE,ARVM02DT,GLOBAL)
.I $D(^TMP("BKMVQCR",$J,"HIVCHK",DFN,"ARVM02")) S @TOTPTS=@TOTPTS+1
Q
ARVM05 ; EP - ARV Therapy
; M.05 TAXONOMIES
N ARVM05DT,SITETAX,NDCTAX,GLOBAL,TOTPTS,DFN
S ARVM05DT=$$FMADD^XLFDT(EDATE,-183)
S SITETAX="BKMV PI MEDS"
S NDCTAX="BKMV PI MED NDCS"
S GLOBAL="^TMP(""BKMVQCR"",$J,""HIVCHK"",DFN,""ARVM05"",VSTDT,TEST)"
S TOTPTS="^TMP(""BKMVQCR"",$J,""HIVCHK"",""ARVM05CNT"")"
S DFN=0,@TOTPTS=0
F S DFN=$O(^TMP("BKMVQCR",$J,"HIVCHK",DFN)) Q:'DFN D
.D MEDTAX^BKMIXX(DFN,SITETAX,EDATE,ARVM05DT,GLOBAL)
.D NDCTAX^BKMIXX1(DFN,NDCTAX,EDATE,ARVM05DT,GLOBAL)
.; Store Medication refusals in same global as regular Medications.
.D REFUSAL^BKMIXX2(DFN,50,SITETAX,EDATE,ARVM05DT,GLOBAL)
.D REFUSAL^BKMIXX2(DFN,50,NDCTAX,EDATE,ARVM05DT,GLOBAL)
.I $D(^TMP("BKMVQCR",$J,"HIVCHK",DFN,"ARVM05")) S @TOTPTS=@TOTPTS+1
Q
PCP ; EP - PCP Prophylaxis
N SITETAX,NDCTAX,GLOBAL,DFN,VSTDT,TEST,RESULT,TOTPTS,FOUND
S SITETAX="BKMV PCP PROPH MEDS"
S NDCTAX="BKMV PCP PROPH MED NDCS"
S GLOBAL="^TMP(""BKMVQCR"",$J,""HIVCHK"",DFN,""PCP"",VSTDT,TEST)"
S TOTPTS="^TMP(""BKMVQCR"",$J,""HIVCHK"",""PCPPTCNT"")"
S DFN=0,@TOTPTS=0
F S DFN=$O(^TMP("BKMVQCR",$J,"HIVCHK",DFN)) Q:'DFN D
.I '$D(^TMP("BKMVQCR",$J,"HIVCHK",DFN,"CD4ABS")) Q
.S VSTDT=""
.S FOUND=0
.; Find earliest CD4 Absolute with results between 50 and 199.
.F S VSTDT=$O(^TMP("BKMVQCR",$J,"HIVCHK",DFN,"CD4ABS",VSTDT)) Q:VSTDT="" D Q:FOUND
..S TEST=""
..F S TEST=$O(^TMP("BKMVQCR",$J,"HIVCHK",DFN,"CD4ABS",VSTDT,TEST)) Q:TEST="" D Q:FOUND
...S RESULT=$P($G(^TMP("BKMVQCR",$J,"HIVCHK",DFN,"CD4ABS",VSTDT,TEST)),U)
...I RESULT="" Q
...I RESULT'<200 Q
...I RESULT<50 Q
...S FOUND=1
.I 'FOUND Q
.; select meds prescribed since the defined CD4 visit
.D MEDTAX^BKMIXX(DFN,SITETAX,EDATE,VSTDT,GLOBAL)
.D NDCTAX^BKMIXX1(DFN,NDCTAX,EDATE,VSTDT,GLOBAL)
.I $D(^TMP("BKMVQCR",$J,"HIVCHK",DFN,"PCP")) S @TOTPTS=@TOTPTS+1
Q
MAC ; EP - MAC Prophylaxis
N SITETAX,NDCTAX,GLOBAL,DFN,VSTDT,TEST,RESULT,TOTPTS,FOUND
S SITETAX="BKMV MAC PROPH MEDS"
S NDCTAX="BKMV MAC PROPH MED NDCS"
S GLOBAL="^TMP(""BKMVQCR"",$J,""HIVCHK"",DFN,""MAC"",VSTDT,TEST)"
S TOTPTS="^TMP(""BKMVQCR"",$J,""HIVCHK"",""MACPTCNT"")"
S DFN=0,@TOTPTS=0
F S DFN=$O(^TMP("BKMVQCR",$J,"HIVCHK",DFN)) Q:'DFN D
.I '$D(^TMP("BKMVQCR",$J,"HIVCHK",DFN,"CD4ABS")) Q
.S VSTDT=""
.S FOUND=0
.; Find earliest CD4 Absolute with results less than 50.
.F S VSTDT=$O(^TMP("BKMVQCR",$J,"HIVCHK",DFN,"CD4ABS",VSTDT)) Q:VSTDT="" D Q:FOUND
..S TEST=""
..F S TEST=$O(^TMP("BKMVQCR",$J,"HIVCHK",DFN,"CD4ABS",VSTDT,TEST)) Q:TEST="" D Q:FOUND
...S RESULT=$G(^TMP("BKMVQCR",$J,"HIVCHK",DFN,"CD4ABS",VSTDT,TEST))
...I RESULT="" Q
...I RESULT'<50 Q
...S FOUND=1
.I 'FOUND Q
.; select meds prescribed since the defined CD4 visit
.D MEDTAX^BKMIXX(DFN,SITETAX,EDATE,VSTDT,GLOBAL)
.D NDCTAX^BKMIXX1(DFN,NDCTAX,EDATE,VSTDT,GLOBAL)
.I $D(^TMP("BKMVQCR",$J,"HIVCHK",DFN,"MAC")) S @TOTPTS=@TOTPTS+1
Q
BKMVQCR4 ;PRXM/HC/BWF - BKMV Quality of Care Report; [ 1/19/2005 7:16 PM ] ; 13 Apr 2005 4:47 PM
+1 ;;2.1;HIV MANAGEMENT SYSTEM;;Feb 07, 2011
+2 ; Quality of Care Audit Report
+3 QUIT
ARVM03 ; EP - ARV Therapy
+1 ; M.03 TAXONOMIES
+2 NEW ARVM03DT,SITETAX,NDCTAX,GLOBAL,TOTPTS,DFN
+3 SET ARVM03DT=$$FMADD^XLFDT(EDATE,-183)
+4 SET SITETAX="BKMV NRTI MEDS"
+5 SET NDCTAX="BKMV NRTI MED NDCS"
+6 SET GLOBAL="^TMP(""BKMVQCR"",$J,""HIVCHK"",DFN,""ARVM03"",VSTDT,TEST)"
+7 SET TOTPTS="^TMP(""BKMVQCR"",$J,""HIVCHK"",""ARVM03CNT"")"
+8 SET DFN=0
SET @TOTPTS=0
+9 FOR
SET DFN=$ORDER(^TMP("BKMVQCR",$JOB,"HIVCHK",DFN))
IF 'DFN
QUIT
Begin DoDot:1
+10 DO MEDTAX^BKMIXX(DFN,SITETAX,EDATE,ARVM03DT,GLOBAL)
+11 DO NDCTAX^BKMIXX1(DFN,NDCTAX,EDATE,ARVM03DT,GLOBAL)
+12 ; Store Medication refusals in same global as regular Medications.
+13 DO REFUSAL^BKMIXX2(DFN,50,SITETAX,EDATE,ARVM03DT,GLOBAL)
+14 DO REFUSAL^BKMIXX2(DFN,50,NDCTAX,EDATE,ARVM03DT,GLOBAL)
+15 IF $DATA(^TMP("BKMVQCR",$JOB,"HIVCHK",DFN,"ARVM03"))
SET @TOTPTS=@TOTPTS+1
End DoDot:1
+16 QUIT
ARVM02 ; EP - ARV Therapy
+1 ; M.02 TAXONOMIES
+2 NEW ARVM02DT,SITETAX,NDCTAX,GLOBAL,TOTPTS,DFN
+3 SET ARVM02DT=$$FMADD^XLFDT(EDATE,-183)
+4 SET SITETAX="BKMV NNRTI MEDS"
+5 SET NDCTAX="BKMV NNRTI MED NDCS"
+6 SET GLOBAL="^TMP(""BKMVQCR"",$J,""HIVCHK"",DFN,""ARVM02"",VSTDT,TEST)"
+7 SET TOTPTS="^TMP(""BKMVQCR"",$J,""HIVCHK"",""ARVM02CNT"")"
+8 SET DFN=0
SET @TOTPTS=0
+9 FOR
SET DFN=$ORDER(^TMP("BKMVQCR",$JOB,"HIVCHK",DFN))
IF 'DFN
QUIT
Begin DoDot:1
+10 DO MEDTAX^BKMIXX(DFN,SITETAX,EDATE,ARVM02DT,GLOBAL)
+11 DO NDCTAX^BKMIXX1(DFN,NDCTAX,EDATE,ARVM02DT,GLOBAL)
+12 ; Store Medication refusals in same global as regular Medications.
+13 DO REFUSAL^BKMIXX2(DFN,50,SITETAX,EDATE,ARVM02DT,GLOBAL)
+14 DO REFUSAL^BKMIXX2(DFN,50,NDCTAX,EDATE,ARVM02DT,GLOBAL)
+15 IF $DATA(^TMP("BKMVQCR",$JOB,"HIVCHK",DFN,"ARVM02"))
SET @TOTPTS=@TOTPTS+1
End DoDot:1
+16 QUIT
ARVM05 ; EP - ARV Therapy
+1 ; M.05 TAXONOMIES
+2 NEW ARVM05DT,SITETAX,NDCTAX,GLOBAL,TOTPTS,DFN
+3 SET ARVM05DT=$$FMADD^XLFDT(EDATE,-183)
+4 SET SITETAX="BKMV PI MEDS"
+5 SET NDCTAX="BKMV PI MED NDCS"
+6 SET GLOBAL="^TMP(""BKMVQCR"",$J,""HIVCHK"",DFN,""ARVM05"",VSTDT,TEST)"
+7 SET TOTPTS="^TMP(""BKMVQCR"",$J,""HIVCHK"",""ARVM05CNT"")"
+8 SET DFN=0
SET @TOTPTS=0
+9 FOR
SET DFN=$ORDER(^TMP("BKMVQCR",$JOB,"HIVCHK",DFN))
IF 'DFN
QUIT
Begin DoDot:1
+10 DO MEDTAX^BKMIXX(DFN,SITETAX,EDATE,ARVM05DT,GLOBAL)
+11 DO NDCTAX^BKMIXX1(DFN,NDCTAX,EDATE,ARVM05DT,GLOBAL)
+12 ; Store Medication refusals in same global as regular Medications.
+13 DO REFUSAL^BKMIXX2(DFN,50,SITETAX,EDATE,ARVM05DT,GLOBAL)
+14 DO REFUSAL^BKMIXX2(DFN,50,NDCTAX,EDATE,ARVM05DT,GLOBAL)
+15 IF $DATA(^TMP("BKMVQCR",$JOB,"HIVCHK",DFN,"ARVM05"))
SET @TOTPTS=@TOTPTS+1
End DoDot:1
+16 QUIT
PCP ; EP - PCP Prophylaxis
+1 NEW SITETAX,NDCTAX,GLOBAL,DFN,VSTDT,TEST,RESULT,TOTPTS,FOUND
+2 SET SITETAX="BKMV PCP PROPH MEDS"
+3 SET NDCTAX="BKMV PCP PROPH MED NDCS"
+4 SET GLOBAL="^TMP(""BKMVQCR"",$J,""HIVCHK"",DFN,""PCP"",VSTDT,TEST)"
+5 SET TOTPTS="^TMP(""BKMVQCR"",$J,""HIVCHK"",""PCPPTCNT"")"
+6 SET DFN=0
SET @TOTPTS=0
+7 FOR
SET DFN=$ORDER(^TMP("BKMVQCR",$JOB,"HIVCHK",DFN))
IF 'DFN
QUIT
Begin DoDot:1
+8 IF '$DATA(^TMP("BKMVQCR",$JOB,"HIVCHK",DFN,"CD4ABS"))
QUIT
+9 SET VSTDT=""
+10 SET FOUND=0
+11 ; Find earliest CD4 Absolute with results between 50 and 199.
+12 FOR
SET VSTDT=$ORDER(^TMP("BKMVQCR",$JOB,"HIVCHK",DFN,"CD4ABS",VSTDT))
IF VSTDT=""
QUIT
Begin DoDot:2
+13 SET TEST=""
+14 FOR
SET TEST=$ORDER(^TMP("BKMVQCR",$JOB,"HIVCHK",DFN,"CD4ABS",VSTDT,TEST))
IF TEST=""
QUIT
Begin DoDot:3
+15 SET RESULT=$PIECE($GET(^TMP("BKMVQCR",$JOB,"HIVCHK",DFN,"CD4ABS",VSTDT,TEST)),U)
+16 IF RESULT=""
QUIT
+17 IF RESULT'<200
QUIT
+18 IF RESULT<50
QUIT
+19 SET FOUND=1
End DoDot:3
IF FOUND
QUIT
End DoDot:2
IF FOUND
QUIT
+20 IF 'FOUND
QUIT
+21 ; select meds prescribed since the defined CD4 visit
+22 DO MEDTAX^BKMIXX(DFN,SITETAX,EDATE,VSTDT,GLOBAL)
+23 DO NDCTAX^BKMIXX1(DFN,NDCTAX,EDATE,VSTDT,GLOBAL)
+24 IF $DATA(^TMP("BKMVQCR",$JOB,"HIVCHK",DFN,"PCP"))
SET @TOTPTS=@TOTPTS+1
End DoDot:1
+25 QUIT
MAC ; EP - MAC Prophylaxis
+1 NEW SITETAX,NDCTAX,GLOBAL,DFN,VSTDT,TEST,RESULT,TOTPTS,FOUND
+2 SET SITETAX="BKMV MAC PROPH MEDS"
+3 SET NDCTAX="BKMV MAC PROPH MED NDCS"
+4 SET GLOBAL="^TMP(""BKMVQCR"",$J,""HIVCHK"",DFN,""MAC"",VSTDT,TEST)"
+5 SET TOTPTS="^TMP(""BKMVQCR"",$J,""HIVCHK"",""MACPTCNT"")"
+6 SET DFN=0
SET @TOTPTS=0
+7 FOR
SET DFN=$ORDER(^TMP("BKMVQCR",$JOB,"HIVCHK",DFN))
IF 'DFN
QUIT
Begin DoDot:1
+8 IF '$DATA(^TMP("BKMVQCR",$JOB,"HIVCHK",DFN,"CD4ABS"))
QUIT
+9 SET VSTDT=""
+10 SET FOUND=0
+11 ; Find earliest CD4 Absolute with results less than 50.
+12 FOR
SET VSTDT=$ORDER(^TMP("BKMVQCR",$JOB,"HIVCHK",DFN,"CD4ABS",VSTDT))
IF VSTDT=""
QUIT
Begin DoDot:2
+13 SET TEST=""
+14 FOR
SET TEST=$ORDER(^TMP("BKMVQCR",$JOB,"HIVCHK",DFN,"CD4ABS",VSTDT,TEST))
IF TEST=""
QUIT
Begin DoDot:3
+15 SET RESULT=$GET(^TMP("BKMVQCR",$JOB,"HIVCHK",DFN,"CD4ABS",VSTDT,TEST))
+16 IF RESULT=""
QUIT
+17 IF RESULT'<50
QUIT
+18 SET FOUND=1
End DoDot:3
IF FOUND
QUIT
End DoDot:2
IF FOUND
QUIT
+19 IF 'FOUND
QUIT
+20 ; select meds prescribed since the defined CD4 visit
+21 DO MEDTAX^BKMIXX(DFN,SITETAX,EDATE,VSTDT,GLOBAL)
+22 DO NDCTAX^BKMIXX1(DFN,NDCTAX,EDATE,VSTDT,GLOBAL)
+23 IF $DATA(^TMP("BKMVQCR",$JOB,"HIVCHK",DFN,"MAC"))
SET @TOTPTS=@TOTPTS+1
End DoDot:1
+24 QUIT