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

MAGVD006.m

Go to the documentation of this file.
  1. MAGVD006 ;WOIFO/NST,MLH - Imaging functions for Query/Retrieve ; 03 Feb 2012 9:14 AM
  1. ;;3.0;IMAGING;**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. ACCIEN(P,REQ,IARRAY,MAGD0,MAGD1,MAGD2,PROC) ; Function to get IEN & procedure description of all images for an accession #
  1. ; Uses entries from "6" queue built by ACCNUM^MAGDQR07
  1. N TYPE
  1. S TYPE=$P(P,"^",1) Q:"^R^C^N^"'[("^"_TYPE_"^") ; entry from "6" queue
  1. ; switch - build image / group array for old Rad, old Consult or new DB?
  1. D @($S(TYPE="R":"ACCOLD",TYPE="C":"ACCOLD",1:"ACCNEW")_"(.IARRAY,P,.MAGD0,.MAGD1,.MAGD2,.PROC)")
  1. Q
  1. ACCOLD(IARRAY,P,MAGD0,MAGD1,MAGD2,PROC) ; old Rad or old Consult
  1. N TYPE,IMAGE
  1. S TYPE=$P(P,"^",1) I TYPE'="R",TYPE'="C" Q
  1. D ; switch - Radiology or Consult?
  1. . I TYPE="R" D Q ; Radiology Images (old DB structure) case
  1. . . D GETSTDY^MAGVD005(.IARRAY,P,.MAGD0,.MAGD1,.MAGD2,.PROC)
  1. . . S IMAGE=$O(IARRAY(""))
  1. . . Q
  1. . I TYPE="C" D Q ; Consult Images (old DB structure) case
  1. . . ; P = C ^ DFN ^ File# ^ IEN ^ Image# ^ Accession#
  1. . . S IMAGE=$P(P,"^",5) Q:'IMAGE S IARRAY(IMAGE)=""
  1. . . S MAGD0=+$P($G(^MAG(2005,+IMAGE,0)),"^",7) ; Patient
  1. . . S (MAGD1,MAGD2)=0 ; Not a radiology study...
  1. . . Q
  1. . Q
  1. S:$G(IMAGE) PROC=$P($G(^MAG(2005,IMAGE,2)),"^",4)
  1. Q
  1. ACCNEW(IARRAY,P,MAGD0,MAGD1,MAGD2,PROC) ; new DB structure case
  1. N TYPE,STUDYIX,SERIESIX,SOPIX
  1. S TYPE=$P(P,"^",1)
  1. Q:TYPE'="N"
  1. S STUDYIX=$P(P,"^",3) Q:STUDYIX=""
  1. S MAGD0=$P(P,"^",2) ; Patient
  1. S SERIESIX=""
  1. F S SERIESIX=$O(^MAGV(2005.63,"C",STUDYIX,SERIESIX)) Q:'SERIESIX D
  1. . S SOPIX=""
  1. . F S SOPIX=$O(^MAGV(2005.64,"C",SERIESIX,SOPIX)) Q:'SOPIX D
  1. . . S IARRAY(SOPIX)=STUDYIX
  1. . . Q
  1. . Q
  1. S (MAGD1,MAGD2)=0 ; Not a radiology study in the old structure...
  1. S PROC=$P($G(^MAGV(2005.62,STUDYIX,3)),"^",1)
  1. Q