forked from KRMAssociatesInc/JDS-GTM
-
Notifications
You must be signed in to change notification settings - Fork 2
/
VPRJT2D.m
124 lines (124 loc) · 4.78 KB
/
VPRJT2D.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
VPRJT2D ;V4W/DLW -- Integration tests for operational utilities
;
STARTUP ; Run once before all tests
D ODSCLR^VPRJTX
QUIT
;
SHUTDOWN ; Run once after all tests
D ODSCLR^VPRJTX
QUIT
;
SETUP ; Run before each test
D ODSCLR^VPRJTX
QUIT
;
TEARDOWN ; Run after each test
D ODSCLR^VPRJTX
QUIT
;
ASSERT(EXPECT,ACTUAL,MSG) ; for convenience
D EQ^VPRJT(EXPECT,ACTUAL,$G(MSG))
QUIT
;
BUILD ; Build up test data
N DATA,LOC
D GETDATA^VPRJTX("TEST1","VPRJTD01",.DATA)
S LOC=$$SAVE^VPRJDS(.DATA)
K DATA,LOC
D GETDATA^VPRJTX("TEST2","VPRJTD01",.DATA)
S LOC=$$SAVE^VPRJDS(.DATA)
K DATA,LOC
D GETDATA^VPRJTX("TEST3","VPRJTD01",.DATA)
S LOC=$$SAVE^VPRJDS(.DATA)
K DATA,LOC
D GETDATA^VPRJTX("TEST4","VPRJTD01",.DATA)
S LOC=$$SAVE^VPRJDS(.DATA)
K DATA,LOC
D GETDATA^VPRJTX("TEST5","VPRJTD01",.DATA)
S LOC=$$SAVE^VPRJDS(.DATA)
K DATA,LOC
D GETDATA^VPRJTX("TEST6","VPRJTD01",.DATA)
S LOC=$$SAVE^VPRJDS(.DATA)
K DATA,LOC
D GETDATA^VPRJTX("TEST7","VPRJTD01",.DATA)
S LOC=$$SAVE^VPRJDS(.DATA)
K DATA,LOC
D GETDATA^VPRJTX("LINK1","VPRJTD01",.DATA)
S LOC=$$SAVE^VPRJDS(.DATA)
;
QUIT
;
RIDXALL ;; @TEST reindexing all operational data indexes
D BUILD
;
D ASSERT(1,$D(^VPRJDX("attr","test-name","alpha ","798789799542=","urn:va:test:1",1)))
D ASSERT(1,$D(^VPRJDX("attr","test-name","omega ","798789768244=","urn:va:test:7",1)))
D ASSERT(1,$D(^VPRJDX("attr","utest-name","alpha ","urn:va:test:1",1)))
D ASSERT(1,$D(^VPRJDX("attr","utest-name","omega ","urn:va:test:7",1)))
D ASSERT(1,$D(^VPRJDX("rev","urn:va:test:2","utest-ods","urn:va:utestods:1","items#1")))
D ASSERT(1,^VPRJDX("tally","test-name-count","alpha"))
D ASSERT(2,^VPRJDX("tally","test-name-count","delta"))
D ASSERT(7,^VPRJDX("count","collection","test"))
;
D RIDXALL^VPRJ2D
;
D ASSERT(1,$D(^VPRJDX("attr","test-name","alpha ","798789799542=","urn:va:test:1",1)))
D ASSERT(1,$D(^VPRJDX("attr","test-name","omega ","798789768244=","urn:va:test:7",1)))
D ASSERT(1,$D(^VPRJDX("attr","utest-name","alpha ","urn:va:test:1",1)))
D ASSERT(1,$D(^VPRJDX("attr","utest-name","omega ","urn:va:test:7",1)))
D ASSERT(1,$D(^VPRJDX("rev","urn:va:test:2","utest-ods","urn:va:utestods:1","items#1")))
D ASSERT(1,^VPRJDX("tally","test-name-count","alpha"))
D ASSERT(2,^VPRJDX("tally","test-name-count","delta"))
D ASSERT(7,^VPRJDX("count","collection","test"))
;
QUIT
;
RIDXONE ;; @TEST reindexing one operational data index
D BUILD
;
D ASSERT(1,$D(^VPRJDX("attr","test-name","alpha ","798789799542=","urn:va:test:1",1)))
D ASSERT(1,$D(^VPRJDX("attr","test-name","omega ","798789768244=","urn:va:test:7",1)))
D ASSERT(1,$D(^VPRJDX("attr","utest-name","alpha ","urn:va:test:1",1)))
D ASSERT(1,$D(^VPRJDX("attr","utest-name","omega ","urn:va:test:7",1)))
D ASSERT(1,$D(^VPRJDX("rev","urn:va:test:2","utest-ods","urn:va:utestods:1","items#1")))
D ASSERT(1,^VPRJDX("tally","test-name-count","alpha"))
D ASSERT(2,^VPRJDX("tally","test-name-count","delta"))
D ASSERT(7,^VPRJDX("count","collection","test"))
;
D RIDXALL^VPRJ2D("test-name")
;
D ASSERT(1,$D(^VPRJDX("attr","test-name","alpha ","798789799542=","urn:va:test:1",1)))
D ASSERT(1,$D(^VPRJDX("attr","test-name","omega ","798789768244=","urn:va:test:7",1)))
D ASSERT(1,$D(^VPRJDX("attr","utest-name","alpha ","urn:va:test:1",1)))
D ASSERT(1,$D(^VPRJDX("attr","utest-name","omega ","urn:va:test:7",1)))
D ASSERT(1,$D(^VPRJDX("rev","urn:va:test:2","utest-ods","urn:va:utestods:1","items#1")))
D ASSERT(1,^VPRJDX("tally","test-name-count","alpha"))
D ASSERT(2,^VPRJDX("tally","test-name-count","delta"))
D ASSERT(7,^VPRJDX("count","collection","test"))
;
QUIT
;
RIDXSOME ;; @TEST reindexing some operational data indexes
D BUILD
;
D ASSERT(1,$D(^VPRJDX("attr","test-name","alpha ","798789799542=","urn:va:test:1",1)))
D ASSERT(1,$D(^VPRJDX("attr","test-name","omega ","798789768244=","urn:va:test:7",1)))
D ASSERT(1,$D(^VPRJDX("attr","utest-name","alpha ","urn:va:test:1",1)))
D ASSERT(1,$D(^VPRJDX("attr","utest-name","omega ","urn:va:test:7",1)))
D ASSERT(1,$D(^VPRJDX("rev","urn:va:test:2","utest-ods","urn:va:utestods:1","items#1")))
D ASSERT(1,^VPRJDX("tally","test-name-count","alpha"))
D ASSERT(2,^VPRJDX("tally","test-name-count","delta"))
D ASSERT(7,^VPRJDX("count","collection","test"))
;
D RIDXALL^VPRJ2D("test-name,utest-name")
;
D ASSERT(1,$D(^VPRJDX("attr","test-name","alpha ","798789799542=","urn:va:test:1",1)))
D ASSERT(1,$D(^VPRJDX("attr","test-name","omega ","798789768244=","urn:va:test:7",1)))
D ASSERT(1,$D(^VPRJDX("attr","utest-name","alpha ","urn:va:test:1",1)))
D ASSERT(1,$D(^VPRJDX("attr","utest-name","omega ","urn:va:test:7",1)))
D ASSERT(1,$D(^VPRJDX("rev","urn:va:test:2","utest-ods","urn:va:utestods:1","items#1")))
D ASSERT(1,^VPRJDX("tally","test-name-count","alpha"))
D ASSERT(2,^VPRJDX("tally","test-name-count","delta"))
D ASSERT(7,^VPRJDX("count","collection","test"))
;
QUIT