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

MAGDQR22.m

Go to the documentation of this file.
  1. MAGDQR22 ;WOIFO/EdM,MLH - Pt ID / SSN logic for C-FIND - find matching rad studies in new DB structure ; 23 Dec 2011 12:55 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. PATSSNNU(P,REQ,RESULT,MAGDUZ,PAT,SSN,UID,FD,LD,ERROR,FATAL) ; Generate response data to pt ID / SSN query from new DB structure - called from PATSSN^MAGDQR20
  1. N PATIX,PATREC,PATDFN,PROCIX,STYIX,STYDATE,SERIX,SOPIX,SOPQUIT,SERQUIT
  1. S FD=$G(FD),LD=$G(LD)
  1. S PATIX="" F S PATIX=$O(^MAGV(2005.6,"B",P,PATIX)) Q:'PATIX D
  1. . S PATREC=$G(^MAGV(2005.6,PATIX,0)) Q:PATREC="" Q:$P(PATREC,"^",3)'="D"
  1. . S PATDFN=$P(PATREC,"^",1)
  1. . S PROCIX="" F S PROCIX=$O(^MAGV(2005.61,"C",PATIX,PROCIX)) Q:'PROCIX D
  1. . . Q:$P($G(^MAGV(2005.61,PROCIX,0)),"^",5)'="A" ; not active
  1. . . S STYIX="" F S STYIX=$O(^MAGV(2005.62,"C",PROCIX,STYIX)) Q:'STYIX D
  1. . . . S STYDATE=$P($G(^MAGV(2005.62,STYIX,2)),"^",1)
  1. . . . I STYDATE Q:FD&(STYDATE<FD) Q:LD&(STYDATE>LD) ; study out of date range (if specified)
  1. . . . Q:$P($G(^MAGV(2005.62,STYIX,5)),"^",2)="I" ; study marked inaccessible
  1. . . . S SERIX="" F S SERIX=$O(^MAGV(2005.63,"C",STYIX,SERIX)) Q:'SERIX D Q:$G(SERQUIT)
  1. . . . . S SOPIX="" F S SOPIX=$O(^MAGV(2005.64,"C",SERIX,SOPIX)) Q:'SOPIX D Q:$G(SOPQUIT)
  1. . . . . . D RESULT^MAGDQR03("N",.REQ,RESULT,SOPIX,MAGDUZ,PATDFN,0,0,.ERROR,.FATAL)
  1. . . . . . S SOPQUIT=1 ; always true for study & series level query - adjust later for SOP level
  1. . . . . . Q
  1. . . . . S SERQUIT=1 ; always true for study level query - adjust later for series, SOP level
  1. . . . . Q
  1. . . . Q
  1. . . Q
  1. . Q
  1. Q