MAGIP118 ;WOIFO/NST,DAC - Install code for MAG*3.0*118 ; 6 Mar 2013 4:35 PM
;;3.0;IMAGING;**118**;Mar 19, 2002;Build 4525;May 01, 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. |
;; +---------------------------------------------------------------+
;;
;***** Environment Check
N IEN
S IEN=0
S IEN=$O(^MAGD(2006.575,IEN))
I +IEN'="0" S XPDQUIT=2 W !,"You must resolve all failed image entries via the Correct RAD-DICOM File option before installation.",!
S IEN=0
S IEN=$O(^MAGD(2006.5752,IEN))
I +IEN'="0" S XPDQUIT=2 W !,"You must resolve all IMPORTABLE DICOM OBJECTS (#2006.5752) file entries before installation.",!
I $G(XPDQUIT)=2 W !,"Installation aborted."
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)
;
N MAGKIDS1,MENU
;
; Execute post install for patch 34
D ADDAD^MAGIP118 ; Update Artifact Descriptor file (#2006.915)
D STORAGE^MAGIP118
D CLEAN ; Clean up DDs and DICOM UID SPECIFIC ACTION file (#2006.539)
D UPDATE^MAGVSOPU ; Update DICOM UID SPECIFIC ACTION file (#2006.539)
D UPDATE^MAGVSOPC ; Update DICOM SOP CLASS file (#2006.532)
D CLEANUP^MAGFXQRS ; clean up headers on QUERY/RETRIEVE STATISTICS file (#2006.5733)
S MENU=$$ADD^XPDMENU("MAG SYS MENU","MAGV AE SEC MX SETTINGS") ; Add Edit AE Security Matrix option
S MENU=$$ADD^XPDMENU("MAG SYS MENU","MAG SYS-DELETE STUDY") ; Delete study by Accession number
S MENU=$$ADD^XPDMENU("MAG SYS MENU","MAGD DICOM MENU")
S MENU=$$ADD^XPDMENU("MAG SYS MENU","MAGV HDIG MENU")
S MENU=$$ADD^XPDMENU("MAGV HDIG MENU","MAGVA ASYNC STORAGE ERR QURY")
S MENU=$$ADD^XPDMENU("MAGV HDIG MENU","MAGVA ASYNC STORAGE ERR LIST")
S MENU=$$ADD^XPDMENU("MAGV HDIG MENU","MAGVA ASYNC STORAGE ERR REQU")
;
;
;--- Link new remote procedures to context option MAG DICOM VISA.
S CALLBACK="$$ADDRPCS^"_$NA(MAGKIDS1("RPCL34V^"_$T(+0),"MAG DICOM VISA"))
I $$CP^MAGKIDS("MAG ATTACH RPCS P34",CALLBACK)<0 D ERROR Q
;
S CALLBACK="$$ADDRPCS^"_$NA(MAGKIDS1("RPCL116V^"_$T(+0),"MAG DICOM VISA"))
I $$CP^MAGKIDS("MAG ATTACH RPCS P116",CALLBACK)<0 D ERROR Q
;
S CALLBACK="$$ADDRPCS^"_$NA(MAGKIDS1("RPCL118V^"_$T(+0),"MAG DICOM VISA"))
I $$CP^MAGKIDS("MAG ATTACH RPCS P118",CALLBACK)<0 D ERROR Q
;
;--- Link new remote procedures to the Broker context option.
S CALLBACK="$$ADDRPCS^"_$NA(MAGKIDS1("RPCL118W^"_$T(+0),"MAG WINDOWS"))
I $$CP^MAGKIDS("MAG ATTACH RPCS P118 WIN",CALLBACK)<0 D ERROR Q
;
;--- Add IMPORTER entry to DICOM AE Security Matrix
I $$CP^MAGKIDS("MAG IMPORTER AE ENTRY","$$ADDIMPAE^"_$T(+0))<0 D ERROR Q
;
;--- Add IMAGING EVENT ACTION file (#2006.931) entries
I $$CP^MAGKIDS("MAG EVENT ACTIONS","$$ADDEVENT^"_$T(+0))<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
;
;***** PRE-INSTALL CODE
PRE ;
;--- Delete the FORCE RECONCILIATION field (#1.3)
D DELFLDS^MAGKIDS(2006.9192,"1.3")
Q
;+++++ LIST OF NEW REMOTE PROCEDURES
; have a list in format ;;MAG4 IMAGE LIST
RPCL34V ;
;;MAGV ATTACH IMAGE INSTANCE
;;MAGV ATTACH PAT PROC REF
;;MAGV ATTACH SERIES
;;MAGV ATTACH SOP
;;MAGV ATTACH STUDY
;;MAGV CREATE DICOM FAILED IMAGE
;;MAGV CREATE PAT REF
;;MAGV DELETE DICOM FAILED IMAGE
;;MAGV DGW ACTION UID LIST
;;MAGV DGW INSTRUMENT LIST
;;MAGV DGW MODALITY LIST
;;MAGV DICOM GET COUNT
;;MAGV DICOM SET INSTRUMENT LIST
;;MAGV DICOM SET MODALITY LIST
;;MAGV FIND PAT REF
;;MAGV FIND PROC REF
;;MAGV FIND SERIES BY REFERENCE
;;MAGV FIND SERIES BY UID
;;MAGV FIND SOP BY UID
;;MAGV FIND STUDY BY UID
;;MAGV GET ACCESSION NUM
;;MAGV GET DGW CONFIG
;;MAGV GET DICOM FAILED IMAGE
;;MAGV GET IMAGE FILE
;;MAGV GET ORIG IMAGE FILE
;;MAGV GET PAT INFO
;;MAGV GET PAT REF ATTS
;;MAGV GET PROC REF ATTS
;;MAGV GET PROCEDURE INFO
;;MAGV GET REPORT
;;MAGV GET SERIES
;;MAGV GET SOP DATA
;;MAGV GET STUDY
;;MAGV INACTIVATE INSTANCE FILE
;;MAGV INACTIVATE PAT REF
;;MAGV INACTIVATE PROC REF
;;MAGV INACTIVATE SERIES
;;MAGV INACTIVATE SOP
;;MAGV INACTIVATE STUDY
;;MAGV SERIES UID CHECK
;;MAGV SET DGW CONFIG
;;MAGV SET DICOM FAILED IMAGE
;;MAGV SOP UID CHECK
;;MAGV STUDY LOOKUP
;;MAGV STUDY UID CHECK
;;MAGV TRAVERSE IMAGE FILE
;;MAGV TRAVERSE PROC REF
;;MAGV TRAVERSE SERIES
;;MAGV TRAVERSE SOP
;;MAGV TRAVERSE STUDY
;;MAGV UPDATE IMAGE FILE
;;MAGV UPDATE PAT PROC REF
;;MAGV UPDATE PAT REF
;;MAGV UPDATE SERIES
;;MAGV UPDATE SOP
;;MAGV UPDATE STUDY
;;MAGVA CREATE AD
;;MAGVA CREATE AINSTANCE
;;MAGVA CREATE ARETPOL
;;MAGVA CREATE ARTIFACT W KL
;;MAGVA CREATE KEYLIST
;;MAGVA CREATE PROVAVAILTY
;;MAGVA CREATE PROVIDER
;;MAGVA CREATE QUEUE
;;MAGVA CREATE RETPOL
;;MAGVA CREATE RETPOL PROV MAP
;;MAGVA CREATE RETPOLFF
;;MAGVA CREATE STORAGE TA
;;MAGVA CREATE TRF STATS
;;MAGVA DELETE KEYLIST
;;MAGVA DELETE PROVAVAILTY
;;MAGVA DELETE RETPOL PROV MAP
;;MAGVA DEQUEUE Q MSG
;;MAGVA ENQUEUE Q MSG
;;MAGVA FIND KEYLIST
;;MAGVA GET A AIS ARPS AND RPFFS
;;MAGVA GET A W KL AND AIS
;;MAGVA GET A W KL AND AIS BY KL
;;MAGVA GET A W KL AND AIS BY PK
;;MAGVA GET ALL ADS
;;MAGVA GET ALL PROVAVAILS
;;MAGVA GET ALL PROVIDERS
;;MAGVA GET ALL QUEUES
;;MAGVA GET ALL RETPOL PROV MAPS
;;MAGVA GET ALL RETPOLS
;;MAGVA GET ALL SITE PARAM IDS
;;MAGVA GET ARTIFACT W KL
;;MAGVA GET CWL
;;MAGVA GET JUKEBOX WL
;;MAGVA GET KEYLIST
;;MAGVA GET NET LOC DETAILS
;;MAGVA PEEK Q MSG
;;MAGVA SET AD RETPOL
;;MAGVA UPDATE ARETPOL
;;MAGVA UPDATE ARTIFACT
;;MAGVA UPDATE LAST ACCESS DT
;;MAGVA UPDATE PROVAVAILTY
;;MAGVA UPDATE PROVIDER
;;MAGVA UPDATE RETPOL PROV MAP
;;MAG DICOM CHECK AE TITLE
;;MAG DICOM VISTA AE TITLE
;;MAG DICOM GET GATEWAY INFO
Q 0
;
RPCL116V ;
;;MAG EVENT AUDIT
Q 0
;
RPCL118V ;
;;MAG CFIND QUERY
;;MAG DICOM GET HOSP LOCATION
;;MAG DICOM RADIOLOGY MODIFIERS
;;MAG DICOM RADIOLOGY PROCEDURES
;;MAG EVENT AUDIT
;;MAG IMAGE CURRENT INFO
;;MAG STUDY UID QUERY
;;MAG4 INDEX GET ORIGIN
;;MAGG INSTALL
;;MAGV ADD WORK ITEM TAGS
;;MAGV CONFIRM RAD ORDER
;;MAGV CREATE WORK ITEM
;;MAGV DELETE WORK ITEM
;;MAGV FIND WORK ITEM
;;MAGV GET NEXT WORK ITEM
;;MAGV GET PAT ORDERS
;;MAGV GET RADIOLOGY PROCEDURES
;;MAGV GET WORK ITEM
;;MAGV GET WORKLISTS
;;MAGV IMPORT STATUS
;;MAGV UPDATE WORK ITEM
;;MAGV IMPORT MEDIA LOG STORE
;;MAGV IMPORT STUDY LOG REPORT
;;MAGV IMPORT STUDY LOG STORE
;;MAGV RAD EXAM ORDER
;;MAGV RAD EXAM REGISTER
;;MAGV RAD STAT COMPLETE
;;MAGV RAD STAT EXAMINED
;;MAGV WORK ITEMS COUNT
;;PSB GETPROVIDER
Q 0
;
RPCL118W ;
;;MAG FILEMAN FIELD ATTS
;;MAG FILEMAN FIELD LIST
;;MAGV SEARCH BY ATTRIBUTE
;;XUS DIVISION GET
Q 0
;
;--- Add an import entry to the AE Security Matrix
;
ADDIMPAE() ;
N FDA1,FDA2,FDA3,SMIEN
I $D(^MAGV(2006.9192,"B","IMPORTER")) Q 0
S FDA1(2006.9192,"+1,",.01)="IMPORTER"
S FDA1(2006.9192,"+1,",1)="VISTA_STORAGE"
S FDA1(2006.9192,"+1,",1.1)="IMPORTER"
S FDA1(2006.9192,"+1,",1.3)=1
S FDA1(2006.9192,"+1,",2)=$G(DUZ(2))
S FDA1(2006.9192,"+1,",6)=1
S FDA1(2006.9192,"+1,",7)=1
S FDA1(2006.9192,"+1,",8)=1
S FDA1(2006.9192,"+1,",9)=1
S FDA1(2006.9192,"+1,",10)=1
S FDA1(2006.9192,"+1,",11)="RAD"
D UPDATE^DIE("","FDA1","SMIEN")
S FDA2(2006.919212,"+1,"_SMIEN(1)_",",.01)=1
S FDA2(2006.919212,"+1,"_SMIEN(1)_",",1)=1
D UPDATE^DIE("","FDA2")
Q 0
;
;--- Add new entries to the IMAGING EVENT ACTION file (#2006.931).
;
ADDEVENT() ;
N CT,FDA1,FILE,NAME S CT=0,FILE=2006.931
F NAME="CLIENT LOGIN","IMPORTER AE SECURITY SUCCESS","IMPORTER AE SECURITY FAILURE" D
. I '$D(^MAGV(FILE,"B",NAME)) S CT=CT+1,FDA1(FILE,"+"_CT_",",.01)=NAME
D:CT UPDATE^DIE("","FDA1")
Q 0
;
STORAGE ; Loop through IMAGE (#2006.1) file and update STORAGE PROVIDER (#2006.917) file
N IEN
S IEN=0
F S IEN=$O(^MAG(2006.1,IEN)) Q:+IEN=0 D
. D ADDP(IEN)
. Q
Q
ADDP(IEN) ; Add STORAGE PROVIDER file (#2006.917)
I $D(^MAGV(2006.917,"B",IEN)) Q
N MAGPARAM,MAGRY,RESDEL,PIEN1,PIEN2
S RESDEL=$$RESDEL^MAGVAF02
S MAGPARAM("STORAGE PROVIDER TYPE")="RAID"
S MAGPARAM("STORAGE PLACE")=IEN
S MAGPARAM("ARCHIVE")=0
S MAGPARAM("PRIMARY STORAGE")=1
S MAGPARAM("WRITABLE")=1
D ADDPRV^MAGVAC01(.MAGRY,.MAGPARAM)
S PIEN1=$P(MAGRY,RESDEL,3)
K MAGRY,MAGPARAM
S MAGPARAM("STORAGE PROVIDER TYPE")="JUKEBOX"
S MAGPARAM("STORAGE PLACE")=IEN
S MAGPARAM("ARCHIVE")=1
S MAGPARAM("PRIMARY STORAGE")=0
S MAGPARAM("WRITABLE")=1
D ADDPRV^MAGVAC01(.MAGRY,.MAGPARAM)
S PIEN2=$P(MAGRY,RESDEL,3)
D ADDRE(IEN,PIEN1,1),ADDRE(IEN,PIEN2,0)
D ADDPA(IEN,PIEN1),ADDPA(IEN,PIEN2)
Q
ADDRE(IEN,PIEN,RAID) ; Add Retention - 2006.923
N MAGPARAM,MAGRY
S MAGPARAM("RETENTION POLICY")=1
S MAGPARAM("STORAGE PROVIDER")=PIEN
S MAGPARAM("SOURCE PLACE")=IEN
S MAGPARAM("SYNCHRONOUS")=$S(RAID=1:1,1:0)
S MAGPARAM("OFFSITE")=$S(RAID=1:0,1:0)
D ADDRPPM^MAGVAC01(.MAGRY,.MAGPARAM)
Q
ADDPA(IEN,PIEN) ; Add Storage Provider Availability file (#2006.924)
N MAGPARAM,MAGRY
S MAGPARAM("STORAGE PROVIDER")=PIEN
S MAGPARAM("SOURCE PLACE")=IEN
S MAGPARAM("START TIME")="20000101.0001"
S MAGPARAM("END TIME")="20000101.0001"
D ADDPA^MAGVAC01(.MAGRY,.MAGPARAM)
Q
ADDAD ; Add Artifact Descriptor file (#2006.915)
N RES,MAGPARAM,I,J,DA,DIK
S DIK="^MAGV(2006.915,"
; Delete the data first
S (I,J)=""
F S I=$O(^MAGV(2006.915,"B",I)) Q:I="" D
. F S J=$O(^MAGV(2006.915,"B",I,J)) Q:J="" D
. . S DA=J
. . D ^DIK
. . Q
. Q
; Add new records
S MAGPARAM("ARTIFACT FORMAT")="DICOM"
S MAGPARAM("ARTIFACT TYPE")="MedicalImage"
S MAGPARAM("FILE EXTENSION")="dcm"
S MAGPARAM("ACTIVE")=1
S MAGPARAM("RETENTION POLICY")=1
D ADDAD^MAGVAC01(.RES,.MAGPARAM)
;
K MAGPARAM
S MAGPARAM("ARTIFACT FORMAT")="JPEG"
S MAGPARAM("ARTIFACT TYPE")="MedicalImageAbstract"
S MAGPARAM("FILE EXTENSION")="jpg"
S MAGPARAM("ACTIVE")=1
S MAGPARAM("RETENTION POLICY")="1"
D ADDAD^MAGVAC01(.RES,.MAGPARAM)
Q
CLEAN ; Clean up DDs
D CLEANAE
D CLEANISP
D UIDS
D CLEANDDS
D WHISTORY
D CLEANQ(4,"",$$FMADD^XLFDT($$NOW^XLFDT(),-30)) ; Clean up QUEUE MESSAGE file (#2006.928)
Q
CLEANQ(QUEUEIEN,MAGBDT,MAGEDT) ; Clean up QUEUE MESSAGE file (#2006.928)
; QUEUEIEN -- Queue IEN in QUEUE file (#2006.924) - e.g., 4 - Email Queue
; MAGBDT -- From Date
; MAGEDT -- Through Date
N FDA,IEN,MAGDT
S MAGDT=$O(^MAGV(2006.928,"ENQDT",QUEUEIEN,MAGBDT-1))
F S MAGDT=$O(^MAGV(2006.928,"ENQDT",QUEUEIEN,MAGDT)) Q:MAGDT=""!(MAGDT>MAGEDT) D
. S IEN=""
. F S IEN=$O(^MAGV(2006.928,"ENQDT",QUEUEIEN,MAGDT,IEN)) Q:IEN="" D
. . K FDA
. . S FDA(2006.928,IEN_",",.01)="@"
. . D FILE^DIE("","FDA")
. . Q
. Q
Q
CLEANAE ; Remove user data from DICOM AE Security Matrix (#2006.9192) file
N AEIEN,FDA
S AEIEN=0
F S AEIEN=$O(^MAGV(2006.9192,AEIEN)) Q:+AEIEN=0 D
. I $P(^MAGV(2006.9192,AEIEN,0),U,7)'="" S FDA(2006.9192,AEIEN_",",2.1)="@"
. Q
I $D(FDA) D FILE^DIE("","FDA")
Q
CLEANISP ; Remove user data from Imaging Site Paramaters (#2006.1) file
N ISPIEN,FDA
S ISPIEN=0
F S ISPIEN=$O(^MAG(2006.1,ISPIEN)) Q:+ISPIEN=0 D
. I $P($G(^MAG(2006.1,ISPIEN,5)),U,1)'="" S FDA(2006.1,ISPIEN_",",104)="@"
. Q
I $D(FDA) D FILE^DIE("","FDA")
Q
CLEANDDS ; Remove user fields from DD entries in file 2006.1 and 2006.9192
I $$GET1^DID(2006.1,104,,"LABEL")="DEFAULT DICOM AE USER" D DELFLDS^MAGKIDS(2006.1,"104")
I $$GET1^DID(2006.9192,2.1,,"LABEL")="USER" D DELFLDS^MAGKIDS(2006.9192,"2.1")
Q
UIDS ; Clean up duplicate entries in the DICOM UID Specific Action (#2006.539) file
N FDA,FIRST,UID,UIDIEN
S UID=""
F S UID=$O(^MAGDICOM(2006.539,"B",UID)) Q:UID="" D
. S FIRST=1
. S UIDIEN=""
. F S UIDIEN=$O(^MAGDICOM(2006.539,"B",UID,UIDIEN)) Q:UIDIEN="" D
. . I 'FIRST S FDA(2006.539,UIDIEN_",",.01)="@"
. . S FIRST=0
. . Q
. Q
I $D(FDA) D FILE^DIE("","FDA","ERR")
Q
WHISTORY ; Remove Work Item History (#2006.9411) file and file entries
D DELFILE^MAGKIDS(2006.9411,"DE")
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HMAGIP118 13188 printed Dec 13, 2024@02:03:53 Page 2
MAGIP118 ;WOIFO/NST,DAC - Install code for MAG*3.0*118 ; 6 Mar 2013 4:35 PM
+1 ;;3.0;IMAGING;**118**;Mar 19, 2002;Build 4525;May 01, 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 ;***** Environment Check
+18 NEW IEN
+19 SET IEN=0
+20 SET IEN=$ORDER(^MAGD(2006.575,IEN))
+21 IF +IEN'="0"
SET XPDQUIT=2
WRITE !,"You must resolve all failed image entries via the Correct RAD-DICOM File option before installation.",!
+22 SET IEN=0
+23 SET IEN=$ORDER(^MAGD(2006.5752,IEN))
+24 IF +IEN'="0"
SET XPDQUIT=2
WRITE !,"You must resolve all IMPORTABLE DICOM OBJECTS (#2006.5752) file entries before installation.",!
+25 IF $GET(XPDQUIT)=2
WRITE !,"Installation aborted."
+26 QUIT
+27 ;
+28 ;+++++ 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 NEW MAGKIDS1,MENU
+5 ;
+6 ; Execute post install for patch 34
+7 ; Update Artifact Descriptor file (#2006.915)
DO ADDAD^MAGIP118
+8 DO STORAGE^MAGIP118
+9 ; Clean up DDs and DICOM UID SPECIFIC ACTION file (#2006.539)
DO CLEAN
+10 ; Update DICOM UID SPECIFIC ACTION file (#2006.539)
DO UPDATE^MAGVSOPU
+11 ; Update DICOM SOP CLASS file (#2006.532)
DO UPDATE^MAGVSOPC
+12 ; clean up headers on QUERY/RETRIEVE STATISTICS file (#2006.5733)
DO CLEANUP^MAGFXQRS
+13 ; Add Edit AE Security Matrix option
SET MENU=$$ADD^XPDMENU("MAG SYS MENU","MAGV AE SEC MX SETTINGS")
+14 ; Delete study by Accession number
SET MENU=$$ADD^XPDMENU("MAG SYS MENU","MAG SYS-DELETE STUDY")
+15 SET MENU=$$ADD^XPDMENU("MAG SYS MENU","MAGD DICOM MENU")
+16 SET MENU=$$ADD^XPDMENU("MAG SYS MENU","MAGV HDIG MENU")
+17 SET MENU=$$ADD^XPDMENU("MAGV HDIG MENU","MAGVA ASYNC STORAGE ERR QURY")
+18 SET MENU=$$ADD^XPDMENU("MAGV HDIG MENU","MAGVA ASYNC STORAGE ERR LIST")
+19 SET MENU=$$ADD^XPDMENU("MAGV HDIG MENU","MAGVA ASYNC STORAGE ERR REQU")
+20 ;
+21 ;
+22 ;--- Link new remote procedures to context option MAG DICOM VISA.
+23 SET CALLBACK="$$ADDRPCS^"_$NAME(MAGKIDS1("RPCL34V^"_$TEXT(+0),"MAG DICOM VISA"))
+24 IF $$CP^MAGKIDS("MAG ATTACH RPCS P34",CALLBACK)<0
DO ERROR
QUIT
+25 ;
+26 SET CALLBACK="$$ADDRPCS^"_$NAME(MAGKIDS1("RPCL116V^"_$TEXT(+0),"MAG DICOM VISA"))
+27 IF $$CP^MAGKIDS("MAG ATTACH RPCS P116",CALLBACK)<0
DO ERROR
QUIT
+28 ;
+29 SET CALLBACK="$$ADDRPCS^"_$NAME(MAGKIDS1("RPCL118V^"_$TEXT(+0),"MAG DICOM VISA"))
+30 IF $$CP^MAGKIDS("MAG ATTACH RPCS P118",CALLBACK)<0
DO ERROR
QUIT
+31 ;
+32 ;--- Link new remote procedures to the Broker context option.
+33 SET CALLBACK="$$ADDRPCS^"_$NAME(MAGKIDS1("RPCL118W^"_$TEXT(+0),"MAG WINDOWS"))
+34 IF $$CP^MAGKIDS("MAG ATTACH RPCS P118 WIN",CALLBACK)<0
DO ERROR
QUIT
+35 ;
+36 ;--- Add IMPORTER entry to DICOM AE Security Matrix
+37 IF $$CP^MAGKIDS("MAG IMPORTER AE ENTRY","$$ADDIMPAE^"_$TEXT(+0))<0
DO ERROR
QUIT
+38 ;
+39 ;--- Add IMAGING EVENT ACTION file (#2006.931) entries
+40 IF $$CP^MAGKIDS("MAG EVENT ACTIONS","$$ADDEVENT^"_$TEXT(+0))<0
DO ERROR
QUIT
+41 ;
+42 ;--- Send the notification e-mail
+43 DO BMES^XPDUTL("Post Install Mail Message: "_$$FMTE^XLFDT($$NOW^XLFDT))
+44 DO INS^MAGQBUT4(XPDNM,DUZ,$$NOW^XLFDT,XPDA)
+45 QUIT
+46 ;
+47 ;***** PRE-INSTALL CODE
PRE ;
+1 ;--- Delete the FORCE RECONCILIATION field (#1.3)
+2 DO DELFLDS^MAGKIDS(2006.9192,"1.3")
+3 QUIT
+4 ;+++++ LIST OF NEW REMOTE PROCEDURES
+5 ; have a list in format ;;MAG4 IMAGE LIST
RPCL34V ;
+1 ;;MAGV ATTACH IMAGE INSTANCE
+2 ;;MAGV ATTACH PAT PROC REF
+3 ;;MAGV ATTACH SERIES
+4 ;;MAGV ATTACH SOP
+5 ;;MAGV ATTACH STUDY
+6 ;;MAGV CREATE DICOM FAILED IMAGE
+7 ;;MAGV CREATE PAT REF
+8 ;;MAGV DELETE DICOM FAILED IMAGE
+9 ;;MAGV DGW ACTION UID LIST
+10 ;;MAGV DGW INSTRUMENT LIST
+11 ;;MAGV DGW MODALITY LIST
+12 ;;MAGV DICOM GET COUNT
+13 ;;MAGV DICOM SET INSTRUMENT LIST
+14 ;;MAGV DICOM SET MODALITY LIST
+15 ;;MAGV FIND PAT REF
+16 ;;MAGV FIND PROC REF
+17 ;;MAGV FIND SERIES BY REFERENCE
+18 ;;MAGV FIND SERIES BY UID
+19 ;;MAGV FIND SOP BY UID
+20 ;;MAGV FIND STUDY BY UID
+21 ;;MAGV GET ACCESSION NUM
+22 ;;MAGV GET DGW CONFIG
+23 ;;MAGV GET DICOM FAILED IMAGE
+24 ;;MAGV GET IMAGE FILE
+25 ;;MAGV GET ORIG IMAGE FILE
+26 ;;MAGV GET PAT INFO
+27 ;;MAGV GET PAT REF ATTS
+28 ;;MAGV GET PROC REF ATTS
+29 ;;MAGV GET PROCEDURE INFO
+30 ;;MAGV GET REPORT
+31 ;;MAGV GET SERIES
+32 ;;MAGV GET SOP DATA
+33 ;;MAGV GET STUDY
+34 ;;MAGV INACTIVATE INSTANCE FILE
+35 ;;MAGV INACTIVATE PAT REF
+36 ;;MAGV INACTIVATE PROC REF
+37 ;;MAGV INACTIVATE SERIES
+38 ;;MAGV INACTIVATE SOP
+39 ;;MAGV INACTIVATE STUDY
+40 ;;MAGV SERIES UID CHECK
+41 ;;MAGV SET DGW CONFIG
+42 ;;MAGV SET DICOM FAILED IMAGE
+43 ;;MAGV SOP UID CHECK
+44 ;;MAGV STUDY LOOKUP
+45 ;;MAGV STUDY UID CHECK
+46 ;;MAGV TRAVERSE IMAGE FILE
+47 ;;MAGV TRAVERSE PROC REF
+48 ;;MAGV TRAVERSE SERIES
+49 ;;MAGV TRAVERSE SOP
+50 ;;MAGV TRAVERSE STUDY
+51 ;;MAGV UPDATE IMAGE FILE
+52 ;;MAGV UPDATE PAT PROC REF
+53 ;;MAGV UPDATE PAT REF
+54 ;;MAGV UPDATE SERIES
+55 ;;MAGV UPDATE SOP
+56 ;;MAGV UPDATE STUDY
+57 ;;MAGVA CREATE AD
+58 ;;MAGVA CREATE AINSTANCE
+59 ;;MAGVA CREATE ARETPOL
+60 ;;MAGVA CREATE ARTIFACT W KL
+61 ;;MAGVA CREATE KEYLIST
+62 ;;MAGVA CREATE PROVAVAILTY
+63 ;;MAGVA CREATE PROVIDER
+64 ;;MAGVA CREATE QUEUE
+65 ;;MAGVA CREATE RETPOL
+66 ;;MAGVA CREATE RETPOL PROV MAP
+67 ;;MAGVA CREATE RETPOLFF
+68 ;;MAGVA CREATE STORAGE TA
+69 ;;MAGVA CREATE TRF STATS
+70 ;;MAGVA DELETE KEYLIST
+71 ;;MAGVA DELETE PROVAVAILTY
+72 ;;MAGVA DELETE RETPOL PROV MAP
+73 ;;MAGVA DEQUEUE Q MSG
+74 ;;MAGVA ENQUEUE Q MSG
+75 ;;MAGVA FIND KEYLIST
+76 ;;MAGVA GET A AIS ARPS AND RPFFS
+77 ;;MAGVA GET A W KL AND AIS
+78 ;;MAGVA GET A W KL AND AIS BY KL
+79 ;;MAGVA GET A W KL AND AIS BY PK
+80 ;;MAGVA GET ALL ADS
+81 ;;MAGVA GET ALL PROVAVAILS
+82 ;;MAGVA GET ALL PROVIDERS
+83 ;;MAGVA GET ALL QUEUES
+84 ;;MAGVA GET ALL RETPOL PROV MAPS
+85 ;;MAGVA GET ALL RETPOLS
+86 ;;MAGVA GET ALL SITE PARAM IDS
+87 ;;MAGVA GET ARTIFACT W KL
+88 ;;MAGVA GET CWL
+89 ;;MAGVA GET JUKEBOX WL
+90 ;;MAGVA GET KEYLIST
+91 ;;MAGVA GET NET LOC DETAILS
+92 ;;MAGVA PEEK Q MSG
+93 ;;MAGVA SET AD RETPOL
+94 ;;MAGVA UPDATE ARETPOL
+95 ;;MAGVA UPDATE ARTIFACT
+96 ;;MAGVA UPDATE LAST ACCESS DT
+97 ;;MAGVA UPDATE PROVAVAILTY
+98 ;;MAGVA UPDATE PROVIDER
+99 ;;MAGVA UPDATE RETPOL PROV MAP
+100 ;;MAG DICOM CHECK AE TITLE
+101 ;;MAG DICOM VISTA AE TITLE
+102 ;;MAG DICOM GET GATEWAY INFO
+103 QUIT 0
+104 ;
RPCL116V ;
+1 ;;MAG EVENT AUDIT
+2 QUIT 0
+3 ;
RPCL118V ;
+1 ;;MAG CFIND QUERY
+2 ;;MAG DICOM GET HOSP LOCATION
+3 ;;MAG DICOM RADIOLOGY MODIFIERS
+4 ;;MAG DICOM RADIOLOGY PROCEDURES
+5 ;;MAG EVENT AUDIT
+6 ;;MAG IMAGE CURRENT INFO
+7 ;;MAG STUDY UID QUERY
+8 ;;MAG4 INDEX GET ORIGIN
+9 ;;MAGG INSTALL
+10 ;;MAGV ADD WORK ITEM TAGS
+11 ;;MAGV CONFIRM RAD ORDER
+12 ;;MAGV CREATE WORK ITEM
+13 ;;MAGV DELETE WORK ITEM
+14 ;;MAGV FIND WORK ITEM
+15 ;;MAGV GET NEXT WORK ITEM
+16 ;;MAGV GET PAT ORDERS
+17 ;;MAGV GET RADIOLOGY PROCEDURES
+18 ;;MAGV GET WORK ITEM
+19 ;;MAGV GET WORKLISTS
+20 ;;MAGV IMPORT STATUS
+21 ;;MAGV UPDATE WORK ITEM
+22 ;;MAGV IMPORT MEDIA LOG STORE
+23 ;;MAGV IMPORT STUDY LOG REPORT
+24 ;;MAGV IMPORT STUDY LOG STORE
+25 ;;MAGV RAD EXAM ORDER
+26 ;;MAGV RAD EXAM REGISTER
+27 ;;MAGV RAD STAT COMPLETE
+28 ;;MAGV RAD STAT EXAMINED
+29 ;;MAGV WORK ITEMS COUNT
+30 ;;PSB GETPROVIDER
+31 QUIT 0
+32 ;
RPCL118W ;
+1 ;;MAG FILEMAN FIELD ATTS
+2 ;;MAG FILEMAN FIELD LIST
+3 ;;MAGV SEARCH BY ATTRIBUTE
+4 ;;XUS DIVISION GET
+5 QUIT 0
+6 ;
+7 ;--- Add an import entry to the AE Security Matrix
+8 ;
ADDIMPAE() ;
+1 NEW FDA1,FDA2,FDA3,SMIEN
+2 IF $DATA(^MAGV(2006.9192,"B","IMPORTER"))
QUIT 0
+3 SET FDA1(2006.9192,"+1,",.01)="IMPORTER"
+4 SET FDA1(2006.9192,"+1,",1)="VISTA_STORAGE"
+5 SET FDA1(2006.9192,"+1,",1.1)="IMPORTER"
+6 SET FDA1(2006.9192,"+1,",1.3)=1
+7 SET FDA1(2006.9192,"+1,",2)=$GET(DUZ(2))
+8 SET FDA1(2006.9192,"+1,",6)=1
+9 SET FDA1(2006.9192,"+1,",7)=1
+10 SET FDA1(2006.9192,"+1,",8)=1
+11 SET FDA1(2006.9192,"+1,",9)=1
+12 SET FDA1(2006.9192,"+1,",10)=1
+13 SET FDA1(2006.9192,"+1,",11)="RAD"
+14 DO UPDATE^DIE("","FDA1","SMIEN")
+15 SET FDA2(2006.919212,"+1,"_SMIEN(1)_",",.01)=1
+16 SET FDA2(2006.919212,"+1,"_SMIEN(1)_",",1)=1
+17 DO UPDATE^DIE("","FDA2")
+18 QUIT 0
+19 ;
+20 ;--- Add new entries to the IMAGING EVENT ACTION file (#2006.931).
+21 ;
ADDEVENT() ;
+1 NEW CT,FDA1,FILE,NAME
SET CT=0
SET FILE=2006.931
+2 FOR NAME="CLIENT LOGIN","IMPORTER AE SECURITY SUCCESS","IMPORTER AE SECURITY FAILURE"
Begin DoDot:1
+3 IF '$DATA(^MAGV(FILE,"B",NAME))
SET CT=CT+1
SET FDA1(FILE,"+"_CT_",",.01)=NAME
End DoDot:1
+4 if CT
DO UPDATE^DIE("","FDA1")
+5 QUIT 0
+6 ;
STORAGE ; Loop through IMAGE (#2006.1) file and update STORAGE PROVIDER (#2006.917) file
+1 NEW IEN
+2 SET IEN=0
+3 FOR
SET IEN=$ORDER(^MAG(2006.1,IEN))
if +IEN=0
QUIT
Begin DoDot:1
+4 DO ADDP(IEN)
+5 QUIT
End DoDot:1
+6 QUIT
ADDP(IEN) ; Add STORAGE PROVIDER file (#2006.917)
+1 IF $DATA(^MAGV(2006.917,"B",IEN))
QUIT
+2 NEW MAGPARAM,MAGRY,RESDEL,PIEN1,PIEN2
+3 SET RESDEL=$$RESDEL^MAGVAF02
+4 SET MAGPARAM("STORAGE PROVIDER TYPE")="RAID"
+5 SET MAGPARAM("STORAGE PLACE")=IEN
+6 SET MAGPARAM("ARCHIVE")=0
+7 SET MAGPARAM("PRIMARY STORAGE")=1
+8 SET MAGPARAM("WRITABLE")=1
+9 DO ADDPRV^MAGVAC01(.MAGRY,.MAGPARAM)
+10 SET PIEN1=$PIECE(MAGRY,RESDEL,3)
+11 KILL MAGRY,MAGPARAM
+12 SET MAGPARAM("STORAGE PROVIDER TYPE")="JUKEBOX"
+13 SET MAGPARAM("STORAGE PLACE")=IEN
+14 SET MAGPARAM("ARCHIVE")=1
+15 SET MAGPARAM("PRIMARY STORAGE")=0
+16 SET MAGPARAM("WRITABLE")=1
+17 DO ADDPRV^MAGVAC01(.MAGRY,.MAGPARAM)
+18 SET PIEN2=$PIECE(MAGRY,RESDEL,3)
+19 DO ADDRE(IEN,PIEN1,1)
DO ADDRE(IEN,PIEN2,0)
+20 DO ADDPA(IEN,PIEN1)
DO ADDPA(IEN,PIEN2)
+21 QUIT
ADDRE(IEN,PIEN,RAID) ; Add Retention - 2006.923
+1 NEW MAGPARAM,MAGRY
+2 SET MAGPARAM("RETENTION POLICY")=1
+3 SET MAGPARAM("STORAGE PROVIDER")=PIEN
+4 SET MAGPARAM("SOURCE PLACE")=IEN
+5 SET MAGPARAM("SYNCHRONOUS")=$SELECT(RAID=1:1,1:0)
+6 SET MAGPARAM("OFFSITE")=$SELECT(RAID=1:0,1:0)
+7 DO ADDRPPM^MAGVAC01(.MAGRY,.MAGPARAM)
+8 QUIT
ADDPA(IEN,PIEN) ; Add Storage Provider Availability file (#2006.924)
+1 NEW MAGPARAM,MAGRY
+2 SET MAGPARAM("STORAGE PROVIDER")=PIEN
+3 SET MAGPARAM("SOURCE PLACE")=IEN
+4 SET MAGPARAM("START TIME")="20000101.0001"
+5 SET MAGPARAM("END TIME")="20000101.0001"
+6 DO ADDPA^MAGVAC01(.MAGRY,.MAGPARAM)
+7 QUIT
ADDAD ; Add Artifact Descriptor file (#2006.915)
+1 NEW RES,MAGPARAM,I,J,DA,DIK
+2 SET DIK="^MAGV(2006.915,"
+3 ; Delete the data first
+4 SET (I,J)=""
+5 FOR
SET I=$ORDER(^MAGV(2006.915,"B",I))
if I=""
QUIT
Begin DoDot:1
+6 FOR
SET J=$ORDER(^MAGV(2006.915,"B",I,J))
if J=""
QUIT
Begin DoDot:2
+7 SET DA=J
+8 DO ^DIK
+9 QUIT
End DoDot:2
+10 QUIT
End DoDot:1
+11 ; Add new records
+12 SET MAGPARAM("ARTIFACT FORMAT")="DICOM"
+13 SET MAGPARAM("ARTIFACT TYPE")="MedicalImage"
+14 SET MAGPARAM("FILE EXTENSION")="dcm"
+15 SET MAGPARAM("ACTIVE")=1
+16 SET MAGPARAM("RETENTION POLICY")=1
+17 DO ADDAD^MAGVAC01(.RES,.MAGPARAM)
+18 ;
+19 KILL MAGPARAM
+20 SET MAGPARAM("ARTIFACT FORMAT")="JPEG"
+21 SET MAGPARAM("ARTIFACT TYPE")="MedicalImageAbstract"
+22 SET MAGPARAM("FILE EXTENSION")="jpg"
+23 SET MAGPARAM("ACTIVE")=1
+24 SET MAGPARAM("RETENTION POLICY")="1"
+25 DO ADDAD^MAGVAC01(.RES,.MAGPARAM)
+26 QUIT
CLEAN ; Clean up DDs
+1 DO CLEANAE
+2 DO CLEANISP
+3 DO UIDS
+4 DO CLEANDDS
+5 DO WHISTORY
+6 ; Clean up QUEUE MESSAGE file (#2006.928)
DO CLEANQ(4,"",$$FMADD^XLFDT($$NOW^XLFDT(),-30))
+7 QUIT
CLEANQ(QUEUEIEN,MAGBDT,MAGEDT) ; Clean up QUEUE MESSAGE file (#2006.928)
+1 ; QUEUEIEN -- Queue IEN in QUEUE file (#2006.924) - e.g., 4 - Email Queue
+2 ; MAGBDT -- From Date
+3 ; MAGEDT -- Through Date
+4 NEW FDA,IEN,MAGDT
+5 SET MAGDT=$ORDER(^MAGV(2006.928,"ENQDT",QUEUEIEN,MAGBDT-1))
+6 FOR
SET MAGDT=$ORDER(^MAGV(2006.928,"ENQDT",QUEUEIEN,MAGDT))
if MAGDT=""!(MAGDT>MAGEDT)
QUIT
Begin DoDot:1
+7 SET IEN=""
+8 FOR
SET IEN=$ORDER(^MAGV(2006.928,"ENQDT",QUEUEIEN,MAGDT,IEN))
if IEN=""
QUIT
Begin DoDot:2
+9 KILL FDA
+10 SET FDA(2006.928,IEN_",",.01)="@"
+11 DO FILE^DIE("","FDA")
+12 QUIT
End DoDot:2
+13 QUIT
End DoDot:1
+14 QUIT
CLEANAE ; Remove user data from DICOM AE Security Matrix (#2006.9192) file
+1 NEW AEIEN,FDA
+2 SET AEIEN=0
+3 FOR
SET AEIEN=$ORDER(^MAGV(2006.9192,AEIEN))
if +AEIEN=0
QUIT
Begin DoDot:1
+4 IF $PIECE(^MAGV(2006.9192,AEIEN,0),U,7)'=""
SET FDA(2006.9192,AEIEN_",",2.1)="@"
+5 QUIT
End DoDot:1
+6 IF $DATA(FDA)
DO FILE^DIE("","FDA")
+7 QUIT
CLEANISP ; Remove user data from Imaging Site Paramaters (#2006.1) file
+1 NEW ISPIEN,FDA
+2 SET ISPIEN=0
+3 FOR
SET ISPIEN=$ORDER(^MAG(2006.1,ISPIEN))
if +ISPIEN=0
QUIT
Begin DoDot:1
+4 IF $PIECE($GET(^MAG(2006.1,ISPIEN,5)),U,1)'=""
SET FDA(2006.1,ISPIEN_",",104)="@"
+5 QUIT
End DoDot:1
+6 IF $DATA(FDA)
DO FILE^DIE("","FDA")
+7 QUIT
CLEANDDS ; Remove user fields from DD entries in file 2006.1 and 2006.9192
+1 IF $$GET1^DID(2006.1,104,,"LABEL")="DEFAULT DICOM AE USER"
DO DELFLDS^MAGKIDS(2006.1,"104")
+2 IF $$GET1^DID(2006.9192,2.1,,"LABEL")="USER"
DO DELFLDS^MAGKIDS(2006.9192,"2.1")
+3 QUIT
UIDS ; Clean up duplicate entries in the DICOM UID Specific Action (#2006.539) file
+1 NEW FDA,FIRST,UID,UIDIEN
+2 SET UID=""
+3 FOR
SET UID=$ORDER(^MAGDICOM(2006.539,"B",UID))
if UID=""
QUIT
Begin DoDot:1
+4 SET FIRST=1
+5 SET UIDIEN=""
+6 FOR
SET UIDIEN=$ORDER(^MAGDICOM(2006.539,"B",UID,UIDIEN))
if UIDIEN=""
QUIT
Begin DoDot:2
+7 IF 'FIRST
SET FDA(2006.539,UIDIEN_",",.01)="@"
+8 SET FIRST=0
+9 QUIT
End DoDot:2
+10 QUIT
End DoDot:1
+11 IF $DATA(FDA)
DO FILE^DIE("","FDA","ERR")
+12 QUIT
WHISTORY ; Remove Work Item History (#2006.9411) file and file entries
+1 DO DELFILE^MAGKIDS(2006.9411,"DE")
+2 QUIT