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

BGP9D42.m

Go to the documentation of this file.
BGP9D42 ; IHS/CMI/LAB - measure 11 ;
 ;;9.0;IHS CLINICAL REPORTING;;JUL 1, 2009
 ;
 ;
IRAO ;EP
 S (BGPN1,BGPN2,BGPN3,BGPN4,BGPN5,BGPN6,BGPN7,BGPN8,BGPD1,BGPD2,BGPD3,BGPD4)=0
 I BGPAGEB<65 S BGPSTOP="" Q  ;65 and older
 I $P(^DPT(DFN,0),U,2)'="F" S BGPSTOP="" Q  ;only females
 I BGPACTUP S BGPD2=1
 I BGPACTCL S BGPD1=1
 I 'BGPD2,'BGPD1 S BGPSTOP=1 Q  ;not in either denom so quit
 S T=$O(^ATXAX("B","BGP OSTEOPOROSIS DXS",0))
 I 'T W BGPBOMB Q
 I $$LASTDX^BGP9UTL1(DFN,"BGP OSTEOPOROSIS DXS",$P(^DPT(DFN,0),U,3),BGPEDATE) S BGPSTOP=1 Q  ;had osteoporosis dx
 S BGPPAP=$$OSTEOSCR(DFN,$$FMADD^XLFDT(BGPBDATE,-(365*2)),BGPEDATE)
 I BGPPAP S BGPN1=1
 I $P(BGPPAP,U)=3 S BGPN2=1
 S BGPVALUE="UP"
 I BGPD1 S BGPVALUE=BGPVALUE_";AC"
 S BGPVALUE=BGPVALUE_"|||"_$P(BGPPAP,U,2)_" "_$$DATE^BGP9UTL($P(BGPPAP,U,3))_$S($P(BGPPAP,U,1)=3:" (refused)",1:"")
 K BGPPAP,X
 Q
 ;
OSTEOSCR(P,BDATE,EDATE) ;EP
 S X=$$LASTPRCI^BGP9UTL1(P,"88.98",BDATE,EDATE)
 I X Q X
 S X=$$LASTDXI^BGP9UTL1(P,"V82.81",BDATE,EDATE)
 I X Q X
 S X=$$CPT^BGP9DU(P,BDATE,EDATE,$O(^ATXAX("B","BGP OSTEO SCREEN CPTS",0)),6)
 I X Q 1_U_$P(X,U,3)_U_$P(X,U,2)
 S X=$$TRAN^BGP9DU(P,BDATE,EDATE,$O(^ATXAX("B","BGP OSTEO SCREEN CPTS",0)),6)
 I X Q 1_U_$P(X,U,3)_U_$P(X,U,2)
 ;now check for refusal
 S X=$$RAD^BGP9DU(P,BDATE,EDATE,$O(^ATXAX("B","BGP OSTEO SCREEN CPTS",0)),6)
 I X Q 1_U_$P(X,U,3)_U_$P(X,U,2)
 ;
 S X=$$RADREF^BGP9UTL1(P,$$FMADD^XLFDT(EDATE,-365),EDATE,$O(^ATXAX("B","BGP OSTEO SCREEN CPTS",0)))
 I X Q 3_U_$P(X,U,3)_U_$P(X,U,2)
 Q ""