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

MAGDQR74.m

Go to the documentation of this file.
  1. MAGDQR74 ;WOIFO/NST,PMK - Imaging Utilities for Query/Retrieve - acc# scan (new); Feb 15, 2022@10:27:25
  1. ;;3.0;IMAGING;**118,305**;Mar 19, 2002;Build 3
  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. ADD1STD(ACCN,TMPQ) ; Add one Study to temp global by accession number
  1. ; Input parameters
  1. ; ================
  1. ;
  1. ; ACCN - Accession Number
  1. ;
  1. ; Return 0 - nothing added
  1. ; 1 - a record was added
  1. ;
  1. ; TMPQ - reference to an array with studies in format
  1. ; TMPQ("N^"_MAGD0_"^"_STUDYIX)=""
  1. ; where MAGD0 is patient DFN
  1. ; STUDYIX is IEN in IMAGE STUDY file (#2005.62)
  1. ;
  1. N STUDYIX,MAGD0,PATREFIX,PATREFDTA,PROCIX,RESULT
  1. S RESULT=0
  1. S PROCIX=""
  1. F S PROCIX=$O(^MAGV(2005.61,"B",ACCN,PROCIX)) Q:PROCIX="" D
  1. . I $$PROBLEM61^MAGDSTA8(PROCIX) Q ; P305 PMK 12/06/2021
  1. . S PATREFIX=$P($G(^MAGV(2005.61,PROCIX,6)),"^",1) ; Patient Reference
  1. . ; Q:'PATREFIX ; Quit if there is no Patient Reference
  1. . S PATREFDTA=$G(^MAGV(2005.6,PATREFIX,0))
  1. . ; Q:$P(PATREFDTA,"^",3)'="D" ; Quit if it is not DFN
  1. . S MAGD0=$P(PATREFDTA,"^",1) ; DFN
  1. . D:MAGD0'=""
  1. . . S STUDYIX="" F S STUDYIX=$O(^MAGV(2005.62,"C",PROCIX,STUDYIX)) Q:'STUDYIX D
  1. . . . I $$PROBLEM62^MAGDSTA8(STUDYIX) Q ; P305 PMK 12/06/2021
  1. . . . ; Q:$P($G(^MAGV(2005.62,STUDYIX,5)),"^",2)="I" ; study marked inaccessible
  1. . . . S @TMPQ@("N^"_MAGD0_"^"_STUDYIX)="",RESULT=1
  1. . . . Q
  1. . . Q
  1. . Q
  1. Q RESULT
  1. ;
  1. ADDSTUDY(ACCN,TMPQ,TMPQACCN) ; Add all Studies to temp global by accession number
  1. ; Input parameters
  1. ; ================
  1. ;
  1. ; ACCN - Accession Number
  1. ;
  1. ; Return 0 - nothing added
  1. ; 1 - a record was added
  1. ;
  1. ; TMPQ - reference to array with studies in format
  1. ; TMPQ("N^"_MAGD0_"^"_STUDYIX)=""
  1. ; where MAGD0 is patient DFN
  1. ; STUDYIX is IEN in IMAGE STUDY file (#2005.62)
  1. ; TMPQACCN - reference to array with accession numbers in format
  1. ; TMPQACCN(V) where V is accession number
  1. ;
  1. N ACNLIST,I,RESULT,V
  1. S ACNLIST=$$DAYCASE2^MAGJUTL6(ACCN) ; Get Radiology accession numbers
  1. S:ACNLIST="" ACNLIST=ACCN ; not a Radiology accession number
  1. S RESULT=0
  1. F I=1:1:$L(ACNLIST,U) D
  1. . S V=$P(ACNLIST,U,I) ; Accesion Number
  1. . S:TMPQACCN'="" @TMPQACCN@(V)="" ; Add it to an accession numbers list
  1. . S:$$ADD1STD^MAGDQR74(V,TMPQ) RESULT=1
  1. . Q
  1. Q RESULT