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 Nutrition report register for 407A and 407B #486

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

Conversation

gabriel090
Copy link
Contributor

No description provided.

@gabriel090 gabriel090 requested a review from njorocs November 18, 2024 05:47
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.

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

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

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

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

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

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

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

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

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

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

@njorocs njorocs Nov 26, 2024

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?

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