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

MAGDQR71.m

Go to the documentation of this file.
  1. MAGDQR71 ;WOIFO/MLH,NST,PMK - Imaging RPCs for Query/Retrieve - acc# scan (new); Feb 15, 2022@10:26:54
  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. ; called by MAGDQR07
  1. ;
  1. ACCNEW(REQ,T,P,ACC) ;look in the new database structure
  1. ; Add patient DFN and Study IEN to ^TMP("MAG",$J,"QR",6) in format
  1. ; ^TMP("MAG",$J,"QR",6,"N^"_MAGD0_"^"_STUDYIX)
  1. ; where MAGD0 is patient DFN
  1. ; STUDYIX is IEN in IMAGE STUDY file (#2005.62)
  1. ;
  1. N PROQIX,TMPQ,I,PROBLEM61,V
  1. S TMPQ=$NA(^TMP("MAG",$J,"QR")) K @TMPQ@(5)
  1. S I=$$MATCHD^MAGDQR03(REQ(T,P),"^RADPT(""ADC"",LOOP)","@TMPQ@(5,LOOP)") ; Radiology lookup
  1. S I=$$MATCHD^MAGDQR03(REQ(T,P),"^RADPT(""ADC1"",LOOP)","@TMPQ@(5,LOOP)") ; Radiology lookup
  1. ;
  1. ; check accession number for inaccessible or artifact not on file - P305 PMK 12/06/2021
  1. S PROBLEM61=0,PROCIX="" ; procedure level indexed by accession number
  1. F S PROCIX=$O(^MAGV(2005.61,"B",ACC,PROCIX)) Q:'PROCIX D
  1. . I $$PROBLEM61^MAGDSTA8(PROCIX) S PROBLEM61=1 ; patient not available - quit
  1. . Q
  1. I 'PROBLEM61 D
  1. . S I=$$MATCHD^MAGDQR03(REQ(T,P),"^MAGV(2005.61,""B"",LOOP)","@TMPQ@(5,LOOP)")
  1. . Q
  1. ;
  1. S V="" F S V=$O(@TMPQ@(5,V)) Q:V="" D ; V is an accession number
  1. . S:$$ADDSTUDY^MAGDQR74(V,$NA(@TMPQ@(6)),"") ACC=1
  1. . Q
  1. Q