MAGVAC01 ;WOIFO/NST - Add records to storage files ; 22 Apr 2010 3:59 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. |
;; +---------------------------------------------------------------+
;;
Q
;
;***** Add a new record to RETENTION POLICY file (#2006.914)
;
; RPC:MAGVA CREATE RETPOL
;
; Input Parameters
; ================
;
; MAGPARAM("ARCHIVE DURATION TRIGGER")
; MAGPARAM("ARCHIVE DURATION YEARS")
; MAGPARAM("BUSINESS KEY")
; MAGPARAM("DISPLAY NAME")
; MAGPARAM("MINIMUM ARCHIVE COPIES")
; MAGPARAM("MINIMUM OFFSITE COPIES")
;
; Return Values
; =============
; if error MAGRY = Failure status ^Error message^
; if success MAGRY = Success status ^^IEN - IEN of the new record
;
ADDRP(MAGRY,MAGPARAM) ; RPC [MAGVA CREATE RETPOL]
N MAGWP
K MAGRY
; Check for uniqueness of business key among active Retention Policies
I $G(MAGPARAM("BUSINESS KEY"))'="" D Q:$G(MAGRY)'=""
. I $O(^MAGV(2006.914,"BKEYACT",MAGPARAM("BUSINESS KEY"),""))'="" D
. . S MAGRY=$$FAILED^MAGVAF02()_$$RESDEL^MAGVAF02()_"Active business key """_MAGPARAM("BUSINESS KEY")_""" already exists."
. Q
;
S MAGPARAM("ACTIVE")=1
D ADDRCD^MAGVAF01(.MAGRY,2006.914,.MAGPARAM,.MAGWP)
Q
;
;***** Add a new record to ARTIFACT file (#2006.916)
;
; RPC:MAGVA CREATE ARTIFACT W KL
;
; Input Parameters
; ================
;
; MAGPARAM("ARTIFACT DESCRIPTOR")
; MAGPARAM("ARTIFACT TOKEN")
; MAGPARAM("CRC")
; MAGPARAM("CREATING APPLICATION")
; MAGPARAM("LAST ACCESS DATE/TIME")
; MAGPARAM("SIZE IN BYTES")
;
; Artifact KEYLIST values
; KLIST(1) = First level Key
; KLIST(2) = Second level Key
; ...
; KLIST(N) = N-th level Key
;
; Return Values
; =============
; if error MAGRY = Failure status ^Error message^
; if success MAGRY = Success status ^^IEN - IEN of the new record
;
ADDAFACT(MAGRY,MAGPARAM,KLIST) ; RPC [MAGVA CREATE ARTIFACT W KL]
; build KLIST first - workaround for Old broker listener
N L,LL
S L="KLIST",LL=0
K KLIST
F S L=$O(MAGPARAM(L)) Q:(L="")!($E(L,1,5)'="KLIST") S LL=LL+1,KLIST(LL)=MAGPARAM(L) K MAGPARAM(L)
;
N MAGWP,FILE,MAGAPP,PFILE
K MAGRY
; Check ARTIFACT TOKEN presents
S FILE=2006.916
I $G(MAGPARAM("ARTIFACT TOKEN"))="" D Q
. S MAGRY=$$FAILED^MAGVAF02()_$$RESDEL^MAGVAF02()_"ARTIFACT TOKEN is required"
. Q
; check for "ARTIFACT TOKEN" for uniqueness first
I $D(^MAGV(FILE,"B",MAGPARAM("ARTIFACT TOKEN"))) D Q
. S MAGRY=$$FAILED^MAGVAF02()_$$RESDEL^MAGVAF02()_"ARTIFACT TOKEN is not unique"
. Q
;
; Get creating application or create a new one
S PFILE=$$GETFILEP^MAGVAF05(FILE,"CREATING APPLICATION") ; the file that field points to
S MAGRY=$$GETIEN^MAGVAF05(PFILE,MAGPARAM("CREATING APPLICATION"),1)
I '$$ISOK^MAGVAF02(MAGRY) Q ; Quit if error. MAGRY is already set
S MAGPARAM("CREATING APPLICATION")=$$GETVAL^MAGVAF02(MAGRY) ; Set the internal value
;
; get the KEYLIST
D GETKLFK^MAGVAKL1(.MAGRY,.KLIST)
I '$$ISOK^MAGVAF02(MAGRY) Q ; Quit if error. MAGRY is already set
S MAGPARAM("KEYLIST")=$$GETVAL^MAGVAF02(MAGRY) ; Set the FK
S MAGPARAM("CREATED DATE/TIME")=$$NOW^XLFDT
D ADDRCD^MAGVAF01(.MAGRY,FILE,.MAGPARAM,.MAGWP)
Q
;
;***** Add an Artifact Retention Policy (#2006.921) record
;
; RPC:MAGVA CREATE ARETPOL
;
; Input Parameters
;
; MAGPARAM("ARTIFACT") = A pointer to ARTIFACT file (#2006.916)
; MAGPARAM("RETENTION POLICY") = A pointer to RETENTION POLICY file (#2006.914)
; MAGPARAM("SATISFIED DATE/TIME") = DateTime in IDF Format (YYYYMMDD.HHMMSS)
;
; Return Values
; =============
; if error MAGRY = Failure status ^Error message^
; if success MAGRY = Success status ^^IEN - IEN of the new record
;
ADDARP(MAGRY,MAGPARAM) ; RPC [MAGVA CREATE ARETPOL]
N MAGWP
K MAGRY
S MAGPARAM("SATISFIED DATE/TIME")=$$IDF2FM^MAGVAF01($G(MAGPARAM("SATISFIED DATE/TIME")))
S MAGPARAM("ACTIVE")=1
S MAGPARAM("CREATED DATE/TIME")=$$NOW^XLFDT
D ADDRCD^MAGVAF01(.MAGRY,2006.921,.MAGPARAM,.MAGWP)
Q
;
;***** Add a new record to RETENTION POLICY FULFILLMENT file (#2006.922)
;
; RPC:MAGVA CREATE RETPOLFF
;
; Input Parameters
; ================
;
; MAGPARAM("ARTIFACT RETENTION POLICY") = A pointer to ARTIFACT RETENTION POLICY file (#2006.921)
; MAGPARAM("ARTIFACT INSTANCE") = A pointer to ARTIFACT INSTANCE file (#2006.918)
;
; Return Values
; =============
; if error MAGRY = Failure status ^Error message^
; if success MAGRY = Success status ^^IEN - IEN of the new record
;
ADDARPF(MAGRY,MAGPARAM) ; RPC [MAGVA CREATE RETPOLFF]
N MAGWP
K MAGRY
S MAGPARAM("CREATED DATE/TIME")=$$NOW^XLFDT
D ADDRCD^MAGVAF01(.MAGRY,2006.922,.MAGPARAM,.MAGWP)
Q
;
;***** Add a new record to STORAGE PROVIDER AVAILABILITY file (#2006.924)
;
; RPC:MAGVA CREATE PROVAVAILTY
;
; Input Parameters
;
; MAGPARAM("STORAGE PROVIDER") = A pointer to STORAGE PROVIDER file (#2006.917)
; MAGPARAM("SOURCE PLACE") = A pointer to IMAGING SITE PARAMETERS file (#2006.1)
; MAGPARAM("START TIME") = DateTime in IDF format (YYYYMMDD.HHMMSS)
; MAGPARAM("END TIME") = DateTime in IDF format (YYYYMMDD.HHMMSS)
;
; Return Values
; =============
; if error MAGRY = Failure status ^Error message^
; if success MAGRY = Success status ^^IEN - IEN of the new record
;
ADDPA(MAGRY,MAGPARAM) ; RPC [MAGVA CREATE PROVAVAILTY]
N MAGWP
K MAGRY
; convert date time fields to FileMan date/time format
S MAGPARAM("START TIME")=$$IDF2FM^MAGVAF01($G(MAGPARAM("START TIME")))
S MAGPARAM("END TIME")=$$IDF2FM^MAGVAF01($G(MAGPARAM("END TIME")))
; Add the record
D ADDRCD^MAGVAF01(.MAGRY,2006.924,.MAGPARAM,.MAGWP)
Q
;
;***** Add a new record to STORAGE PROVIDER file (#2006.917)
;
; RPC: MAGVA CREATE PROVIDER
;
; Input Parameters
; ================
;
; MAGPARAM("STORAGE PROVIDER TYPE")
; MAGPARAM("STORAGE PLACE")
; MAGPARAM("ARCHIVE")
; MAGPARAM("PRIMARY STORAGE")
;
; Return Values
; =============
; if error MAGRY = Failure status ^Error message^
; if success MAGRY = Success status ^^IEN - IEN of the new record
;
ADDPRV(MAGRY,MAGPARAM) ; RPC [MAGVA CREATE PROVIDER]
N MAGWP
K MAGRY
S MAGPARAM("WRITABLE")=1
S MAGPARAM("ACTIVE")=1
; Add the record
D ADDRCD^MAGVAF01(.MAGRY,2006.917,.MAGPARAM,.MAGWP)
Q
;
;***** Add a new record to ARTIFACT INSTANCE file (#2006.918)
;
; RPC: MAGVA CREATE AINSTANCE
;
; Input Parameters
; ================
;
; MAGPARAM("ARTIFACT")
; MAGPARAM("STORAGE PROVIDER")
; MAGPARAM("FILEREF")
; MAGPARAM("DISK VOLUME")
; MAGPARAM("FILEPATH")
; MAGURL(1..n) = URL value
;
; Return Values
; =============
; if error MAGRY = Failure status ^Error message^
; if success MAGRY = Success status ^^IEN - IEN of the new record
;
ADDAINST(MAGRY,MAGPARAM,MAGURL) ; RPC [MAGVA CREATE AINSTANCE]
; build MAGURL first - workaround for Old broker listener
N L,LL
S L="MAGURL",LL=0
K KLIST
F S L=$O(MAGPARAM(L)) Q:(L="")!($E(L,1,6)'="MAGURL") S LL=LL+1,MAGURL(LL)=MAGPARAM(L) K MAGPARAM(L)
;
N FILE,MAGWP
K MAGRY
S FILE=2006.918
S MAGPARAM("CREATED DATE/TIME")=$$NOW^XLFDT
M MAGWP("URL")=MAGURL
D ADDRCD^MAGVAF01(.MAGRY,FILE,.MAGPARAM,.MAGWP) ; add the record
Q
;
;***** Add a new record to ARTIFACT DESCRIPTOR file (#2006.915)
;
; RPC: MAGVA CREATE AD
;
; Input Parameters
; ================
;
; MAGPARAM("ARTIFACT FORMAT")
; MAGPARAM("ARTIFACT TYPE")
; MAGPARAM("FILE EXTENSION")
; MAGPARAM("ACTIVE")
; MAGPARAM("RETENTION POLICY")
;
; Return Values
; =============
; if error MAGRY = Failure status ^Error message^
; if success MAGRY = Success status ^^IEN - IEN of the new record
;
ADDAD(MAGRY,MAGPARAM) ; RPC [MAGVA CREATE AD]
N MAGWP
K MAGRY
; Add the record
D ADDRCD^MAGVAF01(.MAGRY,2006.915,.MAGPARAM,.MAGWP)
Q
;
;***** Add a new record to RETENTION POLICY STORAGE PROVIDER MAP file (#2006.923)
;
; RPC: MAGVA CREATE RETPOL PROV MAP
;
; Input Parameters
; ================
;
; MAGPARAM("RETENTION POLICY") = Pointer to RETENTION POLICY file (#2006.914)
; MAGPARAM("STORAGE PROVIDER") = Pointer to STORAGE PROVIDER file (#2006.917)
; MAGPARAM("SOURCE PLACE") = Pointer to IMAGING SITE PARAMETERS file (#2006.1)
; MAGPARAM("SYNCHRONOUS") = 0/1
; MAGPARAM("OFFSITE") = 0/1
;
; Return Values
; =============
; if error MAGRY = Failure status ^Error message^
; if success MAGRY = Success status ^^IEN - IEN of the new record
;
ADDRPPM(MAGRY,MAGPARAM) ; RPC [MAGVA CREATE RETPOL PROV MAP]
N MAGWP
K MAGRY
; Add the record
D ADDRCD^MAGVAF01(.MAGRY,2006.923,.MAGPARAM,.MAGWP)
Q
;
;***** Add a new record to TRANSFER STATISTICS file (#2006.925)
;
; RPC: MAGVA CREATE TRF STATS
;
; Input Parameters
; ================
;
; MAGPARAM("DURATION IN MILLISECONDS")
; MAGPARAM("ENDPOINT PLACE") = Pointer to IMAGING SITE PARAMETERS file (#2006.1)
; MAGPARAM("STORAGE PROVIDER") = Pointer to STORAGE PROVIDER file (#2006.917)
; MAGPARAM("SIZE IN BYTES")
; MAGPARAM("START DATE/TIME") = DateTime in IDF format (YYYYMMDD.HHMMSS)
;
; Return Values
; =============
; if error MAGRY = Failure status ^Error message^
; if success MAGRY = Success status ^^IEN - IEN of the new record
;
ADDTRFS(MAGRY,MAGPARAM) ; RPC [MAGVA CREATE TRF STATS]
N MAGWP
K MAGRY
; Add the record
S MAGPARAM("START DATE/TIME")=$$IDF2FM^MAGVAF01($G(MAGPARAM("START DATE/TIME")))
D ADDRCD^MAGVAF01(.MAGRY,2006.925,.MAGPARAM,.MAGWP)
Q
;
;***** Add a new record to STORAGE TRANSACTION file (#2006.926)
;
; RPC: MAGVA CREATE STORAGE TA
;
; Input Parameters
; ================
;
; MAGPARAM("ARTIFACT") = Pointer to ARTIFACT file (#2006.916)
; MAGPARAM("STORAGE PROVIDER") = Pointer to STORAGE PROVIDER file (#2006.917)
; MAGPARAM("SUCCEEDED") = 0/1
; MAGPARAM("TRANSACTION TYPE") =
; MAGPARAM("INITIATING APPLICATION") =
;
; MAGMSG(1..n) = MESSAGE - optional
;
; MAGMSG(1..n) = MESSAGE
; Return Values
; =============
;
; if error MAGRY = Failure status ^Error message^
; if success MAGRY = Success status ^^IEN - IEN of the new record
;
ADDSTTA(MAGRY,MAGPARAM,MAGMSG) ; RPC [MAGVA CREATE STORAGE TA]
; build MAGMSG first - workaround for Old broker listener
N L,LL
S L="MAGMSG",LL=0
K MAGMSG
F S L=$O(MAGPARAM(L)) Q:(L="")!($E(L,1,6)'="MAGMSG") S LL=LL+1,MAGMSG(LL)=MAGPARAM(L) K MAGPARAM(L)
;
N FILE,MAGWP,PFILE
K MAGRY
S FILE=2006.926
;
; Get creating application or create a new one
S PFILE=$$GETFILEP^MAGVAF05(FILE,"INITIATING APPLICATION")
S MAGRY=$$GETIEN^MAGVAF05(PFILE,MAGPARAM("INITIATING APPLICATION"),1)
I '$$ISOK^MAGVAF02(MAGRY) Q ; Quit if error. MAGRY is already set
S MAGPARAM("INITIATING APPLICATION")=$$GETVAL^MAGVAF02(MAGRY) ; Set the internal value
;
S MAGPARAM("TRANSACTION DATE/TIME")=$$NOW^XLFDT
M MAGWP("MESSAGE")=MAGMSG
D ADDRCD^MAGVAF01(.MAGRY,FILE,.MAGPARAM,.MAGWP) ; add the record
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HMAGVAC01 12199 printed Sep 15, 2024@21:33:16 Page 2
MAGVAC01 ;WOIFO/NST - Add records to storage files ; 22 Apr 2010 3:59 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 QUIT
+18 ;
+19 ;***** Add a new record to RETENTION POLICY file (#2006.914)
+20 ;
+21 ; RPC:MAGVA CREATE RETPOL
+22 ;
+23 ; Input Parameters
+24 ; ================
+25 ;
+26 ; MAGPARAM("ARCHIVE DURATION TRIGGER")
+27 ; MAGPARAM("ARCHIVE DURATION YEARS")
+28 ; MAGPARAM("BUSINESS KEY")
+29 ; MAGPARAM("DISPLAY NAME")
+30 ; MAGPARAM("MINIMUM ARCHIVE COPIES")
+31 ; MAGPARAM("MINIMUM OFFSITE COPIES")
+32 ;
+33 ; Return Values
+34 ; =============
+35 ; if error MAGRY = Failure status ^Error message^
+36 ; if success MAGRY = Success status ^^IEN - IEN of the new record
+37 ;
ADDRP(MAGRY,MAGPARAM) ; RPC [MAGVA CREATE RETPOL]
+1 NEW MAGWP
+2 KILL MAGRY
+3 ; Check for uniqueness of business key among active Retention Policies
+4 IF $GET(MAGPARAM("BUSINESS KEY"))'=""
Begin DoDot:1
+5 IF $ORDER(^MAGV(2006.914,"BKEYACT",MAGPARAM("BUSINESS KEY"),""))'=""
Begin DoDot:2
+6 SET MAGRY=$$FAILED^MAGVAF02()_$$RESDEL^MAGVAF02()_"Active business key """_MAGPARAM("BUSINESS KEY")_""" already exists."
End DoDot:2
+7 QUIT
End DoDot:1
if $GET(MAGRY)'=""
QUIT
+8 ;
+9 SET MAGPARAM("ACTIVE")=1
+10 DO ADDRCD^MAGVAF01(.MAGRY,2006.914,.MAGPARAM,.MAGWP)
+11 QUIT
+12 ;
+13 ;***** Add a new record to ARTIFACT file (#2006.916)
+14 ;
+15 ; RPC:MAGVA CREATE ARTIFACT W KL
+16 ;
+17 ; Input Parameters
+18 ; ================
+19 ;
+20 ; MAGPARAM("ARTIFACT DESCRIPTOR")
+21 ; MAGPARAM("ARTIFACT TOKEN")
+22 ; MAGPARAM("CRC")
+23 ; MAGPARAM("CREATING APPLICATION")
+24 ; MAGPARAM("LAST ACCESS DATE/TIME")
+25 ; MAGPARAM("SIZE IN BYTES")
+26 ;
+27 ; Artifact KEYLIST values
+28 ; KLIST(1) = First level Key
+29 ; KLIST(2) = Second level Key
+30 ; ...
+31 ; KLIST(N) = N-th level Key
+32 ;
+33 ; Return Values
+34 ; =============
+35 ; if error MAGRY = Failure status ^Error message^
+36 ; if success MAGRY = Success status ^^IEN - IEN of the new record
+37 ;
ADDAFACT(MAGRY,MAGPARAM,KLIST) ; RPC [MAGVA CREATE ARTIFACT W KL]
+1 ; build KLIST first - workaround for Old broker listener
+2 NEW L,LL
+3 SET L="KLIST"
SET LL=0
+4 KILL KLIST
+5 FOR
SET L=$ORDER(MAGPARAM(L))
if (L="")!($EXTRACT(L,1,5)'="KLIST")
QUIT
SET LL=LL+1
SET KLIST(LL)=MAGPARAM(L)
KILL MAGPARAM(L)
+6 ;
+7 NEW MAGWP,FILE,MAGAPP,PFILE
+8 KILL MAGRY
+9 ; Check ARTIFACT TOKEN presents
+10 SET FILE=2006.916
+11 IF $GET(MAGPARAM("ARTIFACT TOKEN"))=""
Begin DoDot:1
+12 SET MAGRY=$$FAILED^MAGVAF02()_$$RESDEL^MAGVAF02()_"ARTIFACT TOKEN is required"
+13 QUIT
End DoDot:1
QUIT
+14 ; check for "ARTIFACT TOKEN" for uniqueness first
+15 IF $DATA(^MAGV(FILE,"B",MAGPARAM("ARTIFACT TOKEN")))
Begin DoDot:1
+16 SET MAGRY=$$FAILED^MAGVAF02()_$$RESDEL^MAGVAF02()_"ARTIFACT TOKEN is not unique"
+17 QUIT
End DoDot:1
QUIT
+18 ;
+19 ; Get creating application or create a new one
+20 ; the file that field points to
SET PFILE=$$GETFILEP^MAGVAF05(FILE,"CREATING APPLICATION")
+21 SET MAGRY=$$GETIEN^MAGVAF05(PFILE,MAGPARAM("CREATING APPLICATION"),1)
+22 ; Quit if error. MAGRY is already set
IF '$$ISOK^MAGVAF02(MAGRY)
QUIT
+23 ; Set the internal value
SET MAGPARAM("CREATING APPLICATION")=$$GETVAL^MAGVAF02(MAGRY)
+24 ;
+25 ; get the KEYLIST
+26 DO GETKLFK^MAGVAKL1(.MAGRY,.KLIST)
+27 ; Quit if error. MAGRY is already set
IF '$$ISOK^MAGVAF02(MAGRY)
QUIT
+28 ; Set the FK
SET MAGPARAM("KEYLIST")=$$GETVAL^MAGVAF02(MAGRY)
+29 SET MAGPARAM("CREATED DATE/TIME")=$$NOW^XLFDT
+30 DO ADDRCD^MAGVAF01(.MAGRY,FILE,.MAGPARAM,.MAGWP)
+31 QUIT
+32 ;
+33 ;***** Add an Artifact Retention Policy (#2006.921) record
+34 ;
+35 ; RPC:MAGVA CREATE ARETPOL
+36 ;
+37 ; Input Parameters
+38 ;
+39 ; MAGPARAM("ARTIFACT") = A pointer to ARTIFACT file (#2006.916)
+40 ; MAGPARAM("RETENTION POLICY") = A pointer to RETENTION POLICY file (#2006.914)
+41 ; MAGPARAM("SATISFIED DATE/TIME") = DateTime in IDF Format (YYYYMMDD.HHMMSS)
+42 ;
+43 ; Return Values
+44 ; =============
+45 ; if error MAGRY = Failure status ^Error message^
+46 ; if success MAGRY = Success status ^^IEN - IEN of the new record
+47 ;
ADDARP(MAGRY,MAGPARAM) ; RPC [MAGVA CREATE ARETPOL]
+1 NEW MAGWP
+2 KILL MAGRY
+3 SET MAGPARAM("SATISFIED DATE/TIME")=$$IDF2FM^MAGVAF01($GET(MAGPARAM("SATISFIED DATE/TIME")))
+4 SET MAGPARAM("ACTIVE")=1
+5 SET MAGPARAM("CREATED DATE/TIME")=$$NOW^XLFDT
+6 DO ADDRCD^MAGVAF01(.MAGRY,2006.921,.MAGPARAM,.MAGWP)
+7 QUIT
+8 ;
+9 ;***** Add a new record to RETENTION POLICY FULFILLMENT file (#2006.922)
+10 ;
+11 ; RPC:MAGVA CREATE RETPOLFF
+12 ;
+13 ; Input Parameters
+14 ; ================
+15 ;
+16 ; MAGPARAM("ARTIFACT RETENTION POLICY") = A pointer to ARTIFACT RETENTION POLICY file (#2006.921)
+17 ; MAGPARAM("ARTIFACT INSTANCE") = A pointer to ARTIFACT INSTANCE file (#2006.918)
+18 ;
+19 ; Return Values
+20 ; =============
+21 ; if error MAGRY = Failure status ^Error message^
+22 ; if success MAGRY = Success status ^^IEN - IEN of the new record
+23 ;
ADDARPF(MAGRY,MAGPARAM) ; RPC [MAGVA CREATE RETPOLFF]
+1 NEW MAGWP
+2 KILL MAGRY
+3 SET MAGPARAM("CREATED DATE/TIME")=$$NOW^XLFDT
+4 DO ADDRCD^MAGVAF01(.MAGRY,2006.922,.MAGPARAM,.MAGWP)
+5 QUIT
+6 ;
+7 ;***** Add a new record to STORAGE PROVIDER AVAILABILITY file (#2006.924)
+8 ;
+9 ; RPC:MAGVA CREATE PROVAVAILTY
+10 ;
+11 ; Input Parameters
+12 ;
+13 ; MAGPARAM("STORAGE PROVIDER") = A pointer to STORAGE PROVIDER file (#2006.917)
+14 ; MAGPARAM("SOURCE PLACE") = A pointer to IMAGING SITE PARAMETERS file (#2006.1)
+15 ; MAGPARAM("START TIME") = DateTime in IDF format (YYYYMMDD.HHMMSS)
+16 ; MAGPARAM("END TIME") = DateTime in IDF format (YYYYMMDD.HHMMSS)
+17 ;
+18 ; Return Values
+19 ; =============
+20 ; if error MAGRY = Failure status ^Error message^
+21 ; if success MAGRY = Success status ^^IEN - IEN of the new record
+22 ;
ADDPA(MAGRY,MAGPARAM) ; RPC [MAGVA CREATE PROVAVAILTY]
+1 NEW MAGWP
+2 KILL MAGRY
+3 ; convert date time fields to FileMan date/time format
+4 SET MAGPARAM("START TIME")=$$IDF2FM^MAGVAF01($GET(MAGPARAM("START TIME")))
+5 SET MAGPARAM("END TIME")=$$IDF2FM^MAGVAF01($GET(MAGPARAM("END TIME")))
+6 ; Add the record
+7 DO ADDRCD^MAGVAF01(.MAGRY,2006.924,.MAGPARAM,.MAGWP)
+8 QUIT
+9 ;
+10 ;***** Add a new record to STORAGE PROVIDER file (#2006.917)
+11 ;
+12 ; RPC: MAGVA CREATE PROVIDER
+13 ;
+14 ; Input Parameters
+15 ; ================
+16 ;
+17 ; MAGPARAM("STORAGE PROVIDER TYPE")
+18 ; MAGPARAM("STORAGE PLACE")
+19 ; MAGPARAM("ARCHIVE")
+20 ; MAGPARAM("PRIMARY STORAGE")
+21 ;
+22 ; Return Values
+23 ; =============
+24 ; if error MAGRY = Failure status ^Error message^
+25 ; if success MAGRY = Success status ^^IEN - IEN of the new record
+26 ;
ADDPRV(MAGRY,MAGPARAM) ; RPC [MAGVA CREATE PROVIDER]
+1 NEW MAGWP
+2 KILL MAGRY
+3 SET MAGPARAM("WRITABLE")=1
+4 SET MAGPARAM("ACTIVE")=1
+5 ; Add the record
+6 DO ADDRCD^MAGVAF01(.MAGRY,2006.917,.MAGPARAM,.MAGWP)
+7 QUIT
+8 ;
+9 ;***** Add a new record to ARTIFACT INSTANCE file (#2006.918)
+10 ;
+11 ; RPC: MAGVA CREATE AINSTANCE
+12 ;
+13 ; Input Parameters
+14 ; ================
+15 ;
+16 ; MAGPARAM("ARTIFACT")
+17 ; MAGPARAM("STORAGE PROVIDER")
+18 ; MAGPARAM("FILEREF")
+19 ; MAGPARAM("DISK VOLUME")
+20 ; MAGPARAM("FILEPATH")
+21 ; MAGURL(1..n) = URL value
+22 ;
+23 ; Return Values
+24 ; =============
+25 ; if error MAGRY = Failure status ^Error message^
+26 ; if success MAGRY = Success status ^^IEN - IEN of the new record
+27 ;
ADDAINST(MAGRY,MAGPARAM,MAGURL) ; RPC [MAGVA CREATE AINSTANCE]
+1 ; build MAGURL first - workaround for Old broker listener
+2 NEW L,LL
+3 SET L="MAGURL"
SET LL=0
+4 KILL KLIST
+5 FOR
SET L=$ORDER(MAGPARAM(L))
if (L="")!($EXTRACT(L,1,6)'="MAGURL")
QUIT
SET LL=LL+1
SET MAGURL(LL)=MAGPARAM(L)
KILL MAGPARAM(L)
+6 ;
+7 NEW FILE,MAGWP
+8 KILL MAGRY
+9 SET FILE=2006.918
+10 SET MAGPARAM("CREATED DATE/TIME")=$$NOW^XLFDT
+11 MERGE MAGWP("URL")=MAGURL
+12 ; add the record
DO ADDRCD^MAGVAF01(.MAGRY,FILE,.MAGPARAM,.MAGWP)
+13 QUIT
+14 ;
+15 ;***** Add a new record to ARTIFACT DESCRIPTOR file (#2006.915)
+16 ;
+17 ; RPC: MAGVA CREATE AD
+18 ;
+19 ; Input Parameters
+20 ; ================
+21 ;
+22 ; MAGPARAM("ARTIFACT FORMAT")
+23 ; MAGPARAM("ARTIFACT TYPE")
+24 ; MAGPARAM("FILE EXTENSION")
+25 ; MAGPARAM("ACTIVE")
+26 ; MAGPARAM("RETENTION POLICY")
+27 ;
+28 ; Return Values
+29 ; =============
+30 ; if error MAGRY = Failure status ^Error message^
+31 ; if success MAGRY = Success status ^^IEN - IEN of the new record
+32 ;
ADDAD(MAGRY,MAGPARAM) ; RPC [MAGVA CREATE AD]
+1 NEW MAGWP
+2 KILL MAGRY
+3 ; Add the record
+4 DO ADDRCD^MAGVAF01(.MAGRY,2006.915,.MAGPARAM,.MAGWP)
+5 QUIT
+6 ;
+7 ;***** Add a new record to RETENTION POLICY STORAGE PROVIDER MAP file (#2006.923)
+8 ;
+9 ; RPC: MAGVA CREATE RETPOL PROV MAP
+10 ;
+11 ; Input Parameters
+12 ; ================
+13 ;
+14 ; MAGPARAM("RETENTION POLICY") = Pointer to RETENTION POLICY file (#2006.914)
+15 ; MAGPARAM("STORAGE PROVIDER") = Pointer to STORAGE PROVIDER file (#2006.917)
+16 ; MAGPARAM("SOURCE PLACE") = Pointer to IMAGING SITE PARAMETERS file (#2006.1)
+17 ; MAGPARAM("SYNCHRONOUS") = 0/1
+18 ; MAGPARAM("OFFSITE") = 0/1
+19 ;
+20 ; Return Values
+21 ; =============
+22 ; if error MAGRY = Failure status ^Error message^
+23 ; if success MAGRY = Success status ^^IEN - IEN of the new record
+24 ;
ADDRPPM(MAGRY,MAGPARAM) ; RPC [MAGVA CREATE RETPOL PROV MAP]
+1 NEW MAGWP
+2 KILL MAGRY
+3 ; Add the record
+4 DO ADDRCD^MAGVAF01(.MAGRY,2006.923,.MAGPARAM,.MAGWP)
+5 QUIT
+6 ;
+7 ;***** Add a new record to TRANSFER STATISTICS file (#2006.925)
+8 ;
+9 ; RPC: MAGVA CREATE TRF STATS
+10 ;
+11 ; Input Parameters
+12 ; ================
+13 ;
+14 ; MAGPARAM("DURATION IN MILLISECONDS")
+15 ; MAGPARAM("ENDPOINT PLACE") = Pointer to IMAGING SITE PARAMETERS file (#2006.1)
+16 ; MAGPARAM("STORAGE PROVIDER") = Pointer to STORAGE PROVIDER file (#2006.917)
+17 ; MAGPARAM("SIZE IN BYTES")
+18 ; MAGPARAM("START DATE/TIME") = DateTime in IDF format (YYYYMMDD.HHMMSS)
+19 ;
+20 ; Return Values
+21 ; =============
+22 ; if error MAGRY = Failure status ^Error message^
+23 ; if success MAGRY = Success status ^^IEN - IEN of the new record
+24 ;
ADDTRFS(MAGRY,MAGPARAM) ; RPC [MAGVA CREATE TRF STATS]
+1 NEW MAGWP
+2 KILL MAGRY
+3 ; Add the record
+4 SET MAGPARAM("START DATE/TIME")=$$IDF2FM^MAGVAF01($GET(MAGPARAM("START DATE/TIME")))
+5 DO ADDRCD^MAGVAF01(.MAGRY,2006.925,.MAGPARAM,.MAGWP)
+6 QUIT
+7 ;
+8 ;***** Add a new record to STORAGE TRANSACTION file (#2006.926)
+9 ;
+10 ; RPC: MAGVA CREATE STORAGE TA
+11 ;
+12 ; Input Parameters
+13 ; ================
+14 ;
+15 ; MAGPARAM("ARTIFACT") = Pointer to ARTIFACT file (#2006.916)
+16 ; MAGPARAM("STORAGE PROVIDER") = Pointer to STORAGE PROVIDER file (#2006.917)
+17 ; MAGPARAM("SUCCEEDED") = 0/1
+18 ; MAGPARAM("TRANSACTION TYPE") =
+19 ; MAGPARAM("INITIATING APPLICATION") =
+20 ;
+21 ; MAGMSG(1..n) = MESSAGE - optional
+22 ;
+23 ; MAGMSG(1..n) = MESSAGE
+24 ; Return Values
+25 ; =============
+26 ;
+27 ; if error MAGRY = Failure status ^Error message^
+28 ; if success MAGRY = Success status ^^IEN - IEN of the new record
+29 ;
ADDSTTA(MAGRY,MAGPARAM,MAGMSG) ; RPC [MAGVA CREATE STORAGE TA]
+1 ; build MAGMSG first - workaround for Old broker listener
+2 NEW L,LL
+3 SET L="MAGMSG"
SET LL=0
+4 KILL MAGMSG
+5 FOR
SET L=$ORDER(MAGPARAM(L))
if (L="")!($EXTRACT(L,1,6)'="MAGMSG")
QUIT
SET LL=LL+1
SET MAGMSG(LL)=MAGPARAM(L)
KILL MAGPARAM(L)
+6 ;
+7 NEW FILE,MAGWP,PFILE
+8 KILL MAGRY
+9 SET FILE=2006.926
+10 ;
+11 ; Get creating application or create a new one
+12 SET PFILE=$$GETFILEP^MAGVAF05(FILE,"INITIATING APPLICATION")
+13 SET MAGRY=$$GETIEN^MAGVAF05(PFILE,MAGPARAM("INITIATING APPLICATION"),1)
+14 ; Quit if error. MAGRY is already set
IF '$$ISOK^MAGVAF02(MAGRY)
QUIT
+15 ; Set the internal value
SET MAGPARAM("INITIATING APPLICATION")=$$GETVAL^MAGVAF02(MAGRY)
+16 ;
+17 SET MAGPARAM("TRANSACTION DATE/TIME")=$$NOW^XLFDT
+18 MERGE MAGWP("MESSAGE")=MAGMSG
+19 ; add the record
DO ADDRCD^MAGVAF01(.MAGRY,FILE,.MAGPARAM,.MAGWP)
+20 QUIT