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

ETL for Orthopaedic form #488

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

gabriel090
Copy link
Contributor

Create ETL for Orthopaedic Technology (Prosthetics and Orthotics) Register MOH 420

@gabriel090 gabriel090 requested a review from njorocs November 27, 2024 05:45
Copy link
Contributor

@njorocs njorocs left a 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")
Copy link
Contributor

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),
Copy link
Contributor

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,
Copy link
Contributor

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),
Copy link
Contributor

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,
Copy link
Contributor

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),
Copy link
Contributor

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,
Copy link
Contributor

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

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