BKMQQCRA ;PRXM/HC/BWF - BKM Quality of Care Report ; 13 Jun 2005 3:41 PM
;;2.1;HIV MANAGEMENT SYSTEM;;Feb 07, 2011
; Quality of Care Audit Report
; Modified to write to a temporary file for iCare
;
PRINT ; EP - Print report.
N TOTPTS,EXDT,INST,HEEXT,CONFS,CONFE,BKMRTN
N LNLEN,LINE,X
N APCHSPAT,APCHSTYP
S DATA=$NA(^TMP("BQIQOC",UID)) K @DATA
;
S LNLEN=80 ; 80 Character display - currently hardcoded - could be a parameter
S LINE="",$P(LINE,"-",LNLEN-1)=""
S CONFS="**** CONFIDENTIAL PATIENT INFORMATION ****"
S CONFE="**** END CONFIDENTIAL PATIENT INFORMATION ****"
;D NOW^%DTC
S EXDT=$$FMTE^XLFDT($$NOW^XLFDT())
S INST=$$GET1^DIQ(4,$G(DUZ(2)),.01,"E")
S HEEXT=$P($$FMTE^XLFDT(EDATE),"@",1)
D COLHDR
S TOTPTS=+$G(@GLOB@("HIVTOT1"))
I TOTPTS=0,$D(NDA) S BMXSEC="RPC Call Failed: This report cannot be run. None of the patients selected for this report meet the criteria."_$C(30) Q
I TOTPTS=0 D UPD("No Data to Report") G DONE
D HDR
D UPD(" Total Patients Reviewed: "_(TOTPTS+$G(NDA)))
D UPD(" Number of Patient Included in this Report "_TOTPTS)
;D UPD(TOTPTS_" Included in this Report .")
D UPD(" (Eligible Population)")
;D UPD($$LINE("","#",50)_" %")
D UPD("")
;D UPD(" Total Number of Eligible Trimesters: 4")
;D UPD("")
D UPD(" Number Percentage")
D WC(" Gender: Male","MALE")
D WC(" Female","FEMALE")
I @GLOB@("UNSPEC") D WC(" Unspecified","UNSPEC")
D UPD("")
D WC(" Age <15 yrs","AGE1")
D WC(" 15-44 yrs","AGE2")
D WC(" 45-64 yrs","AGE3")
D WC(" >64 yrs","AGE4")
D UPD("")
D UPD(" Visits and Related Labs ")
D UPD(" Every 4 months")
D WP(" Total # of Patients w/ Visits","V4M","TOTAL")
D WP(" Patients w/ only a CD4 Count ","CD4M","TOTAL")
D UPD(" every 4 months")
D WP(" Patients w/ only a Viral Load ","VR4M","TOTAL")
D UPD(" every 4 months")
D WP(" Patients w/ both a CD4 Count & a Viral ","BT4M","TOTAL")
D UPD(" Load every 4 months")
D UPD(" Every 6 months")
D WP(" Total # of Patients w/ Visits","V6M","TOTAL")
D WP(" Patients w/ only a CD4 Count ","CD6M","TOTAL")
D UPD(" every 6 months")
D WP(" Patients w/ only a Viral Load ","VR6M","TOTAL")
D UPD(" every 6 months")
D WP(" Patients w/ both a CD4 Count & a Viral ","BT6M","TOTAL")
D UPD(" Load every 6 months")
D UPD("")
D WC(" Number of CD4 counts in Last Time Period","LCD4M",1)
D UPD("")
D WC(" Number of Viral Loads in Last Time Period","LVR4M",1)
;D UPD(" Time Period")
D UPD("")
D UPD(" ARV Management")
D UPD(" Stable")
D WP(" Period 1","STCP1","TOTAL")
D WP(" Period 2","STCP2","TOTAL")
D WP(" Period 3","STCP3","TOTAL")
D UPD(" Unstable")
D WP(" Period 1","UNCP1","TOTAL")
D WP(" Period 2","UNCP2","TOTAL")
D WP(" Period 3","UNCP3","TOTAL")
D UPD(" End Stage")
D WP(" Period 1","ENCP1","TOTAL")
D WP(" Period 2","ENCP2","TOTAL")
D WP(" Period 3","ENCP3","TOTAL")
;D UPD(" No Other Therapeutic Option")
;D WP(" Period 1","NNCP1","TOTAL")
;D WP(" Period 2","NNCP2","TOTAL")
;D WP(" Period 3","NNCP3","TOTAL")
D UPD(" Documentation Assessment")
D WP(" Period 1","AHCP1","TOTAL")
D WP(" Period 2","AHCP2","TOTAL")
D WP(" Period 3","AHCP3","TOTAL")
D UPD("")
D WP(" Patients Managed Appropriately","APPMGT","TOTAL")
D UPD("")
D UPD(" HAART")
D WP(" Total number of patients on HAART","HAART","TOTAL")
D WP(" CD4 0-199","HCD4RES1","TOTAL")
D WP(" CD4 200-349","HCD4RES2","TOTAL")
D WP(" CD4 350-499","HCD4RES3","TOTAL")
D WP(" CD4 greater than or equal to 500","HCD4RES4","TOTAL")
D WP(" Viral Load less than 400","HVIRSUP","TOTAL")
D WP(" Viral Load greater than or equal to 400","HVIRNOT","TOTAL")
D WP(" Viral Load not assessed in past 6 months","HVIR6M","TOTAL")
D UPD("")
D UPD(" NO HAART")
D WP(" Total # of patients","NOHAART","TOTAL")
D WP(" CD4 0-199","NHCD4RES1","TOTAL")
D WP(" CD4 200-349","NHCD4RES2","TOTAL")
D WP(" CD4 350-499","NHCD4RES3","TOTAL")
D WP(" CD4 greater than or equal to 500","NHCD4RES4","TOTAL")
D UPD("")
D UPD(" Prophylaxis")
D WP(" PCP","PCPT","TOTAL")
D WP(" MAC","MACT","TOTAL")
D UPD("")
D UPD(" Screening Indicators")
D UPD(" Lipid Profile")
D WP(" Total # received lipid profile","LIPT","TOTAL")
D WP(" Total # on ARV Regimen","LIPT","LIPIDARV")
D WP(" Total # refused Profile","LIPT","LIPIDREF")
D UPD(" PPD Screening")
D WP(" Total # of TB tests needed","TUBT","NEEDPPD")
D WP(" PPD Received","TUBT","PY")
D WP(" PPD+","TUBT","POSPY")
D WP(" Treatment Provided","TUBT","MED")
D WP(" PPD-","TUBT","NEGPY")
D WP(" PPD Refused","TUBT","REF")
D WP(" PPD Unknown","TUBT","UND")
D UPD(" Hepatitis C Screening")
D WP(" Total # screened","HEPCT","TOTAL")
D UPD(" Syphilis Screening")
D WP(" Total # screened ","RPRT","TOTAL")
D WP(" Reactive","RPRT","REAC")
D WP(" Non-Reactive","RPRT","NONREAC")
D WP(" Refused","RPRT","REF")
D WP(" NMI","RPRT","REFNMI")
D WP(" Undetermined","RPRT","UND")
D UPD(" Chlamydia Screening")
D WP(" Total # screened","CHLAMT","TOTAL")
D WP(" Total # of men screened","CHLAMT","MALE")
D WP(" Total # of women screened","CHLAMT","FEMALE")
D WP(" Total Positive","CHLAMT","POS")
D WP(" Total Negative","CHLAMT","NEG")
D WP(" Total Refused","CHLAMT","REF")
D WP(" NMI","CHLAMT","REFNMI")
D WP(" Undetermined","CHLAMT","UND")
D UPD(" Gonorrhea Screening")
D WP(" Total # screened","GONT","TOTAL")
D WP(" Total # of men screened","GONT","MALE")
D WP(" Total # of women screened","GONT","FEMALE")
D WP(" Total Positive","GONT","POS")
D WP(" Total Negative","GONT","NEG")
D WP(" Total Refused","GONT","REF")
D WP(" NMI","GONT","REFNMI")
D WP(" Undetermined","GONT","UND")
D UPD(" Colorectal Cancer Screening (CRC)")
D WP(" Total # screenings needed","CRCT","TOTAL")
D WP(" CRC screens performed w/in 10yrs","CRCT","CRC")
D UPD(" prior to the report end date")
D WP(" CRC screens refused w/in 10 yrs","CRCT","CRCR")
D UPD(" prior to the report end date")
D UPD("")
D UPD(" General Medical Care Exams - Yearly")
D WP(" Ophthalmology care","EYET","TOTAL")
D WP(" Oral Health","DENTT","TOTAL")
D WP(" Pap smear (women)","PAPT","TOTAL")
D UPD("")
D UPD(" Vaccination")
D WP(" Pneumovax w/in 5 yrs of report end","PNEUMOT","TOTAL")
D UPD(" date OR 2 ever ")
D WP(" Tetanus w/in 10 yrs of report end date","TETT","TOTAL")
D UPD("")
D UPD(" Substance Use Screening and Mental Health Screening")
D WP(" Tobacco Use Screening","TOBT","SCREEN")
D WP(" Current Tobacco User","TOBT","USER")
D WP(" If Yes, Counseled","TOBT","ED")
D WP(" Not a Current User","TOBT","NON")
D WP(" Not Documented","TOBT","UNK")
D UPD("")
D WP(" Substance Use Screening","SUBST","TOTAL")
D UPD("")
D UPD(" Mental Health Screening")
D WP(" Total # Who Received All Components","MHSCRN","TOTAL")
D WP(" Cognitive Function","MHCOG","TOTAL")
D WP(" Depression","MHDEP","TOTAL")
D WP(" Anxiety","MHANX","TOTAL")
D WP(" Sleep","MHSLEEP","TOTAL")
D WP(" Appetite","MHAPP","TOTAL")
D WP(" Domestic Violence","MHDV","TOTAL")
D WP(" Post-Traumatic Stress Disorder","MHPTSD","TOTAL")
D WP(" Psychosocial Assessment","MHPSYC","TOTAL")
D UPD("")
D UPD(" Patient Education")
D WP(" Safe Sex education","SSEX","TOTAL")
D WP(" Family Planning education","FPLN","TOTAL")
D WP(" HIV/AIDS related education","HIVED","TOTAL")
D UPD("")
;PRXM/HC/BHS - 05/10/2006 - Force page break before patient list
D UPD($C(12),1)
D HDR
D CTR("HMS Quality of Care Report"),UPD("")
D UPD(" This report includes all patients who meet the criteria of the selected")
D UPD(" denominator:"),UPD("")
;I $G(BKMRPOP)'="" D
;. D UPD(" * Register Status = Active") ;W !!
;. D UPD(" * Current Diagnosis ="_$S($P(DENPOP,":",2)=" All":" HIV and AIDS",1:$P(DENPOP,":",2))) ;W ?5,"* Current Diagnosis =",$S($P(DENPOP,":",2)=" All":" HIV and AIDS",1:$P(DENPOP,":",2))
D UPD(" 1) HMS Register Status Active with HMS Dx Category values empty, HIV or AIDS")
D UPD(" (i.e., no ""At Risk"" patients);"),UPD("")
D UPD(" OR"),UPD("")
D UPD(" 2) Proposed and/or Accepted Dx tag of HIV/AIDS (user selects either or both")
D UPD(" Tag Status);"),UPD("")
D UPD(" OR"),UPD("")
D UPD(" 3) Specific patients on the grid."),UPD("")
D UPD(" Any denominator is filtered automatically by the following logic: patients")
D UPD(" must have at least one HIV/AIDS POV or Active Problem List or HMS Initial")
D UPD(" HIV Dx Date or HMS Initial AIDS Dx Date 6 months or more prior to report")
D UPD(" end date."),UPD("")
;D UPD(" * "_DENPOP),UPD("")
D UPD(" Total patients reviewed (All patients in denominator): "_(TOTPTS+$G(NDA))),UPD("") ;,!!
;D UPD(" Total Patients Reviewed: "_(TOTPTS+$G(NDA))),UPD("") ;,!!
D UPD(" Number of Patients included on Report (filtered denominator): "_TOTPTS),UPD("")
D UPD(" Number of Patients NOT included on Report: "_+$G(NDA)),UPD("")
D UPD($C(12),1)
D HDR
D UPD(" The following user selected patients are included on this report:")
D UPD("")
S BKMRTN=""
D PATHDR
; Loop through patient list
S BKMDFN=""
F S BKMDFN=$O(@GLOB@("HIVCHK",BKMDFN)) Q:BKMDFN=""!('+BKMDFN) D
. S BKMPATN=$$GET1^DIQ(2,BKMDFN,".01","E")
. I BKMPATN="" S BKMPATN="{MISSING NAME}"
. S @GLOB@("HIVCHK","SORTED BY NAME",BKMPATN,BKMDFN)=""
; Loop through patient list sorted by name
S BKMPATN="",BKMRTN=""
F S BKMPATN=$O(@GLOB@("HIVCHK","SORTED BY NAME",BKMPATN)) Q:BKMPATN="" D Q:BKMRTN="^"
. S BKMDFN="",BKMRTN=""
. F S BKMDFN=$O(@GLOB@("HIVCHK","SORTED BY NAME",BKMPATN,BKMDFN)) Q:BKMDFN=""!('+BKMDFN) D Q:BKMRTN="^"
.. D PAT(BKMPATN,BKMDFN)
I $D(NDA) D
. D UPD("")
. D UPD($C(12),1)
. D HDR
. ; Loop through patient list
. ;D UPD(""),UPD(+$G(NDA)_" patients were reviewed and not included in this report because they did")
. ;D UPD("not meet the first criteria listed above."),UPD("")
. D UPD(" The following user selected patients are NOT included in the report:"),UPD("")
. D PATHDR
. S BKMPATN=""
. F S BKMPATN=$O(NDA(BKMPATN)) Q:BKMPATN="" D
.. S BKMDFN=""
.. F S BKMDFN=$O(NDA(BKMPATN,BKMDFN)) Q:BKMDFN="" D
... D PAT(BKMPATN,BKMDFN)
D UPD(""),UPD("")
D CTR(CONFE)
S BQII=BQII+1,@DATA@(BQII)=$C(30)
G DONE
;
HDR ; Report header
D UPD($$PAD^BKMIXX4($$GET1^DIQ(200,DUZ_",","1","E"),">"," ",55)_$$PAD^BKMIXX4($$FMTE^BQIUL1($$NOW^XLFDT()),">"," ",25)) ;***
D CTR(INST)
D CTR("HMS CUMULATIVE AUDIT REPORT")
D CTR("HIV QUALITY OF CARE")
;D CTR("*** HMS CUMULATIVE AUDIT REPORT -- HIV QUALITY OF CARE ***")
I PLNM'="" D CTR(PLNM)
D CTR(DENPOP)
;D CTR("Denominator Population - "_DENPOP)
D CTR("PERIOD ENDING: "_HEEXT)
;D CTR("Period Ending: "_HEEXT)
D CTR(CONFS)
D UPD(" "_LINE)
Q
;
WC(STR,TYPE,PER) ;
N VAL
I TYPE="" Q
I $G(PER)="" S PER=0
S VAL=+$G(@GLOB@(TYPE))
S STR=$$LINE(STR,$J(VAL,3),47)
;W ?47,$J(VAL,3)
I 'PER S STR=$$LINE(STR,$J(VAL/TOTPTS*100,5,1)_"%",55)
;W ?55,$J(VAL/TOTPTS*100,5,1),"%",!
D UPD(STR)
Q
WP(STR,CAT,TYPE) ;
N VAL,PERC
I TYPE="" Q
S VAL=+$G(@GLOB@(CAT,TYPE,"CNT"))
S STR=$$LINE(STR,$J(VAL,3),47)
;W ?47,$J(VAL,3)
S PERC=$G(@GLOB@(CAT,TYPE,"PERC"))
S STR=$$LINE(STR,$J(PERC,5,1)_"%",55)
D UPD(STR)
;W ?55,$J(PERC,5,1),"%",!
Q
PAT(BKMPATN,BKMDFN) ;
N BKMIEN,BKMREG,TEXT,DXCAT
Q:$G(BKMPATN)=""!($G(BKMDFN)="")
S TEXT=$G(BKMPATN)
;S TEXT=" "_$G(BKMPATN)
S TEXT=$$LINE(TEXT,$$HRN^BKMVA1(BKMDFN),29)
S TEXT=$$LINE(TEXT," "_$$GET1^DIQ(2,BKMDFN,".033","E"),36)
S TEXT=$$LINE(TEXT," "_$$GET1^DIQ(2,BKMDFN,".02","I"),40)
;S DXCAT=$P($$ACT^BKMQUTL(BKMDFN,HMSIEN,""),U,2)
;I DXCAT'="" S TEXT=$$LINE(TEXT,"HIV/AIDS ("_DXCAT_")",45)
S BKMIEN=$$BKMIEN^BKMIXX3(BKMDFN)
I BKMIEN="" D UPD(TEXT) Q
S BKMREG=$$BKMREG^BKMIXX3(BKMIEN)
I BKMREG="" D UPD(TEXT) Q
;S TEXT=$$LINE(TEXT," "_$$GET1^DIQ(90451.01,BKMREG_","_BKMIEN_",",".5","E"),58)
S TEXT=$$LINE(TEXT,$E($$GET1^DIQ(90451.01,BKMREG_","_BKMIEN_",","2.3","E"),1,4),44)
S TEXT=$$LINE(TEXT,$$FMTE^XLFDT($$GET1^DIQ(90451.01,BKMREG_","_BKMIEN_",","5","I"),"5Z"),49)
S TEXT=$$LINE(TEXT,$$FMTE^XLFDT($$GET1^DIQ(90451.01,BKMREG_","_BKMIEN_",","5.5","I"),"5Z"),61)
S DXCAT=$P($$ACT^BKMQUTL(BKMDFN,HMSIEN,""),U,2)
I DXCAT'="" S TEXT=$$LINE(TEXT,DXCAT,76)
D UPD(TEXT)
Q
PATHDR ;
N BKMHDR,TEXT
S $P(BKMHDR,"-",79)=""
S TEXT=" "
S TEXT=$$LINE(TEXT,"REG",44)
S TEXT=$$LINE(TEXT,"INITIAL HIV",49)
S TEXT=$$LINE(TEXT,"INITIAL AIDS",61)
S TEXT=$$LINE(TEXT,"TAG",74)
D UPD(TEXT)
S TEXT="PATIENT NAME"
S TEXT=$$LINE(TEXT,"HRN",29)
S TEXT=$$LINE(TEXT,"AGE",36)
S TEXT=$$LINE(TEXT,"SEX",40)
S TEXT=$$LINE(TEXT,"DX",45)
S TEXT=$$LINE(TEXT,"DX DATE",52)
S TEXT=$$LINE(TEXT,"DX DATE",65)
S TEXT=$$LINE(TEXT,"STATUS",74)
D UPD(TEXT)
S TEXT=$E(BKMHDR,1,12)
S TEXT=$$LINE(TEXT,$E(BKMHDR,1,3),29)
S TEXT=$$LINE(TEXT,$E(BKMHDR,1,3),36)
S TEXT=$$LINE(TEXT,$E(BKMHDR,1,3),40)
S TEXT=$$LINE(TEXT,$E(BKMHDR,1,3),44)
S TEXT=$$LINE(TEXT,$E(BKMHDR,1,11),49)
S TEXT=$$LINE(TEXT,$E(BKMHDR,1,12),61)
S TEXT=$$LINE(TEXT,$E(BKMHDR,1,6),74)
D UPD(TEXT)
Q
;
CTR(TEXT) ; EP - Center data.
;
; Input - TEXT - Text (required)
; LENGTH - Line length (default is 80)
; This utility will center the data before filing it to the RPC temporary global.
;
N CENTER,CLINE,LEN,START
S LEN=$L(TEXT)
S CENTER=LEN/2,CLINE=LNLEN/2
S START=CLINE-CENTER\1
S TEXT=$$LINE("",TEXT,START)
D UPD(TEXT)
Q
;
LINE(TEXT,STR,POS) ; Set text to match Quality of Care report formatting
I $L(TEXT)>POS Q TEXT_STR
S $E(TEXT,POS)=STR
Q TEXT
;
UPD(LINE,SUPP) ; Update global with line of text; update page and total line count
;SUPP - Suppress line feed carriage return
S SUPP=$G(SUPP)
S BQII=BQII+1,@DATA@(BQII)=LINE_$S(SUPP:"",1:$C(13)_$C(10))
Q
;
DONE ;
;
S BQII=BQII+1,@DATA@(BQII)=$C(31)
Q
;
COLHDR ;
S @DATA@(BQII)="T00120REPORT_TEXT"_$C(30)
;S @DATA@(BQII)="T99999REPORT_TEXT"_$C(30)
Q
BKMQQCRA ;PRXM/HC/BWF - BKM Quality of Care Report ; 13 Jun 2005 3:41 PM
+1 ;;2.1;HIV MANAGEMENT SYSTEM;;Feb 07, 2011
+2 ; Quality of Care Audit Report
+3 ; Modified to write to a temporary file for iCare
+4 ;
PRINT ; EP - Print report.
+1 NEW TOTPTS,EXDT,INST,HEEXT,CONFS,CONFE,BKMRTN
+2 NEW LNLEN,LINE,X
+3 NEW APCHSPAT,APCHSTYP
+4 SET DATA=$NAME(^TMP("BQIQOC",UID))
KILL @DATA
+5 ;
+6 ; 80 Character display - currently hardcoded - could be a parameter
SET LNLEN=80
+7 SET LINE=""
SET $PIECE(LINE,"-",LNLEN-1)=""
+8 SET CONFS="**** CONFIDENTIAL PATIENT INFORMATION ****"
+9 SET CONFE="**** END CONFIDENTIAL PATIENT INFORMATION ****"
+10 ;D NOW^%DTC
+11 SET EXDT=$$FMTE^XLFDT($$NOW^XLFDT())
+12 SET INST=$$GET1^DIQ(4,$GET(DUZ(2)),.01,"E")
+13 SET HEEXT=$PIECE($$FMTE^XLFDT(EDATE),"@",1)
+14 DO COLHDR
+15 SET TOTPTS=+$GET(@GLOB@("HIVTOT1"))
+16 IF TOTPTS=0
IF $DATA(NDA)
SET BMXSEC="RPC Call Failed: This report cannot be run. None of the patients selected for this report meet the criteria."_$CHAR(30)
QUIT
+17 IF TOTPTS=0
DO UPD("No Data to Report")
GOTO DONE
+18 DO HDR
+19 DO UPD(" Total Patients Reviewed: "_(TOTPTS+$GET(NDA)))
+20 DO UPD(" Number of Patient Included in this Report "_TOTPTS)
+21 ;D UPD(TOTPTS_" Included in this Report .")
+22 DO UPD(" (Eligible Population)")
+23 ;D UPD($$LINE("","#",50)_" %")
+24 DO UPD("")
+25 ;D UPD(" Total Number of Eligible Trimesters: 4")
+26 ;D UPD("")
+27 DO UPD(" Number Percentage")
+28 DO WC(" Gender: Male","MALE")
+29 DO WC(" Female","FEMALE")
+30 IF @GLOB@("UNSPEC")
DO WC(" Unspecified","UNSPEC")
+31 DO UPD("")
+32 DO WC(" Age <15 yrs","AGE1")
+33 DO WC(" 15-44 yrs","AGE2")
+34 DO WC(" 45-64 yrs","AGE3")
+35 DO WC(" >64 yrs","AGE4")
+36 DO UPD("")
+37 DO UPD(" Visits and Related Labs ")
+38 DO UPD(" Every 4 months")
+39 DO WP(" Total # of Patients w/ Visits","V4M","TOTAL")
+40 DO WP(" Patients w/ only a CD4 Count ","CD4M","TOTAL")
+41 DO UPD(" every 4 months")
+42 DO WP(" Patients w/ only a Viral Load ","VR4M","TOTAL")
+43 DO UPD(" every 4 months")
+44 DO WP(" Patients w/ both a CD4 Count & a Viral ","BT4M","TOTAL")
+45 DO UPD(" Load every 4 months")
+46 DO UPD(" Every 6 months")
+47 DO WP(" Total # of Patients w/ Visits","V6M","TOTAL")
+48 DO WP(" Patients w/ only a CD4 Count ","CD6M","TOTAL")
+49 DO UPD(" every 6 months")
+50 DO WP(" Patients w/ only a Viral Load ","VR6M","TOTAL")
+51 DO UPD(" every 6 months")
+52 DO WP(" Patients w/ both a CD4 Count & a Viral ","BT6M","TOTAL")
+53 DO UPD(" Load every 6 months")
+54 DO UPD("")
+55 DO WC(" Number of CD4 counts in Last Time Period","LCD4M",1)
+56 DO UPD("")
+57 DO WC(" Number of Viral Loads in Last Time Period","LVR4M",1)
+58 ;D UPD(" Time Period")
+59 DO UPD("")
+60 DO UPD(" ARV Management")
+61 DO UPD(" Stable")
+62 DO WP(" Period 1","STCP1","TOTAL")
+63 DO WP(" Period 2","STCP2","TOTAL")
+64 DO WP(" Period 3","STCP3","TOTAL")
+65 DO UPD(" Unstable")
+66 DO WP(" Period 1","UNCP1","TOTAL")
+67 DO WP(" Period 2","UNCP2","TOTAL")
+68 DO WP(" Period 3","UNCP3","TOTAL")
+69 DO UPD(" End Stage")
+70 DO WP(" Period 1","ENCP1","TOTAL")
+71 DO WP(" Period 2","ENCP2","TOTAL")
+72 DO WP(" Period 3","ENCP3","TOTAL")
+73 ;D UPD(" No Other Therapeutic Option")
+74 ;D WP(" Period 1","NNCP1","TOTAL")
+75 ;D WP(" Period 2","NNCP2","TOTAL")
+76 ;D WP(" Period 3","NNCP3","TOTAL")
+77 DO UPD(" Documentation Assessment")
+78 DO WP(" Period 1","AHCP1","TOTAL")
+79 DO WP(" Period 2","AHCP2","TOTAL")
+80 DO WP(" Period 3","AHCP3","TOTAL")
+81 DO UPD("")
+82 DO WP(" Patients Managed Appropriately","APPMGT","TOTAL")
+83 DO UPD("")
+84 DO UPD(" HAART")
+85 DO WP(" Total number of patients on HAART","HAART","TOTAL")
+86 DO WP(" CD4 0-199","HCD4RES1","TOTAL")
+87 DO WP(" CD4 200-349","HCD4RES2","TOTAL")
+88 DO WP(" CD4 350-499","HCD4RES3","TOTAL")
+89 DO WP(" CD4 greater than or equal to 500","HCD4RES4","TOTAL")
+90 DO WP(" Viral Load less than 400","HVIRSUP","TOTAL")
+91 DO WP(" Viral Load greater than or equal to 400","HVIRNOT","TOTAL")
+92 DO WP(" Viral Load not assessed in past 6 months","HVIR6M","TOTAL")
+93 DO UPD("")
+94 DO UPD(" NO HAART")
+95 DO WP(" Total # of patients","NOHAART","TOTAL")
+96 DO WP(" CD4 0-199","NHCD4RES1","TOTAL")
+97 DO WP(" CD4 200-349","NHCD4RES2","TOTAL")
+98 DO WP(" CD4 350-499","NHCD4RES3","TOTAL")
+99 DO WP(" CD4 greater than or equal to 500","NHCD4RES4","TOTAL")
+100 DO UPD("")
+101 DO UPD(" Prophylaxis")
+102 DO WP(" PCP","PCPT","TOTAL")
+103 DO WP(" MAC","MACT","TOTAL")
+104 DO UPD("")
+105 DO UPD(" Screening Indicators")
+106 DO UPD(" Lipid Profile")
+107 DO WP(" Total # received lipid profile","LIPT","TOTAL")
+108 DO WP(" Total # on ARV Regimen","LIPT","LIPIDARV")
+109 DO WP(" Total # refused Profile","LIPT","LIPIDREF")
+110 DO UPD(" PPD Screening")
+111 DO WP(" Total # of TB tests needed","TUBT","NEEDPPD")
+112 DO WP(" PPD Received","TUBT","PY")
+113 DO WP(" PPD+","TUBT","POSPY")
+114 DO WP(" Treatment Provided","TUBT","MED")
+115 DO WP(" PPD-","TUBT","NEGPY")
+116 DO WP(" PPD Refused","TUBT","REF")
+117 DO WP(" PPD Unknown","TUBT","UND")
+118 DO UPD(" Hepatitis C Screening")
+119 DO WP(" Total # screened","HEPCT","TOTAL")
+120 DO UPD(" Syphilis Screening")
+121 DO WP(" Total # screened ","RPRT","TOTAL")
+122 DO WP(" Reactive","RPRT","REAC")
+123 DO WP(" Non-Reactive","RPRT","NONREAC")
+124 DO WP(" Refused","RPRT","REF")
+125 DO WP(" NMI","RPRT","REFNMI")
+126 DO WP(" Undetermined","RPRT","UND")
+127 DO UPD(" Chlamydia Screening")
+128 DO WP(" Total # screened","CHLAMT","TOTAL")
+129 DO WP(" Total # of men screened","CHLAMT","MALE")
+130 DO WP(" Total # of women screened","CHLAMT","FEMALE")
+131 DO WP(" Total Positive","CHLAMT","POS")
+132 DO WP(" Total Negative","CHLAMT","NEG")
+133 DO WP(" Total Refused","CHLAMT","REF")
+134 DO WP(" NMI","CHLAMT","REFNMI")
+135 DO WP(" Undetermined","CHLAMT","UND")
+136 DO UPD(" Gonorrhea Screening")
+137 DO WP(" Total # screened","GONT","TOTAL")
+138 DO WP(" Total # of men screened","GONT","MALE")
+139 DO WP(" Total # of women screened","GONT","FEMALE")
+140 DO WP(" Total Positive","GONT","POS")
+141 DO WP(" Total Negative","GONT","NEG")
+142 DO WP(" Total Refused","GONT","REF")
+143 DO WP(" NMI","GONT","REFNMI")
+144 DO WP(" Undetermined","GONT","UND")
+145 DO UPD(" Colorectal Cancer Screening (CRC)")
+146 DO WP(" Total # screenings needed","CRCT","TOTAL")
+147 DO WP(" CRC screens performed w/in 10yrs","CRCT","CRC")
+148 DO UPD(" prior to the report end date")
+149 DO WP(" CRC screens refused w/in 10 yrs","CRCT","CRCR")
+150 DO UPD(" prior to the report end date")
+151 DO UPD("")
+152 DO UPD(" General Medical Care Exams - Yearly")
+153 DO WP(" Ophthalmology care","EYET","TOTAL")
+154 DO WP(" Oral Health","DENTT","TOTAL")
+155 DO WP(" Pap smear (women)","PAPT","TOTAL")
+156 DO UPD("")
+157 DO UPD(" Vaccination")
+158 DO WP(" Pneumovax w/in 5 yrs of report end","PNEUMOT","TOTAL")
+159 DO UPD(" date OR 2 ever ")
+160 DO WP(" Tetanus w/in 10 yrs of report end date","TETT","TOTAL")
+161 DO UPD("")
+162 DO UPD(" Substance Use Screening and Mental Health Screening")
+163 DO WP(" Tobacco Use Screening","TOBT","SCREEN")
+164 DO WP(" Current Tobacco User","TOBT","USER")
+165 DO WP(" If Yes, Counseled","TOBT","ED")
+166 DO WP(" Not a Current User","TOBT","NON")
+167 DO WP(" Not Documented","TOBT","UNK")
+168 DO UPD("")
+169 DO WP(" Substance Use Screening","SUBST","TOTAL")
+170 DO UPD("")
+171 DO UPD(" Mental Health Screening")
+172 DO WP(" Total # Who Received All Components","MHSCRN","TOTAL")
+173 DO WP(" Cognitive Function","MHCOG","TOTAL")
+174 DO WP(" Depression","MHDEP","TOTAL")
+175 DO WP(" Anxiety","MHANX","TOTAL")
+176 DO WP(" Sleep","MHSLEEP","TOTAL")
+177 DO WP(" Appetite","MHAPP","TOTAL")
+178 DO WP(" Domestic Violence","MHDV","TOTAL")
+179 DO WP(" Post-Traumatic Stress Disorder","MHPTSD","TOTAL")
+180 DO WP(" Psychosocial Assessment","MHPSYC","TOTAL")
+181 DO UPD("")
+182 DO UPD(" Patient Education")
+183 DO WP(" Safe Sex education","SSEX","TOTAL")
+184 DO WP(" Family Planning education","FPLN","TOTAL")
+185 DO WP(" HIV/AIDS related education","HIVED","TOTAL")
+186 DO UPD("")
+187 ;PRXM/HC/BHS - 05/10/2006 - Force page break before patient list
+188 DO UPD($CHAR(12),1)
+189 DO HDR
+190 DO CTR("HMS Quality of Care Report")
DO UPD("")
+191 DO UPD(" This report includes all patients who meet the criteria of the selected")
+192 DO UPD(" denominator:")
DO UPD("")
+193 ;I $G(BKMRPOP)'="" D
+194 ;. D UPD(" * Register Status = Active") ;W !!
+195 ;. D UPD(" * Current Diagnosis ="_$S($P(DENPOP,":",2)=" All":" HIV and AIDS",1:$P(DENPOP,":",2))) ;W ?5,"* Current Diagnosis =",$S($P(DENPOP,":",2)=" All":" HIV and AIDS",1:$P(DENPOP,":",2))
+196 DO UPD(" 1) HMS Register Status Active with HMS Dx Category values empty, HIV or AIDS")
+197 DO UPD(" (i.e., no ""At Risk"" patients);")
DO UPD("")
+198 DO UPD(" OR")
DO UPD("")
+199 DO UPD(" 2) Proposed and/or Accepted Dx tag of HIV/AIDS (user selects either or both")
+200 DO UPD(" Tag Status);")
DO UPD("")
+201 DO UPD(" OR")
DO UPD("")
+202 DO UPD(" 3) Specific patients on the grid.")
DO UPD("")
+203 DO UPD(" Any denominator is filtered automatically by the following logic: patients")
+204 DO UPD(" must have at least one HIV/AIDS POV or Active Problem List or HMS Initial")
+205 DO UPD(" HIV Dx Date or HMS Initial AIDS Dx Date 6 months or more prior to report")
+206 DO UPD(" end date.")
DO UPD("")
+207 ;D UPD(" * "_DENPOP),UPD("")
+208 ;,!!
DO UPD(" Total patients reviewed (All patients in denominator): "_(TOTPTS+$GET(NDA)))
DO UPD("")
+209 ;D UPD(" Total Patients Reviewed: "_(TOTPTS+$G(NDA))),UPD("") ;,!!
+210 DO UPD(" Number of Patients included on Report (filtered denominator): "_TOTPTS)
DO UPD("")
+211 DO UPD(" Number of Patients NOT included on Report: "_+$GET(NDA))
DO UPD("")
+212 DO UPD($CHAR(12),1)
+213 DO HDR
+214 DO UPD(" The following user selected patients are included on this report:")
+215 DO UPD("")
+216 SET BKMRTN=""
+217 DO PATHDR
+218 ; Loop through patient list
+219 SET BKMDFN=""
+220 FOR
SET BKMDFN=$ORDER(@GLOB@("HIVCHK",BKMDFN))
IF BKMDFN=""!('+BKMDFN)
QUIT
Begin DoDot:1
+221 SET BKMPATN=$$GET1^DIQ(2,BKMDFN,".01","E")
+222 IF BKMPATN=""
SET BKMPATN="{MISSING NAME}"
+223 SET @GLOB@("HIVCHK","SORTED BY NAME",BKMPATN,BKMDFN)=""
End DoDot:1
+224 ; Loop through patient list sorted by name
+225 SET BKMPATN=""
SET BKMRTN=""
+226 FOR
SET BKMPATN=$ORDER(@GLOB@("HIVCHK","SORTED BY NAME",BKMPATN))
IF BKMPATN=""
QUIT
Begin DoDot:1
+227 SET BKMDFN=""
SET BKMRTN=""
+228 FOR
SET BKMDFN=$ORDER(@GLOB@("HIVCHK","SORTED BY NAME",BKMPATN,BKMDFN))
IF BKMDFN=""!('+BKMDFN)
QUIT
Begin DoDot:2
+229 DO PAT(BKMPATN,BKMDFN)
End DoDot:2
IF BKMRTN="^"
QUIT
End DoDot:1
IF BKMRTN="^"
QUIT
+230 IF $DATA(NDA)
Begin DoDot:1
+231 DO UPD("")
+232 DO UPD($CHAR(12),1)
+233 DO HDR
+234 ; Loop through patient list
+235 ;D UPD(""),UPD(+$G(NDA)_" patients were reviewed and not included in this report because they did")
+236 ;D UPD("not meet the first criteria listed above."),UPD("")
+237 DO UPD(" The following user selected patients are NOT included in the report:")
DO UPD("")
+238 DO PATHDR
+239 SET BKMPATN=""
+240 FOR
SET BKMPATN=$ORDER(NDA(BKMPATN))
IF BKMPATN=""
QUIT
Begin DoDot:2
+241 SET BKMDFN=""
+242 FOR
SET BKMDFN=$ORDER(NDA(BKMPATN,BKMDFN))
IF BKMDFN=""
QUIT
Begin DoDot:3
+243 DO PAT(BKMPATN,BKMDFN)
End DoDot:3
End DoDot:2
End DoDot:1
+244 DO UPD("")
DO UPD("")
+245 DO CTR(CONFE)
+246 SET BQII=BQII+1
SET @DATA@(BQII)=$CHAR(30)
+247 GOTO DONE
+248 ;
HDR ; Report header
+1 ;***
DO UPD($$PAD^BKMIXX4($$GET1^DIQ(200,DUZ_",","1","E"),">"," ",55)_$$PAD^BKMIXX4($$FMTE^BQIUL1($$NOW^XLFDT()),">"," ",25))
+2 DO CTR(INST)
+3 DO CTR("HMS CUMULATIVE AUDIT REPORT")
+4 DO CTR("HIV QUALITY OF CARE")
+5 ;D CTR("*** HMS CUMULATIVE AUDIT REPORT -- HIV QUALITY OF CARE ***")
+6 IF PLNM'=""
DO CTR(PLNM)
+7 DO CTR(DENPOP)
+8 ;D CTR("Denominator Population - "_DENPOP)
+9 DO CTR("PERIOD ENDING: "_HEEXT)
+10 ;D CTR("Period Ending: "_HEEXT)
+11 DO CTR(CONFS)
+12 DO UPD(" "_LINE)
+13 QUIT
+14 ;
WC(STR,TYPE,PER) ;
+1 NEW VAL
+2 IF TYPE=""
QUIT
+3 IF $GET(PER)=""
SET PER=0
+4 SET VAL=+$GET(@GLOB@(TYPE))
+5 SET STR=$$LINE(STR,$JUSTIFY(VAL,3),47)
+6 ;W ?47,$J(VAL,3)
+7 IF 'PER
SET STR=$$LINE(STR,$JUSTIFY(VAL/TOTPTS*100,5,1)_"%",55)
+8 ;W ?55,$J(VAL/TOTPTS*100,5,1),"%",!
+9 DO UPD(STR)
+10 QUIT
WP(STR,CAT,TYPE) ;
+1 NEW VAL,PERC
+2 IF TYPE=""
QUIT
+3 SET VAL=+$GET(@GLOB@(CAT,TYPE,"CNT"))
+4 SET STR=$$LINE(STR,$JUSTIFY(VAL,3),47)
+5 ;W ?47,$J(VAL,3)
+6 SET PERC=$GET(@GLOB@(CAT,TYPE,"PERC"))
+7 SET STR=$$LINE(STR,$JUSTIFY(PERC,5,1)_"%",55)
+8 DO UPD(STR)
+9 ;W ?55,$J(PERC,5,1),"%",!
+10 QUIT
PAT(BKMPATN,BKMDFN) ;
+1 NEW BKMIEN,BKMREG,TEXT,DXCAT
+2 IF $GET(BKMPATN)=""!($GET(BKMDFN)="")
QUIT
+3 SET TEXT=$GET(BKMPATN)
+4 ;S TEXT=" "_$G(BKMPATN)
+5 SET TEXT=$$LINE(TEXT,$$HRN^BKMVA1(BKMDFN),29)
+6 SET TEXT=$$LINE(TEXT," "_$$GET1^DIQ(2,BKMDFN,".033","E"),36)
+7 SET TEXT=$$LINE(TEXT," "_$$GET1^DIQ(2,BKMDFN,".02","I"),40)
+8 ;S DXCAT=$P($$ACT^BKMQUTL(BKMDFN,HMSIEN,""),U,2)
+9 ;I DXCAT'="" S TEXT=$$LINE(TEXT,"HIV/AIDS ("_DXCAT_")",45)
+10 SET BKMIEN=$$BKMIEN^BKMIXX3(BKMDFN)
+11 IF BKMIEN=""
DO UPD(TEXT)
QUIT
+12 SET BKMREG=$$BKMREG^BKMIXX3(BKMIEN)
+13 IF BKMREG=""
DO UPD(TEXT)
QUIT
+14 ;S TEXT=$$LINE(TEXT," "_$$GET1^DIQ(90451.01,BKMREG_","_BKMIEN_",",".5","E"),58)
+15 SET TEXT=$$LINE(TEXT,$EXTRACT($$GET1^DIQ(90451.01,BKMREG_","_BKMIEN_",","2.3","E"),1,4),44)
+16 SET TEXT=$$LINE(TEXT,$$FMTE^XLFDT($$GET1^DIQ(90451.01,BKMREG_","_BKMIEN_",","5","I"),"5Z"),49)
+17 SET TEXT=$$LINE(TEXT,$$FMTE^XLFDT($$GET1^DIQ(90451.01,BKMREG_","_BKMIEN_",","5.5","I"),"5Z"),61)
+18 SET DXCAT=$PIECE($$ACT^BKMQUTL(BKMDFN,HMSIEN,""),U,2)
+19 IF DXCAT'=""
SET TEXT=$$LINE(TEXT,DXCAT,76)
+20 DO UPD(TEXT)
+21 QUIT
PATHDR ;
+1 NEW BKMHDR,TEXT
+2 SET $PIECE(BKMHDR,"-",79)=""
+3 SET TEXT=" "
+4 SET TEXT=$$LINE(TEXT,"REG",44)
+5 SET TEXT=$$LINE(TEXT,"INITIAL HIV",49)
+6 SET TEXT=$$LINE(TEXT,"INITIAL AIDS",61)
+7 SET TEXT=$$LINE(TEXT,"TAG",74)
+8 DO UPD(TEXT)
+9 SET TEXT="PATIENT NAME"
+10 SET TEXT=$$LINE(TEXT,"HRN",29)
+11 SET TEXT=$$LINE(TEXT,"AGE",36)
+12 SET TEXT=$$LINE(TEXT,"SEX",40)
+13 SET TEXT=$$LINE(TEXT,"DX",45)
+14 SET TEXT=$$LINE(TEXT,"DX DATE",52)
+15 SET TEXT=$$LINE(TEXT,"DX DATE",65)
+16 SET TEXT=$$LINE(TEXT,"STATUS",74)
+17 DO UPD(TEXT)
+18 SET TEXT=$EXTRACT(BKMHDR,1,12)
+19 SET TEXT=$$LINE(TEXT,$EXTRACT(BKMHDR,1,3),29)
+20 SET TEXT=$$LINE(TEXT,$EXTRACT(BKMHDR,1,3),36)
+21 SET TEXT=$$LINE(TEXT,$EXTRACT(BKMHDR,1,3),40)
+22 SET TEXT=$$LINE(TEXT,$EXTRACT(BKMHDR,1,3),44)
+23 SET TEXT=$$LINE(TEXT,$EXTRACT(BKMHDR,1,11),49)
+24 SET TEXT=$$LINE(TEXT,$EXTRACT(BKMHDR,1,12),61)
+25 SET TEXT=$$LINE(TEXT,$EXTRACT(BKMHDR,1,6),74)
+26 DO UPD(TEXT)
+27 QUIT
+28 ;
CTR(TEXT) ; EP - Center data.
+1 ;
+2 ; Input - TEXT - Text (required)
+3 ; LENGTH - Line length (default is 80)
+4 ; This utility will center the data before filing it to the RPC temporary global.
+5 ;
+6 NEW CENTER,CLINE,LEN,START
+7 SET LEN=$LENGTH(TEXT)
+8 SET CENTER=LEN/2
SET CLINE=LNLEN/2
+9 SET START=CLINE-CENTER\1
+10 SET TEXT=$$LINE("",TEXT,START)
+11 DO UPD(TEXT)
+12 QUIT
+13 ;
LINE(TEXT,STR,POS) ; Set text to match Quality of Care report formatting
+1 IF $LENGTH(TEXT)>POS
QUIT TEXT_STR
+2 SET $EXTRACT(TEXT,POS)=STR
+3 QUIT TEXT
+4 ;
UPD(LINE,SUPP) ; Update global with line of text; update page and total line count
+1 ;SUPP - Suppress line feed carriage return
+2 SET SUPP=$GET(SUPP)
+3 SET BQII=BQII+1
SET @DATA@(BQII)=LINE_$SELECT(SUPP:"",1:$CHAR(13)_$CHAR(10))
+4 QUIT
+5 ;
DONE ;
+1 ;
+2 SET BQII=BQII+1
SET @DATA@(BQII)=$CHAR(31)
+3 QUIT
+4 ;
COLHDR ;
+1 SET @DATA@(BQII)="T00120REPORT_TEXT"_$CHAR(30)
+2 ;S @DATA@(BQII)="T99999REPORT_TEXT"_$C(30)
+3 QUIT