1 | DGSEC2 ;ALB/RMO - Display User Access to Patient Record ; 22 JUN 87 1:00 pm
|
---|
2 | ;;5.3;Registration;**391**;Aug 13, 1993
|
---|
3 | I '$D(^XUSEC("DG SECURITY OFFICER",DUZ)) W !!?3,*7,"You do not have the appropriate access privileges to display user access." Q
|
---|
4 | S DIC("A")="Select PATIENT NAME: ",DIC="^DGSL(38.1,",DIC(0)="AEMQ"
|
---|
5 | S DIC("S")="I (+$P(^(0),U,2))!(+$O(^(""D"",0)))",DGSENFLG=""
|
---|
6 | W ! D ^DIC K DIC("A"),DIC("S"),DGSENFLG
|
---|
7 | G Q:Y<0 S DFN=+Y D DTRNG G Q:DGPOP
|
---|
8 | ASKUSR K DGUSR W !!,"Do you want to see when a select user accessed this record" S %=2 D YN^DICN G Q:%<0 S:%=2 DGUSR="ALL" I '% W !!,"Enter 'YES' to display a select user, or 'NO' to display all users." G ASKUSR
|
---|
9 | I '$D(DGUSR) S DIC="^VA(200,",DIC(0)="AEMQ" W ! D ^DIC G Q:Y<0 S DGUSR=+Y
|
---|
10 | S DGPGM="START^DGSEC2",DGVAR="DFN^DGBEGDT^DGENDDT^DGRNG1^DGRNG2^DGUSR" W ! D ZIS^DGUTQ G Q:POP
|
---|
11 | ;
|
---|
12 | START U IO S DGX="",(DGCNT,DGPGE)=0 S:$D(^DPT(DFN,0)) DGNAM=$E($P(^(0),"^",1),1,30),DOB=$P(^(0),"^",3),SSN=$P(^(0),"^",9) D SELUSR:DGUSR,ALLUSR:DGUSR="ALL"
|
---|
13 | ;
|
---|
14 | Q K DFN,DGBEGDT,DGCNT,DGDTE,DGENDDT,DGLNE,DGNAM,DGPGE,DGPOP,DGPGM,DGRNG1,DGRNG2,DGSL0,DGVAR,DGX,POP D CLOSE^DGUTQ
|
---|
15 | Q
|
---|
16 | ;
|
---|
17 | SELUSR D CHKDTE I 'DGCNT W @IOF,!!?5,"User ",$S($D(^VA(200,DGUSR,0)):$P(^(0),"^"),1:DGUSR)," did not access the patient record of",!?5,DGNAM,$S(DGRNG1=DGRNG2:" on "_DGRNG1,1:" during "_DGRNG1_" and "_DGRNG2),"."
|
---|
18 | Q
|
---|
19 | ;
|
---|
20 | ALLUSR F DGUSR=0:0 S DGUSR=$O(^DGSL(38.1,"AU",DFN,DGUSR)) Q:'DGUSR!(DGX="^") D CHKDTE
|
---|
21 | I 'DGCNT W @IOF,!!?5,"No user access logged for the patient record of ",DGNAM,!?5,$S(DGRNG1=DGRNG2:"on "_DGRNG1,1:"during "_DGRNG1_" and "_DGRNG2),"."
|
---|
22 | Q
|
---|
23 | ;
|
---|
24 | CHKDTE F DGDTE=DGENDDT:0 S DGDTE=$O(^DGSL(38.1,"AU",DFN,DGUSR,DGDTE)) Q:'DGDTE!(DGBEGDT<DGDTE) I $D(^DGSL(38.1,DFN,"D",DGDTE,0)) S DGSL0=^(0),DGCNT=DGCNT+1 D HD:'DGPGE!(($Y+4)>IOSL) Q:DGX="^" D PRT
|
---|
25 | Q
|
---|
26 | ;
|
---|
27 | PRT W !,$S($D(^VA(200,DGUSR,0)):$E($P(^(0),"^"),1,20),1:"Unknown") S Y=$P(DGSL0,"^") W ?23 D DT^DIQ
|
---|
28 | W ?46,$S($P(DGSL0,"^",3)]"":$E($P(DGSL0,"^",3),1,20),1:"Unknown"),?70,$P($P(^DD(38.11,4,0),$P(DGSL0,"^",4)_":",2),";",1)
|
---|
29 | Q
|
---|
30 | ;
|
---|
31 | HD D CRCHK Q:DGX="^" W @IOF,!,"Sensitive Patient Access Report for ",DGRNG1," to ",DGRNG2 S DGPGE=DGPGE+1 W ?70,"Page: ",DGPGE
|
---|
32 | K DGLNE S $P(DGLNE,"=",80)="" W !,DGLNE,!,"Run Date : " D H^DGUTL S Y=DGTIME W ?14 D DT^DIQ W ?47,"Social Sec Num: ",$S($D(SSN):SSN,1:"Unknown")
|
---|
33 | W !,"Patient Name: ",$S($D(DGNAM):DGNAM,1:"Unknown"),?47,"Date of Birth : " S Y=$S($D(DOB):DOB,1:"Unknown") D DT^DIQ W !,DGLNE
|
---|
34 | K DGLNE S $P(DGLNE,"-",80)="" W !!,"USER",?23,"DATE ACCESSED",?46,"OPTION/PROTOCOL USED",?70,"INPATIENT",!,DGLNE
|
---|
35 | Q
|
---|
36 | ;
|
---|
37 | CRCHK I DGPGE,$E(IOST,1)="C" W !!,*7,"Press RETURN to continue or '^' to stop " R X:DTIME S DGX=X
|
---|
38 | Q
|
---|
39 | ;
|
---|
40 | DTRNG S DGPOP=0 K DGBEGDT,DGENDDT,DGRNG1,DGRNG2 W !!,"**** Date Range Selection ****"
|
---|
41 | BEGDT W ! S %DT="APEX",%DT("A")=" Beginning DATE : " D ^%DT I Y<0 S DGPOP=1 K %DT Q
|
---|
42 | I $D(DGSDFLG),Y>$P(DGSDFLG,"^",2) W *7," ??" G BEGDT
|
---|
43 | S %DT(0)=Y,DGBEGDT=9999999.9999-(Y-.0001) X ^DD("DD") S DGRNG1=Y
|
---|
44 | ENDDT W ! S %DT="APEX",%DT("A")=" Ending DATE : " D ^%DT I Y<0 S DGPOP=1 K %DT Q
|
---|
45 | I $D(DGSDFLG),Y>$P(DGSDFLG,"^",2) W *7," ??" G ENDDT
|
---|
46 | S DGENDDT=9999999.9999-(Y+.9999) X ^DD("DD") S DGRNG2=Y W ! K %DT Q
|
---|