DGSEC4 ;ALB/MM,JAP,LAB,ATG/JPN,ISL/DKA - Utilities for record access & sensitive record processing ;July 6, 2020@21:55
;;5.3;Registration;**249,281,391,471,684,699,964,1130**;Aug 13, 1993;Build 7
;Per VHA Directive 6402, this routine should not be modified.
;
;Line tags OWNREC & SENS moved from DGSEC in DG*5.3*249 when DGSEC
;reached the maximum routine size.
;
PTSEC(RESULT,DFN,DGMSG,DGOPT) ;RPC/API entry point for patient sensitive & record access checks
;Output array (Required)
; RESULT(1)= -1-RPC/API failed
; Required variable not defined
; 0-No display/action required
; Not accessing own, employee, or sensitive record
; 1-Display warning message
; Sensitive and DG SENSITIVITY key holder
; or Employee and DG SECURITY OFFICER key holder
; 2-Display warning message/require OK to continue
; Sensitive and not a DG SENSITIVITY key holder
; Employee and not a DG SECURITY OFFICER key holder
; 3-Access to record denied
; Accessing own record
; 4-Access to Patient (#2) file records denied
; SSN not defined
; RESULT(2-10) = error or display messages
;
;Input parameters: DFN = Patient file entry (Required)
; DGMSG = If 1, generate message (optional)
; DGOPT = Option name^Menu text (Optional)
;
K RESULT
I $G(DFN)="" D Q
.S RESULT(1)=-1
.S RESULT(2)="Required variable missing."
S DGMSG=$G(DGMSG)
D OWNREC(.RESULT,DFN,$G(DUZ),DGMSG)
I RESULT(1)=1 S RESULT(1)=3 Q
I RESULT(1)=2 S RESULT(1)=4 Q
K RESULT
D SENS(.RESULT,DFN,$G(DUZ))
I RESULT(1)=1 D
.I $G(DUZ)="" D Q
..;DUZ must be defined to access sensitive record & update DG Security log
..S RESULT(1)=-1
..S RESULT(2)="Your user code is undefined. This must be defined to access a restricted patient record."
.D SETLOG1^DGSEC(DFN,DUZ,,$G(DGOPT))
;DG*5.3*964 hook to call VistA Audit Solution (VAS) for non-sensitive patient inquiries
I (RESULT(1)=0) I $$GET1^DIQ(46.5,1,.02,"I") D SELAUD^DGAUDIT2(2,$G(DFN),"INQUIRY",$G(DGOPT))
Q
NOTICE(RESULT,DFN,DGOPT,ACTION) ;RPC/API entry point for log entry and message generation
;Input parameters:
; DFN = Patient file DFN
; DGOPT = Option name^Menu text (Optional)
; ACTION = 1 - Set DG Security Log entry, 2 - Generate mail
; message, 3 - Both (Optional - Defaults to both)
;
;Output: RESULT = 1 - DG Security Log updated and/or Sensitive Record msg sent (Determined by ACTION value)
; 0 - Required variable undefined
;
I $G(DFN)="" S RESULT=0 Q
I $G(DUZ)="" S RESULT=0 Q
S DGOPT=$G(DGOPT)
I $G(ACTION)="" S ACTION=3
I ACTION'=1 D BULTIN1^DGSEC(DFN,DUZ,DGOPT)
I ACTION'=2 D SETLOG1^DGSEC(DFN,DUZ,,DGOPT)
S RESULT=1
Q
;
OWNREC(DGREC,DFN,DGDUZ,DGMSG,DGNEWPT,DGPTSSN) ;Determine if user accessing his/her own Patient file (#2) record
;Input:
; DGREC - Array name passed by reference
; DFN - Patient (#2) file IEN
; DGDUZ - New Person (#200) file IEN (Not required. If not sent will return 0.)
; DGMSG - If 1, generate message (Optional) Will default to 1
; DGNEWPT - Set to 1 when adding a new entry to the Patient file
; DGPTSSN - new patient's SSN
; DGNEWPT & DGPTSSN parameters only defined if DPTLK is adding
; a new Patient (#2) file entry
;
;Output:
; DGREC(1)=0 - Not attempting to access own Patient (#2) file record,
; DUZ not defined, RESTRICT PATIENT RECORD ACCESS parameter
; in MAS Parameters (#43) file not set to yes, or user holds
; DG RECORD ACCESS security key.
; =1 - Attempting to access own Patient file record
; =2 - SSN undefined
; =-1 - Required variable not defined.
; Other nodes in array will contain error message text.
;
;DFN required
I '$D(DFN),($G(DGNEWPT)'=1) D Q
.S DGREC(1)=-1
.S DGREC(2)="DFN not defined."
S DGREC(1)=0
;Check if parameter is on
I +$P($G(^DG(43,1,"REC")),U)=0 Q
N DGNPSSN
;I $D(DUZ)=0 Q
I (+$G(DGDUZ))<1 Q
;Check if user holds security key
I $D(^XUSEC("DG RECORD ACCESS",DGDUZ)) Q
I $G(DGMSG)="" S DGMSG=1
N DGNPERR
; quit if user is a proxy user, i.e., not a real person
I $$ACTIVE^XUSAP(DGDUZ),$$USERTYPE^XUSAP(DGDUZ,"CONNECTOR PROXY")!($$USERTYPE^XUSAP(DGDUZ,"APPLICATION PROXY")) Q
S DGNPSSN=$$GET1^DIQ(200,DGDUZ_",",9,"I","","DGNPERR")
I 'DGNPSSN D Q
.S DGREC(1)=2
.S DGREC(2)="Your SSN is missing from the NEW PERSON file. Contact your ADP Coordinator."
.;Only send message if parameter set to 1
.I DGMSG=1 D MSG(DGDUZ)
I +$G(DGNEWPT)'=1 S DGPTSSN=$P($G(^DPT(DFN,0)),U,9)
I +$G(DGNEWPT)=1 S DGPTSSN=$TR(DGPTSSN,"-","")
I DGNPSSN=DGPTSSN D Q
.S DGREC(1)=1
.S DGREC(2)="Security regulations prohibit computer access to your own medical record."
Q
MSG(DGDUZ) ;Send Missing SSN in New Person file message to mailgroup
;Input: DGDUZ - New Person (#200) file IEN (Required)
;
N DGNPERR,DGNPNAME,DGTEXT,XMCHAN,XMDUZ,XMSUB,XMTEXT,XMY,XMZ
S DGNPNAME=$$GET1^DIQ(200,DGDUZ_",",.01,"","DGNPERR")
S XMSUB="MISSING SSN IN NEW PERSON FILE"
S DGTEXT(1)="The following NEW PERSON record does not contain a Social Security Number."
S DGTEXT(2)="This is required to access PATIENT file entries."
S DGTEXT(3)=""
S DGTEXT(4)=$S(DGNPNAME'="":DGNPNAME,1:"UNKNOWN")
S DGTEXT(5)="NEW PERSON (#200) File Internal Entry Number (DUZ): "_+DGDUZ
S DGTEXT(6)=""
S DGTEXT(7)="This message has been sent to DG MISSING NEW PERSON SSN mail group."
S DGTEXT(8)="Please take appropriate action."
S XMTEXT="DGTEXT("
S XMDUZ=$S(DGNPNAME'="":DGNPNAME,1:.5)
S XMY("G.DG MISSING NEW PERSON SSN")=""
S XMCHAN=1
D ^XMD
Q
SENS(DGSENS,DFN,DGDUZ,DDS,DGSENFLG) ;Determine if sensitive record
;Input:
; DGSENS - Array name passed by reference
; DFN - Patient (#2) file IEN (Required)
; DGDUZ - New Person (#200) file IEN
; DDS - Screenman variable
; DGSENFLG - If defined, patient record sensitivity not checked
;
;Output:
; DGSENS(1)=0 - Record is not sensitive or DGSENFLG set
; =1 - Sensitive record and user holds DG SENSITIVITY key
; - Employee and user holds DG SECURITY OFFICER key
; =2 - Sensitive record and user does not hold key
; - Employee and user does not hold key
; =-1 - Required input variable not defined
; If 1, 2 or -1, array will contain error/display message
;
N DGMSG,DGA1,DG1,DGDATE,DGLNE,DGT,DGTIME,DGEMPLEE
;Patient file DFN must be defined.
I '$D(DFN) D Q
.S DGSENS(1)=-1
.S DGSENS(2)="DFN not defined."
S DGSENS(1)=0
I $D(DGSENFLG) Q
;Determine if patient is employee
S DGEMPLEE=$$EMPL(DFN)
;Quit if not an employee & not found in DG Security Log file
I 'DGEMPLEE,('$D(^DGSL(38.1,+DFN,0))) Q
;Quit if not an employee and not flagged as sensitive
I 'DGEMPLEE,($P($G(^DGSL(38.1,+DFN,0)),U,2)'=1) Q
;DUZ & user name must be defined
S DGMSG=$S('$G(DGDUZ):"user code",'$D(^VA(200,DGDUZ,0)):"user name",1:"")
I DGMSG'="" D Q
.S DGSENS(1)=-1
.S DGSENS(2)="Your "_DGMSG_" is undefined. This must be defined to access"
.S DGSENS(3)=" a restricted patient record."
S DGSENS(1)=1
;Inpatient check - no longer used (kept for future reference)
;D H^DGUTL S DGT=DGTIME D ^DGPMSTAT
S DGSENS(2)="***WARNING***"
I $G(DDS)'="" S DGSENS(2)=DGSENS(2)_" ***RESTRICTED RECORD***"
I $G(DDS)="" S DGSENS(3)="***RESTRICTED RECORD***"
I DGEMPLEE,('$D(^XUSEC("DG SECURITY OFFICER",+$G(DGDUZ)))) D Q
.S DGSENS(1)=2
.D PRIV
I '$D(^XUSEC("DG SENSITIVITY",+$G(DGDUZ))) D
.S DGSENS(1)=2
.D PRIV
Q
PRIV ;Privacy Act statement for DGSENS array
I $G(DDS)="" S DGSENS(4)=""
S DGSENS(5)="1. STOP"
S DGSENS(6)="2. Confirm you need access to this Restricted patient record"
S DGSENS(7)=""
S DGSENS(8)="This record is protected by the Privacy Act of 1974 and the Health"
S DGSENS(9)="Insurance Portability and Accountability Act (HIPAA) Privacy Rule."
S DGSENS(10)=" * Access to this patient record is tracked and monitored."
S DGSENS(11)=" * You must have need for this record to accomplish officially"
S DGSENS(12)=" authorized and assigned duties, such as direct patient care, to"
S DGSENS(13)=" proceed."
S DGSENS(14)=" * You must provide justification for your access upon request."
S DGSENS(15)=" * Failure to comply may result in disciplinary or adverse action up to"
S DGSENS(16)=" and including removal from Federal service, and civil and criminal"
S DGSENS(17)=" penalties."
I $G(DDS)="" S DGSENS(18)=""
Q
EMPL(DFN,DGCHELIG) ;Does patient have any eligibility codes equal to
; EMPLOYEE
;Input:
; DFN - Patient (#2) file IEN (required).
; DGCHELIG - Flags to determine mode of execution (optional).
; Value of the parameter can contain any combination
; of the following characters:
; "P" - check primary eligibility code
; "S" - check secondary eligibility codes
;
; If this parameter is either not defined or set to an
; illegal value, the value of "PS" will be assumed.
;Output:
; 1 - Patient has EMPLOYEE as an eligibility code
; 0 - Patient doesn't have EMPLOYEE as an eligibility code
;
;Notes: EMPLOYEE is entry 14 in the MAS ELIGIBILITY CODE file (#8.1)
N DGELIG,DGEMPLEE
S DGEMPLEE=0
I $G(DGCHELIG)'["P",$G(DGCHELIG)'["S" S DGCHELIG="PS"
;Check primary eligibility
I DGCHELIG["P" D
.S DGELIG=+$G(^DPT(DFN,.36))
.I $D(^DIC(8,"D",14,DGELIG)) S DGEMPLEE=1
;Check secondary eligibilities (if needed)
I DGCHELIG["S",'DGEMPLEE D
.S DGELIG=0
.F S DGELIG=+$O(^DPT("AEL",DFN,DGELIG)) Q:'DGELIG I $D(^DIC(8,"D",14,DGELIG)) S DGEMPLEE=1 Q
Q DGEMPLEE
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HDGSEC4 9963 printed Dec 13, 2024@02:58:56 Page 2
DGSEC4 ;ALB/MM,JAP,LAB,ATG/JPN,ISL/DKA - Utilities for record access & sensitive record processing ;July 6, 2020@21:55
+1 ;;5.3;Registration;**249,281,391,471,684,699,964,1130**;Aug 13, 1993;Build 7
+2 ;Per VHA Directive 6402, this routine should not be modified.
+3 ;
+4 ;Line tags OWNREC & SENS moved from DGSEC in DG*5.3*249 when DGSEC
+5 ;reached the maximum routine size.
+6 ;
PTSEC(RESULT,DFN,DGMSG,DGOPT) ;RPC/API entry point for patient sensitive & record access checks
+1 ;Output array (Required)
+2 ; RESULT(1)= -1-RPC/API failed
+3 ; Required variable not defined
+4 ; 0-No display/action required
+5 ; Not accessing own, employee, or sensitive record
+6 ; 1-Display warning message
+7 ; Sensitive and DG SENSITIVITY key holder
+8 ; or Employee and DG SECURITY OFFICER key holder
+9 ; 2-Display warning message/require OK to continue
+10 ; Sensitive and not a DG SENSITIVITY key holder
+11 ; Employee and not a DG SECURITY OFFICER key holder
+12 ; 3-Access to record denied
+13 ; Accessing own record
+14 ; 4-Access to Patient (#2) file records denied
+15 ; SSN not defined
+16 ; RESULT(2-10) = error or display messages
+17 ;
+18 ;Input parameters: DFN = Patient file entry (Required)
+19 ; DGMSG = If 1, generate message (optional)
+20 ; DGOPT = Option name^Menu text (Optional)
+21 ;
+22 KILL RESULT
+23 IF $GET(DFN)=""
Begin DoDot:1
+24 SET RESULT(1)=-1
+25 SET RESULT(2)="Required variable missing."
End DoDot:1
QUIT
+26 SET DGMSG=$GET(DGMSG)
+27 DO OWNREC(.RESULT,DFN,$GET(DUZ),DGMSG)
+28 IF RESULT(1)=1
SET RESULT(1)=3
QUIT
+29 IF RESULT(1)=2
SET RESULT(1)=4
QUIT
+30 KILL RESULT
+31 DO SENS(.RESULT,DFN,$GET(DUZ))
+32 IF RESULT(1)=1
Begin DoDot:1
+33 IF $GET(DUZ)=""
Begin DoDot:2
+34 ;DUZ must be defined to access sensitive record & update DG Security log
+35 SET RESULT(1)=-1
+36 SET RESULT(2)="Your user code is undefined. This must be defined to access a restricted patient record."
End DoDot:2
QUIT
+37 DO SETLOG1^DGSEC(DFN,DUZ,,$GET(DGOPT))
End DoDot:1
+38 ;DG*5.3*964 hook to call VistA Audit Solution (VAS) for non-sensitive patient inquiries
+39 IF (RESULT(1)=0)
IF $$GET1^DIQ(46.5,1,.02,"I")
DO SELAUD^DGAUDIT2(2,$GET(DFN),"INQUIRY",$GET(DGOPT))
+40 QUIT
NOTICE(RESULT,DFN,DGOPT,ACTION) ;RPC/API entry point for log entry and message generation
+1 ;Input parameters:
+2 ; DFN = Patient file DFN
+3 ; DGOPT = Option name^Menu text (Optional)
+4 ; ACTION = 1 - Set DG Security Log entry, 2 - Generate mail
+5 ; message, 3 - Both (Optional - Defaults to both)
+6 ;
+7 ;Output: RESULT = 1 - DG Security Log updated and/or Sensitive Record msg sent (Determined by ACTION value)
+8 ; 0 - Required variable undefined
+9 ;
+10 IF $GET(DFN)=""
SET RESULT=0
QUIT
+11 IF $GET(DUZ)=""
SET RESULT=0
QUIT
+12 SET DGOPT=$GET(DGOPT)
+13 IF $GET(ACTION)=""
SET ACTION=3
+14 IF ACTION'=1
DO BULTIN1^DGSEC(DFN,DUZ,DGOPT)
+15 IF ACTION'=2
DO SETLOG1^DGSEC(DFN,DUZ,,DGOPT)
+16 SET RESULT=1
+17 QUIT
+18 ;
OWNREC(DGREC,DFN,DGDUZ,DGMSG,DGNEWPT,DGPTSSN) ;Determine if user accessing his/her own Patient file (#2) record
+1 ;Input:
+2 ; DGREC - Array name passed by reference
+3 ; DFN - Patient (#2) file IEN
+4 ; DGDUZ - New Person (#200) file IEN (Not required. If not sent will return 0.)
+5 ; DGMSG - If 1, generate message (Optional) Will default to 1
+6 ; DGNEWPT - Set to 1 when adding a new entry to the Patient file
+7 ; DGPTSSN - new patient's SSN
+8 ; DGNEWPT & DGPTSSN parameters only defined if DPTLK is adding
+9 ; a new Patient (#2) file entry
+10 ;
+11 ;Output:
+12 ; DGREC(1)=0 - Not attempting to access own Patient (#2) file record,
+13 ; DUZ not defined, RESTRICT PATIENT RECORD ACCESS parameter
+14 ; in MAS Parameters (#43) file not set to yes, or user holds
+15 ; DG RECORD ACCESS security key.
+16 ; =1 - Attempting to access own Patient file record
+17 ; =2 - SSN undefined
+18 ; =-1 - Required variable not defined.
+19 ; Other nodes in array will contain error message text.
+20 ;
+21 ;DFN required
+22 IF '$DATA(DFN)
IF ($GET(DGNEWPT)'=1)
Begin DoDot:1
+23 SET DGREC(1)=-1
+24 SET DGREC(2)="DFN not defined."
End DoDot:1
QUIT
+25 SET DGREC(1)=0
+26 ;Check if parameter is on
+27 IF +$PIECE($GET(^DG(43,1,"REC")),U)=0
QUIT
+28 NEW DGNPSSN
+29 ;I $D(DUZ)=0 Q
+30 IF (+$GET(DGDUZ))<1
QUIT
+31 ;Check if user holds security key
+32 IF $DATA(^XUSEC("DG RECORD ACCESS",DGDUZ))
QUIT
+33 IF $GET(DGMSG)=""
SET DGMSG=1
+34 NEW DGNPERR
+35 ; quit if user is a proxy user, i.e., not a real person
+36 IF $$ACTIVE^XUSAP(DGDUZ)
IF $$USERTYPE^XUSAP(DGDUZ,"CONNECTOR PROXY")!($$USERTYPE^XUSAP(DGDUZ,"APPLICATION PROXY"))
QUIT
+37 SET DGNPSSN=$$GET1^DIQ(200,DGDUZ_",",9,"I","","DGNPERR")
+38 IF 'DGNPSSN
Begin DoDot:1
+39 SET DGREC(1)=2
+40 SET DGREC(2)="Your SSN is missing from the NEW PERSON file. Contact your ADP Coordinator."
+41 ;Only send message if parameter set to 1
+42 IF DGMSG=1
DO MSG(DGDUZ)
End DoDot:1
QUIT
+43 IF +$GET(DGNEWPT)'=1
SET DGPTSSN=$PIECE($GET(^DPT(DFN,0)),U,9)
+44 IF +$GET(DGNEWPT)=1
SET DGPTSSN=$TRANSLATE(DGPTSSN,"-","")
+45 IF DGNPSSN=DGPTSSN
Begin DoDot:1
+46 SET DGREC(1)=1
+47 SET DGREC(2)="Security regulations prohibit computer access to your own medical record."
End DoDot:1
QUIT
+48 QUIT
MSG(DGDUZ) ;Send Missing SSN in New Person file message to mailgroup
+1 ;Input: DGDUZ - New Person (#200) file IEN (Required)
+2 ;
+3 NEW DGNPERR,DGNPNAME,DGTEXT,XMCHAN,XMDUZ,XMSUB,XMTEXT,XMY,XMZ
+4 SET DGNPNAME=$$GET1^DIQ(200,DGDUZ_",",.01,"","DGNPERR")
+5 SET XMSUB="MISSING SSN IN NEW PERSON FILE"
+6 SET DGTEXT(1)="The following NEW PERSON record does not contain a Social Security Number."
+7 SET DGTEXT(2)="This is required to access PATIENT file entries."
+8 SET DGTEXT(3)=""
+9 SET DGTEXT(4)=$SELECT(DGNPNAME'="":DGNPNAME,1:"UNKNOWN")
+10 SET DGTEXT(5)="NEW PERSON (#200) File Internal Entry Number (DUZ): "_+DGDUZ
+11 SET DGTEXT(6)=""
+12 SET DGTEXT(7)="This message has been sent to DG MISSING NEW PERSON SSN mail group."
+13 SET DGTEXT(8)="Please take appropriate action."
+14 SET XMTEXT="DGTEXT("
+15 SET XMDUZ=$SELECT(DGNPNAME'="":DGNPNAME,1:.5)
+16 SET XMY("G.DG MISSING NEW PERSON SSN")=""
+17 SET XMCHAN=1
+18 DO ^XMD
+19 QUIT
SENS(DGSENS,DFN,DGDUZ,DDS,DGSENFLG) ;Determine if sensitive record
+1 ;Input:
+2 ; DGSENS - Array name passed by reference
+3 ; DFN - Patient (#2) file IEN (Required)
+4 ; DGDUZ - New Person (#200) file IEN
+5 ; DDS - Screenman variable
+6 ; DGSENFLG - If defined, patient record sensitivity not checked
+7 ;
+8 ;Output:
+9 ; DGSENS(1)=0 - Record is not sensitive or DGSENFLG set
+10 ; =1 - Sensitive record and user holds DG SENSITIVITY key
+11 ; - Employee and user holds DG SECURITY OFFICER key
+12 ; =2 - Sensitive record and user does not hold key
+13 ; - Employee and user does not hold key
+14 ; =-1 - Required input variable not defined
+15 ; If 1, 2 or -1, array will contain error/display message
+16 ;
+17 NEW DGMSG,DGA1,DG1,DGDATE,DGLNE,DGT,DGTIME,DGEMPLEE
+18 ;Patient file DFN must be defined.
+19 IF '$DATA(DFN)
Begin DoDot:1
+20 SET DGSENS(1)=-1
+21 SET DGSENS(2)="DFN not defined."
End DoDot:1
QUIT
+22 SET DGSENS(1)=0
+23 IF $DATA(DGSENFLG)
QUIT
+24 ;Determine if patient is employee
+25 SET DGEMPLEE=$$EMPL(DFN)
+26 ;Quit if not an employee & not found in DG Security Log file
+27 IF 'DGEMPLEE
IF ('$DATA(^DGSL(38.1,+DFN,0)))
QUIT
+28 ;Quit if not an employee and not flagged as sensitive
+29 IF 'DGEMPLEE
IF ($PIECE($GET(^DGSL(38.1,+DFN,0)),U,2)'=1)
QUIT
+30 ;DUZ & user name must be defined
+31 SET DGMSG=$SELECT('$GET(DGDUZ):"user code",'$DATA(^VA(200,DGDUZ,0)):"user name",1:"")
+32 IF DGMSG'=""
Begin DoDot:1
+33 SET DGSENS(1)=-1
+34 SET DGSENS(2)="Your "_DGMSG_" is undefined. This must be defined to access"
+35 SET DGSENS(3)=" a restricted patient record."
End DoDot:1
QUIT
+36 SET DGSENS(1)=1
+37 ;Inpatient check - no longer used (kept for future reference)
+38 ;D H^DGUTL S DGT=DGTIME D ^DGPMSTAT
+39 SET DGSENS(2)="***WARNING***"
+40 IF $GET(DDS)'=""
SET DGSENS(2)=DGSENS(2)_" ***RESTRICTED RECORD***"
+41 IF $GET(DDS)=""
SET DGSENS(3)="***RESTRICTED RECORD***"
+42 IF DGEMPLEE
IF ('$DATA(^XUSEC("DG SECURITY OFFICER",+$GET(DGDUZ))))
Begin DoDot:1
+43 SET DGSENS(1)=2
+44 DO PRIV
End DoDot:1
QUIT
+45 IF '$DATA(^XUSEC("DG SENSITIVITY",+$GET(DGDUZ)))
Begin DoDot:1
+46 SET DGSENS(1)=2
+47 DO PRIV
End DoDot:1
+48 QUIT
PRIV ;Privacy Act statement for DGSENS array
+1 IF $GET(DDS)=""
SET DGSENS(4)=""
+2 SET DGSENS(5)="1. STOP"
+3 SET DGSENS(6)="2. Confirm you need access to this Restricted patient record"
+4 SET DGSENS(7)=""
+5 SET DGSENS(8)="This record is protected by the Privacy Act of 1974 and the Health"
+6 SET DGSENS(9)="Insurance Portability and Accountability Act (HIPAA) Privacy Rule."
+7 SET DGSENS(10)=" * Access to this patient record is tracked and monitored."
+8 SET DGSENS(11)=" * You must have need for this record to accomplish officially"
+9 SET DGSENS(12)=" authorized and assigned duties, such as direct patient care, to"
+10 SET DGSENS(13)=" proceed."
+11 SET DGSENS(14)=" * You must provide justification for your access upon request."
+12 SET DGSENS(15)=" * Failure to comply may result in disciplinary or adverse action up to"
+13 SET DGSENS(16)=" and including removal from Federal service, and civil and criminal"
+14 SET DGSENS(17)=" penalties."
+15 IF $GET(DDS)=""
SET DGSENS(18)=""
+16 QUIT
EMPL(DFN,DGCHELIG) ;Does patient have any eligibility codes equal to
+1 ; EMPLOYEE
+2 ;Input:
+3 ; DFN - Patient (#2) file IEN (required).
+4 ; DGCHELIG - Flags to determine mode of execution (optional).
+5 ; Value of the parameter can contain any combination
+6 ; of the following characters:
+7 ; "P" - check primary eligibility code
+8 ; "S" - check secondary eligibility codes
+9 ;
+10 ; If this parameter is either not defined or set to an
+11 ; illegal value, the value of "PS" will be assumed.
+12 ;Output:
+13 ; 1 - Patient has EMPLOYEE as an eligibility code
+14 ; 0 - Patient doesn't have EMPLOYEE as an eligibility code
+15 ;
+16 ;Notes: EMPLOYEE is entry 14 in the MAS ELIGIBILITY CODE file (#8.1)
+17 NEW DGELIG,DGEMPLEE
+18 SET DGEMPLEE=0
+19 IF $GET(DGCHELIG)'["P"
IF $GET(DGCHELIG)'["S"
SET DGCHELIG="PS"
+20 ;Check primary eligibility
+21 IF DGCHELIG["P"
Begin DoDot:1
+22 SET DGELIG=+$GET(^DPT(DFN,.36))
+23 IF $DATA(^DIC(8,"D",14,DGELIG))
SET DGEMPLEE=1
End DoDot:1
+24 ;Check secondary eligibilities (if needed)
+25 IF DGCHELIG["S"
IF 'DGEMPLEE
Begin DoDot:1
+26 SET DGELIG=0
+27 FOR
SET DGELIG=+$ORDER(^DPT("AEL",DFN,DGELIG))
if 'DGELIG
QUIT
IF $DATA(^DIC(8,"D",14,DGELIG))
SET DGEMPLEE=1
QUIT
End DoDot:1
+28 QUIT DGEMPLEE