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

BGP8CP5.m

Go to the documentation of this file.
BGP8CP5 ; IHS/CMI/LAB - IHS gpra print ;
 ;;8.0;IHS CLINICAL REPORTING;**2**;MAR 12, 2008
 ;
 ;
PNALL ;EP
 I $Y>(BGPIOSL-3) D HDR^BGP8CP Q:BGPQUIT  D L1H^BGP8CP
 S BGPNOBA=1
 D WRACE^BGP8CPU(DFN)
 Q:BGPQUIT
 D WDOB^BGP8CPU(DFN)
 Q:BGPQUIT
 D WZIP^BGP8CPU(DFN)
 Q:BGPQUIT
 D WINS^BGP8CPU(BGPVSIT,DFN)
 Q:BGPQUIT
 D WADM^BGP8CPU(BGPVINP)
 Q:BGPQUIT
 D WADM92^BGP8CPU(BGPVINP)
 Q:BGPQUIT
 D WADMS92^BGP8CPU(BGPVINP)
 Q:BGPQUIT
 D WDT^BGP8CPU(BGPVINP)
 Q:BGPQUIT
 D WDSGS92^BGP8CPU(BGPVINP)
 Q:BGPQUIT
 I $$TRANS^BGP8CU(BGPVINP) D WTT^BGP8CPU(BGPVINP) Q:BGPQUIT
 K BGPNOBA
 D WPNEUPOV^BGP8CPU3(BGPVSIT)
 Q:BGPQUIT
 S BGPNOBA=1
 D OTHDPOVS^BGP8CPU(BGPVSIT)
 Q:BGPQUIT
 D WPRINPRO^BGP8CPU2
 Q:BGPQUIT
 D WOTHPROS^BGP8CPU2
 K BGPNOBA
 Q
 ;
PN1 ;EP
 I $Y>(BGPIOSL-3) D HDR^BGP8CP Q:BGPQUIT  D L1H^BGP8CP
 I $$TRANSIN^BGP8CU(BGPVINP) D TRANSIN Q:BGPQUIT
 D WDT^BGP8CPU3(BGPVINP)
 Q:BGPQUIT
 I $$TRANS^BGP8CU(BGPVINP) D WTT^BGP8CPU3(BGPVINP)
 Q:BGPQUIT
 I $$TRANS^BGP8CU(BGPVINP),$$DODA^BGP8CU(BGPVSIT,BGPVINP) D TRANSN Q:BGPQUIT
 D WPPDPOV^BGP8CPU3(BGPVSIT)
 Q:BGPQUIT
 D OTHDPOVS^BGP8CPU3(BGPVSIT)
 Q:BGPQUIT
 I 'BGPEXCL D
 .S X=$$ERPNEU^BGP8CU(DFN,$$FMADD^XLFDT($P($P(BGPVSIT0,U),"."),-1),$P($P(BGPVSIT0,U),"."),"BGP CMS PNEUMONIA DXS")
 .D WERPNEU^BGP8CPU3
 .S X=$$ADMDX^BGP8CU(BGPVINP,"BGP CMS PNEUMONIA DXS")
 .D WADMDX^BGP8CPU3
 Q:BGPQUIT
 S X=$$COMFORT^BGP8CU(DFN,$P($P(^AUPNVSIT(BGPVSIT,0),U),"."),$P($P(^AUPNVINP(BGPVINP,0),U),"."))
 D WCOMFORT^BGP8CPU3(X)
 Q:BGPQUIT
 K BGPDATA,BGPSCAN
 D CHESTXRY^BGP8CU(DFN,$$FMADD^XLFDT($P($P(^AUPNVSIT(BGPVSIT,0),U),"."),-1),$P($P(^AUPNVINP(BGPVINP,0),U),"."),.BGPDATA)
 D CTSCAN^BGP8CU(DFN,$$FMADD^XLFDT($P($P(^AUPNVSIT(BGPVSIT,0),U),"."),-1),$P($P(^AUPNVINP(BGPVINP,0),U),"."),.BGPSCAN)
 D WCHEST^BGP8CPU3
 Q:BGPQUIT
 I 'BGPEXCL D
 .S X=$$LASTDX^BGP8UTL1(DFN,"BGP CMS CYSTIC FIBROSIS DXS",$$DOB^AUPNPAT(DFN),$$DSCH^BGP8CU(BGPVINP))
 .D WCYSTIC^BGP8CPU3
 K BGPDATA
 D ABGPO^BGP8CU(DFN,$$FMADD^XLFDT($P($P(^AUPNVSIT(BGPVSIT,0),U),"."),-1),$$FMADD^XLFDT($$DSCH^BGP8CU(BGPVINP)),.BGPDATA)
 D WABGPO^BGP8CPU3
 Q:BGPQUIT
 K BGPDATA
 D ALLALG1^BGP8CU1(DFN,DT,$$DSCH^BGP8CU(BGPVINP),.BGPDATA)
 D WALLALG^BG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P8CU(DFN,$$FMADD^XLFDT($P($P(^AUPNVSIT(BGPVSIT,0),U),"."),-1),$P($P(^AUPNVINP(BGPVINP,0),U),"."),.BGPDATA)
 D CTSCAN^BGP8CU(DFN,$$FMADD^XLFDT($P($P(^AUPNVSIT(BGPVSIT,0),U),"."),-1),$P($P(^AUPNVINP(BGPVINP,0),U),"."),.BGPSCAN)
 D WCHEST^BGP8CPU3
 Q:BGPQUIT
 I 'BGPEXCL D
 .S X=$$LASTDX^BGP8UTL1(DFN,"BGP CMS CYSTIC FIBROSIS DXS",$$DOB^AUPNPAT(DFN),$$DSCH^BGP8CU(BGPVINP))
 .D WCYSTIC^BGP8CPU3
 K BGPDATA
 ;antibiotic rx status?
 D ANTIRX^BGP8CU3(DFN,$$FMADD^XLFDT($P($P(^AUPNVSIT(BGPVSIT,0),U),"."),-365),$$FMADD^XLFDT($P($P(^AUPNVINP(BGPVINP,0),U),"."),30),.BGPDATA)
 D WANTIRX^BGP8CPU3
 Q:BGPQUIT
 K BGPDATA
 D ERBCP^BGP8CU3(DFN,$$FMADD^XLFDT($P($P(BGPVSIT0,U),"."),-1),$P($P(BGPVSIT0,U),"."),.BGPDATA)
 D WERBC^BGP8CPU3
 Q:BGPQUIT
 K BGPDATA
 D ALLALG1^BGP8CU1(DFN,DT,$$DSCH^BGP8CU(BGPVINP),.BGPDATA)
 D WALLALG^BGP8CPU
 Q:BGPQUIT
 K BGPDATA
 D ALLALGA1^BGP8CU1(DFN,DT,.BGPDATA)
 D WALLALGT^BGP8CPU
 K BGPDATA
 D IVUD^BGP8CU1(DFN,$P($P(BGPVSIT0,U),"."),$$DSCH^BGP8CU(BGPVINP),,.BGPDATA)
 D WIVUD^BGP8CPU
 Q
 ; 
PN4 ;EP
 I $Y>(BGPIOSL-3) D HDR^BGP8CP Q:BGPQUIT  D L1H^BGP8CP
 I 'BGPEXCL D WDOD^BGP8CPU3(DFN)
 Q:BGPQUIT
 D WDT9^BGP8CPU3(BGPVINP)
 Q:BGPQUIT
 I $$TRANS^BGP8CU(BGPVINP) D WTT^BGP8CPU3(BGPVINP)
 Q:BGPQUIT
 I $$TRANS^BGP8CU(BGPVINP) D TRANSN2 Q:BGPQUIT
 D WPPDPOV^BGP8CPU3(BGPVSIT)
 Q:BGPQUIT
 D OTHDPOVS^BGP8CPU3(BGPVSIT)
 Q:BGPQUIT
 S X=$$COMFORT^BGP8CU(DFN,$P($P(^AUPNVSIT(BGPVSIT,0),U),"."),$P($P(^AUPNVINP(BGPVINP,0),U),"."))
 D WCOMFORT^BGP8CPU3(X)
 Q:BGPQUIT
 K BGPDATA,BGPSCAN
 D CHESTXRY^BGP8CU(DFN,$$FMADD^XLFDT($P($P(^AUPNVSIT(BGPVSIT,0),U),"."),-1),$P($P(^AUPNVINP(BGPVINP,0),U),"."),.BGPDATA)
 D CTSCAN^BGP8CU(DFN,$$FMADD^XLFDT($P($P(^AUPNVSIT(BGPVSIT,0),U),"."),-1),$P($P(^AUPNVINP(BGPVINP,0),U),"."),.BGPSCAN)
 D WCHEST^BGP8CPU3
 Q:BGPQUIT
 I 'BGPEXCL D
 .S X=$$LASTDX^BGP8UTL1(DFN,"BGP CMS CYSTIC FIBROSIS DXS",$$DOB^AUPNPAT(DFN),$$DSCH^BGP8CU(BGPVINP))
 .D WCYSTIC^BGP8CPU3
 K BGPDATA
 ;antibiotic rx status?
 K BGPDATA
 S BGPC=0
 D SMOKER^BGP8CU2(DFN,$$FMADD^XLFDT($P($P(^AUPNVSIT(BGPVSIT,0),U),"."),-365),$$DSCH^BGP8CU(BGPVINP),.BGPDATA)
 D WSMOKER^BGP8CPU
 Q:BGPQUIT
 K BGPDATA
 D CESS^BGP8CU2(DFN,$P($P(^AUPNVSIT(BGPVSIT,0),U),"."),$$DSCH^BGP8CU(BGPVINP),.BGPDATA)
 D WCESS^BGP8CPU
 Q:BGPQUIT
 K BGPDATA
 D CESSMEDS^BGP8CU2(DFN,$P($P(^AUPNVSIT(BGPVSIT,0),U),"."),$$DSCH^BGP8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FMADD^XLFDT($P($P(^AUPNVSIT(BGPVSIT,0),U),"."),-1),$P($P(^AUPNVINP(BGPVINP,0),U),"."),.BGPDATA)
 D CTSCAN^BGP8CU(DFN,$$FMADD^XLFDT($P($P(^AUPNVSIT(BGPVSIT,0),U),"."),-1),$P($P(^AUPNVINP(BGPVINP,0),U),"."),.BGPSCAN)
 D WCHEST^BGP8CPU3
 Q:BGPQUIT
 ;antibiotic rx status?
 K BGPDATA
 D ANTIRX^BGP8CU3(DFN,$$FMADD^XLFDT($P($P(^AUPNVSIT(BGPVSIT,0),U),"."),-365),$$FMADD^XLFDT($P($P(^AUPNVINP(BGPVINP,0),U),"."),30),.BGPDATA)
 D WANTIRX^BGP8CPU3
 Q:BGPQUIT
 I 'BGPEXCL D
 .S X=$$LASTDX^BGP8UTL1(DFN,"BGP CMS CYSTIC FIBROSIS DXS",$$DOB^AUPNPAT(DFN),$$DSCH^BGP8CU(BGPVINP))
 .D WCYSTIC^BGP8CPU3
 K BGPDATA
 ;D ERBCP^BGP8CU3(DFN,$$FMADD^XLFDT($P($P(BGPVSIT0,U),"."),-1),$P($P(BGPVSIT0,U),"."),.BGPDATA)
 ;D WERBC^BGP8CPU3
 Q:BGPQUIT
 K BGPDATA
 D ALLALG1^BGP8CU1(DFN,DT,$$DSCH^BGP8CU(BGPVINP),.BGPDATA)
 D WALLALG^BGP8CPU
 Q:BGPQUIT
 K BGPDATA
 D ALLALGA1^BGP8CU1(DFN,DT,.BGPDATA)
 D WALLALGT^BGP8CPU
 K BGPDATA
 D IVUD^BGP8CU1(DFN,$P($P(BGPVSIT0,U),"."),$$DSCH^BGP8CU(BGPVINP),,.BGPDATA)
 D WIVUD^BGP8CPU
 Q
 ;
PN6 ;EP
 I $Y>(BGPIOSL-3) D HDR^BGP8CP Q:BGPQUIT  D L1H^BGP8CP
 I $$TRANSIN^BGP8CU(BGPVINP) D TRANSIN Q:BGPQUIT
 I 'BGPEXCL D WDOD^BGP8CPU3(DFN)
 Q:BGPQUIT
 D WDT^BGP8CPU3(BGPVINP)
 Q:BGPQUIT
 I $$TRANS^BGP8CU(BGPVINP) D WTT^BGP8CPU3(BGPVINP)
 Q:BGPQUIT
 I $$TRANS^BGP8CU(BGPVINP) D TRANSN Q:BGPQUIT
 D WPPDPOV^BGP8CPU3(BGPVSIT)
 Q:BGPQUIT
 D OTHDPOVS^BGP8CPU3(BGPVSIT)
 Q:BGPQUIT
 I 'BGPEXCL D
 .S X=$$ERPNEU^BGP8CU(DFN,$$FMADD^XLFDT($P($P(BGPVSIT0,U),"."),-1),$P($P(BGPVSIT0,U),"."),"BGP CMS PNEUMONIA DXS")
 .D WERPNEU^BGP8CPU3
 .S X=$$ADMDX^BGP8CU(BGPVINP,"BGP CMS PNEUMONIA DXS")
 .D WADMDX^BGP8CPU3
 Q:BGPQUIT
 S X=$$COMFORT^BGP8CU(DFN,$P($P(^AUPNVSIT(BGPVSIT,0),U),"."),$P($P(^AUPNVINP(BGPVINP,0),U),"."))
 D WCOMFORT^BGP8CPU3(X)
 Q:BGPQUIT
 K BGPDATA
 I 'BGPEXCL D  Q:BGPQUIT
 .K BGPDATA
 .D EXCLCOMP^BGP8CU4(DFN,$P($P(^AUPNVSIT(BGPVSIT,0),U),"."),$P($P(^AUPNVINP(BGPVINP,0),U),"."),.BGPDATA)
 .D WEXCL1^BGP8CPU3
 .Q:BGPQUIT
 .S X=$$PRIORHOS^BGP8CU4(DFN,$$FMADD^XLFDT($P($P(BGPVSIT0,U),"."),-14),$P($P(BGPVSIT0,U),"."),BGPVSIT)
 .S Y=$$HOS2DAYS^BGP8CU4(DFN,$$FMADD^XLFDT($P($P(BGPVSIT0,U),"."),-90),$P($P(BGPVSIT0,U),"."))
 .D WPRIORHO^BGP8CPU3
 .Q:BGPQUIT
 .S X=$$NURSHOME^BGP8CU4(DFN,$$FMADD^XLFDT($P($P(BGPVSIT0,U),"."),-90),$P($P(BGPVSIT0,U),"."))
 .D WNURSHOM^BGP8CPU3
 .Q:BGPQUIT
 .S X=$$WOUNDCAR^BGP8CU4(DFN,$$FMADD^XLFDT($P($P(BGPVSIT0,U),"."),-30),$P($P(BGPVSIT0,U),"."))
 .D WWOUND^BGP8CPU3
 K BGPDATA,BGPSCAN
 D CHESTXRY^BGP8CU(DFN,$$FMADD^XLFDT($P($P(^AUPNVSIT(BGPVSIT,0),U),"."),-1),$P($P(^AUPNVINP(BGPVINP,0),U),"."),.BGPDATA)
 D CTSCAN^BGP8CU(DFN,$$FMADD^XLFDT($P($P(^AUPNVSIT(BGPVSIT,0),U),"."),-1),$P($P(^AUPNVINP(BGPVINP,0),U),"."),.BGPSCAN)
 D WCHEST^BGP8CPU3
 Q:BGPQUIT
 S X=$$ADMDX^BGP8CU(BGPVINP,"BGP CMS OTHER INFECTION DXS")
 D WOTHINF^BGP8CPU3
 Q:BGPQUIT
 K BGPDATA
 I 'BGPEXCL D  Q:BGPQUIT
 .S X=$$LASTDX^BGP8UTL1(DFN,"BGP CMS CYSTIC FIBROSIS DXS",$$DOB^AUPNPAT(DFN),$$DSCH^BGP8CU(BGPVINP))
 .D WCYSTIC^BGP8CPU3
 K BGPDATA
 S BGPPSE=$$PSEUDO^BGP8CU4(BGPVINP)
 S BGPCOPD=$$COPD^BGP8CU4(DFN,$$DSCH^BGP8CU(BGPVINP))
 D WPSEUDO^BGP8CPU3
 Q:BGPQUIT
 ;antibiotic rx status?
 K BGPDATA
 D ANTIRX^BGP8CU3(DFN,$$FMADD^XLFDT($P($P(^AUPNVSIT(BGPVSIT,0),U),"."),-365),$$FMADD^XLFDT($P($P(^AUPNVINP(BGPVINP,0),U),"."),30),.BGPDATA)
 D WANTIRX^BGP8CPU3
 Q:BGPQUIT
 ;D ERBCP^BGP8CU3(DFN,$$FMADD^XLFDT($P($P(BGPVSIT0,U),"."),-1),$P($P(BGPVSIT0,U),"."),.BGPDATA)
 ;D WERBC^BGP8CPU3
 Q:BGPQUIT
 K BGPDATA
 D ALLALG1^BGP8CU1(DFN,DT,$$DSCH^BGP8CU(BGPVINP),.BGPDATA)
 D WALLALG^BGP8CPU
 Q:BGPQUIT
 K BGPDATA
 D ALLALGA1^BGP8CU1(DFN,DT,.BGPDATA)
 D WALLALGT^BGP8CPU
 K BGPDATA
 D IVUD^BGP8CU1(DFN,$P($P(BGPVSIT0,U),"."),$$DSCH^BGP8CU(BGPVINP),,.BGPDATA)
 D WIVUD^BGP8CPU
 Q
 ; 
PN7 ;EP
 I $Y>(BGPIOSL-3) D HDR^BGP8CP Q:BGPQUIT  D L1H^BGP8CP
 D WDT9^BGP8CPU3(BGPVINP)
 Q:BGPQUIT
 I $$TRANS^BGP8CU(BGPVINP) D WTT^BGP8CPU3(BGPVINP)
 Q:BGPQUIT
 I $$TRANS^BGP8CU(BGPVINP) D TRANSN Q:BGPQUIT
 D WPPDPOV^BGP8CPU3(BGPVSIT)
 Q:BGPQUIT
 D OTHDPOVS^BGP8CPU3(BGPVSIT)
 Q:BGPQUIT
 S X=$$COMFORT^BGP8CU(DFN,$P($P(^AUPNVSIT(BGPVSIT,0),U),"."),$P($P(^AUPNVINP(BGPVINP,0),U),"."))
 D WCOMFORT^BGP8CPU3(X)
 Q:BGPQUIT
 D EXCL487^BGP8CPU3
 K BGPDATA,BGPSCAN
 D CHESTXRY^BGP8CU(DFN,$$FMADD^XLFDT($P($P(^AUPNVSIT(BGPVSIT,0),U),"."),-1),$P($P(^AUPNVINP(BGPVINP,0),U),"."),.BGPDATA)
 D CTSCAN^BGP8CU(DFN,$$FMADD^XLFDT($P($P(^AUPNVSIT(BGPVSIT,0),U),"."),-1),$P($P(^AUPNVINP(BGPVINP,0),U),"."),.BGPSCAN)
 D WCHEST^BGP8CPU3
 Q:BGPQUIT
 I 'BGPEXCL D
 .S X=$$LASTDX^BGP8UTL1(DFN,"BGP CMS CYSTIC FIBROSIS DXS",$$DOB^AUPNPAT(DFN),$$DSCH^BGP8CU(BGPVINP))
 .D WCYSTIC^BGP8CPU3
 K BGPDATA
 ;
 D FLUVAX^BGP8CU4(DFN,$$FMADD^XLFDT($P($P(^AUPNVSIT(BGPVSIT,0),U),"."),-365),$$DSCH^BGP8CU(BGPVINP),$$DSCH^BGP8CU(BGPVINP),.BGPDATA)
 ;
 D WFLU^BGP8CPU3
 Q:BGPQUIT
 K BGPDATA
 D ALLALG1^BGP8CU1(DFN,DT,$$DSCH^BGP8CU(BGPVINP),.BGPDATA)
 D WALLALG^BGP8CPU
 Q:BGPQUIT
 K BGPDATA
 D ALLALGA1^BGP8CU1(DFN,DT,.BGPDATA)
 D WALLALGT^BGP8CPU
 K BGPDATA
 D IVUD^BGP8CU1(DFN,$P($P(BGPVSIT0,U),"."),$$DSCH^BGP8CU(BGPVINP),,.BGPDATA)
 D WIVUD^BGP8CPU
 Q
 ; 
TRANSIN ;
 I $Y>(BGPIOSL-4) D HDR^BGP8CP Q:BGPQUIT  D L1H^BGP8CP
 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^BGP8CP Q:BGPQUIT  D L1H^BGP8CP
 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
TRANSN2 ;
 I $Y>(BGPIOSL-4) D HDR^BGP8CP Q:BGPQUIT  D L1H^BGP8CP
 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 !,"short term hospital, federal hospital, or to hospice.",!
 Q
TRANSN3 ;
 I $Y>(BGPIOSL-4) D HDR^BGP8CP Q:BGPQUIT  D L1H^BGP8CP
 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 on day of or day after arrival.",!
 Q
TRANSIN3 ;
 I $Y>(BGPIOSL-4) D HDR^BGP8CP Q:BGPQUIT  D L1H^BGP8CP
 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 or critical care access hospital, including ER from another hospital.",!
 Q
 ;