hospitalrun-frontend icon indicating copy to clipboard operation
hospitalrun-frontend copied to clipboard

Split patient address field into subfields

Open JDarke opened this issue 4 years ago • 24 comments

🚀 Split patient address field into subfields

Patients' addresses should be split into appropriate subfields, such as Street, Town/City, Region and Postal code.

Motivation

Currently, the address field of Patient contact information is stored as a single string of no specific format. This has several potential problems:

  1. Possibly leads to confusion and/or duplication if the same address is entered in various formats for different patients at the same address. Administrative errors have potentially serious ramifications in a clinical context.
  2. Database actions such as sorting and filtering by address will presumably need individual fields and some standard formatting in order to be practically useful.
  3. Specific address info can't easily be pulled into other areas, e.g. - displaying zipcode alongside patient name in search field results.

Screen Shot 2020-06-18 at 20 06 22

Example

The Patient address should be entered, stored and returned as separate subfields:

Street Address Street Address 2 (optional) Town/City Zip/Postcode Country (can be set to the hospital's location country by default, but useful to have the field if international patients are a possibility)

Some fields could potentially benefit from setting standard formats, but I think that can be raised as a separate issue as needed.

JDarke avatar Jun 18 '20 19:06 JDarke

I'd like to be assigned to this myself, pending any suggested refinements to the proposal.

JDarke avatar Jun 18 '20 19:06 JDarke

@JDarke I've assigned this to you!

One thing to consider is supporting addresses globally. So long as our form can do that, should be good.

jackcmeyer avatar Jun 18 '20 20:06 jackcmeyer

Lets try to put some address examples here. We need to cover most possible cases. In my experience (as I said somewhere else I build Warehouse Management Systems for living) this is pretty inclusive:

  {
  name: string
  address1: string
  address2: string
  province?: string // somewhere called district
  city: string
  countryCode: string
  postalCode: string
}

Let me know what do you think.

fox1t avatar Jun 18 '20 20:06 fox1t

@fox1t looks good to me. For reference, FHIR's address type is:

use : code [0..1] « AddressUse! »
type : code [0..1] « AddressType! »
text : string [0..1]
line : string [0..*]
city : string [0..1]
district : string [0..1]
state : string [0..1]
postalCode : string [0..1]
country : string [0..1]
period : Period [0..1]

https://www.hl7.org/fhir/datatypes.html#Address

jackcmeyer avatar Jun 18 '20 20:06 jackcmeyer

I think we can understand if we need use and type on our resources: FHIR uses it also in other entities but i am not sure it is strictly needed in HR.

fox1t avatar Jun 18 '20 20:06 fox1t

I'd suggest changing it slightly to:

{
  name: string
  address1: string
  address2?: string
  city: string
  region?: string 
  countryCode: string
  postalCode: string
}

a) region, as it's more generically descriptive than province or district b) make the second address line optional, too.

Although do we want to make any of them required fields? Address is currently not required; is this by design?

JDarke avatar Jun 18 '20 20:06 JDarke

a) region is very confusing in many parts of the world. For example in Italy there is a region concept but it is not part of the "address". This is also true in Croatia and many parts of Africa. I think that district is more universal, if province isn't a good fit. b) absolutely, my mistake on that!

If a user is adding an address then he/she has to add all of the required fields. However address as object, is not mandatory but itself.

fox1t avatar Jun 18 '20 21:06 fox1t

Ok, I'd stick with province, then. District can be subsets of a city, but as far as I know provinces are generally the larger regions - like a state or county - which is what we're referring to here, right? Or do you mean it as a subarea of a city?

If a user is adding an address then he/she has to add all of the required fields. However address as object, is not mandatory but itself.

Makes sense.

JDarke avatar Jun 18 '20 21:06 JDarke

Correct: here we are referring to counties, states, provinces.

fox1t avatar Jun 18 '20 21:06 fox1t

Hi, I would like to be assigned to this issue please.

yuktashres avatar Jul 12 '20 13:07 yuktashres

@yuktashres - as far as I know, this issue is on hold at the moment pending further refinement of entity definitions.

@fox1t @jackcmeyer can you confirm...?

JDarke avatar Jul 12 '20 20:07 JDarke

@yuktashres Should be good to work on. I've assigned it to you.

An address is the following format:

{
  name: string
  address1: string
  address2?: string
  city: string
  region?: string 
  countryCode: string
  postalCode: string
}

jackcmeyer avatar Jul 12 '20 22:07 jackcmeyer

@jackcmeyer did you want to keep the 'Type' as well with 'home, mobile, work, temporary and old' in the address section?

yuktashres avatar Jul 18 '20 18:07 yuktashres

@jackcmeyer did you want to keep the 'Type' as well with 'home, mobile, work, temporary and old' in the address section?

@yuktashres yes

jackcmeyer avatar Jul 18 '20 20:07 jackcmeyer

Update: still working on this. @jackcmeyer

yuktashres avatar Jul 29 '20 12:07 yuktashres

Hi @jackcmeyer sorry I didn't realise this was unassigned, however I am still actively working on it. I am coming across issues with the tests and CouchDB which I am working through at the moment, getting my head around it thus it's taking some time. Would you be able to assign it back to me please?

yuktashres avatar Sep 16 '20 15:09 yuktashres

Hi @JDarke @jackcmeyer

I'm a new dev, and new to open source contributing.

Is this issue still available to work on?

Let me know and I'll get started on it today!

ghost avatar Oct 12 '20 18:10 ghost

Hi @thelderop! Yes, it's still available. Should I assign it to you?

matteovivona avatar Oct 12 '20 19:10 matteovivona

@tehKapa

That would be great! Thank you.

ghost avatar Oct 12 '20 19:10 ghost

@tehKapa @jackcmeyer I would like to take this issue

agusbrand avatar Feb 20 '21 14:02 agusbrand

ok @agusbrand

matteovivona avatar Feb 24 '21 17:02 matteovivona

@tehKapa @jackcmeyer @fox1t I would like to start working on this issue. Could I be assigned?

tinypapercrane avatar Jan 31 '22 03:01 tinypapercrane

@tehKapa @jackcmeyer @fox1t I'm working with @tinypapercrane, could I be assigned as well?

VrushankGunjur avatar Jan 31 '22 03:01 VrushankGunjur

Hey @tehKapa @jackcmeyer @fox1t, just wanted to make sure if it's ok that @tinypapercrane and @VrushankGunjur be assigned to this task. Thanks!

anthonyaperez avatar Feb 12 '22 19:02 anthonyaperez