-
Notifications
You must be signed in to change notification settings - Fork 0
/
CodeTable.cls
99 lines (86 loc) · 2.34 KB
/
CodeTable.cls
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
/// Sample code table class
Class Sample.iscru.fhir.fts.model.CodeTable Extends (%Persistent, %Populate)
{
/// code
Property code As %String(MAXLEN = 50);
/// display
Property description As %String(MAXLEN = "", POPSPEC = "Mission()");
Property testBoolean As %Boolean;
Property testDate As %Date;
Property testTS As %TimeStamp;
Property testDecimal As %Decimal(SCALE = 4);
Index codeIndex On code [ IdKey, PrimaryKey, Unique ];
Method OnPopulate() As %Status
{
#dim rs As %ResultSet = ##class(%ResultSet).%New($classname() _ ":Extent")
$$$ThrowOnError(rs.Execute())
// if this is the first row then assign "TEST" to code
if 'rs.Next() set ..code = "TEST"
quit $$$OK
}
Storage Default
{
<Data name="CodeTableDefaultData">
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>description</Value>
</Value>
<Value name="3">
<Value>testBoolean</Value>
</Value>
<Value name="4">
<Value>testDate</Value>
</Value>
<Value name="5">
<Value>testTS</Value>
</Value>
<Value name="6">
<Value>testDecimal</Value>
</Value>
</Data>
<DataLocation>^Sample.iscru.fhi89A0.CodeTableD</DataLocation>
<DefaultData>CodeTableDefaultData</DefaultData>
<ExtentSize>10</ExtentSize>
<IdLocation>^Sample.iscru.fhi89A0.CodeTableD</IdLocation>
<IndexLocation>^Sample.iscru.fhi89A0.CodeTableI</IndexLocation>
<Property name="%%CLASSNAME">
<AverageFieldSize>1</AverageFieldSize>
<Selectivity>100.0000%</Selectivity>
</Property>
<Property name="%%ID">
<AverageFieldSize>4.8</AverageFieldSize>
<Selectivity>1</Selectivity>
</Property>
<Property name="code">
<AverageFieldSize>4.8</AverageFieldSize>
<Selectivity>1</Selectivity>
</Property>
<Property name="description">
<AverageFieldSize>1</AverageFieldSize>
<Selectivity>10.0000%</Selectivity>
</Property>
<Property name="testBoolean">
<AverageFieldSize>1</AverageFieldSize>
<Selectivity>50.0000%</Selectivity>
</Property>
<Property name="testDate">
<AverageFieldSize>5</AverageFieldSize>
<Selectivity>10.0000%</Selectivity>
</Property>
<Property name="testDecimal">
<AverageFieldSize>8.9</AverageFieldSize>
<Selectivity>10.0000%</Selectivity>
</Property>
<Property name="testTS">
<AverageFieldSize>19</AverageFieldSize>
<Selectivity>10.0000%</Selectivity>
</Property>
<SQLMap name="codeIndex">
<BlockCount>-4</BlockCount>
</SQLMap>
<StreamLocation>^Sample.iscru.fhi89A0.CodeTableS</StreamLocation>
<Type>%Storage.Persistent</Type>
}
}