EpicSerializer 1.0.1

dotnet add package EpicSerializer --version 1.0.1
NuGet\Install-Package EpicSerializer -Version 1.0.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="EpicSerializer" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add EpicSerializer --version 1.0.1
#r "nuget: EpicSerializer, 1.0.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install EpicSerializer as a Cake Addin
#addin nuget:?package=EpicSerializer&version=1.0.1

// Install EpicSerializer as a Cake Tool
#tool nuget:?package=EpicSerializer&version=1.0.1

EpicSerializer

Epic Chronicles Format Serializer

Epic is a very popular Electronic Medical Record system, with a proprietary format for bulk importing data through their Chronicles tool. This library makes it easy to serialize arbitrary types into the Chronicles format, which resembles an OrderedMap<int, string>. Since Epic configurations can vary so widely among different installations, this library doesn't make any assumptions about how any particular instance is configured.

The library is designed to be scalable, it only performs introspection on your serializable types once, on it's first encounter with that type. During this encounter it creates an access plan that describes how to pull data out of the objects of this type. These plans are stored in a static thread-safe container, so all instances of the Serializer benefit.

Chronicles Format Example: 1,12345 2,Biff Jutsu 45,biffj 50,1 2301,ARNP 2302,WA 2303,ABC123456 2301,RN 2302,WA 2303,DEF789012 1,67890 2,Some Other Person 45,otherp 50,1 ...

Code

Simple single object example.

[EpicSerializable(MasterFile.EMP)]
class EpicUser
{
    [EpicRecord(Field: 1)]
    public int EpicID { get; set; }

    [EpicRecord(Field: 2)]
    public string Name { get; set; }

    [EpicRecord(Field: 45)]
    public string Username { get; set; }

    [EpicRecord(Field: 50)]
    public bool Active { get; set; }
}

var user = new EpicUser
{
    EpicID = 12345,
    Name = "Biff Jutsu",
    Username = "biffj",
    Active = true
};

var serial = new EpicSerializer<EpicUser>();
string serializedResult = serial.Serialize(user);
Console.WriteLine(serializedResult);

// Console Output
1,12345
2,Biff Jutsu
45,biffj
50,1

Single object with simple repeated section.

[EpicSerializable(MasterFile.EMP)]
class EpicUser
{
    [EpicRecord(Field: 1)]
    public int EpicID { get; set; }

    [EpicRecord(Field: 2)]
    public string Name { get; set; }

    [EpicRecord(Field: 45)]
    public string Username { get; set; }

    [EpicRecord(Field: 50)]
    public bool Active { get; set; }

    [EpicRepeat(Field: 100)]
    public List<string> Locations { get; set; }
}

var user = new EpicUser
{
    EpicID = 12345,
    Name = "Biff Jutsu",
    Username = "biffj",
    Active = true,
    Locations = new List<string>
    {
        "Hospital",
        "Burn Ward"
    }
};

var serial = new EpicSerializer<EpicUser>();
string serializedResult = serial.Serialize(user);
Console.WriteLine(serializedResult);

// Console Output
1,12345
2,Biff Jutsu
45,biffj
50,1
100,Hospital
100,Burn Ward

Single object with complex repeated section.

[EpicSerializable(MasterFile.EMP)]
class EpicUser
{
    [EpicRecord(Field: 1)]
    public int EpicID { get; set; }

    [EpicRecord(Field: 2)]
    public string Name { get; set; }

    [EpicRecord(Field: 45)]
    public string Username { get; set; }

    [EpicRecord(Field: 50)]
    public bool Active { get; set; }

    [EpicRepeat(Field: 100)]
    public List<string> Locations { get; set; }

    [EpicRepeat(Field: 2301)]
    public List<License> Licenses { get; set; }
}

[EpicSerializable(MasterFile.EMP)]
class Alias
{
    [EpicRecord(Field: 2301)]
    public string Type { get; set; }

    [EpicRecord(Field: 2302)]
    public string State { get; set; }

    [EpicRecord(Field: 2303)]
    public string Value { get; set; }
}

var user = new EpicUser
{
    EpicID = 12345,
    Name = "Biff Jutsu",
    Username = "biffj",
    Active = true,
    Locations = new List<string>
    {
        "Hospital",
        "Burn Ward"
    },
    Licenses = new List<License>
    {
        new License
        {
            Type = "ARNP",
            State = "WA",
            Value = "ABC123456"
        },
        new License
        {
            Type = "RN",
            State = "WA",
            Value = "DEF789012"
        }
    }
};

var serial = new EpicSerializer<EpicUser>();
string serializedResult = serial.Serialize(user);
Console.WriteLine(serializedResult);

// Console Output
1,12345
2,Biff Jutsu
45,biffj
50,1
100,Hospital
100,Burn Ward
2301,ARNP
2302,WA
2303,ABC123456
2301,RN
2302,WA
2303,DEF789012

See tests for more detailed examples.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.1 1,288 11/17/2017
1.0.0 1,390 11/14/2017

Optimized inner convert loop.