-
Notifications
You must be signed in to change notification settings - Fork 5
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
base: master
Are you sure you want to change the base?
SL-816 Duplicate registrations caused by system error #559
Conversation
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.
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' ; |
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.
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; |
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'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 |
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'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?
No description provided.