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

MAGVCAE.m

Go to the documentation of this file.
  1. MAGVCAE ;;WOIFO/MAT - DICOM Storage Commit RPCs ; 23 Oct 2012 3:01 AM
  1. ;;3.0;IMAGING;**138**;Mar 19, 2002;Build 5380;Sep 03, 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. ; Adapted from MAGVRS52 [RPC: MAG DICOM CHECK AE TITLE]
  1. ;
  1. ;##### GET DICOM AE SECURITY MATRIX (#2006.9192) Data for input AE TITLE
  1. ; RPC: MAG DICOM GET AE ENTRY
  1. ;
  1. AENAME(OUT,APPNAME,LOCATION) ;
  1. ; Returns AE Title and Security Matrix information for a given AE Title and Location
  1. N AEIEN,AEINST,MATCH,MSEP,I,LOCIEN,OSEP,STATION,SERVTYPE
  1. I $G(APPNAME)="" S OUT(1)="-1,No Application Name specified" Q
  1. I $G(LOCATION)="" S OUT(1)="-3,No Location specified" Q
  1. S AEIEN=0,MATCH=0,I=1,OSEP="`",MSEP="|",SERVTYPE="^"
  1. ; Loop through all entries - match on AE Instance name and Location
  1. F S AEIEN=$O(^MAGV(2006.9192,AEIEN)) Q:(AEIEN="")!(+AEIEN=0) D
  1. . S AEINST=$G(^MAGV(2006.9192,AEIEN,0))
  1. . S LOCIEN=$P(AEINST,U,3) ; Pointer to INSTITUTION file (#4)
  1. . Q:LOCIEN="" S STATION=$$STA^XUAF4(LOCIEN) ; IA #2171
  1. . I (LOCATION=STATION)&(($P(AEINST,U,1))=APPNAME) D
  1. . . ; If 1st match write all AE Instance info and Service Role
  1. . . I MATCH=0 D AEINST^MAGVRS52(.OUT,AEIEN,AEINST,LOCATION) S OUT(1)=OUT(1)_"SERVICE MESSAGE="
  1. . . S I=I+1
  1. . . S MATCH=MATCH+1
  1. . . ; Add Services and Roles to output
  1. . . D AESECMX^MAGVRS52(.OUT,AEIEN)
  1. . . ;--- Add N-Response Delay (#13) in seconds, N-Response Retries (#14) *79.
  1. . . S OUT(1)=OUT(1)_OSEP_(60*$$GET1^DIQ(2006.9192,AEIEN,13,"I"))
  1. . . S OUT(1)=OUT(1)_OSEP_$$GET1^DIQ(2006.9192,AEIEN,14,"I")
  1. . Q
  1. I MATCH=0 S OUT(1)="-2,No entry for Application Name """_APPNAME_""" at location """_LOCATION_"""."
  1. Q
  1. AENTRYLC(OUT,SERVICE,ROLE,LOCATION) ; RPC = MAG DICOM GET AE ENTRY LOC
  1. ; The RPC will return the AE SEC MX Entry with matching provided service, role, and location fields
  1. N DROLE,DSERVICE,IEN,DSRIEN,DSR,AEDATA,OSEP
  1. S OSEP=$$OUTSEP,IEN=0,OUT(1)=""
  1. I $G(LOCATION)="" S OUT(1)="-2"_OSEP_"No LOCATION provided." Q
  1. I $G(SERVICE)="" S OUT(1)="-2"_OSEP_"No SERVICE provided." Q
  1. I $G(ROLE)="" S OUT(1)="-2"_OSEP_"No ROLE provided." Q
  1. F S IEN=$O(^MAGV(2006.9192,IEN)) Q:(+IEN=0)!(IEN="")!(OUT(1)'="") D
  1. . S AEDATA=$G(^MAGV(2006.9192,IEN,0))
  1. . I LOCATION'=$P(AEDATA,U,3) Q
  1. . N IENS
  1. . S DSRIEN=0
  1. . F S DSRIEN=$O(^MAGV(2006.9192,IEN,3,DSRIEN)) Q:(+DSRIEN=0)!(DSRIEN="")!(OUT(1)'="") D
  1. . . S IENS=DSRIEN_","_IEN_","
  1. . . S DSERVICE=$$GET1^DIQ(2006.919212,IENS,.01)
  1. . . S DROLE=$$GET1^DIQ(2006.919212,IENS,1)
  1. . . I (SERVICE=DSERVICE)&(ROLE=DROLE) D AENTRYLD(IEN)
  1. . . Q
  1. . Q
  1. S:OUT(1)="" OUT(1)="-1"_OSEP_"No title for """_SERVICE_""", """_ROLE_""" at location """_LOCATION_"""."
  1. Q
  1. ;
  1. ;+++++ Entry point from above, which has chosen the entry to process.
  1. ;
  1. AENTRYLD(AEIEN) ;
  1. S AEINST=$G(^MAGV(2006.9192,AEIEN,0))
  1. D AEINST^MAGVRS52(.OUT,AEIEN,AEINST,LOCATION) S OUT(1)=OUT(1)_"SERVICE MESSAGE="
  1. ; Add Services and Roles to output
  1. D AESECMX^MAGVRS52(.OUT,AEIEN)
  1. ;--- Add N-Response Delay (#13) in seconds, N-Response Retries (#14) *79.
  1. S OUT(1)=OUT(1)_OSEP_(60*$$GET1^DIQ(2006.9192,AEIEN,13,"I"))
  1. S OUT(1)=OUT(1)_OSEP_$$GET1^DIQ(2006.9192,AEIEN,14,"I")
  1. Q
  1. ;--- Set separator values.
  1. ;
  1. OUTSEP() ; Separator for output data ie. NAME`DOB
  1. Q "`"
  1. MULTISEP() ; Name value separator for multiple values ie. REJECT=1|WARNING=1
  1. Q "|"
  1. SRSEP() ; Service and Role Separator ie. C-Store^SCU^C-Move^SCP
  1. Q "^"
  1. ;
  1. ; MAGVCAE