Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow individual & group locations to be updated #96

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

weilu
Copy link
Contributor

@weilu weilu commented Dec 10, 2024

  • Create group with location
  • Update group location
  • Update individual location
  • Display location in individual update task
  • Disable location edited for individuals who belong to a group (Location edit should be done on the group instead)
  • Display location in individual change log
  • Display location in group change log

Also display location id in individual task
];

const IndividualTaskItemFormatters = () => [
(individual) => individual?.first_name,
(individual) => individual?.last_name,
(individual) => individual?.dob,
(individual) => individual?.location_id,
Copy link
Contributor Author

@weilu weilu Dec 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sniedzielski @delcroip any thoughts on how to display the location information to be more user-friendly? I'm not sure it's worth adding one or two separate API calls to fetch the location (possibly two if the individual's location switched from one to another)

Copy link
Contributor

@sniedzielski sniedzielski Dec 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Usually locations in openIMIS are displayed by their code for example if we have 4 level location and:
a) District A
b) Region B
c) Municipality C
d) Village D

  • location code for Village D is shown as 'ABCD' like in this searcher example
    Screenshot from 2024-12-17 12-57-37
    Screenshot from 2024-12-17 13-31-30

The other approach in on the insurees page in result list:
Screenshot from 2024-12-17 12-57-37

Personally I would recommend first approach. In that case in 'formatter' we have to pass location as the 'code' not id. I think somewhere in backend it could be possible to do this in task creation. I have to double check this. Individual has the reference to location https://github.com/openimis/openimis-be-individual_py/blob/d05e42da207f18e10b2ca613988d6e554cedab68/individual/models.py#L21 and it should be possible to manage it thanks to your changes related to locations

in policyholder graphQL projection we have 'locations{id, uuid, code, name, type, parent{id,uuid,code,name,type,parent{id,uuid,code,name,type,parent{id,uuid,code,name,type}}}}' this kind of definition to fetch location informations. I saw in prev PRs that you used 'location Code' in managing locations. Maybe we should use the same approach, take this code from backend and display here in 'task definition'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow edit of individual & group location at record level
2 participants