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

Inventory items condition #232

Merged

Conversation

turboMaCk
Copy link
Contributor

related: #209

work in progress

@turboMaCk
Copy link
Contributor Author

nothing important here yet. I'm still looking around so I'm doing syntax refactoring at least..

@turboMaCk turboMaCk changed the title Refactoring - whities, arrow functions method syntax Inventory items condition Dec 10, 2015
@turboMaCk
Copy link
Contributor Author

Early prototype of model's condition attribute.

I have no clue how this should be set so for now only hardcoded intervals are used. It does not depend on Distribution Unit only on quantity and rank.

x good average bad
A >=20 100 - 199 <100
B >=100 50 - 99 <50
C >=50 25 - 49 <49

Maybe we should add new attr on inventory model and let user sets properties of this on each item (html rank select?)... but than rank enum (dropdown) will be useless.

} else {
return 'average';
}
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

related code

@tangollama
Copy link
Member

@turboMaCk, I appreciate the fact that you tried to sort this out w/o the advantage of good requirements work from me, and I'm sorry that was the case as well. Looking at this, I'm thinking that the issue of the stock position or "condition" of an inventory item is a little more nuanced.

We have a report that calculates the number of days left of stock in a given item that uses past usage to predict a future stock out. It's called the Days Supply Left In Stock.
screen shot 2015-12-11 at 1 31 39 pm
I'm thinking that the best way to judge a certain item's stock "condition" is gauge the number of days left in stock combined with the A,B,C rank.

So ideally, the quantity would be replaced by the calculated number of days left in stock (something like estimatedDaysOfStock). So to do this properly, we would ideally like that to be the const on line 68 of app/models/inventory.js. Since that field doesn't exist yet, I think we can merge this PR, but them I'd like to propose that (if you're willing) you take on this issue: HospitalRun/hospitalrun-server#6

Does that make sense?

@turboMaCk
Copy link
Contributor Author

Dont worry. This is a naive prototype. I just open PR to start discussion on this. This one will take a longer in my opinion. There will be a lot of tweaking I think.

@turboMaCk turboMaCk force-pushed the feature/inventory_items_condition branch from 9bff6d8 to 4e3f44f Compare December 29, 2015 14:04
@turboMaCk
Copy link
Contributor Author

@tangollama So it's done. There is temporary hardcoded value for estimatedDaysOfStock https://github.com/HospitalRun/hospitalrun-frontend/pull/232/files#diff-5a90295e0bf226b91b8c48e9d1e727e9R67

Let me know about settings (days for each rank to indicate each condition)

It's already rebased to current master.

@turboMaCk turboMaCk force-pushed the feature/inventory_items_condition branch from a2c8027 to da78c7d Compare December 29, 2015 15:56
const multiplier = rankToMultiplier(this.get('rank'));

return getCondition(estimatedDaysOfStock, multiplier);
}),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

implementation on model

@turboMaCk turboMaCk force-pushed the feature/inventory_items_condition branch from da78c7d to aff2b0d Compare December 29, 2015 16:04
@turboMaCk
Copy link
Contributor Author

rebased again to @jkleinsc's 77256ae

@jkleinsc
Copy link
Member

@turboMaCk Wow that was fast. I'm taking a look now at merging this PR in.

@turboMaCk
Copy link
Contributor Author

I was working on it at the time you push new commits to master. I'm online and ready to work on any improvements based on your decision right now so let me know what you think. It will be nice to push this forward and move to next step soon.

@jkleinsc
Copy link
Member

@turboMaCk I agree. I am going to merge this and if we need to change settings, we can do that later.

jkleinsc added a commit that referenced this pull request Dec 29, 2015
@jkleinsc jkleinsc merged commit 6604e51 into HospitalRun:master Dec 29, 2015
@jglovier
Copy link
Member

🤘 ⚡

matteovivona pushed a commit that referenced this pull request Jan 15, 2021
…est-table-test-improvements

test(medication-request-table): improvements
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.

4 participants