BGPMUA02 ; IHS/MSC/MGH - MI measure NQF0034 ;01-Mar-2011 15:36;MGH
;;11.1;IHS CLINICAL REPORTING SYSTEM;**1**;JUN 27, 2011;Build 106
;Code to collect meaningful use report for colorectal screening
ENTRY ;EP
N START,END,BGPNUM,BGPDEN,BGPNUM,AENC,BENC,BGPBIRTH,COLLECT
N IEN,INV,VISIT,WTIEN,DATA,VDATE,VALUE,EXCEPT,FIRST,REF,VIEN,EXCEPT,AENC,BENC
N BGPN1,BGPN3,RETVAL,BGPCOLI,BGPCOLP,BGPSIGI,BGPSIGP,BGPFOBTI,BGPCAPR,BGPFOBTC,BGPFOBTI,BGPDSTR,BGPNSTR
N BGPFOBTP,BGPFOBTL,BGPCADXI,BGPCADXP,BGPCARMC,BGPCARMP,BGPENC,BGPFOBT,BGPSIG,BGPCOL,STRING1,STRING2
S (BGPDEN,BGPNUM)=0
;Set a new begin date of 2 years prior to the reporting period end date
N X1,X2,X S X1=BGPEDATE,X2=-730 D C^%DTC S BGPENC=X
S START=9999999-BGPENC,END=9999999-BGPEDATE,VALUE=0,EXCEPT=0,COLLECT=0
S BGPBIRTH=$P(^DPT(DFN,0),U,3)
I BGPBIRTH="" S BGPBIRTH=BGPENC
S RETVAL="",VIEN="" ;Return value
S (STRING1,STRING2,BGPDSTR,BGPNSTR)=""
;Pts must be 50-74
;No need to check further if no age match
Q:(BGPAGEE<50)!(BGPAGEE>74)
;Quit if the patient has a total colectomy by ICD0 or CPT
S BGPCARMC=$$CPT^BGPMUUT1(DFN,BGPBIRTH,BGPEDATE,"BGPMU COLECTOMY CPT")
Q:+BGPCARMC
S BGPCARMP=$$LASTPRC^BGPMUUT2(DFN,BGPBIRTH,BGPEDATE,"BGPMU COLECTOMY ICDS")
Q:+BGPCARMP
S FIRST=END-0.1 F S FIRST=$O(^AUPNVSIT("AA",DFN,FIRST)) Q:FIRST=""!($P(FIRST,".",1)>START)!(RETVAL]"") D
.S IEN=0 F S IEN=$O(^AUPNVSIT("AA",DFN,FIRST,IEN)) Q:'+IEN!(RETVAL]"") D
..;Check provider, Only visits for chosen provider
..Q:'$$PRV^BGPMUUT1(IEN,BGPPROV)
..;Quit if any visit in the last 2 years does not have a valid E&M code
..S AENC=$$VSTCPT^BGPMUUT1(DFN,IEN,"BGPMU COLON ENC EM")
..S BENC=$$VSTPOV^BGPMUUT3(DFN,IEN,"BGPMU COLON ENC DX")
..Q:(AENC=0)&(BENC=0)
..I +AENC S STRING1="ENCC:"_$P(AENC,U,2)
..I +BENC S STRING1="ENCC:"_$P(BENC,U,2)
..S DATA=$G(^AUPNVSIT(IEN,0))
..S VDATE=$P($G(^AUPNVSIT(IEN,0)),U,1),VIEN=IEN
Q:'+VIEN
S BGPDSTR=$P(VDATE,".",1)
S STRING2=""
;Set a new begin date of 2 years prior to the visit
;N X1,X2,X S X1=VDATE,X2=-730 D C^%DTC S BGPENC=X
;Set a new begin date of 10 years prior to the visit for colonoscopy
N X1,X2,X S X1=BGPEDATE,X2=-3650 D C^%DTC S BGPCOL=X
;Set a new begin date of 5 years prior to the visit to find sigmoidoscopy
N X1,X2,X S X1=BGPEDATE,X2=-1825 D C^%DTC S BGPSIG=X
;Set a new begin date of 1 year prior to the visit to find FOBT
N X1,X2,X S X1=BGPEDATE,X2=-365 D C^%DTC S BGPFOBT=X
;Check for colonoscopy in the last 10 years
S BGPCOLP=$$CPT^BGPMUUT1(DFN,BGPCOL,BGPEDATE,"BGPMU COLONOSCOPY CPT")
I +BGPCOLP=1 S VALUE=BGPCOLP,STRING2="COLC:"_$P(BGPCOLP,U,2),BGPNSTR=$P(BGPCOLP,U,2)_";"_$P($P(BGPCOLP,U,3),".",1) G EXCCHK
S BGPCOLI=$$LASTPRC^BGPMUUT2(DFN,BGPCOL,BGPEDATE,"BGPMU COLONOSCOPY PROCEDURE")
I +BGPCOLI=1 S VALUE=BGPCOLI,STRING2="COLI:"_$P(BGPCOLI,U,2),BGPNSTR=$P(BGPCOLI,U,2)_";"_$P($P(BGPCOLI,U,3),".",1) G EXCCHK
;Check for sigmoidoscopy in the last 5 years
S BGPSIGP=$$CPT^BGPMUUT1(DFN,BGPSIG,BGPEDATE,"BGPMU SIGMOIDOSCOPY CPT")
I +BGPSIGP=1 S VALUE=BGPSIGP,STRING2=STRING2_";SIGC:"_$P(BGPSIGP,U,2),BGPNSTR=$P(BGPSIGP,U,2)_";"_$P($P(BGPSIGP,U,3),".",1) G EXCCHK
S BGPSIGI=$$LASTPRC^BGPMUUT2(DFN,BGPSIG,BGPEDATE,"BGPMU SIGMOIDOSCOPY PROCEDURES")
I +BGPSIGI=1 S VALUE=BGPSIGI,STRING2=STRING2_";SIGI:"_$P(BGPSIGI,U,2),BGPNSTR=$P(BGPSIGI,U,2)_";"_$P($P(BGPSIGI,U,3),".",1) G EXCCHK
;Check for FOBT in the last year
S BGPFOBTC=$$CPT^BGPMUUT1(DFN,BGPFOBT,BGPEDATE,"BGPMU FOBT CPTS")
I +BGPFOBTC=1 S VALUE=BGPFOBTC,STRING2=STRING2_";FOBC:"_$P(BGPFOBTC,U,2),BGPNSTR=$P(BGPFOBTC,U,2)_";"_$P($P(BGPFOBTC,U,3),".",1) G EXCCHK
S BGPFOBTI=$$LASTDX^BGPMUUT2(DFN,BGPFOBT,BGPEDATE,"BGPMU FOBT ICD CODES")
I +BGPFOBTI=1 S VALUE=BGPFOBTI,STRING2=STRING2_";FOBI:"_$P(BGPFOBTI,U,2),BGPNSTR=$P(BGPFOBTI,U,2)_";"_$P($P(BGPFOBTI,U,3),".",1) G EXCCHK
S BGPFOBTL=$$LOINC^BGPMUUT2(DFN,BGPFOBT,BGPEDATE,"BGPMU FOBT LOINC")
I +BGPFOBTL S BGPLOINC=$P($G(^AUPNVLAB($P(BGPFOBTL,U,2),11)),U,13) S VALUE="1^"_BGPFOBTL,STRING2=STRING2_";FOBL:"_BGPLOINC,BGPNSTR=BGPLOINC_";"_$P($P(BGPFOBTL,U,1),".",1) G EXCCHK
;I +BGPFOBTL S VALUE="1^"_BGPFOBTL,STRING2=STRING2_";FOBL:"_$P(BGPFOBTL,U,2),BGPNSTR=$P(BGPFOBTL,U,2)_";"_$P($P(BGPFOBTL,U,1),".",1) G EXCCHK
EXCCHK ;Exclude if the patient has a colon cancer diagnosis
;Colon cancer is by ICD or CPT code
I '+VALUE D
.S BGPCADXI=$$LASTDX^BGPMUUT2(DFN,BGPBIRTH,BGPEDATE,"BGPMU COLON CANCER DX")
.I +BGPCADXI=1 S EXCEPT=BGPCADXI,STRING1=STRING1_";CCD:"_$P(BGPCADXI,U,2)
.S BGPCADXP=$$CPT^BGPMUUT1(DFN,BGPBIRTH,BGPEDATE,"BGPMU COLON CANCER STUDY")
.I +BGPCADXP=1 S EXCEPT=BGPCADXP,STRING1=STRING1_";CCS:"_$P(BGPCADXP,U,2)
.S BGPCAPR=$$PLTAX^BGPMUUT1(DFN,"BGPMU COLON CANCER DX")
.I +BGPCAPR=1 S EXCEPT=BGPCAPR,STRING1=STRING1_";CCP:"_$P(BGPCAPR,U,2)
D TOTAL(DFN,VIEN,BGPDSTR,BGPNSTR)
Q
TOTAL(DFN,VIEN,BGPDSTR,BGPNSTR) ;See where this patient ends up
N PTCNT,EXCCT,DENCT,NUMCT,TOTALS
S TOTALS=$G(^TMP("BGPMU0034",$J,BGPMUTF,"TOT"))
S EXCCT=+$G(^TMP("BGPMU0034",$J,BGPMUTF,"EXC"))
S DENCT=+$G(^TMP("BGPMU0034",$J,BGPMUTF,"DEN"))
S NUMCT=+$G(^TMP("BGPMU0034",$J,BGPMUTF,"NUM"))
S PTCNT=TOTALS
S PTCNT=PTCNT+1
;Do not include those with total colectomy in the denomiator
;Q:+COLLECT
S DENCT=DENCT+1 S ^TMP("BGPMU0034",$J,BGPMUTF,"DEN")=DENCT
;If Colon Cancer Dx, put in exception list
I +EXCEPT D
.S EXCCT=EXCCT+1 S ^TMP("BGPMU0034",$J,BGPMUTF,"EXC")=EXCCT
.I BGPMUTF="C" S ^TMP("BGPMU0034",$J,"PAT",BGPMUTF,"EXC",PTCNT)=DFN_U_STRING1_U_STRING2_U_$G(BGPDSTR)_U_"Excluded"
E D
.I +VALUE D
..S NUMCT=NUMCT+1 S ^TMP("BGPMU0034",$J,BGPMUTF,"NUM")=NUMCT
..I BGPMUTF="C" S ^TMP("BGPMU0034",$J,"PAT",BGPMUTF,"NUM",PTCNT)=DFN_U_STRING1_U_STRING2_U_$G(BGPDSTR)_U_$G(BGPNSTR)
.E I BGPMUTF="C" S ^TMP("BGPMU0034",$J,"PAT",BGPMUTF,"DEN",PTCNT)=DFN_U_STRING1_U_STRING2_U_$G(BGPDSTR)_U_$G(BGPNSTR)
S ^TMP("BGPMU0034",$J,BGPMUTF,"TOT")=PTCNT
;Setup iCare array for patient
S BGPICARE("MU.EP.0034.1",BGPMUTF)='EXCEPT_U_+VALUE_U_+EXCEPT_U_$G(BGPDSTR)_";"_$G(BGPNSTR)_U_$P(EXCEPT,U,2)
Q
;
TEST ;
S U="^"
S DT=$P($$NOW^XLFDT(),".",1)
S DTIME=9000
S IOSTBM="$C(27,91)_(+IOTM)_$C(59)_(+IOBM)_$C(114)"
D DUZ^XUP(2)
;MERGE DUZ=^TMP("ZSAT","DUZ")
D ^%ZIS
S DFN=568 ; DFN = patient code from VA PATIENT file
S BGPBDATE=3110101 ; BGPBDATE = begin date of report
S BGPEDATE=3111231 ; BGPEDATE = end date of report
S BGPAGEE=$$AGE^AUPNPAT(DFN,BGPEDATE)
S BGPPROV=2 ; BGPPROV = provider code from NEW PERSON file
S BGPMUTF="C" ; BGPMUTF = timeframe variable - "C"=current year; "P"=previous year; "B"=baseline year
D ENTRY
Q
BGPMUA02 ; IHS/MSC/MGH - MI measure NQF0034 ;01-Mar-2011 15:36;MGH
+1 ;;11.1;IHS CLINICAL REPORTING SYSTEM;**1**;JUN 27, 2011;Build 106
+2 ;Code to collect meaningful use report for colorectal screening
ENTRY ;EP
+1 NEW START,END,BGPNUM,BGPDEN,BGPNUM,AENC,BENC,BGPBIRTH,COLLECT
+2 NEW IEN,INV,VISIT,WTIEN,DATA,VDATE,VALUE,EXCEPT,FIRST,REF,VIEN,EXCEPT,AENC,BENC
+3 NEW BGPN1,BGPN3,RETVAL,BGPCOLI,BGPCOLP,BGPSIGI,BGPSIGP,BGPFOBTI,BGPCAPR,BGPFOBTC,BGPFOBTI,BGPDSTR,BGPNSTR
+4 NEW BGPFOBTP,BGPFOBTL,BGPCADXI,BGPCADXP,BGPCARMC,BGPCARMP,BGPENC,BGPFOBT,BGPSIG,BGPCOL,STRING1,STRING2
+5 SET (BGPDEN,BGPNUM)=0
+6 ;Set a new begin date of 2 years prior to the reporting period end date
+7 NEW X1,X2,X
SET X1=BGPEDATE
SET X2=-730
DO C^%DTC
SET BGPENC=X
+8 SET START=9999999-BGPENC
SET END=9999999-BGPEDATE
SET VALUE=0
SET EXCEPT=0
SET COLLECT=0
+9 SET BGPBIRTH=$PIECE(^DPT(DFN,0),U,3)
+10 IF BGPBIRTH=""
SET BGPBIRTH=BGPENC
+11 ;Return value
SET RETVAL=""
SET VIEN=""
+12 SET (STRING1,STRING2,BGPDSTR,BGPNSTR)=""
+13 ;Pts must be 50-74
+14 ;No need to check further if no age match
+15 IF (BGPAGEE<50)!(BGPAGEE>74)
QUIT
+16 ;Quit if the patient has a total colectomy by ICD0 or CPT
+17 SET BGPCARMC=$$CPT^BGPMUUT1(DFN,BGPBIRTH,BGPEDATE,"BGPMU COLECTOMY CPT")
+18 IF +BGPCARMC
QUIT
+19 SET BGPCARMP=$$LASTPRC^BGPMUUT2(DFN,BGPBIRTH,BGPEDATE,"BGPMU COLECTOMY ICDS")
+20 IF +BGPCARMP
QUIT
+21 SET FIRST=END-0.1
FOR
SET FIRST=$ORDER(^AUPNVSIT("AA",DFN,FIRST))
IF FIRST=""!($PIECE(FIRST,".",1)>START)!(RETVAL]"")
QUIT
Begin DoDot:1
+22 SET IEN=0
FOR
SET IEN=$ORDER(^AUPNVSIT("AA",DFN,FIRST,IEN))
IF '+IEN!(RETVAL]"")
QUIT
Begin DoDot:2
+23 ;Check provider, Only visits for chosen provider
+24 IF '$$PRV^BGPMUUT1(IEN,BGPPROV)
QUIT
+25 ;Quit if any visit in the last 2 years does not have a valid E&M code
+26 SET AENC=$$VSTCPT^BGPMUUT1(DFN,IEN,"BGPMU COLON ENC EM")
+27 SET BENC=$$VSTPOV^BGPMUUT3(DFN,IEN,"BGPMU COLON ENC DX")
+28 IF (AENC=0)&(BENC=0)
QUIT
+29 IF +AENC
SET STRING1="ENCC:"_$PIECE(AENC,U,2)
+30 IF +BENC
SET STRING1="ENCC:"_$PIECE(BENC,U,2)
+31 SET DATA=$GET(^AUPNVSIT(IEN,0))
+32 SET VDATE=$PIECE($GET(^AUPNVSIT(IEN,0)),U,1)
SET VIEN=IEN
End DoDot:2
End DoDot:1
+33 IF '+VIEN
QUIT
+34 SET BGPDSTR=$PIECE(VDATE,".",1)
+35 SET STRING2=""
+36 ;Set a new begin date of 2 years prior to the visit
+37 ;N X1,X2,X S X1=VDATE,X2=-730 D C^%DTC S BGPENC=X
+38 ;Set a new begin date of 10 years prior to the visit for colonoscopy
+39 NEW X1,X2,X
SET X1=BGPEDATE
SET X2=-3650
DO C^%DTC
SET BGPCOL=X
+40 ;Set a new begin date of 5 years prior to the visit to find sigmoidoscopy
+41 NEW X1,X2,X
SET X1=BGPEDATE
SET X2=-1825
DO C^%DTC
SET BGPSIG=X
+42 ;Set a new begin date of 1 year prior to the visit to find FOBT
+43 NEW X1,X2,X
SET X1=BGPEDATE
SET X2=-365
DO C^%DTC
SET BGPFOBT=X
+44 ;Check for colonoscopy in the last 10 years
+45 SET BGPCOLP=$$CPT^BGPMUUT1(DFN,BGPCOL,BGPEDATE,"BGPMU COLONOSCOPY CPT")
+46 IF +BGPCOLP=1
SET VALUE=BGPCOLP
SET STRING2="COLC:"_$PIECE(BGPCOLP,U,2)
SET BGPNSTR=$PIECE(BGPCOLP,U,2)_";"_$PIECE($PIECE(BGPCOLP,U,3),".",1)
GOTO EXCCHK
+47 SET BGPCOLI=$$LASTPRC^BGPMUUT2(DFN,BGPCOL,BGPEDATE,"BGPMU COLONOSCOPY PROCEDURE")
+48 IF +BGPCOLI=1
SET VALUE=BGPCOLI
SET STRING2="COLI:"_$PIECE(BGPCOLI,U,2)
SET BGPNSTR=$PIECE(BGPCOLI,U,2)_";"_$PIECE($PIECE(BGPCOLI,U,3),".",1)
GOTO EXCCHK
+49 ;Check for sigmoidoscopy in the last 5 years
+50 SET BGPSIGP=$$CPT^BGPMUUT1(DFN,BGPSIG,BGPEDATE,"BGPMU SIGMOIDOSCOPY CPT")
+51 IF +BGPSIGP=1
SET VALUE=BGPSIGP
SET STRING2=STRING2_";SIGC:"_$PIECE(BGPSIGP,U,2)
SET BGPNSTR=$PIECE(BGPSIGP,U,2)_";"_$PIECE($PIECE(BGPSIGP,U,3),".",1)
GOTO EXCCHK
+52 SET BGPSIGI=$$LASTPRC^BGPMUUT2(DFN,BGPSIG,BGPEDATE,"BGPMU SIGMOIDOSCOPY PROCEDURES")
+53 IF +BGPSIGI=1
SET VALUE=BGPSIGI
SET STRING2=STRING2_";SIGI:"_$PIECE(BGPSIGI,U,2)
SET BGPNSTR=$PIECE(BGPSIGI,U,2)_";"_$PIECE($PIECE(BGPSIGI,U,3),".",1)
GOTO EXCCHK
+54 ;Check for FOBT in the last year
+55 SET BGPFOBTC=$$CPT^BGPMUUT1(DFN,BGPFOBT,BGPEDATE,"BGPMU FOBT CPTS")
+56 IF +BGPFOBTC=1
SET VALUE=BGPFOBTC
SET STRING2=STRING2_";FOBC:"_$PIECE(BGPFOBTC,U,2)
SET BGPNSTR=$PIECE(BGPFOBTC,U,2)_";"_$PIECE($PIECE(BGPFOBTC,U,3),".",1)
GOTO EXCCHK
+57 SET BGPFOBTI=$$LASTDX^BGPMUUT2(DFN,BGPFOBT,BGPEDATE,"BGPMU FOBT ICD CODES")
+58 IF +BGPFOBTI=1
SET VALUE=BGPFOBTI
SET STRING2=STRING2_";FOBI:"_$PIECE(BGPFOBTI,U,2)
SET BGPNSTR=$PIECE(BGPFOBTI,U,2)_";"_$PIECE($PIECE(BGPFOBTI,U,3),".",1)
GOTO EXCCHK
+59 SET BGPFOBTL=$$LOINC^BGPMUUT2(DFN,BGPFOBT,BGPEDATE,"BGPMU FOBT LOINC")
+60 IF +BGPFOBTL
SET BGPLOINC=$PIECE($GET(^AUPNVLAB($PIECE(BGPFOBTL,U,2),11)),U,13)
SET VALUE="1^"_BGPFOBTL
SET STRING2=STRING2_";FOBL:"_BGPLOINC
SET BGPNSTR=BGPLOINC_";"_$PIECE($PIECE(BGPFOBTL,U,1),".",1)
GOTO EXCCHK
+61 ;I +BGPFOBTL S VALUE="1^"_BGPFOBTL,STRING2=STRING2_";FOBL:"_$P(BGPFOBTL,U,2),BGPNSTR=$P(BGPFOBTL,U,2)_";"_$P($P(BGPFOBTL,U,1),".",1) G EXCCHK
EXCCHK ;Exclude if the patient has a colon cancer diagnosis
+1 ;Colon cancer is by ICD or CPT code
+2 IF '+VALUE
Begin DoDot:1
+3 SET BGPCADXI=$$LASTDX^BGPMUUT2(DFN,BGPBIRTH,BGPEDATE,"BGPMU COLON CANCER DX")
+4 IF +BGPCADXI=1
SET EXCEPT=BGPCADXI
SET STRING1=STRING1_";CCD:"_$PIECE(BGPCADXI,U,2)
+5 SET BGPCADXP=$$CPT^BGPMUUT1(DFN,BGPBIRTH,BGPEDATE,"BGPMU COLON CANCER STUDY")
+6 IF +BGPCADXP=1
SET EXCEPT=BGPCADXP
SET STRING1=STRING1_";CCS:"_$PIECE(BGPCADXP,U,2)
+7 SET BGPCAPR=$$PLTAX^BGPMUUT1(DFN,"BGPMU COLON CANCER DX")
+8 IF +BGPCAPR=1
SET EXCEPT=BGPCAPR
SET STRING1=STRING1_";CCP:"_$PIECE(BGPCAPR,U,2)
End DoDot:1
+9 DO TOTAL(DFN,VIEN,BGPDSTR,BGPNSTR)
+10 QUIT
TOTAL(DFN,VIEN,BGPDSTR,BGPNSTR) ;See where this patient ends up
+1 NEW PTCNT,EXCCT,DENCT,NUMCT,TOTALS
+2 SET TOTALS=$GET(^TMP("BGPMU0034",$JOB,BGPMUTF,"TOT"))
+3 SET EXCCT=+$GET(^TMP("BGPMU0034",$JOB,BGPMUTF,"EXC"))
+4 SET DENCT=+$GET(^TMP("BGPMU0034",$JOB,BGPMUTF,"DEN"))
+5 SET NUMCT=+$GET(^TMP("BGPMU0034",$JOB,BGPMUTF,"NUM"))
+6 SET PTCNT=TOTALS
+7 SET PTCNT=PTCNT+1
+8 ;Do not include those with total colectomy in the denomiator
+9 ;Q:+COLLECT
+10 SET DENCT=DENCT+1
SET ^TMP("BGPMU0034",$JOB,BGPMUTF,"DEN")=DENCT
+11 ;If Colon Cancer Dx, put in exception list
+12 IF +EXCEPT
Begin DoDot:1
+13 SET EXCCT=EXCCT+1
SET ^TMP("BGPMU0034",$JOB,BGPMUTF,"EXC")=EXCCT
+14 IF BGPMUTF="C"
SET ^TMP("BGPMU0034",$JOB,"PAT",BGPMUTF,"EXC",PTCNT)=DFN_U_STRING1_U_STRING2_U_$GET(BGPDSTR)_U_"Excluded"
End DoDot:1
+15 IF '$TEST
Begin DoDot:1
+16 IF +VALUE
Begin DoDot:2
+17 SET NUMCT=NUMCT+1
SET ^TMP("BGPMU0034",$JOB,BGPMUTF,"NUM")=NUMCT
+18 IF BGPMUTF="C"
SET ^TMP("BGPMU0034",$JOB,"PAT",BGPMUTF,"NUM",PTCNT)=DFN_U_STRING1_U_STRING2_U_$GET(BGPDSTR)_U_$GET(BGPNSTR)
End DoDot:2
+19 IF '$TEST
IF BGPMUTF="C"
SET ^TMP("BGPMU0034",$JOB,"PAT",BGPMUTF,"DEN",PTCNT)=DFN_U_STRING1_U_STRING2_U_$GET(BGPDSTR)_U_$GET(BGPNSTR)
End DoDot:1
+20 SET ^TMP("BGPMU0034",$JOB,BGPMUTF,"TOT")=PTCNT
+21 ;Setup iCare array for patient
+22 SET BGPICARE("MU.EP.0034.1",BGPMUTF)='EXCEPT_U_+VALUE_U_+EXCEPT_U_$GET(BGPDSTR)_";"_$GET(BGPNSTR)_U_$PIECE(EXCEPT,U,2)
+23 QUIT
+24 ;
TEST ;
+1 SET U="^"
+2 SET DT=$PIECE($$NOW^XLFDT(),".",1)
+3 SET DTIME=9000
+4 SET IOSTBM="$C(27,91)_(+IOTM)_$C(59)_(+IOBM)_$C(114)"
+5 DO DUZ^XUP(2)
+6 ;MERGE DUZ=^TMP("ZSAT","DUZ")
+7 DO ^%ZIS
+8 ; DFN = patient code from VA PATIENT file
SET DFN=568
+9 ; BGPBDATE = begin date of report
SET BGPBDATE=3110101
+10 ; BGPEDATE = end date of report
SET BGPEDATE=3111231
+11 SET BGPAGEE=$$AGE^AUPNPAT(DFN,BGPEDATE)
+12 ; BGPPROV = provider code from NEW PERSON file
SET BGPPROV=2
+13 ; BGPMUTF = timeframe variable - "C"=current year; "P"=previous year; "B"=baseline year
SET BGPMUTF="C"
+14 DO ENTRY
+15 QUIT