From e37e98a3087789e6fe68eeddb707eb8dd0619c03 Mon Sep 17 00:00:00 2001 From: Apurva Date: Mon, 20 Sep 2021 18:15:12 +0530 Subject: [PATCH] added new field to consultation json schema for storing other type information --- .../migrations/0275_auto_20210920_1811.py | 20 +++++++++++++++++++ .../models/json_schema/consultation.py | 1 + 2 files changed, 21 insertions(+) create mode 100644 care/facility/migrations/0275_auto_20210920_1811.py diff --git a/care/facility/migrations/0275_auto_20210920_1811.py b/care/facility/migrations/0275_auto_20210920_1811.py new file mode 100644 index 0000000000..50ffedad34 --- /dev/null +++ b/care/facility/migrations/0275_auto_20210920_1811.py @@ -0,0 +1,20 @@ +# Generated by Django 2.2.11 on 2021-09-20 12:41 + +import care.utils.models.validators +import django.contrib.postgres.fields.jsonb +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('facility', '0274_auto_20210910_1647'), + ] + + operations = [ + migrations.AlterField( + model_name='patientconsultation', + name='lines', + field=django.contrib.postgres.fields.jsonb.JSONField(default=list, validators=[care.utils.models.validators.JSONFieldSchemaValidator({'$schema': 'http://json-schema.org/draft-07/schema#', 'items': [{'additionalProperties': False, 'properties': {'other_type': {'type': 'string'}, 'site': {'type': 'string'}, 'start_date': {'pattern': '^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2}(?:\\.\\d*)?)((-(\\d{2}):(\\d{2})|Z)?)$', 'type': 'string'}, 'type': {'type': 'string'}}, 'required': ['start_date', 'type', 'site'], 'type': 'object'}], 'type': 'array'})]), + ), + ] diff --git a/care/facility/models/json_schema/consultation.py b/care/facility/models/json_schema/consultation.py index c4d9054eee..95caa25db4 100644 --- a/care/facility/models/json_schema/consultation.py +++ b/care/facility/models/json_schema/consultation.py @@ -10,6 +10,7 @@ "start_date": {"type": "string", "pattern": DATETIME_REGEX}, "type": {"type": "string"}, "site": {"type": "string"}, + "other_type": {"type": "string"}, }, "additionalProperties": False, "required": ["start_date", "type", "site"],