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

GMRAOR0.m

Go to the documentation of this file.
  1. GMRAOR0 ;HIRMFO/WAA,FPT-OERR HL7 UTILITY ; 2/9/95
  1. ;;4.0;Adverse Reaction Tracking;**4**;Mar 29, 1996
  1. DUPCHK(DFN,GMRALL) ;CHECK FOR DUPS
  1. ;Input variable:
  1. ; DFN = Patient DFN
  1. ; GMRALL = Free text of allergy
  1. ;
  1. ;return variable:
  1. ; GMRAFLG = (0,1,-1)
  1. ; 0 Patient has no matching reactions on file
  1. ; 1 Patient has a matching reaction.
  1. ; -1 Patient has a matching reaction but is E/E
  1. ;
  1. ;********************************************************************
  1. N GMRAFLG,GMRAPA
  1. S GMRAFLG=0,GMRAPA=0
  1. ;Loop through all the patient's reaction and look for matches
  1. F S GMRAPA=$O(^GMR(120.8,"B",DFN,GMRAPA)) Q:GMRAPA<1 D Q:GMRAFLG=1
  1. .Q:GMRALL'=$P($G(^GMR(120.8,GMRAPA,0)),U,2) ;Not a match
  1. .I +$G(^GMR(120.8,GMRAPA,"ER")) S GMRAFLG=-1 Q ;E/E
  1. .S GMRAFLG=1 ;Matching allergy.
  1. .Q
  1. Q GMRAFLG