[613] | 1 | XHDPARAM ; SLC/JER - Configurator Server Calls ; 25 Jul 2003 9:42 AM
|
---|
| 2 | ;;1.0;HEALTHEVET DESKTOP;;Jul 15, 2003
|
---|
| 3 | PUT(ERR,KEY,VALUE) ; Calls PUT^XPAR to set param value
|
---|
| 4 | N ENT,PAR,INST,PUTVAL,X,VDTYPE
|
---|
| 5 | S X="ONERROR^XHDPARAM",@^%ZOSF("TRAP")
|
---|
| 6 | S ENT=$S(+$P(KEY,U,2):$P(KEY,U,2),1:DUZ_";VA(200,"),PAR=$P(KEY,U,3)
|
---|
| 7 | S VDTYPE=$P($G(^XTV(8989.51,PAR,1)),U)
|
---|
| 8 | S INST=$P(KEY,U,4)
|
---|
| 9 | S:INST']"" INST=1
|
---|
| 10 | I $S(VDTYPE="W":1,$$COUNT(.VALUE)>1:1,1:0) D SETWPVAL(.VALUE,.PUTVAL) S PUTVAL=$P(KEY,U) I 1
|
---|
| 11 | E S PUTVAL=$$XFORM(VALUE(1),VDTYPE)
|
---|
| 12 | S ^XTMP("XHDPARAM",$J,KEY,"ENT")=ENT,^("PAR")=PAR,^("INST")=INST,^("PUTVAL")=PUTVAL
|
---|
| 13 | D EN^XPAR(ENT,PAR,INST,.PUTVAL,.ERR)
|
---|
| 14 | S ^XTMP("XHDPARAM",$J,KEY,"ERR")=ERR
|
---|
| 15 | Q
|
---|
| 16 | COUNT(VALUE) ; Count number of lines in VALUE
|
---|
| 17 | N XHDI,COUNT S (COUNT,XHDI)=0
|
---|
| 18 | F S XHDI=$O(VALUE(XHDI)) Q:+XHDI'>0 S COUNT=COUNT+1
|
---|
| 19 | Q COUNT
|
---|
| 20 | SETWPVAL(INVALUE,OUTVALUE) ; Sets 0-nodes for WordProcessing value
|
---|
| 21 | N XHDI,VAL S XHDI=0
|
---|
| 22 | F S XHDI=$O(INVALUE(XHDI)) Q:+XHDI'>0 S OUTVALUE(XHDI,0)=INVALUE(XHDI) K INVALUE(XHDI)
|
---|
| 23 | Q
|
---|
| 24 | ONERROR ; Trap errors
|
---|
| 25 | S ERR="1^"_$TR($$EC^%ZOSV,"^","~")
|
---|
| 26 | D ^%ZTER
|
---|
| 27 | Q
|
---|
| 28 | XFORM(VAL,VDTYPE) ; Transform values for select data types
|
---|
| 29 | N XHDY S XHDY=VAL
|
---|
| 30 | I VDTYPE="D" S XHDY=$$HL7TFM^XLFDT(VAL) G XFORMX
|
---|
| 31 | I VDTYPE="Y" S XHDY=$S(VAL="true":"YES",VAL="false":"NO",1:VAL)
|
---|
| 32 | XFORMX Q XHDY
|
---|