diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index fe2723df..c68f9522 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -64,7 +64,8 @@ class BaseAppClient { body['SessionID'] = SESSION_ID; body['IsLoginForDoctorApp'] = IS_LOGIN_FOR_DOCTOR_APP; body['PatientOutSA'] = 0; // PATIENT_OUT_SA; - body['VidaAuthTokenID'] = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMDAyIiwianRpIjoiNDM1MGNjZTYtYzc3MS00YjBiLThiNDItMGZhY2IzYzgxMjQ4IiwiZW1haWwiOiIiLCJpZCI6IjEwMDIiLCJOYW1lIjoiVEVNUCAtIERPQ1RPUiIsIkVtcGxveWVlSWQiOiI0NzA5IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiI0NzA5IiwiU0VTU0lPTklEIjoiMjE1OTYwNTQiLCJDbGluaWNJZCI6IjEiLCJyb2xlIjpbIkRPQ1RPUlMiLCJIRUFEIERPQ1RPUlMiLCJBRE1JTklTVFJBVE9SUyIsIlJFQ0VQVElPTklTVCIsIkVSIE5VUlNFIiwiRVIgUkVDRVBUSU9OSVNUIiwiUEhBUk1BQ1kgQUNDT1VOVCBTVEFGRiIsIlBIQVJNQUNZIE5VUlNFIiwiSU5QQVRJRU5UIFBIQVJNQUNJU1QiLCJBRE1JU1NJT04gU1RBRkYiLCJBUFBST1ZBTCBTVEFGRiIsIkNPTlNFTlQgIiwiTUVESUNBTCBSRVBPUlQgLSBTSUNLIExFQVZFIE1BTkFHRVIiXSwibmJmIjoxNjA5MjI1MjMwLCJleHAiOjE2MTAwODkyMzAsImlhdCI6MTYwOTIyNTIzMH0.rs7lTBQ1ON4PbR11PBkOyjf818DdeMKuqz2IrCJMYQU"; + body['VidaAuthTokenID'] = + "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMDAyIiwianRpIjoiNDM1MGNjZTYtYzc3MS00YjBiLThiNDItMGZhY2IzYzgxMjQ4IiwiZW1haWwiOiIiLCJpZCI6IjEwMDIiLCJOYW1lIjoiVEVNUCAtIERPQ1RPUiIsIkVtcGxveWVlSWQiOiI0NzA5IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiI0NzA5IiwiU0VTU0lPTklEIjoiMjE1OTYwNTQiLCJDbGluaWNJZCI6IjEiLCJyb2xlIjpbIkRPQ1RPUlMiLCJIRUFEIERPQ1RPUlMiLCJBRE1JTklTVFJBVE9SUyIsIlJFQ0VQVElPTklTVCIsIkVSIE5VUlNFIiwiRVIgUkVDRVBUSU9OSVNUIiwiUEhBUk1BQ1kgQUNDT1VOVCBTVEFGRiIsIlBIQVJNQUNZIE5VUlNFIiwiSU5QQVRJRU5UIFBIQVJNQUNJU1QiLCJBRE1JU1NJT04gU1RBRkYiLCJBUFBST1ZBTCBTVEFGRiIsIkNPTlNFTlQgIiwiTUVESUNBTCBSRVBPUlQgLSBTSUNLIExFQVZFIE1BTkFHRVIiXSwibmJmIjoxNjA5MjI1MjMwLCJleHAiOjE2MTAwODkyMzAsImlhdCI6MTYwOTIyNTIzMH0.rs7lTBQ1ON4PbR11PBkOyjf818DdeMKuqz2IrCJMYQU"; //await sharedPref.getString(VIDA_AUTH_TOKEN_ID); body['VidaRefreshTokenID'] ="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMDAyIiwianRpIjoiNDM1MGNjZTYtYzc3MS00YjBiLThiNDItMGZhY2IzYzgxMjQ4IiwiZW1haWwiOiIiLCJpZCI6IjEwMDIiLCJOYW1lIjoiVEVNUCAtIERPQ1RPUiIsIkVtcGxveWVlSWQiOiI0NzA5IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiI0NzA5IiwiU0VTU0lPTklEIjoiMjE1OTYwNTQiLCJDbGluaWNJZCI6IjEiLCJyb2xlIjpbIkRPQ1RPUlMiLCJIRUFEIERPQ1RPUlMiLCJBRE1JTklTVFJBVE9SUyIsIlJFQ0VQVElPTklTVCIsIkVSIE5VUlNFIiwiRVIgUkVDRVBUSU9OSVNUIiwiUEhBUk1BQ1kgQUNDT1VOVCBTVEFGRiIsIlBIQVJNQUNZIE5VUlNFIiwiSU5QQVRJRU5UIFBIQVJNQUNJU1QiLCJBRE1JU1NJT04gU1RBRkYiLCJBUFBST1ZBTCBTVEFGRiIsIkNPTlNFTlQgIiwiTUVESUNBTCBSRVBPUlQgLSBTSUNLIExFQVZFIE1BTkFHRVIiXSwibmJmIjoxNjA5MjI1MjMwLCJleHAiOjE2MTAwODkyMzAsImlhdCI6MTYwOTIyNTIzMH0.rs7lTBQ1ON4PbR11PBkOyjf818DdeMKuqz2IrCJMYQU"; //await sharedPref.getString(VIDA_REFRESH_TOKEN_ID); diff --git a/lib/config/config.dart b/lib/config/config.dart index 8d1d0537..1a13d7e9 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -123,12 +123,12 @@ const GET_PATIENT_ARRIVAL_LIST = const GET_ALLERGIES = 'Services/DoctorApplication.svc/REST/GetAllergies'; const GET_MASTER_LOOKUP_LIST = 'Services/DoctorApplication.svc/REST/GetMasterLookUpList'; -const POST_ALLERGY = 'Services/DoctorApplication.svc/REST/PostAllergies'; -const POST_HISTORY = 'Services/DoctorApplication.svc/REST/PostHistory'; -const POST_CHIEF_COMPLAINT = - 'Services/DoctorApplication.svc/REST/PostChiefcomplaint'; +const PATCH_ALLERGY = 'Services/DoctorApplication.svc/REST/PatchAllergies'; +const PATCH_HISTORY = 'Services/DoctorApplication.svc/REST/PatchHistory'; +const PATCH_CHIEF_COMPLAINT = + 'Services/DoctorApplication.svc/REST/PatchChiefcomplaint'; const POST_PHYSICAL_EXAM = - 'Services/DoctorApplication.svc/REST/PostPhysicalExam'; + 'Services/DoctorApplication.svc/REST/PatchPhysicalExam'; const POST_PROGRESS_NOTE = 'Services/DoctorApplication.svc/REST/PostProgressNote'; @@ -158,7 +158,8 @@ var SERVICES_PATIANT2 = [ "List_MyReferredPatient", "List_MyDischargeReferralPatient", "List_MyTomorrowPatient", - "List_MyReferralPatient" + "List_MyReferralPatient", + "patientArrivalList" ]; var SERVICES_PATIANT_HEADER = [ "Search Out-Patient", @@ -168,7 +169,7 @@ var SERVICES_PATIANT_HEADER = [ "Referral Discharge", "Tomorrow", "Referral", - "Arrived" + "Arrival Patient" ]; var SERVICES_PATIANT_HEADER_AR = [ "المريض الخارجي", @@ -178,7 +179,7 @@ var SERVICES_PATIANT_HEADER_AR = [ "المريض المحال المعافى", "مريض الغد", "المريض المحول مني", - "وصل المريض" + "المريض الواصل" ]; //****************** diff --git a/lib/core/service/SOAP_service.dart b/lib/core/service/SOAP_service.dart index 3219ef6a..45777511 100644 --- a/lib/core/service/SOAP_service.dart +++ b/lib/core/service/SOAP_service.dart @@ -31,7 +31,7 @@ class SOAPService extends LookupService { Future postAllergy(PostAllergyRequestModel postAllergyRequestModel) async { hasError = false; - await baseAppClient.post(POST_ALLERGY, + await baseAppClient.post(PATCH_ALLERGY, onSuccess: (dynamic response, int statusCode) { print("Success"); }, onFailure: (String error, int statusCode) { @@ -43,7 +43,7 @@ class SOAPService extends LookupService { Future postHistories( PostHistoriesRequestModel postHistoriesRequestModel) async { hasError = false; - await baseAppClient.post(POST_HISTORY, + await baseAppClient.post(PATCH_HISTORY, onSuccess: (dynamic response, int statusCode) { print("Success"); }, onFailure: (String error, int statusCode) { @@ -55,7 +55,7 @@ class SOAPService extends LookupService { Future postChiefComplaint( PostChiefComplaintRequestModel postChiefComplaintRequestModel) async { hasError = false; - await baseAppClient.post(POST_CHIEF_COMPLAINT, + await baseAppClient.post(PATCH_CHIEF_COMPLAINT, onSuccess: (dynamic response, int statusCode) { print("Success"); }, onFailure: (String error, int statusCode) { diff --git a/lib/core/service/patient_service.dart b/lib/core/service/patient_service.dart index 38e015cd..f18a9360 100644 --- a/lib/core/service/patient_service.dart +++ b/lib/core/service/patient_service.dart @@ -87,7 +87,7 @@ class PatientService extends BaseService { ClinicByProjectIdRequest(); ReferToDoctorRequest _referToDoctorRequest; - Future getPatientList(PatientModel patient, patientType) async { + Future getPatientList( patient, patientType) async { hasError = false; int val = int.parse(patientType); @@ -101,7 +101,7 @@ class PatientService extends BaseService { hasError = true; super.error = error; }, - body: { + body:val ==7?patient: { "ProjectID": patient.ProjectID, "ClinicID": patient.ClinicID, "DoctorID": patient.DoctorID, diff --git a/lib/core/viewModel/patient_view_model.dart b/lib/core/viewModel/patient_view_model.dart index a1221266..9672da83 100644 --- a/lib/core/viewModel/patient_view_model.dart +++ b/lib/core/viewModel/patient_view_model.dart @@ -49,7 +49,7 @@ class PatientViewModel extends BaseViewModel { List get referralFrequencyList => _patientService.referalFrequancyList; - Future getPatientList(PatientModel patient, patientType, + Future getPatientList( patient, patientType, {bool isBusyLocal = false}) async { if (isBusyLocal) { setState(ViewState.BusyLocal); diff --git a/lib/lookups/patient_lookup.dart b/lib/lookups/patient_lookup.dart index d8db7945..dfcaa305 100644 --- a/lib/lookups/patient_lookup.dart +++ b/lib/lookups/patient_lookup.dart @@ -10,7 +10,7 @@ const PATIENT_TYPE = const [ }, {"text": "Tomorrow Patient", "text_ar": "مريض الغد", "val": "5"}, {"text": "Referral", "text_ar": "المريض المحول مني", "val": "6"}, - {"text": "Arrived", "text_ar": "وصل", "val": "7"}, + {"text": "Arrival", "text_ar": "المريض الواصل", "val": "7"}, ]; const LOCATIONS = const [ diff --git a/lib/models/patient/patiant_info_model.dart b/lib/models/patient/patiant_info_model.dart index 9eec55ca..e5b89cfa 100644 --- a/lib/models/patient/patiant_info_model.dart +++ b/lib/models/patient/patiant_info_model.dart @@ -1,115 +1,161 @@ + +// TODO : it have to be changed. + class PatiantInformtion { final List list; - int projectId; - int clinicId; - int doctorId; - int patientId; - String doctorName; - String doctorNameN; - String firstName; - String middleName; - String lastName; - String firstNameN; - String middleNameN; - String lastNameN; - int gender; - String dateofBirth; - String nationalityId; - String mobileNumber; - String emailAddress; - String patientIdentificationNo; - int patientType; - String admissionNo; - String admissionDate; - String roomId; - String bedId; - String nursingStationId; - String description; - String clinicDescription; - String clinicDescriptionN; - String nationalityName; - String nationalityNameN; - String age; - String genderDescription; - String nursingStationName; - String appointmentDate; - String startTime; - - PatiantInformtion({ - this.list, - this.projectId, - this.clinicId, - this.doctorId, - this.patientId, - this.doctorName, - this.doctorNameN, - this.firstName, - this.middleName, - this.lastName, - this.firstNameN, - this.middleNameN, - this.lastNameN, - this.gender, - this.dateofBirth, - this.nationalityId, - this.mobileNumber, - this.emailAddress, - this.patientIdentificationNo, - this.patientType, - this.admissionNo, - this.admissionDate, - this.roomId, - this.bedId, - this.nursingStationId, - this.description, - this.clinicDescription, - this.clinicDescriptionN, - this.nationalityName, - this.nationalityNameN, - this.age, - this.genderDescription, - this.nursingStationName, - this.appointmentDate, - this.startTime, + int genderInt; + String age; + String appointmentDate; + int appointmentNo; + String appointmentType; + String arrivedOn; + int clinicGroupId; + String companyName; + Null dischargeStatus; + Null doctorDetails; + int doctorId; + String endTime; + int episodeNo; + int fallRiskScore; + bool isSigned; + int medicationOrders; + String mobileNumber; + String nationality; + int projectId; + int clinicId; + int patientId; + String doctorName; + String doctorNameN; + String firstName; + String middleName; + String lastName; + String firstNameN; + String middleNameN; + String lastNameN; + int gender; + String dateofBirth; + String nationalityId; + String emailAddress; + String patientIdentificationNo; + int patientType; + int patientMRN; + String admissionNo; + String admissionDate; + String roomId; + String bedId; + String nursingStationId; + String description; + String clinicDescription; + String clinicDescriptionN; + String nationalityName; + String nationalityNameN; + String genderDescription; + String nursingStationName; + String startTime; - }); + PatiantInformtion({ + this.list, + this.projectId, + this.clinicId, + this.doctorId, + this.patientId, + this.doctorName, + this.doctorNameN, + this.firstName, + this.middleName, + this.lastName, + this.firstNameN, + this.middleNameN, + this.lastNameN, + this.gender, + this.dateofBirth, + this.nationalityId, + this.mobileNumber, + this.emailAddress, + this.patientIdentificationNo, + this.patientType, + this.admissionNo, + this.admissionDate, + this.roomId, + this.bedId, + this.nursingStationId, + this.description, + this.clinicDescription, + this.clinicDescriptionN, + this.nationalityName, + this.nationalityNameN, + this.age, + this.genderDescription, + this.nursingStationName, + this.appointmentDate, + this.startTime, + this.appointmentNo, + this.appointmentType, + this.arrivedOn, + this.clinicGroupId, + this.companyName, + this.dischargeStatus, + this.doctorDetails, + this.endTime, + this.episodeNo, + this.fallRiskScore, + this.genderInt, + this.isSigned, + this.medicationOrders, + this.nationality,this.patientMRN + }); - factory PatiantInformtion.fromJson(Map json) => PatiantInformtion( - projectId: json["ProjectID"], - clinicId: json["ClinicID"], - doctorId: json["DoctorID"], - patientId: json["PatientID"], - doctorName: json["DoctorName"], - doctorNameN: json["DoctorNameN"], - firstName: json["FirstName"], - middleName: json["MiddleName"], - lastName: json["LastName"], - firstNameN: json["FirstNameN"], - middleNameN: json["MiddleNameN"], - lastNameN: json["LastNameN"], - gender: json["Gender"], - dateofBirth: json["DateofBirth"], - nationalityId: json["NationalityID"], - mobileNumber: json["MobileNumber"], - emailAddress: json["EmailAddress"], - patientIdentificationNo: json["PatientIdentificationNo"], - patientType: json["PatientType"], - admissionNo: json["AdmissionNo"], - admissionDate: json["AdmissionDate"], - roomId: json["RoomID"], - bedId: json["BedID"], - nursingStationId: json["NursingStationID"], - description: json["Description"], - clinicDescription: json["ClinicDescription"], - clinicDescriptionN: json["ClinicDescriptionN"], - nationalityName: json["NationalityName"], - nationalityNameN: json["NationalityNameN"], - age: json["Age"], + factory PatiantInformtion.fromJson(Map json) => + PatiantInformtion( + projectId: json["ProjectID"] ?? json["projectID"], + clinicId: json["ClinicID"]?? json["clinicID"], + doctorId: json["DoctorID"]?? json["doctorID"], + patientId: json["PatientID"]?? json["patientID"], + doctorName: json["DoctorName"]?? json["doctorName"], + doctorNameN: json["DoctorNameN"]?? json["doctorNameN"], + firstName: json["FirstName"]?? json["firstName"], + middleName: json["MiddleName"]?? json["middleName"], + lastName: json["LastName"]?? json["lastName"], + firstNameN: json["FirstNameN"]?? json["firstNameN"], + middleNameN: json["MiddleNameN"]?? json["middleNameN"], + lastNameN: json["LastNameN"]?? json["lastNameN"], + gender: json["Gender"]?? json["gender"], + dateofBirth: json["DateofBirth"]?? json["dob"], + nationalityId: json["NationalityID"]?? json["nationalityID"], + mobileNumber: json["MobileNumber"]?? json["mobileNumber"], + emailAddress: json["EmailAddress"]?? json["emailAddress"], + patientIdentificationNo: json["PatientIdentificationNo"]?? json["patientIdentificationNo"], + patientType: json["PatientType"]?? json["patientType"], + admissionNo: json["AdmissionNo"]?? json["admissionNo"], + admissionDate: json["AdmissionDate"]?? json["admissionDate"], + roomId: json["RoomID"]?? json["roomID"], + bedId: json["BedID"]?? json["bedID"], + nursingStationId: json["NursingStationID"]?? json["nursingStationID"], + description: json["Description"]?? json["description"], + clinicDescription: json["ClinicDescription"]?? json["clinicDescription"], + clinicDescriptionN: json["ClinicDescriptionN"]?? json["clinicDescriptionN"], + nationalityName: json["NationalityName"]?? json["nationalityName"], + nationalityNameN: json["NationalityNameN"]?? json["nationalityNameN"], + age: json["Age"]?? json["age"], genderDescription: json["GenderDescription"], nursingStationName: json["NursingStationName"], appointmentDate: json["AppointmentDate"]?? '', startTime: json["StartTime"], + appointmentNo :json['appointmentNo'], + appointmentType :json['appointmentType'], + arrivedOn :json['arrivedOn'], + clinicGroupId :json['clinicGroupId'], + companyName :json['companyName'], + dischargeStatus :json['dischargeStatus'], + doctorDetails :json['doctorDetails'], + endTime :json['endTime'], + episodeNo :json['episodeNo'], + fallRiskScore :json['fallRiskScore'], + isSigned :json['isSigned'], + medicationOrders :json['medicationOrders'], + nationality :json['nationality'], + patientMRN :json['patientMRN'], ); diff --git a/lib/models/patient/patient_arrival/get_patient_arrival_list_request_model.dart b/lib/models/patient/patient_arrival/get_patient_arrival_list_request_model.dart new file mode 100644 index 00000000..393790dd --- /dev/null +++ b/lib/models/patient/patient_arrival/get_patient_arrival_list_request_model.dart @@ -0,0 +1,40 @@ +class GetPatientArrivalListRequestModel { + String vidaAuthTokenID; + String from; + String to; + String doctorID; + int pageIndex; + int pageSize; + int clinicID; + + GetPatientArrivalListRequestModel( + {this.vidaAuthTokenID, + this.from, + this.to, + this.doctorID, + this.pageIndex, + this.pageSize, + this.clinicID}); + + GetPatientArrivalListRequestModel.fromJson(Map json) { + vidaAuthTokenID = json['VidaAuthTokenID']; + from = json['From']; + to = json['To']; + doctorID = json['DoctorID']; + pageIndex = json['PageIndex']; + pageSize = json['PageSize']; + clinicID = json['ClinicID']; + } + + Map toJson() { + final Map data = new Map(); + data['VidaAuthTokenID'] = this.vidaAuthTokenID; + data['From'] = this.from; + data['To'] = this.to; + data['DoctorID'] = this.doctorID; + data['PageIndex'] = this.pageIndex; + data['PageSize'] = this.pageSize; + data['ClinicID'] = this.clinicID; + return data; + } +} diff --git a/lib/screens/patients/patient_search_screen.dart b/lib/screens/patients/patient_search_screen.dart index b8dfe225..ba32fbe1 100644 --- a/lib/screens/patients/patient_search_screen.dart +++ b/lib/screens/patients/patient_search_screen.dart @@ -1,7 +1,7 @@ import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/models/patient/patient_model.dart'; -import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/routes.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; @@ -65,39 +65,34 @@ class _PatientSearchScreenState extends State { PatientOutSA: false); void _validateInputs() async { -//print("============== _selectedType============"+ _selectedType); + try { - //==================== - //_selectedType=='3'? - //===================== - // - // Map profile = await sharedPref.getObj(DOCTOR_PROFILE); - // DoctorProfileModel doctorProfile = - // new DoctorProfileModel.fromJson(profile); + + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + DoctorProfileModel doctorProfile = + new DoctorProfileModel.fromJson(profile); if (_formKey.currentState.validate()) { _formKey.currentState.save(); - // sharedPref.setString(SLECTED_PATIENT_TYPE, _selectedType); - // print('************_selectedType*************'); - // print('_selectedType${_selectedType}'); - // String token = await sharedPref.getString(TOKEN); - // - // _patientSearchFormValues.TokenID = token; - // _patientSearchFormValues.ProjectID = doctorProfile.projectID; //15 - // _patientSearchFormValues.DoctorID = doctorProfile.doctorID; - // _patientSearchFormValues.ClinicID = doctorProfile.clinicID; - // //===================== - // // _patientSearchFormValues. - // //===================== - // - // print("=============doctorProfile.clinicID=" + - // doctorProfile.clinicID.toString()); + sharedPref.setString(SLECTED_PATIENT_TYPE, _selectedType); + String token = await sharedPref.getString(TOKEN); - Navigator.of(context).pushNamed(PATIENTS, arguments: { - "patientSearchForm": _patientSearchFormValues, - "selectedType": _selectedType - }); + _patientSearchFormValues.TokenID = token; + _patientSearchFormValues.ProjectID = doctorProfile.projectID; //15 + _patientSearchFormValues.DoctorID = doctorProfile.doctorID; + _patientSearchFormValues.ClinicID = doctorProfile.clinicID; + + if ((_patientSearchFormValues.From == "0" || + _patientSearchFormValues.To == "0") && + _selectedType == "7") { + helpers.showErrorToast("Please Choose The Dates"); + } else { + Navigator.of(context).pushNamed(PATIENTS, arguments: { + "patientSearchForm": _patientSearchFormValues, + "selectedType": _selectedType + }); + } } else { setState(() { _autoValidate = true; @@ -105,7 +100,6 @@ class _PatientSearchScreenState extends State { } } catch (err) { error = err; - // handelCatchErrorCase(err); } } diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index 4da282ae..cb0c7248 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -9,11 +9,12 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/models/patient/patient_arrival/get_patient_arrival_list_request_model.dart'; import 'package:doctor_app_flutter/models/patient/patient_model.dart'; import 'package:doctor_app_flutter/models/patient/topten_users_res_model.dart'; -import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/routes.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; @@ -48,7 +49,6 @@ class _PatientsScreenState extends State { final String avatarFemale = 'user_female.svg'; final String assetName = 'assets/image.svg'; - // List _locations = ['Today', 'Old Date', 'YESTERDAY']; List _locations = []; //['All', 'Today', 'Tomorrow', 'Next Week']; int _activeLocation = 0; @@ -66,14 +66,6 @@ class _PatientsScreenState extends State { PatientModel patient; -/* - *@author: Amjad Amireh - *@Date:2/5/2020 - *@param: - *@return:PatientsScreen Search textbox filter - - *@desc: - */ searchData(String str) { this.responseModelList = this.responseModelList2; @@ -266,23 +258,52 @@ class _PatientsScreenState extends State { return BaseView( onModelReady: (model) { // TODO : change all the logic here to make it work with the model and remove future - model.getPatientList(patient, patientType).then((res) { + int val2 = int.parse(patientType); + GetPatientArrivalListRequestModel getPatientArrivalListRequestModel; + if (val2 == 7) { + getPatientArrivalListRequestModel = GetPatientArrivalListRequestModel( + from: patient.From, to: patient.To, pageIndex: 0, pageSize: 0); + } + + model + .getPatientList( + val2 == 7 + ? getPatientArrivalListRequestModel.toJson() + : patient, + patientType) + .then((res) { setState(() { _isLoading = false; - if (res['MessageStatus'] == 1) { - int val2 = int.parse(patientType); - lItems = res[SERVICES_PATIANT2[val2]]; - parsed = lItems; - responseModelList = new ModelResponse.fromJson(parsed).list; - responseModelList2 = responseModelList; - _isError = false; + // if (res['MessageStatus'] == 1) { + if (val2 == 7) { + print("Assad"); + if (res[SERVICES_PATIANT2[val2]] == null) { + _isError = true; + _isLoading = false; + this.error = error.toString(); + } else { + + var localList=[]; + res["patientArrivalList"]["entityList"].forEach((v) { + Map mergedPatient= {...v,...v["patientDetails"]}; + localList.add(mergedPatient); + }); + print(localList.toString()); + lItems = localList;//res[SERVICES_PATIANT2[val2]]["entityList"]; + } } else { - _isError = true; - error = res['ErrorEndUserMessage'] ?? res['ErrorMessage']; + lItems = res[SERVICES_PATIANT2[val2]]; } + parsed = lItems; + responseModelList = new ModelResponse.fromJson(parsed).list; + responseModelList2 = responseModelList; + _isError = false; + // } else { + // _isError = true; + // error = res['ErrorEndUserMessage'] ?? res['ErrorMessage']; + // } }); }).catchError((error) { - setState(() { _isError = true; _isLoading = false; diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 19818a0c..093423f1 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -285,7 +285,7 @@ class TranslationBase { String get transfertoadmin => localizedValues['transfertoadmin'][locale.languageCode]; - String get fromDate => localizedValues['toDate'][locale.languageCode]; + String get fromDate => localizedValues['fromDate'][locale.languageCode]; String get toDate => localizedValues['toDate'][locale.languageCode]; diff --git a/lib/widgets/patients/profile/SOAP/add_SOAP_index.dart b/lib/widgets/patients/profile/SOAP/add_SOAP_index.dart index 09d86fd8..5a698af9 100644 --- a/lib/widgets/patients/profile/SOAP/add_SOAP_index.dart +++ b/lib/widgets/patients/profile/SOAP/add_SOAP_index.dart @@ -1,5 +1,4 @@ import 'package:doctor_app_flutter/core/viewModel/doctor_replay_view_model.dart'; -import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_allergy.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_assement.dart'; @@ -12,14 +11,10 @@ import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/objective_page. import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/plan_page.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/subjective/subjective_page.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/Text.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import '../patient_profile_widget.dart'; import 'steps_widget.dart'; class AddSOAPIndex extends StatefulWidget { @@ -96,10 +91,28 @@ class _AddSOAPIndexState extends State }, scrollDirection: Axis.horizontal, children: [ - SubjectivePage(changePageViewIndex: changePageViewIndex,myAllergiesList: myAllergiesList,myHistoryList: myHistoryList,), - ObjectivePage(changePageViewIndex: changePageViewIndex,mySelectedExamination:mySelectedExamination), - AssessmentPage(changePageViewIndex: changePageViewIndex,mySelectedAssessment:mySelectedAssessment), - PlanPage(changePageViewIndex: changePageViewIndex,) + SubjectivePage( + changePageViewIndex: changePageViewIndex, + myAllergiesList: myAllergiesList, + myHistoryList: myHistoryList, + patientInfo: patient, + ), + ObjectivePage( + changePageViewIndex: changePageViewIndex, + mySelectedExamination: + mySelectedExamination, + patientInfo: patient, + ), + AssessmentPage( + changePageViewIndex: changePageViewIndex, + mySelectedAssessment: + mySelectedAssessment, + patientInfo: patient, + ), + PlanPage( + changePageViewIndex: changePageViewIndex, + patientInfo: patient, + ) ], ), ), diff --git a/lib/widgets/patients/profile/SOAP/assessment_page.dart b/lib/widgets/patients/profile/SOAP/assessment_page.dart index 22778913..76c6cdec 100644 --- a/lib/widgets/patients/profile/SOAP/assessment_page.dart +++ b/lib/widgets/patients/profile/SOAP/assessment_page.dart @@ -6,6 +6,7 @@ import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_assement.dart'; import 'package:doctor_app_flutter/models/SOAP/post_assessment_request_model.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart'; @@ -23,9 +24,10 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart'; class AssessmentPage extends StatefulWidget { final Function changePageViewIndex; final MySelectedAssessment mySelectedAssessment; + final PatiantInformtion patientInfo; AssessmentPage( - {Key key, this.changePageViewIndex, this.mySelectedAssessment}); + {Key key, this.changePageViewIndex, this.mySelectedAssessment, this.patientInfo}); @override _AssessmentPageState createState() => _AssessmentPageState(); @@ -308,35 +310,34 @@ class _AssessmentPageState extends State { } submitAssessment(SOAPViewModel model) async { - // if (widget.mySelectedAssessment.selectedDiagnosisCondition != null && - // widget.mySelectedAssessment.selectedDiagnosisType != null) { - // PostAssessmentRequestModel postAssessmentRequestModel = - // new PostAssessmentRequestModel( - // patientMRN: 3120690, - // episodeId: 200012117, - // appointmentNo: 2016054573, - // icdCodeDetails: [ - // new IcdCodeDetails( - // remarks: widget.mySelectedAssessment.remark, - // complexDiagnosis: true, - // conditionId: - // widget.mySelectedAssessment.selectedDiagnosisCondition.id, - // diagnosisTypeId: - // widget.mySelectedAssessment.selectedDiagnosisType.id, - // icdcode10Id: "1") - // ]); - // - // await model.postAssessment(postAssessmentRequestModel); - // - // if (model.state == ViewState.ErrorLocal) { - // helpers.showErrorToast(model.error); - // } else { - // widget.changePageViewIndex(3); - // } - // } else { - // helpers.showErrorToast('Please add required field correctly'); - // } - widget.changePageViewIndex(3); + if (widget.mySelectedAssessment.selectedDiagnosisCondition != null && + widget.mySelectedAssessment.selectedDiagnosisType != null) { + PostAssessmentRequestModel postAssessmentRequestModel = + new PostAssessmentRequestModel( + patientMRN: widget.patientInfo.patientMRN, + episodeId: widget.patientInfo.episodeNo, + appointmentNo: widget.patientInfo.appointmentNo, + icdCodeDetails: [ + new IcdCodeDetails( + remarks: widget.mySelectedAssessment.remark, + complexDiagnosis: true, + conditionId: + widget.mySelectedAssessment.selectedDiagnosisCondition.id, + diagnosisTypeId: + widget.mySelectedAssessment.selectedDiagnosisType.id, + icdcode10Id: "1") + ]); + + await model.postAssessment(postAssessmentRequestModel); + + if (model.state == ViewState.ErrorLocal) { + helpers.showErrorToast(model.error); + } else { + widget.changePageViewIndex(3); + } + } else { + helpers.showErrorToast('Please add required field correctly'); + } } openAssessmentDialog(BuildContext context) { @@ -416,9 +417,9 @@ class _AddAssessmentDetailsState extends State { if (model.listOfDiagnosisType.length == 0) { await model.getMasterLookup(MasterKeysService.DiagnosisType); } - if (model.listOfICD10.length == 0) { - await model.getMasterLookup(MasterKeysService.ICD10); - } + // if (model.listOfICD10.length == 0) { + // await model.getMasterLookup(MasterKeysService.ICD10); + // } }, builder: (_, model, w) => AppScaffold( @@ -468,11 +469,11 @@ class _AddAssessmentDetailsState extends State { Container( height: screenSize.height * 0.070, child: InkWell( - onTap: model.listOfICD10 != null + onTap: model.listOfDiagnosisType != null ? () { MasterKeyDailog dialog = MasterKeyDailog( isICD: true, - list: model.listOfICD10, + list: model.listOfDiagnosisType, selectedValue: widget .mySelectedAssessment .selectedICD, diff --git a/lib/widgets/patients/profile/SOAP/objective_page.dart b/lib/widgets/patients/profile/SOAP/objective_page.dart index 8d12e1c9..6441ac6c 100644 --- a/lib/widgets/patients/profile/SOAP/objective_page.dart +++ b/lib/widgets/patients/profile/SOAP/objective_page.dart @@ -6,6 +6,7 @@ import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_examination.dart'; import 'package:doctor_app_flutter/models/SOAP/post_physical_exam_request_model.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart'; @@ -23,9 +24,9 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart'; class ObjectivePage extends StatefulWidget { final Function changePageViewIndex; final List mySelectedExamination; - + final PatiantInformtion patientInfo; ObjectivePage( - {Key key, this.changePageViewIndex, this.mySelectedExamination}); + {Key key, this.changePageViewIndex, this.mySelectedExamination, this.patientInfo}); @override _ObjectivePageState createState() => _ObjectivePageState(); @@ -320,48 +321,43 @@ class _ObjectivePageState extends State { } submitObjectivePage(SOAPViewModel model) async { - // if(widget.mySelectedExamination.isNotEmpty){ - // PostPhysicalExamRequestModel postPhysicalExamRequestModel = new PostPhysicalExamRequestModel(); - // widget.mySelectedExamination.forEach((exam) { - // if (postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM == - // null) - // postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM = []; - // - // postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM.add( - // ListHisProgNotePhysicalExaminationVM( - // patientMRN: 3120690, - // episodeId: 200012117, - // appointmentNo: 2016054573, - // remarks: exam.remark ?? '', - // createdBy: 1485, - // createdOn: DateTime.now().toIso8601String(), - // editedBy: 1485, - // editedOn: DateTime.now().toIso8601String(), - // examId: exam.selectedExamination.id, - // examType: exam.selectedExamination.typeId, - // isAbnormal: exam.isAbnormal, - // isNormal: exam.isNormal, - // masterDescription: exam.selectedExamination, - // notExamined: false - // - // )); - // }); - // - // await model.postPhysicalExam(postPhysicalExamRequestModel); - // - // if (model.state == ViewState.ErrorLocal) { - // helpers.showErrorToast(model.error); - // } else { - // widget.changePageViewIndex(2); - // } - // } else { - // helpers.showErrorToast('Please add required field correctly'); - // } + if(widget.mySelectedExamination.isNotEmpty){ + PostPhysicalExamRequestModel postPhysicalExamRequestModel = new PostPhysicalExamRequestModel(); + widget.mySelectedExamination.forEach((exam) { + if (postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM == + null) + postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM = []; - widget.changePageViewIndex(2); + postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM.add( + ListHisProgNotePhysicalExaminationVM( + patientMRN: widget.patientInfo.patientMRN, + episodeId: widget.patientInfo.episodeNo, + appointmentNo: widget.patientInfo.appointmentNo, + remarks: exam.remark ?? '', + createdBy: 1485, + createdOn: DateTime.now().toIso8601String(), + editedBy: 1485, + editedOn: DateTime.now().toIso8601String(), + examId: exam.selectedExamination.id, + examType: exam.selectedExamination.typeId, + isAbnormal: exam.isAbnormal, + isNormal: exam.isNormal, + masterDescription: exam.selectedExamination, + notExamined: false + )); + }); + await model.postPhysicalExam(postPhysicalExamRequestModel); + if (model.state == ViewState.ErrorLocal) { + helpers.showErrorToast(model.error); + } else { + widget.changePageViewIndex(2); + } + } else { + helpers.showErrorToast('Please add required field correctly'); + } } removeExamination(MasterKeyModel masterKey) { diff --git a/lib/widgets/patients/profile/SOAP/plan_page.dart b/lib/widgets/patients/profile/SOAP/plan_page.dart index 3e5ca10a..3bf7aa5e 100644 --- a/lib/widgets/patients/profile/SOAP/plan_page.dart +++ b/lib/widgets/patients/profile/SOAP/plan_page.dart @@ -3,6 +3,7 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_progress_note_request_model.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart'; @@ -18,8 +19,9 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart'; class PlanPage extends StatefulWidget { final Function changePageViewIndex; + final PatiantInformtion patientInfo; - PlanPage({Key key, this.changePageViewIndex}); + PlanPage({Key key, this.changePageViewIndex, this.patientInfo}); @override _PlanPageState createState() => _PlanPageState(); @@ -269,9 +271,9 @@ class _PlanPageState extends State { submitPlan(SOAPViewModel model) async { if (progressNoteController.text.isNotEmpty) { PostProgressNoteRequestModel postProgressNoteRequestModel = new PostProgressNoteRequestModel( - patientMRN: 3120690, - episodeId: 200012117, - appointmentNo: 2016054573, + patientMRN: widget.patientInfo.patientMRN, + episodeId: widget.patientInfo.episodeNo, + appointmentNo: widget.patientInfo.appointmentNo, planNote: progressNoteController.text); diff --git a/lib/widgets/patients/profile/SOAP/subjective/subjective_page.dart b/lib/widgets/patients/profile/SOAP/subjective/subjective_page.dart index d4ed9c86..18849aa5 100644 --- a/lib/widgets/patients/profile/SOAP/subjective/subjective_page.dart +++ b/lib/widgets/patients/profile/SOAP/subjective/subjective_page.dart @@ -7,11 +7,11 @@ import 'package:doctor_app_flutter/models/SOAP/my_selected_allergy.dart'; import 'package:doctor_app_flutter/models/SOAP/post_allergy_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_chief_complaint_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_histories_request_model.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/subjective/add_allergies_widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/subjective/add_history_widget.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/subjective/add_medication_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; @@ -24,9 +24,15 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart'; class SubjectivePage extends StatefulWidget { final Function changePageViewIndex; final List myAllergiesList; - final List myHistoryList ; + final List myHistoryList; + final PatiantInformtion patientInfo; - SubjectivePage({Key key, this.changePageViewIndex, this.myAllergiesList, this.myHistoryList}); + SubjectivePage( + {Key key, + this.changePageViewIndex, + this.myAllergiesList, + this.myHistoryList, + this.patientInfo}); @override _SubjectivePageState createState() => _SubjectivePageState(); @@ -270,44 +276,46 @@ class _SubjectivePageState extends State { formKey.currentState.save(); formKey.currentState.validate(); - widget.changePageViewIndex(1); - // if(complaintsController.text.isNotEmpty && illnessController.text.isNotEmpty && complaintsController.text.length>25) { - // await postChiefComplaint(model: model); - // if (model.state == ViewState.ErrorLocal) { - // helpers.showErrorToast(model.error); - // } else { - // if (myHistoryList.length != 0) { - // await postHistories(model: model, myHistoryList: myHistoryList); - // if (model.state == ViewState.ErrorLocal) { - // helpers.showErrorToast(model.error); - // } else { - // if (myAllergiesList.length != 0) { - // await postAllergy(myAllergiesList: myAllergiesList, model: model); - // if (model.state == ViewState.ErrorLocal) { - // helpers.showErrorToast(model.error); - // } else { - // widget.changePageViewIndex(1); - // } - // } - // - // } - // } else { - // if (myAllergiesList.length != 0) { - // await postAllergy(myAllergiesList: myAllergiesList, model: model); - // if (model.state == ViewState.ErrorLocal) { - // helpers.showErrorToast(model.error); - // } else { - // widget.changePageViewIndex(1); - // } - // } else { - // widget.changePageViewIndex(1); - // } - // } - // } - // } else { - // helpers.showErrorToast('Please add required field correctly'); - // } + if(complaintsController.text.isNotEmpty && illnessController.text.isNotEmpty && complaintsController.text.length>25) { + await postChiefComplaint(model: model); + if (model.state == ViewState.ErrorLocal) { + helpers.showErrorToast(model.error); + } else { + if (myHistoryList.length != 0) { + await postHistories(model: model, myHistoryList: myHistoryList); + if (model.state == ViewState.ErrorLocal) { + helpers.showErrorToast(model.error); + } else { + if (myAllergiesList.length != 0) { + await postAllergy(myAllergiesList: myAllergiesList, model: model); + if (model.state == ViewState.ErrorLocal) { + helpers.showErrorToast(model.error); + } else { + widget.changePageViewIndex(1); + } + } else { + widget.changePageViewIndex(1); + + } + + } + } else { + if (myAllergiesList.length != 0) { + await postAllergy(myAllergiesList: myAllergiesList, model: model); + if (model.state == ViewState.ErrorLocal) { + helpers.showErrorToast(model.error); + } else { + widget.changePageViewIndex(1); + } + } else { + widget.changePageViewIndex(1); + } + } + } + } else { + helpers.showErrorToast('Please add required field correctly'); + } } @@ -324,9 +332,9 @@ class _SubjectivePageState extends State { .add(ListHisProgNotePatientAllergyDiseaseVM( allergyDiseaseId: allergy.selectedAllergy.id, allergyDiseaseType: allergy.selectedAllergy.typeId, - patientMRN: 3120690, - episodeId: 200012117, - appointmentNo: 2016054573, + patientMRN: widget.patientInfo.patientMRN, + episodeId: widget.patientInfo.episodeNo, + appointmentNo: widget.patientInfo.appointmentNo, severity: allergy.selectedAllergySeverity.id, remarks: allergy.remark, createdBy: 1485, @@ -353,9 +361,9 @@ class _SubjectivePageState extends State { postHistoriesRequestModel.listMedicalHistoryVM = []; //TODO: make static value dynamic postHistoriesRequestModel.listMedicalHistoryVM.add(ListMedicalHistoryVM( - patientMRN: 3120690, - episodeId: 200012117, - appointmentNo: 2016054573, + patientMRN: widget.patientInfo.patientMRN, + episodeId: widget.patientInfo.episodeNo, + appointmentNo: widget.patientInfo.appointmentNo, remarks: "", historyId: history.id, historyType: history.typeId, @@ -375,11 +383,11 @@ class _SubjectivePageState extends State { PostChiefComplaintRequestModel postChiefComplaintRequestModel = //TODO: make static value dynamic new PostChiefComplaintRequestModel( - patientMRN: 3120690, - episodeID: 200012117, - appointmentNo: 2016054573, + patientMRN: widget.patientInfo.patientMRN, + episodeID: widget.patientInfo.episodeNo, + appointmentNo: widget.patientInfo.appointmentNo, chiefComplaint: complaintsController.text, - currentMedication: "currentMedication", + currentMedication: " currentMedication ", hopi: illnessController.text, isLactation: false, ispregnant: false, diff --git a/lib/widgets/patients/profile/patient_profile_widget.dart b/lib/widgets/patients/profile/patient_profile_widget.dart index ac6c7f0f..792eb49e 100644 --- a/lib/widgets/patients/profile/patient_profile_widget.dart +++ b/lib/widgets/patients/profile/patient_profile_widget.dart @@ -168,7 +168,7 @@ class PatientProfileWidget extends StatelessWidget { height: 4, ), AppText( - patient.genderDescription, + patient.gender.toString() == '1' ? 'Male' : 'Female', fontWeight: FontWeight.normal, fontSize: 1.8 * SizeConfig.textMultiplier, ),