[613] | 1 | GMVPAR ; HOIFO/DP - XPARameter RPC ; 31-MAY-2002 10:06:18
|
---|
| 2 | ;;5.0;GEN. MED. REC. - VITALS;**3**;Oct 31, 2002
|
---|
| 3 | ; Integration Agreements:
|
---|
| 4 | ; IA# 2263 [Supported] XPAR parameter call.
|
---|
| 5 | ; IA# 2541 [Supported] Call to XUPARAM.
|
---|
| 6 | ; IA# 10060 [Supported] FILE 200 fields
|
---|
| 7 | ; IA# 10090 [Supported] FILE 4 references
|
---|
| 8 | ;
|
---|
| 9 | ; This routine supports the following IAs:
|
---|
| 10 | ; #4367 - GMV PARAMETER RPC is called at RPC (private)
|
---|
| 11 | ;
|
---|
| 12 | ;DELLST; [Procedure] Delete list of parameters
|
---|
| 13 | ;D NDEL^XPAR(ENT,PAR,.ERR)
|
---|
| 14 | ;S:'$G(ERR) @RESULTS@(0)="1^All instances removed"
|
---|
| 15 | ;Q
|
---|
| 16 | ;
|
---|
| 17 | DELPAR ; [Procedure] Delete single parameter value
|
---|
| 18 | D DEL^XPAR(ENT,PAR,INST,.ERR)
|
---|
| 19 | S:'$G(ERR) @RESULTS@(0)="1^Instance deleted"
|
---|
| 20 | Q
|
---|
| 21 | ;
|
---|
| 22 | ENTVAL ; [Procedure] Return value of the entity
|
---|
| 23 | I ENT="SYS" S ENT=$$KSP^XUPARAM("WHERE")
|
---|
| 24 | E I ENT="DIV" S ENT=$$GET1^DIQ(4,DUZ(2)_",",.01)
|
---|
| 25 | E I ENT="USR" S ENT=$$GET1^DIQ(200,DUZ_",",.01)
|
---|
| 26 | E S ENT=$$GET1^DIQ(+$P(ENT,"(",2),+ENT_",",.01)
|
---|
| 27 | S @RESULTS@(0)=ENT
|
---|
| 28 | Q
|
---|
| 29 | ;
|
---|
| 30 | ;GETHDR; [Procedure] Returns common header format
|
---|
| 31 | ;S X=$$FIND1^DIC(8989.51,,"QX",PAR)
|
---|
| 32 | ;I X S @RESULTS@(0)=X_";8989.51^"_PAR
|
---|
| 33 | ;E S @RESULTS@(0)="-1^No such parameter ["_PAR_"]"
|
---|
| 34 | ;Q
|
---|
| 35 | ;
|
---|
| 36 | GETLST ; [Procedure] Return all instances of a parameter
|
---|
| 37 | D GETLST^XPAR(.RET,ENT,PAR,"E",.ERR)
|
---|
| 38 | Q:$G(ERR,0)
|
---|
| 39 | S TMP="RET"
|
---|
| 40 | F S TMP=$Q(@TMP) Q:TMP="" D
|
---|
| 41 | .S @RESULTS@($O(@RESULTS@(""),-1)+1)=@TMP
|
---|
| 42 | S @RESULTS@(0)=$O(@RESULTS@(""),-1)
|
---|
| 43 | Q
|
---|
| 44 | ;
|
---|
| 45 | GETPAR ; [Procedure] Returns external value of a parameter
|
---|
| 46 | S @RESULTS@(0)=$$GET^XPAR(ENT,PAR,INST,"E")
|
---|
| 47 | Q
|
---|
| 48 | ;
|
---|
| 49 | ;GETWP; [Procedure] Returns WP text for a parameter
|
---|
| 50 | ;D GETWP^XPAR(.RET,ENT,PAR,INST,.ERR)
|
---|
| 51 | ;Q:$G(ERR,0)
|
---|
| 52 | ;S TMP="RET"
|
---|
| 53 | ;F S TMP=$Q(@TMP) Q:TMP="" D
|
---|
| 54 | ;.S @RESULTS@($O(@RESULTS@(""),-1)+1)=@TMP
|
---|
| 55 | ;S @RESULTS@(0)=$O(@RESULTS@(""),-1)_U_INST
|
---|
| 56 | ;Q
|
---|
| 57 | ;
|
---|
| 58 | RPC(RESULTS,OPTION,ENT,PAR,INST,VAL) ; [Procedure] Main RPC Hit Point
|
---|
| 59 | ; RPC: [GMV PARAMETER]
|
---|
| 60 | ;
|
---|
| 61 | ; Requires that the parameter name in PAR
|
---|
| 62 | ; be in the GMV namespace.
|
---|
| 63 | ;
|
---|
| 64 | ; Input parameters
|
---|
| 65 | ; 1. RESULTS [Literal/Required] No description
|
---|
| 66 | ; 2. OPTION [Literal/Required] No description
|
---|
| 67 | ; 3. ENT [Literal/Required] No description
|
---|
| 68 | ; 4. PAR [Literal/Required] No description
|
---|
| 69 | ; 5. INST [Literal/Required] No description
|
---|
| 70 | ; 6. VAL [Literal/Required] No description
|
---|
| 71 | ;
|
---|
| 72 | N ERR,TMP,RET,TXT,IEN,IENS,ROOT
|
---|
| 73 | S INST=$G(INST,1)
|
---|
| 74 | S PAR=$G(PAR,"GMV")
|
---|
| 75 | S RESULTS=$NA(^TMP($J)) K @RESULTS
|
---|
| 76 | I PAR'?1"GMV".E S ^TMP($J,0)="-1^Non Vitals Measurements Parameter" Q
|
---|
| 77 | D:$T(@OPTION)]"" @OPTION
|
---|
| 78 | I +$G(ERR) K @RESULTS S @RESULTS@(0)="-1^Error: "_(+ERR)_" "_$P(ERR,U,2)
|
---|
| 79 | I '$D(^TMP($J)) S @RESULTS@(0)="-1^No date returned"
|
---|
| 80 | D CLEAN^DILF
|
---|
| 81 | Q
|
---|
| 82 | ;
|
---|
| 83 | ;SETLST; [Procedure] Build list of parameters
|
---|
| 84 | ;N GMVINS ; Instance Counter
|
---|
| 85 | ;D DELLST(ENT,PAR)
|
---|
| 86 | ;S GMVINS=""
|
---|
| 87 | ;F S GMVINS=$O(VAL(GMVINS)) Q:GMVINS="" D
|
---|
| 88 | ;.D EN^XPAR(ENT,PAR,GMVINS,VAL(GMVINS),.ERR)
|
---|
| 89 | ;S:'$G(ERR) @RESULTS@(0)="1^List "_PAR_" rebuilt"
|
---|
| 90 | ;Q
|
---|
| 91 | ;
|
---|
| 92 | SETPAR ; [Procedure] Set single value into a parameter
|
---|
| 93 | D EN^XPAR(ENT,PAR,INST,VAL,.ERR)
|
---|
| 94 | S:'$G(ERR) @RESULTS@(0)="1^Parameter updated"
|
---|
| 95 | Q
|
---|
| 96 | ;
|
---|
| 97 | ;SETWP; [Procedure] Set WP text into a parameter
|
---|
| 98 | ;S TXT=INST,TMP=""
|
---|
| 99 | ;F S TMP=$O(VAL(TMP)) Q:TMP="" D
|
---|
| 100 | ;.S TXT($O(TXT(""),-1)+1,0)=VAL(TMP)
|
---|
| 101 | ;D EN^XPAR(ENT,PAR,INST,.TXT,.ERR)
|
---|
| 102 | ;S:'$G(ERR) @RESULTS@(0)="1^WP Text Saved"
|
---|
| 103 | ;Q
|
---|
| 104 | ;
|
---|