Skip to content

Commit

Permalink
Update BirthLocationJurisdiction to EventLocationJurisdiction
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertScalfani committed Jan 13, 2025
1 parent 9806339 commit 3308c56
Show file tree
Hide file tree
Showing 13 changed files with 36 additions and 45 deletions.
4 changes: 2 additions & 2 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 @@ -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
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
4 changes: 2 additions & 2 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
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
6 changes: 3 additions & 3 deletions projects/BFDR/BFDR.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion projects/BFDR/Connectathon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ record = NullMonroe();

if (record != null && state != null)
{
record.BirthLocationJurisdiction = state;
record.EventLocationJurisdiction = state;
}

if (record != null && year != null)
Expand Down
13 changes: 2 additions & 11 deletions projects/BFDR/IJEFetalDeath.cs
Original file line number Diff line number Diff line change
Expand Up @@ -198,17 +198,8 @@ public string FDOD_YR
[IJEField(2, 5, 2, "State, U.S. Territory or Canadian Province of Place of Delivery - code", "DSTATE", 1)]
public string DSTATE
{
get
{
return Dictionary_Geo_Get("DSTATE", "PlaceOfBirth", "address", "state", true);
}
set
{
if (!String.IsNullOrWhiteSpace(value))
{
Dictionary_Set("DSTATE", "PlaceOfBirth", "addressState", value);
}
}
get => LeftJustified_Get("DSTATE", "EventLocationJurisdiction");
set => LeftJustified_Set("DSTATE", "EventLocationJurisdiction", value);
}

/// <summary>Certificate Number</summary>
Expand Down
2 changes: 1 addition & 1 deletion projects/BFDR/NatalityRecord_constructors.cs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ private void UpdateRecordIdentifier()
year = (uint)this.GetYear();
}

String jurisdictionId = this.BirthLocationJurisdiction;
String jurisdictionId = this.EventLocationJurisdiction;
if (jurisdictionId == null || jurisdictionId.Trim().Length < 2)
{
jurisdictionId = "XX";
Expand Down
8 changes: 4 additions & 4 deletions projects/BFDR/NatalityRecord_submissionProperties.cs
Original file line number Diff line number Diff line change
Expand Up @@ -631,14 +631,14 @@ public string MotherMaidenSuffix
/// <value>the vital record jurisdiction identifier.</value>
/// <example>
/// <para>// Setter:</para>
/// <para>ExampleBirthRecord.BirthLocationJurisdiction = "MA";</para>
/// <para>ExampleBirthRecord.EventLocationJurisdiction = "MA";</para>
/// <para>// Getter:</para>
/// <para>Console.WriteLine($"Birth Location Jurisdiction: {ExampleBirthRecord.BirthLocationJurisdiction}");</para>
/// <para>Console.WriteLine($"Birth Location Jurisdiction: {ExampleBirthRecord.EventLocationJurisdiction}");</para>
/// </example>
[Property("Birth Location Jurisdiction", Property.Types.String, "Birth Location", "Vital Records Jurisdiction of Birth Location (two character jurisdiction code, e.g. CA).", true, VR.IGURL.Child, false, 16)]
[Property("Event Location Jurisdiction", Property.Types.String, "Event Location", "Vital Records Jurisdiction of Event Location (two character jurisdiction code, e.g. CA).", true, VR.IGURL.Child, false, 16)]
// TODO - Currently not sure where the birth location would be in the record via FHIRPath, it seems different in BFDR vs VRDR. Some of the property fields above also need updating. Is this not in PatientChildVitalRecords at all and I just can't find it? There seems to be no reference to a jurisdiction location in the IG table of contents.
[FHIRPath("Bundle.entry.resource.where($this is Location).where(type.coding.code='birth')", "")]
public string BirthLocationJurisdiction
public string EventLocationJurisdiction
{
get
{
Expand Down
4 changes: 2 additions & 2 deletions projects/Canary.Tests/RecordTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ public async void TestConverter()
};
_recController.ControllerContext.HttpContext = httpContext;
var response = await _recController.NewPostAsync("bfdr-birth");
((BirthRecord) response.Item1.GetRecord()).BirthLocationJurisdiction = "AZ";
((BirthRecord) response.Item1.GetRecord()).EventLocationJurisdiction = "AZ";
((BirthRecord) response.Item1.GetRecord()).CertificateNumber = "99991";
BirthRecord br = new BirthRecord(romeroJson);
br.BirthLocationJurisdiction = "AZ";
br.EventLocationJurisdiction = "AZ";
br.CertificateNumber = "99991";

Assert.Equal(JsonConvert.SerializeObject(br), JsonConvert.SerializeObject(new BirthRecord(response.Item1.Json)));
Expand Down
2 changes: 1 addition & 1 deletion projects/Canary/Models/BirthRecordFaker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ public override BirthRecord Generate(bool simple = false)
record.FatherRace = new Tuple<string, string>[] { race1 };
record.MotherRace = new Tuple<string, string>[] { race2 };
}
record.BirthLocationJurisdiction = state;
record.EventLocationJurisdiction = state;
Dictionary<string, string> birthAddress = new Dictionary<string, string>();
birthAddress.Add("addressLine1", $"{faker.Random.Number(999) + 1} Main Street");
birthAddress.Add("addressCity", "Springfield");
Expand Down

0 comments on commit 3308c56

Please sign in to comment.