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

BGPD7.m

Go to the documentation of this file.
BGPD7 ; IHS/CMI/LAB - indicator 7 ;
 ;;7.0;IHS CLINICAL REPORTING;;JAN 24, 2007
 ;
I7 ;EP ;EP - indicator 7
 ;Q:'$D(BGPIND(17))
 Q:$P(^DPT(DFN,0),U,2)'="F"
 Q:BGPAGEB<40
 Q:BGPAGEB>69
 D S(BGPRPT,$S(BGPTIME=1:15,BGPTIME=0:45,BGPTIME=8:85,1:999),8,1)
 S BGPMAM=$$MAMMOG(DFN,BGPEDATE,2)
 I $E(BGPMAM)="Y" D S(BGPRPT,$S(BGPTIME=1:15,BGPTIME=0:45,BGPTIME=8:85,1:999),9,1)
 I $D(BGPLIST(17)),BGPTIME=1 S ^XTMP("BGPD",BGPJ,BGPH,"LIST",17,$S($P($G(^AUPNPAT(DFN,11)),U,18)]"":$P(^AUPNPAT(DFN,11),U,18),1:"UNKNOWN"),$P(^DPT(DFN,0),U,2),BGPAGEE,DFN)=BGPMAM
 Q
S(R,N,P,V) ;
 I 'V Q  ;no value to add
 S $P(^BGPD(R,N),U,P)=$P($G(^BGPD(R,N)),U,P)+V
 Q
REFUSAL(P,F,I,B,E) ;EP
 I '$G(P) Q ""
 I '$G(F) Q ""
 I '$G(I) Q ""
 I $G(B)="" Q ""
 I $G(E)="" Q ""
 NEW G,X
 S (X,G)=0 F  S X=$O(^AUPNPREF("AA",P,F,I,X)) Q:X'=+X!(G)  S Y=0 F  S Y=$O(^AUPNPREF("AA",P,F,I,X,Y)) Q:Y'=+Y  S D=$P(^AUPNPREF(Y,0),U,3) I D'<B&(D'>E) S G=1
 Q G
MAMMOG(P,EDATE,YEARS) ;
 NEW BGP,%,E,BDATE S BDATE=$$FMADD^XLFDT(EDATE,-(365*YEARS))
 I '$G(P) Q ""
 S %=P_"^LAST RAD 76091;DURING "_$$FMTE^XLFDT(BDATE)_"-"_$$FMTE^XLFDT(EDATE),E=$$START1^APCLDF(%,"BGP(")
 I $D(BGP(1)) Q "Yes "_$$FMTE^XLFDT($P(BGP(1),U))_" 76091"
 K BGP S %=P_"^LAST RAD 76092;DURING "_$$FMTE^XLFDT(BDATE)_"-"_$$FMTE^XLFDT(EDATE),E=$$START1^APCLDF(%,"BGP(")
 I $D(BGP(1)) Q "Yes "_$$FMTE^XLFDT($P(BGP(1),U))_" 76092"
 K BGP S %=P_"^LAST RAD 76090;DURING "_$$FMTE^XLFDT(BDATE)_"-"_$$FMTE^XLFDT(EDATE),E=$$START1^APCLDF(%,"BGP(")
 I $D(BGP(1)) Q "Yes "_$$FMTE^XLFDT($P(BGP(1),U))_" 76090"
 K BGP S %=P_"^LAST DX V76.11;DURING "_$$FMTE^XLFDT(BDATE)_"-"_$$FMTE^XLFDT(EDATE),E=$$START1^APCLDF(%,"BGP(")
 I $D(BGP(1)) Q "Yes "_$$FMTE^XLFDT($P(BGP(1),U))_" V76.11"
 K BGP S %=P_"^LAST DX V76.12;DURING "_$$FMTE^XLFDT(BDATE)_"-"_$$FMTE^XLFDT(EDATE),E=$$START1^APCLDF(%,"BGP(")
 I $D(BGP(1)) Q "Yes "_$$FMTE^XLFDT($P(BGP(1),U))_" V76.12"
 K BGP S %=P_"^LAST PROCEDURE 87.37;DURING "_$$FMTE^XLFDT(BDATE)_"-"_$$FMTE^XLFDT(EDATE),E=$$START1^APCLDF(%,"BGP(")
 I $D(BGP(1)) Q "Yes "_$$FMTE^XLFDT($P(BGP(1),U))_" Pr 87.37"
 K BGP S %=P_"^LAST PROCEDURE 87.36;DURING "_$$FMTE^XLFDT(BDATE)_"-"_$$FMTE^XLFDT(EDATE),E=$$START1^APCLDF(%,"BGP(")
 I $D(BGP(1)) Q "Yes "_$$FMTE^XLFDT($P(BGP(1),U))_" Pr 87.36"
 S T=$O(^ATXAX("B","BGP CPT MAMMOGRAM",0))
 I T D  I X]"" Q "Yes "_$$FMTE^XLFDT(X)_" CPT"
 .S X=$$CPT^BGPDU(P,,EDATE,T,3)
 S T="MAMMOGRAM SCREENING",T=$O(^BWPN("B",T,0))
 I T D  I X]"" Q "Yes "_X_" WHTP"
 .S X=$$WH^BGPDU(P,,EDATE,T,4)
 S T="MAMMOGRAM DX BILAT",T=$O(^BWPN("B",T,0))
 I T D  I X]"" Q "Yes "_X_" WHTP"
 .S X=$$WH^BGPDU(P,,EDATE,T,4)
 S T="MAMMOGRAM DX UNILAT",T=$O(^BWPN("B",T,0))
 I T D  I X]"" Q "Yes "_X_" WHTP"
 .S X=$$WH^BGPDU(P,,EDATE,T,4)
 S T=$$REFUSAL(P,71,$O(^RAMIS(71,"D",76091,0)),$$FMADD^XLFDT(EDATE,-365),EDATE)
 I T Q "Yes - Refused or NMI"
 S T=$$REFUSAL(P,71,$O(^RAMIS(71,"D",76092,0)),$$FMADD^XLFDT(EDATE,-365),EDATE)
 I T Q "Yes - Refused or NMI"
 S T=$$REFUSAL(P,71,$O(^RAMIS(71,"D",76090,0)),$$FMADD^XLFDT(EDATE,-365),EDATE)
 I T Q "Yes - Refused or NMI"
 Q "No"