source: WorldVistAEHR/trunk/r/HEALTHEVET_DESKTOP-XHD/XHDTST.m@ 1361

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

initial load of WorldVistAEHR

File size: 1.2 KB
RevLine 
[613]1XHDTST ; SLC/JER - Test calls ; 25 Jul 2003 9:42 AM
2 ;;1.0;HEALTHEVET DESKTOP;;Jul 15, 2003
3INLST(ORY,ORX) ; Test input list
4 N I,J,RC S I="",(J,RC)=0,ORY=$NA(^TMP("XHDZTST",$J))
5 D XMLHDR^XHDLXM(.ORY,"result",.J),RSLTBL(.ORY,.J)
6 F S I=$O(ORX(I)) Q:I']"" D
7 . N COL
8 . S RC=RC+1
9 . D BUILDROW(.COL,.ORX,I),SETROW(.ORY,.COL,.J)
10 S SPEC("##")=RC,@ORY@(3)=$$REPLACE^XLFSTR(@ORY@(3),.SPEC)
11 S J=J+1,@ORY@(J)="</rows>"
12 S J=J+1,@ORY@(J)="</resultTable>"
13 D XMLFOOT^XHDLXM(.ORY,"result",.J)
14 Q
15RSLTBL(ORY,ORI) ; resultTable
16 S ORI=ORI+1
17 S @ORY@(ORI)="<resultTable name=""test_list"" rowCount=""##"" columnCount=""2"">"
18 S ORI=ORI+1,@ORY@(ORI)="<columns>"
19 S ORI=ORI+1
20 S @ORY@(ORI)="<c name=""name"" type=""string""/>"
21 S ORI=ORI+1
22 S @ORY@(ORI)="<c name=""value"" type=""string""/>"
23 S ORI=ORI+1,@ORY@(ORI)="</columns>"
24 S ORI=ORI+1,@ORY@(ORI)="<rows>"
25 Q
26BUILDROW(COL,ORX,I) ; Resolve fields for each row
27 S COL(1)=I
28 S COL(2)=ORX(I)
29 Q
30SETROW(ORY,COL,ORI) ; Generate tags for row
31 N ORC,Y S ORC=0
32 S ORI=ORI+1,@ORY@(ORI)="<r>"
33 S Y=ORI
34 F S ORC=$O(COL(ORC)) Q:+ORC'>0 D
35 . S ORI=ORI+1,@ORY@(ORI)=$S(COL(ORC)]"":"<c>"_COL(ORC)_"</c>",1:"<c/>")
36 I Y=ORI S ORI=ORI+1,@ORY@(ORI)="<c/>"
37 S ORI=ORI+1,@ORY@(ORI)="</r>"
38 Q
Note: See TracBrowser for help on using the repository browser.