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

MAGDSTQ9.m

Go to the documentation of this file.
  1. MAGDSTQ9 ;WOIFO/PMK - Study Tracker - Query/Retrieve user ; Feb 15, 2022@10:23:02
  1. ;;3.0;IMAGING;**231,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. ;
  1. ; Supported IA #2056 reference $$GET1^DIQ function call
  1. ; Supported IA #10090 to read LOCATION file (#4)
  1. ;
  1. ;
  1. ; Select the DICOM Service Class Provider
  1. ;
  1. ; Modeled after PICKSCP^MAGDACU on the DICOM Gateway
  1. ;
  1. PICKSCP(DEFAULT,SCPTYPE) ; Pick the SCP for the site
  1. N FOUND,HIT,I,LOCATION,MAGIEN,MAGSCPTYPE,N,NEXT,NEXTDATETIME
  1. N USERAPP,STATNUMB,TARGET,TIMESTAMP,X
  1. S STATNUMB=$$STATNUMB^MAGDFCNV
  1. S DEFAULT=$G(DEFAULT),SCPTYPE=$G(SCPTYPE)
  1. S USERAPP="",(HIT,I)=0
  1. F S USERAPP=$O(^MAG(2006.587,"B",USERAPP)) Q:USERAPP="" D
  1. . S (FOUND,MAGIEN,TIMESTAMP)=""
  1. . F S MAGIEN=$O(^MAG(2006.587,"B",USERAPP,MAGIEN)) Q:MAGIEN="" D
  1. . . S NEXT=^MAG(2006.587,MAGIEN,0)
  1. . . S LOCATION=$P(NEXT,"^",7)
  1. . . S LOCATION=$$GET1^DIQ(4,LOCATION,99,"E") ; compare station numbers
  1. . . I LOCATION'=STATNUMB Q ; ignore entries for other locations
  1. . . S MAGSCPTYPE=$P(NEXT,"^",9)
  1. . . I SCPTYPE'="",SCPTYPE'=MAGSCPTYPE Q ; skip entries for other types
  1. . . S NEXTDATETIME=$P(NEXT,"^",8)
  1. . . I NEXTDATETIME>TIMESTAMP D ; get latest version
  1. . . . S FOUND=NEXT,TIMESTAMP=NEXTDATETIME
  1. . . . Q
  1. . . Q
  1. . I FOUND'="" D
  1. . . S I=I+1,TARGET(I)=FOUND
  1. . . I USERAPP=DEFAULT S HIT=I
  1. . . Q
  1. . Q
  1. S N=I
  1. I N<1 W !!,"No Service Class Providers defined in SCU_LIST.DIC." Q ""
  1. F D Q:X'=""
  1. . W !,"DICOM ",$S(SCPTYPE'="":SCPTYPE_" ",1:""),"Service Class Providers"
  1. . S X=$X W ! F I=1:1:X W "-"
  1. . F I=1:1:N W !,$J(I,3)," -- ",$P(TARGET(I),"^")
  1. . I N=1 W " (selected)" S X=1 Q
  1. . W !!,"Select the provider application (1-",N,"): "
  1. . W:HIT HIT,"// " R X:DTIME E S X="^"
  1. . I X["^" Q ; a caret will terminate the program
  1. . I X="" S X=HIT W X I X="" S X="^" Q
  1. . I (X<1)!(X>N)!'$D(TARGET(X)) W " ??? -- try again",!! S X="" Q
  1. . Q
  1. I X["^" S X=""
  1. I X S X=$P(TARGET(X),"^",1)
  1. Q X