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

Added medicine_administration field #1025

Merged
merged 2 commits into from
Sep 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions care/facility/migrations/0318_merge_20220917_2113.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Generated by Django 2.2.11 on 2022-09-17 15:43

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('facility', '0317_merge_20220915_2209'),
('facility', '0315_auto_20220909_0925'),
]

operations = [
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Generated by Django 2.2.11 on 2022-09-17 16:03

import django.contrib.postgres.fields.jsonb
from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('facility', '0318_merge_20220917_2113'),
]

operations = [
migrations.AddField(
model_name='dailyround',
name='medicine_administration',
field=django.contrib.postgres.fields.jsonb.JSONField(default=list),
),
]
4 changes: 4 additions & 0 deletions care/facility/models/daily_round.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,10 @@ class InsulinIntakeFrequencyType(enum.Enum):
default=list, validators=[JSONFieldSchemaValidator(NURSING_PROCEDURE)]
)

medicine_administration = JSONField(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we have a JSON schema for this as well? having a schemaless field might get hard for standardization at some point.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The JSON schema for this is going to be very complex. It has still not been finalized. Once it will, I will add the schema in the backend as another PR.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okays, make an issue and tag it here even if this PR is merged

default=list,
)

meta = JSONField(default=dict, validators=[JSONFieldSchemaValidator(META)])

def cztn(self, value):
Expand Down
4 changes: 2 additions & 2 deletions care/facility/models/json_schema/daily_round.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"items": [
{
"type": "object",
"properties": {"name": {"type": "string"}, "quantity": {"type": "number"},},
"properties": {"name": {"type": "string"}, "quantity": {"type": "number"}, },
"additionalProperties": False,
"required": ["name", "quantity"],
}
Expand Down Expand Up @@ -63,7 +63,7 @@
"items": [
{
"type": "object",
"properties": {"name": {"type": "string"}, "quantity": {"type": "number"},},
"properties": {"name": {"type": "string"}, "quantity": {"type": "number"}, },
"additionalProperties": False,
"required": ["name", "quantity"],
}
Expand Down