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

MAGUE002.m

Go to the documentation of this file.
  1. MAGUE002 ;WOIFO/MLH - database encapsulation - radiology order record ; 29 Feb 2012 5:50 PM
  1. ;;3.0;IMAGING;**54,118**;Mar 19, 2002;Build 4525;May 01, 2013
  1. ;; Per VHA Directive 2004-038, this routine should not be modified.
  1. ;; +---------------------------------------------------------------+
  1. ;; | Property of the US Government. |
  1. ;; | No permission to copy or redistribute this software is given. |
  1. ;; | Use of unreleased versions of this software requires the user |
  1. ;; | to execute a written test agreement with the VistA Imaging |
  1. ;; | Development Office of the Department of Veterans Affairs, |
  1. ;; | telephone (301) 734-0100. |
  1. ;; | The Food and Drug Administration classifies this software as |
  1. ;; | a medical device. As such, it may not be changed in any way. |
  1. ;; | Modifications to this software may result in an adulterated |
  1. ;; | medical device under 21CFR820, the use of which is considered |
  1. ;; | to be a violation of US Federal Statutes. |
  1. ;; +---------------------------------------------------------------+
  1. ;;
  1. Q
  1. ;
  1. RORDRR(MAGRRPTI,ERR) ;FUNCTION - return a radiology order record
  1. ; input: MAGRRPTI radiology report index from image record
  1. ; output: ERR error message if couldn't get record
  1. ; function return: radiology order record
  1. ;
  1. N MAGRRPTR ; -- radiology report record
  1. N MAGD0 ; ----- Radiology patient file IEN
  1. N MAGD1 ; ----- date index to order record in rad pt file
  1. N MAGD2 ; ----- subdate index to order record in rad pt file
  1. N V ; --------- scratch var
  1. N MAGRORDR ; -- radiology order record
  1. N MAGRPROC ; -- radiology procedure code
  1. S ERR=""
  1. I MAGRRPTI="" S ERR="5~Radiology report pointer required" Q
  1. S MAGRRPTR=$G(^RARPT(MAGRRPTI,0))
  1. S MAGD0=$P(MAGRRPTR,"^",2)
  1. I 'MAGD0 S ERR="1~Radiology patient not found" Q ""
  1. S MAGD1=9999999.9999-$P(MAGRRPTR,"^",3)
  1. S V=$P(MAGRRPTR,"^",4)
  1. S MAGD2=$O(^RADPT(MAGD0,"DT",MAGD1,"P","B",V,"")) ; IA # 1172
  1. I 'MAGD2 S ERR="3~Order record pointer not found" Q ""
  1. S MAGRORDR=$G(^RADPT(MAGD0,"DT",MAGD1,"P",MAGD2,0)) ; IA # 1172
  1. I 'MAGRORDR S ERR="4~Radiology order record not found" Q ""
  1. S ERR=""
  1. Q MAGRORDR