Skip to content

Commit

Permalink
add now as default for authored datetime
Browse files Browse the repository at this point in the history
  • Loading branch information
sainak committed Jan 22, 2025
1 parent b547baa commit b842e69
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion care/emr/migrations/0009_medicationrequest_authored_on.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Generated by Django 5.1.4 on 2025-01-21 11:15

import django.utils.timezone
from django.db import migrations, models


Expand All @@ -13,6 +14,6 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='medicationrequest',
name='authored_on',
field=models.DateTimeField(blank=True, default=None, null=True),
field=models.DateTimeField(blank=True, default=django.utils.timezone.now, null=True),
),
]
3 changes: 2 additions & 1 deletion care/emr/models/medication_request.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from django.db import models
from django.utils import timezone

from care.emr.models.base import EMRBaseModel

Expand All @@ -16,4 +17,4 @@ class MedicationRequest(EMRBaseModel):
encounter = models.ForeignKey("emr.Encounter", on_delete=models.CASCADE)
dosage_instruction = models.JSONField(default=list, null=True, blank=True)
note = models.TextField(null=True, blank=True)
authored_on = models.DateTimeField(null=True, blank=True, default=None)
authored_on = models.DateTimeField(null=True, blank=True, default=timezone.now)

0 comments on commit b842e69

Please sign in to comment.