MAGXIDXU ;WOIFO/JSL - MAG INDEX TERMS BUILD/UPDATE Utilities for Imaging Version 3.0 ;;3.0;IMAGING;**61**;Feb 07, 2006 ;; +---------------------------------------------------------------+ ;; | 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 IDXUPDT ;API call - OPTION (MAG IMAGE INDEX TERMS UPDATE) N DATE,IDA,SUB,XP,EOF,IN,MAGMSG,INXMB,LINE,LN,NEWSN,START,TKID,X,Y,XMZ,XMER,DIR D GETENV^%ZOSV,KILL^XM I '$D(^XUSEC("MAG SYSTEM",+$G(DUZ))) U IO(0) W !,"Calling user does not have security key MAG SYSTEM" Q U IO(0) S DIR("A")="Update your local Index Terms with the latest Index Term Distribution (Y/N)",DIR("B")="Y",DIR(0)="Y" D ^DIR I '$G(Y) Q S SUB="MAG INDEX TERMS UPDATE" K ^TMP(SUB,$J) S TKID=$H*86400+$P($H,",",2) S X="ERR^MAGXIDXU",@^%ZOSF("TRAP") L +^XTMP(SUB):5 I '$T U IO(0) W !,"Some one is also updating Index Terms, ^XTMP("_SUB_") locked." H 5 Q S INXMB=$$INXMB^MAGXIDX0 I 'INXMB U IO(0) W !,"No updated distribution." H 2 Q ;latest idx update U IO(0) W ! ;;IA 1048 - $$READ^XMGAPI1 Get the next line of XMZ message text. S XMZ=INXMB F LN=1:1:256 S LINE=$$READ^XMGAPI1() Q:XMER=-1 I LINE[SUB Q S LINE=$$READ^XMGAPI1() Q:XMER=-1 Q:LINE="" S NEWSN=+$P(LINE,"SERIAL#",2) ;new serial# I +$G(^MAG(2005.82,"SERIAL#"))'