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

BKMVQCR4.m

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