-
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 Nutrition report register for 407A and 407B #486
base: master
Are you sure you want to change the base?
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.
You missed to etl diagnosis.
Address the issues raised. note that they apply to all dmls and scheduled updates, even though I raised them in dwapi_dml.
e.encounter_id as encounter_id, | ||
e.creator, | ||
e.date_created as date_created, | ||
max(if(o.concept_id=164181,trim(o.value_coded),null)) as visit_type, |
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.
remove all trim() from value_coded
e.creator, | ||
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=160632,trim(o.value_text),null)) as 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.
Use a more intuitive variable/column name. Which facility name is this?
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=160632,trim(o.value_text),null)) as facility_name, | ||
max(if(o.concept_id=5272,trim(o.value_coded),null)) as patient_pregnant, |
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.
what about lactating?
max(if(o.concept_id=160632,trim(o.value_text),null)) as medication_condition_other, | ||
max(if(o.concept_id=163894,trim(o.value_coded),null)) as patient_has_edema, | ||
max(if(o.concept_id=156625,trim(o.value_coded),null)) as anaemia_level, | ||
max(if(o.concept_id=163304,trim(o.value_coded),null)) as metabolic_disorders, |
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 being a multi-select, how do you handle multiple disorders?
max(if(o.concept_id=156625,trim(o.value_coded),null)) as anaemia_level, | ||
max(if(o.concept_id=163304,trim(o.value_coded),null)) as metabolic_disorders, | ||
max(if(o.concept_id=160205,trim(o.value_coded),null)) as patient_sam_mam, | ||
max(if(o.concept_id=162696,trim(o.value_coded),null)) as nutritional_intervention, |
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 column name is not matching the question on the form.
max(if(o.concept_id=168734,trim(o.value_coded),null)) as postnatal, | ||
max(if(o.concept_id=163300,trim(o.value_coded),null)) as maternal_nutrition, | ||
max(if(o.concept_id=161005,trim(o.value_coded),null)) as critical_nutrition_practices, | ||
max(if(o.concept_id=161648,trim(o.value_coded),null)) as therapeutic_food, |
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 possible multiple values
max(if(o.concept_id=161005,trim(o.value_coded),null)) as critical_nutrition_practices, | ||
max(if(o.concept_id=161648,trim(o.value_coded),null)) as therapeutic_food, | ||
max(if(o.concept_id=160632,trim(o.value_text),null)) as therapeutic_food_other, | ||
max(if(o.concept_id=159854,trim(o.value_coded),null)) as supplemental_food, |
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 possible multiple values
max(if(o.concept_id=160632,trim(o.value_text),null)) as therapeutic_food_other, | ||
max(if(o.concept_id=159854,trim(o.value_coded),null)) as supplemental_food, | ||
max(if(o.concept_id=160632,trim(o.value_text),null)) as supplemental_food_other, | ||
max(if(o.concept_id=5484,trim(o.value_coded),null)) as micronutrients, |
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 possible multiple values
max(if(o.concept_id=1788,trim(o.value_coded),null)) as referral_status, | ||
max(if(o.concept_id=167381,trim(o.value_coded),null)) as criteria_for_admission, | ||
max(if(o.concept_id=162477,trim(o.value_coded),null)) as type_of_admission, | ||
max(if(o.concept_id=5096,o.value_datetime,null)) as next_appointment_date, |
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 is handled by appointment module. check on the form. You need to make sure the service is included in the appointment etl.
max(if(o.concept_id=5096,o.value_datetime,null)) as next_appointment_date, | ||
max(if(o.concept_id=5619,trim(o.value_coded),null)) as cadre, | ||
max(if(o.concept_id=160632,trim(o.value_text),null)) as cadre_other, | ||
max(if(o.concept_id=1473,o.value_text,null)) as provider_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.
How does this work? Is this concept/variable in the form?
5ccc8c9
to
53c4f1e
Compare
No description provided.