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

MAGUE007.m

Go to the documentation of this file.
  1. 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
  1. ;; Per VHA Directive 2004-038, this routine should not be modified.
  1. ;; +---------------------------------------------------------------+
  1. ;; | Property of the US Government. |
  1. ;; | No permission to copy or redistribute this software is given. |
  1. ;; | Use of unreleased versions of this software requires the user |
  1. ;; | to execute a written test agreement with the VistA Imaging |
  1. ;; | Development Office of the Department of Veterans Affairs, |
  1. ;; | telephone (301) 734-0100. |
  1. ;; | The Food and Drug Administration classifies this software as |
  1. ;; | a medical device. As such, it may not be changed in any way. |
  1. ;; | Modifications to this software may result in an adulterated |
  1. ;; | medical device under 21CFR820, the use of which is considered |
  1. ;; | to be a violation of US Federal Statutes. |
  1. ;; +---------------------------------------------------------------+
  1. ;;
  1. Q
  1. ;
  1. ; +++++ RETURN SENSITIVE/EMPLOYEE FLAG FOR A PATIENT
  1. ;
  1. ; MAGDFN Patient's internal entry number on PATIENT File (#2)
  1. ;
  1. ; RETURN VALUES
  1. ; =============
  1. ;
  1. ; MAGRY(0) One of the following values:
  1. ; -4^^DFN parameter missing or empty
  1. ; -3^^DFN not numeric
  1. ; -2^^DFN not found on PATIENT File
  1. ; -1^^ERROR [MUMPS error]
  1. ; 0^^Not employee, not sensitive
  1. ; 1^^Employee, not sensitive
  1. ; 2^^Not employee, sensitive
  1. ; 3^^Employee, sensitive
  1. ;
  1. EMPSENS(MAGRY,MAGDFN) ;
  1. K MAGRY
  1. N $ETRAP,$ESTACK S $ETRAP="D ERRA^MAGUTERR"
  1. N SENSFLAG ; sum of values returned from utility calls
  1. I $G(MAGDFN)="" D Q
  1. . S MAGRY(0)="-4^^DFN parameter missing or empty"
  1. . Q
  1. I MAGDFN'?.N D Q
  1. . S MAGRY(0)="-3^^DFN not numeric"
  1. . Q
  1. I '$D(^DPT(MAGDFN)) D Q ; ICR ???
  1. . S MAGRY(0)="-2^^DFN not found on PATIENT File"
  1. . Q
  1. S:$$EMPL^DGSEC4(MAGDFN)=1 SENSFLAG=$G(SENSFLAG)_"E" ; ICR #3646
  1. S:$P($G(^DGSL(38.1,MAGDFN,0)),"^",2)=1 SENSFLAG=$G(SENSFLAG)_"S" ; ICR #767
  1. I $G(SENSFLAG)="" S MAGRY(0)="0^^Not employee, not sensitive" Q
  1. I SENSFLAG="E" S MAGRY(0)="1^^Employee, not sensitive" Q
  1. I SENSFLAG="S" S MAGRY(0)="2^^Not employee, sensitive" Q
  1. I SENSFLAG="ES" S MAGRY(0)="3^^Employee, sensitive" Q
  1. Q