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

MAGXMA.m

Go to the documentation of this file.
  1. MAGXMA ;WOIFO/MLH - Index mapping API routine ; 14 Jan 2004 2:19 PM
  1. ;;3.0;IMAGING;**11**;14-April-2004
  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. ;; | |
  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. FIELD43(XMOD,XSPEC,XPROC) ; API - Determine proc/event based on modality, specialty
  1. ;
  1. ; Input parameters:
  1. ; XMOD Abbreviation for the modality in use (required)
  1. ; XSPEC Specialty index in the IMAGE INDEX FOR SPEC/SUBSPEC File
  1. ; (#2005.84). This is what will be populated into the
  1. ; SPEC/SUBSPEC Field (#44) of the IMAGE File (#2005).
  1. ;
  1. ; Output parameter:
  1. ; .XPROC Associated procedure/event index in the IMAGE INDEX FOR
  1. ; PROC/EVENT File (#2005.85). This can be populated into
  1. ; the PROC/EVENT Field (#43) of the IMAGE File (#2005).
  1. ; If no procedure/event is associated, null is returned unless
  1. ; the function returns an exception code < 0.
  1. ;
  1. ; Function return:
  1. ; 0 Executed normally, found a match
  1. ; 1 Modality XMOD non-null but is not indexed
  1. ; -1 Missing XMOD
  1. ; -2 XSPEC non-null, not found in File #2005.84
  1. ;
  1. I $G(XMOD)="" Q -1
  1. I $G(XSPEC),'$D(^MAG(2005.84,XSPEC)) Q -2
  1. ;
  1. N IMOD ; ---- modality pointer in 2005.872
  1. N ISPEC ; --- specialty multiple pointer in 2005.872
  1. S XPROC=""
  1. ;
  1. S IMOD=$O(^MAG(2005.872,"B",XMOD,""))
  1. I 'IMOD Q 1
  1. I XSPEC]"" S ISPEC=$O(^MAG(2005.872,IMOD,1,"B",XSPEC,"")) I ISPEC S XPROC=$P(^MAG(2005.872,IMOD,1,ISPEC,0),U,2)
  1. E S XPROC=$P(^MAG(2005.872,IMOD,0),U,2)
  1. Q 0