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

MAGGROI.m

Go to the documentation of this file.
  1. MAGGROI ;WOIFO/BNT/NST - Multiple image print ; 12 Oct 2010 9:55 AM
  1. ;;3.0;IMAGING;**117**;Mar 19, 2002;Build 2238;Jul 15, 2011
  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. ;; | 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. ;***** Log multiple images printed for a patient in the
  1. ; MULTI IMAGE PRINT file (#2006.961)
  1. ;
  1. ; RPC: MAGG MULTI IMAGE PRINT
  1. ;
  1. ; Input Parameters
  1. ; ================
  1. ;
  1. ; DATA "^" delimited string containing data inserted
  1. ; into the MULTI IMAGE PRINT file #2006.961.
  1. ;
  1. ; ^01: PATIENT DFN
  1. ; ^02: REASON FOR PRINT
  1. ;
  1. ; e.g.: 123456^Authorized release of medical records or health information (ROI)
  1. ;
  1. ; IMGARR An array of "^" delimited string of values for each image printed
  1. ;
  1. ; ^01: IEN for the image (Note: This may be a url for a remote image)
  1. ; ^02: Local/remote indicator (0=local, 1=remote)
  1. ; ^03: IMAGE PRINT STATUS
  1. ; (Note: The image information displayed to the user
  1. ; in the client application.)
  1. ;
  1. ; e.g.: IMGARR(0)=^1^SLC-DIABETIC TELERETINAL IMAGING CONSULT REPORT
  1. ; -NOTE-04/13/2009 11:31: Image type not printable
  1. ; IMGARR(1)=123456^0^SLC-AU 01 2-LAB-08/21/2001: Image printed
  1. ;
  1. ; Return Values
  1. ; =============
  1. ;
  1. ; MAGRY = if error "0^Error message"
  1. ; if success "1^Printed Images Logged"
  1. ;
  1. LOGPRNT(MAGRY,DATA,IMGARR) ;RPC [MAGG MULTI IMAGE PRINT]
  1. N $ETRAP,$ESTACK S $ETRAP="D ERR^MAGGTERR"
  1. ;
  1. S MAGRY=$$ENTRY($P(DATA,U),$P(DATA,U,2),$G(DUZ),.IMGARR)
  1. ;
  1. Q
  1. ;
  1. ; Call With:
  1. ; MAGDFN = Patient IEN
  1. ; MAGREASN = Reason For Print
  1. ; MAGDUZ = User IEN
  1. ; MAGARR = Array of Multiple Images that have been printed
  1. ;
  1. ; The Date/Time images printed is derived from current system time
  1. ENTRY(MAGDFN,MAGREASN,MAGDUZ,MAGARR) ;
  1. N MAGX,MAGY,SFN,FN,NOW,MAGIENS,MAGIEN,MAGREM,MAGFDA
  1. N MAGERR,MAGRESA,MAGRY
  1. ; Initialize file number, image subfile number, date/time and return value
  1. S FN=2006.961
  1. S SFN=2006.9613
  1. S NOW=$$NOW^XLFDT()
  1. S MAGIEN="+1,"
  1. ;
  1. ; Set up FDA array
  1. S MAGFDA(FN,MAGIEN,.01)=MAGDFN ; Patient
  1. S MAGFDA(FN,MAGIEN,1)=NOW ; Print Date/Time
  1. S MAGFDA(FN,MAGIEN,2)=MAGDUZ ; User
  1. S MAGFDA(FN,MAGIEN,3)=MAGREASN ; Reason for Print
  1. S MAGX="",MAGY=1,MAGERR=0
  1. F S MAGX=$O(MAGARR(MAGX)) Q:MAGX="" D Q:MAGERR
  1. . ; Patient mismatch check was done during the selection of images
  1. . S MAGY=MAGY+1,MAGIENS=MAGY_","_MAGIEN
  1. . ; Is Image Local or Remote? MAGREM = 1 for Remote, 0 for Local
  1. . S MAGREM=$P(MAGARR(MAGX),U,2)
  1. . S MAGFDA(SFN,"+"_MAGIENS,.01)=MAGX+1 ; Image ID
  1. . I 'MAGREM S MAGFDA(SFN,"+"_MAGIENS,1)=$P(MAGARR(MAGX),U,1) ; Local Image IEN
  1. . I MAGREM S MAGFDA(SFN,"+"_MAGIENS,3)=$P(MAGARR(MAGX),U,1) ; Remote Image
  1. . S MAGFDA(SFN,"+"_MAGIENS,2)=$P(MAGARR(MAGX),U,3) ; Image Print Status
  1. . Q
  1. I MAGERR Q MAGRY
  1. ; File data in MULTI IMAGE PRINT file
  1. D UPDATE^DIE("","MAGFDA","","MAGERR")
  1. I $D(MAGERR("DIERR","E")) D Q
  1. . D MSG^DIALOG("A",.MAGRESA,245,5,"MAGERR")
  1. . S MAGRY="0^"_MAGRESA(1)
  1. . Q
  1. Q "1^Printed Images Logged"