-
Notifications
You must be signed in to change notification settings - Fork 30
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
ETL for Orthopaedic form #488
base: master
Are you sure you want to change the base?
Conversation
1d4b663
to
81b721b
Compare
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.
Pleae address the issues
e.voided as voided | ||
from encounter e | ||
inner join person p on p.person_id=e.patient_id and p.voided=0 | ||
inner join form f on f.form_id=e.form_id and f.uuid in ("beec83df-6606-4019-8223-05a54a52f2b0") |
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.
use "=" instead of in for single value comparison
date_created DATETIME NOT NULL, | ||
date_last_modified DATETIME, | ||
visit_type INT(11), | ||
referral_form INT(11), |
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.
check typo
e.date_created as date_created, | ||
max(if(o.concept_id=164181,trim(o.value_coded),null)) as visit_type, | ||
max(if(o.concept_id=161643,trim(o.value_coded),null)) as referral_form, | ||
max(if(o.concept_id=160632,o.value_text,null)) as other_facility_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.
This concept is repeated in the form multiple times. Using it here may report the wrong data
musculoskeletal_system_conditions_other VARCHAR(255), | ||
musculoskeletal_examination_findings VARCHAR(255), | ||
musculoskeletal_findings INT(11), | ||
musculoskeletal_findings VARCHAR(255), | ||
musculoskeletal_findings_other VARCHAR(255), | ||
joint_assessed VARCHAR(255), | ||
joint_movement INT(11), |
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.
Data type mismatch between ddl and dml
max(if(o.concept_id = 164936 and o.value_coded = 135412, 'Anterior/posterior angulation',NULL)), | ||
max(if(o.concept_id = 164936 and o.value_coded = 134186, 'Garden spade deformity',NULL)), | ||
max(if(o.concept_id = 164936 and o.value_coded = 116472, 'Kyphosis',NULL)), | ||
max(if(o.concept_id = 164936 and o.value_coded = 5622, 'Others',NULL))) as musculoskeletal_findings, | ||
max(if(o.concept_id=160632,o.value_text,null)) as musculoskeletal_findings_other, | ||
max(if(o.concept_id=165285,o.value_coded,null)) as joint_assessed, | ||
max(if(o.concept_id=165139,o.value_coded,null)) as joint_movement, |
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.
Handle multi-select
musculoskeletal_system_conditions_other VARCHAR(255), | ||
musculoskeletal_examination_findings VARCHAR(255), | ||
musculoskeletal_findings INT(11), | ||
musculoskeletal_findings VARCHAR(255), | ||
musculoskeletal_findings_other VARCHAR(255), | ||
joint_assessed VARCHAR(255), | ||
joint_movement INT(11), |
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.
This won't handle multi-select. Check data type.
max(if(o.concept_id = 164936 and o.value_coded = 135412, 'Anterior/posterior angulation',NULL)), | ||
max(if(o.concept_id = 164936 and o.value_coded = 134186, 'Garden spade deformity',NULL)), | ||
max(if(o.concept_id = 164936 and o.value_coded = 116472, 'Kyphosis',NULL)), | ||
max(if(o.concept_id = 164936 and o.value_coded = 5622, 'Others',NULL))) as musculoskeletal_findings, | ||
max(if(o.concept_id=160632,o.value_text,null)) as musculoskeletal_findings_other, |
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.
Same concept used for musculoskeletal_examination_findings above
Create ETL for Orthopaedic Technology (Prosthetics and Orthotics) Register MOH 420