# How can I format the address on the response from the API call?

**URL:** <https://developer.community.nhs.uk/t/how-can-i-format-the-address-on-the-response-from-the-api-call/461>\
**Category:** Personal Demographics Service FHIR API\
**Tags:** fhir, spine\
**Created:** [1 September 2023 15:49 UTC](https://developer.community.nhs.uk/t/how-can-i-format-the-address-on-the-response-from-the-api-call/461 "2023-09-01T15:49:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![david.garcia](https://avatars.discourse-cdn.com/v4/letter/d/e495f1/32.png) [@david.garcia](https://developer.community.nhs.uk/u/david.garcia)\
**Post date:** [1 September 2023 15:49 UTC](https://developer.community.nhs.uk/t/how-can-i-format-the-address-on-the-response-from-the-api-call/461/1 "2023-09-01T15:49:24Z")

</div>

Is there a way to get the response like the one in [Address returned for patient by id by not from patient search](https://developer.community.nhs.uk/t/address-returned-for-patient-by-id-by-not-from-patient-search/412) ?

There are records which have no address line 1 for instance, so the array format is not really helpful:

![image](https://europe1.discourse-cdn.com/nhsdigitaldeveloper/original/1X/36cba44352d5039e058193497d5ca7ddb588e8d0.png)

---

<div class="post-metadata">

**Author:** ![chris.clarke](https://dub1.discourse-cdn.com/nhsdigitaldeveloper/user_avatar/developer.community.nhs.uk/chris.clarke/32/134_2.png) [@chris.clarke](https://developer.community.nhs.uk/u/chris.clarke)\
**Post date:** [5 September 2023 09:18 UTC](https://developer.community.nhs.uk/t/how-can-i-format-the-address-on-the-response-from-the-api-call/461/2 "2023-09-05T09:18:51Z")

</div>

Unfortunately not, this is a limitation of FHIR, from the [PDS FHIR documentation](https://digital.nhs.uk/developer/api-catalogue/personal-demographics-service-fhir#get-/Patient/-id-)

> If any of the lines are blank, they are not returned due to FHIR conformance constraints.

---

<div class="post-metadata">

**Author:** ![paul.richardson](https://dub1.discourse-cdn.com/nhsdigitaldeveloper/user_avatar/developer.community.nhs.uk/paul.richardson/32/72_2.png) [@paul.richardson](https://developer.community.nhs.uk/u/paul.richardson)\
**Post date:** [15 December 2023 17:31 UTC](https://developer.community.nhs.uk/t/how-can-i-format-the-address-on-the-response-from-the-api-call/461/3 "2023-12-15T17:31:43Z")

</div>

Hi Chris,  
I’ve just hit this issue myself. Surely, I can’t be alone in thinking that this is a big problem? For years, CAP compliance has insisted on how those 5 address lines should be used, and now that’s all going to go to pot and result in address data getting dirtier and dirtier as anyone populating a system that has concepts of town/city and country (which should be all of them) will have no idea which fields in the FHIR response to put into those fields.  
Am I overstating the scale of the problem? I hope so.  
I’d be interested in the thoughts of the demographics team.  
Thanks,  
Paul

---

<div class="post-metadata">

**Author:** ![paul.richardson](https://dub1.discourse-cdn.com/nhsdigitaldeveloper/user_avatar/developer.community.nhs.uk/paul.richardson/32/72_2.png) [@paul.richardson](https://developer.community.nhs.uk/u/paul.richardson)\
**Post date:** [18 January 2024 10:14 UTC](https://developer.community.nhs.uk/t/how-can-i-format-the-address-on-the-response-from-the-api-call/461/4 "2024-01-18T10:14:27Z")

</div>

Just bumping this issue.
