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

BGPMUGD5.m

Go to the documentation of this file.
  1. BGPMUGD5 ; IHS/MSC/MMT - MU EP measures NQF0036 ;20-Aug-2011 11:26;DU
  1. ;;14.1;IHS CLINICAL REPORTING;**1**;MAY 29, 2014;Build 2
  1. ;Delimited output reports for this measure
  1. ASTPHARM ;EP
  1. D P1
  1. K ^TMP("BGPMU0036",$J)
  1. Q
  1. P1 ;Write individual measure
  1. N X,Y,Z,LIST1,LIST2,LIST3
  1. N DEN1,NUM1,DEN2,NUM2,EXC1,EXC2,STRING1,STRING2,STRING3
  1. N PRD1,PRD4,PRN1,PRN4
  1. D NUM36^BGPMUGP5("C",.STRING1)
  1. D NUM36^BGPMUGP5("P",.STRING2)
  1. D NUM36^BGPMUGP5("B",.STRING3)
  1. D SUMMARY1^BGPMUGP5(.STRING1,.STRING2,.STRING3)
  1. S X=U_"REPORT PERIOD"_U_"%"_U_"PREV YR PERIOD"_U_"%"_U_"CHG FROM PREV YR"_U_"BASE YEAR"_U_"%"_U_"CHG FROM BASE"
  1. D S^BGPMUDEL(X,2,1)
  1. D P1SUB(1)
  1. D P1SUB(2)
  1. D P1SUB(3)
  1. I $D(BGPLIST(BGPIC)) D P2
  1. Q
  1. P1SUB(POP) ;Population tabular output
  1. S PRD1=$P(STRING1(POP),U,5)-$P(STRING2(POP),U,5)
  1. S PRD4=$P(STRING1(POP),U,7)-$P(STRING2(POP),U,7)
  1. S PRN1=$P(STRING1(POP),U,5)-$P(STRING3(POP),U,5)
  1. S PRN4=$P(STRING1(POP),U,7)-$P(STRING3(POP),U,7)
  1. S X="Denominator "_POP
  1. D S^BGPMUDEL(X,2,1)
  1. S X=$P($T(P1TEXT+POP),";;",2)_U_$P(STRING1(POP),U,1)_U_U_$P(STRING2(POP),U,1)_U_U_U_$P(STRING3(POP),U,1)
  1. D S^BGPMUDEL(X,2,1)
  1. S X="# Excluded (Exc)"_U_$P(STRING1(POP),U,4)_U_U_$P(STRING2(POP),U,4)_U_U_U_$P(STRING3(POP),U,4)
  1. D S^BGPMUDEL(X,1,1)
  1. S X=$P($T(P1TEXTE+POP),";;",2)_U_$P(STRING1(POP),U,3)_U_U_$P(STRING2(POP),U,3)_U_U_U_$P(STRING3(POP),U,3)
  1. D S^BGPMUDEL(X,1,1)
  1. S X="# w/asthma medications"_U_$P(STRING1(POP),U,2)_U_$J($P(STRING1(POP),U,5),5,1)_U_$P(STRING2(POP),U,2)_U_$J($P(STRING2(POP),U,5),5,1)_U_$J($FN(PRD1,",+",1),6)_U_$P(STRING3(POP),U,2)_U_$J($P(STRING3(POP),U,5),5,1)_U_$J($FN(PRN1,",+",1),6)
  1. D S^BGPMUDEL(X,2,1)
  1. S X="# w/o asthma medications"_U_$P(STRING1(POP),U,6)_U_$J($P(STRING1(POP),U,7),5,1)_U_$P(STRING2(POP),U,6)_U_$J($P(STRING2(POP),U,7),5,1)_U_$J($FN(PRD4,",+",1),6)_U_$P(STRING3(POP),U,6)_U_$J($P(STRING3(POP),U,7),5,1)_U_$J($FN(PRN4,",+",1),6)
  1. D S^BGPMUDEL(X,1,1)
  1. Q
  1. P1TEXT ;Text lines for output
  1. ;;Pts 5-11 w/asthma or meds indicative of asthma
  1. ;;Pts 12-50 w/asthma or meds indicative of asthma
  1. ;;Pts 5-50 w/asthma or meds indicative of asthma
  1. P1TEXTE ;Text lines for output LESS exclusions
  1. ;;Pts 5-11 w/asthma or meds indicative of asthma less Exc
  1. ;;Pts 12-50 w/asthma or meds indicative of asthma less Exc
  1. ;;Pts 5-50 w/asthma or meds indicative of asthma less Exc
  1. ;population
  1. P2 ;Do the Details
  1. N PT,NODE,NAME,VST,BMI,FOL,X,PTCT,BGPARR,LINE
  1. S X="**** CONFIDENTIAL PATIENT INFORMATION COVERED BY PRIVACY ACT ****" D S^BGPMUDEL(X,2,1)
  1. S X="Patients 5-50 years of age with one of the following during the reporting" D S^BGPMUDEL(X,1,1)
  1. S X="period or within 1 year before the beginning of the reporting period: (a) at" D S^BGPMUDEL(X,1,1)
  1. S X="least 1 ED or acute inpatient encounter with the EP and a diagnosis of asthma," D S^BGPMUDEL(X,1,1)
  1. S X="(b) at least 4 outpatient encounters with the EP AND a diagnosis of asthma AND" D S^BGPMUDEL(X,1,1)
  1. S X="at least 2 counts asthma medication prescribed by the EP, (c) at least 4 counts" D S^BGPMUDEL(X,1,1)
  1. S X="of asthma medication prescribed by the EP, or (d) at least 4 counts of " D S^BGPMUDEL(X,1,1)
  1. S X="leukotriebe inhibitors prescribed by the EP and a diagnosis of asthma, if any." D S^BGPMUDEL(X,1,1)
  1. S X="Patients who did not meet the numerator criteria are listed first (NM:)" D S^BGPMUDEL(X,2,1)
  1. S X="followed by patients who do meet the numerator criteria (M:). Excluded patients" D S^BGPMUDEL(X,1,1)
  1. S X="are listed last." D S^BGPMUDEL(X,1,1)
  1. S X="The following are the abbreviations used in the denominator and numerator" D S^BGPMUDEL(X,2,1)
  1. S X="columns:" D S^BGPMUDEL(X,1,1)
  1. S X="AST=Asthma Diagnosis" D S^BGPMUDEL(X,1,1)
  1. S X="MED=Asthma Medication" D S^BGPMUDEL(X,1,1)
  1. S X="EN=Encounter" D S^BGPMUDEL(X,1,1)
  1. S X="Patients 5-11"
  1. D S^BGPMUDEL(X,2,1)
  1. S X="PATIENT NAME"_U_"HRN"_U_"COMMUNITY"_U_"SEX"_U_"AGE"_U_"DENOMINATOR"_U_"NUMERATOR"
  1. D S^BGPMUDEL(X,2,1)
  1. D LISTSUB(1)
  1. S X="Patients 12-50"
  1. D S^BGPMUDEL(X,2,1)
  1. S X="PATIENT NAME"_U_"HRN"_U_"COMMUNITY"_U_"SEX"_U_"AGE"_U_"DENOMINATOR"_U_"NUMERATOR"
  1. D S^BGPMUDEL(X,2,1)
  1. D LISTSUB(2)
  1. Q
  1. LISTSUB(POP) ;write out patient list for given population
  1. S PTCT=0
  1. I BGPLIST="D"!(BGPLIST="A") D
  1. .K BGPARR
  1. .D PTLSORT^BGPMUUTL(.BGPARR,"^TMP(""BGPMU0036"","_$J_",""PAT"",""C"","_POP_",""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(""BGPMU0036"","_$J_",""PAT"",""C"","_POP_",""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. I BGPLIST="A" D
  1. .K BGPARR
  1. .D PTLSORT^BGPMUUTL(.BGPARR,"^TMP(""BGPMU0036"","_$J_",""PAT"",""C"","_POP_",""EXC"")")
  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. S X="Total # of patients on list: "_PTCT D S^BGPMUDEL(X,2,1)
  1. Q
  1. DATA(NODE) ;GET DATA
  1. N NAME,HRN,DEN,NUM,AGE,DFN,SEX,COMM,NUM1,NUM2
  1. S DFN=$P(NODE,U,1)
  1. S NAME=$E($$GET1^DIQ(2,$P(NODE,U,1),.01),1,30)
  1. S HRN=$$HRN^AUPNPAT(DFN,DUZ(2))
  1. S AGE=$$AGE^AUPNPAT(DFN,BGPED)
  1. S COMM=$$GET1^DIQ(9000047,DFN,1118)
  1. S SEX=$P(^DPT(DFN,0),U,2)
  1. S DEN=$P(NODE,U,2)
  1. S NUM=$P(NODE,U,3)
  1. S X=NAME_U_HRN_U_COMM_U_SEX_U_AGE_U_DEN_U_NUM D S^BGPMUDEL(X,1,1)
  1. Q