Skip to content

fix: broken bulk upload #543

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

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

amosmachora
Copy link
Collaborator

Requirements

  • This PR has a title that briefly describes the work done, including the ticket number if there is a ticket.
  • My work conforms to the OpenMRS 3.0 Styleguide.
  • I checked for feature overlap with existing widgets.

Summary

This PR adds/enhances a way for users to

  • download charge items ✅
  • download blank bulk upload template ✅
  • bulk upload new charge items

However, I am currently stuck on a feature whereby given a concept_id I cannot figure out how to get its uuid to make the post request with. Normally when you fill out a form to create a new charge item you search for and select a concept, the selected concept's uuid is then posted to the backend. Still, you wouldn't expect users to fill in UUIDs on an Excel sheet so I went with the ID approach as they are way shorter and much more flexible. unfortunately, I can't find a way to translate the ID to a uuid. If I try sending the ID to the backend the ChargeItem's concept is just nullified regardless of updating or creating..

So in so many words do not merge yet. Check this.

Screenshots

None.

Related Issue

None.

Other

None.

@amosmachora
Copy link
Collaborator Author

@Injiri any suggestions on how I can go about this, can the /ws/rest/v1/cashier/api/billable-service be improved a little bit to accept concept IDs on update?

@Injiri
Copy link

Injiri commented Jan 13, 2025

It's possible however current implementation supports passing the uuid for the concept relating to the service... just incase a uuid is interfered, even with one character there is min probability for new uuid to match an existing concept unlike if one tampers with the upload file with id's, just adding on single digit might map to an existing concept wrongly

@donaldkibet
Copy link
Contributor

donaldkibet commented Jan 13, 2025

@Injiri @amosmachora

Suggested improvement for charge items template:

  1. Generate the template with all fields pre-populated EXCEPT for 'Unit Price'
  • This allows users to quickly enter just the prices
  • Prevents errors with metadata like UUIDs

We should also consider adding a UI feature where users can:

  • Select which items they want to create charge items for
  • Generate a template based on their selection

This would provide a quicker and more error-proof way to handle charge item creation.

@amosmachora
Copy link
Collaborator Author

@Injiri can we have a short huddle today to clear that up?

@amosmachora
Copy link
Collaborator Author

  1. e template with all f

I already have that. Attached is an example of the new template.
charge_items_template (6).xlsx

@Injiri @donaldkibet here is an example of downloaded billable services.
charge-items (6) (3).xlsx

@amosmachora amosmachora marked this pull request as draft January 21, 2025 08:13
@amosmachora amosmachora changed the title fix: broken bulk upload (Draft) fix: broken bulk upload Jan 21, 2025
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.

3 participants