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

MAGTP008.m

Go to the documentation of this file.
  1. MAGTP008 ;WOIFO/FG,MLH,JSL - TELEPATHOLOGY TAGS ; 17 Apr 2013 2:52 PM
  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. ;***** INITIALIZE SESSION (COLLECT USER INFO)
  1. ; SEE USERINF2^MAGJUTL3
  1. ; RPC: MAGTP GET USER
  1. ;
  1. ; .MAGRY Reference to a variable naming the global to store returned data
  1. ;
  1. ; Input Parameters
  1. ; ================
  1. ; N/A
  1. ;
  1. ; Return Values
  1. ; =============
  1. ;
  1. ; If MAGRY(0) 1st '^'-piece is 0, then an error
  1. ; occurred during execution of the procedure: 0^0^ ERROR explanation
  1. ;
  1. ; Otherwise, the output array is as follows:
  1. ;
  1. ; MAGRY(0) Description
  1. ; ^01: DUZ
  1. ; ^02: NAME
  1. ; ^03: INITIALS
  1. ; ^04: SSN
  1. ; ^05: UserLocalStationNumber
  1. ; ^06: PrimarySiteStationNumber
  1. ; ^07: SiteServiceURL
  1. ; ^08: SiteCode
  1. ; ^09: SiteName
  1. ; ^10: Production account? 0:"NO",1:"YES"
  1. ;
  1. ; MAGRY(1:N) Description
  1. ; LAB DATA file (#63) Security Keys
  1. ;
  1. USERINF(MAGRY) ; RPC [MAGTP GET USER]
  1. K MAGRY
  1. N $ETRAP,$ESTACK S $ETRAP="D ERRA^MAGGTERR"
  1. I +$G(DUZ)=0 S MAGRY(0)="0^0^DUZ Undefined, Null or Zero" Q
  1. I +$G(DUZ(2))=0 S MAGRY(0)="0^0^DUZ(2) Undefined, Null or Zero" Q
  1. N MAGPL,SSUNC,VIXPTR,KEY,CT
  1. ;
  1. S MAGRY(0)=DUZ_U_$$GET1^DIQ(200,DUZ_",",.01)_U_$$GET1^DIQ(200,DUZ_",",1) ; IA #10060
  1. ;
  1. ; Add pieces ^04:^06 for VIX
  1. S MAGRY(0)=MAGRY(0)_U_$$GET1^DIQ(200,DUZ_",",9) ;...SSN ; IA #10060
  1. S MAGRY(0)=MAGRY(0)_U_$$GET1^DIQ(4,DUZ(2),99,"E") ;.UserLocalStationNumber
  1. S MAGRY(0)=MAGRY(0)_U_$P($$SITE^VASITE(),U,3) ;.....PrimarySiteStationNumber
  1. ;
  1. ; Lookup SiteServiceURL
  1. S MAGPL=$$PLACE^MAGBAPI(+$G(DUZ(2))) ; Get place for DUZ(2)
  1. S VIXPTR=$$GET1^DIQ(2006.1,MAGPL,55,"I") ; Net site service
  1. ;
  1. ; Return UNC only if OpStatus is 'online'
  1. I VIXPTR,+$$GET1^DIQ(2005.2,VIXPTR,5,"I") D
  1. . S SSUNC=$$GET1^DIQ(2005.2,VIXPTR,1)
  1. S MAGRY(0)=MAGRY(0)_U_$G(SSUNC) ;...................SiteServiceURL
  1. S MAGRY(0)=MAGRY(0)_U_$$GET1^DIQ(2006.1,MAGPL,.09) ;SiteCode
  1. S MAGRY(0)=MAGRY(0)_U_$$GET1^DIQ(2006.1,MAGPL,.01) ;SiteName
  1. S MAGRY(0)=MAGRY(0)_U_$S($L($T(PROD^XUPROD)):+$$PROD^XUPROD,1:0) ; IA #4440
  1. ;
  1. ; KEYS
  1. S KEY="LR",CT=0 ; Find LAB DATA file keys
  1. F S KEY=$O(^XUSEC(KEY)) Q:$E(KEY,1,2)'="LR" D ; IA #10076
  1. . I $D(^XUSEC(KEY,DUZ)) S CT=CT+1,MAGRY(CT)=KEY ; IA #10076
  1. Q ;
  1. ;
  1. ;+++++ GET THE ABBREVIATION FOR A SITE IEN FROM FILE (#2006.19)
  1. ;
  1. ; SITE Site Number (IEN)
  1. ;
  1. ; Return Value
  1. ; ============
  1. ;
  1. ; ABBR Abbreviation for SITE
  1. ;
  1. GETABBR(SITE) ;
  1. Q:'$G(SITE) ""
  1. N MAGREC,ABBR
  1. S MAGREC=$O(^MAG(2006.19,"D",SITE,""))
  1. S ABBR=$S(MAGREC:$P($G(^MAG(2006.19,MAGREC,0)),U,4),1:"")
  1. Q ABBR