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

APCLD992.m

Go to the documentation of this file.
  1. APCLD992 ; IHS/CMI/LAB - 1999 DIABETES AUDIT ;
  1. ;;2.0;IHS PCC SUITE;;MAY 14, 2009
  1. MAMMOG(P,BDATE,EDATE) ; EP
  1. I $$SEX^AUPNPAT(P)'="F" Q "N/A"
  1. I '$G(P) Q ""
  1. NEW LMAM S LMAM=""
  1. I $G(^AUTTSITE(1,0)),$P(^AUTTLOC($P(^AUTTSITE(1,0),U),0),U,10)="353101" S LMAM=$$MAMMOG1(P,BDATE,EDATE)
  1. NEW APCL S %=P_"^LAST RAD MAMMOGRAM BILAT;DURING "_BDATE_"-"_EDATE,E=$$START1^APCLDF(%,"APCL(")
  1. I $D(APCL(1)) D
  1. .Q:LMAM>$P(APCL(1),U)
  1. .S LMAM=$P(APCL(1),U)
  1. K APCL S %=P_"^LAST RAD SCREENING MAMMOGRAM;DURING "_BDATE_"-"_EDATE,E=$$START1^APCLDF(%,"APCL(")
  1. I $D(APCL(1)) D
  1. .Q:LMAM>$P(APCL(1),U)
  1. .S LMAM=$P(APCL(1),U)
  1. K APCL S %=P_"^LAST DX V76.11;DURING "_BDATE_"-"_EDATE,E=$$START1^APCLDF(%,"APCL(")
  1. I $D(APCL(1)) D
  1. .Q:LMAM>$P(APCL(1),U)
  1. .S LMAM=$P(APCL(1),U)
  1. K APCL S %=P_"^LAST DX V76.12;DURING "_BDATE_"-"_EDATE,E=$$START1^APCLDF(%,"APCL(")
  1. I $D(APCL(1)) D
  1. .Q:LMAM>$P(APCL(1),U)
  1. .S LMAM=$P(APCL(1),U)
  1. K APCL S %=P_"^LAST PROCEDURE 87.37;DURING "_BDATE_"-"_EDATE,E=$$START1^APCLDF(%,"APCL(")
  1. I $D(APCL(1)) D
  1. .Q:LMAM>$P(APCL(1),U)
  1. .S LMAM=$P(APCL(1),U)
  1. Q $S(LMAM]"":"Yes "_$$FMTE^XLFDT(LMAM),1:"No")
  1. ;
  1. MAMMOG1(P,BDATE,EDATE) ;for radiology 4.5+ or until qman can handle taxonomies for radiology procedures
  1. ;
  1. ;IHS/ANMC/LJF 8/26/99 new code to look for all mammograms no matter
  1. ; how they are spelled in file 71 - for Rad version 4.5+
  1. NEW APCLMAM,CODE,COUNT,IEN,X
  1. S CODE=$O(^DIC(40.7,"C",72,0)) I 'CODE Q "No <never recorded>"
  1. S IEN=0 F S IEN=$O(^RAMIS(71,IEN)) Q:'IEN D
  1. . Q:$G(^RAMIS(71,IEN,"I")) ;inactive
  1. . Q:'$D(^RAMIS(71,IEN,"STOP","B",CODE)) ;no mamm stop code
  1. . S COUNT=$G(COUNT)+1,APCLMAM(COUNT)=$P(^RAMIS(71,IEN,0),U)
  1. ;
  1. ; -- use data fetcher to find mammogram dates
  1. NEW APCLY,APCLSAV,APCLX,APCLNAM
  1. S (APCLSAV,APCLX)=0 F S APCLX=$O(APCLMAM(APCLX)) Q:'APCLX D
  1. . S %=P_"^LAST RAD "_APCLMAM(APCLX)_";DURING "_BDATE_"-"_EDATE,E=$$START1^APCLDF(%,"APCLY(")
  1. . ; save latest date and procedure name
  1. . I $G(APCLY(1)),$P(APCLY(1),U)>APCLSAV S APCLSAV=$P(APCLY(1),U),APCLNAM=APCLMAM(APCLX)
  1. ;
  1. ; -- return results
  1. I APCLSAV'=0 Q APCLSAV
  1. ;IHS/ANMC/LJF 8/26/99 end of new code
  1. ;
  1. Q ""
  1. ;