source: WorldVistAEHR/trunk/r/IMAGING-MAG-ZMAG/MAGSDEL3.m@ 1604

Last change on this file since 1604 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 1.9 KB
Line 
1MAGSDEL3 ;WOIFO/LB - Delete image pointers in the lab file ; [ 06/20/2001 08:57 ]
2 ;;3.0;IMAGING;;Mar 01, 2002
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 ;; | |
11 ;; | The Food and Drug Administration classifies this software as |
12 ;; | a medical device. As such, it may not be changed in any way. |
13 ;; | Modifications to this software may result in an adulterated |
14 ;; | medical device under 21CFR820, the use of which is considered |
15 ;; | to be a violation of US Federal Statutes. |
16 ;; +---------------------------------------------------------------+
17 ;;
18 Q
19EN(IMAGE,RESULT) ;
20 ;IMAGE is the ien in file 2005
21 S RESULT="0^Parent File Delete Failed"
22 Q:'IMAGE
23 Q:'$D(^MAG(2005,IMAGE,0))
24 N DIK,DA
25 N MAGLRDFN,MAGLRTYP,MAGLRI,MAGLIEN,MAGLRNOD,FIELD,COMPARE
26 ;
27 S MAGLRDFN=$P(^MAG(2005,IMAGE,2),"^",7),MAGLRTYP=$P(^(2),"^",6)
28 S MAGLRI=$P(^MAG(2005,IMAGE,2),"^",10),MAGLIEN=$P(^(2),"^",8)
29 I 'MAGLRI!('MAGLIEN) Q ;No parent pointers
30 S MAGLRNOD=$S(MAGLRTYP=63.08:"SP",MAGLRTYP=63.02:"EM",MAGLRTYP=63.09:"CY",1:"AY")
31 ;"AY" Has two fields, 2005 and 2005.1
32 S FIELD=$S(MAGLRTYP=63:2005.1,1:2005)
33 Q:'$D(^LR(MAGLRDFN,MAGLRNOD,MAGLRI,FIELD,MAGLIEN,0))
34 ; EXAMPLE ^LR(48,"AY",1,2005.1,3,0) = 49345
35 S COMPARE=$P($G(^LR(MAGLRDFN,MAGLRNOD,MAGLRI,FIELD,MAGLIEN,0)),"^")
36 Q:COMPARE'=IMAGE ;Not same image pointer
37 S DA(2)=MAGLRDFN,DA(1)=MAGLRI,DA=MAGLIEN
38 S DIK="^LR("_MAGLRDFN_","""_MAGLRNOD_""","_MAGLRI_","_FIELD_","
39 D ^DIK
40 S RESULT="1^SUCCESS"
41 Q
Note: See TracBrowser for help on using the repository browser.