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

MAGDRA3.m

Go to the documentation of this file.
  1. MAGDRA3 ;WOIFO/LB - Routine to lookup patient by casenumber of name ; 05 Apr 2011 8:50 AM
  1. ;;3.0;IMAGING;**49**;Mar 19, 2002;Build 2033;Apr 07, 2011
  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. ASK() ;Prompt user
  1. N DIR,X,Y
  1. S DIR(0)="F:1:30",DIR("A")="Enter patient or case number"
  1. S DIR("?")="Enter a patient name or case number to associate this image."
  1. D ^DIR
  1. Q Y
  1. READ(RESULT) ;
  1. N ANS
  1. S RESULT=0,ANS=$$ASK
  1. I ANS=""!(ANS="^") S RESULT="^" Q RESULT
  1. I ANS?1.5N!(ANS?6N1"-".N)!(ANS?3N1"-"6N1"-".N) D CASE(ANS,.RESULT) I +RESULT Q RESULT
  1. I ANS?1.8N Q RESULT ;Incomplete ssn sent. Couldn't be a case number?
  1. D:ANS'?.N1"-".E PAT(ANS,.RESULT)
  1. Q RESULT
  1. CASE(CASE,RESULT) ;
  1. N MAGXR,MAGDFN,MAGDTI,MAGCNI,ARESULT
  1. S MAGXR=$S($L(CASE,"-")>1:"RAAPI",1:"AE")
  1. I MAGXR="RAAPI",$$ACCFIND^RAAPI(CASE,.ARESULT)>0 S RESULT=$TR(ARESULT(1),"^","~")
  1. I MAGXR="AE",$D(^RADPT(MAGXR,CASE)) D
  1. . S MAGDFN=$O(^RADPT(MAGXR,CASE,0))
  1. . S MAGDTI=$O(^RADPT(MAGXR,CASE,MAGDFN,0))
  1. . S MAGCNI=$O(^RADPT(MAGXR,CASE,MAGDFN,MAGDTI,0))
  1. . S RESULT=MAGDFN_"~"_MAGDTI_"~"_MAGCNI
  1. Q
  1. PAT(PAT,RESULT) ;
  1. N DIR,X,Y
  1. S DIR(0)="P^70:EMZ",DIR("B")=PAT
  1. D ^DIR
  1. S RESULT=Y
  1. Q