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

BPXRMIM2.m

Go to the documentation of this file.
  1. BPXRMIM2 ; IHS/MSC/MGH - Handle Computed findings for immunizations. ;18-Apr-2014 15:24;DU
  1. ;;2.0;CLINICAL REMINDERS;**1001,1002**;Feb 04, 2005;Build 15
  1. ;=================================================================
  1. ;This routine is designed to search the immunication forcast
  1. ;data to determine if an immunization is due for a child requiring a
  1. ;series immunization
  1. ;Fixed call to standard call for forecaster
  1. ;1005 Changed and added call to forecaster to display last date done
  1. ;if the reminder is due
  1. ;=====================================================================
  1. GETVAR(BPXTRM) ;EP
  1. ;Get the needed data from the reminder term. This includes the date range
  1. ;the test name(s) and the value to search for
  1. N X,Y,BPXFIND,BPXTYPE,BPXFILE,BPXCOND,BPXOFF,BPXVAL,BPXRESLT,BPXLAST
  1. N BPXCNT,BPXHI,TARGET,BPXTEST,TSTRING
  1. S TSTRING=""
  1. K ^TMP("BPXIMM",$J)
  1. S BPXCNT=0,BPXHI=0,BPXRESLT=0
  1. S TODAY=$$DT^XLFDT()
  1. S TARGET="^TMP(""BPXIMM"",$J)"
  1. S BPXFIND=0 F S BPXFIND=$O(^PXRMD(811.5,BPXTRM,20,BPXFIND)) Q:BPXFIND=""!(BPXFIND?1A.A)!(BPXRESLT=1) D
  1. .S BPXTYPE=$P($G(^PXRMD(811.5,BPXTRM,20,BPXFIND,0)),U,1)
  1. .S BPXTEST=$P(BPXTYPE,";",1),BPXFILE=$P(BPXTYPE,";",2)
  1. .Q:BPXFILE'="AUTTIMM("
  1. .S BPXOFF=$P($G(^PXRMD(811.5,BPXTRM,20,BPXFIND,0)),U,8)
  1. .S BPXOFF="-"_BPXOFF
  1. .;Call next routine with patient,start and stop dates,test name
  1. .S BPXRESLT=$$RESULT^BPXRMIM2(DFN,BPXTEST)
  1. I BPXRESLT=1 S TEST=0,VALUE=TEST
  1. I BPXRESLT=0 S TEST=1,VALUE=TEST,DATE=TODAY
  1. Q
  1. RESULT(DFN,TEST) ;Find what is due
  1. ;Search the imunization forecast file to find the chosen immunizations
  1. N BPXFOR,BPXIMM,BPXDONE,BPXSTR,TNAME,BIHX,BIDE,TCODE
  1. S BPXDONE=0
  1. ;Changed called Patch 1004 to standard call for forecaster
  1. S TNAME=$P(^AUTTIMM(TEST,0),U,2),TCODE=$P(^AUTTIMM(TEST,0),U,3)
  1. I TSTRING="" S TSTRING=TCODE
  1. I TSTRING'="" S TSTRING=TSTRING_","_TCODE
  1. ;Call the forecaster code to return the data
  1. D IMMFORC^BIRPC(.BPXSTR,DFN)
  1. F I=1:1 S BPXFOR=$P(BPXSTR,"^",I) Q:BPXFOR="" D
  1. .S BPXIMM=$P(BPXFOR,"|",1)
  1. .;See if the immunization is due
  1. .I BPXIMM[TNAME S BPXDONE=1
  1. .;Find the date last done
  1. .S DATE=$$LASTIMM^BIUTL11(DFN,TSTRING)
  1. Q BPXDONE