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

MAGSIMBR.m

Go to the documentation of this file.
  1. MAGSIMBR ;WOIFO/SEB - Image Business Rules ;
  1. ;;3.0;IMAGING;**8**;Sep 15, 2004
  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. ;; | |
  1. ;; | The Food and Drug Administration classifies this software as |
  1. ;; | a Class II medical device. As such, it may not be changed |
  1. ;; | in any way. Modifications to this software may result in an |
  1. ;; | adulterated medical device under 21CFR820, the use of which |
  1. ;; | is considered to be a violation of US Federal Statutes. |
  1. ;; +---------------------------------------------------------------+
  1. ;;
  1. Q
  1. ; Business rules for deletion of images
  1. DELETE(RY,MAGIEN,SYSDEL) N DELOK,MAGRY,MAG2,TIUDA
  1. ; Check user privileges for delete key
  1. S RY(0)="1^This image is allowed to be deleted."
  1. I 'SYSDEL I '$D(^XUSEC("MAG DELETE",DUZ)) D
  1. . S RY(0)="0^User doesn't have delete privilege."
  1. . Q
  1. I +RY(0)=0 Q
  1. ; Check if we are allowed to delete this image
  1. ; (Node 101 - Placeholder for future status field)
  1. S DELOK=1 ;I $P($G(^MAG(2005,MAGIEN,101)),"^")=0 S DELOK=0
  1. I DELOK=0 S RY(0)="0^This image cannot be deleted."
  1. I +RY(0)=0 Q
  1. ; If this image is linked to a TIU note, check to see that the TIU note is not signed.
  1. S MAG2=$G(^MAG(2005,MAGIEN,2)) I $P(MAG2,"^",6)=8925 D
  1. . S TIUDA=$P(MAG2,"^",7) D DATA(.MAGRY,TIUDA)
  1. . ;I $P(MAGRY,"^",4)="COMPLETED" S RY(0)="0^The TIU note has been signed. Cannot delete this image."
  1. . Q
  1. I +RY(0)=0 Q
  1. Q
  1. ;
  1. DATA(MAGRY,TIUDA) ;RPC Call to get TIU data from the TIUDA
  1. ; Return = TIUDA^Document Type^Document Date^Document Status
  1. ;
  1. S MAGRY=TIUDA_U_$$GET1^DIQ(8925,TIUDA,".01","E")_U_$$GET1^DIQ(8925,TIUDA,"1201","I")_U_$$GET1^DIQ(8925,TIUDA,".05","E")
  1. Q