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

XUSERNEW.m

Go to the documentation of this file.
  1. XUSERNEW ;SF/RWF - ADD NEW USER ;5/13/08 17:19
  1. ;;8.0;KERNEL;**16,49,134,208,157,313,351,419,467,480**;Jul 10, 1995;Build 0
  1. ;;Per VHA Directive 2004-038, this routine should not be modified
  1. ;In the call to NEW^XM for new users the variable XMZ must be undef.
  1. ;on a reactivation XMZ should be set to the current max message number.
  1. EN ;Add
  1. N Y,XUN,DR,DIE,DA,DTOUT,DIWF,XMDT,XMM,XMZ
  1. S Y=$$ADD("","",1) G EXIT:Y'>0,RE:$P(Y,U,3)'=1
  1. S XUN=+Y ;XU USER ADD called in $$ADD
  1. S DR="["_$$GET^XUPARAM("XUNEW USER","N")_"]"
  1. S DIE=200,DA=XUN D XUDIE^XUS5 G:$D(DTOUT) EXIT
  1. I $$GET1^DIQ(200,XUN_",",11,"I")="" W !,"Without a VERIFY code the user will not be able to sign-on!",$C(7),!
  1. S Y=XUN K XMZ D NEW^XM K XMDT,XMM,XMZ
  1. ;ACCESS LETTER, Also see XUSERBLK
  1. W ! D LETTER(XUN,1)
  1. K DIR,DIWF,XUTEXT
  1. ;
  1. ;Fall in from above, called from REACT
  1. KEYS N DIR,XQHOLD,XQKEY,XQDA,XQAL,XQ6,XQFL
  1. S DIR(0)="Y",DIR("B")="NO",DIR("A")="Do you wish to allocate security keys" D ^DIR G:$D(DIRUT) EXIT
  1. I Y=1 S XQHOLD(XUN)="",XQKEY(0)=0,XQDA=0,XQAL=1,XQ6="",XQFL="" D KEY^XQ6
  1. ;
  1. ;Check on adding this user to user groups
  1. I $P(^VA(200,XUN,0),U,3)'="" D ;Must have access code & mailbox
  1. .N DIR,Y
  1. .S DIR(0)="Y",DIR("B")="NO",DIR("A")="Do you wish to add this user to mail groups" D ^DIR Q:$D(DIRUT)
  1. .I Y=1 D ENLOCAL1^XMVGRP(XUN)
  1. .K XMDUN,XMDUZ,XMV
  1. .Q
  1. ;
  1. EXIT K D0,DA,DDER,DDSFILE,DIE,DIC,DIR,DI,DICR,DIG,DIH,DISYS,DIU,DIV,DIWT,DLAYGO,DR,DQ,K,I,X,X1,XQHOLD,XQKEY,XUN,XUSOLD,XMB,XMZ,Y,Z,XQ6,XQFL,DTOUT
  1. Q
  1. ;
  1. RE ;Jump from new user to reactivate
  1. S XUN=+Y,DIR("A")="This isn't a new user, Want to reactivate?",DIR(0)="Y",DIR("B")="NO"
  1. D ^DIR
  1. G EXIT:$D(DIRUT)!(Y'=1),RE2
  1. ;Reactivate a user
  1. REACT ;SEA/WDE-REACTIVATE A USER
  1. N XUN,XUSOLD,DIE,DIC,DA,DR,FDA
  1. S XUN=+$$LOOKUP^XUSER G EXIT:XUN<0
  1. RE2 S XUSOLD=^VA(200,XUN,0)
  1. S FDA(200,XUN_",",9.2)="@" ;Clear the Termination date
  1. D UPDATE^DIE("E","FDA")
  1. ;Show the screanman form
  1. S DIE=200,DR="["_$$GET^XUPARAM("XUREACT USER","N")_"]",DA=XUN
  1. D XUDIE^XUS5 G:$D(DTOUT) EXIT
  1. I $P(^VA(200,XUN,0),U,3)="" W !!,"No ACCESS CODE has been entered.",$C(7),!
  1. I $P(^VA(200,XUN,0),U,11)>0,$P(^(0),U,11)'>DT W !!,"User is still TERMINATED.",$C(7),!
  1. I $$GET1^DIQ(200,XUN_",",11,"I")="" W !,"Without a VERIFY code the user will not be able to sign-on!",$C(7),!
  1. N DIR
  1. S DIR(0)="Y",DIR("A")="Deny access to old mail messages",DIR("B")="NO",DIR("?")="Enter a 'YES' to restrict access to old mail messages."
  1. D ^DIR G:$D(DIRUT) EXIT
  1. K XMZ S:Y=1 XMZ=+$P(^XMB(3.9,0),"^",3) S Y=XUN D NEW^XM K XMDT,XMM,XMZ
  1. D REACT^XQ84(XUN) ;See if this user's menu trees need to be rebuilt
  1. G KEYS
  1. Q
  1. ;
  1. ADD(NP1,KEYS,NONC) ;Common point to do DIC call for adding a new person.
  1. ;NP1 will be added to the default or what comes from the NPI field or the KSP.
  1. ;KEYS is a list of Keys to give the new person
  1. N DA,DR,DLAYGO,XUITNAME,XUS1,XUS2,DIC,DIE,DIK,NP2,Y
  1. I $G(^XTV(8989.3,1,"NPI"))]"" X ^("NPI") S NP2=DR
  1. S:'$D(NP2) NP2="1;"_$S($D(^XUSEC("XUSPF200",DUZ)):9,1:"9R~")_";4;41.99"
  1. ;";41.99" is for adding National Provider Identifier
  1. S DIC="^VA(200,",DIC(0)="AELMQ",DLAYGO=200,DIC("A")="Enter NEW PERSON's name (Family,Given Middle Suffix): ",DIC("DR")="",XUITNAME=1
  1. D ^DIC S XUS1=Y G AX:(Y'>0)!($P(Y,U,3)'>0)
  1. S DA=+$G(^VA(200,+XUS1,3.1)) I DA,'$G(NONC) D
  1. . W !,"Name components."
  1. . S DIE="^VA(20,",DR="1;2;3;5"
  1. . L +^VA(20,DA,0):60 D ^DIE L -^VA(20,DA,0)
  1. . I $D(Y)!$D(DTOUT) S DA=+XUS1,XUS1=-1
  1. . E S $P(XUS1,U,2)=$P(^VA(200,+XUS1,0),U)
  1. D:XUS1>0
  1. . W !,"Now for the Identifiers."
  1. . S DA=+XUS1,DIE="^VA(200,",DR=NP2_$S($D(NP1):";"_NP1,1:""),DIE("NO^")="OUTOK"
  1. . L +^VA(200,DA,0):60 D ^DIE L -^VA(200,DA,0)
  1. . S:$D(Y)!$D(DTOUT) XUS1=-1
  1. I XUS1<0 D S XUS1=-1
  1. . W !?5,"<'",$P(^VA(200,DA,0),U),"' DELETED>"
  1. . S DIK="^VA(200," D ^DIK
  1. . Q:$P($G(^DIC(3,0)),U)'="USER"!'$D(^DD(3,0))
  1. . S DIK="^DIC(3,",XUS1=$P($G(^DIC(3,DA,0)),U,16) D ^DIK
  1. . Q:'XUS1!($P($G(^DIC(16,0)),U)'="PERSON")!'$D(^DD(16,0))
  1. . S DIK="^DIC(16,",DA=XUS1 D ^DIK
  1. N XUSNPI S XUSNPI=$P($G(^VA(200,DA,"NPI")),"^")
  1. I XUS1>0,+XUSNPI>0 D
  1. . S XUSNPI=$$ADDNPI^XUSNPI("Individual_ID",DA,XUSNPI,$$NOW^XLFDT(),1) ;add NPI to multiple
  1. . ; Initialize field 41.97 to 1 (YES)
  1. . Q:+XUSNPI'>0
  1. . N DIE,DR,DA S DIE="^VA(200,",DA=+XUS1,DR="41.97////1" D ^DIE
  1. . Q
  1. I XUS1>0,$D(KEYS) F XUS2=1:1 S Y=$P(KEYS,",",XUS2) Q:'$L(Y) D
  1. . S %=$$ADD^XQKEY(XUS1,Y) I '% W !,"Key '",Y,"' not allocated"
  1. I XUS1>0 D CALL^XUSERP(+XUS1,1) ;XQOR add
  1. AX Q XUS1
  1. ;
  1. REPRINT ;Reprint letter
  1. S DA=+$$LOOKUP^XUSER G EXIT:DA'>0
  1. D LETTER(DA)
  1. G EXIT
  1. ;
  1. LETTER(XUN,ASK) ;Print access letter
  1. Q:'$G(XUN)
  1. N DIWF,FR,TO,BY,DIR,XUTEXT
  1. S XUTEXT=$$GET^XUPARAM("XUSER COMPUTER ACCOUNT","N"),XUTEXT=$O(^DIC(9.2,"B",XUTEXT,0))
  1. S DIR(0)="Y",DIR("A")="Print User Account Access Letter"
  1. I XUTEXT>0 S Y=1 D:$G(ASK) ^DIR I Y=1 D
  1. . S (XUU,XUU2)="________",DIWF="^DIC(9.2,XUTEXT,1,",DIWF(1)=200,FR=XUN,TO=XUN,BY="NUMBER" D EN2^DIWF
  1. . Q
  1. Q