-
Notifications
You must be signed in to change notification settings - Fork 336
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
Loading medibase and icd11 static json and migrations #1941
Conversation
update_fields=[ | ||
"created_date", | ||
"modified_date", | ||
"deleted", |
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.
"deleted", |
@@ -24,6 +24,7 @@ def handle(self, *args, **options): | |||
MedibaseMedicine.objects.bulk_create( |
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.
add a check to fallback to bulk create only if there are no medicines in the db to speed up the process
data = json.load(f) | ||
|
||
for medicine in data: | ||
m = MedibaseMedicine.objects.get(name=medicine["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.
create in case of DoesNotExists error
# Conflicts: # data/medibase.json
@sainak either complete or close this MR. |
Proposed Changes
1.Updated medibase.json
2.Updated
MedibaseMedicine
model , removed external_id3.Updated
python manage.py load_redis_index
command to directly use the json to populate the redis4.Migrate all related models to use id as fk instead of external_id
Associated Issue
Merge Checklist
Only PR's with test cases included and passing lint and test pipelines will be reviewed
@coronasafe/care-backend-maintainers @coronasafe/care-backend-admins