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

MAGBAPIP.m

Go to the documentation of this file.
  1. MAGBAPIP ;WOIFO/MLH - Background Processor API to build queues - Modules for place
  1. ;;3.0;IMAGING;**1,7,8,20,59**;Nov 27, 2007;Build 20
  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. ;; | |
  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. DUZ2PLC(WARN) ;Convert DUZ to a PLACE. File 2006.1 entry (PLACE)
  1. ; Extrinsic : Always returns a PLACE
  1. ; WARN : message about where the PLACE was derived from.
  1. ; Compute the Users Institution for older versions of Imaging Display workstation.
  1. ; This is called when DUZ(2) doesn't exist Or Can't resolve DUZ(2)
  1. ; into site param entry. This solved a GateWay Problem where DUZ(2) didn't
  1. ; exist. - Shouldn't get here anymore, that was fixed.
  1. N MAGINST,DIVDTA,PLACE
  1. S MAGINST=0
  1. D GETS^DIQ(200,DUZ,"16*","I","DIVDTA") ; look up Division field
  1. ; ? Any division data on file for this user
  1. I $D(DIVDTA) D ; yes, use it
  1. . S MAGINST=@$Q(DIVDTA),WARN="Using first Division of New Person File."
  1. . Q
  1. E D ; no, use default site param?
  1. . S MAGINST=$$KSP^XUPARAM("INST"),WARN="Using Kernel Site Param default entry." Q
  1. . Q
  1. S PLACE=$$GETPLACE^MAGBAPI(+$$PLACE^MAGBAPI(MAGINST))
  1. I 'PLACE S PLACE=$O(^MAG(2006.1,0)),WARN="Using First Site Param entry."
  1. Q PLACE
  1. ;
  1. DA2PLC(MAGDA,TYPE) ; Get Place from Image File IEN
  1. ; TYPE : Possible values "A" Abstract, "F" Full Res or "B" Big File
  1. ; (defaults to "F" if null)
  1. ; Resolve Place (PLC) using the Acquisition Site field (ACQS)
  1. ; IF ACQS is null or not doesn't exist in the site parameter file
  1. ; THEN Resolve PLC using NetWork Location pointer
  1. ;
  1. N MAGREF,MAG0,FBIG,SITE,PLC,MAGJB
  1. I '$G(MAGDA) Q 0
  1. S SITE=$P($G(^MAG(2005,MAGDA,100)),U,3)
  1. I SITE S PLC=$$PLACE^MAGBAPI(SITE) Q:PLC PLC
  1. ; p59 Stop the error when an Image is Deleted.
  1. S MAG0=$G(^MAG(2005,MAGDA,0)) Q:MAG0="" 0
  1. ;
  1. S TYPE=$E($G(TYPE)_"F",1)
  1. I "AF"[TYPE D
  1. . S MAGREF=$S(TYPE="A":+$P(MAG0,"^",4),1:+$P(MAG0,"^",3))
  1. . I MAGREF=0 S MAGJB=1,MAGREF=+$P(MAG0,"^",5) ; get file from jukebox
  1. I "B"[TYPE D
  1. . S FBIG=$G(^MAG(2005,MAGDA,"FBIG"))
  1. . S MAGREF=+$P(FBIG,"^") ; get file from magnetic disk, if possible
  1. . I MAGREF=0 S MAGREF=+$P(FBIG,"^",2) ; get file from jukebox
  1. I 'MAGREF Q 0
  1. I '$D(^MAG(2005.2,MAGREF,0)) Q 0
  1. Q $$GETPLACE^MAGBAPI(+$$GET1^DIQ(2005.2,MAGREF,.04,"I"))