Skip to content

Commit 67ca3e3

Browse files
authored
BFD-4538: Fix Address (#2992)
1 parent a76d771 commit 67ca3e3

4 files changed

Lines changed: 98 additions & 3 deletions

File tree

apps/bfd-server-ng/src/main/java/gov/cms/bfd/server/ng/beneficiary/model/Address.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,11 @@ public class Address {
4040
* @return FHIR address
4141
*/
4242
public Optional<org.hl7.fhir.r4.model.Address> toFhir() {
43-
// This is a no-op currently since we don't have approval to share address data.
44-
// We should either remove or add these mappings later when a final decision is made.
45-
return Optional.empty();
43+
var fhirAddress = new org.hl7.fhir.r4.model.Address();
44+
45+
stateCode.ifPresent(fhirAddress::setState);
46+
zipCode.ifPresent(fhirAddress::setPostalCode);
47+
48+
return fhirAddress.isEmpty() ? Optional.empty() : Optional.of(fhirAddress);
4649
}
4750
}

apps/bfd-server-ng/src/test/java/gov/cms/bfd/server/ng/__snapshots__/PatientCoverageC4DICSearchIT.snap

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ gov.cms.bfd.server.ng.PatientCoverageC4DICSearchIT.patientCoverageSearchAllParts
33
"entry" : [ {
44
"fullUrl" : "{uuid}",
55
"resource" : {
6+
"address" : [ {
7+
"postalCode" : "36609",
8+
"state" : "AL"
9+
} ],
610
"birthDate" : "1967-03-19",
711
"communication" : [ {
812
"language" : {
@@ -460,6 +464,10 @@ gov.cms.bfd.server.ng.PatientCoverageC4DICSearchIT.patientCoverageSearchByIdDual
460464
"entry" : [ {
461465
"fullUrl" : "{uuid}",
462466
"resource" : {
467+
"address" : [ {
468+
"postalCode" : "77551",
469+
"state" : "TX"
470+
} ],
463471
"birthDate" : "1922-04-01",
464472
"communication" : [ {
465473
"language" : {
@@ -606,6 +614,10 @@ gov.cms.bfd.server.ng.PatientCoverageC4DICSearchIT.patientCoverageSearchByIdPart
606614
"entry" : [ {
607615
"fullUrl" : "{uuid}",
608616
"resource" : {
617+
"address" : [ {
618+
"postalCode" : "77551",
619+
"state" : "TX"
620+
} ],
609621
"birthDate" : "1922-04-01",
610622
"communication" : [ {
611623
"language" : {
@@ -759,6 +771,10 @@ gov.cms.bfd.server.ng.PatientCoverageC4DICSearchIT.patientCoverageSearchByIdPart
759771
"entry" : [ {
760772
"fullUrl" : "{uuid}",
761773
"resource" : {
774+
"address" : [ {
775+
"postalCode" : "36609",
776+
"state" : "AL"
777+
} ],
762778
"birthDate" : "1959-03-14",
763779
"communication" : [ {
764780
"language" : {

apps/bfd-server-ng/src/test/java/gov/cms/bfd/server/ng/__snapshots__/PatientReadIT.snap

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ gov.cms.bfd.server.ng.PatientReadIT.patientReadMergedBene=[
1515

1616
gov.cms.bfd.server.ng.PatientReadIT.patientReadUnMergedWithHistoricBenes=[
1717
{
18+
"address" : [ {
19+
"postalCode" : "58054",
20+
"state" : "ND"
21+
} ],
1822
"birthDate" : "1959-03-14",
1923
"communication" : [ {
2024
"language" : {
@@ -97,6 +101,10 @@ gov.cms.bfd.server.ng.PatientReadIT.patientReadUnMergedWithHistoricBenes=[
97101

98102
gov.cms.bfd.server.ng.PatientReadIT.patientReadUnMergedWithHistoricKillCredit=[
99103
{
104+
"address" : [ {
105+
"postalCode" : "58054",
106+
"state" : "ND"
107+
} ],
100108
"birthDate" : "1959-03-14",
101109
"communication" : [ {
102110
"language" : {
@@ -153,6 +161,10 @@ gov.cms.bfd.server.ng.PatientReadIT.patientReadUnMergedWithHistoricKillCredit=[
153161

154162
gov.cms.bfd.server.ng.PatientReadIT.patientReadValidLong=[
155163
{
164+
"address" : [ {
165+
"postalCode" : "77551",
166+
"state" : "TX"
167+
} ],
156168
"birthDate" : "1922-04-01",
157169
"communication" : [ {
158170
"language" : {
@@ -210,6 +222,10 @@ gov.cms.bfd.server.ng.PatientReadIT.patientReadValidLong=[
210222

211223
gov.cms.bfd.server.ng.PatientReadIT.patientReadValidString=[
212224
{
225+
"address" : [ {
226+
"postalCode" : "77551",
227+
"state" : "TX"
228+
} ],
213229
"birthDate" : "1922-04-01",
214230
"communication" : [ {
215231
"language" : {

apps/bfd-server-ng/src/test/java/gov/cms/bfd/server/ng/__snapshots__/PatientSearchIT.snap

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ gov.cms.bfd.server.ng.PatientSearchIT.patientSearchByHistoricalMbi[GET]=[
22
{
33
"entry" : [ {
44
"resource" : {
5+
"address" : [ {
6+
"postalCode" : "58054",
7+
"state" : "ND"
8+
} ],
59
"birthDate" : "1959-03-14",
610
"communication" : [ {
711
"language" : {
@@ -98,6 +102,10 @@ gov.cms.bfd.server.ng.PatientSearchIT.patientSearchByHistoricalMbi[GET_WITH_SEAR
98102
{
99103
"entry" : [ {
100104
"resource" : {
105+
"address" : [ {
106+
"postalCode" : "58054",
107+
"state" : "ND"
108+
} ],
101109
"birthDate" : "1959-03-14",
102110
"communication" : [ {
103111
"language" : {
@@ -194,6 +202,10 @@ gov.cms.bfd.server.ng.PatientSearchIT.patientSearchByHistoricalMbi[POST]=[
194202
{
195203
"entry" : [ {
196204
"resource" : {
205+
"address" : [ {
206+
"postalCode" : "58054",
207+
"state" : "ND"
208+
} ],
197209
"birthDate" : "1959-03-14",
198210
"communication" : [ {
199211
"language" : {
@@ -338,6 +350,10 @@ gov.cms.bfd.server.ng.PatientSearchIT.patientSearchByIdMergedBeneMultipleLinks[G
338350
{
339351
"entry" : [ {
340352
"resource" : {
353+
"address" : [ {
354+
"postalCode" : "58054",
355+
"state" : "ND"
356+
} ],
341357
"birthDate" : "1959-03-14",
342358
"communication" : [ {
343359
"language" : {
@@ -436,6 +452,10 @@ gov.cms.bfd.server.ng.PatientSearchIT.patientSearchByIdMergedBeneMultipleLinks[G
436452
{
437453
"entry" : [ {
438454
"resource" : {
455+
"address" : [ {
456+
"postalCode" : "58054",
457+
"state" : "ND"
458+
} ],
439459
"birthDate" : "1959-03-14",
440460
"communication" : [ {
441461
"language" : {
@@ -534,6 +554,10 @@ gov.cms.bfd.server.ng.PatientSearchIT.patientSearchByIdMergedBeneMultipleLinks[P
534554
{
535555
"entry" : [ {
536556
"resource" : {
557+
"address" : [ {
558+
"postalCode" : "58054",
559+
"state" : "ND"
560+
} ],
537561
"birthDate" : "1959-03-14",
538562
"communication" : [ {
539563
"language" : {
@@ -719,6 +743,10 @@ gov.cms.bfd.server.ng.PatientSearchIT.patientSearchByIdUnMergedWithHistoricKillC
719743
{
720744
"entry" : [ {
721745
"resource" : {
746+
"address" : [ {
747+
"postalCode" : "58054",
748+
"state" : "ND"
749+
} ],
722750
"birthDate" : "1959-03-14",
723751
"communication" : [ {
724752
"language" : {
@@ -789,6 +817,10 @@ gov.cms.bfd.server.ng.PatientSearchIT.patientSearchByIdUnMergedWithHistoricKillC
789817
{
790818
"entry" : [ {
791819
"resource" : {
820+
"address" : [ {
821+
"postalCode" : "58054",
822+
"state" : "ND"
823+
} ],
792824
"birthDate" : "1959-03-14",
793825
"communication" : [ {
794826
"language" : {
@@ -859,6 +891,10 @@ gov.cms.bfd.server.ng.PatientSearchIT.patientSearchByIdUnMergedWithHistoricKillC
859891
{
860892
"entry" : [ {
861893
"resource" : {
894+
"address" : [ {
895+
"postalCode" : "58054",
896+
"state" : "ND"
897+
} ],
862898
"birthDate" : "1959-03-14",
863899
"communication" : [ {
864900
"language" : {
@@ -929,6 +965,10 @@ gov.cms.bfd.server.ng.PatientSearchIT.patientSearchById[GET]=[
929965
{
930966
"entry" : [ {
931967
"resource" : {
968+
"address" : [ {
969+
"postalCode" : "77551",
970+
"state" : "TX"
971+
} ],
932972
"birthDate" : "1922-04-01",
933973
"communication" : [ {
934974
"language" : {
@@ -1000,6 +1040,10 @@ gov.cms.bfd.server.ng.PatientSearchIT.patientSearchById[GET_WITH_SEARCH]=[
10001040
{
10011041
"entry" : [ {
10021042
"resource" : {
1043+
"address" : [ {
1044+
"postalCode" : "77551",
1045+
"state" : "TX"
1046+
} ],
10031047
"birthDate" : "1922-04-01",
10041048
"communication" : [ {
10051049
"language" : {
@@ -1071,6 +1115,10 @@ gov.cms.bfd.server.ng.PatientSearchIT.patientSearchById[POST]=[
10711115
{
10721116
"entry" : [ {
10731117
"resource" : {
1118+
"address" : [ {
1119+
"postalCode" : "77551",
1120+
"state" : "TX"
1121+
} ],
10741122
"birthDate" : "1922-04-01",
10751123
"communication" : [ {
10761124
"language" : {
@@ -1190,6 +1238,10 @@ gov.cms.bfd.server.ng.PatientSearchIT.patientSearchByIdentifier[GET]=[
11901238
{
11911239
"entry" : [ {
11921240
"resource" : {
1241+
"address" : [ {
1242+
"postalCode" : "58054",
1243+
"state" : "ND"
1244+
} ],
11931245
"birthDate" : "1959-03-14",
11941246
"communication" : [ {
11951247
"language" : {
@@ -1286,6 +1338,10 @@ gov.cms.bfd.server.ng.PatientSearchIT.patientSearchByIdentifier[GET_WITH_SEARCH]
12861338
{
12871339
"entry" : [ {
12881340
"resource" : {
1341+
"address" : [ {
1342+
"postalCode" : "58054",
1343+
"state" : "ND"
1344+
} ],
12891345
"birthDate" : "1959-03-14",
12901346
"communication" : [ {
12911347
"language" : {
@@ -1382,6 +1438,10 @@ gov.cms.bfd.server.ng.PatientSearchIT.patientSearchByIdentifier[POST]=[
13821438
{
13831439
"entry" : [ {
13841440
"resource" : {
1441+
"address" : [ {
1442+
"postalCode" : "58054",
1443+
"state" : "ND"
1444+
} ],
13851445
"birthDate" : "1959-03-14",
13861446
"communication" : [ {
13871447
"language" : {

0 commit comments

Comments
 (0)