MAGIP079 ;;WOIFO/MAT - DICOM Storage Commit Post-install  ; 8 Jul 2013  12:49 PM
 ;;3.0;IMAGING;**79**;Mar 19, 2002;Build 5366;Aug 30, 2013
 ;; 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.                     |
 ;; +---------------------------------------------------------------+
 ;;
 Q
 ;
 ;+++++ INSTALLATION ERROR HANDLING
ERROR ;
 S:$D(XPDNM) XPDABORT=1
 ;--- Display the messages and store them to the INSTALL file (#9.7).
 D DUMP^MAGUERR1(),ABTMSG^MAGKIDS()
 Q
 ;
 ;***** POST-INSTALL CODE
 ;
POS ;
 N CALLBACK
 D CLEAR^MAGUERR(1)
 ;
 N MENU
 ;
 ;--- 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
 ;
 ;***** Below functionality is deprecated here as it has been consolidated
 ;        in the MAG*3.0*138 post-install routine. Retaining the below for
 ;        reference only.
 ;
 ;--- Link new remote procedures to context option MAG DICOM VISA.
 ;S CALLBACK="$$ADDRPCS^"_$NA(MAGKIDS1("RPCL079^"_$T(+0),"MAG DICOM VISA"))
 ;I $$CP^MAGKIDS("MAG ATTACH RPCS P79",CALLBACK)<0 D ERROR Q
 ;
 ;--- Add WORKLIST entry.
 ;S CALLBACK="$$ADDWRKLS^"_$T(+0)_"()"
 ;I $$CP^MAGKIDS("MAG ADD WORKLIST ENTRY",CALLBACK)<0 D ERROR Q
 ;
 ;--- Add MAG WORK ITEM STATUS entries.
 ;S CALLBACK="$$ADDSTATS^"_$T(+0)_"()"
 ;I $$CP^MAGKIDS("MAG ADD WORK ITEM STATUS",CALLBACK)<0 D ERROR Q
 ;
 ;--- Add StorageCommit entry to the MAG WORK ITEM SUBTYPE file.
 ;S CALLBACK="$$ADDSUBTP^"_$T(+0)_"()"
 ;I $$CP^MAGKIDS("MAG ADD WORK ITEM SUBTYPE",CALLBACK)<0 D ERROR Q
 ;
 ;--- 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
 ;
 ;--- Add StorageCommit STATUS values to the MAG WORK ITEM STATUS file.
 ;
ADDSTATS() ;
 N CT,FDA1,FILE,STATUS S CT=0,FILE=2006.9413
 F STATUS="RECEIVED","IN PROGRESS","SUCCESS","SUCCESS SENT","FAILURE" D
 . I '$D(^MAGV(FILE,"B",STATUS)) S CT=CT+1,FDA1(FILE,"+"_CT_",",.01)=STATUS
 . Q
 F STATUS="FAILURE SENT","SENDING RESPONSE FAILED" D
 . I '$D(^MAGV(FILE,"B",STATUS)) S CT=CT+1,FDA1(FILE,"+"_CT_",",.01)=STATUS
 . Q
 D:CT UPDATE^DIE("","FDA1")
 Q 0
 ;
 ;--- Add a StorageCommit entry to the MAG WORK ITEM SUBTYPE file.
 ;
ADDSUBTP() ;
 Q:$D(^MAGV(2006.9414,"B","StorageCommit")) 0
 N FDA1
 S FDA1(2006.9414,"+1,",.01)="StorageCommit"
 D UPDATE^DIE("","FDA1")
 Q 0
 ;
 ;--- Add a StorageCommit entry to the WORKLIST file.
 ;
ADDWRKLS() ;
 Q:$D(^MAGV(2006.9412,"B","StorageCommit")) 0
 N FDA1
 S FDA1(2006.9412,"+1,",.01)="StorageCommit"
 D UPDATE^DIE("","FDA1")
 Q 0
 ;
RPCL079 ;
 ;;MAG DICOM CHECK AE TITLE
 ;;MAG DICOM GET AE ENTRY
 ;;MAG DICOM GET AE ENTRY LOC
 ;;MAGVC WI DELETE
 ;;MAGVC WI GET
 ;;MAGVC WI LIST
 ;;MAGVC WI SUBMIT NEW
 ;;MAGVC WI UPDATE STATUS
 Q
 ;
 ; MAGIP079
 
--- Routine Detail   --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HMAGIP079   3739     printed  Sep 23, 2025@19:39:53                                                                                                                                                                                                    Page 2
MAGIP079  ;;WOIFO/MAT - DICOM Storage Commit Post-install  ; 8 Jul 2013  12:49 PM
 +1       ;;3.0;IMAGING;**79**;Mar 19, 2002;Build 5366;Aug 30, 2013
 +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       QUIT 
 +18      ;
 +19      ;+++++ INSTALLATION ERROR HANDLING
ERROR     ;
 +1        if $DATA(XPDNM)
               SET XPDABORT=1
 +2       ;--- Display the messages and store them to the INSTALL file (#9.7).
 +3        DO DUMP^MAGUERR1()
           DO ABTMSG^MAGKIDS()
 +4        QUIT 
 +5       ;
 +6       ;***** POST-INSTALL CODE
 +7       ;
POS       ;
 +1        NEW CALLBACK
 +2        DO CLEAR^MAGUERR(1)
 +3       ;
 +4        NEW MENU
 +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      ;***** Below functionality is deprecated here as it has been consolidated
 +12      ;        in the MAG*3.0*138 post-install routine. Retaining the below for
 +13      ;        reference only.
 +14      ;
 +15      ;--- Link new remote procedures to context option MAG DICOM VISA.
 +16      ;S CALLBACK="$$ADDRPCS^"_$NA(MAGKIDS1("RPCL079^"_$T(+0),"MAG DICOM VISA"))
 +17      ;I $$CP^MAGKIDS("MAG ATTACH RPCS P79",CALLBACK)<0 D ERROR Q
 +18      ;
 +19      ;--- Add WORKLIST entry.
 +20      ;S CALLBACK="$$ADDWRKLS^"_$T(+0)_"()"
 +21      ;I $$CP^MAGKIDS("MAG ADD WORKLIST ENTRY",CALLBACK)<0 D ERROR Q
 +22      ;
 +23      ;--- Add MAG WORK ITEM STATUS entries.
 +24      ;S CALLBACK="$$ADDSTATS^"_$T(+0)_"()"
 +25      ;I $$CP^MAGKIDS("MAG ADD WORK ITEM STATUS",CALLBACK)<0 D ERROR Q
 +26      ;
 +27      ;--- Add StorageCommit entry to the MAG WORK ITEM SUBTYPE file.
 +28      ;S CALLBACK="$$ADDSUBTP^"_$T(+0)_"()"
 +29      ;I $$CP^MAGKIDS("MAG ADD WORK ITEM SUBTYPE",CALLBACK)<0 D ERROR Q
 +30      ;
 +31      ;--- Send the notification e-mail
 +32      ;D BMES^XPDUTL("Post Install Mail Message: "_$$FMTE^XLFDT($$NOW^XLFDT))
 +33      ;D INS^MAGQBUT4(XPDNM,DUZ,$$NOW^XLFDT,XPDA)
 +34       QUIT 
 +35      ;
 +36      ;--- Add StorageCommit STATUS values to the MAG WORK ITEM STATUS file.
 +37      ;
ADDSTATS() ;
 +1        NEW CT,FDA1,FILE,STATUS
           SET CT=0
           SET FILE=2006.9413
 +2        FOR STATUS="RECEIVED","IN PROGRESS","SUCCESS","SUCCESS SENT","FAILURE"
               Begin DoDot:1
 +3                IF '$DATA(^MAGV(FILE,"B",STATUS))
                       SET CT=CT+1
                       SET FDA1(FILE,"+"_CT_",",.01)=STATUS
 +4                QUIT 
               End DoDot:1
 +5        FOR STATUS="FAILURE SENT","SENDING RESPONSE FAILED"
               Begin DoDot:1
 +6                IF '$DATA(^MAGV(FILE,"B",STATUS))
                       SET CT=CT+1
                       SET FDA1(FILE,"+"_CT_",",.01)=STATUS
 +7                QUIT 
               End DoDot:1
 +8        if CT
               DO UPDATE^DIE("","FDA1")
 +9        QUIT 0
 +10      ;
 +11      ;--- Add a StorageCommit entry to the MAG WORK ITEM SUBTYPE file.
 +12      ;
ADDSUBTP() ;
 +1        if $DATA(^MAGV(2006.9414,"B","StorageCommit"))
               QUIT 0
 +2        NEW FDA1
 +3        SET FDA1(2006.9414,"+1,",.01)="StorageCommit"
 +4        DO UPDATE^DIE("","FDA1")
 +5        QUIT 0
 +6       ;
 +7       ;--- Add a StorageCommit entry to the WORKLIST file.
 +8       ;
ADDWRKLS() ;
 +1        if $DATA(^MAGV(2006.9412,"B","StorageCommit"))
               QUIT 0
 +2        NEW FDA1
 +3        SET FDA1(2006.9412,"+1,",.01)="StorageCommit"
 +4        DO UPDATE^DIE("","FDA1")
 +5        QUIT 0
 +6       ;
RPCL079   ;
 +1       ;;MAG DICOM CHECK AE TITLE
 +2       ;;MAG DICOM GET AE ENTRY
 +3       ;;MAG DICOM GET AE ENTRY LOC
 +4       ;;MAGVC WI DELETE
 +5       ;;MAGVC WI GET
 +6       ;;MAGVC WI LIST
 +7       ;;MAGVC WI SUBMIT NEW
 +8       ;;MAGVC WI UPDATE STATUS
 +9        QUIT 
 +10      ;
 +11      ; MAGIP079