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

XUSRB2.m

Go to the documentation of this file.
  1. XUSRB2 ;SFISC/RWF - RPC Broker Kernel Utilities. ;1/30/08 11:37
  1. ;;8.0;KERNEL;**115,150,277,337,469**;Jul 10, 1995;Build 16
  1. ;Per VHA Directive 2004-038, this routine should not be modified.
  1. Q
  1. ;
  1. DIVGET(RET,IEN) ;Get Division data
  1. ;IEN is userid (DUZ or username) for future use.
  1. N %,XUDIV
  1. S XUDIV=0,%=$$CHKDIV^XUS1(.XUDIV) ;Get users div.
  1. I (%>0)&($P(%,U,2)'>0) D UPDIV(+%) ;Set users default div.
  1. S RET(0)=XUDIV ;RET(0) is number of divisions.
  1. I XUDIV S %=0 D S RET(0)=XUDIV
  1. . ;RET(%) is divison array eg. ien;station name;station#
  1. . F S %=$O(XUDIV(%)) Q:(%'>0) S RET(%)=XUDIV(%)
  1. Q
  1. DIVSET(RET,DIV) ;Set users Division
  1. S RET=0,DIV=$$FIND1^DIC(200.02,","_DUZ_",","MX",$G(DIV))
  1. Q:DIV'>0
  1. N X
  1. I '$D(^VA(200,DUZ,2,DIV,0)) Q
  1. S RET=1 ;1=set, 0=not set
  1. D UPDIV(+DIV) ;Update Sign-on log
  1. Q
  1. ;
  1. UPDIV(V) ;Update the Sign-on Log & DUZ(2)
  1. N IX
  1. S DUZ(2)=V
  1. S IX=$G(^XUTL("XQ",$J,0)) I IX S $P(^XUSEC(0,IX,0),U,17)=DUZ(2)
  1. Q
  1. ;
  1. USERINFO(RET) ;generic user information for seeding VistaUser object.
  1. ;Entry point for 'XUS GET USER INFO' RPC
  1. N %,XU1,XU5
  1. S RET(0)=DUZ
  1. F %=1:1:6 S RET(%)="unk"
  1. I DUZ'>0 S XWBSEC="User not fully sign-on" Q
  1. S XU1=^VA(200,DUZ,0),XU5=$G(^(5))
  1. S RET(1)=$P(XU1,"^") ;.01 User name.
  1. S RET(2)=$$NAME^XUSER(DUZ) ;Return standard name.
  1. S RET(3)=DUZ(2)_"^"_$$NS^XUAF4(DUZ(2))
  1. S %=+$P(XU1,U,9),RET(4)=$P($G(^DIC(3.1,%,0)),U) ;Title
  1. S %=+XU5,RET(5)=$P($G(^DIC(49,%,0)),U) ;Service/Section
  1. S RET(6)=$G(DUZ("LANG")) ;User language
  1. S RET(7)=DTIME ;Users DTIME
  1. S RET(8)=$$VPID^XUPS(DUZ) ;Return VPID
  1. Q