From 80691475f2212d79ddf63b922a1c1f76fbc479d8 Mon Sep 17 00:00:00 2001 From: yaso Date: Fri, 29 Nov 2024 11:38:30 +0200 Subject: [PATCH] add icd 10 ibject and api call --- Frontend/lib/mih_objects/icd10_code.dart.dart | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 Frontend/lib/mih_objects/icd10_code.dart.dart diff --git a/Frontend/lib/mih_objects/icd10_code.dart.dart b/Frontend/lib/mih_objects/icd10_code.dart.dart new file mode 100644 index 00000000..dc675090 --- /dev/null +++ b/Frontend/lib/mih_objects/icd10_code.dart.dart @@ -0,0 +1,23 @@ +class ICD10Code { + final String icd10; + final String description; + + const ICD10Code({ + required this.icd10, + required this.description, + }); + + factory ICD10Code.fromJson(Map json) { + return switch (json) { + { + "icd10": String icd10, + 'description': String description, + } => + ICD10Code( + icd10: icd10, + description: description, + ), + _ => throw const FormatException('Failed to load icd10 code object.'), + }; + } +}