-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Pricing types #1526
Pricing types #1526
Conversation
Merge master from upstream
There was a problem hiding this 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!
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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