Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

Secondary, tertiary (etc) addresses, phone numbers, and emails for a patient #1920

Closed
jackcmeyer opened this issue Mar 18, 2020 · 14 comments · Fixed by #2113
Closed

Secondary, tertiary (etc) addresses, phone numbers, and emails for a patient #1920

jackcmeyer opened this issue Mar 18, 2020 · 14 comments · Fixed by #2113
Labels
🚀enhancement an issue/pull request that adds a feature to the application in progress indicates that issue/pull request is currently being worked on LOE - large indicates that the level of effort to complete issue is large patients issue/pull request that interacts with patients module

Comments

@jackcmeyer
Copy link
Member

🚀 Feature Proposal

I would like the ability to define secondary, tertiary, etc. phone numbers, addresses, and emails for a patient.

When creating a new patient or editing patient, I should be able to add these extra fields.

It should also be able to label what kind of phone number, address, or email it is.

Phone numbers can be one of the following:

  • home
  • work
  • temp
  • old
  • mobile

Email can be one of the following:

  • home
  • work
  • temp
  • old
  • mobile

Addresses can one of the following:

  • home
  • work
  • temp
  • old
  • billing

Motivation

We should be flexible in the type of data that can handle.

Example

  • Apple Contacts

Technical notes

  • Will require changes to the Patient model to support a list of addresses, phone numbers, emails.
  • Will require changes to some models to support the label of the phone number, address, or email (in some cases it might even require creating new models).
@jackcmeyer jackcmeyer transferred this issue from HospitalRun/hospitalrun Mar 18, 2020
@jackcmeyer jackcmeyer added 🚀enhancement an issue/pull request that adds a feature to the application help wanted indicates that an issue is open for contributions patients issue/pull request that interacts with patients module labels Mar 18, 2020
@alti21
Copy link
Contributor

alti21 commented Mar 19, 2020

May I help on this?

@jackcmeyer jackcmeyer added in progress indicates that issue/pull request is currently being worked on and removed help wanted indicates that an issue is open for contributions labels Mar 19, 2020
@jackcmeyer
Copy link
Member Author

I've assigned this to you, @alti21. Please reach out if you have any questions!

@alti21
Copy link
Contributor

alti21 commented Mar 21, 2020

@jackcmeyer I'm having some trouble with this. I'm quite new to typescript just to let you know. I'm having trouble with this: Will require changes to the Patient model to support a list of addresses, phone numbers, emails. I changed phoneNumber into an array in ContactInformation.ts:

export default interface ContactInformation { phoneNumber: string[], email?: string, address?: string }
Sorry i'm not sure how to add a line break to the code here

But then when I try to access patient.phonenumber[0] in GeneralInformation.ts, I get an error saying that patient.phoneNumber is undefined

@jackcmeyer
Copy link
Member Author

You have the right idea for adding how to define the phone numbers as an array.

I'm guessing that the patient that you are looking at has no phone numbers defined for them.

If that's the case, then patient.phoneNumber is undefined.

When using an array accessor on undefined, you'll receive the error that you are getting.

Before accessing the patient's phoneNumber you'll want to check first its not undefined.

@alti21
Copy link
Contributor

alti21 commented Mar 22, 2020

@jackcmeyer thanks for the help, I got that part figured out now. I do need some help with the translations, as I want to have different labels for the new fields. Is there a file that has the translations?

@jackcmeyer jackcmeyer added help wanted indicates that an issue is open for contributions LOE - large indicates that the level of effort to complete issue is large and removed in progress indicates that issue/pull request is currently being worked on labels May 3, 2020
@sourabbanka22
Copy link
Contributor

Hi @jackcmeyer, May I work on this issue?

@jackcmeyer
Copy link
Member Author

@sourabbanka22 I've assigned this to you!

@jackcmeyer jackcmeyer added in progress indicates that issue/pull request is currently being worked on and removed help wanted indicates that an issue is open for contributions labels May 11, 2020
@sourabbanka22
Copy link
Contributor

Hi , @jackcmeyer I have implemented the feature to define secondary, tertiary, etc. phone numbers, addresses, and emails for a patient.

Following are some screenshots of the implemented functionality:

Initial:
NewPatient_Before

NewPatient_After

After Adding PhoneNumber and Email:
NewPatient_View

Adding Multiple PhoneNumbers, etc
EditPatient_After

Does this look OK to you?

@matteovivona
Copy link
Contributor

@lauggh @StefanoMiC

@jackcmeyer
Copy link
Member Author

@sourabbanka22 could you open a PR that can build so we can play around on the preview?

@sourabbanka22
Copy link
Contributor

@jackcmeyer as I have made quite a few number of changes in the Patient model to support a list of addresses, phone numbers, emails also some additional changes to some models to support the label of the phone number, address, or email because of which some tests requires to be updated accordingly, I would require some help with that. Should I open a PR with these Test Cases failing?

sourabbanka22 added a commit to sourabbanka22/hospitalrun-frontend that referenced this issue May 28, 2020
A Feature that adds the ability to define secondary, tertiary, etc. phone numbers, addresses, and
emails for a patient.

New Feature HospitalRun#1920
@sourabbanka22
Copy link
Contributor

@jackcmeyer I just opened a PR, Currently I have commented out a few tests related to newly created Phone Number, Email and Address Models

Please let me know if there are any Modifications or Changes required.

sourabbanka22 added a commit to sourabbanka22/hospitalrun-frontend that referenced this issue May 29, 2020
Design Changes for Phone Number, Email and Address Model

fix HospitalRun#1920
sourabbanka22 added a commit to sourabbanka22/hospitalrun-frontend that referenced this issue May 30, 2020
Some Bug Fixes and Tests Updated

fix HospitalRun#1920
sourabbanka22 added a commit to sourabbanka22/hospitalrun-frontend that referenced this issue Jun 1, 2020
Issue relating to Saved and UnSaved Phone Numbers, Emails, Adresses when the user does not click the
Add Button

fix HospitalRun#1920
sourabbanka22 added a commit to sourabbanka22/hospitalrun-frontend that referenced this issue Jun 4, 2020
Improved Input Validation for PhoneNumbers, Emails, Adresses by checking if the user input is Valid
or Invalid also whether the input is empty or not

fix HospitalRun#1920
sourabbanka22 added a commit to sourabbanka22/hospitalrun-frontend that referenced this issue Jun 5, 2020
Adding Missing Tests and corrected Existing Tests for Phone Number, Email and Address Model

fix HospitalRun#1920
sourabbanka22 added a commit to sourabbanka22/hospitalrun-frontend that referenced this issue Jun 6, 2020
Adding Missing Tests and corrected Existing Tests for Phone Number, Email and Address Model

fix HospitalRun#1920
@lauggh
Copy link
Member

lauggh commented Jun 6, 2020

Screenshots look good.

sourabbanka22 added a commit to sourabbanka22/hospitalrun-frontend that referenced this issue Jun 8, 2020
Component Instances for Phone Numbers, Addresses and Emails

re HospitalRun#1920
@ghost
Copy link

ghost commented Jun 14, 2020

Hi, PR is ready for your review at #2113. Thank you!

@ghost ghost assigned ghost and unassigned sourabbanka22 Jun 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🚀enhancement an issue/pull request that adds a feature to the application in progress indicates that issue/pull request is currently being worked on LOE - large indicates that the level of effort to complete issue is large patients issue/pull request that interacts with patients module
Projects
None yet
5 participants