| 1 | MDRPCOV ; HOIFO/DP - Object RPCs (TMDParameter) ; [04-15-2003 12:42] | 
|---|
| 2 | ;;1.0;CLINICAL PROCEDURES;;Apr 01, 2004 | 
|---|
| 3 | ; Integration Agreements: | 
|---|
| 4 | ; IA# 2263 [Supported] XPAR parameter call. | 
|---|
| 5 | ; IA# 2541 [Supported] Call to XUPARAM. | 
|---|
| 6 | ; | 
|---|
| 7 | DELLST ; [Procedure] Delete list of parameters | 
|---|
| 8 | D NDEL^XPAR(ENT,PAR,.ERR) | 
|---|
| 9 | S:'$G(ERR) @RESULTS@(0)="1^All instances removed" | 
|---|
| 10 | Q | 
|---|
| 11 | ; | 
|---|
| 12 | DELPAR ; [Procedure] Delete single parameter value | 
|---|
| 13 | D DEL^XPAR(ENT,PAR,INST,.ERR) | 
|---|
| 14 | S:'$G(ERR) @RESULTS@(0)="1^Instance deleted" | 
|---|
| 15 | Q | 
|---|
| 16 | ; | 
|---|
| 17 | ENTVAL ; [Procedure] Return value of the entity | 
|---|
| 18 | I ENT="SYS" S ENT=$$KSP^XUPARAM("WHERE") | 
|---|
| 19 | E  I ENT="DIV" S ENT=$$GET1^DIQ(4,DUZ(2)_",",.01) | 
|---|
| 20 | E  I ENT="USR" S ENT=$$GET1^DIQ(200,DUZ_",",.01) | 
|---|
| 21 | E  S ENT=$$GET1^DIQ(+$P(ENT,"(",2),+ENT_",",.01) | 
|---|
| 22 | S @RESULTS@(0)=ENT | 
|---|
| 23 | Q | 
|---|
| 24 | ; | 
|---|
| 25 | GETHDR ; [Procedure] Returns common header format for TMDRecordID | 
|---|
| 26 | S X=$$FIND1^DIC(8989.51,,"QX",PAR) | 
|---|
| 27 | I X S @RESULTS@(0)=X_";8989.51^"_PAR | 
|---|
| 28 | E  S @RESULTS@(0)="-1^No such parameter ["_PAR_"]" | 
|---|
| 29 | Q | 
|---|
| 30 | ; | 
|---|
| 31 | GETLST ; [Procedure] Return all instances of a parameter | 
|---|
| 32 | D GETLST^XPAR(.RET,ENT,PAR,"E",.ERR) | 
|---|
| 33 | Q:$G(ERR,0) | 
|---|
| 34 | S TMP="RET" | 
|---|
| 35 | F  S TMP=$Q(@TMP) Q:TMP=""  D | 
|---|
| 36 | .S @RESULTS@($O(@RESULTS@(""),-1)+1)=@TMP | 
|---|
| 37 | S @RESULTS@(0)=$O(@RESULTS@(""),-1) | 
|---|
| 38 | Q | 
|---|
| 39 | ; | 
|---|
| 40 | GETPAR ; [Procedure] Returns external value of a parameter | 
|---|
| 41 | S @RESULTS@(0)=$$GET^XPAR(ENT,PAR,INST,"E") | 
|---|
| 42 | Q | 
|---|
| 43 | ; | 
|---|
| 44 | GETWP ; [Procedure] Returns WP text for a parameter | 
|---|
| 45 | D GETWP^XPAR(.RET,ENT,PAR,INST,.ERR) | 
|---|
| 46 | Q:$G(ERR,0) | 
|---|
| 47 | S TMP="RET" | 
|---|
| 48 | F  S TMP=$Q(@TMP) Q:TMP=""  D | 
|---|
| 49 | .S @RESULTS@($O(@RESULTS@(""),-1)+1)=@TMP | 
|---|
| 50 | S @RESULTS@(0)=$O(@RESULTS@(""),-1)_U_INST | 
|---|
| 51 | Q | 
|---|
| 52 | ; | 
|---|
| 53 | LOCK ; [Procedure] Gain exclusive access to the CP Parameters | 
|---|
| 54 | L +(^MDD("CP PARAMETERS")):5 S @RESULTS@(0)=$T | 
|---|
| 55 | Q | 
|---|
| 56 | ; | 
|---|
| 57 | PARLST ; [Procedure] Returns list of all parameters | 
|---|
| 58 | F Y=1:1 Q:$P($T(PARS+Y),";;",2)["**EOD**"  D | 
|---|
| 59 | .S @RESULTS@(Y)=$P($T(PARS+Y),";;",2) | 
|---|
| 60 | S @RESULTS@(0)=+$O(@RESULTS@(""),-1) | 
|---|
| 61 | Q | 
|---|
| 62 | ; | 
|---|
| 63 | RPC(RESULTS,OPTION,ENT,PAR,INST,VAL) ; [Procedure] Main RPC Hit Point | 
|---|
| 64 | ; RPC: [MD TMDPARAMETER] | 
|---|
| 65 | ; | 
|---|
| 66 | ; Requires that the parameter name in PAR | 
|---|
| 67 | ; be in the Clinical Procedures namespace. | 
|---|
| 68 | ; | 
|---|
| 69 | ; Input parameters | 
|---|
| 70 | ;  1. RESULTS [Literal/Required] No description | 
|---|
| 71 | ;  2. OPTION [Literal/Required] No description | 
|---|
| 72 | ;  3. ENT [Literal/Required] No description | 
|---|
| 73 | ;  4. PAR [Literal/Required] No description | 
|---|
| 74 | ;  5. INST [Literal/Required] No description | 
|---|
| 75 | ;  6. VAL [Literal/Required] No description | 
|---|
| 76 | ; | 
|---|
| 77 | N ERR,TMP,RET,TXT,IEN,IENS,ROOT,MDD | 
|---|
| 78 | S INST=$G(INST,1) | 
|---|
| 79 | S PAR=$G(PAR,"MD") | 
|---|
| 80 | S RESULTS=$NA(^TMP($J)) K @RESULTS | 
|---|
| 81 | I PAR'?1"MD".E S ^TMP($J,0)="-1^Non Clinical Procedures Parameter" Q | 
|---|
| 82 | D:$T(@OPTION)]"" @OPTION | 
|---|
| 83 | I +$G(ERR) K ^TMP($J,0) S ^(0)="-1^Error: "_(+ERR)_" "_$P(ERR,U,2) | 
|---|
| 84 | D:'$D(^TMP($J)) BADRPC^MDRPCU("MD TMDPARAMETER",$T(+0),OPTION) | 
|---|
| 85 | D CLEAN^DILF | 
|---|
| 86 | Q | 
|---|
| 87 | ; | 
|---|
| 88 | SETLST ; [Procedure] Build list of parameters | 
|---|
| 89 | N MDINS ; Instance Counter | 
|---|
| 90 | D DELLST(ENT,PAR) | 
|---|
| 91 | S MDINS="" | 
|---|
| 92 | F  S MDINS=$O(VAL(MDINS)) Q:MDINS=""  D | 
|---|
| 93 | .D EN^XPAR(ENT,PAR,MDINS,VAL(MDINS),.ERR) | 
|---|
| 94 | S:'$G(ERR) @RESULTS@(0)="1^List "_PAR_" rebuilt" | 
|---|
| 95 | Q | 
|---|
| 96 | ; | 
|---|
| 97 | SETPAR ; [Procedure] Set single value into a parameter | 
|---|
| 98 | D EN^XPAR(ENT,PAR,INST,VAL,.ERR) | 
|---|
| 99 | S:'$G(ERR) @RESULTS@(0)="1^Parameter updated" | 
|---|
| 100 | Q | 
|---|
| 101 | ; | 
|---|
| 102 | SETWP ; [Procedure] Set WP text into a parameter | 
|---|
| 103 | S TXT=INST,TMP="" | 
|---|
| 104 | F  S TMP=$O(VAL(TMP)) Q:TMP=""  D | 
|---|
| 105 | .S TXT($O(TXT(""),-1)+1,0)=VAL(TMP) | 
|---|
| 106 | D EN^XPAR(ENT,PAR,INST,.TXT,.ERR) | 
|---|
| 107 | S:'$G(ERR) @RESULTS@(0)="1^WP Text Saved" | 
|---|
| 108 | Q | 
|---|
| 109 | ; | 
|---|
| 110 | UNLOCK ; [Procedure] Relinquish exclusive access to CP Parameters | 
|---|
| 111 | L -(^MDD("CP PARAMETERS")) S @RESULTS@(0)=$T | 
|---|
| 112 | Q | 
|---|
| 113 | ; | 
|---|
| 114 | PARS ; [Data Module] All Parameters | 
|---|
| 115 | ;;1^MD ALLOW EXTERNAL ATTACHMENTS^Allow non-instrument attachments^yes/no^No | 
|---|
| 116 | ;;2^MD CRC BYPASS^Bypass CRC Checking^yes/no^No | 
|---|
| 117 | ;;3^MD CRC VALUES^Clinical Procedures CRC Values^free text^Yes | 
|---|
| 118 | ;;4^MD DAYS FOR INSTRUMENT DATA^Temporary instrument data life (Days)^numeric^No | 
|---|
| 119 | ;;5^MD FILE EXTENSIONS^Imaging File Types^free text^Yes | 
|---|
| 120 | ;;6^MD HFS SCRATCH^VistA Scratch HFS Directory^free text^No | 
|---|
| 121 | ;;7^MD IMAGING XFER^Imaging Network Share^free text^No | 
|---|
| 122 | ;;8^MD OFFLINE MESSAGE^Offline message^word processing^No | 
|---|
| 123 | ;;9^MD ONLINE^Clinical Procedure Online/Offline^yes/no^No | 
|---|
| 124 | ;;10^MD VERSION CHK^Version Compatibility^yes/no^Yes | 
|---|
| 125 | ;;11^MD WEBLINK^Clinical Procedures Home Page^free text^No | 
|---|
| 126 | ;;**EOD** | 
|---|