Skip to content

Commit

Permalink
add default units: consider valid measure units only
Browse files Browse the repository at this point in the history
  • Loading branch information
marceloarocha committed Nov 7, 2023
1 parent 2c56e01 commit 2335a38
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions services/admin/drug_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def get_drug_list(
):
SegmentOutlier = db.aliased(Segment)
ConversionsAgg = db.aliased(MeasureUnitConvert)
MeasureUnitAgg = db.aliased(MeasureUnit)

presc_query = (
db.session.query(
Expand All @@ -39,6 +40,10 @@ def get_drug_list(
PrescriptionAgg.idSegment.label("idSegment"),
)
.select_from(PrescriptionAgg)
.join(
MeasureUnitAgg,
PrescriptionAgg.idMeasureUnit == MeasureUnitAgg.id,
)
.outerjoin(
ConversionsAgg,
and_(
Expand Down

0 comments on commit 2335a38

Please sign in to comment.