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

BPXRMASM.m

Go to the documentation of this file.
  1. BPXRMASM ; IHS/CIA/MGH - Asthma reminders. ;18-Apr-2014 15:23;DU
  1. ;;2.0;CLINICAL REMINDERS;**1001,1002**;Feb 04, 2005;Build 15
  1. ;=================================================================
  1. ;This routine is designed to evaluate the asthma registry information
  1. ;to create the reminders for asthma patients that match the
  1. ;health summary maintenance reminders for asthma patients
  1. ;1004 MODIFIED TO MAKE MORE UNIFORM DATE RETURN FOR ASTHAM PLAN
  1. ;1007 Updated to match the treatment prompts logic
  1. ;=====================================================================
  1. STEROID(DFN,TEST,DATE,VALUE,TEXT) ; EP
  1. ;This computed finding will check to see if steroids should be increased
  1. I '$$HMR1ST^APCHSMAS(DFN) S TEST=1,DATE=DT,TEXT="Not a candidate for this reminder" Q
  1. E S TEST=0,DATE=DT,TEXT="If this patient has asthma, consider adding or increasing this patient's inhaled corticsteroids."
  1. Q
  1. PRIMARY(DFN,TEST,DATE,VALUE,TEXT) ; EP
  1. ;This computed finding will check to see if this asthma patient has a primary provider
  1. N CIADOB,CIASEX,X1,X2,CIAAGE
  1. S TEST=0,DATE="",TEXT="",VALUE=""
  1. I $P($G(^AUPNPAT(DFN,0)),U,14)]"" S TEST=1,DATE=DT,TEXT="PROVIDER FOUND" Q
  1. NEW APCHPRV
  1. D WHPCP^BDPAPI(DFN,.APCHPRV)
  1. I $G(APCHPRV("DESIGNATED PRIMARY PROVIDER"))]"" S TEST=1,DATE=DT,TEXT="PROVIDER FOUND" Q
  1. I '$$HMR5ST^APCHSMAS(DFN) S TEST=1,DATE=DT,TEXT="Does not meet criteria for reminder" Q
  1. E S TEST=0,DATE=DT,TEXT="No primary provider found"
  1. Q
  1. SEVERITY(DFN,TEST,DATE,VALUE,TEXT) ; EP
  1. ;This computed finding will check to see if the asthma patient has
  1. ;had a severity indicated
  1. N CIASTAT,X
  1. I $$LASTASCL^APCHSMAS(DFN,1)]"" S TEST=1,DATE=DT,TEXT="ASTHMA SEVERITY DOCUMENTED" Q ;asthma severity documented
  1. I '$$HMR4ST^APCHSMAS(DFN) S TEST=1,DATE=DT,TEXT="NOT A CANDIDATE FOR ASTHMA SEVERITY" ;not a candidate so reminder is resolved
  1. E S TEST=0,DATE=DT,TEXT="ASTHMA SEVERITY NOT DOCUMENTED" ; severity is NOT documented
  1. Q
  1. PLAN(DFN,TEST,DATE,VALUE,TEXT) ; EP
  1. ;This computed finding will check to see if the patient has an asthma plan
  1. ;in place
  1. ;IHS/MSC/MGH Changed to match treatment plan logic
  1. N APCHICAR,Y
  1. S APCHICAR=$$LASTITEM^APCLAPIU(DFN,"ASM-SMP","EDUCATION",,,"A")
  1. I APCHICAR="" S APCHICAR=$$LASTAM^APCHSAST(DFN,3)
  1. S (APCHLAST,Y)=$P(APCHICAR,U,1)
  1. I Y>$$FMADD^XLFDT(DT,-365) S TEST=1,DATE=APCHLAST,VALUE=APCHLAST,TEXT="Asthma plan found in the last year" Q
  1. I '$$HMR2ST^APCHSMAS(DFN) S TEST=1,DATE=DT,TEXT="Not a candidate for asthma plan"
  1. E D
  1. .S TEST=0,DATE=DT,TEXT="No asthma management plan found"
  1. Q
  1. CONTROL(DFN,TEST,DATE,VALUE,TEXT) ;EP
  1. N APCHLAST
  1. I '$$HMR6ST^APCHSMAS(DFN) S TEST=1,DATE=DT,TEXT="Not a candidate for this reminder" Q
  1. S APCHLAST=$$LASTACON^APCHSMAS(DFN,2)
  1. I $$FMDIFF^XLFDT(DT,APCHLAST)<365 S TEST=1,DATE=APCHLAST,VALUE=APCHLAST,TEXT="Asthma control documented"
  1. E S TEST=0,DATE=DT,TEXT="No asthma control documented"
  1. Q
  1. RISK(DFN,TEST,DATE,VALUE,TEXT) ;EP
  1. N APCHSEV
  1. S APCHSEV=$$HMR7ST^APCHSMAS(DFN) ;not a candidate
  1. I 'APCHSEV S TEST=1,DATE=DT,TEXT="Not a candidate for this reminder"
  1. E S TEST=0,DATE=DT,TEXT="Pt at risk for exacerbation"
  1. Q