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

MAGGTUP.m

Go to the documentation of this file.
  1. MAGGTUP ;WOIFO/GEK/SG/NST/JSL - Imaging System User preferences ; 07 Mar 2011 2:14 PM
  1. ;;3.0;IMAGING;**7,8,48,45,59,93,94,117,122**;Mar 19, 2002;Build 92;Aug 02, 2012
  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. GET(MAGRY,CODE) ;RPC [MAGGUPREFGET] Call to Get user preferences.
  1. ;
  1. N Y,PRFIEN,J,X,Z,NODE,MAGPREF
  1. N $ETRAP,$ESTACK S $ETRAP="D ERRA^MAGGTERR"
  1. K MAGRY
  1. S MAGRY(0)="0^Error: Attempting to access user preference"
  1. S PRFIEN=$O(^MAG(2006.18,"AC",DUZ,""))
  1. ; if first time user
  1. I 'PRFIEN S PRFIEN=$$NEWUSER(DUZ) Q:PRFIEN=-1
  1. ; merge default settings into User's Preferences
  1. D MERGE(PRFIEN)
  1. ; This returns the users default Filter, and creates filters if needed.
  1. S $P(^MAG(2006.18,PRFIEN,"LISTWIN1"),"^",3)=$$DFTFLT^MAGGSFLT(DUZ)
  1. S MAGRY(0)="1^User Preferences returned."
  1. ;
  1. ; At This point. Then entry in 2006.18 for User DUZ in complete
  1. ; it has been merged with defaults, and has a valid Default Filter.
  1. ;
  1. ; if caller only wants one node, get it then quit.
  1. I $L($G(CODE)) S MAGRY($O(MAGRY(""),-1)+1)=CODE_"^"_$G(^MAG(2006.18,PRFIEN,CODE)) Q
  1. ;
  1. ; loop through User Pref file, returning all nodes.
  1. ; Next line was Un-Commented out. BUT Clients before Patch 8 need it.
  1. S MAGRY($O(MAGRY(""),-1)+1)="SYS^"_^MAG(2006.18,PRFIEN,0)
  1. S NODE=""
  1. F S NODE=$O(^MAG(2006.18,PRFIEN,NODE)) Q:(NODE="") D
  1. . S MAGRY($O(MAGRY(""),-1)+1)=NODE_"^"_^MAG(2006.18,PRFIEN,NODE)
  1. Q
  1. MERGE(PRFIEN) ; Merge default settings into User Prefs returned.
  1. ; This will assure the User Prefs returned have values for New fields.
  1. ; PRFIEN = IEN in IMAGING USER PREFERENCES File.
  1. N NODE,DARR,MN,YN
  1. D DFLTARR(.DARR)
  1. S NODE="" F S NODE=$O(DARR($J,NODE)) Q:(NODE="") D
  1. . S YN=DARR($J,NODE)
  1. . S MN=$G(^MAG(2006.18,PRFIEN,NODE))
  1. . F J=1:1:$L(YN,"^") I ($P(YN,"^",J)'=""),($P(MN,"^",J)="") S $P(MN,"^",J)=$P(YN,"^",J)
  1. . S ^MAG(2006.18,PRFIEN,NODE)=MN
  1. ;
  1. Q
  1. SAVE(MAGRY,DATA) ;RPC [MAGGUPREFSAVE] Call to save User Preferences
  1. ;
  1. S MAGRY="0^Error: Saving user preferences."
  1. N X,Y,NODE,PRFIEN,J
  1. N $ETRAP,$ESTACK S $ETRAP="D ERR^MAGGTERR"
  1. S PRFIEN=$O(^MAG(2006.18,"AC",DUZ,"")) I 'PRFIEN S PRFIEN=$$NEWUSER(DUZ) Q:PRFIEN=-1
  1. S NODE="" F S NODE=$O(DATA(NODE)) Q:NODE="" D
  1. . S X=$G(^MAG(2006.18,PRFIEN,NODE))
  1. . S Y=DATA(NODE)
  1. . F J=1:1:$L(Y,"^") I $L($P(Y,"^",J)) S $P(X,"^",J)=$P(Y,"^",J)
  1. . S ^MAG(2006.18,PRFIEN,NODE)=X
  1. S MAGRY="1^User Preferences saved."
  1. Q
  1. NEWUSER(USER) ;Returns IEN of New entry in IMAGING USER PREFERENCES File.
  1. K DD,DO
  1. N DIC
  1. S X=$E($$GET1^DIQ(200,USER_",",.01),1,15)_" (SETTING 1)"
  1. S DIC="^MAG(2006.18,",DIC(0)="L"
  1. S DIC("DR")="1////"_USER_";2////12;3////12;" D FILE^DICN
  1. I Y=-1 Q Y
  1. D DEFAULT(+Y)
  1. Q +Y
  1. DEFAULT(NEWPREF) ;Setup a new IMAGING USER PREFERENCES entry, with System defaults.
  1. ; NEWPREF = IEN in IMAGING USER PREFERENCES File
  1. N DFTPREF,N0,DFTSET
  1. S DFTPREF=+$$GET1^DIQ(2006.1,$$PLACE^MAGBAPI(DUZ(2)),100,"I") ; DBI - SEB 9/20/2002
  1. I DFTPREF,$D(^MAG(2006.18,DFTPREF)) D DEFUSER(NEWPREF,DFTPREF) Q
  1. ; save the User name, Setting Name
  1. S N0=$P(^MAG(2006.18,NEWPREF,0),U,1,4)
  1. D DFLTARR(.DFTSET)
  1. M ^MAG(2006.18,NEWPREF)=DFTSET($J)
  1. ; reset User name, Setting name.
  1. S $P(^MAG(2006.18,NEWPREF,0),U,1,4)=N0
  1. Q
  1. DEFUSER(NEWPREF,DFTPREF) ;Merge New User preference with the Default User as defined
  1. ; in the Imaging Site Parameters file
  1. ; NEWPREF = new IMAGING USER PREFERENCE (IEN)
  1. ; DFLTPREF = DEFAULT USER PREFERENCE in the IMAGING SITE PARAMETERS File
  1. ;
  1. N X0
  1. S X0=$P(^MAG(2006.18,NEWPREF,0),"^",1,4)
  1. M ^MAG(2006.18,NEWPREF)=^MAG(2006.18,DFTPREF)
  1. S $P(^MAG(2006.18,NEWPREF,0),"^",1,4)=X0
  1. ; remove default user's default Filter from new user's preferences.
  1. S $P(^MAG(2006.18,NEWPREF,"LISTWIN1"),"^",3)=""
  1. Q
  1. DFLTARR(ARR) ; Return an Array of All Default settings
  1. K ARR($J)
  1. S ARR($J,0)="^^^^0^1^1^"
  1. S ARR($J,"DICOMWIN")="2^320^292^724^487"
  1. S ARR($J,"IMAGEGRID")="2^487^2^786^426^1^35,73,67,34,110,46,69,96,76,79,25,0,0^1^"
  1. S ARR($J,"REPORT")="2^2^333^722^437^Courier^^10"
  1. S ARR($J,"RADLISTWIN")="2^487^10^433^172^0"
  1. S ARR($J,"MAIN")="2^1^1^487^172^1"
  1. S ARR($J,"ABS")="2^1^160^486^326^134^113^1^1^3^24^2^1^0"
  1. S ARR($J,"FULL")="2^310^282^714^487^674^447^^1^1^4^1^0^1"
  1. S ARR($J,"GROUP")="2^24^231^427^457^110^70^^1^2^24^2^1^0"
  1. S ARR($J,"DOC")="2^298^24^729^429^0^0^3^1^2^4^2^0"
  1. S ARR($J,"CAPCONFIG")="1^1^1^0^0^0^0^1^0^1^0^0^1^1^0^0^1^1^1^1^1^1^200^400^300^100^500^0^0^1^0^1"
  1. ; 1 2 3 4 5 6 7 8 9 0 1 2 3 456 7 8
  1. S ARR($J,"CAPTIU")="261^414^455^654^66^67^280^1^1^~^1^100^-12^^^1^1^^"
  1. S ARR($J,"RIVER")="1^0^0^0^0"
  1. S ARR($J,"APPMSG")="0^0^"
  1. S ARR($J,"APPPREFS")="1^7^7^10^^0^0^0^1^0" ; SET $P 9 =1 for Deleted Image Placeholder default
  1. S ARR($J,"LISTWIN1")="0^0^^1^0"
  1. ;--- MAG*3*93
  1. S ARR($J,"IEDIT")="2^445^295^710^433"
  1. S ARR($J,"ISTYLE")="0^0^1^1^1^3^1^1^0^1^1^1^,101,460,288,2,2,288,298,259,160,"
  1. S ARR($J,"IVERIFY")="2^184^56^1201^871^1^0^1^1^44,139,0,0,0,42,0,0,0,0,0,0,0,0,0,58,0,,"
  1. ;
  1. ; MAG*3.0*94
  1. S ARR($J,"EKG")="2^1^1^600^400^0"
  1. ; MAG*3.0*122
  1. S ARR($J,"ANNOTCAPTURE")="Arial^0^36^5^32768^159^0^35^35^0^0"
  1. S ARR($J,"ANNOTDISPLAY")="Arial^0^36^5^32768^159^0^35^35^0^0^1"
  1. Q