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

MAGDSTAD.m

Go to the documentation of this file.
  1. MAGDSTAD ;WOIFO/PMK - Q/R Retrieve of DICOM images from PACS to VistA ; Sep 10, 2020@10:46:09
  1. ;;3.0;IMAGING;**231**;5-May-2007;Build 9
  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. ; Second Step, get study info from PACS.
  1. ;
  1. ; Issue a PACS Study Root Study Level query (C-FIND) using the
  1. ; the Study Instance UID (0020,000D) as the key.
  1. ; Request the following return data attributes:
  1. ; a. Number of Study Related Series (0020,1206)
  1. ; b. Number of Study Related Instances (0020,1208)
  1. ; c. Series Instance UID(s) (0020,000E)
  1. ;
  1. ; If the study cannot be found on the PACS, then return error.
  1. ;
  1. STUDY(PACSSTUDYUID) ; get the study information
  1. N COUNT,I,RETURN,X
  1. S RETURN=0
  1. K ^TMP("MAG",$J,"Q/R QUERY")
  1. S ^TMP("MAG",$J,"Q/R QUERY",QRSTACK,"STUDY INSTANCE UID(0001)")=PACSSTUDYUID
  1. S ^TMP("MAG",$J,"Q/R QUERY",QRSTACK,"QUERY USER APPLICATION")=$$QRSCP^MAGDSTA8
  1. S ^TMP("MAG",$J,"Q/R QUERY",QRSTACK,"QUERY LEVEL")="STUDY"
  1. S ^TMP("MAG",$J,"Q/R QUERY",QRSTACK,"ROOT")="STUDY"
  1. D SOPUIDQ^MAGDSTV1 ; C-FIND
  1. I $D(^XTMP(MAGXTMP,HOSTNAME,$J,QRSTACK,"MESSAGE","MSG")) D
  1. . S X=$G(^XTMP(MAGXTMP,HOSTNAME,$J,QRSTACK,"MESSAGE","MSG",2))
  1. . I X="No matching PATIENT/STUDY was found" S RETURN=-1 ; study not found
  1. . E S RETURN=-2 ; other errors, also just in case the message changes
  1. . Q
  1. Q RETURN