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

BGPDP32.m

Go to the documentation of this file.
  1. BGPDP32 ; IHS/CMI/LAB - print ind 32 ;
  1. ;;7.0;IHS CLINICAL REPORTING;;JAN 24, 2007
  1. ;
  1. ;
  1. I32 ;EP ;
  1. ;Q:'$D(BGPIND(30))
  1. D HEADER^BGPDPH
  1. W !,"Indicator 32: HIV Testing"
  1. W !!,"Denominator is all patients with a positive value in the year prior",!," to the end of the time period for any of the following lab tests:"
  1. S BGPX=0 F S BGPX=$O(^BGPILAB(BGPX)) Q:BGPX'=+BGPX D
  1. .I $Y>(IOSL-2) D HEADER^BGPDPH Q:BGPQUIT
  1. .W !?5,$P(^LAB(60,BGPX,0),U),?38," "
  1. .S Y=0 F S Y=$O(^BGPILAB(BGPX,11,Y)) Q:Y'=+Y W " ",$P(^BGPILAB(BGPX,11,Y,0),U)," ;"
  1. W !!,"Increase the percentage of high-risk sexually active persons who have been",!,"tested for HIV.",!
  1. I $Y>(IOSL-7) D HEADER^BGPDPH Q:BGPQUIT
  1. D H1^BGPDPH
  1. S BGPCYD=$$V(BGPRPT,20,1),BGPCYN=$$V(BGPRPT,20,2),BGPCYP=$S(BGPCYD:((BGPCYN/BGPCYD)*100),1:"")
  1. S BGP98D=$$V(BGPRPT,90,1),BGP98N=$$V(BGPRPT,90,2),BGP98P=$S(BGP98D:((BGP98N/BGP98D)*100),1:"")
  1. S BGPPRD=$$V(BGPRPT,50,1),BGPPRN=$$V(BGPRPT,50,2),BGPPRP=$S(BGPPRD:((BGPPRN/BGPPRD)*100),1:"")
  1. W !,"# Patients w/Positive",!?2,"result",?22,$$C(BGP98D,0,8),?37,$$C(BGPPRD,0,8),?52,$$C(BGPCYD,0,8)
  1. W !!,"# w/HIV Test recorded",!?2,"w/in 1 yr of",!?2,"end of time period"
  1. D H2^BGPDPH
  1. Q
  1. Q
  1. CALC(N,O) ;ENTRY POINT
  1. NEW Z
  1. I O=0!(N=0)!(O="")!(N="") Q "**"
  1. NEW X,X2,X3
  1. S X=N,X2=1,X3=0 D COMMA^%DTC S N=X
  1. S X=O,X2=1,X3=0 D COMMA^%DTC S O=X
  1. I +O=0 Q "**"
  1. S Z=(((N-O)/O)*100),Z=$FN(Z,"+,",1)
  1. Q Z
  1. V(R,N,P) ;
  1. NEW Y
  1. I $G(BGPAREAA),'$G(BGPSUMR) G VA
  1. Q $P($G(^BGPD(R,N)),U,P)
  1. VA ;
  1. NEW X,C,V,MT,FT,M,F,B S X=0,C="" F S X=$O(BGPSUL(X)) Q:X'=+X D
  1. .S V=$P($G(^BGPD(X,N)),U,P)
  1. .I C="" S C=V Q
  1. .S MT=$P(C,"!"),FT=$P(C,"!",2),M=$P(V,"!"),F=$P(V,"!",2)
  1. .F B=1:1:6 S $P(MT,"~",B)=$P(MT,"~",B)+$P(M,"~",B)
  1. .F B=1:1:6 S $P(FT,"~",B)=$P(FT,"~",B)+$P(F,"~",B)
  1. .S C=MT_"!"_FT
  1. .Q
  1. Q C
  1. C(X,X2,X3) ;
  1. D COMMA^%DTC
  1. Q X