MAGIP271 ;WOIFO/DAC - Install code for MAG*3.0*271 ; Jan 14, 2021@07:44:50
 ;;3.0;IMAGING;**271**;Mar 19, 2002;Build 10
 ;; Per VHA Directive 2004-038, 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 MAGIP271 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.
 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 SOPUPDT
 S MENU=$$ADD^XPDMENU("MAG SYS MENU","MAG MANAGE NEW SOP CLASSES") ; Add SOP class update menu options 
 ;
 ;--- 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
SOPUPDT ; Update DICOM UID SPECIFIC ACTION file (#2006.539)
 N MAGN
 ;
 S MAGN("1.2.840.10008.5.1.4.1.1.78.7^Ophthalmic Axial Measurements Storage^2^New|dicom.JPG")=""
 S MAGN("1.2.840.10008.5.1.4.1.1.78.8^Intraocular Lens Calculations Storage^2^New|dicom.JPG")=""
 S MAGN("1.2.840.10008.5.1.4.1.1.79.1^Macular Grid Thickness and Volume Report Storage^2^New|dicom.JPG")=""
 S MAGN("1.2.840.10008.5.1.4.1.1.80.1^Ophthalmic Visual Field Static Perimetry Measurements Storage^2^New|dicom.JPG")=""
 S MAGN("1.2.840.10008.5.1.4.1.1.81.1^Ophthalmic Thickness Map Storage^2^New|dicom.JPG")=""
 S MAGN("1.2.840.10008.5.1.4.1.1.82.1^Corneal Topography Map Storage^2^New|dicom.JPG")=""
 S MAGN("1.2.840.10008.5.1.4.1.1.66.3^Deformable Spatial Registration Storage^2^New|dicom.JPG")=""
 S MAGN("1.2.840.10008.5.1.4.1.1.66.4^Segmentation Storage^2^New|dicom.JPG")=""
 S MAGN("1.2.840.10008.5.1.4.1.1.66.5^Surface Segmentation Storage^2^New|dicom.JPG")=""
 S MAGN("1.2.840.10008.5.1.4.1.1.66.6^Tractography Results Storage^2^New|dicom.JPG")=""
 S MAGN("1.2.840.10008.5.1.4.1.1.67^Real World Value Mapping Storage^2^New|dicom.JPG")=""
 S MAGN("1.2.840.10008.5.1.4.1.1.68.1^Surface Scan Mesh Storage^2^New|dicom.JPG")=""
 S MAGN("1.2.840.10008.5.1.4.1.1.68.2^Surface Scan Point Cloud Storage^2^New|dicom.JPG")=""
 S MAGN("1.2.840.10008.5.1.4.1.1.88.34^Comprehensive 3D SR Storage^2^New|dicom.JPG")=""
 S MAGN("1.2.840.10008.5.1.4.1.1.88.35^Extensible SR Storage^2^New|dicom.JPG")=""
 S MAGN("1.2.840.10008.5.1.4.1.1.88.70^Implantation Plan SR Document Storage^2^New|dicom.JPG")=""
 S MAGN("1.2.840.10008.5.1.4.1.1.88.71^Acquisition Context SR Storage^2^New|dicom.JPG")=""
 S MAGN("1.2.840.10008.5.1.4.1.1.88.72^Simplified Adult Echo SR Storage^2^New|dicom.JPG")=""
 S MAGN("1.2.840.10008.5.1.4.1.1.88.73^Patient Radiation Dose SR Storage^2^New|dicom.JPG")=""
 S MAGN("1.2.840.10008.5.1.4.1.1.88.74^Planned Imaging Agent Administration SR Storage^2^New|dicom.JPG")=""
 S MAGN("1.2.840.10008.5.1.4.1.1.88.75^Performed Imaging Agent Administration SR Storage^2^New|dicom.JPG")=""
 S MAGN("1.2.840.10008.5.1.4.1.1.104.2^Encapsulated CDA Storage^2^New|dicom.JPG")=""
 S MAGN("1.2.840.10008.5.1.4.1.1.104.3^Encapsulated STL Storage^2^New|dicom.JPG")=""
 S MAGN("1.2.840.10008.5.1.4.1.1.104.4^Encapsulated OBJ Storage^2^New|dicom.JPG")=""
 S MAGN("1.2.840.10008.5.1.4.1.1.104.5^Encapsulated MTL Storage^2^New|dicom.JPG")=""
 S MAGN("1.2.840.10008.5.1.4.1.1.481.9^RT Ion Beams Treatment Record Storage^2^New|dicom.JPG")=""
 S MAGN("1.2.840.10008.5.1.4.1.1.481.10^RT Physician Intent Storage^2^New|dicom.JPG")=""
 S MAGN("1.2.840.10008.5.1.4.1.1.481.11^RT Segment Annotation Storage^2^New|dicom.JPG")=""
 S MAGN("1.2.840.10008.5.1.4.1.1.481.12^RT Radiation Set Storage^2^New|dicom.JPG")=""
 S MAGN("1.2.840.10008.5.1.4.1.1.481.13^C-Arm Photon-Electron Radiation Storage^2^New|dicom.JPG")=""
 S MAGN("1.2.840.10008.5.1.4.1.1.481.14^Tomotherapeutic Radiation Storage^2^New|dicom.JPG")=""
 S MAGN("1.2.840.10008.5.1.4.1.1.481.15^Robotic-Arm Radiation Storage^2^New|dicom.JPG")=""
 S MAGN("1.2.840.10008.5.1.4.1.1.481.16^RT Radiation Record Set Storage^2^New|dicom.JPG")=""
 S MAGN("1.2.840.10008.5.1.4.1.1.481.17^RT Radiation Salvage Record Storage^2^New|dicom.JPG")=""
 S MAGN("1.2.840.10008.5.1.4.1.1.481.18^Tomotherapeutic Radiation Record Storage^2^New|dicom.JPG")=""
 S MAGN("1.2.840.10008.5.1.4.1.1.481.19^C-Arm Photon-Electron Radiation Record Storage^2^New|dicom.JPG")=""
 S MAGN("1.2.840.10008.5.1.4.1.1.481.20^Robotic Radiation Record Storage^2^New|dicom.JPG")=""
 S MAGN("1.2.840.10008.5.1.4.34.7^RT Beams Delivery Instruction Storage^2^New|dicom.JPG")=""
 S MAGN("1.2.840.10008.5.1.4.34.10^RT Brachy Application Setup Delivery Instruction Storage^2^New|dicom.JPG")=""
 ;
 N MAGNFDA,MAGNIEN,MAGNXE,I
 N PURPOSE,TYPE,SUBTYPE
 N UID,UIDDESCR,ACTION,COMMENT
 S I=""
 S PURPOSE="Storage SCP"
 S TYPE="SOP Class"
 S SUBTYPE="Storage"
 F  S I=$O(MAGN(I)) Q:I=""  D
 . K MAGNFDA,MAGNIEN,MAGNXE
 . S UID=$P(I,"^",1)
 . S UIDDESCR=$P(I,"^",2)
 . S ACTION=$P(I,"^",3)
 . S COMMENT=$P(I,"^",4)
 . S MAGNFDA(2006.539,"?+1,",.01)=UID
 . S MAGNFDA(2006.539,"?+1,",2)=UIDDESCR
 . S MAGNFDA(2006.539,"?+1,",3)=TYPE
 . S MAGNFDA(2006.539,"?+1,",4)=SUBTYPE
 . S MAGNFDA(2006.5391,"?+2,?+1,",.01)=PURPOSE
 . S MAGNFDA(2006.5391,"?+2,?+1,",2)=ACTION
 . S MAGNFDA(2006.5391,"?+2,?+1,",3)=COMMENT
 . D UPDATE^DIE("S","MAGNFDA","MAGNIEN","MAGNXE")
 . I $D(MAGNXE("DIERR","E")) W !,"Error updating DICOM UID SPECIFIC ACTION file (#2006.539): ",I
 . Q
 W !,"Update of DICOM UID SPECIFIC ACTION file (#2006.539) is done"
 Q
 
--- Routine Detail   --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HMAGIP271   6589     printed  Sep 23, 2025@19:41:38                                                                                                                                                                                                    Page 2
MAGIP271  ;WOIFO/DAC - Install code for MAG*3.0*271 ; Jan 14, 2021@07:44:50
 +1       ;;3.0;IMAGING;**271**;Mar 19, 2002;Build 10
 +2       ;; Per VHA Directive 2004-038, 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 MAGIP271 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       QUIT 
 +22      ;
 +23      ;+++++ 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        DO SOPUPDT
 +4       ; Add SOP class update menu options 
           SET MENU=$$ADD^XPDMENU("MAG SYS MENU","MAG MANAGE NEW SOP CLASSES")
 +5       ;
 +6       ;--- Send the notification e-mail
 +7        DO BMES^XPDUTL("Post Install Mail Message: "_$$FMTE^XLFDT($$NOW^XLFDT))
 +8        DO INS^MAGQBUT4(XPDNM,DUZ,$$NOW^XLFDT,XPDA)
 +9        QUIT 
 +10      ;
 +11      ;***** PRE-INSTALL CODE
PRE       ;
 +1        QUIT 
SOPUPDT   ; Update DICOM UID SPECIFIC ACTION file (#2006.539)
 +1        NEW MAGN
 +2       ;
 +3        SET MAGN("1.2.840.10008.5.1.4.1.1.78.7^Ophthalmic Axial Measurements Storage^2^New|dicom.JPG")=""
 +4        SET MAGN("1.2.840.10008.5.1.4.1.1.78.8^Intraocular Lens Calculations Storage^2^New|dicom.JPG")=""
 +5        SET MAGN("1.2.840.10008.5.1.4.1.1.79.1^Macular Grid Thickness and Volume Report Storage^2^New|dicom.JPG")=""
 +6        SET MAGN("1.2.840.10008.5.1.4.1.1.80.1^Ophthalmic Visual Field Static Perimetry Measurements Storage^2^New|dicom.JPG")=""
 +7        SET MAGN("1.2.840.10008.5.1.4.1.1.81.1^Ophthalmic Thickness Map Storage^2^New|dicom.JPG")=""
 +8        SET MAGN("1.2.840.10008.5.1.4.1.1.82.1^Corneal Topography Map Storage^2^New|dicom.JPG")=""
 +9        SET MAGN("1.2.840.10008.5.1.4.1.1.66.3^Deformable Spatial Registration Storage^2^New|dicom.JPG")=""
 +10       SET MAGN("1.2.840.10008.5.1.4.1.1.66.4^Segmentation Storage^2^New|dicom.JPG")=""
 +11       SET MAGN("1.2.840.10008.5.1.4.1.1.66.5^Surface Segmentation Storage^2^New|dicom.JPG")=""
 +12       SET MAGN("1.2.840.10008.5.1.4.1.1.66.6^Tractography Results Storage^2^New|dicom.JPG")=""
 +13       SET MAGN("1.2.840.10008.5.1.4.1.1.67^Real World Value Mapping Storage^2^New|dicom.JPG")=""
 +14       SET MAGN("1.2.840.10008.5.1.4.1.1.68.1^Surface Scan Mesh Storage^2^New|dicom.JPG")=""
 +15       SET MAGN("1.2.840.10008.5.1.4.1.1.68.2^Surface Scan Point Cloud Storage^2^New|dicom.JPG")=""
 +16       SET MAGN("1.2.840.10008.5.1.4.1.1.88.34^Comprehensive 3D SR Storage^2^New|dicom.JPG")=""
 +17       SET MAGN("1.2.840.10008.5.1.4.1.1.88.35^Extensible SR Storage^2^New|dicom.JPG")=""
 +18       SET MAGN("1.2.840.10008.5.1.4.1.1.88.70^Implantation Plan SR Document Storage^2^New|dicom.JPG")=""
 +19       SET MAGN("1.2.840.10008.5.1.4.1.1.88.71^Acquisition Context SR Storage^2^New|dicom.JPG")=""
 +20       SET MAGN("1.2.840.10008.5.1.4.1.1.88.72^Simplified Adult Echo SR Storage^2^New|dicom.JPG")=""
 +21       SET MAGN("1.2.840.10008.5.1.4.1.1.88.73^Patient Radiation Dose SR Storage^2^New|dicom.JPG")=""
 +22       SET MAGN("1.2.840.10008.5.1.4.1.1.88.74^Planned Imaging Agent Administration SR Storage^2^New|dicom.JPG")=""
 +23       SET MAGN("1.2.840.10008.5.1.4.1.1.88.75^Performed Imaging Agent Administration SR Storage^2^New|dicom.JPG")=""
 +24       SET MAGN("1.2.840.10008.5.1.4.1.1.104.2^Encapsulated CDA Storage^2^New|dicom.JPG")=""
 +25       SET MAGN("1.2.840.10008.5.1.4.1.1.104.3^Encapsulated STL Storage^2^New|dicom.JPG")=""
 +26       SET MAGN("1.2.840.10008.5.1.4.1.1.104.4^Encapsulated OBJ Storage^2^New|dicom.JPG")=""
 +27       SET MAGN("1.2.840.10008.5.1.4.1.1.104.5^Encapsulated MTL Storage^2^New|dicom.JPG")=""
 +28       SET MAGN("1.2.840.10008.5.1.4.1.1.481.9^RT Ion Beams Treatment Record Storage^2^New|dicom.JPG")=""
 +29       SET MAGN("1.2.840.10008.5.1.4.1.1.481.10^RT Physician Intent Storage^2^New|dicom.JPG")=""
 +30       SET MAGN("1.2.840.10008.5.1.4.1.1.481.11^RT Segment Annotation Storage^2^New|dicom.JPG")=""
 +31       SET MAGN("1.2.840.10008.5.1.4.1.1.481.12^RT Radiation Set Storage^2^New|dicom.JPG")=""
 +32       SET MAGN("1.2.840.10008.5.1.4.1.1.481.13^C-Arm Photon-Electron Radiation Storage^2^New|dicom.JPG")=""
 +33       SET MAGN("1.2.840.10008.5.1.4.1.1.481.14^Tomotherapeutic Radiation Storage^2^New|dicom.JPG")=""
 +34       SET MAGN("1.2.840.10008.5.1.4.1.1.481.15^Robotic-Arm Radiation Storage^2^New|dicom.JPG")=""
 +35       SET MAGN("1.2.840.10008.5.1.4.1.1.481.16^RT Radiation Record Set Storage^2^New|dicom.JPG")=""
 +36       SET MAGN("1.2.840.10008.5.1.4.1.1.481.17^RT Radiation Salvage Record Storage^2^New|dicom.JPG")=""
 +37       SET MAGN("1.2.840.10008.5.1.4.1.1.481.18^Tomotherapeutic Radiation Record Storage^2^New|dicom.JPG")=""
 +38       SET MAGN("1.2.840.10008.5.1.4.1.1.481.19^C-Arm Photon-Electron Radiation Record Storage^2^New|dicom.JPG")=""
 +39       SET MAGN("1.2.840.10008.5.1.4.1.1.481.20^Robotic Radiation Record Storage^2^New|dicom.JPG")=""
 +40       SET MAGN("1.2.840.10008.5.1.4.34.7^RT Beams Delivery Instruction Storage^2^New|dicom.JPG")=""
 +41       SET MAGN("1.2.840.10008.5.1.4.34.10^RT Brachy Application Setup Delivery Instruction Storage^2^New|dicom.JPG")=""
 +42      ;
 +43       NEW MAGNFDA,MAGNIEN,MAGNXE,I
 +44       NEW PURPOSE,TYPE,SUBTYPE
 +45       NEW UID,UIDDESCR,ACTION,COMMENT
 +46       SET I=""
 +47       SET PURPOSE="Storage SCP"
 +48       SET TYPE="SOP Class"
 +49       SET SUBTYPE="Storage"
 +50       FOR 
               SET I=$ORDER(MAGN(I))
               if I=""
                   QUIT 
               Begin DoDot:1
 +51               KILL MAGNFDA,MAGNIEN,MAGNXE
 +52               SET UID=$PIECE(I,"^",1)
 +53               SET UIDDESCR=$PIECE(I,"^",2)
 +54               SET ACTION=$PIECE(I,"^",3)
 +55               SET COMMENT=$PIECE(I,"^",4)
 +56               SET MAGNFDA(2006.539,"?+1,",.01)=UID
 +57               SET MAGNFDA(2006.539,"?+1,",2)=UIDDESCR
 +58               SET MAGNFDA(2006.539,"?+1,",3)=TYPE
 +59               SET MAGNFDA(2006.539,"?+1,",4)=SUBTYPE
 +60               SET MAGNFDA(2006.5391,"?+2,?+1,",.01)=PURPOSE
 +61               SET MAGNFDA(2006.5391,"?+2,?+1,",2)=ACTION
 +62               SET MAGNFDA(2006.5391,"?+2,?+1,",3)=COMMENT
 +63               DO UPDATE^DIE("S","MAGNFDA","MAGNIEN","MAGNXE")
 +64               IF $DATA(MAGNXE("DIERR","E"))
                       WRITE !,"Error updating DICOM UID SPECIFIC ACTION file (#2006.539): ",I
 +65               QUIT 
               End DoDot:1
 +66       WRITE !,"Update of DICOM UID SPECIFIC ACTION file (#2006.539) is done"
 +67       QUIT