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

GMRAOR3.m

Go to the documentation of this file.
  1. GMRAOR3 ;HIRMFO/RM,WAA-ORDERABLE LIST UTILITIES ; 11/29/07 12:17pm
  1. ;;4.0;Adverse Reaction Tracking;**13,41**;Mar 29, 1996;Build 8
  1. ;;THIS ROUTINE IS NO LONGER IN USE THUS THE REFERENCES TO PHARMACY
  1. ;;GLOBALS DO NOT NEED TO BE REMOVED
  1. ;;THIS ROUTINE MAY BE DELETED ON SOME FUTURE DATE
  1. ;
  1. EN1(START,NUM,ARRAY) ; ENTRY POINT WHERE ALL VARIABLES ARE OPTIONAL.
  1. ; START IS THE STARTING POINT OF LIST TO BE RETURNED, NUM IS
  1. ; THE NUMBER OF ENTRIES FROM STARTING POINT TO INCLUDE IN LIST,
  1. ; AND ARRAY IS THE ADDRESS OF THE ARRAY LIST IS TO BE RETURNED.
  1. ;
  1. K:$G(START)="" START ; Force list to start at "A" and skip num./punc.
  1. S START=$G(START,"A"),NUM=$G(NUM),ARRAY=$G(ARRAY,"GMRALST")
  1. K ^TMP($J,"GMRALST")
  1. NODE ;Loop through each file in order of X-ref.
  1. ;
  1. ; Loop through GMR Allergies file.
  1. S GMRAST=START
  1. F GMRACNT=1:1 Q:NUM&(GMRACNT>NUM) S GMRAST=$O(^GMRD(120.82,"B",GMRAST)) Q:GMRAST="" S GMRAIEN=$O(^(GMRAST,"")) I GMRAIEN>0 D FILE("ALL",0)
  1. ;
  1. ; Loop through VA Drug Class file.
  1. ; THIS ROUTINE IS NOT IN USE THUS THE DIRECT PHARMACY READ DOES NOT
  1. ; NEED TO BE UPDATED
  1. S GMRAST=START
  1. F GMRACNT=1:1 Q:NUM&(GMRACNT>NUM) S GMRAST=$O(^PS(50.605,"C",GMRAST)) Q:GMRAST="" S GMRAIEN=$O(^(GMRAST,"")) I GMRAIEN>0 D FILE("PSC",0)
  1. ;
  1. ; Loop through NDF File (B X-ref)
  1. ; $$B^PSNAPIS returns NDF version dependent root of "B" x-ref
  1. ; THIS ROUTINE IS NOT IN USE THUS THE DIRECT PHARMACY READ DOES NOT
  1. ; NEED TO BE UPDATED
  1. S GMRAST=START
  1. F GMRACNT=1:1 Q:NUM&(GMRACNT>NUM) S GMRAST=$O(@($$B^PSNAPIS)@(GMRAST)) Q:GMRAST="" S GMRAIEN=$O(^(GMRAST,"")) I GMRAIEN>0 D FILE("NDF",0)
  1. ;
  1. ; Loop through NDF file (T X-ref)
  1. ; $$T^PSNAPIS returns NDF version dependent root of "T" x-ref
  1. ; THIS ROUTINE IS NOT IN USE THUS THE DIRECT PHARMACY READ DOES NOT
  1. ; NEED TO BE UPDATED
  1. S GMRAST=START K ^TMP($J,"GMRAT")
  1. F GMRACNT=1:1 Q:NUM&(GMRACNT>NUM) S GMRAST=$O(@($$T^PSNAPIS)@(GMRAST)) Q:GMRAST="" S GMRAIEN=$$TGTOG^PSNAPIS(GMRAST) I GMRAIEN>0 D FILE("NDF",1)
  1. ; Set the return array.
  1. S GMRACNT=1,GMRAST="" F S GMRAST=$O(^TMP($J,"GMRALST",GMRAST)) Q:GMRAST="" D I NUM'="" Q:GMRACNT>NUM
  1. .S @ARRAY@(GMRACNT)=^TMP($J,"GMRALST",GMRAST),GMRACNT=GMRACNT+1
  1. .Q
  1. K ^TMP($J,"GMRALST"),^TMP($J,"GMRAT"),GMRACNT,GMRAIEN,GMRAST
  1. Q
  1. FILE(GMRATAB,GMRAT) ;File away a found entry
  1. ; GMRATAB is the table entry in from OE3 HL7 spec.
  1. ; GMRAT is (0/1) indicating whether to check for dups of same entry.
  1. ;
  1. I GMRAT Q:$D(^TMP($J,"GMRAT",GMRAIEN)) S ^(GMRAIEN)=""
  1. I '$D(^TMP($J,"GMRALST",GMRAST)) S ^(GMRAST)=GMRAIEN_U_GMRAST_U_"99"_GMRATAB
  1. K GMRAT,GMRATAB
  1. Q