-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Conversation
OPD Reports Custom Forms
Fix/report acceptance tests
Refactor code
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.
@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> |
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.
modifiedBy is the user's id, not the users name.
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.
@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
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.
@jkleinsc Oh! Ignore my comment above, I just saw your other detailed comment.
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.
@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.
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.
I am going to merge this in with the vitals using the modifiedBy field. I think that field is sufficient
Fixes #1016
cc @HospitalRun/core-maintainers