feature: FHIR R4 Inbound Facade

This commit is contained in:
voltsrage
2026-06-21 13:53:38 +08:00
parent 9f96f54007
commit a43db52813
42 changed files with 2873 additions and 3 deletions
@@ -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}'")
};
}