MDRPCOV ; HOIFO/DP - Object RPCs (TMDParameter) ; [04-15-2003 12:42]
;;1.0;CLINICAL PROCEDURES;;Apr 01, 2004
; Integration Agreements:
; IA# 2263 [Supported] XPAR parameter call.
; IA# 2541 [Supported] Call to XUPARAM.
;
DELLST ; [Procedure] Delete list of parameters
D NDEL^XPAR(ENT,PAR,.ERR)
S:'$G(ERR) @RESULTS@(0)="1^All instances removed"
Q
;
DELPAR ; [Procedure] Delete single parameter value
D DEL^XPAR(ENT,PAR,INST,.ERR)
S:'$G(ERR) @RESULTS@(0)="1^Instance deleted"
Q
;
ENTVAL ; [Procedure] Return value of the entity
I ENT="SYS" S ENT=$$KSP^XUPARAM("WHERE")
E I ENT="DIV" S ENT=$$GET1^DIQ(4,DUZ(2)_",",.01)
E I ENT="USR" S ENT=$$GET1^DIQ(200,DUZ_",",.01)
E S ENT=$$GET1^DIQ(+$P(ENT,"(",2),+ENT_",",.01)
S @RESULTS@(0)=ENT
Q
;
GETHDR ; [Procedure] Returns common header format for TMDRecordID
S X=$$FIND1^DIC(8989.51,,"QX",PAR)
I X S @RESULTS@(0)=X_";8989.51^"_PAR
E S @RESULTS@(0)="-1^No such parameter ["_PAR_"]"
Q
;
GETLST ; [Procedure] Return all instances of a parameter
D GETLST^XPAR(.RET,ENT,PAR,"E",.ERR)
Q:$G(ERR,0)
S TMP="RET"
F S TMP=$Q(@TMP) Q:TMP="" D
.S @RESULTS@($O(@RESULTS@(""),-1)+1)=@TMP
S @RESULTS@(0)=$O(@RESULTS@(""),-1)
Q
;
GETPAR ; [Procedure] Returns external value of a parameter
S @RESULTS@(0)=$$GET^XPAR(ENT,PAR,INST,"E")
Q
;
GETWP ; [Procedure] Returns WP text for a parameter
D GETWP^XPAR(.RET,ENT,PAR,INST,.ERR)
Q:$G(ERR,0)
S TMP="RET"
F S TMP=$Q(@TMP) Q:TMP="" D
.S @RESULTS@($O(@RESULTS@(""),-1)+1)=@TMP
S @RESULTS@(0)=$O(@RESULTS@(""),-1)_U_INST
Q
;
LOCK ; [Procedure] Gain exclusive access to the CP Parameters
L +(^MDD("CP PARAMETERS")):5 S @RESULTS@(0)=$T
Q
;
PARLST ; [Procedure] Returns list of all parameters
F Y=1:1 Q:$P($T(PARS+Y),";;",2)["**EOD**" D
.S @RESULTS@(Y)=$P($T(PARS+Y),";;",2)
S @RESULTS@(0)=+$O(@RESULTS@(""),-1)
Q
;
RPC(RESULTS,OPTION,ENT,PAR,INST,VAL) ; [Procedure] Main RPC Hit Point
; RPC: [MD TMDPARAMETER]
;
; Requires that the parameter name in PAR
; be in the Clinical Procedures namespace.
;
; Input parameters
; 1. RESULTS [Literal/Required] No description
; 2. OPTION [Literal/Required] No description
; 3. ENT [Literal/Required] No description
; 4. PAR [Literal/Required] No description
; 5. INST [Literal/Required] No description
; 6. VAL [Literal/Required] No description
;
N ERR,TMP,RET,TXT,IEN,IENS,ROOT,MDD
S INST=$G(INST,1)
S PAR=$G(PAR,"MD")
S RESULTS=$NA(^TMP($J)) K @RESULTS
I PAR'?1"MD".E S ^TMP($J,0)="-1^Non Clinical Procedures Parameter" Q
D:$T(@OPTION)]"" @OPTION
I +$G(ERR) K ^TMP($J,0) S ^(0)="-1^Error: "_(+ERR)_" "_$P(ERR,U,2)
D:'$D(^TMP($J)) BADRPC^MDRPCU("MD TMDPARAMETER",$T(+0),OPTION)
D CLEAN^DILF
Q
;
SETLST ; [Procedure] Build list of parameters
N MDINS ; Instance Counter
D DELLST(ENT,PAR)
S MDINS=""
F S MDINS=$O(VAL(MDINS)) Q:MDINS="" D
.D EN^XPAR(ENT,PAR,MDINS,VAL(MDINS),.ERR)
S:'$G(ERR) @RESULTS@(0)="1^List "_PAR_" rebuilt"
Q
;
SETPAR ; [Procedure] Set single value into a parameter
D EN^XPAR(ENT,PAR,INST,VAL,.ERR)
S:'$G(ERR) @RESULTS@(0)="1^Parameter updated"
Q
;
SETWP ; [Procedure] Set WP text into a parameter
S TXT=INST,TMP=""
F S TMP=$O(VAL(TMP)) Q:TMP="" D
.S TXT($O(TXT(""),-1)+1,0)=VAL(TMP)
D EN^XPAR(ENT,PAR,INST,.TXT,.ERR)
S:'$G(ERR) @RESULTS@(0)="1^WP Text Saved"
Q
;
UNLOCK ; [Procedure] Relinquish exclusive access to CP Parameters
L -(^MDD("CP PARAMETERS")) S @RESULTS@(0)=$T
Q
;
PARS ; [Data Module] All Parameters
;;1^MD ALLOW EXTERNAL ATTACHMENTS^Allow non-instrument attachments^yes/no^No
;;2^MD CRC BYPASS^Bypass CRC Checking^yes/no^No
;;3^MD CRC VALUES^Clinical Procedures CRC Values^free text^Yes
;;4^MD DAYS FOR INSTRUMENT DATA^Temporary instrument data life (Days)^numeric^No
;;5^MD FILE EXTENSIONS^Imaging File Types^free text^Yes
;;6^MD HFS SCRATCH^VistA Scratch HFS Directory^free text^No
;;7^MD IMAGING XFER^Imaging Network Share^free text^No
;;8^MD OFFLINE MESSAGE^Offline message^word processing^No
;;9^MD ONLINE^Clinical Procedure Online/Offline^yes/no^No
;;10^MD VERSION CHK^Version Compatibility^yes/no^Yes
;;11^MD WEBLINK^Clinical Procedures Home Page^free text^No
;;**EOD**
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HMDRPCOV 4272 printed Oct 16, 2024@17:45:03 Page 2
MDRPCOV ; HOIFO/DP - Object RPCs (TMDParameter) ; [04-15-2003 12:42]
+1 ;;1.0;CLINICAL PROCEDURES;;Apr 01, 2004
+2 ; Integration Agreements:
+3 ; IA# 2263 [Supported] XPAR parameter call.
+4 ; IA# 2541 [Supported] Call to XUPARAM.
+5 ;
DELLST ; [Procedure] Delete list of parameters
+1 DO NDEL^XPAR(ENT,PAR,.ERR)
+2 if '$GET(ERR)
SET @RESULTS@(0)="1^All instances removed"
+3 QUIT
+4 ;
DELPAR ; [Procedure] Delete single parameter value
+1 DO DEL^XPAR(ENT,PAR,INST,.ERR)
+2 if '$GET(ERR)
SET @RESULTS@(0)="1^Instance deleted"
+3 QUIT
+4 ;
ENTVAL ; [Procedure] Return value of the entity
+1 IF ENT="SYS"
SET ENT=$$KSP^XUPARAM("WHERE")
+2 IF '$TEST
IF ENT="DIV"
SET ENT=$$GET1^DIQ(4,DUZ(2)_",",.01)
+3 IF '$TEST
IF ENT="USR"
SET ENT=$$GET1^DIQ(200,DUZ_",",.01)
+4 IF '$TEST
SET ENT=$$GET1^DIQ(+$PIECE(ENT,"(",2),+ENT_",",.01)
+5 SET @RESULTS@(0)=ENT
+6 QUIT
+7 ;
GETHDR ; [Procedure] Returns common header format for TMDRecordID
+1 SET X=$$FIND1^DIC(8989.51,,"QX",PAR)
+2 IF X
SET @RESULTS@(0)=X_";8989.51^"_PAR
+3 IF '$TEST
SET @RESULTS@(0)="-1^No such parameter ["_PAR_"]"
+4 QUIT
+5 ;
GETLST ; [Procedure] Return all instances of a parameter
+1 DO GETLST^XPAR(.RET,ENT,PAR,"E",.ERR)
+2 if $GET(ERR,0)
QUIT
+3 SET TMP="RET"
+4 FOR
SET TMP=$QUERY(@TMP)
if TMP=""
QUIT
Begin DoDot:1
+5 SET @RESULTS@($ORDER(@RESULTS@(""),-1)+1)=@TMP
End DoDot:1
+6 SET @RESULTS@(0)=$ORDER(@RESULTS@(""),-1)
+7 QUIT
+8 ;
GETPAR ; [Procedure] Returns external value of a parameter
+1 SET @RESULTS@(0)=$$GET^XPAR(ENT,PAR,INST,"E")
+2 QUIT
+3 ;
GETWP ; [Procedure] Returns WP text for a parameter
+1 DO GETWP^XPAR(.RET,ENT,PAR,INST,.ERR)
+2 if $GET(ERR,0)
QUIT
+3 SET TMP="RET"
+4 FOR
SET TMP=$QUERY(@TMP)
if TMP=""
QUIT
Begin DoDot:1
+5 SET @RESULTS@($ORDER(@RESULTS@(""),-1)+1)=@TMP
End DoDot:1
+6 SET @RESULTS@(0)=$ORDER(@RESULTS@(""),-1)_U_INST
+7 QUIT
+8 ;
LOCK ; [Procedure] Gain exclusive access to the CP Parameters
+1 LOCK +(^MDD("CP PARAMETERS")):5
SET @RESULTS@(0)=$TEST
+2 QUIT
+3 ;
PARLST ; [Procedure] Returns list of all parameters
+1 FOR Y=1:1
if $PIECE($TEXT(PARS+Y),";;",2)["**EOD**"
QUIT
Begin DoDot:1
+2 SET @RESULTS@(Y)=$PIECE($TEXT(PARS+Y),";;",2)
End DoDot:1
+3 SET @RESULTS@(0)=+$ORDER(@RESULTS@(""),-1)
+4 QUIT
+5 ;
RPC(RESULTS,OPTION,ENT,PAR,INST,VAL) ; [Procedure] Main RPC Hit Point
+1 ; RPC: [MD TMDPARAMETER]
+2 ;
+3 ; Requires that the parameter name in PAR
+4 ; be in the Clinical Procedures namespace.
+5 ;
+6 ; Input parameters
+7 ; 1. RESULTS [Literal/Required] No description
+8 ; 2. OPTION [Literal/Required] No description
+9 ; 3. ENT [Literal/Required] No description
+10 ; 4. PAR [Literal/Required] No description
+11 ; 5. INST [Literal/Required] No description
+12 ; 6. VAL [Literal/Required] No description
+13 ;
+14 NEW ERR,TMP,RET,TXT,IEN,IENS,ROOT,MDD
+15 SET INST=$GET(INST,1)
+16 SET PAR=$GET(PAR,"MD")
+17 SET RESULTS=$NAME(^TMP($JOB))
KILL @RESULTS
+18 IF PAR'?1"MD".E
SET ^TMP($JOB,0)="-1^Non Clinical Procedures Parameter"
QUIT
+19 if $TEXT(@OPTION)]""
DO @OPTION
+20 IF +$GET(ERR)
KILL ^TMP($JOB,0)
SET ^(0)="-1^Error: "_(+ERR)_" "_$PIECE(ERR,U,2)
+21 if '$DATA(^TMP($JOB))
DO BADRPC^MDRPCU("MD TMDPARAMETER",$TEXT(+0),OPTION)
+22 DO CLEAN^DILF
+23 QUIT
+24 ;
SETLST ; [Procedure] Build list of parameters
+1 ; Instance Counter
NEW MDINS
+2 DO DELLST(ENT,PAR)
+3 SET MDINS=""
+4 FOR
SET MDINS=$ORDER(VAL(MDINS))
if MDINS=""
QUIT
Begin DoDot:1
+5 DO EN^XPAR(ENT,PAR,MDINS,VAL(MDINS),.ERR)
End DoDot:1
+6 if '$GET(ERR)
SET @RESULTS@(0)="1^List "_PAR_" rebuilt"
+7 QUIT
+8 ;
SETPAR ; [Procedure] Set single value into a parameter
+1 DO EN^XPAR(ENT,PAR,INST,VAL,.ERR)
+2 if '$GET(ERR)
SET @RESULTS@(0)="1^Parameter updated"
+3 QUIT
+4 ;
SETWP ; [Procedure] Set WP text into a parameter
+1 SET TXT=INST
SET TMP=""
+2 FOR
SET TMP=$ORDER(VAL(TMP))
if TMP=""
QUIT
Begin DoDot:1
+3 SET TXT($ORDER(TXT(""),-1)+1,0)=VAL(TMP)
End DoDot:1
+4 DO EN^XPAR(ENT,PAR,INST,.TXT,.ERR)
+5 if '$GET(ERR)
SET @RESULTS@(0)="1^WP Text Saved"
+6 QUIT
+7 ;
UNLOCK ; [Procedure] Relinquish exclusive access to CP Parameters
+1 LOCK -(^MDD("CP PARAMETERS"))
SET @RESULTS@(0)=$TEST
+2 QUIT
+3 ;
PARS ; [Data Module] All Parameters
+1 ;;1^MD ALLOW EXTERNAL ATTACHMENTS^Allow non-instrument attachments^yes/no^No
+2 ;;2^MD CRC BYPASS^Bypass CRC Checking^yes/no^No
+3 ;;3^MD CRC VALUES^Clinical Procedures CRC Values^free text^Yes
+4 ;;4^MD DAYS FOR INSTRUMENT DATA^Temporary instrument data life (Days)^numeric^No
+5 ;;5^MD FILE EXTENSIONS^Imaging File Types^free text^Yes
+6 ;;6^MD HFS SCRATCH^VistA Scratch HFS Directory^free text^No
+7 ;;7^MD IMAGING XFER^Imaging Network Share^free text^No
+8 ;;8^MD OFFLINE MESSAGE^Offline message^word processing^No
+9 ;;9^MD ONLINE^Clinical Procedure Online/Offline^yes/no^No
+10 ;;10^MD VERSION CHK^Version Compatibility^yes/no^Yes
+11 ;;11^MD WEBLINK^Clinical Procedures Home Page^free text^No
+12 ;;**EOD**