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

BGPMUFP7.m

Go to the documentation of this file.
  1. BGPMUFP7 ; IHS/MSC/MMT - Print MU EP measures NQF0068 ;20-JUL-2011 11:27;DU
  1. ;;14.1;IHS CLINICAL REPORTING;**1**;MAY 29, 2014;Build 2
  1. ;Printed output reports for this measure
  1. IVDMED ;EP
  1. D P1
  1. K ^TMP("BGPMU0068",$J)
  1. Q
  1. P1 ;Write individual measure
  1. N X,Y,Z,DEN,NUM,PC1,PC2,STRING1,STRING2,STRING3,PRD,PRN
  1. S STRING1=$$D68("C")
  1. S STRING2=$$D68("P")
  1. S STRING3=$$D68("B")
  1. S PRD=$P(STRING1,U,3)-$P(STRING2,U,3)
  1. S PRN=$P(STRING1,U,3)-$P(STRING3,U,3)
  1. S PRD1=$P(STRING1,U,5)-$P(STRING2,U,5)
  1. S PRN1=$P(STRING1,U,5)-$P(STRING3,U,5)
  1. D HEADER^BGPMUPH Q:BGPQUIT
  1. D HDRBLK^BGPMUPH
  1. I $Y>(BGPIOSL-3) D HEADER^BGPMUPH Q:BGPQUIT
  1. W !,"Pts 18+ w/PTCA, AMI, CABG",?33,($P(STRING1,U,1)+$P(STRING1,U,4)),?44,($P(STRING2,U,1)+$P(STRING2,U,4)),?64,($P(STRING3,U,1)+$P(STRING3,U,4))
  1. W !,"or IVD"
  1. I $Y>(BGPIOSL-5) D HEADER^BGPMUPH Q:BGPQUIT
  1. W !!,"# w/oral antiplatelet",?33,$P(STRING1,U,2),?38,$J($P(STRING1,U,3),5,1),?44,$P(STRING2,U,2),?49,$J($P(STRING2,U,3),5,1),?56,$J($FN(PRD,",+",1),6),?64,$P(STRING3,U,2),?68,$J($P(STRING3,U,3),5,1),?74,$J($FN(PRN,",+",1),6)
  1. W !,"therapy or aspirin"
  1. W !,"# w/o oral antiplatelet",?33,($P(STRING1,U,1)-$P(STRING1,U,2)),?38,$J($P(STRING1,U,5),5,1),?44,($P(STRING2,U,1)-$P(STRING2,U,2)),?49,$J($P(STRING2,U,5),5,1),?56,$J($FN(PRD1,",+",1),6)
  1. W ?64,($P(STRING3,U,1)-$P(STRING3,U,2)),?68,$J($P(STRING3,U,5),5,1),?74,$J($FN(PRN1,",+",1),6)
  1. W !,"therapy or aspirin"
  1. I $D(BGPLIST(BGPIC)) D P2
  1. D SUM68
  1. K X,Y,Z,DEN,NUM,PC1,STRING1,STRING2,STRING3,PRD,PRN
  1. Q
  1. D68(TF) ;Get the numbers for this measure
  1. N DATA
  1. S DEN=+$G(^TMP("BGPMU0068",$J,TF,"DEN"))
  1. S NUM1=+$G(^TMP("BGPMU0068",$J,TF,"NUM"))
  1. I DEN=0 S (PC1,PC2)=0
  1. I DEN>0 D
  1. .S PC1=$$ROUND^BGPMUA01((NUM1/DEN),3)*100,PC2=$$ROUND^BGPMUA01(((DEN-NUM1)/DEN),3)*100
  1. S DATA=DEN_U_NUM1_U_PC1_U_""_U_PC2
  1. Q DATA
  1. P2 ;Do the Details
  1. N PT,NODE,NAME,VST,COLON,FOL,BGPARR,LINE,PTCT
  1. D HEADERL^BGPMUPH
  1. S X="Patients 18+ and (a) who had at least 1 acute inpatient encounter with the" D W^BGPMUPP(X,0,1,BGPPTYPE)
  1. S X="EP 14-24 months prior to the reporting period end date AND who underwent" D W^BGPMUPP(X,0,1,BGPPTYPE)
  1. S X="percutaneous transluminal coronary angioplasty (PTCA), acute myocardial" D W^BGPMUPP(X,0,1,BGPPTYPE)
  1. S X="infarction (AMI), or coronary artery bypass graft (CABG); OR (b) who had least" D W^BGPMUPP(X,0,1,BGPPTYPE)
  1. S X="1 acute inpatient or outpatient encounter with the EP within 2 years of the" D W^BGPMUPP(X,0,1,BGPPTYPE)
  1. S X="reporting period end date with a diagnosis of ischemic vascular disease (IVD);" D W^BGPMUPP(X,0,1,BGPPTYPE)
  1. S X="AND (c) who were prescribed oral antiplatelet therapy or aspirin" D W^BGPMUPP(X,0,1,BGPPTYPE)
  1. S X="during the reporting period, if any." D W^BGPMUPP(X,0,1,BGPPTYPE)
  1. S X="Patients who do not meet the numerator criteria are listed first (NM:)," D W^BGPMUPP(X,0,2,BGPPTYPE)
  1. S X="followed by patients who do meet the numerator criteria (M:)." D W^BGPMUPP(X,0,1,BGPPTYPE)
  1. S X="The following are the abbreviations used in the denominator and numerator" D W^BGPMUPP(X,0,2,BGPPTYPE)
  1. S X="columns:" D W^BGPMUPP(X,0,1,BGPPTYPE)
  1. S X="PTCA=PTCA Procedure" D W^BGPMUPP(X,0,1,BGPPTYPE)
  1. S X="AMI=AMI Diagnosis" D W^BGPMUPP(X,0,1,BGPPTYPE)
  1. S X="CABG=CABG Procedure" D W^BGPMUPP(X,0,1,BGPPTYPE)
  1. S X="IVD=IVD Diagnosis" D W^BGPMUPP(X,0,1,BGPPTYPE)
  1. S X="EN=Encounter" D W^BGPMUPP(X,0,1,BGPPTYPE)
  1. S X="MED=Oral Antiplatelet Therapy or Aspirin" D W^BGPMUPP(X,0,1,BGPPTYPE)
  1. I $Y>(BGPIOSL-8) D HEADERL^BGPMUPH Q:BGPQUIT
  1. S X="" D W^BGPMUPP(X,0,1,BGPPTYPE)
  1. S PTCT=0
  1. W !,"PATIENT NAME",?23,"HRN",?30,"COMMUNITY",?42,"SEX",?46,"AGE",?50,"DENOMINATOR",?64,"NUMERATOR"
  1. S LINE="",$P(LINE,"-",81)="" W !,LINE
  1. I BGPLIST="D"!(BGPLIST="A") D
  1. .K BGPARR
  1. .D PTLSORT^BGPMUUTL(.BGPARR,"^TMP(""BGPMU0068"","_$J_",""PAT"",""C"",""NOT"")")
  1. .S PT=0 F S PT=$O(BGPARR(PT)) Q:PT="" D
  1. ..S PTCT=PTCT+1
  1. ..S NODE=$G(BGPARR(PT))
  1. ..D DATA(NODE)
  1. I BGPLIST="N"!(BGPLIST="A") D
  1. .K BGPARR
  1. .D PTLSORT^BGPMUUTL(.BGPARR,"^TMP(""BGPMU0068"","_$J_",""PAT"",""C"",""NUM"")")
  1. .S PT=0 F S PT=$O(BGPARR(PT)) Q:PT="" D
  1. ..S PTCT=PTCT+1
  1. ..S NODE=$G(BGPARR(PT))
  1. ..D DATA(NODE)
  1. W !!,"Total # of patients on list: "_PTCT
  1. K PT,NODE,NAME,VST,COLON,FOL
  1. Q
  1. DATA(NODE) ;DISPLAY DATA
  1. N X,NAME,HRN,DEN,DEN1,DEN2,NUM1,NUM2,NUM3,AGE,DFN,LINE,COMM,SEX
  1. N NUMVALS,NUMDATES
  1. S (DEN1,DEN2,NUM1,NUM2,NUM3)=""
  1. S DFN=$P(NODE,U,1)
  1. S NAME=$E($$GET1^DIQ(2,$P(NODE,U,1),.01),1,22)
  1. S HRN=$$HRN^AUPNPAT(DFN,DUZ(2))
  1. S AGE=$$AGE^AUPNPAT(DFN,BGPED)
  1. S COMM=$E($$GET1^DIQ(9000001,DFN,1118),1,11)
  1. S SEX=$P(^DPT(DFN,0),U,2)
  1. S DEN=$P(NODE,U,2),NUM=$P(NODE,U,3)
  1. S DEN1=$P(DEN,";",1),DEN2=$P(DEN,";",2)
  1. S:NUM'="" NUM1="MED "_$$DATE^BGPMUUTL(NUM)
  1. I $Y>(BGPIOSL-2) D
  1. .D HEADERL^BGPMUPH Q:BGPQUIT
  1. .W !,"PATIENT NAME",?23,"HRN",?30,"COMMUNITY",?42,"SEX",?46,"AGE",?50,"DENOMINATOR",?64,"NUMERATOR"
  1. .S LINE="",$P(LINE,"-",81)="" W !,LINE
  1. W !,NAME,?23,HRN,?30,COMM,?43,SEX,?46,AGE,?50,DEN1,?64,$S($G(NUM1)="":"NM:",1:"M:"_NUM1)
  1. W:(DEN2'="") !,?50,DEN2
  1. K X,NAME,HRN,DEN,DEN1,DEN2,NUM1,NUM2,NUM3,AGE,DFN,LINE,COMM,SEX
  1. K NUMVALS,NUMDATES
  1. Q
  1. XML68 ;Populate the BGPXML array with data for each population/numerator
  1. ; BGPXMLOUT(i)=PQRI number^""^Denominator Count^Numerator Count^Exclusion Count
  1. ;NOTE: the first pieces below are INCORRECT but no PQRI number is defined for this measure
  1. S BGPXML(1)="204"_U_""_U_+$G(^TMP("BGPMU0068",$J,"C","DEN"))_U_+$G(^TMP("BGPMU0068",$J,"C","NUM"))
  1. K ^TMP("BGPMU0068",$J)
  1. Q
  1. SUM68 ;Populate "BGPMU SUMMARY" for IVD Antithrombotic
  1. ;Initialize iCare/summary global
  1. N BGPDNCNT,BGPSSTR,J,N
  1. S BGPDNCNT=0
  1. K ^TMP("BGPMU SUMMARY",$J,BGPIC)
  1. S ^TMP("BGPMU SUMMARY",$J,BGPIC)="0068"_U_"204"
  1. S N=1 ;only 1 numerator
  1. ;Setup summary page/iCare ^TMP global
  1. S CDEN1CT=+$G(^TMP("BGPMU0068",$J,"C","DEN")) ;current
  1. S CNUM1CT=+$G(^TMP("BGPMU0068",$J,"C","NUM"))
  1. S CMP=$S(CDEN1CT>0:$$ROUND^BGPMUA01(CNUM1CT/CDEN1CT,3)*100,1:0)
  1. S PDEN1CT=+$G(^TMP("BGPMU0068",$J,"P","DEN")) ;previous
  1. S PNUM1CT=+$G(^TMP("BGPMU0068",$J,"P","NUM"))
  1. S PMP=$S(PDEN1CT>0:$$ROUND^BGPMUA01(PNUM1CT/PDEN1CT,3)*100,1:0)
  1. S BDEN1CT=+$G(^TMP("BGPMU0068",$J,"B","DEN")) ;baseline
  1. S BNUM1CT=+$G(^TMP("BGPMU0068",$J,"B","NUM"))
  1. S BMP=$S(BDEN1CT>0:$$ROUND^BGPMUA01(BNUM1CT/BDEN1CT,3)*100,1:0)
  1. ;FIRST NUMERATOR
  1. S BGPDNCNT=BGPDNCNT+1
  1. S BGPSSTR="MU.EP.0068.1"_U_"18+ # w/oral antiplatelet therapy"_U_""_U_CDEN1CT_U_CNUM1CT_U_CMP_U_U_U_U
  1. ; 11 12 13 14
  1. S BGPSSTR=BGPSSTR_U_""_U_PDEN1CT_U_PNUM1CT_U_PMP
  1. ; 15 16 17 18
  1. S BGPSSTR=BGPSSTR_U_""_U_BDEN1CT_U_BNUM1CT_U_BMP
  1. S ^TMP("BGPMU SUMMARY",$J,BGPIC,BGPDNCNT)=BGPSSTR
  1. Q