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

BGP9CP4.m

Go to the documentation of this file.
BGP9CP4 ; IHS/CMI/LAB - IHS gpra print 01 Nov 2007 4:08 PM ;
 ;;9.0;IHS CLINICAL REPORTING;;JUL 1, 2009
 ;
 ;
HFALL ;EP
 ;I $Y>(BGPIOSL-3) D HDR^BGP9CP Q:BGPQUIT  D L1H^BGP9CP
 ;S BGPNOBA=1
 ;D WDT^BGP9CPU2(BGPVINP)
 ;Q:BGPQUIT
 ;I $$TRANS^BGP9CU(BGPVINP) D WTT^BGP9CPU2(BGPVINP) Q:BGPQUIT
 ;D WPPDPOV^BGP9CPU(BGPVSIT)
 ;K BGPNOBA
 I $Y>(BGPIOSL-3) D HDR^BGP9CP Q:BGPQUIT  D L1H^BGP9CP
 S BGPNOBA=1
 D WRACE^BGP9CPU(DFN)
 Q:BGPQUIT
 D WDOB^BGP9CPU(DFN)
 Q:BGPQUIT
 D WZIP^BGP9CPU(DFN)
 Q:BGPQUIT
 D WINS^BGP9CPU(BGPVSIT,DFN)
 Q:BGPQUIT
 D WADM^BGP9CPU(BGPVINP)
 Q:BGPQUIT
 D WADM92^BGP9CPU(BGPVINP)
 Q:BGPQUIT
 D WADMS92^BGP9CPU(BGPVINP)
 Q:BGPQUIT
 D WDT^BGP9CPU(BGPVINP)
 Q:BGPQUIT
 D WDSGS92^BGP9CPU(BGPVINP)
 Q:BGPQUIT
 I $$TRANS^BGP9CU(BGPVINP) D WTT^BGP9CPU(BGPVINP) Q:BGPQUIT
 K BGPNOBA
 D WPPDPOV^BGP9CPU(BGPVSIT)
 Q:BGPQUIT
 S BGPNOBA=1
 D OTHDPOVS^BGP9CPU(BGPVSIT)
 Q:BGPQUIT
 D WPRINPRO^BGP9CPU2
 Q:BGPQUIT
 D WOTHPROS^BGP9CPU2
 K BGPNOBA
 Q
 ;
HF1 ;EP
 I $Y>(BGPIO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PNVSIT(BGPVSIT,0),U),"."),$P($P(^AUPNVINP(BGPVINP,0),U),"."))
 D WCOMFORT^BGP9CPU2(X)
 Q:BGPQUIT
 K BGPY,BGPDATA
 Q:BGPQUIT
 S BGPC=0
 D ALLDXS^BGP9CU2(DFN,$$FMADD^XLFDT($$DSCH^BGP9CU(BGPVINP),-365),$$DSCH^BGP9CU(BGPVINP),.BGPDATA,BGPC,"BGP CMS AORTIC STENOSIS DXS")
 I 'BGPEXCL D WAORTIC^BGP9CPU
 Q:BGPQUIT
 K BGPDATA,BGPDX,BGPC
 S BGPXX=0
 D ANGIOED^BGP9CU6(DFN,$$DOB^AUPNPAT(DFN),$$DSCH^BGP9CU(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^BGP9CU6(DFN,$$DOB^AUPNPAT(DFN),$$DSCH^BGP9CU(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^BGP9CU6(DFN,$$DOB^AUPNPAT(DFN),$$DSCH^BGP9CU(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^BGP9CU6(DFN,$$DOB^AUPNPAT(DFN),$$DSCH^BGP9CU(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^BGP9CU6(DFN,$$DOB^AUPNPAT(DFN),$$DSCH^BGP9CU(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^BGP9CPU
 K BGPDATA,BGPY
 Q:BGPQUIT
 S X=$$ACEALLEG^BGP9CU1(DFN,$$DOB^AUPNPAT(DFN),$$DSCH^BGP9CU(BGPVINP))
 S Z=$$ARBALLEG^BGP9CU1(DFN,$$DOB^AUPNPAT(DFN),$$DSCH^BGP9CU(BGPVINP))
 D WACEALEG^BGP9CPU
 Q:BGPQUIT
 K BGPDATA,BGPDX
 S BGPC=0
 D NMIDRUG^BGP9CU1(DFN,$$VD^APCLV(BGPVSIT),$$DSCH^BGP9CU(BGPVINP),.BGPDATA,"BGP CMS ACEI MEDS",0)
 D NMIDRUG^BGP9CU1(DFN,$$VD^APCLV(BGPVSIT),$$DSCH^BGP9CU(BGPVINP),.BGPDATA,"BGP CMS ARB MEDS",BGPC)
 S E=+$$CODEN^ICPTCOD("G8029")
 S BGPACPT=$$CPTI^BGP9DU(DFN,$$DSCH^BGP9CU(BGPVINP),$$DSCH^BGP9CU(BGPVINP),E) I Z]"" S Z=$$DATE^BGP9UTL($P(Z,U,2))_" [G8029]"
 D WNMIACE^BGP9CPU2
 Q:BGPQUIT
 I 'BGPEXCL D
 .S BGPLVAD=$$LVADEX^BGP9CU(DFN,$P($P(BGPVSIT0,U),"."),$$DSCH^BGP9CU(BGPVINP)) I BGPLVAD S BGPLVAD=$$DATE^BGP9UTL($P(BGPLVAD,U,3))_"  ["_$P(BGPLVAD,U,2)_"]  "_$$VAL^XBDIQ1(9000010.08,$P(BGPLVAD,U,5),.04)
 .D WLVAD^BGP9CPU2
 Q:BGPQUIT
 S X=$$LASTMED^BGP9CU1(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^BGP9CU1(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^BGP9CPU
 Q:BGPQUIT
 K BGPDATA
 D ALLALG1^BGP9CU1(DFN,DT,$$DSCH^BGP9CU(BGPVINP),.BGPDATA)
 D WALLALG^BGP9CPU
 Q:BGPQUIT
 K BGPDATA
 D ALLALGA1^BGP9CU1(DFN,DT,.BGPDATA)
 D WALLALGT^BGP9CPU
 K BGPDATA
 D IVUD^BGP9CU1(DFN,$P($P(BGPVSIT0,U),"."),$$DSCH^BGP9CU(BGPVINP),,.BGPDATA)
 D WIVUD^BGP9CPU
 Q
 ;
HF4 ;
 I $Y>(BGPIOSL-3) D HDR^BGP9CP Q:BGPQUIT  D L1H^BGP9CP
 D WDT^BGP9CPU2(BGPVINP)
 Q:BGPQUIT
 I $$TRANS^BGP9CU(BGPVINP) D WTT^BGP9CPU2(BGPVINP)
 Q:BGPQUIT
 I $$TRANS^BGP9CU(BGPVINP) D TRANSN Q:BGPQUIT
 D WPPDPOV^BGP9CPU2(BGPVSIT)
 Q:BGPQUIT
 D OTHDPOVS^BGP9CPU2(BGPVSIT)
 Q:BGPQUIT
 S X=$$COMFORT^BGP9CU(DFN,$P($P(^AUPNVSIT(BGPVSIT,0),U),"."),$P($P(^AUPNVINP(BGPVINP,0),U),"."))
 D WCOMFORT^BGP9CPU2(X)
 Q:BGPQUIT
 I 'BGPEXCL D
 .S BGPLVAD=$$LVADEX^BGP9CU(DFN,$P($P(BGPVSIT0,U),"."),$$DSCH^BGP9CU(BGPVINP)) I BGPLVAD S BGPLVAD=$$DATE^BGP9UTL($P(BGPLVAD,U,3))_"  ["_$P(BGPLVAD,U,2)_"]  "_$$VAL^XBDIQ1(9000010.08,$P(BGPLVAD,U,5),.04)
 .D WLVAD^BGP9CPU2
 Q:BGPQUIT
 K BGPDATA
 S BGPC=0
 D SMOKER^BGP9CU2(DFN,$$FMADD^XLFDT($P($P(^AUPNVSIT(BGPVSIT,0),U),"."),-365),$$DSCH^BGP9CU(BGPVINP),.BGPDATA)
 D WSMOKER^BGP9CPU
 Q:BGPQUIT
 K BGPDATA
 D CESS^BGP9CU2(DFN,$P($P(^AUPNVSIT(BGPVSIT,0),U),"."),$$DSCH^BGP9CU(BGPVINP),.BGPDATA)
 D WCESS^BGP9CPU
 Q:BGPQUIT
 K BGPDATA
 D CESSMEDS^BGP9CU2(DFN,$$FMADD^XLFDT($P($P(^AUPNVSIT(BGPVSIT,0),U),"."),-365),$$FMADD^XLFDT($$DSCH^BGP9CU(BGPVINP),30),.BGPDATA)
 D WCESSMED^BGP9CPU
 K BGPDATA
 Q:BGPQUIT
 D ALLALG1^BGP9CU1(DFN,DT,$$DSCH^BGP9CU(BGPVINP),.BGPDATA)
 D WALLALG^BGP9CPU
 Q:BGPQUIT
 K BGPDATA
 D ALLALGA1^BGP9CU1(DFN,DT,.BGPDATA)
 D WALLALGT^BGP9CPU
 Q:BGPQUIT
 K BGPDATA
 D IVUD^BGP9CU1(DFN,$P($P(BGPVSIT0,U),"."),$$DSCH^BGP9CU(BGPVINP),,.BGPDATA)
 D WIVUD^BGP9CPU
 Q
 ;
TRANSIN ;
 I $Y>(BGPIOSL-4) D HDR^BGP9CP Q:BGPQUIT  D L1H^BGP9CP
 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^BGP9CP Q:BGPQUIT  D L1H^BGP9CP
 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
 ;