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

GMRAPAT.m

Go to the documentation of this file.
  1. GMRAPAT ;HIRMFO/WAA-Select a patient for ART System ;10/8/96 15:19
  1. ;;4.0;Adverse Reaction Tracking;**5**;Mar 29, 1996
  1. PAT ;Select a patient from the patient file
  1. ; Return list:
  1. ; DFN = If DFN is null patient DFN from the patient file
  1. ;
  1. S GMRAOUT=0
  1. W ! S DIC="^DPT(",DIC(0)="AEQM" D ^DIC
  1. I +Y'>0 S GMRAOUT=1 Q
  1. S DFN=+Y,GMRADOD=$P($G(^DPT(DFN,.35)),U)
  1. ;check if patient is deceased
  1. I GMRADOD]"" D
  1. .W !!?5,$C(7),"NOTE: This patient is deceased (",$$FMTE^XLFDT(GMRADOD),").",!!
  1. .D HANGT^GMRAPEH0
  1. .Q
  1. K GMRADOD
  1. Q
  1. REACT(DFN) ;Select a patient reaction
  1. ;
  1. Q:'$D(DFN)
  1. N GMRAL
  1. S GMRAOUT=0,GMRAL=""
  1. D LIST(DFN,.GMRAL)
  1. I GMRAL D EN1^GMRADSP0(.GMRAL) Q:GMRAOUT
  1. E W !?10,"This patient has no allergy/adverse reaction data."
  1. Q
  1. LIST(DFN,GMRA) ;Get all the reaction for a patient
  1. N GMRAPA
  1. S (GMRAPA,GMRA)=0
  1. F S GMRAPA=$O(^GMR(120.8,"B",DFN,GMRAPA)) Q:GMRAPA<1 D
  1. .Q:$G(^GMR(120.8,GMRAPA,0))=""
  1. .Q:+$G(^GMR(120.8,GMRAPA,"ER"))
  1. .D PASS^GMRADPT(GMRAPA,.GMRA)
  1. .I 'GMRA S GMRA=1
  1. .Q
  1. Q