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

BGP0CP5.m

Go to the documentation of this file.
BGP0CP5 ; IHS/CMI/LAB - IHS gpra print ;
 ;;10.0;IHS CLINICAL REPORTING;;JUN 18, 2010
 ;
 ;
PNALL ;EP
 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 WPNEUPOV^BGP0CPU3(BGPVSIT)
 Q:BGPQUIT
 S BGPNOBA=1
 D OTHDPOVS^BGP0CPU(BGPVSIT)
 Q:BGPQUIT
 D WPRINPRO^BGP0CPU2
 Q:BGPQUIT
 D WOTHPROS^BGP0CPU2
 K BGPNOBA
 Q
 ;
PN1 ;EP
 I $Y>(BGPIOSL-3) D HDR^BGP0CP Q:BGPQUIT  D L1H^BGP0CP
 I $$TRANSIN^BGP0CU(BGPVINP) D TRANSIN Q:BGPQUIT
 D WDT^BGP0CPU3(BGPVINP)
 Q:BGPQUIT
 I $$TRANS^BGP0CU(BGPVINP) D WTT^BGP0CPU3(BGPVINP)
 Q:BGPQUIT
 I $$TRANS^BGP0CU(BGPVINP),$$DODA^BGP0CU(BGPVSIT,BGPVINP) D TRANSN Q:BGPQUIT
 D WPPDPOV^BGP0CPU3(BGPVSIT)
 Q:BGPQUIT
 D OTHDPOVS^BGP0CPU3(BGPVSIT)
 Q:BGPQUIT
 I 'BGPEXCL D
 .S X=$$ERPNEU^BGP0CU(DFN,$$FMADD^XLFDT($P($P(BGPVSIT0,U),"."),-1),$P($P(BGPVSIT0,U),"."),"BGP CMS PNEUMONIA DXS")
 .D WERPNEU^BGP0CPU3
 .S X=$$ADMDX^BGP0CU(BGPVINP,"BGP CMS PNEUMONIA DXS")
 .D WADMDX^BGP0CPU3
 Q:BGPQUIT
 S X=$$COMFORT^BGP0CU(DFN,$P($P(^AUPNVSIT(BGPVSIT,0),U),"."),$P($P(^AUPNVINP(BGPVINP,0),U),"."))
 D WCOMFORT^BGP0CPU3(X)
 Q:BGPQUIT
 K BGPDATA,BGPSCAN
 D CHESTXRY^BGP0CU(DFN,$$FMADD^XLFDT($P($P(^AUPNVSIT(BGPVSIT,0),U),"."),-1),$P($P(^AUPNVINP(BGPVINP,0),U),"."),.BGPDATA)
 D CTSCAN^BGP0CU(DFN,$$FMADD^XLFDT($P($P(^AUPNVSIT(BGPVSIT,0),U),"."),-1),$P($P(^AUPNVINP(BGPVINP,0),U),"."),.BGPSCAN)
 D WCHEST^BGP0CPU3
 Q:BGPQUIT
 I 'BGPEXCL D
 .S X=$$LASTDX^BGP0UTL1(DFN,"BGP CMS CYSTIC FIBROSIS DXS",$$DOB^AUPNPAT(DFN),$$DSCH^BGP0CU(BGPVINP))
 .D WCYSTIC^BGP0CPU3
 K BGPDATA
 D ABGPO^BGP0CU(DFN,$$FMADD^XLFDT($P($P(^AUPNVSIT(BGPVSIT,0),U),"."),-1),$$FMADD^XLFDT($$DSCH^BGP0CU(BGPVINP)),.BGPDATA)
 D WABGPO^BGP0CPU3
 Q:BGPQUIT
 K BGPDATA
 D ALLALG1^BGP0CU1(DFN,DT,$$DSCH^BGP0CU(BGPVINP),.BGPDATA)
 D WALLALG^BGP0C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U(DFN,$$FMADD^XLFDT($P($P(^AUPNVSIT(BGPVSIT,0),U),"."),-1),$P($P(^AUPNVINP(BGPVINP,0),U),"."),.BGPDATA)
 D CTSCAN^BGP0CU(DFN,$$FMADD^XLFDT($P($P(^AUPNVSIT(BGPVSIT,0),U),"."),-1),$P($P(^AUPNVINP(BGPVINP,0),U),"."),.BGPSCAN)
 D WCHEST^BGP0CPU3
 Q:BGPQUIT
 I 'BGPEXCL D
 .S X=$$LASTDX^BGP0UTL1(DFN,"BGP CMS CYSTIC FIBROSIS DXS",$$DOB^AUPNPAT(DFN),$$DSCH^BGP0CU(BGPVINP))
 .D WCYSTIC^BGP0CPU3
 K BGPDATA
 ;antibiotic rx status?
 D ANTIRX^BGP0CU3(DFN,$$FMADD^XLFDT($P($P(^AUPNVSIT(BGPVSIT,0),U),"."),-365),$$FMADD^XLFDT($P($P(^AUPNVINP(BGPVINP,0),U),"."),30),.BGPDATA)
 D WANTIRX^BGP0CPU3
 Q:BGPQUIT
 K BGPDATA
 D ERBCP^BGP0CU3(DFN,$$FMADD^XLFDT($P($P(BGPVSIT0,U),"."),-1),$P($P(BGPVSIT0,U),"."),.BGPDATA)
 D WERBC^BGP0CPU3
 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
 ; 
PN4 ;EP
 I $Y>(BGPIOSL-3) D HDR^BGP0CP Q:BGPQUIT  D L1H^BGP0CP
 I 'BGPEXCL D WDOD^BGP0CPU3(DFN)
 Q:BGPQUIT
 D WDT9^BGP0CPU3(BGPVINP)
 Q:BGPQUIT
 I $$TRANS^BGP0CU(BGPVINP) D WTT^BGP0CPU3(BGPVINP)
 Q:BGPQUIT
 I $$TRANS^BGP0CU(BGPVINP) D TRANSN2 Q:BGPQUIT
 D WPPDPOV^BGP0CPU3(BGPVSIT)
 Q:BGPQUIT
 D OTHDPOVS^BGP0CPU3(BGPVSIT)
 Q:BGPQUIT
 S X=$$COMFORT^BGP0CU(DFN,$P($P(^AUPNVSIT(BGPVSIT,0),U),"."),$P($P(^AUPNVINP(BGPVINP,0),U),"."))
 D WCOMFORT^BGP0CPU3(X)
 Q:BGPQUIT
 K BGPDATA,BGPSCAN
 D CHESTXRY^BGP0CU(DFN,$$FMADD^XLFDT($P($P(^AUPNVSIT(BGPVSIT,0),U),"."),-1),$P($P(^AUPNVINP(BGPVINP,0),U),"."),.BGPDATA)
 D CTSCAN^BGP0CU(DFN,$$FMADD^XLFDT($P($P(^AUPNVSIT(BGPVSIT,0),U),"."),-1),$P($P(^AUPNVINP(BGPVINP,0),U),"."),.BGPSCAN)
 D WCHEST^BGP0CPU3
 Q:BGPQUIT
 I 'BGPEXCL D
 .S X=$$LASTDX^BGP0UTL1(DFN,"BGP CMS CYSTIC FIBROSIS DXS",$$DOB^AUPNPAT(DFN),$$DSCH^BGP0CU(BGPVINP))
 .D WCYSTIC^BGP0CPU3
 K BGPDATA
 ;antibiotic rx status?
 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,$P($P(^AUPNVSIT(BGPVSIT,0),U),"."),$$DSCH^BGP0CU(BGPVINP),.BGPDATA)
 D WCESSMED^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
 ; 
PN5B ;EP
 I $Y>(BGPIOSL-3) D HDR^BGP0CP Q:BGPQUIT  D L1H^BGP0CP
 I $$TRANSIN^BGP0CU(BGPVINP) D TRANSIN Q:BGPQUIT
 I 'BGPEXCL D WDOD^BGP0CPU3(DFN)
 Q:BGPQUIT
 D WDT^BGP0CPU3(BGPVINP)
 Q:BGPQUIT
 I $$TRANS^BGP0CU(BGPVINP) D WTT^BGP0CPU3(BGPVINP)
 Q:BGPQUIT
 I $$TRANS^BGP0CU(BGPVINP) D TRANSN Q:BGPQUIT
 D WPPDPOV^BGP0CPU3(BGPVSIT)
 Q:BGPQUIT
 D OTHDPOVS^BGP0CPU3(BGPVSIT)
 Q:BGPQUIT
 I 'BGPEXCL D
 .S X=$$ERPNEU^BGP0CU(DFN,$$FMADD^XLFDT($P($P(BGPVSIT0,U),"."),-1),$P($P(BGPVSIT0,U),"."),"BGP CMS PNEUMONIA DXS")
 .D WERPNEU^BGP0CPU3
 .S X=$$ADMDX^BGP0CU(BGPVINP,"BGP CMS PNEUMONIA DXS")
 .D WADMDX^BGP0CPU3
 Q:BGPQUIT
 S X=$$COMFORT^BGP0CU(DFN,$P($P(^AUPNVSIT(BGPVSIT,0),U),"."),$P($P(^AUPNVINP(BGPVINP,0),U),"."))
 D WCOMFORT^BGP0CPU3(X)
 Q:BGPQUIT
 K BGPDATA,BGPSCAN
 D CHESTXRY^BGP0CU(DFN,$$FMADD^XLFDT($P($P(^AUPNVSIT(BGPVSIT,0),U),"."),-1),$P($P(^AUPNVINP(BGPVINP,0),U),"."),.BGPDATA)
 D CTSCAN^BGP0CU(DFN,$$FMADD^XLFDT($P($P(^AUPNVSIT(BGPVSIT,0),U),"."),-1),$P($P(^AUPNVINP(BGPVINP,0),U),"."),.BGPSCAN)
 D WCHEST^BGP0CPU3
 Q:BGPQUIT
 ;antibiotic rx status?
 K BGPDATA
 D ANTIRX^BGP0CU3(DFN,$$FMADD^XLFDT($P($P(^AUPNVSIT(BGPVSIT,0),U),"."),-365),$$FMADD^XLFDT($P($P(^AUPNVINP(BGPVINP,0),U),"."),30),.BGPDATA)
 D WANTIRX^BGP0CPU3
 Q:BGPQUIT
 I 'BGPEXCL D
 .S X=$$LASTDX^BGP0UTL1(DFN,"BGP CMS CYSTIC FIBROSIS DXS",$$DOB^AUPNPAT(DFN),$$DSCH^BGP0CU(BGPVINP))
 .D WCYSTIC^BGP0CPU3
 K BGPDATA
 ;D ERBCP^BGP0CU3(DFN,$$FMADD^XLFDT($P($P(BGPVSIT0,U),"."),-1),$P($P(BGPVSIT0,U),"."),.BGPDATA)
 ;D WERBC^BGP0CPU3
 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
 ;
PN6 ;EP
 I $Y>(BGPIOSL-3) D HDR^BGP0CP Q:BGPQUIT  D L1H^BGP0CP
 I $$TRANSIN^BGP0CU(BGPVINP) D TRANSIN Q:BGPQUIT
 I 'BGPEXCL D WDOD^BGP0CPU3(DFN)
 Q:BGPQUIT
 D WDT^BGP0CPU3(BGPVINP)
 Q:BGPQUIT
 I $$TRANS^BGP0CU(BGPVINP) D WTT^BGP0CPU3(BGPVINP)
 Q:BGPQUIT
 I $$TRANS^BGP0CU(BGPVINP) D TRANSN Q:BGPQUIT
 D WPPDPOV^BGP0CPU3(BGPVSIT)
 Q:BGPQUIT
 D OTHDPOVS^BGP0CPU3(BGPVSIT)
 Q:BGPQUIT
 I 'BGPEXCL D
 .S X=$$ERPNEU^BGP0CU(DFN,$$FMADD^XLFDT($P($P(BGPVSIT0,U),"."),-1),$P($P(BGPVSIT0,U),"."),"BGP CMS PNEUMONIA DXS")
 .D WERPNEU^BGP0CPU3
 .S X=$$ADMDX^BGP0CU(BGPVINP,"BGP CMS PNEUMONIA DXS")
 .D WADMDX^BGP0CPU3
 Q:BGPQUIT
 S X=$$COMFORT^BGP0CU(DFN,$P($P(^AUPNVSIT(BGPVSIT,0),U),"."),$P($P(^AUPNVINP(BGPVINP,0),U),"."))
 D WCOMFORT^BGP0CPU3(X)
 Q:BGPQUIT
 K BGPDATA
 I 'BGPEXCL D  Q:BGPQUIT
 .K BGPDATA
 .D EXCLCOMP^BGP0CU4(DFN,$P($P(^AUPNVSIT(BGPVSIT,0),U),"."),$P($P(^AUPNVINP(BGPVINP,0),U),"."),.BGPDATA)
 .D WEXCL1^BGP0CPU3
 .Q:BGPQUIT
 .S X=$$PRIORHOS^BGP0CU4(DFN,$$FMADD^XLFDT($P($P(BGPVSIT0,U),"."),-14),$P($P(BGPVSIT0,U),"."),BGPVSIT)
 .S Y=$$HOS2DAYS^BGP0CU4(DFN,$$FMADD^XLFDT($P($P(BGPVSIT0,U),"."),-90),$P($P(BGPVSIT0,U),"."))
 .D WPRIORHO^BGP0CPU3
 .Q:BGPQUIT
 .S X=$$NURSHOME^BGP0CU4(DFN,$$FMADD^XLFDT($P($P(BGPVSIT0,U),"."),-90),$P($P(BGPVSIT0,U),"."))
 .D WNURSHOM^BGP0CPU3
 .Q:BGPQUIT
 .S X=$$WOUNDCAR^BGP0CU4(DFN,$$FMADD^XLFDT($P($P(BGPVSIT0,U),"."),-30),$P($P(BGPVSIT0,U),"."))
 .D WWOUND^BGP0CPU3
 K BGPDATA,BGPSCAN
 D CHESTXRY^BGP0CU(DFN,$$FMADD^XLFDT($P($P(^AUPNVSIT(BGPVSIT,0),U),"."),-1),$P($P(^AUPNVINP(BGPVINP,0),U),"."),.BGPDATA)
 D CTSCAN^BGP0CU(DFN,$$FMADD^XLFDT($P($P(^AUPNVSIT(BGPVSIT,0),U),"."),-1),$P($P(^AUPNVINP(BGPVINP,0),U),"."),.BGPSCAN)
 D WCHEST^BGP0CPU3
 Q:BGPQUIT
 S X=$$ADMDX^BGP0CU(BGPVINP,"BGP CMS OTHER INFECTION DXS")
 D WOTHINF^BGP0CPU3
 Q:BGPQUIT
 K BGPDATA
 I 'BGPEXCL D  Q:BGPQUIT
 .S X=$$LASTDX^BGP0UTL1(DFN,"BGP CMS CYSTIC FIBROSIS DXS",$$DOB^AUPNPAT(DFN),$$DSCH^BGP0CU(BGPVINP))
 .D WCYSTIC^BGP0CPU3
 K BGPDATA
 S BGPPSE=$$PSEUDO^BGP0CU4(BGPVINP)
 S BGPCOPD=$$COPD^BGP0CU4(DFN,$$DSCH^BGP0CU(BGPVINP))
 D WPSEUDO^BGP0CPU3
 Q:BGPQUIT
 ;antibiotic rx status?
 K BGPDATA
 D ANTIRX^BGP0CU3(DFN,$$FMADD^XLFDT($P($P(^AUPNVSIT(BGPVSIT,0),U),"."),-365),$$FMADD^XLFDT($P($P(^AUPNVINP(BGPVINP,0),U),"."),30),.BGPDATA)
 D WANTIRX^BGP0CPU3
 Q:BGPQUIT
 ;D ERBCP^BGP0CU3(DFN,$$FMADD^XLFDT($P($P(BGPVSIT0,U),"."),-1),$P($P(BGPVSIT0,U),"."),.BGPDATA)
 ;D WERBC^BGP0CPU3
 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
 ; 
PN7 ;EP
 I $Y>(BGPIOSL-3) D HDR^BGP0CP Q:BGPQUIT  D L1H^BGP0CP
 D WDT9^BGP0CPU3(BGPVINP)
 Q:BGPQUIT
 I $$TRANS^BGP0CU(BGPVINP) D WTT^BGP0CPU3(BGPVINP)
 Q:BGPQUIT
 I $$TRANS^BGP0CU(BGPVINP) D TRANSN Q:BGPQUIT
 D WPPDPOV^BGP0CPU3(BGPVSIT)
 Q:BGPQUIT
 D OTHDPOVS^BGP0CPU3(BGPVSIT)
 Q:BGPQUIT
 S X=$$COMFORT^BGP0CU(DFN,$P($P(^AUPNVSIT(BGPVSIT,0),U),"."),$P($P(^AUPNVINP(BGPVINP,0),U),"."))
 D WCOMFORT^BGP0CPU3(X)
 Q:BGPQUIT
 D EXCL487^BGP0CPU3
 K BGPDATA,BGPSCAN
 D CHESTXRY^BGP0CU(DFN,$$FMADD^XLFDT($P($P(^AUPNVSIT(BGPVSIT,0),U),"."),-1),$P($P(^AUPNVINP(BGPVINP,0),U),"."),.BGPDATA)
 D CTSCAN^BGP0CU(DFN,$$FMADD^XLFDT($P($P(^AUPNVSIT(BGPVSIT,0),U),"."),-1),$P($P(^AUPNVINP(BGPVINP,0),U),"."),.BGPSCAN)
 D WCHEST^BGP0CPU3
 Q:BGPQUIT
 I 'BGPEXCL D
 .S X=$$LASTDX^BGP0UTL1(DFN,"BGP CMS CYSTIC FIBROSIS DXS",$$DOB^AUPNPAT(DFN),$$DSCH^BGP0CU(BGPVINP))
 .D WCYSTIC^BGP0CPU3
 K BGPDATA
 ;
 D FLUVAX^BGP0CU4(DFN,$$FMADD^XLFDT($P($P(^AUPNVSIT(BGPVSIT,0),U),"."),-365),$$DSCH^BGP0CU(BGPVINP),$$DSCH^BGP0CU(BGPVINP),.BGPDATA)
 ;
 D WFLU^BGP0CPU3
 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
 ; 
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
TRANSN2 ;
 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 !,"short term hospital, federal hospital, or to hospice.",!
 Q
TRANSN3 ;
 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 on day of or day after arrival.",!
 Q
TRANSIN3 ;
 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 or critical care access hospital, including ER from another hospital.",!
 Q
 ;