BGP1CP1 ; IHS/CMI/LAB - IHS gpra print ;
;;11.1;IHS CLINICAL REPORTING SYSTEM;;JUN 27, 2011;Build 33
;
;
AMIALL ;EP
I $Y>(BGPIOSL-3) D HDR^BGP1CP Q:BGPQUIT D L1H^BGP1CP
S BGPNOBA=1
D WRACE^BGP1CPU(DFN)
Q:BGPQUIT
D WDOB^BGP1CPU(DFN)
Q:BGPQUIT
D WZIP^BGP1CPU(DFN)
Q:BGPQUIT
D WINS^BGP1CPU(BGPVSIT,DFN)
Q:BGPQUIT
D WADM^BGP1CPU(BGPVINP)
Q:BGPQUIT
D WADM92^BGP1CPU(BGPVINP)
Q:BGPQUIT
D WADMS92^BGP1CPU(BGPVINP)
Q:BGPQUIT
D WDT^BGP1CPU(BGPVINP)
Q:BGPQUIT
D WDSGS92^BGP1CPU(BGPVINP)
Q:BGPQUIT
I $$TRANS^BGP1CU(BGPVINP) D WTT^BGP1CPU(BGPVINP) Q:BGPQUIT
K BGPNOBA
D WPPDPOV^BGP1CPU(BGPVSIT)
Q:BGPQUIT
S BGPNOBA=1
D OTHDPOVS^BGP1CPU(BGPVSIT)
Q:BGPQUIT
D WPRINPRO^BGP1CPU2
Q:BGPQUIT
D WOTHPROS^BGP1CPU2
K BGPNOBA
Q
;
AMI1 ;EP
I $Y>(BGPIOSL-3) D HDR^BGP1CP Q:BGPQUIT D L1H^BGP1CP
I $$TRANSIN^BGP1CU(BGPVINP) D TRANSIN^BGP1CP3 Q:BGPQUIT
D WDT^BGP1CPU(BGPVINP)
Q:BGPQUIT
I $$TRANS^BGP1CU(BGPVINP) D WTT^BGP1CPU(BGPVINP)
Q:BGPQUIT
I $$TRANS^BGP1CU(BGPVINP),$$DODA^BGP1CU(BGPVSIT,BGPVINP) D TRANSN^BGP1CP2 Q:BGPQUIT
D WPPDPOV^BGP1CPU(BGPVSIT)
Q:BGPQUIT
D OTHDPOVS^BGP1CPU(BGPVSIT)
Q:BGPQUIT
S X=$$COMFORT^BGP1CU(DFN,$P($P(^AUPNVSIT(BGPVSIT,0),U),"."),$P($P(^AUPNVINP(BGPVINP,0),U),"."))
D WCOMFORT^BGP1CPU(X)
Q:BGPQUIT
K BGPY,BGPDATA
D NMIDRUG^BGP1CU1(DFN,$$FMADD^XLFDT($P($P(^AUPNVSIT(BGPVSIT,0),U),"."),-1),$P($P(^AUPNVINP(BGPVINP,0),U),"."),.BGPDATA,"DM AUDIT ASPIRIN DRUGS",0)
D WNMIASP^BGP1CPU
Q:BGPQUIT
K X
S X=$$LASTMED^BGP1CU1(DFN,$$FMADD^XLFDT($P($P(^AUPNVSIT(BGPVSIT,0),U),"."),-365),$$FMADD^XLFDT($P($P(^AUPNVINP(BGPVINP,0),U),"."),30),"DM AUDIT ASPIRIN DRUGS") I X]"" S X="Last Outpatient Rx: "_X
K BGPUD
D IVUD^BGP1CU1(DFN,$P($P(BGPVSIT0,U),"."),$$DSCH^BGP1CU(BGPVINP),$O(^ATXAX("B","DM AUDIT ASPIRIN DRUGS",0)),.BGPUD)
D WLASTASP^BGP1CPU
Q:BGPQUIT
S X=$$LASTASPC^BGP1CU1(DFN,$$FMADD^XLFDT($P($P(^AUPNVSIT(BGPVSIT,0),U),"."),-365),$$FMADD^XLFDT($P($P(^AUPNVINP(BGPVINP,0),U),"."),30))
D WASPCPT^BGP1CPU(X)
Q:BGPQUIT
S X=$$LASTMED^BGP1CU1(DFN,$$FMADD^XLFDT($P($P(^AUPNVSIT(BGPVSIT,0),U),"."),-365),$$FMADD^XLFDT($P($P(^AUPNVINP(BGPVINP,0),U),"."),30),"BGP ANTI-PLATELET DRUGS","","BGP CMS ANTI-PLATELET CLASS") I X]"" S X="Last Outpatient Rx: "_X
K BGPUD
D IVUD^BGP1CU1(DFN,$P($P(BGPVSIT0,U),"."),$$DSCH^BGP1CU(BGPVINP),$O(^ATXAX("B","BGP ANTI-PLATELET DRUGS",0)),.BGPUD,$O(^ATXAX("B","BGP ANTI-PLATELET DRUGS",0)))
D WLASTAP^BGP1CPU
Q:BGPQUIT
D ALLALG1^BGP1CU1(DFN,DT,$$DSCH^BGP1CU(BGPVINP),.BGPDATA)
D WALLALG^BGP1CPU
Q:BGPQUIT
K BGPDATA
D ALLALGA1^BGP1CU1(DFN,DT,.BGPDATA)
D WALLALGT^BGP1CPU
K BGPDATA
D IVUD^BGP1CU1(DFN,$P($P(BGPVSIT0,U),"."),$$DSCH^BGP1CU(BGPVINP),,.BGPDATA)
D WIVUD^BGP1CPU
Q
AMI1W ;EP
I $Y>(BGPIOSL-3) D HDR^BGP1CP Q:BGPQUIT D L1H^BGP1CP
I $$TRANSIN^BGP1CU(BGPVINP) D TRANSIN^BGP1CP3 Q:BGPQUIT
D WDOD^BGP1CPU(DFN)
Q:BGPQUIT
D WDT^BGP1CPU(BGPVINP)
Q:BGPQUIT
I $$TRANS^BGP1CU(BGPVINP) D WTT^BGP1CPU(BGPVINP)
Q:BGPQUIT
I $$TRANS^BGP1CU(BGPVINP),$$DODA^BGP1CU(BGPVSIT,BGPVINP) D TRANSN^BGP1CP2 Q:BGPQUIT
D WPPDPOV^BGP1CPU(BGPVSIT)
Q:BGPQUIT
D OTHDPOVS^BGP1CPU(BGPVSIT)
Q:BGPQUIT
S X=$$COMFORT^BGP1CU(DFN,$P($P(^AUPNVSIT(BGPVSIT,0),U),"."),$P($P(^AUPNVINP(BGPVINP,0),U),"."))
D WCOMFORT^BGP1CPU(X)
Q:BGPQUIT
S X=$$ASAALLEG^BGP1CU1(DFN,$$DOB^AUPNPAT(DFN),$$DSCH^BGP1CU(BGPVINP)),X=$P(X,U,2,999)
D WASAALEG^BGP1CPU
Q:BGPQUIT
K BGPDATA
D WARRX^BGP1CU1(DFN,$$FMADD^XLFDT($P($P(^AUPNVSIT(BGPVSIT,0),U),"."),-180),$P($P(^AUPNVSIT(BGPVSIT,0),U),"."),1,.BGPDATA)
D WWARRX^BGP1CPU
Q:BGPQUIT
K BGPDATA,BGPY
D NMIDRUG^BGP1CU1(DFN,$P($P(^AUPNVSIT(BGPVSIT,0),U),"."),$P($P(^AUPNVINP(BGPVINP,0),U),"."),.BGPDATA,"DM AUDIT ASPIRIN DRUGS",0)
D WNMIASP^BGP1CPU
Q:BGPQUIT
K X
S X=$$LASTMED^BGP1CU1(DFN,$$FMADD^XLFDT($P($P(^AUPNVSIT(BGPVSIT,0),U),"."),-365),$$FMADD^XLFDT($P($P(^AUPNVINP(BGPVINP,0),U),"."),30),"DM AUDIT ASPIRIN DRUGS") I X]"" S X="Last Outpatient Rx: "_X
K BGPUD
D IVUD^BGP1CU1(DFN,$P($P(BGPVSIT0,U),"."),$$DSCH^BGP1CU(BGPVINP),$O(^ATXAX("B","DM AUDIT ASPIRIN DRUGS",0)),.BGPUD)
D WLASTASP^BGP1CPU
Q:BGPQUIT
S X=$$LASTASPC^BGP1CU1(DFN,$$FMADD^XLFDT($P($P(^AUPNVSIT(BGPVSIT,0),U),"."),-365),$$FMADD^XLFDT($P($P(^AUPNVINP(BGPVINP,0),U),"."),30))
D WASPCPT^BGP1CPU(X)
Q:BGPQUIT
S X=$$LASTMED^BGP1CU1(DFN,$$FMADD^XLFDT($P($P(^AUPNVSIT(BGPVSIT,0),U),"."),-365),$$FMADD^XLFDT($P($P(^AUPNVINP(BGPVINP,0),U),"."),30),"BGP ANTI-PLATELET DRUGS","","BGP CMS ANTI-PLATELET CLASS") I X]"" S X="Last Outpatient RX: "_X
K BGPUD
D IVUD^BGP1CU1(DFN,$P($P(BGPVSIT0,U),"."),$$DSCH^BGP1CU(BGPVINP),$O(^ATXAX("B","BGP ANTI-PLATELET DRUGS",0)),.BGPUD,$O(^ATXAX("B","BGP ANTI-PLATELET DRUGS",0)))
D WLASTAP^BGP1CPU
Q:BGPQUIT
D ALLALG1^BGP1CU1(DFN,DT,$$DSCH^BGP1CU(BGPVINP),.BGPDATA)
D WALLALG^BGP1CPU
Q:BGPQUIT
K BGPDATA
D ALLALGA1^BGP1CU1(DFN,DT,.BGPDATA)
D WALLALGT^BGP1CPU
Q:BGPQUIT
K BGPDATA
D IVUD^BGP1CU1(DFN,$P($P(BGPVSIT0,U),"."),$$DSCH^BGP1CU(BGPVINP),,.BGPDATA)
D WIVUD^BGP1CPU
Q
AMI2 ;EP
I $Y>(BGPIOSL-3) D HDR^BGP1CP Q:BGPQUIT D L1H^BGP1CP
D WDT^BGP1CPU(BGPVINP)
Q:BGPQUIT
I $$TRANS^BGP1CU(BGPVINP) D WTT^BGP1CPU(BGPVINP)
Q:BGPQUIT
I $$TRANS^BGP1CU(BGPVINP) D TRANSN^BGP1CP2 Q:BGPQUIT
D WPPDPOV^BGP1CPU(BGPVSIT)
Q:BGPQUIT
D OTHDPOVS^BGP1CPU(BGPVSIT)
Q:BGPQUIT
S X=$$COMFORT^BGP1CU(DFN,$P($P(^AUPNVSIT(BGPVSIT,0),U),"."),$P($P(^AUPNVINP(BGPVINP,0),U),"."))
D WCOMFORT^BGP1CPU(X)
Q:BGPQUIT
K BGPY,BGPDATA
D NMIDRUG^BGP1CU1(DFN,$P($P(^AUPNVSIT(BGPVSIT,0),U),"."),$P($P(^AUPNVINP(BGPVINP,0),U),"."),.BGPDATA,"DM AUDIT ASPIRIN DRUGS",0)
D WNMIASP^BGP1CPU
Q:BGPQUIT
S X=$$LASTMED^BGP1CU1(DFN,$$FMADD^XLFDT($P($P(^AUPNVSIT(BGPVSIT,0),U),"."),-365),$$FMADD^XLFDT($P($P(^AUPNVINP(BGPVINP,0),U),"."),30),"DM AUDIT ASPIRIN DRUGS") I X]"" S X="Last Outpatient Rx: "_X
K BGPUD
D IVUD^BGP1CU1(DFN,$P($P(BGPVSIT0,U),"."),$$DSCH^BGP1CU(BGPVINP),$O(^ATXAX("B","DM AUDIT ASPIRIN DRUGS",0)),.BGPUD)
D WLASTASP^BGP1CPU
Q:BGPQUIT
S X=$$LASTASPC^BGP1CU1(DFN,$$FMADD^XLFDT($P($P(^AUPNVSIT(BGPVSIT,0),U),"."),-365),$$FMADD^XLFDT($P($P(^AUPNVINP(BGPVINP,0),U),"."),30))
D WASPCPT^BGP1CPU(X)
Q:BGPQUIT
S X=$$LASTMED^BGP1CU1(DFN,$$FMADD^XLFDT($P($P(^AUPNVSIT(BGPVSIT,0),U),"."),-365),$$FMADD^XLFDT($P($P(^AUPNVINP(BGPVINP,0),U),"."),30),"BGP ANTI-PLATELET DRUGS","","BGP CMS ANTI-PLATELET CLASS") I X]"" S X="Last Outpatient RX: "_X
K BGPUD
D IVUD^BGP1CU1(DFN,$P($P(BGPVSIT0,U),"."),$$DSCH^BGP1CU(BGPVINP),$O(^ATXAX("B","BGP ANTI-PLATELET DRUGS",0)),.BGPUD,$O(^ATXAX("B","BGP ANTI-PLATELET DRUGS",0)))
D WLASTAP^BGP1CPU
Q:BGPQUIT
D ALLALG1^BGP1CU1(DFN,DT,$$DSCH^BGP1CU(BGPVINP),.BGPDATA)
D WALLALG^BGP1CPU
Q:BGPQUIT
K BGPDATA
D ALLALGA1^BGP1CU1(DFN,DT,.BGPDATA)
D WALLALGT^BGP1CPU
K BGPDATA
D IVUD^BGP1CU1(DFN,$P($P(BGPVSIT0,U),"."),$$DSCH^BGP1CU(BGPVINP),,.BGPDATA)
D WIVUD^BGP1CPU
Q
AMI2W ;EP
I $Y>(BGPIOSL-3) D HDR^BGP1CP Q:BGPQUIT D L1H^BGP1CP
D WDOD^BGP1CPU(DFN)
Q:BGPQUIT
D WDT^BGP1CPU(BGPVINP)
Q:BGPQUIT
I $$TRANS^BGP1CU(BGPVINP) D WTT^BGP1CPU(BGPVINP)
Q:BGPQUIT
I $$TRANS^BGP1CU(BGPVINP) D TRANSN^BGP1CP2 Q:BGPQUIT
D WPPDPOV^BGP1CPU(BGPVSIT)
Q:BGPQUIT
D OTHDPOVS^BGP1CPU(BGPVSIT)
Q:BGPQUIT
S X=$$COMFORT^BGP1CU(DFN,$P($P(^AUPNVSIT(BGPVSIT,0),U),"."),$P($P(^AUPNVINP(BGPVINP,0),U),"."))
D WCOMFORT^BGP1CPU(X)
Q:BGPQUIT
S X=$$ASAALLEG^BGP1CU1(DFN,$$DOB^AUPNPAT(DFN),$$DSCH^BGP1CU(BGPVINP))
D WASAALEG^BGP1CPU
Q:BGPQUIT
K BGPDATA
D WARRX^BGP1CU1(DFN,$P($P(^AUPNVINP(BGPVINP,0),U),"."),$P($P(^AUPNVINP(BGPVINP,0),U),"."),1,.BGPDATA)
D WWARRX^BGP1CPU
Q:BGPQUIT
K BGPDATA
D NMIDRUG^BGP1CU1(DFN,$P($P(^AUPNVSIT(BGPVSIT,0),U),"."),$P($P(^AUPNVINP(BGPVINP,0),U),"."),.BGPDATA,"DM AUDIT ASPIRIN DRUGS",0)
D WNMIASP^BGP1CPU
Q:BGPQUIT
S X=$$LASTMED^BGP1CU1(DFN,$$FMADD^XLFDT($P($P(^AUPNVSIT(BGPVSIT,0),U),"."),-365),$$FMADD^XLFDT($P($P(^AUPNVINP(BGPVINP,0),U),"."),30),"DM AUDIT ASPIRIN DRUGS") I X]"" S X="Last Outpatient Rx: "_X
K BGPUD
D IVUD^BGP1CU1(DFN,$P($P(BGPVSIT0,U),"."),$$DSCH^BGP1CU(BGPVINP),$O(^ATXAX("B","DM AUDIT ASPIRIN DRUGS",0)),.BGPUD)
D WLASTASP^BGP1CPU
Q:BGPQUIT
S X=$$LASTASPC^BGP1CU1(DFN,$P($P(^AUPNVINP(BGPVINP,0),U),"."),$P($P(^AUPNVINP(BGPVINP,0),U),"."))
D WASPCPT^BGP1CPU(X)
Q:BGPQUIT
S X=$$LASTMED^BGP1CU1(DFN,$$FMADD^XLFDT($P($P(^AUPNVSIT(BGPVSIT,0),U),"."),-365),$$FMADD^XLFDT($P($P(^AUPNVINP(BGPVINP,0),U),"."),30),"BGP ANTI-PLATELET DRUGS","","BGP CMS ANTI-PLATELET CLASS") I X]"" S X="Last Outpatient RX: "_X
K BGPUD
D IVUD^BGP1CU1(DFN,$P($P(BGPVSIT0,U),"."),$$DSCH^BGP1CU(BGPVINP),$O(^ATXAX("B","BGP ANTI-PLATELET DRUGS",0)),.BGPUD,$O(^ATXAX("B","BGP ANTI-PLATELET DRUGS",0)))
D WLASTAP^BGP1CPU
Q:BGPQUIT
D ALLALG1^BGP1CU1(DFN,DT,$$DSCH^BGP1CU(BGPVINP),.BGPDATA)
D WALLALG^BGP1CPU
Q:BGPQUIT
K BGPDATA
D ALLALGA1^BGP1CU1(DFN,DT,.BGPDATA)
D WALLALGT^BGP1CPU
Q:BGPQUIT
K BGPDATA
D IVUD^BGP1CU1(DFN,$P($P(BGPVSIT0,U),"."),$$DSCH^BGP1CU(BGPVINP),,.BGPDATA)
D WIVUD^BGP1CPU
Q
AMI3 ;EP
I $Y>(BGPIOSL-3) D HDR^BGP1CP Q:BGPQUIT D L1H^BGP1CP
D WDT^BGP1CPU(BGPVINP)
Q:BGPQUIT
I $$TRANS^BGP1CU(BGPVINP) D WTT^BGP1CPU(BGPVINP)
Q:BGPQUIT
I $$TRANS^BGP1CU(BGPVINP) D TRANSN^BGP1CP2 Q:BGPQUIT
D WPPDPOV^BGP1CPU(BGPVSIT)
Q:BGPQUIT
D OTHDPOVS^BGP1CPU(BGPVSIT)
Q:BGPQUIT
K BGPDATA
S BGPC=0
D LVSD^BGP1CU1(DFN,$$FMADD^XLFDT($$DSCH^BGP1CU(BGPVINP),-365),$$DSCH^BGP1CU(BGPVINP),.BGPDATA,0)
D EJECFRAC^BGP1CU1(DFN,$$FMADD^XLFDT($$DSCH^BGP1CU(BGPVINP),-365),$$DSCH^BGP1CU(BGPVINP),.BGPDATA,BGPC)
D WLVSD^BGP1CPU
Q:BGPQUIT
K BGPDATA
S X=$$COMFORT^BGP1CU(DFN,$P($P(^AUPNVSIT(BGPVSIT,0),U),"."),$P($P(^AUPNVINP(BGPVINP,0),U),"."))
D WCOMFORT^BGP1CPU(X)
Q:BGPQUIT
K BGPDATA,BGPDX
S BGPXX=0
D ANGIOED^BGP1CU6(DFN,$$FMADD^XLFDT($$DSCH^BGP1CU(BGPVINP),-365),$$DSCH^BGP1CU(BGPVINP),.BGPDATA,0)
S X=0 F S X=$O(BGPDATA(X)) Q:X'=+X S BGPXX=BGPXX+1,BGPDX(BGPXX)=BGPDATA(X)
K BGPDATA D HYPERKAL^BGP1CU6(DFN,$$FMADD^XLFDT($$DSCH^BGP1CU(BGPVINP),-365),$$DSCH^BGP1CU(BGPVINP),.BGPDATA,0)
S X=0 F S X=$O(BGPDATA(X)) Q:X'=+X S BGPXX=BGPXX+1,BGPDX(BGPXX)=BGPDATA(X)
K BGPDATA D HYPOTEN^BGP1CU6(DFN,$$FMADD^XLFDT($$DSCH^BGP1CU(BGPVINP),-365),$$DSCH^BGP1CU(BGPVINP),.BGPDATA,0)
S X=0 F S X=$O(BGPDATA(X)) Q:X'=+X S BGPXX=BGPXX+1,BGPDX(BGPXX)=BGPDATA(X)
K BGPDATA D RENART^BGP1CU6(DFN,$$FMADD^XLFDT($$DSCH^BGP1CU(BGPVINP),-365),$$DSCH^BGP1CU(BGPVINP),.BGPDATA,0)
S X=0 F S X=$O(BGPDATA(X)) Q:X'=+X S BGPXX=BGPXX+1,BGPDX(BGPXX)=BGPDATA(X)
K BGPDATA D RENAL^BGP1CU6(DFN,$$FMADD^XLFDT($$DSCH^BGP1CU(BGPVINP),-365),$$DSCH^BGP1CU(BGPVINP),.BGPDATA,0)
S X=0 F S X=$O(BGPDATA(X)) Q:X'=+X S BGPXX=BGPXX+1,BGPDX(BGPXX)=BGPDATA(X)
D WDXS^BGP1CPU
K BGPDATA
K BGPY
Q:BGPQUIT
S X=$$ACEALLEG^BGP1CU1(DFN,$$DOB^AUPNPAT(DFN),$$DSCH^BGP1CU(BGPVINP))
S Z=$$ARBALLEG^BGP1CU1(DFN,$$DOB^AUPNPAT(DFN),$$DSCH^BGP1CU(BGPVINP))
D WACEALEG^BGP1CPU
Q:BGPQUIT
K BGPDATA
S BGPC=0
D NMIDRUG^BGP1CU1(DFN,$P($P(^AUPNVSIT(BGPVSIT,0),U),"."),$P($P(^AUPNVINP(BGPVINP,0),U),"."),.BGPDATA,"BGP CMS ACEI MEDS",0)
D NMIDRUG^BGP1CU1(DFN,$P($P(^AUPNVSIT(BGPVSIT,0),U),"."),$P($P(^AUPNVINP(BGPVINP,0),U),"."),.BGPDATA,"BGP CMS ARB MEDS",BGPC)
D WNMIACE^BGP1CPU(.BGPDATA)
Q:BGPQUIT
S X=$$LASTMED^BGP1CU1(DFN,$$FMADD^XLFDT($P($P(^AUPNVSIT(BGPVSIT,0),U),"."),-365),$$FMADD^XLFDT($P($P(^AUPNVINP(BGPVINP,0),U),"."),30),"BGP CMS ACEI MEDS","","BGP CMS ACEI MEDS CLASS")
S Z=$$LASTMED^BGP1CU1(DFN,$$FMADD^XLFDT($P($P(^AUPNVSIT(BGPVSIT,0),U),"."),-365),$$FMADD^XLFDT($P($P(^AUPNVINP(BGPVINP,0),U),"."),30),"BGP CMS ARB MEDS","","BGP CMS ARB MEDS CLASS")
D WLASTACE^BGP1CPU
Q:BGPQUIT
D ALLALG1^BGP1CU1(DFN,DT,$$DSCH^BGP1CU(BGPVINP),.BGPDATA)
D WALLALG^BGP1CPU
Q:BGPQUIT
K BGPDATA
D ALLALGA1^BGP1CU1(DFN,DT,.BGPDATA)
D WALLALGT^BGP1CPU
K BGPDATA
D IVUD^BGP1CU1(DFN,$P($P(BGPVSIT0,U),"."),$$DSCH^BGP1CU(BGPVINP),,.BGPDATA)
D WIVUD^BGP1CPU
Q
;
AMI3W ;EP
D AMI3W^BGP1CP11
Q
BGP1CP1 ; IHS/CMI/LAB - IHS gpra print ;
+1 ;;11.1;IHS CLINICAL REPORTING SYSTEM;;JUN 27, 2011;Build 33
+2 ;
+3 ;
AMIALL ;EP
+1 IF $Y>(BGPIOSL-3)
DO HDR^BGP1CP
IF BGPQUIT
QUIT
DO L1H^BGP1CP
+2 SET BGPNOBA=1
+3 DO WRACE^BGP1CPU(DFN)
+4 IF BGPQUIT
QUIT
+5 DO WDOB^BGP1CPU(DFN)
+6 IF BGPQUIT
QUIT
+7 DO WZIP^BGP1CPU(DFN)
+8 IF BGPQUIT
QUIT
+9 DO WINS^BGP1CPU(BGPVSIT,DFN)
+10 IF BGPQUIT
QUIT
+11 DO WADM^BGP1CPU(BGPVINP)
+12 IF BGPQUIT
QUIT
+13 DO WADM92^BGP1CPU(BGPVINP)
+14 IF BGPQUIT
QUIT
+15 DO WADMS92^BGP1CPU(BGPVINP)
+16 IF BGPQUIT
QUIT
+17 DO WDT^BGP1CPU(BGPVINP)
+18 IF BGPQUIT
QUIT
+19 DO WDSGS92^BGP1CPU(BGPVINP)
+20 IF BGPQUIT
QUIT
+21 IF $$TRANS^BGP1CU(BGPVINP)
DO WTT^BGP1CPU(BGPVINP)
IF BGPQUIT
QUIT
+22 KILL BGPNOBA
+23 DO WPPDPOV^BGP1CPU(BGPVSIT)
+24 IF BGPQUIT
QUIT
+25 SET BGPNOBA=1
+26 DO OTHDPOVS^BGP1CPU(BGPVSIT)
+27 IF BGPQUIT
QUIT
+28 DO WPRINPRO^BGP1CPU2
+29 IF BGPQUIT
QUIT
+30 DO WOTHPROS^BGP1CPU2
+31 KILL BGPNOBA
+32 QUIT
+33 ;
AMI1 ;EP
+1 IF $Y>(BGPIOSL-3)
DO HDR^BGP1CP
IF BGPQUIT
QUIT
DO L1H^BGP1CP
+2 IF $$TRANSIN^BGP1CU(BGPVINP)
DO TRANSIN^BGP1CP3
IF BGPQUIT
QUIT
+3 DO WDT^BGP1CPU(BGPVINP)
+4 IF BGPQUIT
QUIT
+5 IF $$TRANS^BGP1CU(BGPVINP)
DO WTT^BGP1CPU(BGPVINP)
+6 IF BGPQUIT
QUIT
+7 IF $$TRANS^BGP1CU(BGPVINP)
IF $$DODA^BGP1CU(BGPVSIT,BGPVINP)
DO TRANSN^BGP1CP2
IF BGPQUIT
QUIT
+8 DO WPPDPOV^BGP1CPU(BGPVSIT)
+9 IF BGPQUIT
QUIT
+10 DO OTHDPOVS^BGP1CPU(BGPVSIT)
+11 IF BGPQUIT
QUIT
+12 SET X=$$COMFORT^BGP1CU(DFN,$PIECE($PIECE(^AUPNVSIT(BGPVSIT,0),U),"."),$PIECE($PIECE(^AUPNVINP(BGPVINP,0),U),"."))
+13 DO WCOMFORT^BGP1CPU(X)
+14 IF BGPQUIT
QUIT
+15 KILL BGPY,BGPDATA
+16 DO NMIDRUG^BGP1CU1(DFN,$$FMADD^XLFDT($PIECE($PIECE(^AUPNVSIT(BGPVSIT,0),U),"."),-1),$PIECE($PIECE(^AUPNVINP(BGPVINP,0),U),"."),.BGPDATA,"DM AUDIT ASPIRIN DRUGS",0)
+17 DO WNMIASP^BGP1CPU
+18 IF BGPQUIT
QUIT
+19 KILL X
+20 SET X=$$LASTMED^BGP1CU1(DFN,$$FMADD^XLFDT($PIECE($PIECE(^AUPNVSIT(BGPVSIT,0),U),"."),-365),$$FMADD^XLFDT($PIECE($PIECE(^AUPNVINP(BGPVINP,0),U),"."),30),"DM AUDIT ASPIRIN DRUGS")
IF X]""
SET X="Last Outpatient Rx: "_X
+21 KILL BGPUD
+22 DO IVUD^BGP1CU1(DFN,$PIECE($PIECE(BGPVSIT0,U),"."),$$DSCH^BGP1CU(BGPVINP),$ORDER(^ATXAX("B","DM AUDIT ASPIRIN DRUGS",0)),.BGPUD)
+23 DO WLASTASP^BGP1CPU
+24 IF BGPQUIT
QUIT
+25 SET X=$$LASTASPC^BGP1CU1(DFN,$$FMADD^XLFDT($PIECE($PIECE(^AUPNVSIT(BGPVSIT,0),U),"."),-365),$$FMADD^XLFDT($PIECE($PIECE(^AUPNVINP(BGPVINP,0),U),"."),30))
+26 DO WASPCPT^BGP1CPU(X)
+27 IF BGPQUIT
QUIT
+28 SET X=$$LASTMED^BGP1CU1(DFN,$$FMADD^XLFDT($PIECE($PIECE(^AUPNVSIT(BGPVSIT,0),U),"."),-365),$$FMADD^XLFDT($PIECE($PIECE(^AUPNVINP(BGPVINP,0),U),"."),30),"BGP ANTI-PLATELET DRUGS","","BGP CMS ANTI-PLATELET CLASS")
IF X]""
SET X="Last Outpatient Rx: "_X
+29 KILL BGPUD
+30 DO IVUD^BGP1CU1(DFN,$PIECE($PIECE(BGPVSIT0,U),"."),$$DSCH^BGP1CU(BGPVINP),$ORDER(^ATXAX("B","BGP ANTI-PLATELET DRUGS",0)),.BGPUD,$ORDER(^ATXAX("B","BGP ANTI-PLATELET DRUGS",0)))
+31 DO WLASTAP^BGP1CPU
+32 IF BGPQUIT
QUIT
+33 DO ALLALG1^BGP1CU1(DFN,DT,$$DSCH^BGP1CU(BGPVINP),.BGPDATA)
+34 DO WALLALG^BGP1CPU
+35 IF BGPQUIT
QUIT
+36 KILL BGPDATA
+37 DO ALLALGA1^BGP1CU1(DFN,DT,.BGPDATA)
+38 DO WALLALGT^BGP1CPU
+39 KILL BGPDATA
+40 DO IVUD^BGP1CU1(DFN,$PIECE($PIECE(BGPVSIT0,U),"."),$$DSCH^BGP1CU(BGPVINP),,.BGPDATA)
+41 DO WIVUD^BGP1CPU
+42 QUIT
AMI1W ;EP
+1 IF $Y>(BGPIOSL-3)
DO HDR^BGP1CP
IF BGPQUIT
QUIT
DO L1H^BGP1CP
+2 IF $$TRANSIN^BGP1CU(BGPVINP)
DO TRANSIN^BGP1CP3
IF BGPQUIT
QUIT
+3 DO WDOD^BGP1CPU(DFN)
+4 IF BGPQUIT
QUIT
+5 DO WDT^BGP1CPU(BGPVINP)
+6 IF BGPQUIT
QUIT
+7 IF $$TRANS^BGP1CU(BGPVINP)
DO WTT^BGP1CPU(BGPVINP)
+8 IF BGPQUIT
QUIT
+9 IF $$TRANS^BGP1CU(BGPVINP)
IF $$DODA^BGP1CU(BGPVSIT,BGPVINP)
DO TRANSN^BGP1CP2
IF BGPQUIT
QUIT
+10 DO WPPDPOV^BGP1CPU(BGPVSIT)
+11 IF BGPQUIT
QUIT
+12 DO OTHDPOVS^BGP1CPU(BGPVSIT)
+13 IF BGPQUIT
QUIT
+14 SET X=$$COMFORT^BGP1CU(DFN,$PIECE($PIECE(^AUPNVSIT(BGPVSIT,0),U),"."),$PIECE($PIECE(^AUPNVINP(BGPVINP,0),U),"."))
+15 DO WCOMFORT^BGP1CPU(X)
+16 IF BGPQUIT
QUIT
+17 SET X=$$ASAALLEG^BGP1CU1(DFN,$$DOB^AUPNPAT(DFN),$$DSCH^BGP1CU(BGPVINP))
SET X=$PIECE(X,U,2,999)
+18 DO WASAALEG^BGP1CPU
+19 IF BGPQUIT
QUIT
+20 KILL BGPDATA
+21 DO WARRX^BGP1CU1(DFN,$$FMADD^XLFDT($PIECE($PIECE(^AUPNVSIT(BGPVSIT,0),U),"."),-180),$PIECE($PIECE(^AUPNVSIT(BGPVSIT,0),U),"."),1,.BGPDATA)
+22 DO WWARRX^BGP1CPU
+23 IF BGPQUIT
QUIT
+24 KILL BGPDATA,BGPY
+25 DO NMIDRUG^BGP1CU1(DFN,$PIECE($PIECE(^AUPNVSIT(BGPVSIT,0),U),"."),$PIECE($PIECE(^AUPNVINP(BGPVINP,0),U),"."),.BGPDATA,"DM AUDIT ASPIRIN DRUGS",0)
+26 DO WNMIASP^BGP1CPU
+27 IF BGPQUIT
QUIT
+28 KILL X
+29 SET X=$$LASTMED^BGP1CU1(DFN,$$FMADD^XLFDT($PIECE($PIECE(^AUPNVSIT(BGPVSIT,0),U),"."),-365),$$FMADD^XLFDT($PIECE($PIECE(^AUPNVINP(BGPVINP,0),U),"."),30),"DM AUDIT ASPIRIN DRUGS")
IF X]""
SET X="Last Outpatient Rx: "_X
+30 KILL BGPUD
+31 DO IVUD^BGP1CU1(DFN,$PIECE($PIECE(BGPVSIT0,U),"."),$$DSCH^BGP1CU(BGPVINP),$ORDER(^ATXAX("B","DM AUDIT ASPIRIN DRUGS",0)),.BGPUD)
+32 DO WLASTASP^BGP1CPU
+33 IF BGPQUIT
QUIT
+34 SET X=$$LASTASPC^BGP1CU1(DFN,$$FMADD^XLFDT($PIECE($PIECE(^AUPNVSIT(BGPVSIT,0),U),"."),-365),$$FMADD^XLFDT($PIECE($PIECE(^AUPNVINP(BGPVINP,0),U),"."),30))
+35 DO WASPCPT^BGP1CPU(X)
+36 IF BGPQUIT
QUIT
+37 SET X=$$LASTMED^BGP1CU1(DFN,$$FMADD^XLFDT($PIECE($PIECE(^AUPNVSIT(BGPVSIT,0),U),"."),-365),$$FMADD^XLFDT($PIECE($PIECE(^AUPNVINP(BGPVINP,0),U),"."),30),"BGP ANTI-PLATELET DRUGS","","BGP CMS ANTI-PLATELET CLASS")
IF X]""
SET X="Last Outpatient RX: "_X
+38 KILL BGPUD
+39 DO IVUD^BGP1CU1(DFN,$PIECE($PIECE(BGPVSIT0,U),"."),$$DSCH^BGP1CU(BGPVINP),$ORDER(^ATXAX("B","BGP ANTI-PLATELET DRUGS",0)),.BGPUD,$ORDER(^ATXAX("B","BGP ANTI-PLATELET DRUGS",0)))
+40 DO WLASTAP^BGP1CPU
+41 IF BGPQUIT
QUIT
+42 DO ALLALG1^BGP1CU1(DFN,DT,$$DSCH^BGP1CU(BGPVINP),.BGPDATA)
+43 DO WALLALG^BGP1CPU
+44 IF BGPQUIT
QUIT
+45 KILL BGPDATA
+46 DO ALLALGA1^BGP1CU1(DFN,DT,.BGPDATA)
+47 DO WALLALGT^BGP1CPU
+48 IF BGPQUIT
QUIT
+49 KILL BGPDATA
+50 DO IVUD^BGP1CU1(DFN,$PIECE($PIECE(BGPVSIT0,U),"."),$$DSCH^BGP1CU(BGPVINP),,.BGPDATA)
+51 DO WIVUD^BGP1CPU
+52 QUIT
AMI2 ;EP
+1 IF $Y>(BGPIOSL-3)
DO HDR^BGP1CP
IF BGPQUIT
QUIT
DO L1H^BGP1CP
+2 DO WDT^BGP1CPU(BGPVINP)
+3 IF BGPQUIT
QUIT
+4 IF $$TRANS^BGP1CU(BGPVINP)
DO WTT^BGP1CPU(BGPVINP)
+5 IF BGPQUIT
QUIT
+6 IF $$TRANS^BGP1CU(BGPVINP)
DO TRANSN^BGP1CP2
IF BGPQUIT
QUIT
+7 DO WPPDPOV^BGP1CPU(BGPVSIT)
+8 IF BGPQUIT
QUIT
+9 DO OTHDPOVS^BGP1CPU(BGPVSIT)
+10 IF BGPQUIT
QUIT
+11 SET X=$$COMFORT^BGP1CU(DFN,$PIECE($PIECE(^AUPNVSIT(BGPVSIT,0),U),"."),$PIECE($PIECE(^AUPNVINP(BGPVINP,0),U),"."))
+12 DO WCOMFORT^BGP1CPU(X)
+13 IF BGPQUIT
QUIT
+14 KILL BGPY,BGPDATA
+15 DO NMIDRUG^BGP1CU1(DFN,$PIECE($PIECE(^AUPNVSIT(BGPVSIT,0),U),"."),$PIECE($PIECE(^AUPNVINP(BGPVINP,0),U),"."),.BGPDATA,"DM AUDIT ASPIRIN DRUGS",0)
+16 DO WNMIASP^BGP1CPU
+17 IF BGPQUIT
QUIT
+18 SET X=$$LASTMED^BGP1CU1(DFN,$$FMADD^XLFDT($PIECE($PIECE(^AUPNVSIT(BGPVSIT,0),U),"."),-365),$$FMADD^XLFDT($PIECE($PIECE(^AUPNVINP(BGPVINP,0),U),"."),30),"DM AUDIT ASPIRIN DRUGS")
IF X]""
SET X="Last Outpatient Rx: "_X
+19 KILL BGPUD
+20 DO IVUD^BGP1CU1(DFN,$PIECE($PIECE(BGPVSIT0,U),"."),$$DSCH^BGP1CU(BGPVINP),$ORDER(^ATXAX("B","DM AUDIT ASPIRIN DRUGS",0)),.BGPUD)
+21 DO WLASTASP^BGP1CPU
+22 IF BGPQUIT
QUIT
+23 SET X=$$LASTASPC^BGP1CU1(DFN,$$FMADD^XLFDT($PIECE($PIECE(^AUPNVSIT(BGPVSIT,0),U),"."),-365),$$FMADD^XLFDT($PIECE($PIECE(^AUPNVINP(BGPVINP,0),U),"."),30))
+24 DO WASPCPT^BGP1CPU(X)
+25 IF BGPQUIT
QUIT
+26 SET X=$$LASTMED^BGP1CU1(DFN,$$FMADD^XLFDT($PIECE($PIECE(^AUPNVSIT(BGPVSIT,0),U),"."),-365),$$FMADD^XLFDT($PIECE($PIECE(^AUPNVINP(BGPVINP,0),U),"."),30),"BGP ANTI-PLATELET DRUGS","","BGP CMS ANTI-PLATELET CLASS")
IF X]""
SET X="Last Outpatient RX: "_X
+27 KILL BGPUD
+28 DO IVUD^BGP1CU1(DFN,$PIECE($PIECE(BGPVSIT0,U),"."),$$DSCH^BGP1CU(BGPVINP),$ORDER(^ATXAX("B","BGP ANTI-PLATELET DRUGS",0)),.BGPUD,$ORDER(^ATXAX("B","BGP ANTI-PLATELET DRUGS",0)))
+29 DO WLASTAP^BGP1CPU
+30 IF BGPQUIT
QUIT
+31 DO ALLALG1^BGP1CU1(DFN,DT,$$DSCH^BGP1CU(BGPVINP),.BGPDATA)
+32 DO WALLALG^BGP1CPU
+33 IF BGPQUIT
QUIT
+34 KILL BGPDATA
+35 DO ALLALGA1^BGP1CU1(DFN,DT,.BGPDATA)
+36 DO WALLALGT^BGP1CPU
+37 KILL BGPDATA
+38 DO IVUD^BGP1CU1(DFN,$PIECE($PIECE(BGPVSIT0,U),"."),$$DSCH^BGP1CU(BGPVINP),,.BGPDATA)
+39 DO WIVUD^BGP1CPU
+40 QUIT
AMI2W ;EP
+1 IF $Y>(BGPIOSL-3)
DO HDR^BGP1CP
IF BGPQUIT
QUIT
DO L1H^BGP1CP
+2 DO WDOD^BGP1CPU(DFN)
+3 IF BGPQUIT
QUIT
+4 DO WDT^BGP1CPU(BGPVINP)
+5 IF BGPQUIT
QUIT
+6 IF $$TRANS^BGP1CU(BGPVINP)
DO WTT^BGP1CPU(BGPVINP)
+7 IF BGPQUIT
QUIT
+8 IF $$TRANS^BGP1CU(BGPVINP)
DO TRANSN^BGP1CP2
IF BGPQUIT
QUIT
+9 DO WPPDPOV^BGP1CPU(BGPVSIT)
+10 IF BGPQUIT
QUIT
+11 DO OTHDPOVS^BGP1CPU(BGPVSIT)
+12 IF BGPQUIT
QUIT
+13 SET X=$$COMFORT^BGP1CU(DFN,$PIECE($PIECE(^AUPNVSIT(BGPVSIT,0),U),"."),$PIECE($PIECE(^AUPNVINP(BGPVINP,0),U),"."))
+14 DO WCOMFORT^BGP1CPU(X)
+15 IF BGPQUIT
QUIT
+16 SET X=$$ASAALLEG^BGP1CU1(DFN,$$DOB^AUPNPAT(DFN),$$DSCH^BGP1CU(BGPVINP))
+17 DO WASAALEG^BGP1CPU
+18 IF BGPQUIT
QUIT
+19 KILL BGPDATA
+20 DO WARRX^BGP1CU1(DFN,$PIECE($PIECE(^AUPNVINP(BGPVINP,0),U),"."),$PIECE($PIECE(^AUPNVINP(BGPVINP,0),U),"."),1,.BGPDATA)
+21 DO WWARRX^BGP1CPU
+22 IF BGPQUIT
QUIT
+23 KILL BGPDATA
+24 DO NMIDRUG^BGP1CU1(DFN,$PIECE($PIECE(^AUPNVSIT(BGPVSIT,0),U),"."),$PIECE($PIECE(^AUPNVINP(BGPVINP,0),U),"."),.BGPDATA,"DM AUDIT ASPIRIN DRUGS",0)
+25 DO WNMIASP^BGP1CPU
+26 IF BGPQUIT
QUIT
+27 SET X=$$LASTMED^BGP1CU1(DFN,$$FMADD^XLFDT($PIECE($PIECE(^AUPNVSIT(BGPVSIT,0),U),"."),-365),$$FMADD^XLFDT($PIECE($PIECE(^AUPNVINP(BGPVINP,0),U),"."),30),"DM AUDIT ASPIRIN DRUGS")
IF X]""
SET X="Last Outpatient Rx: "_X
+28 KILL BGPUD
+29 DO IVUD^BGP1CU1(DFN,$PIECE($PIECE(BGPVSIT0,U),"."),$$DSCH^BGP1CU(BGPVINP),$ORDER(^ATXAX("B","DM AUDIT ASPIRIN DRUGS",0)),.BGPUD)
+30 DO WLASTASP^BGP1CPU
+31 IF BGPQUIT
QUIT
+32 SET X=$$LASTASPC^BGP1CU1(DFN,$PIECE($PIECE(^AUPNVINP(BGPVINP,0),U),"."),$PIECE($PIECE(^AUPNVINP(BGPVINP,0),U),"."))
+33 DO WASPCPT^BGP1CPU(X)
+34 IF BGPQUIT
QUIT
+35 SET X=$$LASTMED^BGP1CU1(DFN,$$FMADD^XLFDT($PIECE($PIECE(^AUPNVSIT(BGPVSIT,0),U),"."),-365),$$FMADD^XLFDT($PIECE($PIECE(^AUPNVINP(BGPVINP,0),U),"."),30),"BGP ANTI-PLATELET DRUGS","","BGP CMS ANTI-PLATELET CLASS")
IF X]""
SET X="Last Outpatient RX: "_X
+36 KILL BGPUD
+37 DO IVUD^BGP1CU1(DFN,$PIECE($PIECE(BGPVSIT0,U),"."),$$DSCH^BGP1CU(BGPVINP),$ORDER(^ATXAX("B","BGP ANTI-PLATELET DRUGS",0)),.BGPUD,$ORDER(^ATXAX("B","BGP ANTI-PLATELET DRUGS",0)))
+38 DO WLASTAP^BGP1CPU
+39 IF BGPQUIT
QUIT
+40 DO ALLALG1^BGP1CU1(DFN,DT,$$DSCH^BGP1CU(BGPVINP),.BGPDATA)
+41 DO WALLALG^BGP1CPU
+42 IF BGPQUIT
QUIT
+43 KILL BGPDATA
+44 DO ALLALGA1^BGP1CU1(DFN,DT,.BGPDATA)
+45 DO WALLALGT^BGP1CPU
+46 IF BGPQUIT
QUIT
+47 KILL BGPDATA
+48 DO IVUD^BGP1CU1(DFN,$PIECE($PIECE(BGPVSIT0,U),"."),$$DSCH^BGP1CU(BGPVINP),,.BGPDATA)
+49 DO WIVUD^BGP1CPU
+50 QUIT
AMI3 ;EP
+1 IF $Y>(BGPIOSL-3)
DO HDR^BGP1CP
IF BGPQUIT
QUIT
DO L1H^BGP1CP
+2 DO WDT^BGP1CPU(BGPVINP)
+3 IF BGPQUIT
QUIT
+4 IF $$TRANS^BGP1CU(BGPVINP)
DO WTT^BGP1CPU(BGPVINP)
+5 IF BGPQUIT
QUIT
+6 IF $$TRANS^BGP1CU(BGPVINP)
DO TRANSN^BGP1CP2
IF BGPQUIT
QUIT
+7 DO WPPDPOV^BGP1CPU(BGPVSIT)
+8 IF BGPQUIT
QUIT
+9 DO OTHDPOVS^BGP1CPU(BGPVSIT)
+10 IF BGPQUIT
QUIT
+11 KILL BGPDATA
+12 SET BGPC=0
+13 DO LVSD^BGP1CU1(DFN,$$FMADD^XLFDT($$DSCH^BGP1CU(BGPVINP),-365),$$DSCH^BGP1CU(BGPVINP),.BGPDATA,0)
+14 DO EJECFRAC^BGP1CU1(DFN,$$FMADD^XLFDT($$DSCH^BGP1CU(BGPVINP),-365),$$DSCH^BGP1CU(BGPVINP),.BGPDATA,BGPC)
+15 DO WLVSD^BGP1CPU
+16 IF BGPQUIT
QUIT
+17 KILL BGPDATA
+18 SET X=$$COMFORT^BGP1CU(DFN,$PIECE($PIECE(^AUPNVSIT(BGPVSIT,0),U),"."),$PIECE($PIECE(^AUPNVINP(BGPVINP,0),U),"."))
+19 DO WCOMFORT^BGP1CPU(X)
+20 IF BGPQUIT
QUIT
+21 KILL BGPDATA,BGPDX
+22 SET BGPXX=0
+23 DO ANGIOED^BGP1CU6(DFN,$$FMADD^XLFDT($$DSCH^BGP1CU(BGPVINP),-365),$$DSCH^BGP1CU(BGPVINP),.BGPDATA,0)
+24 SET X=0
FOR
SET X=$ORDER(BGPDATA(X))
IF X'=+X
QUIT
SET BGPXX=BGPXX+1
SET BGPDX(BGPXX)=BGPDATA(X)
+25 KILL BGPDATA
DO HYPERKAL^BGP1CU6(DFN,$$FMADD^XLFDT($$DSCH^BGP1CU(BGPVINP),-365),$$DSCH^BGP1CU(BGPVINP),.BGPDATA,0)
+26 SET X=0
FOR
SET X=$ORDER(BGPDATA(X))
IF X'=+X
QUIT
SET BGPXX=BGPXX+1
SET BGPDX(BGPXX)=BGPDATA(X)
+27 KILL BGPDATA
DO HYPOTEN^BGP1CU6(DFN,$$FMADD^XLFDT($$DSCH^BGP1CU(BGPVINP),-365),$$DSCH^BGP1CU(BGPVINP),.BGPDATA,0)
+28 SET X=0
FOR
SET X=$ORDER(BGPDATA(X))
IF X'=+X
QUIT
SET BGPXX=BGPXX+1
SET BGPDX(BGPXX)=BGPDATA(X)
+29 KILL BGPDATA
DO RENART^BGP1CU6(DFN,$$FMADD^XLFDT($$DSCH^BGP1CU(BGPVINP),-365),$$DSCH^BGP1CU(BGPVINP),.BGPDATA,0)
+30 SET X=0
FOR
SET X=$ORDER(BGPDATA(X))
IF X'=+X
QUIT
SET BGPXX=BGPXX+1
SET BGPDX(BGPXX)=BGPDATA(X)
+31 KILL BGPDATA
DO RENAL^BGP1CU6(DFN,$$FMADD^XLFDT($$DSCH^BGP1CU(BGPVINP),-365),$$DSCH^BGP1CU(BGPVINP),.BGPDATA,0)
+32 SET X=0
FOR
SET X=$ORDER(BGPDATA(X))
IF X'=+X
QUIT
SET BGPXX=BGPXX+1
SET BGPDX(BGPXX)=BGPDATA(X)
+33 DO WDXS^BGP1CPU
+34 KILL BGPDATA
+35 KILL BGPY
+36 IF BGPQUIT
QUIT
+37 SET X=$$ACEALLEG^BGP1CU1(DFN,$$DOB^AUPNPAT(DFN),$$DSCH^BGP1CU(BGPVINP))
+38 SET Z=$$ARBALLEG^BGP1CU1(DFN,$$DOB^AUPNPAT(DFN),$$DSCH^BGP1CU(BGPVINP))
+39 DO WACEALEG^BGP1CPU
+40 IF BGPQUIT
QUIT
+41 KILL BGPDATA
+42 SET BGPC=0
+43 DO NMIDRUG^BGP1CU1(DFN,$PIECE($PIECE(^AUPNVSIT(BGPVSIT,0),U),"."),$PIECE($PIECE(^AUPNVINP(BGPVINP,0),U),"."),.BGPDATA,"BGP CMS ACEI MEDS",0)
+44 DO NMIDRUG^BGP1CU1(DFN,$PIECE($PIECE(^AUPNVSIT(BGPVSIT,0),U),"."),$PIECE($PIECE(^AUPNVINP(BGPVINP,0),U),"."),.BGPDATA,"BGP CMS ARB MEDS",BGPC)
+45 DO WNMIACE^BGP1CPU(.BGPDATA)
+46 IF BGPQUIT
QUIT
+47 SET X=$$LASTMED^BGP1CU1(DFN,$$FMADD^XLFDT($PIECE($PIECE(^AUPNVSIT(BGPVSIT,0),U),"."),-365),$$FMADD^XLFDT($PIECE($PIECE(^AUPNVINP(BGPVINP,0),U),"."),30),"BGP CMS ACEI MEDS","","BGP CMS ACEI MEDS CLASS")
+48 SET Z=$$LASTMED^BGP1CU1(DFN,$$FMADD^XLFDT($PIECE($PIECE(^AUPNVSIT(BGPVSIT,0),U),"."),-365),$$FMADD^XLFDT($PIECE($PIECE(^AUPNVINP(BGPVINP,0),U),"."),30),"BGP CMS ARB MEDS","","BGP CMS ARB MEDS CLASS")
+49 DO WLASTACE^BGP1CPU
+50 IF BGPQUIT
QUIT
+51 DO ALLALG1^BGP1CU1(DFN,DT,$$DSCH^BGP1CU(BGPVINP),.BGPDATA)
+52 DO WALLALG^BGP1CPU
+53 IF BGPQUIT
QUIT
+54 KILL BGPDATA
+55 DO ALLALGA1^BGP1CU1(DFN,DT,.BGPDATA)
+56 DO WALLALGT^BGP1CPU
+57 KILL BGPDATA
+58 DO IVUD^BGP1CU1(DFN,$PIECE($PIECE(BGPVSIT0,U),"."),$$DSCH^BGP1CU(BGPVINP),,.BGPDATA)
+59 DO WIVUD^BGP1CPU
+60 QUIT
+61 ;
AMI3W ;EP
+1 DO AMI3W^BGP1CP11
+2 QUIT