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

BGP0CP4.m

Go to the documentation of this file.
BGP0CP4 ; IHS/CMI/LAB - IHS gpra print 01 Nov 2008 4:08 PM ;
 ;;10.0;IHS CLINICAL REPORTING;;JUN 18, 2010
 ;
 ;
HFALL ;EP
 ;I $Y>(BGPIOSL-3) D HDR^BGP0CP Q:BGPQUIT  D L1H^BGP0CP
 ;S BGPNOBA=1
 ;D WDT^BGP0CPU2(BGPVINP)
 ;Q:BGPQUIT
 ;I $$TRANS^BGP0CU(BGPVINP) D WTT^BGP0CPU2(BGPVINP) Q:BGPQUIT
 ;D WPPDPOV^BGP0CPU(BGPVSIT)
 ;K BGPNOBA
 I $Y>(BGPIOSL-3) D HDR^BGP0CP Q:BGPQUIT  D L1H^BGP0CP
 S BGPNOBA=1
 D WRACE^BGP0CPU(DFN)
 Q:BGPQUIT
 D WDOB^BGP0CPU(DFN)
 Q:BGPQUIT
 D WZIP^BGP0CPU(DFN)
 Q:BGPQUIT
 D WINS^BGP0CPU(BGPVSIT,DFN)
 Q:BGPQUIT
 D WADM^BGP0CPU(BGPVINP)
 Q:BGPQUIT
 D WADM92^BGP0CPU(BGPVINP)
 Q:BGPQUIT
 D WADMS92^BGP0CPU(BGPVINP)
 Q:BGPQUIT
 D WDT^BGP0CPU(BGPVINP)
 Q:BGPQUIT
 D WDSGS92^BGP0CPU(BGPVINP)
 Q:BGPQUIT
 I $$TRANS^BGP0CU(BGPVINP) D WTT^BGP0CPU(BGPVINP) Q:BGPQUIT
 K BGPNOBA
 D WPPDPOV^BGP0CPU(BGPVSIT)
 Q:BGPQUIT
 S BGPNOBA=1
 D OTHDPOVS^BGP0CPU(BGPVSIT)
 Q:BGPQUIT
 D WPRINPRO^BGP0CPU2
 Q:BGPQUIT
 D WOTHPROS^BGP0CPU2
 K BGPNOBA
 Q
 ;
HF1 ;EP
 I $Y>(BGPIO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PNVSIT(BGPVSIT,0),U),"."),$P($P(^AUPNVINP(BGPVINP,0),U),"."))
 D WCOMFORT^BGP0CPU2(X)
 Q:BGPQUIT
 K BGPY,BGPDATA
 Q:BGPQUIT
 S BGPC=0
 D ALLDXS^BGP0CU2(DFN,$$FMADD^XLFDT($$DSCH^BGP0CU(BGPVINP),-365),$$DSCH^BGP0CU(BGPVINP),.BGPDATA,BGPC,"BGP CMS AORTIC STENOSIS DXS")
 I 'BGPEXCL D WAORTIC^BGP0CPU
 Q:BGPQUIT
 K BGPDATA,BGPDX,BGPC
 S BGPXX=0
 D ANGIOED^BGP0CU6(DFN,$$DOB^AUPNPAT(DFN),$$DSCH^BGP0CU(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^BGP0CU6(DFN,$$DOB^AUPNPAT(DFN),$$DSCH^BGP0CU(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^BGP0CU6(DFN,$$DOB^AUPNPAT(DFN),$$DSCH^BGP0CU(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^BGP0CU6(DFN,$$DOB^AUPNPAT(DFN),$$DSCH^BGP0CU(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^BGP0CU6(DFN,$$DOB^AUPNPAT(DFN),$$DSCH^BGP0CU(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^BGP0CPU
 K BGPDATA,BGPY
 Q:BGPQUIT
 S X=$$ACEALLEG^BGP0CU1(DFN,$$DOB^AUPNPAT(DFN),$$DSCH^BGP0CU(BGPVINP))
 S Z=$$ARBALLEG^BGP0CU1(DFN,$$DOB^AUPNPAT(DFN),$$DSCH^BGP0CU(BGPVINP))
 D WACEALEG^BGP0CPU
 Q:BGPQUIT
 K BGPDATA,BGPDX
 S BGPC=0
 D NMIDRUG^BGP0CU1(DFN,$$VD^APCLV(BGPVSIT),$$DSCH^BGP0CU(BGPVINP),.BGPDATA,"BGP CMS ACEI MEDS",0)
 D NMIDRUG^BGP0CU1(DFN,$$VD^APCLV(BGPVSIT),$$DSCH^BGP0CU(BGPVINP),.BGPDATA,"BGP CMS ARB MEDS",BGPC)
 S E=+$$CODEN^ICPTCOD("G8029")
 S BGPACPT=$$CPTI^BGP0DU(DFN,$$DSCH^BGP0CU(BGPVINP),$$DSCH^BGP0CU(BGPVINP),E) I Z]"" S Z=$$DATE^BGP0UTL($P(Z,U,2))_" [G8029]"
 D WNMIACE^BGP0CPU2
 Q:BGPQUIT
 I 'BGPEXCL D
 .S BGPLVAD=$$LVADEX^BGP0CU(DFN,$P($P(BGPVSIT0,U),"."),$$DSCH^BGP0CU(BGPVINP)) I BGPLVAD S BGPLVAD=$$DATE^BGP0UTL($P(BGPLVAD,U,3))_"  ["_$P(BGPLVAD,U,2)_"]  "_$$VAL^XBDIQ1(9000010.08,$P(BGPLVAD,U,5),.04)
 .D WLVAD^BGP0CPU2
 Q:BGPQUIT
 S X=$$LASTMED^BGP0CU1(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^BGP0CU1(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^BGP0CPU
 Q:BGPQUIT
 K BGPDATA
 D ALLALG1^BGP0CU1(DFN,DT,$$DSCH^BGP0CU(BGPVINP),.BGPDATA)
 D WALLALG^BGP0CPU
 Q:BGPQUIT
 K BGPDATA
 D ALLALGA1^BGP0CU1(DFN,DT,.BGPDATA)
 D WALLALGT^BGP0CPU
 K BGPDATA
 D IVUD^BGP0CU1(DFN,$P($P(BGPVSIT0,U),"."),$$DSCH^BGP0CU(BGPVINP),,.BGPDATA)
 D WIVUD^BGP0CPU
 Q
 ;
HF4 ;
 I $Y>(BGPIOSL-3) D HDR^BGP0CP Q:BGPQUIT  D L1H^BGP0CP
 D WDT^BGP0CPU2(BGPVINP)
 Q:BGPQUIT
 I $$TRANS^BGP0CU(BGPVINP) D WTT^BGP0CPU2(BGPVINP)
 Q:BGPQUIT
 I $$TRANS^BGP0CU(BGPVINP) D TRANSN Q:BGPQUIT
 D WPPDPOV^BGP0CPU2(BGPVSIT)
 Q:BGPQUIT
 D OTHDPOVS^BGP0CPU2(BGPVSIT)
 Q:BGPQUIT
 S X=$$COMFORT^BGP0CU(DFN,$P($P(^AUPNVSIT(BGPVSIT,0),U),"."),$P($P(^AUPNVINP(BGPVINP,0),U),"."))
 D WCOMFORT^BGP0CPU2(X)
 Q:BGPQUIT
 I 'BGPEXCL D
 .S BGPLVAD=$$LVADEX^BGP0CU(DFN,$P($P(BGPVSIT0,U),"."),$$DSCH^BGP0CU(BGPVINP)) I BGPLVAD S BGPLVAD=$$DATE^BGP0UTL($P(BGPLVAD,U,3))_"  ["_$P(BGPLVAD,U,2)_"]  "_$$VAL^XBDIQ1(9000010.08,$P(BGPLVAD,U,5),.04)
 .D WLVAD^BGP0CPU2
 Q:BGPQUIT
 K BGPDATA
 S BGPC=0
 D SMOKER^BGP0CU2(DFN,$$FMADD^XLFDT($P($P(^AUPNVSIT(BGPVSIT,0),U),"."),-365),$$DSCH^BGP0CU(BGPVINP),.BGPDATA)
 D WSMOKER^BGP0CPU
 Q:BGPQUIT
 K BGPDATA
 D CESS^BGP0CU2(DFN,$P($P(^AUPNVSIT(BGPVSIT,0),U),"."),$$DSCH^BGP0CU(BGPVINP),.BGPDATA)
 D WCESS^BGP0CPU
 Q:BGPQUIT
 K BGPDATA
 D CESSMEDS^BGP0CU2(DFN,$$FMADD^XLFDT($P($P(^AUPNVSIT(BGPVSIT,0),U),"."),-365),$$FMADD^XLFDT($$DSCH^BGP0CU(BGPVINP),30),.BGPDATA)
 D WCESSMED^BGP0CPU
 K BGPDATA
 Q:BGPQUIT
 D ALLALG1^BGP0CU1(DFN,DT,$$DSCH^BGP0CU(BGPVINP),.BGPDATA)
 D WALLALG^BGP0CPU
 Q:BGPQUIT
 K BGPDATA
 D ALLALGA1^BGP0CU1(DFN,DT,.BGPDATA)
 D WALLALGT^BGP0CPU
 Q:BGPQUIT
 K BGPDATA
 D IVUD^BGP0CU1(DFN,$P($P(BGPVSIT0,U),"."),$$DSCH^BGP0CU(BGPVINP),,.BGPDATA)
 D WIVUD^BGP0CPU
 Q
 ;
TRANSIN ;
 I $Y>(BGPIOSL-4) D HDR^BGP0CP Q:BGPQUIT  D L1H^BGP0CP
 W !!?3,"NOTE:  Since Admission Type was ","""","Transferred,",""""," review patient's chart"
 W !,"to determine if patient should be excluded if transfer was from another"
 W !,"acute care hospital, including ER from another hospital.",!
 Q
 ;
TRANSN ;
 I $Y>(BGPIOSL-4) D HDR^BGP0CP Q:BGPQUIT  D L1H^BGP0CP
 W !!?3,"NOTE:  Since Discharge Type was ","""","Transferred,",""""," review patient's chart"
 W !,"to determine if patient should be excluded if transferred to another"
 W !,"acute care hospital or federal hospital.",!
 Q
 ;