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

Pricing types #1526

Merged
merged 8 commits into from
Oct 14, 2018
Merged

Pricing types #1526

merged 8 commits into from
Oct 14, 2018

Conversation

MatthewDorner
Copy link
Contributor

@MatthewDorner MatthewDorner commented Oct 11, 2018

Fixes #1444

#877
aa09e64
#1139

Based on the previous changes and discussion above, the intention was to remove user's ability to set Pricing Type for Pricing models with Category == 'Lab' or Category == 'Imaging' and instead lock them to default value of 'Lab Procedure' or 'Imaging Procedure'. But, the lookup lists for these weren't fully removed which has confused users and the pricing/edit controller had a bug which meant the Pricing Type would sometimes be set to blank instead of the appropriate default value, and this caused that Pricing model to become unusable due to the Lab and Imaging Request pages filtering out anything that didn't match the default 'Lab Procedure' or 'Imaging Procedure'.

In this PR, I removed the lookup lists and fixed the pricing/edit controller behavior. I also removed unused code related to the old behavior (with the lookup lists). Also removed the labs/charge and imaging/charge routes entirely as they're not used now and I believe they'd need to be re-written if they were to be used. I think they were intended for adding lab or imaging charges from another route via a modal dialog.

Also changed pricing/edit controller so when you have Category set to 'Lab' or 'Imaging', it shows Pricing Type as a static text field set to the appropriate default value instead of just making it disappear as it did before.

I will add some test cases in the next couple days.

cc @HospitalRun/core-maintainers

Copy link
Contributor

@donaldwasserman donaldwasserman left a comment

Choose a reason for hiding this comment

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

Looks good once we get some tests to cover it!

@MatthewDorner
Copy link
Contributor Author

MatthewDorner commented Oct 11, 2018

One other thing, you can see that I removed the reference to 'imaging_pricing_types' from the imaging/route.js' additionalModels array. But I couldn't do the same thing for labs/route.js. That's because in labs/route.js, there was only that one element in additionalModels and I found that removing it causes a problem.

Basically, querying for the additionalModels in abstract-module-route's model(), even if it returns nothing, has some effect of initializing relational-pouch and if you don't do it, the code in abstract-index-route's model() will fail. I will create a new issue for that though.

Copy link
Contributor

@donaldwasserman donaldwasserman left a comment

Choose a reason for hiding this comment

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

LGTM

@MatthewDorner MatthewDorner merged commit d55cbc9 into HospitalRun:master Oct 14, 2018
@MatthewDorner MatthewDorner deleted the pricing-types branch October 14, 2018 00:48
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot add Imaging Pricing Types manually
2 participants