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

MAGGTMC1.m

Go to the documentation of this file.
  1. MAGGTMC1 ;WOIFO/GEK - RPC Calls for Imaging/Medicine procedures ; [ 06/20/2001 08:57 ]
  1. ;;3.0;IMAGING;**59**;Nov 27, 2007;Build 20
  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. ;; | |
  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. FILE(MAGRY,DATA,MAGARR) ;RPC Call to File the Image pointer into
  1. ; the Procedure/Subspecialty and Proc/Subspec into Image file.
  1. ;
  1. ; DATA = DATETIME^PSIEN^DFN^MCIEN^PROCSTUB ; 6/19/97
  1. ; If MCIEN isn't sent, this will be added as new procedure
  1. ; MAGARR is array of image pointers
  1. ; IF PROCSTUB is 1 we JUST want New Medicine procedure stub IEN 6/19/97
  1. ; as the success i.e. MAGRY="IEN^Procdure Stub created" 6/19/97
  1. IF $$NEWERR^%ZTER N $ETRAP,$ESTACK S $ETRAP="D ERR^MAGGTERR"
  1. E S X="ERR^MAGGTERR",@^%ZOSF("TRAP")
  1. N I,J,K,X,Y,Z,TIME,PSIEN,DFN,MAGPTR,MAGMCIEN,MCFILE,MAGOK,MAGERR,PROCSTUB
  1. ;
  1. S X=$P(DATA,U,1),%DT="TS" D ^%DT S TIME=Y
  1. S PSIEN=+$P(DATA,U,2)
  1. S DFN=+$P(DATA,U,3)
  1. S MAGMCIEN=+$P(DATA,U,4)
  1. S PROCSTUB=+$P(DATA,U,5) ; NEW 6/19/97 GEK
  1. S MCFILE=$P($P(^MCAR(697.2,PSIEN,0),U,2),"(",2)
  1. I '$D(^MAG(2005.03,MCFILE)) S MAGRY="0^Procedure file is Invalid in Imaging Parent Data File " Q
  1. S MAGOK=""
  1. S I="" F S I=$O(MAGARR(I)) Q:I="" D
  1. . S MAGPTR(I)=""
  1. . I '$D(^MAG(2005,I)) S MAGERR="0^INVALID Image entry "_I
  1. I $D(MAGERR) S MAGRY=MAGERR Q
  1. ; 6/19/97 New Note .MAGMCIEN
  1. D UPDATE^MCUIMAG0(TIME,PSIEN,DFN,.MAGPTR,.MAGMCIEN,.MAGOK)
  1. ;
  1. I 'MAGOK S MAGRY=MAGOK Q
  1. ; Next if we're getting a stub, Quit with the stub if it was created
  1. I MAGOK,PROCSTUB D Q
  1. . I MAGMCIEN<1 S MAGRY="0^FAILED Creating New Procedure stub"_MAGOK Q
  1. . S MAGRY=$P(MAGMCIEN,U,1)_"^Procedure Stub created"
  1. ;
  1. ; now enter the pointers to procedures, in the image file.
  1. ; we get back MAGPTR(I)= MCFILE^PSIEN^MULTIPLE ENTRY IEN
  1. S I="" F S I=$O(MAGPTR(I)) Q:I="" D
  1. . S $P(^MAG(2005,I,2),U,6,8)=MAGPTR(I)
  1. . D LINKDT^MAGGTU6(.X,I)
  1. S MAGRY=MAGOK
  1. Q
  1. ;/GEK/ 4/29/98 put in modification to return DICOM ID for MED proc.
  1. DICOMID(MAGRY,DATA) ;RPC Call to return a Dicom ID for medicine procedure.
  1. ; This is displayed on workstation, and used to link Dicom images
  1. ; to a medicine procedure.
  1. ; DATA is null ^ PSIEN ^ DFN ^ MCIEN ^ null
  1. ;
  1. N TMCFILE,TPSIEN,TDFN,TMCIEN,RETX
  1. S TPSIEN=+$P(DATA,U,2)
  1. S TDFN=+$P(DATA,U,3)
  1. S TMCIEN=+$P(DATA,U,4)
  1. S TMCFILE=$P($P($G(^MCAR(697.2,TPSIEN,0)),U,2),"(",2)
  1. I 'TMCFILE S MAGRY="0^InValid data input PSIEN="_TPSIEN Q
  1. D DICOMID^MAGDMEDI(.RETX,TMCFILE,TMCIEN,TPSIEN,TDFN)
  1. S MAGRY=RETX
  1. Q
  1. NEW(MAGRY,DATA) ;RPC call to Create NEW Procedure stub
  1. ; for a medicine procedure
  1. ;
  1. ; DATA = DATETIME^PSIEN^DFN ; same as old call
  1. S $P(DATA,"^",4)="^1" ; the 1 means we want a new procedure stub
  1. K MAGARR ; we are not passing any images.
  1. D FILE(.MAGRY,DATA,.MAGARR)
  1. Q