Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1578 remove active episode #1594

Merged
merged 10 commits into from Oct 4, 2018
Merged

Conversation

davidmiller
Copy link
Member

Serialising a value for Patient.to_dict()['active_episode_id'] hasn't made sense since we accepted that there will be multiple concurrent episodes as a common occurrence.

Picking the first episode id from self.episode_set.filter(active=True).order_by('id').reverse() is if anything confusing, as it implies that there is some special status to that episode - which there is not.

This PR removes the concept of Patient.active_episode_id and refactors the HospitalNumberCtrl to (the only place that really used it) replicate the behaviour itself.

The behaviour of HospitalNumberCtrl is frankly suspect anyway, but it leaves this PR no more suspect than before it.

Note that we probably want to merge #1590 before this, as Copy To Category also uses active_episode_id.

refs #1578

_.values(patient.episodes),
function(x){ return x.active == true }
);
if(active_ids.length > 0){
Copy link
Contributor

Choose a reason for hiding this comment

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

bike shedding but active_ids.length is enough

@fredkingham fredkingham merged commit e335dd7 into v0.13.0 Oct 4, 2018
@davidmiller davidmiller deleted the 1578-remove-active-episode-id branch August 12, 2019 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants