MAGIP343 ;WOIFO/JSL/MKN - Install code for MAG*3.0*343 ; Mar 21, 2023@10:58:35
;;3.0;IMAGING;**343**;Mar 19, 2002;Build 2
;; Per VA Directive 6402, this routine should not be modified.
;; +---------------------------------------------------------------+
;; | 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. |
;; +---------------------------------------------------------------+
;;
; There are no environment checks here but the MAGIP343 has to be
; referenced by the "Environment Check Routine" field of the KIDS
; build so that entry points of the routine are available to the
; KIDS during all installation phases.
;
; Supported IA #10103 reference $$NOW^XLFDT function call
; Supported IA #10103 reference $$FMTE^XLFDT function call
; Supported IA #10141 reference $$BMES^XPDUTL function call
; Supported IA #2053 reference FILE^DIE
;
Q
;
;+++++ INSTALLATION ERROR HANDLING
ERROR ;
S:$D(XPDNM) XPDABORT=1
;--- Display the messages and store them to the INSTALL file
D DUMP^MAGUERR1(),ABTMSG^MAGKIDS()
Q
;
;***** POST-INSTALL CODE
POS ;
N CALLBACK
D CLEAR^MAGUERR(1)
;
D UPDATE
D URL
;
;--- Send the notification e-mail
D BMES^XPDUTL("Post Install Mail Message: "_$$FMTE^XLFDT($$NOW^XLFDT))
D INS^MAGQBUT4(XPDNM,DUZ,$$NOW^XLFDT,XPDA)
Q
;
;***** PRE-INSTALL CODE
PRE ;
Q
;
UPDATE ; Add ELIGIBILITY/VA FORM 20-0986/10-0383" to the IMAGE INDEX FOR TYPES file (#2005.83)
;NOTE: Code contains hard sets to file #2005.83 because the file cannot be updated by FileMan due to
; a LAYGO TEST that can never be true (Authorized by the VA DBA)
N DIK,MAG0,MAG3,MAG4,MAGFILE,MAGIEN,MAGIENCL,MAGNEW
S MAGNEW="ELIGIBILITY/VA FORM 20-0986/10-0383",MAGFILE="IMAGE INDEX FOR TYPES file (#2005.83)"
D BMES^XPDUTL("Checking for existence of form "_MAGNEW_" in the "_MAGFILE)
S MAGIEN=$O(^MAG(2005.83,"B",MAGNEW,""))
I MAGIEN D BMES^XPDUTL("Form "_MAGNEW_" already in "_MAGNEW_".") Q
;Add the new record to file #2005.83
;Find IEN of class "ADMIN" in IMAGE INDEX FOR CLASS file (#2005.82)
S MAGIENCL=$O(^MAG(2005.82,"B","ADMIN",""))
I 'MAGIENCL D Q
. D BMES^XPDUTL("Unable to find the ""ADMIN"" class in the IMAGE INDEX FOR CLASS FILE (#2005.82)")
. D BMES^XPDUTL("Unable to add form "_MAGNEW_" in "_MAGFILE)
D BMES^XPDUTL("Adding "_MAGNEW_" to "_MAGFILE)
S DIK="^MAG(2005.83," D IXALL2^DIK
S MAG0=^MAG(2005.83,0),MAG3=$P(MAG0,U,3)+1,MAG4=$P(MAG0,U,4)+1
S ^MAG(2005.83,MAG3,0)=MAGNEW_U_MAGIENCL_U_"A",^MAG(2005.83,MAG3,1)="20-0986"
S $P(MAG0,U,3)=MAG3,$P(MAG0,U,4)=MAG4,^MAG(2005.83,0)=MAG0
D BMES^XPDUTL("Reindexing "_MAGFILE)
S DIK="^MAG(2005.83," D IXALL^DIK
D BMES^XPDUTL("Form "_MAGNEW_" added to the "_MAGFILE)
Q
;
URL ; update URL for Capture User Guide
N MAGFILE,MAGIEN,MAGNEW,MAGURL
S MAGURL="https://www.domain.ext/vdl/documents/Clinical/Vista_Imaging_Sys/mag_capture_user_manual.pdf"
S MAGNEW="#76 CAPTURE HELP URL",MAGFILE="#2006.1 IMAGING SITE PARAMETERS",MAGIEN=0
D BMES^XPDUTL("Updating field "_MAGNEW_" in file "_MAGFILE)
S MAGIEN=$O(^MAG(2006.1,MAGIEN)) Q:MAGIEN="" D
.;I '$D(^MAG(2006.1,MAGIEN,"HELPC")) D BMES^XPDUTL("No data in "_MAGNEW_" in "_MAGFILE_" for entry#: "_MAGIEN) Q
.;Change the existing URL to: https://www.domain.ext/vdl/documents/Clinical/Vista_Imaging_Sys/mag_capture_user_manual.pdf
.D BMES^XPDUTL("Adding/Updating field "_MAGNEW_" for entry#: "_MAGIEN)
.S ^MAG(2006.1,MAGIEN,"HELPC")=MAGURL
D BMES^XPDUTL("All "_MAGNEW_" fields in "_MAGFILE_" changed to: "_MAGURL)
Q
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HMAGIP343 4273 printed Mar 25, 2026@15:30:38 Page 2
MAGIP343 ;WOIFO/JSL/MKN - Install code for MAG*3.0*343 ; Mar 21, 2023@10:58:35
+1 ;;3.0;IMAGING;**343**;Mar 19, 2002;Build 2
+2 ;; Per VA Directive 6402, this routine should not be modified.
+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 ;; | The Food and Drug Administration classifies this software as |
+11 ;; | a medical device. As such, it may not be changed in any way. |
+12 ;; | Modifications to this software may result in an adulterated |
+13 ;; | medical device under 21CFR820, the use of which is considered |
+14 ;; | to be a violation of US Federal Statutes. |
+15 ;; +---------------------------------------------------------------+
+16 ;;
+17 ; There are no environment checks here but the MAGIP343 has to be
+18 ; referenced by the "Environment Check Routine" field of the KIDS
+19 ; build so that entry points of the routine are available to the
+20 ; KIDS during all installation phases.
+21 ;
+22 ; Supported IA #10103 reference $$NOW^XLFDT function call
+23 ; Supported IA #10103 reference $$FMTE^XLFDT function call
+24 ; Supported IA #10141 reference $$BMES^XPDUTL function call
+25 ; Supported IA #2053 reference FILE^DIE
+26 ;
+27 QUIT
+28 ;
+29 ;+++++ INSTALLATION ERROR HANDLING
ERROR ;
+1 if $DATA(XPDNM)
SET XPDABORT=1
+2 ;--- Display the messages and store them to the INSTALL file
+3 DO DUMP^MAGUERR1()
DO ABTMSG^MAGKIDS()
+4 QUIT
+5 ;
+6 ;***** POST-INSTALL CODE
POS ;
+1 NEW CALLBACK
+2 DO CLEAR^MAGUERR(1)
+3 ;
+4 DO UPDATE
+5 DO URL
+6 ;
+7 ;--- Send the notification e-mail
+8 DO BMES^XPDUTL("Post Install Mail Message: "_$$FMTE^XLFDT($$NOW^XLFDT))
+9 DO INS^MAGQBUT4(XPDNM,DUZ,$$NOW^XLFDT,XPDA)
+10 QUIT
+11 ;
+12 ;***** PRE-INSTALL CODE
PRE ;
+1 QUIT
+2 ;
UPDATE ; Add ELIGIBILITY/VA FORM 20-0986/10-0383" to the IMAGE INDEX FOR TYPES file (#2005.83)
+1 ;NOTE: Code contains hard sets to file #2005.83 because the file cannot be updated by FileMan due to
+2 ; a LAYGO TEST that can never be true (Authorized by the VA DBA)
+3 NEW DIK,MAG0,MAG3,MAG4,MAGFILE,MAGIEN,MAGIENCL,MAGNEW
+4 SET MAGNEW="ELIGIBILITY/VA FORM 20-0986/10-0383"
SET MAGFILE="IMAGE INDEX FOR TYPES file (#2005.83)"
+5 DO BMES^XPDUTL("Checking for existence of form "_MAGNEW_" in the "_MAGFILE)
+6 SET MAGIEN=$ORDER(^MAG(2005.83,"B",MAGNEW,""))
+7 IF MAGIEN
DO BMES^XPDUTL("Form "_MAGNEW_" already in "_MAGNEW_".")
QUIT
+8 ;Add the new record to file #2005.83
+9 ;Find IEN of class "ADMIN" in IMAGE INDEX FOR CLASS file (#2005.82)
+10 SET MAGIENCL=$ORDER(^MAG(2005.82,"B","ADMIN",""))
+11 IF 'MAGIENCL
Begin DoDot:1
+12 DO BMES^XPDUTL("Unable to find the ""ADMIN"" class in the IMAGE INDEX FOR CLASS FILE (#2005.82)")
+13 DO BMES^XPDUTL("Unable to add form "_MAGNEW_" in "_MAGFILE)
End DoDot:1
QUIT
+14 DO BMES^XPDUTL("Adding "_MAGNEW_" to "_MAGFILE)
+15 SET DIK="^MAG(2005.83,"
DO IXALL2^DIK
+16 SET MAG0=^MAG(2005.83,0)
SET MAG3=$PIECE(MAG0,U,3)+1
SET MAG4=$PIECE(MAG0,U,4)+1
+17 SET ^MAG(2005.83,MAG3,0)=MAGNEW_U_MAGIENCL_U_"A"
SET ^MAG(2005.83,MAG3,1)="20-0986"
+18 SET $PIECE(MAG0,U,3)=MAG3
SET $PIECE(MAG0,U,4)=MAG4
SET ^MAG(2005.83,0)=MAG0
+19 DO BMES^XPDUTL("Reindexing "_MAGFILE)
+20 SET DIK="^MAG(2005.83,"
DO IXALL^DIK
+21 DO BMES^XPDUTL("Form "_MAGNEW_" added to the "_MAGFILE)
+22 QUIT
+23 ;
URL ; update URL for Capture User Guide
+1 NEW MAGFILE,MAGIEN,MAGNEW,MAGURL
+2 SET MAGURL="https://www.domain.ext/vdl/documents/Clinical/Vista_Imaging_Sys/mag_capture_user_manual.pdf"
+3 SET MAGNEW="#76 CAPTURE HELP URL"
SET MAGFILE="#2006.1 IMAGING SITE PARAMETERS"
SET MAGIEN=0
+4 DO BMES^XPDUTL("Updating field "_MAGNEW_" in file "_MAGFILE)
+5 SET MAGIEN=$ORDER(^MAG(2006.1,MAGIEN))
if MAGIEN=""
QUIT
Begin DoDot:1
+6 ;I '$D(^MAG(2006.1,MAGIEN,"HELPC")) D BMES^XPDUTL("No data in "_MAGNEW_" in "_MAGFILE_" for entry#: "_MAGIEN) Q
+7 ;Change the existing URL to: https://www.domain.ext/vdl/documents/Clinical/Vista_Imaging_Sys/mag_capture_user_manual.pdf
+8 DO BMES^XPDUTL("Adding/Updating field "_MAGNEW_" for entry#: "_MAGIEN)
+9 SET ^MAG(2006.1,MAGIEN,"HELPC")=MAGURL
End DoDot:1
+10 DO BMES^XPDUTL("All "_MAGNEW_" fields in "_MAGFILE_" changed to: "_MAGURL)
+11 QUIT
+12 ;