-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat(medication): EPI-1083: Extend drugs reference data #7047
feat(medication): EPI-1083: Extend drugs reference data #7047
Conversation
EPI-1083 Extend drugs reference data
Brief DescriptionThis card tracks updates required for reference data type Requirements:
Testing note:
Refinement points (DD/MM/YY): Questions: Complexities/Unknowns: Easy wins: Testing: |
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.
Nice on @khoi-bes, pretty clean - just a couple of small things
{ | ||
id: primaryKey, | ||
referenceDataId: { | ||
type: DataTypes.INTEGER, |
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.
Shouldn't this be TEXT
or UUID
?
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.
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.
ah right, my mistake
packages/database/src/migrations/1736614067055-addReferenceDrugsTable.js
Outdated
Show resolved
Hide resolved
@@ -421,3 +421,29 @@ export async function taskTemplateLoader(item, { models, pushError }) { | |||
|
|||
return rows; | |||
} | |||
|
|||
export async function drugLoader(item, { models }) { |
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.
Have you tested this works for a drug that isn't already in reference_data
? It doesn't seem like it will be added to the parent table, but I might be missing something.
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.
yes I tested this, we did the same thing on "Tasking" before
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.
Oh cool, thanks
…gsTable.js Co-authored-by: Edwin Monk-Fromont <edwin.monkfromont@gmail.com>
…yondessential/tamanu into feature/epi-1083-extend-drugs-reference-data
@@ -15,7 +15,7 @@ export class ReferenceDrug extends Model { | |||
{ | |||
id: primaryKey, | |||
referenceDataId: { | |||
type: DataTypes.INTEGER, | |||
type: DataTypes.TEXT, |
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.
We actually use DataTypes.STRING
in the migration. Is there a reason the two are different?
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.
I'm sorry, that was clearly my mistake, I was confused myself when reading the feedback
1a3ec9d
into
epic-medication-enhancements-and-mar
* feat(medication): EPI-1083: Extend drugs reference data * refactor(migrations): Remove unused drug reference data insertion logic * feat(migrations): Add bulk insert for reference drugs from reference data * feat(migrations): Add conditional check for bulk insert of reference drugs * fix(migrations): Update conditional check for bulk insert of reference drugs * add docs for models * Update packages/database/src/migrations/1736614067055-addReferenceDrugsTable.js Co-authored-by: Edwin Monk-Fromont <edwin.monkfromont@gmail.com> * address feedbacks * address feedback * fix dbt models --------- Co-authored-by: Edwin Monk-Fromont <edwin.monkfromont@gmail.com>
* feat(medication): EPI-1083: Extend drugs reference data * refactor(migrations): Remove unused drug reference data insertion logic * feat(migrations): Add bulk insert for reference drugs from reference data * feat(migrations): Add conditional check for bulk insert of reference drugs * fix(migrations): Update conditional check for bulk insert of reference drugs * add docs for models * Update packages/database/src/migrations/1736614067055-addReferenceDrugsTable.js Co-authored-by: Edwin Monk-Fromont <edwin.monkfromont@gmail.com> * address feedbacks * address feedback * fix dbt models --------- Co-authored-by: Edwin Monk-Fromont <edwin.monkfromont@gmail.com>
* feat(medication): EPI-1083: Extend drugs reference data * refactor(migrations): Remove unused drug reference data insertion logic * feat(migrations): Add bulk insert for reference drugs from reference data * feat(migrations): Add conditional check for bulk insert of reference drugs * fix(migrations): Update conditional check for bulk insert of reference drugs * add docs for models * Update packages/database/src/migrations/1736614067055-addReferenceDrugsTable.js Co-authored-by: Edwin Monk-Fromont <edwin.monkfromont@gmail.com> * address feedbacks * address feedback * fix dbt models --------- Co-authored-by: Edwin Monk-Fromont <edwin.monkfromont@gmail.com>
Changes
reference_drugs
that includes additional information from referenceData of the type "drug".Deploys
Remember to...