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

Consultation JSON Schema: added parameter for storing information about Other type choice. #622

Merged
merged 2 commits into from
Oct 11, 2021
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
20 changes: 20 additions & 0 deletions care/facility/migrations/0275_auto_20210920_1811.py
Original file line number Diff line number Diff line change
@@ -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'})]),
),
]
1 change: 1 addition & 0 deletions care/facility/models/json_schema/consultation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down