From 3598c9a277929aded7afe9a12182f68565c08346 Mon Sep 17 00:00:00 2001 From: rithviknishad Date: Thu, 22 Aug 2024 15:38:04 +0530 Subject: [PATCH] Update JSON Schema validations for I/O Balance fields --- .../models/json_schema/daily_round.py | 31 ++++++++++++++++--- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/care/facility/models/json_schema/daily_round.py b/care/facility/models/json_schema/daily_round.py index 2ae76ff9a4..70cab4d589 100644 --- a/care/facility/models/json_schema/daily_round.py +++ b/care/facility/models/json_schema/daily_round.py @@ -16,7 +16,16 @@ { "type": "object", "properties": { - "name": {"type": "string"}, + "name": { + "type": "string", + "enum": [ + "Adrenalin", + "Nor-adrenalin", + "Vasopressin", + "Dopamine", + "Dobutamine", + ], + }, "quantity": {"type": "number"}, "concentration": {"type": "number"}, "conc_unit": {"type": "string"}, @@ -34,7 +43,10 @@ { "type": "object", "properties": { - "name": {"type": "string"}, + "name": { + "type": "string", + "enum": ["RL", "NS", "DNS"], + }, "quantity": {"type": "number"}, }, "additionalProperties": False, @@ -50,7 +62,10 @@ { "type": "object", "properties": { - "name": {"type": "string"}, + "name": { + "type": "string", + "enum": ["Ryles Tube", "Normal Feed"], + }, "quantity": {"type": "number"}, "calories": {"type": "number"}, }, @@ -67,7 +82,15 @@ { "type": "object", "properties": { - "name": {"type": "string"}, + "name": { + "type": "string", + "enum": [ + "Urine", + "Ryles Tube Aspiration", + "ICD", + "Abdominal Drain", + ], + }, "quantity": {"type": "number"}, }, "additionalProperties": False,