Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(bfdr): fix birth specific properties #209

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions projects/BFDR.CLI/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ static int Main(string[] args)
birthRecord.AttendantTitleHelper = "76231001";


birthRecord.BirthLocationJurisdiction = "MA";
birthRecord.EventLocationJurisdiction = "MA";
Dictionary<string, string> birthAddress = new Dictionary<string, string>();
birthAddress.Add("addressLine1", "123 Fake Street");
birthAddress.Add("addressCity", "Springfield");
Expand Down Expand Up @@ -166,11 +166,11 @@ static int Main(string[] args)
fetaldeathRecord.FetalDeathSex = "M";

string[] childNames = { "Alexander", "Arlo" };
fetaldeathRecord.ChildGivenNames = childNames;
fetaldeathRecord.FetusGivenNames = childNames;
string[] motherName = { "Xenia" };
fetaldeathRecord.MotherGivenNames = motherName;
string lastName = "Adkins";
fetaldeathRecord.ChildFamilyName = lastName;
fetaldeathRecord.FetusFamilyName = lastName;
fetaldeathRecord.MotherFamilyName = lastName;

fetaldeathRecord.CertifierName = "Janet Seito";
Expand All @@ -181,7 +181,7 @@ static int Main(string[] args)
fetaldeathRecord.AttendantTitleHelper = "76231001";


fetaldeathRecord.BirthLocationJurisdiction = "MA";
fetaldeathRecord.EventLocationJurisdiction = "MA";
Dictionary<string, string> birthAddress = new Dictionary<string, string>();
birthAddress.Add("addressLine1", "123 Fake Street");
birthAddress.Add("addressCity", "Springfield");
Expand Down
2 changes: 1 addition & 1 deletion projects/BFDR.Messaging/BFDRBaseMessage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ protected void ExtractBusinessIdentifiers(NatalityRecord from)
{
this.SetYear((uint)from.GetYear());
}
this.JurisdictionId = from?.BirthLocationJurisdiction;
this.JurisdictionId = from?.EventLocationJurisdiction;
}

/////////////////////////////////////////////////////////////////////////////////
Expand Down
5 changes: 3 additions & 2 deletions projects/BFDR.Tests/BFDR.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<InvariantGlobalization>true</InvariantGlobalization>
<TargetFrameworks>netcoreapp6.0</TargetFrameworks>
<RootNamespace>BFDR.Tests</RootNamespace>
<IsPackable>false</IsPackable>
Expand All @@ -12,9 +13,9 @@
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.0" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit" Version="2.5.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.3" />
<PackageReference Include="ReportGenerator" Version="5.3.5" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2" />
<DotNetCliToolReference Include="dotnet-xunit" Version="2.3.1" />
</ItemGroup>
<ItemGroup>
Expand Down
26 changes: 13 additions & 13 deletions projects/BFDR.Tests/BirthRecord_Should.cs
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ public void TestPatientChildVitalRecordProperties()
// State of Birth
Assert.Equal("UT", firstRecord.PlaceOfBirth["addressState"]);
Assert.Equal(firstRecord.PlaceOfBirth["addressState"], secondRecord.PlaceOfBirth["addressState"]);
Assert.Equal("UT", firstRecord.BirthLocationJurisdiction); // TODO - Birth Location Jurisdiction still needs to be finalized.
Assert.Equal("UT", firstRecord.EventLocationJurisdiction); // TODO - Birth Location Jurisdiction still needs to be finalized.
// Time of Birth
Assert.Equal("13:00:00", firstRecord.BirthTime);
Assert.Equal(firstRecord.BirthTime, secondRecord.BirthTime);
Expand Down Expand Up @@ -736,7 +736,7 @@ public void TestBirthPlaceSetters()
IJEBirth ije = new(record);

Assert.Equal("UT", record.PlaceOfBirth["addressState"]);
Assert.Equal("UT", record.BirthLocationJurisdiction); // TODO - Birth Location Jurisdiction still needs to be finalized.
Assert.Equal("UT", record.EventLocationJurisdiction); // TODO - Birth Location Jurisdiction still needs to be finalized.
// County of Birth (Literal)
Assert.Equal("Salt Lake", record.PlaceOfBirth["addressCounty"]);
// City/town/place of birth (Literal)
Expand Down Expand Up @@ -976,7 +976,7 @@ public void TestChildIdentifierSetters()
record.BirthYear = 2020;
record.CertificateNumber = "767676";
Assert.Equal("2020XX767676", record.RecordIdentifier);
record.BirthLocationJurisdiction = "WY";
record.EventLocationJurisdiction = "WY";
record.CertificateNumber = "898989";
Assert.Equal("2020WY898989", record.RecordIdentifier);
// Infant Medical Record Number
Expand Down Expand Up @@ -1841,13 +1841,13 @@ public void MotherNamesPresent()
[Fact]
public void BirthLocationPresent()
{
Assert.Equal("MA", FakeBirthRecord.BirthLocationJurisdiction);
Assert.Equal("MA", FakeBirthRecord.EventLocationJurisdiction);
Assert.Equal("123 Fake Street", FakeBirthRecord.PlaceOfBirth["addressLine1"]);
Assert.Equal("MA", FakeBirthRecord.PlaceOfBirth["addressState"]);
Assert.Equal("01101", FakeBirthRecord.PlaceOfBirth["addressZip"]);
//set after parse
FakeBirthRecord.BirthLocationJurisdiction = "MN";
Assert.Equal("MN", FakeBirthRecord.BirthLocationJurisdiction);
FakeBirthRecord.EventLocationJurisdiction = "MN";
Assert.Equal("MN", FakeBirthRecord.EventLocationJurisdiction);
FakeBirthRecord.PlaceOfBirth = new Dictionary<string, string>
{
["addressState"] = "UT",
Expand Down Expand Up @@ -3357,7 +3357,7 @@ public void TestFullBirthRecordImport()
Assert.Null(birthRecord.MotherSuffix);
Assert.Null(birthRecord.FatherSuffix);
Assert.Null(birthRecord.MotherMaidenSuffix);
Assert.Equal("UT", birthRecord.BirthLocationJurisdiction);
Assert.Equal("UT", birthRecord.EventLocationJurisdiction);
tempDict = new();
tempDict.Add("addressLine1", "");
tempDict.Add("addressLine2", "");
Expand Down Expand Up @@ -3895,22 +3895,22 @@ public void TestConnectathonRecords() {
string zalbanaizIje = "2002TT0099990 1025M010101311568794535 1095199505150XXKU73000013AZUSY199506040YYX40NNNN NNNNNNNNNNNNNNY MIDDLE EASTERN ARABIAN 60NNNN NNNNNNNNNNNNNNY MIDDLE EASTERN ARABIAN 1N0604201812272018180503016501990N01000001201988888800000000220180418NNNNNN NN000NN NNNNNNNNNNNNNNYNNYYNN14NNNNNNN2277036009880202999999990NNNNNNNNNNNNNNNNNNNNYY 9999NXX 20190102 XYUGBNX XMX ZALBANAIZ MARICOPA MESA MOUNTAIN VISTA MEDICAL CENTER REEM NASSER ALHAMADI ALHAMADI 999 N COLLEGE AVE5656 85281 MARICOPA TEMPE ARIZONA UNITED STATES OMAR AHMED ALBANAI 8888888888888888882626 ZZKU KUWAIT KUWAIT 888 N PRIEST AVE9999 85429 GLENDALE ARIZONA UNITED STATES Y1 MANISHAAPUROHIT 1972721538 1201183921 1200527124 20190102 0XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ";

BirthRecord romeroRawBr = new IJEBirth(romeroIje).ToRecord();
romeroRawBr.BirthLocationJurisdiction = "AZ";
romeroRawBr.EventLocationJurisdiction = "AZ";
romeroRawBr.CertificateNumber = "8888";
BirthRecord zalbanaizRawBr = new IJEBirth(zalbanaizIje).ToRecord();
zalbanaizRawBr.BirthLocationJurisdiction = "AZ";
zalbanaizRawBr.EventLocationJurisdiction = "AZ";
zalbanaizRawBr.CertificateNumber = "8888";
BirthRecord romeroConnectathonBr = Connectathon.YytrfCardenasRomero();
romeroConnectathonBr.BirthLocationJurisdiction = "AZ";
romeroConnectathonBr.EventLocationJurisdiction = "AZ";
romeroConnectathonBr.CertificateNumber = "8888";
BirthRecord zalbanaizConnectathonBr = Connectathon.XyugbnxZalbanaiz();
zalbanaizConnectathonBr.BirthLocationJurisdiction = "AZ";
zalbanaizConnectathonBr.EventLocationJurisdiction = "AZ";
zalbanaizConnectathonBr.CertificateNumber = "8888";
BirthRecord romeroImportedBr = new BirthRecord(File.ReadAllText(TestHelpers.FixturePath("fixtures/json/BirthRecordR.json")));
romeroImportedBr.BirthLocationJurisdiction = "AZ";
romeroImportedBr.EventLocationJurisdiction = "AZ";
romeroImportedBr.CertificateNumber = "8888";
BirthRecord zalbanaizImportedBr = new BirthRecord(File.ReadAllText(TestHelpers.FixturePath("fixtures/json/BirthRecordZ.json")));
zalbanaizImportedBr.BirthLocationJurisdiction = "AZ";
zalbanaizImportedBr.EventLocationJurisdiction = "AZ";
zalbanaizImportedBr.CertificateNumber = "8888";
Assert.Equal(JsonConvert.SerializeObject(romeroRawBr), JsonConvert.SerializeObject(romeroConnectathonBr));
Assert.Equal(JsonConvert.SerializeObject(romeroRawBr), JsonConvert.SerializeObject(romeroImportedBr));
Expand Down
6 changes: 3 additions & 3 deletions projects/BFDR.Tests/FetalDeathRecord_Should.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ public void TestFetalDeathIdentifierSetters()
SetterFetalDeathRecord.DeliveryYear = 2020;
// SetterFetalDeathRecord.CertificateNumber = "767676";
// Assert.Equal("2020XX767676", SetterFetalDeathRecord.RecordIdentifier);
// Is the field name BirthLocationJurisdiction for Fetal Death?
SetterFetalDeathRecord.BirthLocationJurisdiction = "WY";
// Is the field name EventLocationJurisdiction for Fetal Death?
SetterFetalDeathRecord.EventLocationJurisdiction = "WY";
SetterFetalDeathRecord.CertificateNumber = "898989";
Assert.Equal("2020WY898989", SetterFetalDeathRecord.RecordIdentifier);
}
Expand Down Expand Up @@ -1444,7 +1444,7 @@ public void TestChildName()
parsedRecord.FetusSuffix = "Junior";
Assert.Equal("Jim", parsedRecord.FetusGivenNames[0]);
Assert.Equal("Jam", parsedRecord.FetusGivenNames[1]);
Assert.Equal("Jones", parsedRecord.ChildFamilyName);
Assert.Equal("Jones", parsedRecord.FetusFamilyName);
Assert.Equal("Junior", parsedRecord.FetusSuffix);

// to IJE
Expand Down
6 changes: 3 additions & 3 deletions projects/BFDR.Tests/Messaging_Should.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public void LoadBirthSubmissionFromJSON()
Assert.Equal((uint)48858, submission.CertNo);
Assert.Equal((uint)2019, submission.EventYear);
Assert.Equal("000000000042", submission.StateAuxiliaryId);
Assert.Equal(submission.JurisdictionId, submission.BirthRecord.BirthLocationJurisdiction);
Assert.Equal(submission.JurisdictionId, submission.BirthRecord.EventLocationJurisdiction);
Assert.Equal(2019, submission.BirthRecord.BirthYear);
Assert.Null(submission.PayloadVersionId);
}
Expand Down Expand Up @@ -216,7 +216,7 @@ public void LoadUpdateFromJSON()
Assert.Equal((uint)48858, submission.CertNo);
Assert.Equal((uint)2019, submission.EventYear);
Assert.Equal("000000000042", submission.StateAuxiliaryId);
Assert.Equal(submission.JurisdictionId, submission.BirthRecord.BirthLocationJurisdiction);
Assert.Equal(submission.JurisdictionId, submission.BirthRecord.EventLocationJurisdiction);
Assert.Equal(2019, submission.BirthRecord.BirthYear);
Assert.Equal("BFDR_STU2_0", submission.PayloadVersionId);
Assert.Equal("48858", submission.BirthRecord.CertificateNumber);
Expand All @@ -232,7 +232,7 @@ public void LoadUpdateFromJSON()
// Assert.Equal((uint)48858, submission.CertNo);
// Assert.Equal((uint)2019, submission.EventYear);
// Assert.Equal("000000000042", submission.StateAuxiliaryId);
// Assert.Equal(submission.JurisdictionId, submission.FetalDeathRecord.BirthLocationJurisdiction);
// Assert.Equal(submission.JurisdictionId, submission.FetalDeathRecord.EventLocationJurisdiction);
// Assert.Equal(2019, submission.FetalDeathRecord.BirthYear);
// Assert.Equal("48858", submission.FetalDeathRecord.CertificateNumber);
// }
Expand Down
2 changes: 1 addition & 1 deletion projects/BFDR.Tests/NatalityData_Should.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public void TestImportPatientChildVitalRecordProperties()
Assert.Equal("MA".PadRight(2), ijeImported.BSTATE);
Assert.Equal(ijeImported.BSTATE, ijeConverted.BSTATE);
Assert.Equal("MA", br.PlaceOfBirth["addressState"]);
Assert.Equal("MA", br.BirthLocationJurisdiction); // TODO - Birth Location Jurisdiction still needs to be finalized.
Assert.Equal("MA", br.EventLocationJurisdiction); // TODO - Birth Location Jurisdiction still needs to be finalized.
// Time of Birth
Assert.Equal("1230".PadRight(4), ijeImported.TB);
Assert.Equal(ijeImported.TB, ijeConverted.TB);
Expand Down
1 change: 1 addition & 0 deletions projects/BFDR/BFDR.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<Authors>[email protected],[email protected],[email protected]</Authors>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<InvariantGlobalization>true</InvariantGlobalization>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Hl7.Fhir.R4" Version="4.3.0" />
Expand Down
Loading
Loading