-
Notifications
You must be signed in to change notification settings - Fork 345
/
Copy pathOperationOutcome.cs
733 lines (670 loc) · 28.9 KB
/
OperationOutcome.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
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
// <auto-generated/>
// Contents of: hl7.fhir.r5.expansions#5.0.0, hl7.fhir.r5.core#5.0.0
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using Hl7.Fhir.Introspection;
using Hl7.Fhir.Serialization;
using Hl7.Fhir.Specification;
using Hl7.Fhir.Utility;
using Hl7.Fhir.Validation;
using SystemPrimitive = Hl7.Fhir.ElementModel.Types;
/*
Copyright (c) 2011+, HL7, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of HL7 nor the names of its contributors may be used to
endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
namespace Hl7.Fhir.Model
{
/// <summary>
/// Information about the success/failure of an action
/// </summary>
/// <remarks>
/// A collection of error, warning, or information messages that result from a system action.
/// Can result from the failure of a REST call or be part of the response message returned from a request message.
/// </remarks>
[Serializable]
[DataContract]
[FhirType("OperationOutcome","http://hl7.org/fhir/StructureDefinition/OperationOutcome", IsResource=true)]
public partial class OperationOutcome : Hl7.Fhir.Model.DomainResource
{
/// <summary>
/// FHIR Type Name
/// </summary>
public override string TypeName { get { return "OperationOutcome"; } }
/// <summary>
/// How the issue affects the success of the action.
/// (url: http://hl7.org/fhir/ValueSet/issue-severity)
/// (system: http://hl7.org/fhir/issue-severity)
/// </summary>
[FhirEnumeration("IssueSeverity", "http://hl7.org/fhir/ValueSet/issue-severity", "http://hl7.org/fhir/issue-severity")]
public enum IssueSeverity
{
/// <summary>
/// The issue caused the action to fail and no further checking could be performed.
/// (system: http://hl7.org/fhir/issue-severity)
/// </summary>
[EnumLiteral("fatal"), Description("Fatal")]
Fatal,
/// <summary>
/// The issue is sufficiently important to cause the action to fail.
/// (system: http://hl7.org/fhir/issue-severity)
/// </summary>
[EnumLiteral("error"), Description("Error")]
Error,
/// <summary>
/// The issue is not important enough to cause the action to fail but may cause it to be performed suboptimally or in a way that is not as desired.
/// (system: http://hl7.org/fhir/issue-severity)
/// </summary>
[EnumLiteral("warning"), Description("Warning")]
Warning,
/// <summary>
/// The issue has no relation to the degree of success of the action.
/// (system: http://hl7.org/fhir/issue-severity)
/// </summary>
[EnumLiteral("information"), Description("Information")]
Information,
/// <summary>
/// The operation completed successfully.
/// (system: http://hl7.org/fhir/issue-severity)
/// </summary>
[EnumLiteral("success"), Description("Operation Successful")]
Success,
}
/// <summary>
/// A code that describes the type of issue.
/// (url: http://hl7.org/fhir/ValueSet/issue-type)
/// (system: http://hl7.org/fhir/issue-type)
/// </summary>
[FhirEnumeration("IssueType", "http://hl7.org/fhir/ValueSet/issue-type", "http://hl7.org/fhir/issue-type")]
public enum IssueType
{
/// <summary>
/// Content invalid against the specification or a profile.
/// (system: http://hl7.org/fhir/issue-type)
/// </summary>
[EnumLiteral("invalid"), Description("Invalid Content")]
Invalid,
/// <summary>
/// A structural issue in the content such as wrong namespace, unable to parse the content completely, invalid syntax, etc.
/// (system: http://hl7.org/fhir/issue-type)
/// </summary>
[EnumLiteral("structure"), Description("Structural Issue")]
Structure,
/// <summary>
/// A required element is missing.
/// (system: http://hl7.org/fhir/issue-type)
/// </summary>
[EnumLiteral("required"), Description("Required element missing")]
Required,
/// <summary>
/// An element or header value is invalid.
/// (system: http://hl7.org/fhir/issue-type)
/// </summary>
[EnumLiteral("value"), Description("Element value invalid")]
Value,
/// <summary>
/// A content validation rule failed - e.g. a schematron rule.
/// (system: http://hl7.org/fhir/issue-type)
/// </summary>
[EnumLiteral("invariant"), Description("Validation rule failed")]
Invariant,
/// <summary>
/// An authentication/authorization/permissions issue of some kind.
/// (system: http://hl7.org/fhir/issue-type)
/// </summary>
[EnumLiteral("security"), Description("Security Problem")]
Security,
/// <summary>
/// The client needs to initiate an authentication process.
/// (system: http://hl7.org/fhir/issue-type)
/// </summary>
[EnumLiteral("login"), Description("Login Required")]
Login,
/// <summary>
/// The user or system was not able to be authenticated (either there is no process, or the proferred token is unacceptable).
/// (system: http://hl7.org/fhir/issue-type)
/// </summary>
[EnumLiteral("unknown"), Description("Unknown User")]
Unknown,
/// <summary>
/// User session expired; a login may be required.
/// (system: http://hl7.org/fhir/issue-type)
/// </summary>
[EnumLiteral("expired"), Description("Session Expired")]
Expired,
/// <summary>
/// The user does not have the rights to perform this action.
/// (system: http://hl7.org/fhir/issue-type)
/// </summary>
[EnumLiteral("forbidden"), Description("Forbidden")]
Forbidden,
/// <summary>
/// Some information was not or might not have been returned due to business rules, consent or privacy rules, or access permission constraints. This information may be accessible through alternate processes.
/// (system: http://hl7.org/fhir/issue-type)
/// </summary>
[EnumLiteral("suppressed"), Description("Information Suppressed")]
Suppressed,
/// <summary>
/// Processing issues. These are expected to be final e.g. there is no point resubmitting the same content unchanged.
/// (system: http://hl7.org/fhir/issue-type)
/// </summary>
[EnumLiteral("processing"), Description("Processing Failure")]
Processing,
/// <summary>
/// The interaction, operation, resource or profile is not supported.
/// (system: http://hl7.org/fhir/issue-type)
/// </summary>
[EnumLiteral("not-supported"), Description("Content not supported")]
NotSupported,
/// <summary>
/// An attempt was made to create a duplicate record.
/// (system: http://hl7.org/fhir/issue-type)
/// </summary>
[EnumLiteral("duplicate"), Description("Duplicate")]
Duplicate,
/// <summary>
/// Multiple matching records were found when the operation required only one match.
/// (system: http://hl7.org/fhir/issue-type)
/// </summary>
[EnumLiteral("multiple-matches"), Description("Multiple Matches")]
MultipleMatches,
/// <summary>
/// The reference provided was not found. In a pure RESTful environment, this would be an HTTP 404 error, but this code may be used where the content is not found further into the application architecture.
/// (system: http://hl7.org/fhir/issue-type)
/// </summary>
[EnumLiteral("not-found"), Description("Not Found")]
NotFound,
/// <summary>
/// The reference pointed to content (usually a resource) that has been deleted.
/// (system: http://hl7.org/fhir/issue-type)
/// </summary>
[EnumLiteral("deleted"), Description("Deleted")]
Deleted,
/// <summary>
/// Provided content is too long (typically, this is a denial of service protection type of error).
/// (system: http://hl7.org/fhir/issue-type)
/// </summary>
[EnumLiteral("too-long"), Description("Content Too Long")]
TooLong,
/// <summary>
/// The code or system could not be understood, or it was not valid in the context of a particular ValueSet.code.
/// (system: http://hl7.org/fhir/issue-type)
/// </summary>
[EnumLiteral("code-invalid"), Description("Invalid Code")]
CodeInvalid,
/// <summary>
/// An extension was found that was not acceptable, could not be resolved, or a modifierExtension was not recognized.
/// (system: http://hl7.org/fhir/issue-type)
/// </summary>
[EnumLiteral("extension"), Description("Unacceptable Extension")]
Extension,
/// <summary>
/// The operation was stopped to protect server resources; e.g. a request for a value set expansion on all of SNOMED CT.
/// (system: http://hl7.org/fhir/issue-type)
/// </summary>
[EnumLiteral("too-costly"), Description("Operation Too Costly")]
TooCostly,
/// <summary>
/// The content/operation failed to pass some business rule and so could not proceed.
/// (system: http://hl7.org/fhir/issue-type)
/// </summary>
[EnumLiteral("business-rule"), Description("Business Rule Violation")]
BusinessRule,
/// <summary>
/// Content could not be accepted because of an edit conflict (i.e. version aware updates). (In a pure RESTful environment, this would be an HTTP 409 error, but this code may be used where the conflict is discovered further into the application architecture.).
/// (system: http://hl7.org/fhir/issue-type)
/// </summary>
[EnumLiteral("conflict"), Description("Edit Version Conflict")]
Conflict,
/// <summary>
/// Some search filters might not have applied on all results. Data may have been included that does not meet all of the filters listed in the `self` `Bundle.link`.
/// (system: http://hl7.org/fhir/issue-type)
/// </summary>
[EnumLiteral("limited-filter"), Description("Limited Filter Application")]
LimitedFilter,
/// <summary>
/// Transient processing issues. The system receiving the message may be able to resubmit the same content once an underlying issue is resolved.
/// (system: http://hl7.org/fhir/issue-type)
/// </summary>
[EnumLiteral("transient"), Description("Transient Issue")]
Transient,
/// <summary>
/// A resource/record locking failure (usually in an underlying database).
/// (system: http://hl7.org/fhir/issue-type)
/// </summary>
[EnumLiteral("lock-error"), Description("Lock Error")]
LockError,
/// <summary>
/// The persistent store is unavailable; e.g. the database is down for maintenance or similar action, and the interaction or operation cannot be processed.
/// (system: http://hl7.org/fhir/issue-type)
/// </summary>
[EnumLiteral("no-store"), Description("No Store Available")]
NoStore,
/// <summary>
/// An unexpected internal error has occurred.
/// (system: http://hl7.org/fhir/issue-type)
/// </summary>
[EnumLiteral("exception"), Description("Exception")]
Exception,
/// <summary>
/// An internal timeout has occurred.
/// (system: http://hl7.org/fhir/issue-type)
/// </summary>
[EnumLiteral("timeout"), Description("Timeout")]
Timeout,
/// <summary>
/// Not all data sources typically accessed could be reached or responded in time, so the returned information might not be complete (applies to search interactions and some operations).
/// (system: http://hl7.org/fhir/issue-type)
/// </summary>
[EnumLiteral("incomplete"), Description("Incomplete Results")]
Incomplete,
/// <summary>
/// The system is not prepared to handle this request due to load management.
/// (system: http://hl7.org/fhir/issue-type)
/// </summary>
[EnumLiteral("throttled"), Description("Throttled")]
Throttled,
/// <summary>
/// A message unrelated to the processing success of the completed operation (examples of the latter include things like reminders of password expiry, system maintenance times, etc.).
/// (system: http://hl7.org/fhir/issue-type)
/// </summary>
[EnumLiteral("informational"), Description("Informational Note")]
Informational,
/// <summary>
/// The operation completed successfully.
/// (system: http://hl7.org/fhir/issue-type)
/// </summary>
[EnumLiteral("success"), Description("Operation Successful")]
Success,
}
/// <summary>
/// A single issue associated with the action
/// </summary>
/// <remarks>
/// An error, warning, or information message that results from a system action.
/// </remarks>
[Serializable]
[DataContract]
[FhirType("OperationOutcome#Issue", IsNestedType=true)]
[BackboneType("OperationOutcome.issue")]
public partial class IssueComponent : Hl7.Fhir.Model.BackboneElement
{
/// <summary>
/// FHIR Type Name
/// </summary>
public override string TypeName { get { return "OperationOutcome#Issue"; } }
/// <summary>
/// fatal | error | warning | information | success
/// </summary>
[FhirElement("severity", InSummary=true, IsModifier=true, Order=40)]
[FhirElement("severity", InSummary=true, Order=40, Since=FhirRelease.R4)]
[DeclaredType(Type = typeof(Code))]
[Binding("IssueSeverity")]
[Cardinality(Min=1,Max=1)]
[DataMember]
public Code<Hl7.Fhir.Model.OperationOutcome.IssueSeverity> SeverityElement
{
get { return _SeverityElement; }
set { _SeverityElement = value; OnPropertyChanged("SeverityElement"); }
}
private Code<Hl7.Fhir.Model.OperationOutcome.IssueSeverity> _SeverityElement;
/// <summary>
/// fatal | error | warning | information | success
/// </summary>
/// <remarks>This uses the native .NET datatype, rather than the FHIR equivalent</remarks>
[IgnoreDataMember]
public Hl7.Fhir.Model.OperationOutcome.IssueSeverity? Severity
{
get { return SeverityElement != null ? SeverityElement.Value : null; }
set
{
if (value == null)
SeverityElement = null;
else
SeverityElement = new Code<Hl7.Fhir.Model.OperationOutcome.IssueSeverity>(value);
OnPropertyChanged("Severity");
}
}
/// <summary>
/// Error or warning code
/// </summary>
[FhirElement("code", InSummary=true, Order=50)]
[DeclaredType(Type = typeof(Code))]
[Binding("IssueType")]
[Cardinality(Min=1,Max=1)]
[DataMember]
public Code<Hl7.Fhir.Model.OperationOutcome.IssueType> CodeElement
{
get { return _CodeElement; }
set { _CodeElement = value; OnPropertyChanged("CodeElement"); }
}
private Code<Hl7.Fhir.Model.OperationOutcome.IssueType> _CodeElement;
/// <summary>
/// Error or warning code
/// </summary>
/// <remarks>This uses the native .NET datatype, rather than the FHIR equivalent</remarks>
[IgnoreDataMember]
public Hl7.Fhir.Model.OperationOutcome.IssueType? Code
{
get { return CodeElement != null ? CodeElement.Value : null; }
set
{
if (value == null)
CodeElement = null;
else
CodeElement = new Code<Hl7.Fhir.Model.OperationOutcome.IssueType>(value);
OnPropertyChanged("Code");
}
}
/// <summary>
/// Additional details about the error
/// </summary>
[FhirElement("details", InSummary=true, Order=60)]
[Binding("IssueDetails")]
[DataMember]
public Hl7.Fhir.Model.CodeableConcept Details
{
get { return _Details; }
set { _Details = value; OnPropertyChanged("Details"); }
}
private Hl7.Fhir.Model.CodeableConcept _Details;
/// <summary>
/// Additional diagnostic information about the issue
/// </summary>
[FhirElement("diagnostics", InSummary=true, Order=70)]
[DataMember]
public Hl7.Fhir.Model.FhirString DiagnosticsElement
{
get { return _DiagnosticsElement; }
set { _DiagnosticsElement = value; OnPropertyChanged("DiagnosticsElement"); }
}
private Hl7.Fhir.Model.FhirString _DiagnosticsElement;
/// <summary>
/// Additional diagnostic information about the issue
/// </summary>
/// <remarks>This uses the native .NET datatype, rather than the FHIR equivalent</remarks>
[IgnoreDataMember]
public string Diagnostics
{
get { return DiagnosticsElement != null ? DiagnosticsElement.Value : null; }
set
{
if (value == null)
DiagnosticsElement = null;
else
DiagnosticsElement = new Hl7.Fhir.Model.FhirString(value);
OnPropertyChanged("Diagnostics");
}
}
/// <summary>
/// Deprecated: Path of element(s) related to issue
/// </summary>
[FhirElement("location", InSummary=true, Order=80)]
[Cardinality(Min=0,Max=-1)]
[DataMember]
public List<Hl7.Fhir.Model.FhirString> LocationElement
{
get { if(_LocationElement==null) _LocationElement = new List<Hl7.Fhir.Model.FhirString>(); return _LocationElement; }
set { _LocationElement = value; OnPropertyChanged("LocationElement"); }
}
private List<Hl7.Fhir.Model.FhirString> _LocationElement;
/// <summary>
/// Deprecated: Path of element(s) related to issue
/// </summary>
/// <remarks>This uses the native .NET datatype, rather than the FHIR equivalent</remarks>
[IgnoreDataMember]
public IEnumerable<string> Location
{
get { return LocationElement != null ? LocationElement.Select(elem => elem.Value) : null; }
set
{
if (value == null)
LocationElement = null;
else
LocationElement = new List<Hl7.Fhir.Model.FhirString>(value.Select(elem=>new Hl7.Fhir.Model.FhirString(elem)));
OnPropertyChanged("Location");
}
}
/// <summary>
/// FHIRPath of element(s) related to issue
/// </summary>
[FhirElement("expression", InSummary=true, Order=90)]
[Cardinality(Min=0,Max=-1)]
[DataMember]
public List<Hl7.Fhir.Model.FhirString> ExpressionElement
{
get { if(_ExpressionElement==null) _ExpressionElement = new List<Hl7.Fhir.Model.FhirString>(); return _ExpressionElement; }
set { _ExpressionElement = value; OnPropertyChanged("ExpressionElement"); }
}
private List<Hl7.Fhir.Model.FhirString> _ExpressionElement;
/// <summary>
/// FHIRPath of element(s) related to issue
/// </summary>
/// <remarks>This uses the native .NET datatype, rather than the FHIR equivalent</remarks>
[IgnoreDataMember]
public IEnumerable<string> Expression
{
get { return ExpressionElement != null ? ExpressionElement.Select(elem => elem.Value) : null; }
set
{
if (value == null)
ExpressionElement = null;
else
ExpressionElement = new List<Hl7.Fhir.Model.FhirString>(value.Select(elem=>new Hl7.Fhir.Model.FhirString(elem)));
OnPropertyChanged("Expression");
}
}
public override IDeepCopyable CopyTo(IDeepCopyable other)
{
var dest = other as IssueComponent;
if (dest == null)
{
throw new ArgumentException("Can only copy to an object of the same type", "other");
}
base.CopyTo(dest);
if(SeverityElement != null) dest.SeverityElement = (Code<Hl7.Fhir.Model.OperationOutcome.IssueSeverity>)SeverityElement.DeepCopy();
if(CodeElement != null) dest.CodeElement = (Code<Hl7.Fhir.Model.OperationOutcome.IssueType>)CodeElement.DeepCopy();
if(Details != null) dest.Details = (Hl7.Fhir.Model.CodeableConcept)Details.DeepCopy();
if(DiagnosticsElement != null) dest.DiagnosticsElement = (Hl7.Fhir.Model.FhirString)DiagnosticsElement.DeepCopy();
if(LocationElement.Any()) dest.LocationElement = new List<Hl7.Fhir.Model.FhirString>(LocationElement.DeepCopy());
if(ExpressionElement.Any()) dest.ExpressionElement = new List<Hl7.Fhir.Model.FhirString>(ExpressionElement.DeepCopy());
return dest;
}
public override IDeepCopyable DeepCopy()
{
return CopyTo(new IssueComponent());
}
///<inheritdoc />
public override bool Matches(IDeepComparable other)
{
var otherT = other as IssueComponent;
if(otherT == null) return false;
if(!base.Matches(otherT)) return false;
if( !DeepComparable.Matches(SeverityElement, otherT.SeverityElement)) return false;
if( !DeepComparable.Matches(CodeElement, otherT.CodeElement)) return false;
if( !DeepComparable.Matches(Details, otherT.Details)) return false;
if( !DeepComparable.Matches(DiagnosticsElement, otherT.DiagnosticsElement)) return false;
if( !DeepComparable.Matches(LocationElement, otherT.LocationElement)) return false;
if( !DeepComparable.Matches(ExpressionElement, otherT.ExpressionElement)) return false;
return true;
}
public override bool IsExactly(IDeepComparable other)
{
var otherT = other as IssueComponent;
if(otherT == null) return false;
if(!base.IsExactly(otherT)) return false;
if( !DeepComparable.IsExactly(SeverityElement, otherT.SeverityElement)) return false;
if( !DeepComparable.IsExactly(CodeElement, otherT.CodeElement)) return false;
if( !DeepComparable.IsExactly(Details, otherT.Details)) return false;
if( !DeepComparable.IsExactly(DiagnosticsElement, otherT.DiagnosticsElement)) return false;
if( !DeepComparable.IsExactly(LocationElement, otherT.LocationElement)) return false;
if( !DeepComparable.IsExactly(ExpressionElement, otherT.ExpressionElement)) return false;
return true;
}
[IgnoreDataMember]
public override IEnumerable<Base> Children
{
get
{
foreach (var item in base.Children) yield return item;
if (SeverityElement != null) yield return SeverityElement;
if (CodeElement != null) yield return CodeElement;
if (Details != null) yield return Details;
if (DiagnosticsElement != null) yield return DiagnosticsElement;
foreach (var elem in LocationElement) { if (elem != null) yield return elem; }
foreach (var elem in ExpressionElement) { if (elem != null) yield return elem; }
}
}
[IgnoreDataMember]
public override IEnumerable<ElementValue> NamedChildren
{
get
{
foreach (var item in base.NamedChildren) yield return item;
if (SeverityElement != null) yield return new ElementValue("severity", SeverityElement);
if (CodeElement != null) yield return new ElementValue("code", CodeElement);
if (Details != null) yield return new ElementValue("details", Details);
if (DiagnosticsElement != null) yield return new ElementValue("diagnostics", DiagnosticsElement);
foreach (var elem in LocationElement) { if (elem != null) yield return new ElementValue("location", elem); }
foreach (var elem in ExpressionElement) { if (elem != null) yield return new ElementValue("expression", elem); }
}
}
protected override bool TryGetValue(string key, out object value)
{
switch (key)
{
case "severity":
value = SeverityElement;
return SeverityElement is not null;
case "code":
value = CodeElement;
return CodeElement is not null;
case "details":
value = Details;
return Details is not null;
case "diagnostics":
value = DiagnosticsElement;
return DiagnosticsElement is not null;
case "location":
value = LocationElement;
return LocationElement?.Any() == true;
case "expression":
value = ExpressionElement;
return ExpressionElement?.Any() == true;
default:
return base.TryGetValue(key, out value);
}
}
protected override IEnumerable<KeyValuePair<string, object>> GetElementPairs()
{
foreach (var kvp in base.GetElementPairs()) yield return kvp;
if (SeverityElement is not null) yield return new KeyValuePair<string,object>("severity",SeverityElement);
if (CodeElement is not null) yield return new KeyValuePair<string,object>("code",CodeElement);
if (Details is not null) yield return new KeyValuePair<string,object>("details",Details);
if (DiagnosticsElement is not null) yield return new KeyValuePair<string,object>("diagnostics",DiagnosticsElement);
if (LocationElement?.Any() == true) yield return new KeyValuePair<string,object>("location",LocationElement);
if (ExpressionElement?.Any() == true) yield return new KeyValuePair<string,object>("expression",ExpressionElement);
}
}
/// <summary>
/// A single issue associated with the action
/// </summary>
[FhirElement("issue", InSummary=true, Order=90)]
[Cardinality(Min=1,Max=-1)]
[DataMember]
public List<Hl7.Fhir.Model.OperationOutcome.IssueComponent> Issue
{
get { if(_Issue==null) _Issue = new List<Hl7.Fhir.Model.OperationOutcome.IssueComponent>(); return _Issue; }
set { _Issue = value; OnPropertyChanged("Issue"); }
}
private List<Hl7.Fhir.Model.OperationOutcome.IssueComponent> _Issue;
public override IDeepCopyable CopyTo(IDeepCopyable other)
{
var dest = other as OperationOutcome;
if (dest == null)
{
throw new ArgumentException("Can only copy to an object of the same type", "other");
}
base.CopyTo(dest);
if(Issue.Any()) dest.Issue = new List<Hl7.Fhir.Model.OperationOutcome.IssueComponent>(Issue.DeepCopy());
return dest;
}
public override IDeepCopyable DeepCopy()
{
return CopyTo(new OperationOutcome());
}
///<inheritdoc />
public override bool Matches(IDeepComparable other)
{
var otherT = other as OperationOutcome;
if(otherT == null) return false;
if(!base.Matches(otherT)) return false;
if( !DeepComparable.Matches(Issue, otherT.Issue)) return false;
return true;
}
public override bool IsExactly(IDeepComparable other)
{
var otherT = other as OperationOutcome;
if(otherT == null) return false;
if(!base.IsExactly(otherT)) return false;
if( !DeepComparable.IsExactly(Issue, otherT.Issue)) return false;
return true;
}
[IgnoreDataMember]
public override IEnumerable<Base> Children
{
get
{
foreach (var item in base.Children) yield return item;
foreach (var elem in Issue) { if (elem != null) yield return elem; }
}
}
[IgnoreDataMember]
public override IEnumerable<ElementValue> NamedChildren
{
get
{
foreach (var item in base.NamedChildren) yield return item;
foreach (var elem in Issue) { if (elem != null) yield return new ElementValue("issue", elem); }
}
}
protected override bool TryGetValue(string key, out object value)
{
switch (key)
{
case "issue":
value = Issue;
return Issue?.Any() == true;
default:
return base.TryGetValue(key, out value);
}
}
protected override IEnumerable<KeyValuePair<string, object>> GetElementPairs()
{
foreach (var kvp in base.GetElementPairs()) yield return kvp;
if (Issue?.Any() == true) yield return new KeyValuePair<string,object>("issue",Issue);
}
}
}
// end of file