MAGUE007 ;WOIFO/MLH - database encapsulation - sensitive/employee patient lookup ; 13-Mar-2013 04:03 pm
;;3.0;IMAGING;**138**;Mar 19, 2002;Build 5380;Sep 03, 2013
;; Per VHA Directive 2004-038, this routine should not be modified.
;; +---------------------------------------------------------------+
;; | Property of the US Government. |
;; | No permission to copy or redistribute this software is given. |
;; | Use of unreleased versions of this software requires the user |
;; | to execute a written test agreement with the VistA Imaging |
;; | Development Office of the Department of Veterans Affairs, |
;; | telephone (301) 734-0100. |
;; | The Food and Drug Administration classifies this software as |
;; | a medical device. As such, it may not be changed in any way. |
;; | Modifications to this software may result in an adulterated |
;; | medical device under 21CFR820, the use of which is considered |
;; | to be a violation of US Federal Statutes. |
;; +---------------------------------------------------------------+
;;
Q
;
; +++++ RETURN SENSITIVE/EMPLOYEE FLAG FOR A PATIENT
;
; MAGDFN Patient's internal entry number on PATIENT File (#2)
;
; RETURN VALUES
; =============
;
; MAGRY(0) One of the following values:
; -4^^DFN parameter missing or empty
; -3^^DFN not numeric
; -2^^DFN not found on PATIENT File
; -1^^ERROR [MUMPS error]
; 0^^Not employee, not sensitive
; 1^^Employee, not sensitive
; 2^^Not employee, sensitive
; 3^^Employee, sensitive
;
EMPSENS(MAGRY,MAGDFN) ;
K MAGRY
N $ETRAP,$ESTACK S $ETRAP="D ERRA^MAGUTERR"
N SENSFLAG ; sum of values returned from utility calls
I $G(MAGDFN)="" D Q
. S MAGRY(0)="-4^^DFN parameter missing or empty"
. Q
I MAGDFN'?.N D Q
. S MAGRY(0)="-3^^DFN not numeric"
. Q
I '$D(^DPT(MAGDFN)) D Q ; ICR ???
. S MAGRY(0)="-2^^DFN not found on PATIENT File"
. Q
S:$$EMPL^DGSEC4(MAGDFN)=1 SENSFLAG=$G(SENSFLAG)_"E" ; ICR #3646
S:$P($G(^DGSL(38.1,MAGDFN,0)),"^",2)=1 SENSFLAG=$G(SENSFLAG)_"S" ; ICR #767
I $G(SENSFLAG)="" S MAGRY(0)="0^^Not employee, not sensitive" Q
I SENSFLAG="E" S MAGRY(0)="1^^Employee, not sensitive" Q
I SENSFLAG="S" S MAGRY(0)="2^^Not employee, sensitive" Q
I SENSFLAG="ES" S MAGRY(0)="3^^Employee, sensitive" Q
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HMAGUE007 2547 printed Nov 22, 2024@17:19 Page 2
MAGUE007 ;WOIFO/MLH - database encapsulation - sensitive/employee patient lookup ; 13-Mar-2013 04:03 pm
+1 ;;3.0;IMAGING;**138**;Mar 19, 2002;Build 5380;Sep 03, 2013
+2 ;; Per VHA Directive 2004-038, this routine should not be modified.
+3 ;; +---------------------------------------------------------------+
+4 ;; | Property of the US Government. |
+5 ;; | No permission to copy or redistribute this software is given. |
+6 ;; | Use of unreleased versions of this software requires the user |
+7 ;; | to execute a written test agreement with the VistA Imaging |
+8 ;; | Development Office of the Department of Veterans Affairs, |
+9 ;; | telephone (301) 734-0100. |
+10 ;; | The Food and Drug Administration classifies this software as |
+11 ;; | a medical device. As such, it may not be changed in any way. |
+12 ;; | Modifications to this software may result in an adulterated |
+13 ;; | medical device under 21CFR820, the use of which is considered |
+14 ;; | to be a violation of US Federal Statutes. |
+15 ;; +---------------------------------------------------------------+
+16 ;;
+17 QUIT
+18 ;
+19 ; +++++ RETURN SENSITIVE/EMPLOYEE FLAG FOR A PATIENT
+20 ;
+21 ; MAGDFN Patient's internal entry number on PATIENT File (#2)
+22 ;
+23 ; RETURN VALUES
+24 ; =============
+25 ;
+26 ; MAGRY(0) One of the following values:
+27 ; -4^^DFN parameter missing or empty
+28 ; -3^^DFN not numeric
+29 ; -2^^DFN not found on PATIENT File
+30 ; -1^^ERROR [MUMPS error]
+31 ; 0^^Not employee, not sensitive
+32 ; 1^^Employee, not sensitive
+33 ; 2^^Not employee, sensitive
+34 ; 3^^Employee, sensitive
+35 ;
EMPSENS(MAGRY,MAGDFN) ;
+1 KILL MAGRY
+2 NEW $ETRAP,$ESTACK
SET $ETRAP="D ERRA^MAGUTERR"
+3 ; sum of values returned from utility calls
NEW SENSFLAG
+4 IF $GET(MAGDFN)=""
Begin DoDot:1
+5 SET MAGRY(0)="-4^^DFN parameter missing or empty"
+6 QUIT
End DoDot:1
QUIT
+7 IF MAGDFN'?.N
Begin DoDot:1
+8 SET MAGRY(0)="-3^^DFN not numeric"
+9 QUIT
End DoDot:1
QUIT
+10 ; ICR ???
IF '$DATA(^DPT(MAGDFN))
Begin DoDot:1
+11 SET MAGRY(0)="-2^^DFN not found on PATIENT File"
+12 QUIT
End DoDot:1
QUIT
+13 ; ICR #3646
if $$EMPL^DGSEC4(MAGDFN)=1
SET SENSFLAG=$GET(SENSFLAG)_"E"
+14 ; ICR #767
if $PIECE($GET(^DGSL(38.1,MAGDFN,0)),"^",2)=1
SET SENSFLAG=$GET(SENSFLAG)_"S"
+15 IF $GET(SENSFLAG)=""
SET MAGRY(0)="0^^Not employee, not sensitive"
QUIT
+16 IF SENSFLAG="E"
SET MAGRY(0)="1^^Employee, not sensitive"
QUIT
+17 IF SENSFLAG="S"
SET MAGRY(0)="2^^Not employee, sensitive"
QUIT
+18 IF SENSFLAG="ES"
SET MAGRY(0)="3^^Employee, sensitive"
QUIT
+19 QUIT