From 2f273dcde8cdb9f38a335dd2796ea58c0ac807a3 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Wed, 30 Dec 2020 12:58:13 +0200 Subject: [PATCH] add ICD10 --- lib/models/SOAP/master_key_model.dart | 16 ++++----- lib/routes.dart | 3 ++ .../patients/profile/SOAP/add_SOAP_index.dart | 3 ++ .../profile/SOAP/assessment_page.dart | 20 +++++------ .../SOAP/subjective/subjective_page.dart | 10 ------ .../profile/profile_medical_info_widget.dart | 8 +++++ .../shared/dialogs/master_key_dailog.dart | 35 ++++++++++++------- 7 files changed, 54 insertions(+), 41 deletions(-) diff --git a/lib/models/SOAP/master_key_model.dart b/lib/models/SOAP/master_key_model.dart index 79615f82..a1c32039 100644 --- a/lib/models/SOAP/master_key_model.dart +++ b/lib/models/SOAP/master_key_model.dart @@ -1,18 +1,18 @@ class MasterKeyModel { String alias; String aliasN; - int code; - Null description; - Null detail1; - Null detail2; - Null detail3; - Null detail4; - Null detail5; + dynamic code; + dynamic description; + dynamic detail1; + dynamic detail2; + dynamic detail3; + dynamic detail4; + dynamic detail5; int groupID; int id; String nameAr; String nameEn; - Null remarks; + dynamic remarks; int typeId; String valueList; diff --git a/lib/routes.dart b/lib/routes.dart index 3fbec294..8412f055 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -79,6 +79,7 @@ const String PATIENT_INSURANCE_APPROVALS = 'patients/patient_insurance_approvals'; const String VITAL_SIGN_DETAILS = 'patients/vital-sign-details'; const String CREATE_EPISODE = 'patients/create-episode'; +const String UPDATE_EPISODE = 'patients/create-episode'; const String BODY_MEASUREMENTS = 'patients/body-measurements'; const String IN_PATIENT_PRESCRIPTIONS_DETAILS = 'patients/prescription-details'; @@ -89,6 +90,7 @@ const String ORDER_PROCEDURE = 'procedure/procedure'; // const String LIVECARE_END_DIALOG = 'video-call/EndCallDialogBox'; const String PATIENT_SICKLEAVE = 'patients/patient_sickleave'; const String ADD_SICKLEAVE = 'add-sickleave'; +//todo: change the routing way. var routes = { ROOT: (_) => RootPage(), HOME: (_) => LandingPage(), @@ -122,6 +124,7 @@ var routes = { PATIENT_INSURANCE_APPROVALS: (_) => InsuranceApprovalsScreen(), VITAL_SIGN_DETAILS: (_) => VitalSignDetailsScreen(), CREATE_EPISODE: (_) => AddSOAPIndex(), + UPDATE_EPISODE: (_) => AddSOAPIndex(isUpdate: true,), BODY_MEASUREMENTS: (_) => VitalSignItemDetailsScreen(), IN_PATIENT_PRESCRIPTIONS_DETAILS: (_) => InpatientPrescriptionDetailsScreen(), // VIDEO_CALL: (_) => VideoCallPage(patientData: null), diff --git a/lib/widgets/patients/profile/SOAP/add_SOAP_index.dart b/lib/widgets/patients/profile/SOAP/add_SOAP_index.dart index a6f792c8..e06e8033 100644 --- a/lib/widgets/patients/profile/SOAP/add_SOAP_index.dart +++ b/lib/widgets/patients/profile/SOAP/add_SOAP_index.dart @@ -22,6 +22,9 @@ import '../patient_profile_widget.dart'; import 'steps_widget.dart'; class AddSOAPIndex extends StatefulWidget { + final bool isUpdate; + + const AddSOAPIndex({Key key, this.isUpdate}) : super(key: key); @override _AddSOAPIndexState createState() => _AddSOAPIndexState(); } diff --git a/lib/widgets/patients/profile/SOAP/assessment_page.dart b/lib/widgets/patients/profile/SOAP/assessment_page.dart index 8fa73630..22778913 100644 --- a/lib/widgets/patients/profile/SOAP/assessment_page.dart +++ b/lib/widgets/patients/profile/SOAP/assessment_page.dart @@ -416,10 +416,9 @@ class _AddAssessmentDetailsState extends State { if (model.listOfDiagnosisType.length == 0) { await model.getMasterLookup(MasterKeysService.DiagnosisType); } - // todo return it back when service is fixed. - // if (model.listOfICD10.length == 0) { - // await model.getMasterLookup(MasterKeysService.ICD10); - // } + if (model.listOfICD10.length == 0) { + await model.getMasterLookup(MasterKeysService.ICD10); + } }, builder: (_, model, w) => AppScaffold( @@ -469,13 +468,14 @@ class _AddAssessmentDetailsState extends State { Container( height: screenSize.height * 0.070, child: InkWell( - onTap: model.listOfDiagnosisType != null + onTap: model.listOfICD10 != null ? () { MasterKeyDailog dialog = MasterKeyDailog( - list: model.listOfDiagnosisType, + isICD: true, + list: model.listOfICD10, selectedValue: widget .mySelectedAssessment - .selectedDiagnosisType, + .selectedICD, okText: TranslationBase .of(context) .ok, @@ -483,7 +483,7 @@ class _AddAssessmentDetailsState extends State { (MasterKeyModel selectedValue) { setState(() { widget.mySelectedAssessment - .selectedDiagnosisType = + .selectedICD = selectedValue; }); }, @@ -501,10 +501,10 @@ class _AddAssessmentDetailsState extends State { decoration: textFieldSelectorDecoration( "Name / ICD", widget.mySelectedAssessment - .selectedDiagnosisType != + .selectedICD != null ? widget.mySelectedAssessment - .selectedDiagnosisType.nameEn + .selectedICD.nameEn : null, true), enabled: false, diff --git a/lib/widgets/patients/profile/SOAP/subjective/subjective_page.dart b/lib/widgets/patients/profile/SOAP/subjective/subjective_page.dart index 80246166..d4ed9c86 100644 --- a/lib/widgets/patients/profile/SOAP/subjective/subjective_page.dart +++ b/lib/widgets/patients/profile/SOAP/subjective/subjective_page.dart @@ -168,11 +168,6 @@ class _SubjectivePageState extends State { variant: isHistoryExpand ? "bodyText" : '', bold: isHistoryExpand ? true : false, color: Colors.black), - Icon( - FontAwesomeIcons.asterisk, - color: AppGlobal.appPrimaryColor, - size: 12, - ) ], ), InkWell( @@ -214,11 +209,6 @@ class _SubjectivePageState extends State { variant: isAllergiesExpand ? "bodyText" : '', bold: isAllergiesExpand ? true : false, color: Colors.black), - Icon( - FontAwesomeIcons.asterisk, - color: AppGlobal.appPrimaryColor, - size: 12, - ) ], ), InkWell( diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index 9b70ae3a..446db0ac 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -18,6 +18,7 @@ import 'PatientProfileButton.dart'; *@desc: Profile Medical Info Widget */ class ProfileMedicalInfoWidget extends StatelessWidget { + ProfileMedicalInfoWidget({Key key, this.patient}) : super(key: key); PatiantInformtion patient; @override @@ -35,6 +36,13 @@ class ProfileMedicalInfoWidget extends StatelessWidget { nameLine2: "Episode", route: CREATE_EPISODE, icon: 'heartbeat.png'), + PatientProfileButton( + key: key, + patient: patient, + nameLine1: "Update", + nameLine2: "Episode", + route: CREATE_EPISODE, + icon: 'heartbeat.png'), PatientProfileButton( key: key, patient: patient, diff --git a/lib/widgets/shared/dialogs/master_key_dailog.dart b/lib/widgets/shared/dialogs/master_key_dailog.dart index 42d766e7..a3be364b 100644 --- a/lib/widgets/shared/dialogs/master_key_dailog.dart +++ b/lib/widgets/shared/dialogs/master_key_dailog.dart @@ -7,12 +7,15 @@ class MasterKeyDailog extends StatefulWidget { final List list; final okText; final Function(MasterKeyModel) okFunction; - MasterKeyModel selectedValue; + MasterKeyModel selectedValue; + final bool isICD; MasterKeyDailog( {@required this.list, @required this.okText, - @required this.okFunction, this.selectedValue}); + @required this.okFunction, + this.selectedValue, + this.isICD = false}); @override _MasterKeyDailogState createState() => _MasterKeyDailogState(); @@ -63,17 +66,23 @@ class _MasterKeyDailogState extends State { children: [ ...widget.list .map((item) => RadioListTile( - title: Text(item.nameEn.toString()), - groupValue: widget.selectedValue.id.toString(), - value: item.id.toString(), - activeColor: Colors.blue.shade700, - selected: item.id.toString() == widget.selectedValue.id.toString(), - onChanged: (val) { - setState(() { - widget.selectedValue = item; - }); - }, - )) + title: Text( + '${item.nameEn}' + (widget.isICD ? '/${item.code}' : '')), + groupValue: widget.isICD + ? widget.selectedValue.code.toString() + : widget.selectedValue.id.toString(), + value: widget.isICD ? widget.selectedValue.code.toString() : item + .id.toString(), + activeColor: Colors.blue.shade700, + selected: widget.isICD ? item.code.toString() == + widget.selectedValue.code.toString() : item.id.toString() == + widget.selectedValue.id.toString(), + onChanged: (val) { + setState(() { + widget.selectedValue = item; + }); + }, + )) .toList() ], ),