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

Fix 1016 #1020

Merged
merged 139 commits into from
Mar 29, 2017
Merged

Fix 1016 #1020

merged 139 commits into from
Mar 29, 2017

Conversation

adeolabadmus
Copy link
Contributor

Fixes #1016

cc @HospitalRun/core-maintainers

Chima1707 and others added 30 commits January 26, 2017 16:23
Chima1707 and others added 27 commits March 10, 2017 11:50
Copy link
Member

@jkleinsc jkleinsc left a comment

Choose a reason for hiding this comment

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

@adeolabadmus thanks for the PR!
In order for this to work like visit notes, we need to add a need attribute to the vitals that records the users display name and not rely on the modifiedBy field which contains the user's id.

If you take a look at https://github.com/HospitalRun/hospitalrun-frontend/blob/master/app/visits/vitals/edit/controller.js#L25 you will see there is logic in beforeUpdate that fires when the model is new. You can set the new attribute there by getting the value from this.getUserName(), like we do here:
https://github.com/HospitalRun/hospitalrun-frontend/blob/master/app/patients/notes/controller.js#L29

@@ -226,6 +227,7 @@
</tr>
{{#each model.vitals as |vital|}}
<tr>
<td>{{vital.modifiedBy}}</td>
Copy link
Member

Choose a reason for hiding this comment

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

modifiedBy is the user's id, not the users name.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jkleinsc, Actually, it is the user's display name.

The modifiedBy attribute is set here: https://github.com/HospitalRun/hospitalrun-frontend/blob/master/app/models/abstract.js#L86

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jkleinsc Oh! Ignore my comment above, I just saw your other detailed comment.

Copy link
Member

Choose a reason for hiding this comment

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

@adeolabadmus hold on... you might be right here. modifiedBy used to be the users id, but it looks like it is now user display name. Though we probably want the user who added, not who last modified, which would require an additional attribute.

Copy link
Member

Choose a reason for hiding this comment

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

I am going to merge this in with the vitals using the modifiedBy field. I think that field is sufficient

@jkleinsc jkleinsc merged commit 2ea2fe2 into HospitalRun:master Mar 29, 2017
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