-
Notifications
You must be signed in to change notification settings - Fork 12
/
YamlSettings.cs
245 lines (226 loc) · 9.57 KB
/
YamlSettings.cs
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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
using System.Collections.Generic;
namespace UniversaLIS
{
public class YamlSettings
{
public InterfaceSettings? Interfaces { get; set; }
public ServiceConfig? ServiceConfig { get; set; }
public TableMappings? TableFieldMappings { get; set; }
public class InterfaceSettings
{
public List<Serial>? Serial { get; set; }
public List<Tcp>? Tcp { get; set; }
}
}
public interface IPortSettings
{
public string? ReceiverId { get; set; }
public string? Password { get; set; }
public bool UseLegacyFrameSize { get; set; }
public int AutoSendOrders { get; set; }
public string GetPortDetails();
}
public class Tcp : IPortSettings
{
public string? ReceiverId { get; set; }
public string? Password { get; set; }
public bool UseLegacyFrameSize { get; set; }
public int Socket { get; set; }
public int AutoSendOrders { get; set; }
public string GetPortDetails()
{
return $"{Socket}";
}
}
public class Serial : IPortSettings
{
public string? ReceiverId { get; set; }
public string? Password { get; set; }
public string? Portname { get; set; }
public int Baud { get; set; }
public System.IO.Ports.Parity Parity { get; set; }
public int Databits { get; set; }
public System.IO.Ports.StopBits Stopbits { get; set; }
public System.IO.Ports.Handshake Handshake { get; set; }
public bool UseLegacyFrameSize { get; set; }
public int AutoSendOrders { get; set; }
public string GetPortDetails()
{
int stopbits = 0;
if (Stopbits == System.IO.Ports.StopBits.One)
{
stopbits = 1;
}
else if (Stopbits == System.IO.Ports.StopBits.Two)
{
stopbits = 2;
}
char parity = 'N';
if (Parity == System.IO.Ports.Parity.Even)
{
parity = 'E';
}
else if (Parity == System.IO.Ports.Parity.Odd)
{
parity = 'O';
}
else if (Parity == System.IO.Ports.Parity.Mark)
{
parity = 'M';
}
else if (Parity == System.IO.Ports.Parity.Space)
{
parity = 'S';
}
return $"{Databits}{parity}{stopbits}";
}
//(Parity)Enum.Parse(typeof(Parity), parity, true), databits, (StopBits)Enum.Parse(typeof(StopBits), stopbits, true)
}
public class TableMappings
{
public PatientRecordSet? PatientRecord { get; set; }
public OrderRecordSet? OrderRecord { get; set; }
public ResultRecordSet? ResultRecord { get; set; }
public QueryRecordSet? QueryRecord { get; set; }
public CommentRecordSet? CommentRecord { get; set; }
public ScientificRecordSet? ScientificRecord { get; set; }
public class PatientRecordSet
{
public string? PAPID { get; set; }
public string? LAPID { get; set; }
public string? PID3 { get; set; }
public string? PName { get; set; }
public string? MMName { get; set; }
public string? DOB { get; set; }
public string? PSex { get; set; }
public string? PRace { get; set; }
public string? PAddr { get; set; }
public string? Reserved { get; set; }
public string? PTelNo { get; set; }
public string? Attending { get; set; }
public string? Special1 { get; set; }
public string? Special2 { get; set; }
public string? PHeight { get; set; }
public string? PWeight { get; set; }
public string? PDiag { get; set; }
public string? PMeds { get; set; }
public string? PDiet { get; set; }
public string? PF1 { get; set; }
public string? PF2 { get; set; }
public string? AdmDates { get; set; }
public string? AdmStatus { get; set; }
public string? PLocation { get; set; }
public string? AltCodeNature { get; set; }
public string? AltCode { get; set; }
public string? PReligion { get; set; }
public string? PMarStatus { get; set; }
public string? PIsoStatus { get; set; }
public string? PLanguage { get; set; }
public string? HospService { get; set; }
public string? HospInst { get; set; }
public string? DoseCat { get; set; }
}
public class OrderRecordSet
{
public string? PRID { get; set; }
public string? SpecID { get; set; }
public string? InSpecID { get; set; }
public string? UTID { get; set; }
public string? OrderDate { get; set; }
public string? CollectDate { get; set; }
public string? CollEndTime { get; set; }
public string? CollVolume { get; set; }
public string? Collector { get; set; }
public string? ActCode { get; set; }
public string? DangerCode { get; set; }
public string? RelClinInfo { get; set; }
public string? SpecRecd { get; set; }
public string? SpecDesc { get; set; }
public string? OrdPhys { get; set; }
public string? PhysTelNo { get; set; }
public string? UF1 { get; set; }
public string? UF2 { get; set; }
public string? LF1 { get; set; }
public string? LF2 { get; set; }
public string? LastReported { get; set; }
public string? BillRef { get; set; }
public string? InSectID { get; set; }
public string? RepType { get; set; }
public string? Reserved { get; set; }
public string? SpecColLocation { get; set; }
public string? NosInfFlag { get; set; }
public string? SpecService { get; set; }
public string? SpecInst { get; set; }
}
public class ResultRecordSet
{
public string? ORID { get; set; }
public string? UTID { get; set; }
public string? Result { get; set; }
public string? Unit { get; set; }
public string? RefRange { get; set; }
public string? Abnormal { get; set; }
public string? AbNature { get; set; }
public string? ResStatus { get; set; }
public string? NormsChanged { get; set; }
public string? OpID { get; set; }
public string? TestStart { get; set; }
public string? TestEnd { get; set; }
public string? InstID { get; set; }
}
public class QueryRecordSet
{
public string? StartRange { get; set; }
public string? EndRange { get; set; }
public string? UTID { get; set; }
public string? ReqLimNature { get; set; }
public string? ReqResBeginDT { get; set; }
public string? ReqResEndDT { get; set; }
public string? ReqPhysName { get; set; }
public string? ReqPhysTelNo { get; set; }
public string? UF1 { get; set; }
public string? UF2 { get; set; }
public string? ReqInfoStatus { get; set; }
}
public class CommentRecordSet
{
public string? Source { get; set; }
public string? Text { get; set; }
public string? Type { get; set; }
}
public class ScientificRecordSet
{
public string? AnalMeth { get; set; }
public string? Instrument { get; set; }
public string? Reagents { get; set; }
public string? Units { get; set; }
public string? QC { get; set; }
public string? SpecDesc { get; set; }
public string? Reserved { get; set; }
public string? Container { get; set; }
public string? SpecID { get; set; }
public string? Analyte { get; set; }
public string? Result { get; set; }
public string? ResUnits { get; set; }
public string? CollectDT { get; set; }
public string? ResultDT { get; set; }
public string? AnalPreSteps { get; set; }
public string? PatDiag { get; set; }
public string? PatDOB { get; set; }
public string? PSex { get; set; }
public string? PRace { get; set; }
}
}
public class ServiceConfig
{
public bool UseExternalDb { get; set; }
public string? ConnectionString { get; set; }
public string? SqlitePath { get; set; }
public int DbPollInterval { get; set; }
public bool ListenHl7 { get; set; }
public int Hl7TcpPort { get; set; }
public string? LisId { get; set; }
public string? Address { get; set; }
public string? Phone { get; set; }
}
}