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

DGSEC1.m

Go to the documentation of this file.
  1. DGSEC1 ;ALB/RMO-MAS Security Options ;7/24/99 23:48
  1. ;;5.3;Registration;**222,149,214**;Aug 13, 1993
  1. N I,X,DIK
  1. G:$D(^DOPT("DGSEC1",4)) A S ^DOPT("DGSEC1",0)="Security Menu Options^1N^" F I=1:1 S X=$T(@(I)+1) Q:X="" S ^DOPT("DGSEC1",I,0)=$P(X,";;",2,99)
  1. S DIK="^DOPT(""DGSEC1""," D IXALL^DIK
  1. A N DIC,Y,X
  1. W !! S DIC="^DOPT(""DGSEC1"",",DIC(0)="AEQM" D ^DIC Q:Y<0 D @+Y G A
  1. 1 ;
  1. ;;Enter/Edit Patient Security Level
  1. N DA,DLAYGO,DR,DIC,X,Y
  1. I '$D(^XUSEC("DG SENSITIVITY",DUZ)) W !!?3,$C(7),"You do not have the appropriate access privileges to assign security." Q
  1. S DIC("A")="Select PATIENT NAME: ",DIC="^DGSL(38.1,",DLAYGO=38.1,DIC(0)="AELMQ",DGSENFLG="" W ! D ^DIC K DIC("A"),DGSENFLG Q:Y<0
  1. S DA=+Y
  1. ;
  1. ; warn user if attempting to edit security level from remote source
  1. N SECSRCE,OK
  1. S SECSRCE=$P($G(^DGSL(38.1,DA,0)),"^",5)
  1. I SECSRCE'="" D G:'OK 1
  1. .W !!?3,$C(7),">>> WARNING: The source that assigned this patient's security level"
  1. .W !,?16,"is '"_$S(SECSRCE="AAC":"VBA",1:"UNKNOWN")_"'. Editing the patient security level will"
  1. .W !,?16,"cause the security source to be deleted.",!
  1. .S OK=$$RUSURE()
  1. ;
  1. N SENSBEF,SENSAFTR
  1. S SENSBEF=$P($G(^DGSL(38.1,DA,0)),"^",2)
  1. S DIE="^DGSL(38.1,"
  1. S DR="2;3////"_DUZ_";4///NOW"
  1. I SECSRCE'="",$G(OK) S DR=DR_";5////@"
  1. D ^DIE
  1. K DE,DQ,DIE
  1. S SENSAFTR=$P($G(^DGSL(38.1,DA,0)),"^",2)
  1. ;
  1. ;CIRN CHANGES
  1. I SENSBEF'=SENSAFTR D SECA08^VAFCDD01(DA)
  1. K SENSBEF,SENSAFTR
  1. G 1
  1. ;
  1. BULTIN ;This bulletin is sent if a patient's sensitivity is removed.
  1. N SECSRCE,SUB,DIC,X,Y S SUB=1
  1. K DGB I $D(^DG(43,1,"NOT")),+$P(^("NOT"),"^",11) S DGB=11
  1. Q:'$D(DGB)
  1. S DGB=+$P($G(^DG(43,1,"NOT")),U,DGB) Q:'DGB
  1. S DGB=$P($G(^XMB(3.8,DGB,0)),U) Q:'$L(DGB)
  1. N XMB,XMY,XMY0,XMZ,DGI
  1. S XMB="DG SENSITIVITY REMOVED" S Y=$$NOW^XLFDT() X ^DD("DD") S XMB(7)=Y
  1. S XMB(1)="UNKNOWN",X=+$P(^DGSL(38.1,DA,0),"^",3) I X D
  1. .S DIC="^VA(200,",DIC(0)="MO",X="`"_X D ^DIC
  1. .S:Y>0 XMB(1)=$P(Y,U,2) S:XMB(1)="" XMB(1)="UNKNOWN"
  1. .Q
  1. S XMB(2)=$S($D(^DPT(DA,0)):$P(^(0),"^")_" ("_$P(^(0),"^",9)_")",1:"UNKNOWN")
  1. F DGI=3:1:6 S XMB(DGI)=""
  1. S SECSRCE=$P($G(^DGSL(38.1,DA,0)),"^",5) I SECSRCE'="" D
  1. .S XMB(3)=" >>> WARNING: The source of the patient sensitivity"
  1. .S XMB(4)=" removed was "_$S(SECSRCE="AAC":"VBA",1:"UNKNOWN")
  1. I $D(^DGSL(38.1,DA,0)),'$O(^("D",0)) D
  1. .S XMB(5)="No record of user access, patient should be removed"
  1. .S XMB(6)="from the security log."
  1. S XMY("G."_DGB)="" D SEND^DGSEC(.XMB,.XMY)
  1. Q
  1. 2 ;
  1. ;;Display User Access to Patient Record
  1. G ^DGSEC2
  1. 3 ;
  1. ;;Purge Record of User Access from Security Log
  1. G ^DGSEC3
  1. 4 ;
  1. ;;Purge Non-sensitive Patients from Security Log
  1. I '$D(^XUSEC("DG SECURITY OFFICER",DUZ)) W !!?3,$C(7),"You do not have the appropriate access privileges to purge patients." Q
  1. ASKPUR N %
  1. W !!,"Are you sure you want to purge all non-sensitive patients" S %=2 D YN^DICN G Q:%<0!(%=2)
  1. I '% W !!,"Enter 'YES' to purge non-sensitive patients, or 'NO' to exit this process." G ASKPUR
  1. ;
  1. ASKPRT W !!,"Do you want to print patients as they are purged" S %=2 D YN^DICN G Q:%<0 S DGPRT=$S(%=2:"QUE",1:"") I '% W !!,"Enter 'YES' to print patients being purged, or 'NO' to schedule purge." G ASKPRT
  1. S DGPGM="PURNON^DGSEC1",DGVAR="DGPRT^DUZ" I DGPRT="" W ! D ZIS^DGUTQ G Q:POP,PURNON
  1. I DGPRT="QUE" S ION="" W ! D QUE^DGUTQ G Q
  1. ;
  1. PURNON N DIC,Y
  1. I DGPRT="" S DGCNT=0 W !!,"Purge Non-sensitive Patients from Security Log started " D H^DGUTL S Y=DGTIME D DT^DIQ W ".",!
  1. F DFN=0:0 S DFN=$O(^DGSL(38.1,"ANS",DFN)) Q:'DFN I $D(^DGSL(38.1,DFN,0)),'$P(^(0),"^",2) S DA=DFN,DIK="^DGSL(38.1," D ^DIK I DGPRT="" W !," ...",$S($D(^DPT(DFN,0)):$P(^(0),"^")_" ("_$P(^(0),"^",9)_")",1:"Unknown") S DGCNT=DGCNT+1
  1. I DGPRT="" W !!,"Purge completed " D H^DGUTL S Y=DGTIME D DT^DIQ W ". ","Number of records purged: ",DGCNT
  1. ;
  1. Q K DFN,DGCNT,DGPGM,DGPRT,DGVAR,POP D CLOSE^DGUTQ
  1. Q
  1. ;
  1. ;
  1. RUSURE() ; Description: Asks user if they are sure they want to edit the DG SECURITY LOG record.
  1. ;
  1. N DIR,DIRUT,X,Y
  1. S DIR(0)="Y"
  1. S DIR("A")="Are you sure that you want to edit the patient's security level"
  1. S DIR("B")="NO"
  1. D ^DIR
  1. Q:$D(DIRUT) 0
  1. Q Y