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

MAGSDHCP.m

Go to the documentation of this file.
  1. MAGSDHCP ;WOIFO/LB - Routine to delete entries in file 2006.5839 ; 10/08/2003 09:54
  1. ;;3.0;IMAGING;**10**;Nov 06, 2003
  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 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. DCMTEMP(RESULT,IMAGE) ;
  1. N DA,DIK,IEN,FILE,ENTRY,IMG
  1. S RESULT="0^Failure could not delete entry from file."
  1. Q:'IMAGE
  1. Q:'$D(^MAG(2005,IMAGE,0))
  1. I $P(^MAG(2005,IMAGE,0),"^",10) D Q
  1. . S RESULT="1^Parent pointer does not need to be resolved."
  1. . ; This should allow code to continue deleting image entry.
  1. . Q
  1. ; Can only delete if the image is a group entry.
  1. ; Find the DA entry.
  1. S DA=0
  1. S FILE=$P(^MAG(2005,IMAGE,2),"^",6) Q:FILE'=2006.5839
  1. S ENTRY=$P(^MAG(2005,IMAGE,2),"^",7) Q:'ENTRY
  1. I $D(^MAG(2006.5839,"C",123,ENTRY)) D
  1. . S IEN=$O(^MAG(2006.5839,"C",123,ENTRY,0)) Q:'IEN
  1. . Q:'$D(^MAG(2006.5839,IEN,0))
  1. . S IMG=$P(^MAG(2006.5839,IEN,0),"^",3)
  1. . I IMAGE'=IMG S DA=0
  1. . S DA=IEN
  1. . Q
  1. I 'DA S RESULT="0^Entry in file 2006.5839 does not exist" Q
  1. S IEN=DA
  1. S DIK="^MAG(2006.5839," D ^DIK
  1. I '$D(^MAG(2006.5839,IEN,0)) D
  1. . S RESULT="1^Success in deleting entry in file 2006.5839."
  1. . Q
  1. Q