source: FOIAVistA/trunk/r/HEALTHEVET_DESKTOP-XHD/XHDPARAM.m@ 632

Last change on this file since 632 was 628, checked in by George Lilly, 15 years ago

initial load of FOIAVistA 6/30/08 version

File size: 1.3 KB
Line 
1XHDPARAM ; SLC/JER - Configurator Server Calls ; 25 Jul 2003 9:42 AM
2 ;;1.0;HEALTHEVET DESKTOP;;Jul 15, 2003
3PUT(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
16COUNT(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
20SETWPVAL(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
24ONERROR ; Trap errors
25 S ERR="1^"_$TR($$EC^%ZOSV,"^","~")
26 D ^%ZTER
27 Q
28XFORM(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)
32XFORMX Q XHDY
Note: See TracBrowser for help on using the repository browser.