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

BGP3CP5.m

Go to the documentation of this file.
BGP3CP5 ; IHS/CMI/LAB - IHS gpra print ;
 ;;13.0;IHS CLINICAL REPORTING;;NOV 20, 2012;Build 81
 ;
 ;
PNALL ;EP
 I $Y>(BGPIOSL-3) D HDR^BGP3CP Q:BGPQUIT  D L1H^BGP3CP
 S BGPNOBA=1
 D WRACE^BGP3CPU(DFN)
 Q:BGPQUIT
 D WDOB^BGP3CPU(DFN)
 Q:BGPQUIT
 D WZIP^BGP3CPU(DFN)
 Q:BGPQUIT
 D WINS^BGP3CPU(BGPVSIT,DFN)
 Q:BGPQUIT
 D WADM^BGP3CPU(BGPVINP)
 Q:BGPQUIT
 D WADM92^BGP3CPU(BGPVINP)
 Q:BGPQUIT
 D WADMS92^BGP3CPU(BGPVINP)
 Q:BGPQUIT
 D WDT^BGP3CPU(BGPVINP)
 Q:BGPQUIT
 D WDSGS92^BGP3CPU(BGPVINP)
 Q:BGPQUIT
 I $$TRANS^BGP3CU(BGPVINP) D WTT^BGP3CPU(BGPVINP) Q:BGPQUIT
 K BGPNOBA
 D WPNEUPOV^BGP3CPU3(BGPVSIT)
 Q:BGPQUIT
 S BGPNOBA=1
 D OTHDPOVS^BGP3CPU(BGPVSIT)
 Q:BGPQUIT
 D WPRINPRO^BGP3CPU2
 Q:BGPQUIT
 D WOTHPROS^BGP3CPU2
 K BGPNOBA
 Q
 ;
PN1 ;EP
 I $Y>(BGPIOSL-3) D HDR^BGP3CP Q:BGPQUIT  D L1H^BGP3CP
 I $$TRANSIN^BGP3CU(BGPVINP) D TRANSIN Q:BGPQUIT
 D WDT^BGP3CPU3(BGPVINP)
 Q:BGPQUIT
 I $$TRANS^BGP3CU(BGPVINP) D WTT^BGP3CPU3(BGPVINP)
 Q:BGPQUIT
 I $$TRANS^BGP3CU(BGPVINP),$$DODA^BGP3CU(BGPVSIT,BGPVINP) D TRANSN Q:BGPQUIT
 D WPPDPOV^BGP3CPU3(BGPVSIT)
 Q:BGPQUIT
 D OTHDPOVS^BGP3CPU3(BGPVSIT)
 Q:BGPQUIT
 I 'BGPEXCL D
 .S X=$$ERPNEU^BGP3CU(DFN,$$FMADD^XLFDT($P($P(BGPVSIT0,U),"."),-1),$P($P(BGPVSIT0,U),"."),"BGP CMS PNEUMONIA DXS")
 .D WERPNEU^BGP3CPU3
 .S X=$$ADMDX^BGP3CU(BGPVINP,"BGP CMS PNEUMONIA DXS")
 .D WADMDX^BGP3CPU3
 Q:BGPQUIT
 S X=$$COMFORT^BGP3CU(DFN,$P($P(^AUPNVSIT(BGPVSIT,0),U),"."),$P($P(^AUPNVINP(BGPVINP,0),U),"."))
 D WCOMFORT^BGP3CPU3(X)
 Q:BGPQUIT
 K BGPDATA,BGPSCAN
 D CHESTXRY^BGP3CU(DFN,$$FMADD^XLFDT($P($P(^AUPNVSIT(BGPVSIT,0),U),"."),-1),$P($P(^AUPNVINP(BGPVINP,0),U),"."),.BGPDATA)
 D CTSCAN^BGP3CU(DFN,$$FMADD^XLFDT($P($P(^AUPNVSIT(BGPVSIT,0),U),"."),-1),$P($P(^AUPNVINP(BGPVINP,0),U),"."),.BGPSCAN)
 D WCHEST^BGP3CPU3
 Q:BGPQUIT
 I 'BGPEXCL D
 .S X=$$LASTDX^BGP3UTL1(DFN,"BGP CMS CYSTIC FIBROSIS DXS",$$DOB^AUPNPAT(DFN),$$DSCH^BGP3CU(BGPVINP))
 .D WCYSTIC^BGP3CPU3
 K BGPDATA
 D ABGPO^BGP3CU(DFN,$$FMADD^XLFDT($P($P(^AUPNVSIT(BGPVSIT,0),U),"."),-1),$$FMADD^XLFDT($$DSCH^BGP3CU(BGPVINP)),.BGPDATA)
 D WABGPO^BGP3CPU3
 Q:BGPQUIT
 K BGPDATA
 D ALLALG1^BGP3CU1(DFN,DT,$$DSCH^BGP3CU(BGPVINP),.BGPDATA)
 D WALLALG^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BGP3CU(DFN,$$FMADD^XLFDT($P($P(^AUPNVSIT(BGPVSIT,0),U),"."),-1),$P($P(^AUPNVINP(BGPVINP,0),U),"."),.BGPDATA)
 D CTSCAN^BGP3CU(DFN,$$FMADD^XLFDT($P($P(^AUPNVSIT(BGPVSIT,0),U),"."),-1),$P($P(^AUPNVINP(BGPVINP,0),U),"."),.BGPSCAN)
 D WCHEST^BGP3CPU3
 Q:BGPQUIT
 I 'BGPEXCL D
 .S X=$$LASTDX^BGP3UTL1(DFN,"BGP CMS CYSTIC FIBROSIS DXS",$$DOB^AUPNPAT(DFN),$$DSCH^BGP3CU(BGPVINP))
 .D WCYSTIC^BGP3CPU3
 K BGPDATA
 ;antibiotic rx status?
 D ANTIRX^BGP3CU3(DFN,$$FMADD^XLFDT($P($P(^AUPNVSIT(BGPVSIT,0),U),"."),-365),$$FMADD^XLFDT($P($P(^AUPNVINP(BGPVINP,0),U),"."),30),.BGPDATA)
 D WANTIRX^BGP3CPU3
 Q:BGPQUIT
 K BGPDATA
 D ERBCP^BGP3CU3(DFN,$$FMADD^XLFDT($P($P(BGPVSIT0,U),"."),-1),$P($P(BGPVSIT0,U),"."),.BGPDATA)
 D WERBC^BGP3CPU3
 Q:BGPQUIT
 K BGPDATA
 D ALLALG1^BGP3CU1(DFN,DT,$$DSCH^BGP3CU(BGPVINP),.BGPDATA)
 D WALLALG^BGP3CPU
 Q:BGPQUIT
 K BGPDATA
 D ALLALGA1^BGP3CU1(DFN,DT,.BGPDATA)
 D WALLALGT^BGP3CPU
 K BGPDATA
 D IVUD^BGP3CU1(DFN,$P($P(BGPVSIT0,U),"."),$$DSCH^BGP3CU(BGPVINP),,.BGPDATA)
 D WIVUD^BGP3CPU
 Q
 ; 
PN4 ;EP
 I $Y>(BGPIOSL-3) D HDR^BGP3CP Q:BGPQUIT  D L1H^BGP3CP
 I 'BGPEXCL D WDOD^BGP3CPU3(DFN)
 Q:BGPQUIT
 D WDT9^BGP3CPU3(BGPVINP)
 Q:BGPQUIT
 I $$TRANS^BGP3CU(BGPVINP) D WTT^BGP3CPU3(BGPVINP)
 Q:BGPQUIT
 I $$TRANS^BGP3CU(BGPVINP) D TRANSN2 Q:BGPQUIT
 D WPPDPOV^BGP3CPU3(BGPVSIT)
 Q:BGPQUIT
 D OTHDPOVS^BGP3CPU3(BGPVSIT)
 Q:BGPQUIT
 S X=$$COMFORT^BGP3CU(DFN,$P($P(^AUPNVSIT(BGPVSIT,0),U),"."),$P($P(^AUPNVINP(BGPVINP,0),U),"."))
 D WCOMFORT^BGP3CPU3(X)
 Q:BGPQUIT
 K BGPDATA,BGPSCAN
 D CHESTXRY^BGP3CU(DFN,$$FMADD^XLFDT($P($P(^AUPNVSIT(BGPVSIT,0),U),"."),-1),$P($P(^AUPNVINP(BGPVINP,0),U),"."),.BGPDATA)
 D CTSCAN^BGP3CU(DFN,$$FMADD^XLFDT($P($P(^AUPNVSIT(BGPVSIT,0),U),"."),-1),$P($P(^AUPNVINP(BGPVINP,0),U),"."),.BGPSCAN)
 D WCHEST^BGP3CPU3
 Q:BGPQUIT
 I 'BGPEXCL D
 .S X=$$LASTDX^BGP3UTL1(DFN,"BGP CMS CYSTIC FIBROSIS DXS",$$DOB^AUPNPAT(DFN),$$DSCH^BGP3CU(BGPVINP))
 .D WCYSTIC^BGP3CPU3
 K BGPDATA
 ;antibiotic rx status?
 K BGPDATA
 S BGPC=0
 D SMOKER^BGP3CU2(DFN,$$FMADD^XLFDT($P($P(^AUPNVSIT(BGPVSIT,0),U),"."),-365),$$DSCH^BGP3CU(BGPVINP),.BGPDATA)
 D WSMOKER^BGP3CPU
 Q:BGPQUIT
 K BGPDATA
 D CESS^BGP3CU2(DFN,$P($P(^AUPNVSIT(BGPVSIT,0),U),"."),$$DSCH^BGP3CU(BGPVINP),.BGPDATA)
 D WCESS^BGP3CPU
 Q:BGPQUIT
 K BGPDATA
 D CESSMEDS^BGP3CU2(DFN,$P($P(^AUPNVSIT(BGPVSIT,0),U),"."),$$DSCH^BG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$$FMADD^XLFDT($P($P(^AUPNVSIT(BGPVSIT,0),U),"."),-1),$P($P(^AUPNVINP(BGPVINP,0),U),"."),.BGPDATA)
 D CTSCAN^BGP3CU(DFN,$$FMADD^XLFDT($P($P(^AUPNVSIT(BGPVSIT,0),U),"."),-1),$P($P(^AUPNVINP(BGPVINP,0),U),"."),.BGPSCAN)
 D WCHEST^BGP3CPU3
 Q:BGPQUIT
 ;antibiotic rx status?
 K BGPDATA
 D ANTIRX^BGP3CU3(DFN,$$FMADD^XLFDT($P($P(^AUPNVSIT(BGPVSIT,0),U),"."),-365),$$FMADD^XLFDT($P($P(^AUPNVINP(BGPVINP,0),U),"."),30),.BGPDATA)
 D WANTIRX^BGP3CPU3
 Q:BGPQUIT
 I 'BGPEXCL D
 .S X=$$LASTDX^BGP3UTL1(DFN,"BGP CMS CYSTIC FIBROSIS DXS",$$DOB^AUPNPAT(DFN),$$DSCH^BGP3CU(BGPVINP))
 .D WCYSTIC^BGP3CPU3
 K BGPDATA
 ;D ERBCP^BGP3CU3(DFN,$$FMADD^XLFDT($P($P(BGPVSIT0,U),"."),-1),$P($P(BGPVSIT0,U),"."),.BGPDATA)
 ;D WERBC^BGP3CPU3
 Q:BGPQUIT
 K BGPDATA
 D ALLALG1^BGP3CU1(DFN,DT,$$DSCH^BGP3CU(BGPVINP),.BGPDATA)
 D WALLALG^BGP3CPU
 Q:BGPQUIT
 K BGPDATA
 D ALLALGA1^BGP3CU1(DFN,DT,.BGPDATA)
 D WALLALGT^BGP3CPU
 K BGPDATA
 D IVUD^BGP3CU1(DFN,$P($P(BGPVSIT0,U),"."),$$DSCH^BGP3CU(BGPVINP),,.BGPDATA)
 D WIVUD^BGP3CPU
 Q
 ;
PN6 ;EP
 I $Y>(BGPIOSL-3) D HDR^BGP3CP Q:BGPQUIT  D L1H^BGP3CP
 I $$TRANSIN^BGP3CU(BGPVINP) D TRANSIN Q:BGPQUIT
 I 'BGPEXCL D WDOD^BGP3CPU3(DFN)
 Q:BGPQUIT
 D WDT^BGP3CPU3(BGPVINP)
 Q:BGPQUIT
 I $$TRANS^BGP3CU(BGPVINP) D WTT^BGP3CPU3(BGPVINP)
 Q:BGPQUIT
 I $$TRANS^BGP3CU(BGPVINP) D TRANSN Q:BGPQUIT
 D WPPDPOV^BGP3CPU3(BGPVSIT)
 Q:BGPQUIT
 D OTHDPOVS^BGP3CPU3(BGPVSIT)
 Q:BGPQUIT
 I 'BGPEXCL D
 .S X=$$ERPNEU^BGP3CU(DFN,$$FMADD^XLFDT($P($P(BGPVSIT0,U),"."),-1),$P($P(BGPVSIT0,U),"."),"BGP CMS PNEUMONIA DXS")
 .D WERPNEU^BGP3CPU3
 .S X=$$ADMDX^BGP3CU(BGPVINP,"BGP CMS PNEUMONIA DXS")
 .D WADMDX^BGP3CPU3
 Q:BGPQUIT
 S X=$$COMFORT^BGP3CU(DFN,$P($P(^AUPNVSIT(BGPVSIT,0),U),"."),$P($P(^AUPNVINP(BGPVINP,0),U),"."))
 D WCOMFORT^BGP3CPU3(X)
 Q:BGPQUIT
 K BGPDATA
 I 'BGPEXCL D  Q:BGPQUIT
 .K BGPDATA
 .D EXCLCOMP^BGP3CU4(DFN,$P($P(^AUPNVSIT(BGPVSIT,0),U),"."),$P($P(^AUPNVINP(BGPVINP,0),U),"."),.BGPDATA)
 .D WEXCL1^BGP3CPU3
 .Q:BGPQUIT
 .S X=$$PRIORHOS^BGP3CU4(DFN,$$FMADD^XLFDT($P($P(BGPVSIT0,U),"."),-14),$P($P(BGPVSIT0,U),"."),BGPVSIT)
 .S Y=$$HOS2DAYS^BGP3CU4(DFN,$$FMADD^XLFDT($P($P(BGPVSIT0,U),"."),-90),$P($P(BGPVSIT0,U),"."))
 .D WPRIORHO^BGP3CPU3
 .Q:BGPQUIT
 .S X=$$NURSHOME^BGP3CU4(DFN,$$FMADD^XLFDT($P($P(BGPVSIT0,U),"."),-90),$P($P(BGPVSIT0,U),"."))
 .D WNURSHOM^BGP3CPU3
 .Q:BGPQUIT
 .S X=$$WOUNDCAR^BGP3CU4(DFN,$$FMADD^XLFDT($P($P(BGPVSIT0,U),"."),-30),$P($P(BGPVSIT0,U),"."))
 .D WWOUND^BGP3CPU3
 K BGPDATA,BGPSCAN
 D CHESTXRY^BGP3CU(DFN,$$FMADD^XLFDT($P($P(^AUPNVSIT(BGPVSIT,0),U),"."),-1),$P($P(^AUPNVINP(BGPVINP,0),U),"."),.BGPDATA)
 D CTSCAN^BGP3CU(DFN,$$FMADD^XLFDT($P($P(^AUPNVSIT(BGPVSIT,0),U),"."),-1),$P($P(^AUPNVINP(BGPVINP,0),U),"."),.BGPSCAN)
 D WCHEST^BGP3CPU3
 Q:BGPQUIT
 S X=$$ADMDX^BGP3CU(BGPVINP,"BGP CMS OTHER INFECTION DXS")
 D WOTHINF^BGP3CPU3
 Q:BGPQUIT
 K BGPDATA
 I 'BGPEXCL D  Q:BGPQUIT
 .S X=$$LASTDX^BGP3UTL1(DFN,"BGP CMS CYSTIC FIBROSIS DXS",$$DOB^AUPNPAT(DFN),$$DSCH^BGP3CU(BGPVINP))
 .D WCYSTIC^BGP3CPU3
 K BGPDATA
 S BGPPSE=$$PSEUDO^BGP3CU4(BGPVINP)
 S BGPCOPD=$$COPD^BGP3CU4(DFN,$$DSCH^BGP3CU(BGPVINP))
 D WPSEUDO^BGP3CPU3
 Q:BGPQUIT
 ;antibiotic rx status?
 K BGPDATA
 D ANTIRX^BGP3CU3(DFN,$$FMADD^XLFDT($P($P(^AUPNVSIT(BGPVSIT,0),U),"."),-365),$$FMADD^XLFDT($P($P(^AUPNVINP(BGPVINP,0),U),"."),30),.BGPDATA)
 D WANTIRX^BGP3CPU3
 Q:BGPQUIT
 ;D ERBCP^BGP3CU3(DFN,$$FMADD^XLFDT($P($P(BGPVSIT0,U),"."),-1),$P($P(BGPVSIT0,U),"."),.BGPDATA)
 ;D WERBC^BGP3CPU3
 Q:BGPQUIT
 K BGPDATA
 D ALLALG1^BGP3CU1(DFN,DT,$$DSCH^BGP3CU(BGPVINP),.BGPDATA)
 D WALLALG^BGP3CPU
 Q:BGPQUIT
 K BGPDATA
 D ALLALGA1^BGP3CU1(DFN,DT,.BGPDATA)
 D WALLALGT^BGP3CPU
 K BGPDATA
 D IVUD^BGP3CU1(DFN,$P($P(BGPVSIT0,U),"."),$$DSCH^BGP3CU(BGPVINP),,.BGPDATA)
 D WIVUD^BGP3CPU
 Q
 ; 
PN7 ;EP
 I $Y>(BGPIOSL-3) D HDR^BGP3CP Q:BGPQUIT  D L1H^BGP3CP
 D WDT9^BGP3CPU3(BGPVINP)
 Q:BGPQUIT
 I $$TRANS^BGP3CU(BGPVINP) D WTT^BGP3CPU3(BGPVINP)
 Q:BGPQUIT
 I $$TRANS^BGP3CU(BGPVINP) D TRANSN Q:BGPQUIT
 D WPPDPOV^BGP3CPU3(BGPVSIT)
 Q:BGPQUIT
 D OTHDPOVS^BGP3CPU3(BGPVSIT)
 Q:BGPQUIT
 S X=$$COMFORT^BGP3CU(DFN,$P($P(^AUPNVSIT(BGPVSIT,0),U),"."),$P($P(^AUPNVINP(BGPVINP,0),U),"."))
 D WCOMFORT^BGP3CPU3(X)
 Q:BGPQUIT
 D EXCL487^BGP3CPU3
 K BGPDATA,BGPSCAN
 D CHESTXRY^BGP3CU(DFN,$$FMADD^XLFDT($P($P(^AUPNVSIT(BGPVSIT,0),U),"."),-1),$P($P(^AUPNVINP(BGPVINP,0),U),"."),.BGPDATA)
 D CTSCAN^BGP3CU(DFN,$$FMADD^XLFDT($P($P(^AUPNVSIT(BGPVSIT,0),U),"."),-1),$P($P(^AUPNVINP(BGPVINP,0),U),"."),.BGPSCAN)
 D WCHEST^BGP3CPU3
 Q:BGPQUIT
 I 'BGPEXCL D
 .S X=$$LASTDX^BGP3UTL1(DFN,"BGP CMS CYSTIC FIBROSIS DXS",$$DOB^AUPNPAT(DFN),$$DSCH^BGP3CU(BGPVINP))
 .D WCYSTIC^BGP3CPU3
 K BGPDATA
 ;
 D FLUVAX^BGP3CU4(DFN,$$FMADD^XLFDT($P($P(^AUPNVSIT(BGPVSIT,0),U),"."),-365),$$DSCH^BGP3CU(BGPVINP),$$DSCH^BGP3CU(BGPVINP),.BGPDATA)
 ;
 D WFLU^BGP3CPU3
 Q:BGPQUIT
 K BGPDATA
 D ALLALG1^BGP3CU1(DFN,DT,$$DSCH^BGP3CU(BGPVINP),.BGPDATA)
 D WALLALG^BGP3CPU
 Q:BGPQUIT
 K BGPDATA
 D ALLALGA1^BGP3CU1(DFN,DT,.BGPDATA)
 D WALLALGT^BGP3CPU
 K BGPDATA
 D IVUD^BGP3CU1(DFN,$P($P(BGPVSIT0,U),"."),$$DSCH^BGP3CU(BGPVINP),,.BGPDATA)
 D WIVUD^BGP3CPU
 Q
 ; 
TRANSIN ;
 I $Y>(BGPIOSL-4) D HDR^BGP3CP Q:BGPQUIT  D L1H^BGP3CP
 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^BGP3CP Q:BGPQUIT  D L1H^BGP3CP
 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^BGP3CP Q:BGPQUIT  D L1H^BGP3CP
 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^BGP3CP Q:BGPQUIT  D L1H^BGP3CP
 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^BGP3CP Q:BGPQUIT  D L1H^BGP3CP
 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
 ;