chore: deploy initial code base
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
using Strata.RxNorm.Biz.RxNorm;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
|
||||
namespace Strata.RxNorm.Biz.Test.Unit.Extensions
|
||||
{
|
||||
[ExcludeFromCodeCoverage]
|
||||
public static class RxnAttributeExtension
|
||||
{
|
||||
|
||||
public static IEnumerable<RxnAttribute> LoadRxnAttributes(this string fileName)
|
||||
{
|
||||
var assembly = Assembly.GetExecutingAssembly();
|
||||
var lines = assembly.LoadRxnNorm(fileName);
|
||||
return lines.Select(l => l.AttributeCtor()).ToList();
|
||||
}
|
||||
|
||||
public static RxnAttribute AttributeCtor(this string line, string separator = "|")
|
||||
{
|
||||
var data = line.Split(separator).ToArray();
|
||||
var r = new RxnAttribute();
|
||||
r.Rxcui = data[0];
|
||||
r.Lui = data[1];
|
||||
r.Sui = data[2];
|
||||
r.Rxaui = data[3];
|
||||
r.Stype = data[4];
|
||||
r.Code = data[5];
|
||||
r.Atui = data[6];
|
||||
r.Satui = data[7];
|
||||
r.Atn = data[8];
|
||||
r.Sab = data[9];
|
||||
r.Atv = data[10];
|
||||
r.Suppress = data[11];
|
||||
r.Cvf = data[12];
|
||||
return r;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user