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

SL-816 Duplicate registrations caused by system error #559

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dmdesimone
Copy link
Contributor

No description provided.

@dmdesimone dmdesimone requested a review from mogoodrich January 3, 2025 02:04
Copy link
Member

@mogoodrich mogoodrich left a comment

Choose a reason for hiding this comment

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

Had some questions, but generally LGTM!

Also, feel free to assign this back to me and/or do a other ticket about looking into the root cause of the problem again.


-- person attributes
select person_attribute_type_id into @telephone from person_attribute_type where name = 'Telephone Number' ;
select person_attribute_type_id into @motherName from person_attribute_type where name = 'First Name of Mother' ;
Copy link
Member

Choose a reason for hiding this comment

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

Not a big deal, but do we connect these attributes in all our countries? I guess if not just needs to be null-safe.

and d.reg_location <=> p.reg_location
and d.registration_date <=> p.registration_date
and date(d.registration_entry_date) <=> date(p.registration_entry_date)
and d.user_entered <=> p.user_entered;
Copy link
Member

Choose a reason for hiding this comment

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

I'm probably missing this, but why do we have to do a comparison on all the fields again? Doesn't the group part handle that?

and exists
(select 1 from encounter e2 where e2.patient_id in
(select patient_id from temp_potential_dups_patient_ids d2 where d2.group_id = d.group_id)
and e2.encounter_type <> @regEncounterType
Copy link
Member

Choose a reason for hiding this comment

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

I'm probably missing this, but do you need to confirm that e2.patient is not equalt to e.patient? Or I guess it's the fact that the two clauses can never be both true for the same patient?

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.

2 participants