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

BGPMUFD1.m

Go to the documentation of this file.
  1. BGPMUFD1 ;IHS/MSC/MMT - MU Reports Measure NQF0038 ;01-Mar-2011 15:50;MGH
  1. ;;14.1;IHS CLINICAL REPORTING;**1**;MAY 29, 2014;Build 2
  1. ;
  1. CHIMM ;EP
  1. D P1
  1. K ^TMP("BGPMU0038",$J)
  1. Q
  1. P1 ;Print measure details
  1. N TOTALS,BGPI,TF,CMP,PMP,BMP,CMPWO,PMPWO,BMPWO,BGPDNCNT,BGPSSTR
  1. S BGPDNCNT=0
  1. F TF="C","P","B" D NEW
  1. F TF="C","P","B" D LOAD
  1. ;Initialize iCare/summary global
  1. K ^TMP("BGPMU SUMMARY",$J,BGPIC)
  1. S ^TMP("BGPMU SUMMARY",$J,BGPIC)="0038^240"
  1. F N=1:1:12 D
  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. .S X="" D S^BGPMUDEL(X,1,1)
  1. .S X="Numerator "_N_" ("_$P($T(ITEXT+N),";;",2)_")"
  1. .D S^BGPMUDEL(X,1,1)
  1. .S X="Pts 2 yrs old"_U_(@("CDEN"_N_"CT")+@("CEXC"_N_"CT"))_U_U_(@("PDEN"_N_"CT")+@("PEXC"_N_"CT"))_U_U_U_(@("BDEN"_N_"CT")+@("BEXC"_N_"CT"))
  1. .D S^BGPMUDEL(X,1,1)
  1. .S X="# Excluded (Exc)"_U_@("CEXC"_N_"CT")_U_U_@("PEXC"_N_"CT")_U_U_U_@("BEXC"_N_"CT")
  1. .D S^BGPMUDEL(X,1,1)
  1. .S X="Pts 2 yrs old less Exc"_U_@("CDEN"_N_"CT")_U_U_@("PDEN"_N_"CT")_U_U_U_@("BDEN"_N_"CT")
  1. .D S^BGPMUDEL(X,1,1)
  1. .D CALCS(N,.CMP,.PMP,.BMP)
  1. .D CALCSWO(N,.CMPWO,.PMPWO,.BMPWO)
  1. .S X=$P($T(NTEXT+N),";;",2)_U_@("CNUM"_N_"CT")_U_$J(CMP,5,1)_U_@("PNUM"_N_"CT")_U_$J(PMP,5,1)_U_$J($FN(CMP-PMP,"+,",1),6)_U_@("BNUM"_N_"CT")_U_$J(BMP,5,1)_U_$J($FN(CMP-BMP,"+,",1),6)
  1. .D S^BGPMUDEL(X,2,1)
  1. .S X=$P($T(OTEXT+N),";;",2)_U_(@("CDEN"_N_"CT")-@("CNUM"_N_"CT"))_U_$J(CMPWO,5,1)_U_(@("PDEN"_N_"CT")-@("PNUM"_N_"CT"))_U_$J(PMPWO,5,1)_U_$J($FN(CMPWO-PMPWO,"+,",1),6)
  1. .S X=X_U_(@("BDEN"_N_"CT")-@("BNUM"_N_"CT"))_U_$J(BMPWO,5,1)_U_$J($FN(CMPWO-BMPWO,"+,",1),6)
  1. .D S^BGPMUDEL(X,1,1)
  1. .;Setup summary page/iCare ^TMP global
  1. .S BGPDNCNT=BGPDNCNT+1
  1. .S BGPSSTR="MU.EP.0038."_N_U_$P($T(ITEXT+N),";;",2)_U_@("CEXC"_N_"CT")_U_@("CDEN"_N_"CT")_U_@("CNUM"_N_"CT")_U_CMP_"^^^^"
  1. .; 11 12 13 14
  1. .S BGPSSTR=BGPSSTR_U_@("PEXC"_N_"CT")_U_@("PDEN"_N_"CT")_U_@("PNUM"_N_"CT")_U_PMP
  1. .; 15 16 17 18
  1. .S BGPSSTR=BGPSSTR_U_@("BEXC"_N_"CT")_U_@("BDEN"_N_"CT")_U_@("BNUM"_N_"CT")_U_BMP
  1. .S ^TMP("BGPMU SUMMARY",$J,BGPIC,BGPDNCNT)=BGPSSTR
  1. I $D(BGPLIST(BGPIC)) D P2
  1. F TF="C","P","B" D KILL
  1. Q
  1. ;
  1. P2 ;Print the Patient List Details
  1. N PT,NODE,NAME,VST,BMI,FOL,X,N,BGPARR,PTCT
  1. S X="Patients who reached 2 years of age and who had at least 1 encounter with the" D S^BGPMUDEL(X,2,1)
  1. S X="EP, both during the reporting period." D S^BGPMUDEL(X,1,1)
  1. S X="Patients who do not meet the numerator criteria are listed first (NM:), followed" D S^BGPMUDEL(X,2,1)
  1. S X="by patients who do meet the numerator criteria (M:)." D S^BGPMUDEL(X,1,1)
  1. S X="The following are the abbreviations used in the denominator column:" D S^BGPMUDEL(X,2,1)
  1. S X="EN=Encounter" D S^BGPMUDEL(X,1,1)
  1. F N=1:1:12 D
  1. .S X=$P($T(LITEXT+N),";;",2) D S^BGPMUDEL(X,2,1)
  1. .S PTCT=0
  1. .I BGPLIST="D"!(BGPLIST="A") D
  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. ..K BGPARR
  1. ..D PTLSORT^BGPMUUTL(.BGPARR,"^TMP(""BGPMU0038"","_$J_",""C"",""PAT"",""NOT"","_N_")")
  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. ...S $P(NODE,U,3)="NM:"_$P(NODE,U,3) ; uglify the display
  1. ...D DATA(NODE)
  1. .I BGPLIST="N"!(BGPLIST="A") D
  1. ..K BGPARR
  1. ..D PTLSORT^BGPMUUTL(.BGPARR,"^TMP(""BGPMU0038"","_$J_",""C"",""PAT"",""INCL"","_N_")")
  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. ...S $P(NODE,U,3)="M:"_$P(NODE,U,3) ; uglify the display
  1. ...D DATA(NODE)
  1. .I BGPLIST="A" D
  1. ..K BGPARR
  1. ..D PTLSORT^BGPMUUTL(.BGPARR,"^TMP(""BGPMU0038"","_$J_",""C"",""PAT"",""EXCL"","_N_")")
  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
  1. .D S^BGPMUDEL(X,2,1)
  1. Q
  1. DATA(NODE) ;GET DATA
  1. N NAME,HRN,DEN,NUM,AGE,DFN,SEX,COMM
  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 X=NAME_U_HRN_U_COMM_U_SEX_U_AGE_U_DEN_U_NUM
  1. D S^BGPMUDEL(X,1,1)
  1. Q
  1. CALCS(N,CMP,PMP,BMP) ;
  1. S CMP=$FN($S(@("CDEN"_N_"CT")>0:$$ROUND^BGPMUA01((@("CNUM"_N_"CT")/@("CDEN"_N_"CT")),3)*100,1:0),",",1)
  1. S PMP=$FN($S(@("PDEN"_N_"CT")>0:$$ROUND^BGPMUA01((@("PNUM"_N_"CT")/@("PDEN"_N_"CT")),3)*100,1:0),",",1)
  1. S BMP=$FN($S(@("BDEN"_N_"CT")>0:$$ROUND^BGPMUA01((@("BNUM"_N_"CT")/@("BDEN"_N_"CT")),3)*100,1:0),",",1)
  1. Q
  1. CALCSWO(N,CMP,PMP,BMP) ;
  1. S CMP=$FN($S(@("CDEN"_N_"CT")>0:$$ROUND^BGPMUA01(((@("CDEN"_N_"CT")-@("CNUM"_N_"CT"))/@("CDEN"_N_"CT")),3)*100,1:0),",",1)
  1. S PMP=$FN($S(@("PDEN"_N_"CT")>0:$$ROUND^BGPMUA01(((@("PDEN"_N_"CT")-@("PNUM"_N_"CT"))/@("PDEN"_N_"CT")),3)*100,1:0),",",1)
  1. S BMP=$FN($S(@("BDEN"_N_"CT")>0:$$ROUND^BGPMUA01(((@("BDEN"_N_"CT")-@("BNUM"_N_"CT"))/@("BDEN"_N_"CT")),3)*100,1:0),",",1)
  1. Q
  1. NEW ;NEW all variables for timeframe
  1. F BGPI=1:1:12 N @(TF_"EXC"_BGPI_"CT")
  1. F BGPI=1:1:12 N @(TF_"DEN"_BGPI_"CT")
  1. F BGPI=1:1:12 N @(TF_"NUM"_BGPI_"CT")
  1. Q
  1. LOAD ;Load variables from TMP global
  1. S @(TF_"TOTALS")=$G(^TMP("BGPMU0038",$J,TF,"TOT"))
  1. ;exclusion counts
  1. F BGPI=1:1:12 S @(TF_"EXC"_BGPI_"CT")=+$G(^TMP("BGPMU0038",$J,TF,"EXC",BGPI))
  1. ;denominator counts
  1. F BGPI=1:1:12 S @(TF_"DEN"_BGPI_"CT")=+$G(^TMP("BGPMU0038",$J,TF,"DEN",BGPI))
  1. ;numerator counts
  1. F BGPI=1:1:12 S @(TF_"NUM"_BGPI_"CT")=+$G(^TMP("BGPMU0038",$J,TF,"NUM",BGPI))
  1. Q
  1. KILL ;KILL all varables for timeframe
  1. F BGPI=1:1:12 N @(TF_"EXC"_BGPI_"CT")
  1. F BGPI=1:1:12 N @(TF_"DEN"_BGPI_"CT")
  1. F BGPI=1:1:12 N @(TF_"NUM"_BGPI_"CT")
  1. Q
  1. XML38 ;Populate the BGPXML array with data for each population/numerator
  1. ; BGPXMLOUT(i)=Population Number^Numerator Number^Denominator Count^Numerator Count^Exclusion Count
  1. ;F BGPI=1:1:12 S BGPXML(BGPI)="1"_U_BGPI_U_+$G(^TMP("BGPMU0038",$J,"C","DEN",BGPI))_U_+$G(^TMP("BGPMU0038",$J,"C","NUM",BGPI))_U_+$G(^TMP("BGPMU0038",$J,"C","EXC",BGPI))
  1. S BGPXML(1)="240"_U_""_U_+$G(^TMP("BGPMU0038",$J,"C","DEN",12))_U_+$G(^TMP("BGPMU0038",$J,"C","NUM",12))_U_+$G(^TMP("BGPMU0038",$J,"C","EXC",12))
  1. K ^TMP("BGPMU0038",$J)
  1. Q
  1. ITEXT ;
  1. ;;4 DTaP
  1. ;;3 IPV
  1. ;;1 MMR
  1. ;;3 HiB
  1. ;;3 HepB
  1. ;;1 VZV
  1. ;;4 Pneumococcal
  1. ;;2 HepA
  1. ;;2 Rotavirus
  1. ;;2 Influenza
  1. ;;4:3:1:3:3:1
  1. ;;4:3:1:3:3:1:4
  1. NTEXT ;
  1. ;;# w/4 DTaP
  1. ;;# w/3 IPV
  1. ;;# w/1 MMR
  1. ;;# w/3 HiB
  1. ;;# w/3 Hep B
  1. ;;# w/1 VZV
  1. ;;# w/4 Pneumococcal
  1. ;;# w/2 Hep A
  1. ;;# w/2 Rotavirus
  1. ;;# w/2 Influenza
  1. ;;# w/1-6 (4:3:1:3:3:1)
  1. ;;# w/1-7 (4:3:1:3:3:1:4)
  1. OTEXT ;
  1. ;;# w/o 4 DTaP
  1. ;;# w/o 3 IPV
  1. ;;# w/o 1 MMR
  1. ;;# w/o 3 HiB
  1. ;;# w/o 3 Hep B
  1. ;;# w/o 1 VZV
  1. ;;# w/o 4 Pneumococcal
  1. ;;# w/o 2 Hep A
  1. ;;# w/o 2 Rotavirus
  1. ;;# w/o 2 Influenza
  1. ;;# w/o 1-6 (4:3:1:3:3:1)
  1. ;;# w/o 1-7 (4:3:1:3:3:1:4)
  1. LITEXT ;
  1. ;;1: 4 DTaP Patients
  1. ;;2: 3 IPV Patients
  1. ;;3: 1 MMR Patients
  1. ;;4: 3 HiB Patients
  1. ;;5: 3 Hepatitis B Patients
  1. ;;6: 1 VZV Patients
  1. ;;7: 4 Pneumococcal Patients
  1. ;;8: 2 Hepatitis A Patients
  1. ;;9: 2 Rotavirus Patients
  1. ;;10: 2 Influenza Patients
  1. ;;11: 4:3:1:3:3:1 Patients
  1. ;;12: 4:3:1:3:3:1:4 Patients
  1. ;;
  1. ;;DTAP numerator patients
  1. ;;IPV numerator patients
  1. ;;MMR numerator patients
  1. ;;HiB numerator patients
  1. ;;HepB numerator patients
  1. ;;VZV numerator patients
  1. ;;Pneumo numerator patients
  1. ;;HepA numerator patients
  1. ;;Rotavirus numerator patients
  1. ;;Influenza numerator patients
  1. ;;Numerator patients for 1 thru 6
  1. ;;Numerator patients for 1 thru 7
  1. LNTEXT ;
  1. ;;Denominator patients not in numerator for DTAP
  1. ;;Denominator patients not in numerator for IPV
  1. ;;Denominator patients not in numerator for MMR
  1. ;;Denominator patients not in numerator for HiB
  1. ;;Denominator patients not in numerator for Hep B
  1. ;;Denominator patients not in numerator for VZV
  1. ;;Denominator patients not in numerator for Pneumococcal
  1. ;;Denominator patients not in numerator for Hep A
  1. ;;Denominator patients not in numerator for Rotavirus
  1. ;;Denominator patients not in numerator for Influenza
  1. ;;Denominator patients not in numerator for 1 thru 6
  1. ;;Denominator patients not in numerator for 1 thru 7
  1. LETEXT ;
  1. ;;Exclusion patients for DTAP
  1. ;;Exclusion patients for IPV
  1. ;;Exclusion patients for MMR
  1. ;;Exclusion patients for HiB
  1. ;;Exclusion patients for Hep B
  1. ;;Exclusion patients for VZV
  1. ;;Exclusion patients for Pneumococcal
  1. ;;Exclusion patients for Hep A
  1. ;;Exclusion patients for Rotavirus
  1. ;;Exclusion patients for Influenza
  1. ;;Exclusion patients for 1 thru 6
  1. ;;Exclusion patients for 1 thru 7