/
ExtractionRequestMessage.cs
54 lines (48 loc) · 1.99 KB
/
ExtractionRequestMessage.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
using Newtonsoft.Json;
using System.Collections.Generic;
namespace Smi.Common.Messages.Extraction
{
/// <summary>
/// Describes a request to extract all images identified by a DicomTag e.g. SeriesInstanceUID with the specified project specific patient identifiers (PatientID)
/// </summary>
public class ExtractionRequestMessage : ExtractMessage
{
/// <summary>
/// Contains the name of the identifier you want to extract based on (this should be a DicomTag e.g. 'SeriesInstanceUID')
/// </summary>
[JsonProperty(Required = Required.Always)]
public string KeyTag { get; set; } = null!;
/// <summary>
/// Optional list of modalities to extract when <see cref="KeyTag"/> could include multiple modalities
/// (e.g. extracting based on patient or study (study can include e.g. CT + SR).
/// </summary>
[JsonProperty(Required = Required.AllowNull)]
public string? Modalities { get; set; }
/// <summary>
/// The unique set of identifiers of Type <see cref="KeyTag"/> which should be extracted
/// </summary>
[JsonProperty(Required = Required.Always)]
public List<string> ExtractionIdentifiers { get; set; } = null!;
[JsonConstructor]
public ExtractionRequestMessage()
{
ExtractionIdentifiers = new List<string>();
}
/// <summary>
/// (Shallow) copy constructor
/// </summary>
/// <param name="other"></param>
public ExtractionRequestMessage(ExtractionRequestMessage other)
: base(other)
{
KeyTag = other.KeyTag;
Modalities = other.Modalities;
ExtractionIdentifiers = other.ExtractionIdentifiers;
}
public override string ToString()
=> base.ToString() + ", " +
$"KeyTag={KeyTag}, " +
$"Modality={Modalities ?? "Unspecified"}, " +
$"nIdentifiers={ExtractionIdentifiers.Count}";
}
}