EpicSerializer 1.0.1
dotnet add package EpicSerializer --version 1.0.1
NuGet\Install-Package EpicSerializer -Version 1.0.1
<PackageReference Include="EpicSerializer" Version="1.0.1" />
paket add EpicSerializer --version 1.0.1
#r "nuget: EpicSerializer, 1.0.1"
// 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 | Versions |
---|---|
.NET | net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows net7.0 net7.0-android net7.0-ios net7.0-maccatalyst net7.0-macos net7.0-tvos net7.0-windows |
.NET Core | netcoreapp2.0 netcoreapp2.1 netcoreapp2.2 netcoreapp3.0 netcoreapp3.1 |
.NET Standard | netstandard2.0 netstandard2.1 |
.NET Framework | net461 net462 net463 net47 net471 net472 net48 net481 |
MonoAndroid | monoandroid |
MonoMac | monomac |
MonoTouch | monotouch |
Tizen | tizen40 tizen60 |
Xamarin.iOS | xamarinios |
Xamarin.Mac | xamarinmac |
Xamarin.TVOS | xamarintvos |
Xamarin.WatchOS | xamarinwatchos |
-
.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.
Optimized inner convert loop.