diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 2ded6152..cbd6436c 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -592,6 +592,7 @@ const Map> localizedValues = { 'allergicTO': {'en': "ALLERGIC TO ", 'ar': " حساس من"}, 'normal': {'en': "Normal", 'ar': "عادي"}, 'abnormal': {'en': "Abnormal", 'ar': " غير عادي"}, + 'notExamined': {'en': "Not Examined", 'ar': "لم يتم الفحص"}, "systolic-lng": {"en": "Systolic", "ar": "الإنقباض"}, "diastolic-lng": {"en": "Diastolic", "ar": "الإنبساط"}, "mass": {"en": "Mass", "ar": "كتلة"}, diff --git a/lib/models/SOAP/GetPhysicalExamListResModel.dart b/lib/models/SOAP/GetPhysicalExamListResModel.dart index f9b2f44f..c97189b1 100644 --- a/lib/models/SOAP/GetPhysicalExamListResModel.dart +++ b/lib/models/SOAP/GetPhysicalExamListResModel.dart @@ -1,13 +1,19 @@ class GetPhysicalExamResModel { int appointmentNo; int createdBy; + String createdByName; String createdOn; - int editedBy; + Null editedBy; + String editedByName; String editedOn; int episodeId; int examId; + String examName; int examType; + int examinationType; + String examinationTypeName; bool isAbnormal; + bool isNew; bool isNormal; bool notExamined; int patientMRN; @@ -16,13 +22,19 @@ class GetPhysicalExamResModel { GetPhysicalExamResModel( {this.appointmentNo, this.createdBy, + this.createdByName, this.createdOn, this.editedBy, + this.editedByName, this.editedOn, this.episodeId, this.examId, + this.examName, this.examType, + this.examinationType, + this.examinationTypeName, this.isAbnormal, + this.isNew, this.isNormal, this.notExamined, this.patientMRN, @@ -31,13 +43,19 @@ class GetPhysicalExamResModel { GetPhysicalExamResModel.fromJson(Map json) { appointmentNo = json['appointmentNo']; createdBy = json['createdBy']; + createdByName = json['createdByName']; createdOn = json['createdOn']; editedBy = json['editedBy']; + editedByName = json['editedByName']; editedOn = json['editedOn']; episodeId = json['episodeId']; examId = json['examId']; + examName = json['examName']; examType = json['examType']; + examinationType = json['examinationType']; + examinationTypeName = json['examinationTypeName']; isAbnormal = json['isAbnormal']; + isNew = json['isNew']; isNormal = json['isNormal']; notExamined = json['notExamined']; patientMRN = json['patientMRN']; @@ -48,13 +66,19 @@ class GetPhysicalExamResModel { final Map data = new Map(); data['appointmentNo'] = this.appointmentNo; data['createdBy'] = this.createdBy; + data['createdByName'] = this.createdByName; data['createdOn'] = this.createdOn; data['editedBy'] = this.editedBy; + data['editedByName'] = this.editedByName; data['editedOn'] = this.editedOn; data['episodeId'] = this.episodeId; data['examId'] = this.examId; + data['examName'] = this.examName; data['examType'] = this.examType; + data['examinationType'] = this.examinationType; + data['examinationTypeName'] = this.examinationTypeName; data['isAbnormal'] = this.isAbnormal; + data['isNew'] = this.isNew; data['isNormal'] = this.isNormal; data['notExamined'] = this.notExamined; data['patientMRN'] = this.patientMRN; diff --git a/lib/models/SOAP/my_selected_examination.dart b/lib/models/SOAP/my_selected_examination.dart index 5a717a4e..d2946f29 100644 --- a/lib/models/SOAP/my_selected_examination.dart +++ b/lib/models/SOAP/my_selected_examination.dart @@ -5,6 +5,8 @@ class MySelectedExamination { String remark; bool isNormal; bool isAbnormal; + bool notExamined; + bool isNew; int createdBy; MySelectedExamination( @@ -12,6 +14,8 @@ class MySelectedExamination { this.remark, this.isNormal = true, this.isAbnormal = false, + this.notExamined = false, + this.isNew = true, this.createdBy}); MySelectedExamination.fromJson(Map json) { @@ -19,8 +23,10 @@ class MySelectedExamination { ? new MasterKeyModel.fromJson(json['selectedExamination']) : null; remark = json['remark']; - remark = json['isNormal']; - remark = json['isAbnormal']; + isNormal = json['isNormal']; + isAbnormal = json['isAbnormal']; + notExamined = json['notExamined']; + isNew = json['isNew']; createdBy = json['createdBy']; } @@ -33,6 +39,8 @@ class MySelectedExamination { data['remark'] = this.remark; data['isNormal'] = this.isNormal; data['isAbnormal'] = this.isAbnormal; + data['notExamined'] = this.notExamined; + data['isNew'] = this.isNew; data['createdBy'] = this.createdBy; return data; } diff --git a/lib/models/SOAP/post_physical_exam_request_model.dart b/lib/models/SOAP/post_physical_exam_request_model.dart index 46a104f1..d1b64837 100644 --- a/lib/models/SOAP/post_physical_exam_request_model.dart +++ b/lib/models/SOAP/post_physical_exam_request_model.dart @@ -25,75 +25,91 @@ class PostPhysicalExamRequestModel { } } -class ListHisProgNotePhysicalExaminationVM { - int episodeId; - int appointmentNo; - int examType; - int examId; - int patientMRN; - bool isNormal; - bool isAbnormal; - String remarks; - int createdBy; - String createdOn; - int editedBy; - String editedOn; - bool notExamined; - MasterKeyModel masterDescription; + class ListHisProgNotePhysicalExaminationVM { + int episodeId; + int appointmentNo; + int examType; + int examId; + int patientMRN; + bool isNormal; + bool isAbnormal; + bool notExamined; + String examName; + String examinationTypeName; + int examinationType; + String remarks; + bool isNew; + int createdBy; + String createdOn; + String createdByName; + int editedBy; + String editedOn; + String editedByName; - ListHisProgNotePhysicalExaminationVM( - {this.episodeId, - this.appointmentNo, - this.examType, - this.examId, - this.patientMRN, - this.isNormal, - this.isAbnormal, - this.remarks, - this.createdBy, - this.createdOn, - this.editedBy, - this.editedOn, - this.notExamined, - this.masterDescription}); + ListHisProgNotePhysicalExaminationVM( + {this.episodeId, + this.appointmentNo, + this.examType, + this.examId, + this.patientMRN, + this.isNormal, + this.isAbnormal, + this.notExamined, + this.examName, + this.examinationTypeName, + this.examinationType, + this.remarks, + this.isNew, + this.createdBy, + this.createdOn, + this.createdByName, + this.editedBy, + this.editedOn, + this.editedByName}); - ListHisProgNotePhysicalExaminationVM.fromJson(Map json) { - episodeId = json['episodeId']; - appointmentNo = json['appointmentNo']; - examType = json['examType']; - examId = json['examId']; - patientMRN = json['patientMRN']; - isNormal = json['isNormal']; - isAbnormal = json['isAbnormal']; - remarks = json['remarks']; - createdBy = json['createdBy']; - createdOn = json['createdOn']; - editedBy = json['editedBy']; - editedOn = json['editedOn']; - notExamined = json['notExamined']; - masterDescription = json['masterDescription'] != null - ? new MasterKeyModel.fromJson(json['masterDescription']) - : null; - } + ListHisProgNotePhysicalExaminationVM.fromJson(Map json) { + episodeId = json['episodeId']; + appointmentNo = json['appointmentNo']; + examType = json['examType']; + examId = json['examId']; + patientMRN = json['patientMRN']; + isNormal = json['isNormal']; + isAbnormal = json['isAbnormal']; + notExamined = json['notExamined']; + examName = json['examName']; + examinationTypeName = json['examinationTypeName']; + examinationType = json['examinationType']; + remarks = json['remarks']; + isNew = json['isNew']; + createdBy = json['createdBy']; + createdOn = json['createdOn']; + createdByName = json['createdByName']; + editedBy = json['editedBy']; + editedOn = json['editedOn']; + editedByName = json['editedByName']; + } - Map toJson() { - final Map data = new Map(); - data['episodeId'] = this.episodeId; - data['appointmentNo'] = this.appointmentNo; - data['examType'] = this.examType; - data['examId'] = this.examId; - data['patientMRN'] = this.patientMRN; - data['isNormal'] = this.isNormal; - data['isAbnormal'] = this.isAbnormal; - data['remarks'] = this.remarks; - data['createdBy'] = this.createdBy; - data['createdOn'] = this.createdOn; - data['editedBy'] = this.editedBy; - data['editedOn'] = this.editedOn; - data['notExamined'] = this.notExamined; - if (this.masterDescription != null) { - data['masterDescription'] = this.masterDescription.toJson(); + Map toJson() { + final Map data = new Map(); + data['episodeId'] = this.episodeId; + data['appointmentNo'] = this.appointmentNo; + data['examType'] = this.examType; + data['examId'] = this.examId; + data['patientMRN'] = this.patientMRN; + data['isNormal'] = this.isNormal; + data['isAbnormal'] = this.isAbnormal; + data['notExamined'] = this.notExamined; + data['examName'] = this.examName; + data['examinationTypeName'] = this.examinationTypeName; + data['examinationType'] = this.examinationType; + data['remarks'] = this.remarks; + data['isNew'] = this.isNew; + data['createdBy'] = this.createdBy; + data['createdOn'] = this.createdOn; + data['createdByName'] = this.createdByName; + data['editedBy'] = this.editedBy; + data['editedOn'] = this.editedOn; + data['editedByName'] = this.editedByName; + return data; } - return data; } -} \ No newline at end of file diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index c192d7b9..a3c058a8 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -940,6 +940,7 @@ class TranslationBase { String get allergicTO => localizedValues['allergicTO'][locale.languageCode]; String get normal => localizedValues['normal'][locale.languageCode]; + String get notExamined => localizedValues['notExamined'][locale.languageCode]; String get abnormal => localizedValues['abnormal'][locale.languageCode]; diff --git a/lib/widgets/patients/profile/soap_update/update_objective_page.dart b/lib/widgets/patients/profile/soap_update/update_objective_page.dart index 93182207..af960ff7 100644 --- a/lib/widgets/patients/profile/soap_update/update_objective_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_objective_page.dart @@ -85,6 +85,8 @@ class _UpdateObjectivePageState extends State { remark: element.remarks, isNormal: element.isNormal, createdBy: element.createdBy, + notExamined: element.notExamined, + isNew: element.isNew, isAbnormal: element.isAbnormal); widget.mySelectedExamination.add(tempEam); }); @@ -243,9 +245,10 @@ class _UpdateObjectivePageState extends State { onTap: () { setState(() { examination.isAbnormal = - !examination.isAbnormal; + false; examination.isNormal = - !examination.isNormal; + true; + examination.notExamined = false; }); }), SizedBox( @@ -290,12 +293,63 @@ class _UpdateObjectivePageState extends State { ), )), ), + onTap: () { + setState(() { + examination.isNormal = + false; + examination.isAbnormal = + true; + examination.notExamined = false; + }); + }),SizedBox( + width: 12, + ), + InkWell( + child: Center( + child: Container( + height: + screenSize.height * + 0.070, + decoration: + containerBorderDecoration( + examination + .notExamined + ? Color( + 0xFF515A5D) + : Colors + .white, + Colors.black), + child: Center( + child: Padding( + padding: + const EdgeInsets + .all(8.0), + child: Text( + "Not Examined", + style: TextStyle( + fontSize: 12, + color: + examination + .notExamined + ? Colors.white + : Colors + .black, + //Colors.black, + fontWeight: + FontWeight + .bold, + ), + ), + ), + )), + ), onTap: () { setState(() { examination.isAbnormal = - !examination.isAbnormal; + false; examination.isNormal = - !examination.isNormal; + false; + examination.notExamined = true; }); }), ], @@ -394,13 +448,17 @@ class _UpdateObjectivePageState extends State { examType: exam.selectedExamination.typeId, isAbnormal: exam.isAbnormal, isNormal: exam.isNormal, - masterDescription: exam.selectedExamination, - notExamined: false + // masterDescription: exam.selectedExamination, + notExamined: exam.notExamined, + examinationType: exam.isNormal?1:exam.isAbnormal?2:3, + examinationTypeName: exam.isNormal?"Normal":exam.isAbnormal?'AbNormal':"Not Examined", + isNew:exam.isNew )); }); if(model.patientPhysicalExamList.isEmpty) { + await model.postPhysicalExam(postPhysicalExamRequestModel); } else { await model.patchPhysicalExam(postPhysicalExamRequestModel);