feature: FHIR R4 Inbound Facade
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
public class ExternalResourceIdentifier
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public ExternalResourceType ResourceType { get; set; }
|
||||
public Guid InternalId { get; set; }
|
||||
public string System { get; set; } = null!;
|
||||
public string Value { get; set; } = null!;
|
||||
public DateTimeOffset CreatedAt { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
public enum ExternalResourceType
|
||||
{
|
||||
Patient,
|
||||
Encounter
|
||||
}
|
||||
|
||||
public static class ExternalResourceTypeExtensions
|
||||
{
|
||||
public static string ToDbString(this ExternalResourceType t) => t switch
|
||||
{
|
||||
ExternalResourceType.Patient => "PATIENT",
|
||||
ExternalResourceType.Encounter => "ENCOUNTER",
|
||||
_ => throw new ArgumentOutOfRangeException(nameof(t))
|
||||
};
|
||||
|
||||
public static ExternalResourceType FromDbString(string v) => v switch
|
||||
{
|
||||
"PATIENT" => ExternalResourceType.Patient,
|
||||
"ENCOUNTER" => ExternalResourceType.Encounter,
|
||||
_ => throw new ArgumentOutOfRangeException(nameof(v), $"Unknown external resource type: '{v}'")
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user