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

APCLPDBL.m

Go to the documentation of this file.
  1. APCLPDBL ; IHS/CMI/LAB - Routine to send bulletin if patient has certain PRE-DM test results ;
  1. ;;2.0;IHS PCC SUITE;**5,11**;MAY 14, 2009;Build 58
  1. ;
  1. Q ;not at top
  1. EN(T,P,V,RES) ;EP - Called by PD mumps x-ref on Results Field (.04)of V Lab File
  1. NEW APCLTNAM,APCLIFGT,APCLIGTT,XMB
  1. S APCLTNAM=$P(^LAB(60,T,0),U) ;test name
  1. S APCLIFGT=$O(^ATXLAB("B","DM AUDIT FASTING GLUCOSE TESTS",0)) ;FBS taxonomy ien
  1. S APCLIGTT=$O(^ATXLAB("B","DM AUDIT 75GM 2HR GLUCOSE",0)) ;2 hr GTT taxonomy ien
  1. Q:APCLIFGT=""
  1. Q:APCLIGTT=""
  1. I $D(^ATXLAB(APCLIFGT,21,"B",T)) S XMB="APCL IFG NOTIFICATION"
  1. I $D(^ATXLAB(APCLIGTT,21,"B",T)),RES>139 S XMB="APCL IGT NOTIFICATION"
  1. Q:$G(XMB)']""
  1. I 'P,$D(BLRVADFN) S P=BLRVADFN
  1. Q:$$DMDX(P)="Yes" ;quit if pt has DM dx
  1. I $G(P) S XMB(1)=$P(^DPT(P,0),U)
  1. I $D(^AUPNVSIT(V)) D
  1. .S D=$P(^AUPNVSIT(V,0),U),XMB(2)=$$FMTE^XLFDT(D)
  1. .S XMB(3)=$P(^DIC(4,$P(^AUPNVSIT(V,0),U,6),0),U) ;location of visit
  1. .S XMB(4)=$$COMMRES^AUPNPAT(P,"E") ;current community
  1. .S XMB(5)=$P($G(^AUPNPAT(P,41,DUZ(2),0)),U,2)
  1. .S XMB(6)=$$DOB^AUPNPAT(P,"E") ;DOB
  1. .S XMB(7)=APCLTNAM
  1. .S XMB(8)=RES
  1. .S XMDUZ=.5
  1. .S XMDT=DT
  1. .D ^XMB
  1. ;K XMB,V,D,COMM,HRN,DOB,T,APCLIFGT,APCLIGTT,RES,APCLTNAM,APCLX
  1. Q
  1. ;
  1. DMDX(P) ;
  1. ;check problem list OR must have 3 diagnoses
  1. N Z S Z=$O(^ATXAX("B","SURVEILLANCE DIABETES",0))
  1. I 'Z Q ""
  1. N X,Y,I S (X,Y,I)=0 F S X=$O(^AUPNPROB("AC",P,X)) Q:X'=+X!(I) I $D(^AUPNPROB(X,0)),$P(^AUPNPROB(X,0),U,12)'="D" S Y=$P(^AUPNPROB(X,0),U) I $$ICD^ATXAPI(Y,Z,9) S I=1
  1. I I Q "Yes"
  1. NEW APCLX,E
  1. S APCLX=""
  1. S X=P_"^LAST 3 DX [SURVEILLANCE DIABETES" S E=$$START1^APCLDF(X,"APCLX(") G:E DMX I $D(APCLX(3)) S APCLX="Yes"
  1. I $G(APCLX)="" S APCLX="No"
  1. DMX ;
  1. Q APCLX
  1. ;