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

BGPD14.m

Go to the documentation of this file.
  1. BGPD14 ; IHS/CMI/LAB - indicator 14 ;
  1. ;;7.0;IHS CLINICAL REPORTING;;JAN 24, 2007
  1. ;
  1. I14 ;EP ;EP - indicator 14
  1. ;Q:'$D(BGPIND(19))
  1. Q:'BGPDMPAT
  1. S BGPP=$$DENT00(DFN,BGPEDATE)
  1. I BGPP]"" D S(BGPRPT,$S(BGPTIME=1:15,BGPTIME=0:45,BGPTIME=8:85,1:999),17,1)
  1. I $D(BGPLIST(21)),BGPTIME=1 S ^XTMP("BGPD",BGPJ,BGPH,"LIST",21,$S($P($G(^AUPNPAT(DFN,11)),U,18)]"":$P(^AUPNPAT(DFN,11),U,18),1:"UNKNOWN"),$P(^DPT(DFN,0),U,2),BGPAGEE,DFN)=BGPP
  1. Q
  1. S(R,N,P,V) ;
  1. I 'V Q ;no value to add
  1. S $P(^BGPD(R,N),U,P)=$P($G(^BGPD(R,N)),U,P)+V
  1. Q
  1. ;
  1. DNKA(V) ;is this a DNKA visit?
  1. I '$G(V) Q ""
  1. NEW D,N S D=$$PRIMPOV^APCLV(V,"C")
  1. I D=".0860" Q 1
  1. S N=$$PRIMPOV^APCLV(V,"N")
  1. I $E(D)="V",N["DNKA" Q 1
  1. I $E(D)="V",N["DID NOT KEEP APPOINTMENT" Q 1
  1. I $E(D)="V",N["DID NOT KEEP APPT" Q 1
  1. Q 0
  1. DENT00(P,EDATE) ;
  1. NEW BGPG,X,%,E,R,V,BDATE
  1. K BGPG
  1. S BDATE=$$FMADD^XLFDT(EDATE,-365)
  1. S %=P_"^LAST ADA 0000;DURING "_$$FMTE^XLFDT(BDATE)_"-"_$$FMTE^XLFDT(EDATE),E=$$START1^APCLDF(%,"BGPG(")
  1. I $D(BGPG(1)) Q "Yes - "_$$FMTE^XLFDT($P(BGPG(1),U))
  1. ;look for dental clinic or dental provider visit date
  1. K BGPG
  1. K ^TMP($J,"A")
  1. S A="^TMP($J,""A"",",B=P_"^ALL VISITS;DURING "_$$FMTE^XLFDT(BDATE)_"-"_$$FMTE^XLFDT(EDATE),E=$$START1^APCLDF(B,A)
  1. NEW X,Y S X=0,Y="" F S X=$O(^TMP($J,"A",X)) Q:X'=+X!(Y]"") I $$CLINIC^APCLV($P(^TMP($J,"A",X),U,5),"C")=56,'$$DNKA($P(^TMP($J,"A",X),U,5)) S Y="Yes - "_$$FMTE^XLFDT($P(^TMP($J,"A",X),U))
  1. I Y]"" Q Y
  1. S X=0,Y="" F S X=$O(^TMP($J,"A",X)) Q:X'=+X!(Y]"") I $$PRIMPROV^APCLV($P(^TMP($J,"A",X),U,5),"D")=52,'$$DNKA($P(^TMP($J,"A",X),U,5)) S Y="Yes - "_$$FMTE^XLFDT($P(^TMP($J,"A",X),U))
  1. Q Y
  1. Q ""