From 29de472c66d3a6d3b27173a3a11527030b49abfb Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Sat, 30 Jan 2021 00:11:57 +0200 Subject: [PATCH] bug fix --- lib/core/model/medical_file_model.dart | 75 ++++++++++++++++++- .../medical-file/medical_file_details.dart | 30 ++++---- .../prescription/prescription_screen.dart | 9 ++- 3 files changed, 98 insertions(+), 16 deletions(-) diff --git a/lib/core/model/medical_file_model.dart b/lib/core/model/medical_file_model.dart index 4e9d8f3e..f2b4ce3c 100644 --- a/lib/core/model/medical_file_model.dart +++ b/lib/core/model/medical_file_model.dart @@ -169,6 +169,7 @@ class Consulations { List lstPhysicalExam; List lstProcedure; List lstMedicalHistory; + List lstCheifComplaint; Consulations( {this.admissionNo, @@ -194,7 +195,8 @@ class Consulations { this.lstAssessments, this.lstPhysicalExam, this.lstProcedure, - this.lstMedicalHistory}); + this.lstMedicalHistory, + this.lstCheifComplaint}); Consulations.fromJson(Map json) { admissionNo = json['AdmissionNo']; @@ -223,6 +225,12 @@ class Consulations { lstAssessments.add(new LstAssessments.fromJson(v)); }); } + if (json['lstCheifComplaint'] != null) { + lstCheifComplaint = new List(); + json['lstCheifComplaint'].forEach((v) { + lstCheifComplaint.add(new LstCheifComplaint.fromJson(v)); + }); + } if (json['lstPhysicalExam'] != null) { lstPhysicalExam = new List(); json['lstPhysicalExam'].forEach((v) { @@ -269,6 +277,10 @@ class Consulations { data['lstAssessments'] = this.lstAssessments.map((v) => v.toJson()).toList(); } + if (this.lstCheifComplaint != null) { + data['lstCheifComplaint'] = + this.lstCheifComplaint.map((v) => v.toJson()).toList(); + } if (this.lstPhysicalExam != null) { data['lstPhysicalExam'] = this.lstPhysicalExam.map((v) => v.toJson()).toList(); @@ -284,6 +296,67 @@ class Consulations { } } +class LstCheifComplaint { + int appointmentNo; + String cCDate; + String chiefComplaint; + String currentMedication; + int episodeID; + String hOPI; + int patientID; + String patientType; + int projectID; + String projectName; + String setupID; + String dispalyName; + + LstCheifComplaint( + {this.appointmentNo, + this.cCDate, + this.chiefComplaint, + this.currentMedication, + this.episodeID, + this.hOPI, + this.patientID, + this.patientType, + this.projectID, + this.projectName, + this.setupID, + this.dispalyName}); + + LstCheifComplaint.fromJson(Map json) { + appointmentNo = json['AppointmentNo']; + cCDate = json['CCDate']; + chiefComplaint = json['ChiefComplaint']; + currentMedication = json['CurrentMedication']; + episodeID = json['EpisodeID']; + hOPI = json['HOPI']; + patientID = json['PatientID']; + patientType = json['PatientType']; + projectID = json['ProjectID']; + projectName = json['ProjectName']; + setupID = json['SetupID']; + dispalyName = json['dispalyName']; + } + + Map toJson() { + final Map data = new Map(); + data['AppointmentNo'] = this.appointmentNo; + data['CCDate'] = this.cCDate; + data['ChiefComplaint'] = this.chiefComplaint; + data['CurrentMedication'] = this.currentMedication; + data['EpisodeID'] = this.episodeID; + data['HOPI'] = this.hOPI; + data['PatientID'] = this.patientID; + data['PatientType'] = this.patientType; + data['ProjectID'] = this.projectID; + data['ProjectName'] = this.projectName; + data['SetupID'] = this.setupID; + data['dispalyName'] = this.dispalyName; + return data; + } +} + class LstAssessments { int appointmentNo; String condition; diff --git a/lib/screens/medical-file/medical_file_details.dart b/lib/screens/medical-file/medical_file_details.dart index f7525391..a148610b 100644 --- a/lib/screens/medical-file/medical_file_details.dart +++ b/lib/screens/medical-file/medical_file_details.dart @@ -188,16 +188,18 @@ class _MedicalFileDetailsState extends State { .consulations .length != 0) - AppText( - model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations[0] - .doctorName - .toUpperCase(), - fontWeight: FontWeight.w700, + Expanded( + child: AppText( + model + .medicalFileList[0] + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .consulations[0] + .doctorName + .toUpperCase(), + fontWeight: FontWeight.w700, + ), ), ], ), @@ -315,7 +317,7 @@ class _MedicalFileDetailsState extends State { .timelines[encounterNumber] .timeLineEvents[0] .consulations[0] - .lstMedicalHistory + .lstCheifComplaint .length, itemBuilder: (BuildContext ctxt, int index) { @@ -338,9 +340,9 @@ class _MedicalFileDetailsState extends State { encounterNumber] .timeLineEvents[0] .consulations[0] - .lstMedicalHistory[ + .lstCheifComplaint[ index] - .history + .hOPI .trim(), ), ), @@ -795,7 +797,7 @@ class _MedicalFileDetailsState extends State { .consulations[0] .lstPhysicalExam[ index] - .examType), + .examDesc), ], ), Row( diff --git a/lib/screens/prescription/prescription_screen.dart b/lib/screens/prescription/prescription_screen.dart index 1f45deb1..cef99164 100644 --- a/lib/screens/prescription/prescription_screen.dart +++ b/lib/screens/prescription/prescription_screen.dart @@ -946,7 +946,7 @@ class _NewPrescriptionScreenState extends State { : null, child: TextField( decoration: textFieldSelectorDecoration( - TranslationBase.of(context).route, + 'Route', route != null ? route['name'] : null, @@ -1181,6 +1181,13 @@ class _NewPrescriptionScreenState extends State { }); } + // String getName(String num) { + // dynamic x = routeList.where((i) { + // return i['id'] == int.parse(num); + // }).first(); + // return x.toString(); + // } + updatePrescription( {PrescriptionViewModel model, int drugId,