BGPMUDD7 ; IHS/MSC/SAT - MU EP measures NQF0385 ;08-SEP-2011 11:26;DU
;;14.1;IHS CLINICAL REPORTING;**1**;MAY 29, 2014;Build 2
;Delimited output reports for this measure
DOCC ;EP
D P1
K ^TMP("BGPMU0385",$J)
Q
P1 ;Write individual measure
N X,Y,Z,LIST1,LIST2,LIST3
N DEN1,NUM1,DEN2,NUM2,PC1,PC2,EXC1,EXC2,STRING1,STRING2,STRING3
N PRD1,PRD2,PRD3,PRD4,PRD5,PRD6,PRD7,PRD8,PRN1,PRN2,PRN3,PRN4,PRN5,PRN6,PRN7,PRN8
S STRING1=$$NUM385^BGPMUDP7("C")
S STRING2=$$NUM385^BGPMUDP7("P")
S STRING3=$$NUM385^BGPMUDP7("B")
D SUMMARY1^BGPMUDP7(STRING1,STRING2,STRING3)
;population
S PRD11=$P(STRING1,U,5)-$P(STRING2,U,5)
S PRD14=$P(STRING1,U,9)-$P(STRING2,U,9)
S PRN11=$P(STRING1,U,5)-$P(STRING3,U,5)
S PRN14=$P(STRING1,U,9)-$P(STRING3,U,9)
S X=U_"REPORT PERIOD"_U_"%"_U_"PREV YR PERIOD"_U_"%"_U_"CHG FROM PREV YR"_U_"BASE YEAR"_U_"%"_U_"CHG FROM BASE"
D S^BGPMUDEL(X,2,1)
;
S X="Pts 18+ w/stage III"_U_+$P(STRING1,U,1)_U_U_+$P(STRING2,U,1)_U_U_U_+$P(STRING3,U,1)
D S^BGPMUDEL(X,2,1)
S X="colon cancer"
D S^BGPMUDEL(X,1,1)
S X="# Excluded (Exc)"_U_+$P(STRING1,U,4)_U_U_+$P(STRING2,U,4)_U_U_U_+$P(STRING3,U,4)
D S^BGPMUDEL(X,1,1)
S X="Pts 18+ w/stage III"_U_$P(STRING1,U,3)_U_U_$P(STRING2,U,3)_U_U_U_$P(STRING3,U,3)
D S^BGPMUDEL(X,1,1)
S X="colon cancer less Exc"
D S^BGPMUDEL(X,1,1)
;
S X="# w/adjuvant chemotherapy"_U_+$P(STRING1,U,2)_U_$J($P(STRING1,U,5),5,1)_U_+$P(STRING2,U,2)_U_$J($P(STRING2,U,5),5,1)_U_$FN(PRD11,",+",1)_U_+$P(STRING3,U,2)_U_$J($P(STRING3,U,5),5,1)_U_$FN(PRN11,",+",1)
D S^BGPMUDEL(X,2,1)
S X="# w/o adjuvant chemotherapy"_U_+$P(STRING1,U,8)_U_$J($P(STRING1,U,9),5,1)_U_+$P(STRING2,U,8)_U_$J($P(STRING2,U,9),5,1)_U_$FN(PRD14,",+",1)_U_+$P(STRING3,U,8)_U_$J($P(STRING3,U,9),5,1)_U_$FN(PRN14,",+",1)
D S^BGPMUDEL(X,1,1)
;
I $D(BGPLIST(BGPIC)) D P2
Q
P2 ;Do the Details
N PT,NODE,NAME,VST,BMI,FOL,X,PTCT
S X="**** CONFIDENTIAL PATIENT INFORMATION COVERED BY PRIVACY ACT ****" D S^BGPMUDEL(X,2,1)
S X="Patients 18+ with Stage IIIA through IIIC colon cancer who had at least 2 office" D S^BGPMUDEL(X,1,1)
S X="visit encounters with the EP during the reporting period AND who were prescribed" D S^BGPMUDEL(X,1,1)
S X="or administered adjuvant chemotherapy for colon cancer during the reporting" D S^BGPMUDEL(X,1,1)
S X="period, if any." D S^BGPMUDEL(X,1,1)
;
S X="Patients who do not meet the numerator criteria are listed first (NM:), followed" D S^BGPMUDEL(X,2,1)
S X="by patients who do meet the numerator criteria (M:). Excluded patients are" D S^BGPMUDEL(X,1,1)
S X="listed last." D S^BGPMUDEL(X,1,1)
;
S X="The following are the abbreviations used in the denominator and numerator" D S^BGPMUDEL(X,2,1)
S X="columns:" D S^BGPMUDEL(X,1,1)
S X="CCDX=Colon Cancer Diagnosis" D S^BGPMUDEL(X,1,1)
S X="CCST=Colon Cancer Stage III" D S^BGPMUDEL(X,1,1)
S X="EN=Encounter" D S^BGPMUDEL(X,1,1)
S X="MED=Chemotherapy for colon cancer" D S^BGPMUDEL(X,1,1)
;
S PTCT=0
S X="PATIENT NAME"_U_"HRN"_U_"COMMUNITY"_U_"SEX"_U_"AGE"_U_"DENOMINATOR"_U_"NUMERATOR" D S^BGPMUDEL(X,2,1)
I BGPLIST="D"!(BGPLIST="A") D
.K BGPARR
.D PTLSORT^BGPMUUTL(.BGPARR,"^TMP(""BGPMU0385"","_$J_",""PAT"",""C"",""NOT"",1)")
.S PT=0 F S PT=$O(BGPARR(PT)) Q:PT="" D
..S PTCT=PTCT+1
..S NODE=$G(BGPARR(PT))
..D DATA(NODE)
I BGPLIST="N"!(BGPLIST="A") D
.K BGPARR
.D PTLSORT^BGPMUUTL(.BGPARR,"^TMP(""BGPMU0385"","_$J_",""PAT"",""C"",""NUM"",1)")
.S PT=0 F S PT=$O(BGPARR(PT)) Q:PT="" D
..S PTCT=PTCT+1
..S NODE=$G(BGPARR(PT))
..D DATA(NODE)
I BGPLIST="A" D
.K BGPARR
.D PTLSORT^BGPMUUTL(.BGPARR,"^TMP(""BGPMU0385"","_$J_",""PAT"",""C"",""EXC"",1)")
.S PT=0 F S PT=$O(BGPARR(PT)) Q:PT="" D
..S PTCT=PTCT+1
..S NODE=$G(BGPARR(PT))
..D DATA(NODE)
S X="Total # of patients on list: "_PTCT D S^BGPMUDEL(X,2,1)
;
Q
;
DATA(NODE) ;GET DATA
N NAME,HRN,DEN,NUM,AGE,DFN,SEX,COMM,LINE
S DFN=$P(NODE,U,1)
S NAME=$E($$GET1^DIQ(2,$P(NODE,U,1),.01),1,22)
S HRN=$$HRN^AUPNPAT(DFN,DUZ(2))
S AGE=$$AGE^AUPNPAT(DFN,BGPED)
S DEN=$P(NODE,U,2)
S NUM=$P(NODE,U,3)
S COMM=$E($$GET1^DIQ(9000001,DFN,1118),1,11)
S SEX=$P(^DPT(DFN,0),U,2)
S X=NAME_U_HRN_U_COMM_U_SEX_U_AGE_U_$P(DEN,";",1)_U_NUM
D S^BGPMUDEL(X,1,1)
F BGPI=2:1:$L(DEN,";") D
.S X=U_U_U_U_U_$P(DEN,";",BGPI)
.D S^BGPMUDEL(X,1,1)
Q
BGPMUDD7 ; IHS/MSC/SAT - MU EP measures NQF0385 ;08-SEP-2011 11:26;DU
+1 ;;14.1;IHS CLINICAL REPORTING;**1**;MAY 29, 2014;Build 2
+2 ;Delimited output reports for this measure
DOCC ;EP
+1 DO P1
+2 KILL ^TMP("BGPMU0385",$JOB)
+3 QUIT
P1 ;Write individual measure
+1 NEW X,Y,Z,LIST1,LIST2,LIST3
+2 NEW DEN1,NUM1,DEN2,NUM2,PC1,PC2,EXC1,EXC2,STRING1,STRING2,STRING3
+3 NEW PRD1,PRD2,PRD3,PRD4,PRD5,PRD6,PRD7,PRD8,PRN1,PRN2,PRN3,PRN4,PRN5,PRN6,PRN7,PRN8
+4 SET STRING1=$$NUM385^BGPMUDP7("C")
+5 SET STRING2=$$NUM385^BGPMUDP7("P")
+6 SET STRING3=$$NUM385^BGPMUDP7("B")
+7 DO SUMMARY1^BGPMUDP7(STRING1,STRING2,STRING3)
+8 ;population
+9 SET PRD11=$PIECE(STRING1,U,5)-$PIECE(STRING2,U,5)
+10 SET PRD14=$PIECE(STRING1,U,9)-$PIECE(STRING2,U,9)
+11 SET PRN11=$PIECE(STRING1,U,5)-$PIECE(STRING3,U,5)
+12 SET PRN14=$PIECE(STRING1,U,9)-$PIECE(STRING3,U,9)
+13 SET X=U_"REPORT PERIOD"_U_"%"_U_"PREV YR PERIOD"_U_"%"_U_"CHG FROM PREV YR"_U_"BASE YEAR"_U_"%"_U_"CHG FROM BASE"
+14 DO S^BGPMUDEL(X,2,1)
+15 ;
+16 SET X="Pts 18+ w/stage III"_U_+$PIECE(STRING1,U,1)_U_U_+$PIECE(STRING2,U,1)_U_U_U_+$PIECE(STRING3,U,1)
+17 DO S^BGPMUDEL(X,2,1)
+18 SET X="colon cancer"
+19 DO S^BGPMUDEL(X,1,1)
+20 SET X="# Excluded (Exc)"_U_+$PIECE(STRING1,U,4)_U_U_+$PIECE(STRING2,U,4)_U_U_U_+$PIECE(STRING3,U,4)
+21 DO S^BGPMUDEL(X,1,1)
+22 SET X="Pts 18+ w/stage III"_U_$PIECE(STRING1,U,3)_U_U_$PIECE(STRING2,U,3)_U_U_U_$PIECE(STRING3,U,3)
+23 DO S^BGPMUDEL(X,1,1)
+24 SET X="colon cancer less Exc"
+25 DO S^BGPMUDEL(X,1,1)
+26 ;
+27 SET X="# w/adjuvant chemotherapy"_U_+$PIECE(STRING1,U,2)_U_$JUSTIFY($PIECE(STRING1,U,5),5,1)_U_+$PIECE(STRING2,U,2)_U_$JUSTIFY($PIECE(STRING2,U,5),5,1)_U_$FNUMBER(PRD11,",+",1)_U_+$PIECE(STRING3,U,2)_U_$JUSTIFY(...
... $PIECE(STRING3,U,5),5,1)_U_$FNUMBER(PRN11,",+",1)
+28 DO S^BGPMUDEL(X,2,1)
+29 SET X="# w/o adjuvant chemotherapy"_U_+$PIECE(STRING1,U,8)_U_$JUSTIFY($PIECE(STRING1,U,9),5,1)_U_+$PIECE(STRING2,U,8)_U_$JUSTIFY($PIECE(STRING2,U,9),5,1)_U_$FNUMBER(PRD14,",+",1)_U_+$PIECE(STRING3,U,8)_U_$JUSTIFY(...
... $PIECE(STRING3,U,9),5,1)_U_$FNUMBER(PRN14,",+",1)
+30 DO S^BGPMUDEL(X,1,1)
+31 ;
+32 IF $DATA(BGPLIST(BGPIC))
DO P2
+33 QUIT
P2 ;Do the Details
+1 NEW PT,NODE,NAME,VST,BMI,FOL,X,PTCT
+2 SET X="**** CONFIDENTIAL PATIENT INFORMATION COVERED BY PRIVACY ACT ****"
DO S^BGPMUDEL(X,2,1)
+3 SET X="Patients 18+ with Stage IIIA through IIIC colon cancer who had at least 2 office"
DO S^BGPMUDEL(X,1,1)
+4 SET X="visit encounters with the EP during the reporting period AND who were prescribed"
DO S^BGPMUDEL(X,1,1)
+5 SET X="or administered adjuvant chemotherapy for colon cancer during the reporting"
DO S^BGPMUDEL(X,1,1)
+6 SET X="period, if any."
DO S^BGPMUDEL(X,1,1)
+7 ;
+8 SET X="Patients who do not meet the numerator criteria are listed first (NM:), followed"
DO S^BGPMUDEL(X,2,1)
+9 SET X="by patients who do meet the numerator criteria (M:). Excluded patients are"
DO S^BGPMUDEL(X,1,1)
+10 SET X="listed last."
DO S^BGPMUDEL(X,1,1)
+11 ;
+12 SET X="The following are the abbreviations used in the denominator and numerator"
DO S^BGPMUDEL(X,2,1)
+13 SET X="columns:"
DO S^BGPMUDEL(X,1,1)
+14 SET X="CCDX=Colon Cancer Diagnosis"
DO S^BGPMUDEL(X,1,1)
+15 SET X="CCST=Colon Cancer Stage III"
DO S^BGPMUDEL(X,1,1)
+16 SET X="EN=Encounter"
DO S^BGPMUDEL(X,1,1)
+17 SET X="MED=Chemotherapy for colon cancer"
DO S^BGPMUDEL(X,1,1)
+18 ;
+19 SET PTCT=0
+20 SET X="PATIENT NAME"_U_"HRN"_U_"COMMUNITY"_U_"SEX"_U_"AGE"_U_"DENOMINATOR"_U_"NUMERATOR"
DO S^BGPMUDEL(X,2,1)
+21 IF BGPLIST="D"!(BGPLIST="A")
Begin DoDot:1
+22 KILL BGPARR
+23 DO PTLSORT^BGPMUUTL(.BGPARR,"^TMP(""BGPMU0385"","_$JOB_",""PAT"",""C"",""NOT"",1)")
+24 SET PT=0
FOR
SET PT=$ORDER(BGPARR(PT))
IF PT=""
QUIT
Begin DoDot:2
+25 SET PTCT=PTCT+1
+26 SET NODE=$GET(BGPARR(PT))
+27 DO DATA(NODE)
End DoDot:2
End DoDot:1
+28 IF BGPLIST="N"!(BGPLIST="A")
Begin DoDot:1
+29 KILL BGPARR
+30 DO PTLSORT^BGPMUUTL(.BGPARR,"^TMP(""BGPMU0385"","_$JOB_",""PAT"",""C"",""NUM"",1)")
+31 SET PT=0
FOR
SET PT=$ORDER(BGPARR(PT))
IF PT=""
QUIT
Begin DoDot:2
+32 SET PTCT=PTCT+1
+33 SET NODE=$GET(BGPARR(PT))
+34 DO DATA(NODE)
End DoDot:2
End DoDot:1
+35 IF BGPLIST="A"
Begin DoDot:1
+36 KILL BGPARR
+37 DO PTLSORT^BGPMUUTL(.BGPARR,"^TMP(""BGPMU0385"","_$JOB_",""PAT"",""C"",""EXC"",1)")
+38 SET PT=0
FOR
SET PT=$ORDER(BGPARR(PT))
IF PT=""
QUIT
Begin DoDot:2
+39 SET PTCT=PTCT+1
+40 SET NODE=$GET(BGPARR(PT))
+41 DO DATA(NODE)
End DoDot:2
End DoDot:1
+42 SET X="Total # of patients on list: "_PTCT
DO S^BGPMUDEL(X,2,1)
+43 ;
+44 QUIT
+45 ;
DATA(NODE) ;GET DATA
+1 NEW NAME,HRN,DEN,NUM,AGE,DFN,SEX,COMM,LINE
+2 SET DFN=$PIECE(NODE,U,1)
+3 SET NAME=$EXTRACT($$GET1^DIQ(2,$PIECE(NODE,U,1),.01),1,22)
+4 SET HRN=$$HRN^AUPNPAT(DFN,DUZ(2))
+5 SET AGE=$$AGE^AUPNPAT(DFN,BGPED)
+6 SET DEN=$PIECE(NODE,U,2)
+7 SET NUM=$PIECE(NODE,U,3)
+8 SET COMM=$EXTRACT($$GET1^DIQ(9000001,DFN,1118),1,11)
+9 SET SEX=$PIECE(^DPT(DFN,0),U,2)
+10 SET X=NAME_U_HRN_U_COMM_U_SEX_U_AGE_U_$PIECE(DEN,";",1)_U_NUM
+11 DO S^BGPMUDEL(X,1,1)
+12 FOR BGPI=2:1:$LENGTH(DEN,";")
Begin DoDot:1
+13 SET X=U_U_U_U_U_$PIECE(DEN,";",BGPI)
+14 DO S^BGPMUDEL(X,1,1)
End DoDot:1
+15 QUIT