Merge branch 'development' into feature_admission_request

merge-requests/210/head
mosazaid 5 years ago
commit 0e645c2b1f

@ -36,21 +36,20 @@ class BaseAppClient {
}) async {
String url = BASE_URL + endPoint;
try {
//TODO change it edit By Jammal
// Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
// String token = await sharedPref.getString(TOKEN);
// if (profile != null) {
// DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
// if (body['DoctorID'] == null)
body['DoctorID'] = 4709;//doctorProfile?.doctorID;
body['EditedBy'] = 4709;//doctorProfile?.doctorID;
//if (body['ProjectID'] == null) {
body['ProjectID'] = 15;//doctorProfile?.projectID;
// }
// if (body['ClinicID'] == null)
body['ClinicID'] = 1;//doctorProfile?.clinicID;
// }
body['TokenID'] = "@dm!n";//token ?? '';
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
String token = await sharedPref.getString(TOKEN);
if (profile != null) {
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
if (body['DoctorID'] == null)
body['DoctorID'] = doctorProfile?.doctorID;
body['EditedBy'] = doctorProfile?.doctorID;
if (body['ProjectID'] == null) {
body['ProjectID'] = doctorProfile?.projectID;
}
if (body['ClinicID'] == null)
body['ClinicID'] = doctorProfile?.clinicID;
}
body['TokenID'] = token ?? '';
String lang = await sharedPref.getString(APP_Language);
if (lang != null && lang == 'ar')
body['LanguageID'] = 1;
@ -64,11 +63,9 @@ class BaseAppClient {
body['SessionID'] = SESSION_ID;
body['IsLoginForDoctorApp'] = IS_LOGIN_FOR_DOCTOR_APP;
body['PatientOutSA'] = 0; // PATIENT_OUT_SA;
body['VidaAuthTokenID'] =
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMDAyIiwianRpIjoiNDM1MGNjZTYtYzc3MS00YjBiLThiNDItMGZhY2IzYzgxMjQ4IiwiZW1haWwiOiIiLCJpZCI6IjEwMDIiLCJOYW1lIjoiVEVNUCAtIERPQ1RPUiIsIkVtcGxveWVlSWQiOiI0NzA5IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiI0NzA5IiwiU0VTU0lPTklEIjoiMjE1OTYwNTQiLCJDbGluaWNJZCI6IjEiLCJyb2xlIjpbIkRPQ1RPUlMiLCJIRUFEIERPQ1RPUlMiLCJBRE1JTklTVFJBVE9SUyIsIlJFQ0VQVElPTklTVCIsIkVSIE5VUlNFIiwiRVIgUkVDRVBUSU9OSVNUIiwiUEhBUk1BQ1kgQUNDT1VOVCBTVEFGRiIsIlBIQVJNQUNZIE5VUlNFIiwiSU5QQVRJRU5UIFBIQVJNQUNJU1QiLCJBRE1JU1NJT04gU1RBRkYiLCJBUFBST1ZBTCBTVEFGRiIsIkNPTlNFTlQgIiwiTUVESUNBTCBSRVBPUlQgLSBTSUNLIExFQVZFIE1BTkFHRVIiXSwibmJmIjoxNjA5MjI1MjMwLCJleHAiOjE2MTAwODkyMzAsImlhdCI6MTYwOTIyNTIzMH0.rs7lTBQ1ON4PbR11PBkOyjf818DdeMKuqz2IrCJMYQU";
//await sharedPref.getString(VIDA_AUTH_TOKEN_ID);
body['VidaRefreshTokenID'] ="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMDAyIiwianRpIjoiNDM1MGNjZTYtYzc3MS00YjBiLThiNDItMGZhY2IzYzgxMjQ4IiwiZW1haWwiOiIiLCJpZCI6IjEwMDIiLCJOYW1lIjoiVEVNUCAtIERPQ1RPUiIsIkVtcGxveWVlSWQiOiI0NzA5IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiI0NzA5IiwiU0VTU0lPTklEIjoiMjE1OTYwNTQiLCJDbGluaWNJZCI6IjEiLCJyb2xlIjpbIkRPQ1RPUlMiLCJIRUFEIERPQ1RPUlMiLCJBRE1JTklTVFJBVE9SUyIsIlJFQ0VQVElPTklTVCIsIkVSIE5VUlNFIiwiRVIgUkVDRVBUSU9OSVNUIiwiUEhBUk1BQ1kgQUNDT1VOVCBTVEFGRiIsIlBIQVJNQUNZIE5VUlNFIiwiSU5QQVRJRU5UIFBIQVJNQUNJU1QiLCJBRE1JU1NJT04gU1RBRkYiLCJBUFBST1ZBTCBTVEFGRiIsIkNPTlNFTlQgIiwiTUVESUNBTCBSRVBPUlQgLSBTSUNLIExFQVZFIE1BTkFHRVIiXSwibmJmIjoxNjA5MjI1MjMwLCJleHAiOjE2MTAwODkyMzAsImlhdCI6MTYwOTIyNTIzMH0.rs7lTBQ1ON4PbR11PBkOyjf818DdeMKuqz2IrCJMYQU";
//await sharedPref.getString(VIDA_REFRESH_TOKEN_ID);
body['VidaAuthTokenID'] = await sharedPref.getString(VIDA_AUTH_TOKEN_ID);
body['VidaRefreshTokenID'] = await sharedPref.getString(VIDA_REFRESH_TOKEN_ID);
print("URL : $url");
print("Body : ${json.encode(body)}");

@ -1,6 +1,14 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart';
import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart';
import 'package:doctor_app_flutter/models/SOAP/GeneralGetReqForSOAP.dart';
import 'package:doctor_app_flutter/models/SOAP/GetAllergiesResModel.dart';
import 'package:doctor_app_flutter/models/SOAP/GetGetProgressNoteReqModel.dart';
import 'package:doctor_app_flutter/models/SOAP/GetGetProgressNoteResModel.dart';
import 'package:doctor_app_flutter/models/SOAP/GetHistoryReqModel.dart';
import 'package:doctor_app_flutter/models/SOAP/GetHistoryResModel.dart';
import 'package:doctor_app_flutter/models/SOAP/GetPhysicalExamListResModel.dart';
import 'package:doctor_app_flutter/models/SOAP/GetPhysicalExamReqModel.dart';
import 'package:doctor_app_flutter/models/SOAP/get_Allergies_request_model.dart';
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/models/SOAP/post_allergy_request_model.dart';
@ -14,7 +22,11 @@ import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/update_a
import 'base/lookup-service.dart';
class SOAPService extends LookupService {
List<GetChiefComplaintResModel> chiefComplaintList = [];
List<GetChiefComplaintResModel> patientChiefComplaintList = [];
List<GetAllergiesResModel> patientAllergiesList = [];
List<GetHistoryResModel> patientHistoryList = [];
List<GetPhysicalExamResModel> patientPhysicalExamList = [];
List<GetGetProgressNoteResModel> patientProgressNoteList = [];
Future getAllergies(GetAllergiesRequestModel getAllergiesRequestModel) async {
await baseAppClient.post(
@ -181,68 +193,83 @@ class SOAPService extends LookupService {
Future getPatientAllergy(PostAllergyRequestModel getPatientAllergyRequestModel) async {
Future getPatientAllergy(GeneralGetReqForSOAP generalGetReqForSOAP) async {
hasError = false;
await baseAppClient.post (GET_ALLERGY,
onSuccess: (dynamic response, int statusCode) {
print("Success");
patientAllergiesList.clear();
response['List_Allergies']['entityList'].forEach((v) {
patientAllergiesList.add(GetAllergiesResModel.fromJson(v));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: getPatientAllergyRequestModel.toJson());
}, body: generalGetReqForSOAP.toJson());
}
Future getPatientHistories(
PostHistoriesRequestModel getPatientHistoriesRequestModel) async {
GetHistoryReqModel getHistoryReqModel) async {
hasError = false;
await baseAppClient.post (GET_HISTORY,
onSuccess: (dynamic response, int statusCode) {
print("Success");
patientHistoryList.clear();
response['List_History']['entityList'].forEach((v) {
patientHistoryList.add(GetHistoryResModel.fromJson(v));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: getPatientHistoriesRequestModel.toJson());
}, body: getHistoryReqModel.toJson());
}
Future getPatientChiefComplaint(
GeneralGetReqForSOAP getPatientChiefComplaintRequestModel) async {
GetChiefComplaintReqModel getChiefComplaintReqModel) async {
hasError = false;
await baseAppClient.post (GET_CHIEF_COMPLAINT,
onSuccess: (dynamic response, int statusCode) {
print("Success");
chiefComplaintList.clear();
patientChiefComplaintList.clear();
response['List_ChiefComplaint']['entityList'].forEach((v) {
chiefComplaintList.add(GetChiefComplaintResModel.fromJson(v));
patientChiefComplaintList.add(GetChiefComplaintResModel.fromJson(v));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: getPatientChiefComplaintRequestModel.toJson());
}, body: getChiefComplaintReqModel.toJson());
}
Future getPatientPhysicalExam(
PostPhysicalExamRequestModel getPatientPhysicalExamRequestModel) async {
GetPhysicalExamReqModel getPhysicalExamReqModel) async {
hasError = false;
await baseAppClient.post (GET_PHYSICAL_EXAM,
onSuccess: (dynamic response, int statusCode) {
print("Success");
patientPhysicalExamList.clear();
response['PhysicalExamList']['entityList'].forEach((v) {
patientPhysicalExamList.add(GetPhysicalExamResModel.fromJson(v));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: getPatientPhysicalExamRequestModel.toJson());
}, body: getPhysicalExamReqModel.toJson());
}
Future getPatientProgressNote(
PostProgressNoteRequestModel getPatientProgressNoteRequestModel) async {
GetGetProgressNoteReqModel getGetProgressNoteReqModel) async {
hasError = false;
await baseAppClient.post (GET_PROGRESS_NOTE,
onSuccess: (dynamic response, int statusCode) {
print("Success");
patientProgressNoteList.clear();
response['ProgressNoteList']['entityList'].forEach((v) {
patientProgressNoteList.add(GetGetProgressNoteResModel.fromJson(v));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: getPatientProgressNoteRequestModel.toJson());
}, body: getGetProgressNoteReqModel.toJson());
}
Future getPatientAssessment(

@ -1,6 +1,7 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
import 'package:flutter/cupertino.dart';
import 'base_service.dart';
@ -146,4 +147,5 @@ class LookupService extends BaseService {
break;
}
}
}

@ -1,8 +1,16 @@
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/service/SOAP_service.dart';
import 'package:doctor_app_flutter/models/SOAP/Allergy_model.dart';
import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart';
import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart';
import 'package:doctor_app_flutter/models/SOAP/GeneralGetReqForSOAP.dart';
import 'package:doctor_app_flutter/models/SOAP/GetAllergiesResModel.dart';
import 'package:doctor_app_flutter/models/SOAP/GetGetProgressNoteReqModel.dart';
import 'package:doctor_app_flutter/models/SOAP/GetGetProgressNoteResModel.dart';
import 'package:doctor_app_flutter/models/SOAP/GetHistoryReqModel.dart';
import 'package:doctor_app_flutter/models/SOAP/GetHistoryResModel.dart';
import 'package:doctor_app_flutter/models/SOAP/GetPhysicalExamListResModel.dart';
import 'package:doctor_app_flutter/models/SOAP/GetPhysicalExamReqModel.dart';
import 'package:doctor_app_flutter/models/SOAP/get_Allergies_request_model.dart';
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/models/SOAP/post_allergy_request_model.dart';
@ -12,6 +20,7 @@ import 'package:doctor_app_flutter/models/SOAP/post_histories_request_model.dart
import 'package:doctor_app_flutter/models/SOAP/post_physical_exam_request_model.dart';
import 'package:doctor_app_flutter/models/SOAP/post_progress_note_request_model.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/update_assessment_page.dart';
import 'package:flutter/material.dart';
import '../../locator.dart';
import 'base_view_model.dart';
@ -32,14 +41,36 @@ class SOAPViewModel extends BaseViewModel {
List<MasterKeyModel> get historySportList => _SOAPService.historySportList;
List<MasterKeyModel> get historySocialList => _SOAPService.historySocialList;
List<MasterKeyModel> get historySurgicalList => _SOAPService.historySurgicalList;
List<MasterKeyModel> get mergeHistorySurgicalWithHistorySportList => [...historySurgicalList,...historySportList];
List<MasterKeyModel> get physicalExaminationList => _SOAPService.physicalExaminationList;
List<MasterKeyModel> get listOfDiagnosisType => _SOAPService.listOfDiagnosisType;
List<MasterKeyModel> get listOfDiagnosisCondition => _SOAPService.listOfDiagnosisCondition;
List<MasterKeyModel> get listOfICD10 => _SOAPService.listOfICD10;
List<MasterKeyModel> get historySurgicalList =>
_SOAPService.historySurgicalList;
List<MasterKeyModel> get mergeHistorySurgicalWithHistorySportList =>
[...historySurgicalList, ...historySportList];
List<MasterKeyModel> get physicalExaminationList =>
_SOAPService.physicalExaminationList;
List<MasterKeyModel> get listOfDiagnosisType =>
_SOAPService.listOfDiagnosisType;
List<MasterKeyModel> get listOfDiagnosisCondition =>
_SOAPService.listOfDiagnosisCondition;
List<MasterKeyModel> get listOfICD10 => _SOAPService.listOfICD10;
List<GetChiefComplaintResModel> get patientChiefComplaintList =>
_SOAPService.patientChiefComplaintList;
List<GetAllergiesResModel> get patientAllergiesList =>
_SOAPService.patientAllergiesList;
List<GetHistoryResModel> get patientHistoryList =>
_SOAPService.patientHistoryList;
List<GetPhysicalExamResModel> get patientPhysicalExamList =>
_SOAPService.patientPhysicalExamList;
List<GetGetProgressNoteResModel> get patientProgressNoteList =>
_SOAPService.patientProgressNoteList;
Future getAllergies(GetAllergiesRequestModel getAllergiesRequestModel) async {
setState(ViewState.Busy);
@ -183,11 +214,9 @@ class SOAPViewModel extends BaseViewModel {
}
Future getPatientAllergy(PostAllergyRequestModel getPatientAllergyRequestModel) async {
Future getPatientAllergy(GeneralGetReqForSOAP generalGetReqForSOAP) async {
setState(ViewState.Busy);
await _SOAPService.getPatientAllergy(getPatientAllergyRequestModel);
await _SOAPService.getPatientAllergy(generalGetReqForSOAP);
if (_SOAPService.hasError) {
error = _SOAPService.error;
setState(ViewState.Busy);
@ -195,9 +224,9 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future getPatientHistories(PostHistoriesRequestModel getPatientHistoriesRequestModel) async {
Future getPatientHistories(GetHistoryReqModel getHistoryReqModel) async {
setState(ViewState.Busy);
await _SOAPService.getPatientHistories(getPatientHistoriesRequestModel);
await _SOAPService.getPatientHistories(getHistoryReqModel);
if (_SOAPService.hasError) {
error = _SOAPService.error;
setState(ViewState.Busy);
@ -205,9 +234,10 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future getPatientChiefComplaint(GeneralGetReqForSOAP getPatientChiefComplaintRequestModel) async {
Future getPatientChiefComplaint(
GetChiefComplaintReqModel getChiefComplaintReqModel) async {
setState(ViewState.Busy);
await _SOAPService.getPatientChiefComplaint(getPatientChiefComplaintRequestModel);
await _SOAPService.getPatientChiefComplaint(getChiefComplaintReqModel);
if (_SOAPService.hasError) {
error = _SOAPService.error;
setState(ViewState.Busy);
@ -215,27 +245,28 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future getPatientPhysicalExam(PostPhysicalExamRequestModel getPatientPhysicalExamRequestModel) async {
Future getPatientPhysicalExam(GetPhysicalExamReqModel getPhysicalExamReqModel) async {
setState(ViewState.Busy);
await _SOAPService.getPatientPhysicalExam(getPatientPhysicalExamRequestModel);
await _SOAPService.getPatientPhysicalExam(getPhysicalExamReqModel);
if (_SOAPService.hasError) {
error = _SOAPService.error;
setState(ViewState.Busy);
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
Future getPatientProgressNote(PostProgressNoteRequestModel getPatientProgressNoteRequestModel) async {
Future getPatientProgressNote(GetGetProgressNoteReqModel getGetProgressNoteReqModel) async {
setState(ViewState.Busy);
await _SOAPService.getPatientProgressNote(getPatientProgressNoteRequestModel);
await _SOAPService.getPatientProgressNote(getGetProgressNoteReqModel);
if (_SOAPService.hasError) {
error = _SOAPService.error;
setState(ViewState.Busy);
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
Future getPatientAssessment(PostAssessmentRequestModel getPatientAssessmentRequestModel) async {
Future getPatientAssessment(
PostAssessmentRequestModel getPatientAssessmentRequestModel) async {
setState(ViewState.Busy);
await _SOAPService.getPatientAssessment(getPatientAssessmentRequestModel);
if (_SOAPService.hasError) {
@ -245,4 +276,133 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
// ignore: missing_return
MasterKeyModel getOneMasterKey(
{@required MasterKeysService masterKeys, int id, int typeId}) {
switch (masterKeys) {
case MasterKeysService.Allergies:
List<MasterKeyModel> result = allergiesList.where((element) {
print(element.id == id);
return element.id == id &&
element.typeId == masterKeys.getMasterKeyService();
}).toList();
if (result.isNotEmpty) {
return result.first;
}
break;
case MasterKeysService.HistoryFamily:
List<MasterKeyModel> result = historyFamilyList.where((element) {
print(element.id == id);
return element.id == id &&
element.typeId == masterKeys.getMasterKeyService();
}).toList();
if (result.isNotEmpty) {
return result.first;
}
break;
case MasterKeysService.HistoryMedical:
List<MasterKeyModel> result = historyMedicalList.where((element) {
print(element.id == id);
return element.id == id &&
element.typeId == masterKeys.getMasterKeyService();
}).toList();
if (result.isNotEmpty) {
return result.first;
}
break;
case MasterKeysService.HistorySocial:
List<MasterKeyModel> result = historySocialList.where((element) {
print(element.id == id);
return element.id == id &&
element.typeId == masterKeys.getMasterKeyService();
}).toList();
if (result.isNotEmpty) {
return result.first;
}
break;
case MasterKeysService.HistorySports:
List<MasterKeyModel> result = historySocialList.where((element) {
print(element.id == id);
return element.id == id &&
element.typeId == masterKeys.getMasterKeyService();
}).toList();
if (result.isNotEmpty) {
return result.first;
}
break;
case MasterKeysService.HistorySurgical:
List<MasterKeyModel> result = historySurgicalList.where((element) {
print(element.id == id);
return element.id == id &&
element.typeId == masterKeys.getMasterKeyService();
}).toList();
if (result.isNotEmpty) {
return result.first;
}
break;
case MasterKeysService.PhysicalExamination:
List<MasterKeyModel> result = physicalExaminationList.where((element) {
print(element.id == id);
return element.id == id &&
element.typeId == masterKeys.getMasterKeyService();
}).toList();
if (result.isNotEmpty) {
return result.first;
}
break;
case MasterKeysService.AllergySeverity:
List<MasterKeyModel> result = allergySeverityList.where((element) {
print(element.id == id);
return element.id == id &&
element.typeId == masterKeys.getMasterKeyService();
}).toList();
if (result.isNotEmpty) {
return result.first;
}
break;
// case MasterKeysService.physiotherapyGoals:
// listOfPhysiotherapyGoals.clear();
// entryList.forEach((v) {
// listOfPhysiotherapyGoals.add(MasterKeyModel.fromJson(v));
// });
// break;
case MasterKeysService.DiagnosisType:
List<MasterKeyModel> result = listOfDiagnosisType.where((element) {
print(element.id == id);
return element.id == id &&
element.typeId == masterKeys.getMasterKeyService();
}).toList();
if (result.isNotEmpty) {
return result.first;
}
break;
case MasterKeysService.DiagnosisCondition:
List<MasterKeyModel> result = listOfDiagnosisCondition.where((element) {
print(element.id == id);
return element.id == id &&
element.typeId == masterKeys.getMasterKeyService();
}).toList();
if (result.isNotEmpty) {
return result.first;
}
break;
case MasterKeysService.ICD10:
listOfICD10.clear();
List<MasterKeyModel> result = listOfICD10.where((element) {
print(element.id == id);
return element.id == id &&
element.typeId == masterKeys.getMasterKeyService();
}).toList();
if (result.isNotEmpty) {
return result.first;
}
break;
break;
}
}
}

@ -0,0 +1,25 @@
class GetChiefComplaintReqModel {
int patientMRN;
int appointmentNo;
int episodeId;
int episodeID;
GetChiefComplaintReqModel(
{this.patientMRN, this.appointmentNo, this.episodeId, this.episodeID});
GetChiefComplaintReqModel.fromJson(Map<String, dynamic> json) {
patientMRN = json['PatientMRN'];
appointmentNo = json['AppointmentNo'];
episodeId = json['EpisodeId'];
episodeID = json['EpisodeID'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['PatientMRN'] = this.patientMRN;
data['AppointmentNo'] = this.appointmentNo;
data['EpisodeId'] = this.episodeId;
data['EpisodeID'] = this.episodeID;
return data;
}
}

@ -0,0 +1,60 @@
class GetAllergiesResModel {
int allergyDiseaseId;
String allergyDiseaseName;
int allergyDiseaseType;
int appointmentNo;
int createdBy;
String createdByName;
String createdOn;
int episodeID;
bool isChecked;
bool isUpdatedByNurse;
int severity;
String severityName;
GetAllergiesResModel(
{this.allergyDiseaseId,
this.allergyDiseaseName,
this.allergyDiseaseType,
this.appointmentNo,
this.createdBy,
this.createdByName,
this.createdOn,
this.episodeID,
this.isChecked,
this.isUpdatedByNurse,
this.severity,
this.severityName});
GetAllergiesResModel.fromJson(Map<String, dynamic> json) {
allergyDiseaseId = json['allergyDiseaseId'];
allergyDiseaseName = json['allergyDiseaseName'];
allergyDiseaseType = json['allergyDiseaseType'];
appointmentNo = json['appointmentNo'];
createdBy = json['createdBy'];
createdByName = json['createdByName'];
createdOn = json['createdOn'];
episodeID = json['episodeID'];
isChecked = json['isChecked'];
isUpdatedByNurse = json['isUpdatedByNurse'];
severity = json['severity'];
severityName = json['severityName'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['allergyDiseaseId'] = this.allergyDiseaseId;
data['allergyDiseaseName'] = this.allergyDiseaseName;
data['allergyDiseaseType'] = this.allergyDiseaseType;
data['appointmentNo'] = this.appointmentNo;
data['createdBy'] = this.createdBy;
data['createdByName'] = this.createdByName;
data['createdOn'] = this.createdOn;
data['episodeID'] = this.episodeID;
data['isChecked'] = this.isChecked;
data['isUpdatedByNurse'] = this.isUpdatedByNurse;
data['severity'] = this.severity;
data['severityName'] = this.severityName;
return data;
}
}

@ -0,0 +1,40 @@
class GetGetProgressNoteReqModel {
int patientMRN;
int appointmentNo;
String episodeID;
String from;
String to;
int clinicID;
int doctorID;
GetGetProgressNoteReqModel(
{this.patientMRN,
this.appointmentNo,
this.episodeID,
this.from,
this.to,
this.clinicID,
this.doctorID});
GetGetProgressNoteReqModel.fromJson(Map<String, dynamic> json) {
patientMRN = json['PatientMRN'];
appointmentNo = json['AppointmentNo'];
episodeID = json['EpisodeID'];
from = json['From'];
to = json['To'];
clinicID = json['ClinicID'];
doctorID = json['DoctorID'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['PatientMRN'] = this.patientMRN;
data['AppointmentNo'] = this.appointmentNo;
data['EpisodeID'] = this.episodeID;
data['From'] = this.from;
data['To'] = this.to;
data['ClinicID'] = this.clinicID;
data['DoctorID'] = this.doctorID;
return data;
}
}

@ -0,0 +1,25 @@
class GetGetProgressNoteResModel {
int appointmentNo;
int episodeId;
int patientMRN;
String planNote;
GetGetProgressNoteResModel(
{this.appointmentNo, this.episodeId, this.patientMRN, this.planNote});
GetGetProgressNoteResModel.fromJson(Map<String, dynamic> json) {
appointmentNo = json['appointmentNo'];
episodeId = json['episodeId'];
patientMRN = json['patientMRN'];
planNote = json['planNote'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['appointmentNo'] = this.appointmentNo;
data['episodeId'] = this.episodeId;
data['patientMRN'] = this.patientMRN;
data['planNote'] = this.planNote;
return data;
}
}

@ -0,0 +1,18 @@
class GetHistoryReqModel {
int patientMRN;
int historyType;
GetHistoryReqModel({this.patientMRN, this.historyType});
GetHistoryReqModel.fromJson(Map<String, dynamic> json) {
patientMRN = json['PatientMRN'];
historyType = json['HistoryType'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['PatientMRN'] = this.patientMRN;
data['HistoryType'] = this.historyType;
return data;
}
}

@ -0,0 +1,40 @@
class GetHistoryResModel {
int appointmentNo;
int episodeId;
int historyId;
int historyType;
bool isChecked;
int patientMRN;
String remarks;
GetHistoryResModel(
{this.appointmentNo,
this.episodeId,
this.historyId,
this.historyType,
this.isChecked,
this.patientMRN,
this.remarks});
GetHistoryResModel.fromJson(Map<String, dynamic> json) {
appointmentNo = json['appointmentNo'];
episodeId = json['episodeId'];
historyId = json['historyId'];
historyType = json['historyType'];
isChecked = json['isChecked'];
patientMRN = json['patientMRN'];
remarks = json['remarks'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['appointmentNo'] = this.appointmentNo;
data['episodeId'] = this.episodeId;
data['historyId'] = this.historyId;
data['historyType'] = this.historyType;
data['isChecked'] = this.isChecked;
data['patientMRN'] = this.patientMRN;
data['remarks'] = this.remarks;
return data;
}
}

@ -0,0 +1,64 @@
class GetPhysicalExamResModel {
int appointmentNo;
int createdBy;
String createdOn;
int editedBy;
String editedOn;
int episodeId;
int examId;
int examType;
bool isAbnormal;
bool isNormal;
bool notExamined;
int patientMRN;
String remarks;
GetPhysicalExamResModel(
{this.appointmentNo,
this.createdBy,
this.createdOn,
this.editedBy,
this.editedOn,
this.episodeId,
this.examId,
this.examType,
this.isAbnormal,
this.isNormal,
this.notExamined,
this.patientMRN,
this.remarks});
GetPhysicalExamResModel.fromJson(Map<String, dynamic> json) {
appointmentNo = json['appointmentNo'];
createdBy = json['createdBy'];
createdOn = json['createdOn'];
editedBy = json['editedBy'];
editedOn = json['editedOn'];
episodeId = json['episodeId'];
examId = json['examId'];
examType = json['examType'];
isAbnormal = json['isAbnormal'];
isNormal = json['isNormal'];
notExamined = json['notExamined'];
patientMRN = json['patientMRN'];
remarks = json['remarks'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['appointmentNo'] = this.appointmentNo;
data['createdBy'] = this.createdBy;
data['createdOn'] = this.createdOn;
data['editedBy'] = this.editedBy;
data['editedOn'] = this.editedOn;
data['episodeId'] = this.episodeId;
data['examId'] = this.examId;
data['examType'] = this.examType;
data['isAbnormal'] = this.isAbnormal;
data['isNormal'] = this.isNormal;
data['notExamined'] = this.notExamined;
data['patientMRN'] = this.patientMRN;
data['remarks'] = this.remarks;
return data;
}
}

@ -0,0 +1,32 @@
class GetPhysicalExamReqModel {
int patientMRN;
int appointmentNo;
String episodeID;
String from;
String to;
GetPhysicalExamReqModel(
{this.patientMRN,
this.appointmentNo,
this.episodeID,
this.from,
this.to});
GetPhysicalExamReqModel.fromJson(Map<String, dynamic> json) {
patientMRN = json['PatientMRN'];
appointmentNo = json['AppointmentNo'];
episodeID = json['EpisodeID'];
from = json['From'];
to = json['To'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['PatientMRN'] = this.patientMRN;
data['AppointmentNo'] = this.appointmentNo;
data['EpisodeID'] = this.episodeID;
data['From'] = this.from;
data['To'] = this.to;
return data;
}
}

@ -22,7 +22,7 @@ class RootPage extends StatelessWidget {
);
break;
case APP_STATUS.UNAUTHENTICATED:
return LandingPage();
return Loginsreen();
break;
case APP_STATUS.AUTHENTICATED:
return LandingPage();

@ -115,69 +115,68 @@ class _DashboardScreenState extends State<DashboardScreen> {
SizedBox(
height: 4,
),
//TODO change it edit By Jammal
// InkWell(
// onTap: () async {
// showCupertinoPicker(
// decKey: '',
// context: context,
// actionList: projectsProvider
// .doctorClinicsList);
// },
// child: Row(
// mainAxisAlignment:
// MainAxisAlignment.spaceBetween,
// children: <Widget>[
// Container(
// child: AppText(
// authProvider.selectedClinicName !=
// null
// ? authProvider
// .selectedClinicName
// : authProvider.doctorProfile
// .clinicDescription,
// fontSize:
// SizeConfig.textMultiplier *
// 1.7,
// color: Colors.white,
// textAlign: TextAlign.center,
// ),
// alignment: projectsProvider.isArabic
// ? Alignment.topRight
// : Alignment.topLeft,
// ),
// Row(
// mainAxisAlignment:
// MainAxisAlignment.start,
// mainAxisSize: MainAxisSize.max,
// crossAxisAlignment:
// CrossAxisAlignment.start,
// children: <Widget>[
// InkWell(
// child: Container(
// margin: EdgeInsets.only(
// left: 5,
// top: projectsProvider
// .isArabic
// ? 0
// : 5,
// right: 10,
// bottom: projectsProvider
// .isArabic
// ? 15
// : 7),
// child: Icon(
// DoctorApp.sync_icon,
// color: Colors.white,
// size: SizeConfig
// .textMultiplier *
// 1.8,
// )),
// ),
// ],
// ),
// ]),
// ),
InkWell(
onTap: () async {
showCupertinoPicker(
decKey: '',
context: context,
actionList: projectsProvider
.doctorClinicsList);
},
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: <Widget>[
Container(
child: AppText(
authProvider.selectedClinicName !=
null
? authProvider
.selectedClinicName
: authProvider.doctorProfile
.clinicDescription,
fontSize:
SizeConfig.textMultiplier *
1.7,
color: Colors.white,
textAlign: TextAlign.center,
),
alignment: projectsProvider.isArabic
? Alignment.topRight
: Alignment.topLeft,
),
Row(
mainAxisAlignment:
MainAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
InkWell(
child: Container(
margin: EdgeInsets.only(
left: 5,
top: projectsProvider
.isArabic
? 0
: 5,
right: 10,
bottom: projectsProvider
.isArabic
? 15
: 7),
child: Icon(
DoctorApp.sync_icon,
color: Colors.white,
size: SizeConfig
.textMultiplier *
1.8,
)),
),
],
),
]),
),
],
),
]),

@ -242,7 +242,8 @@ class _AddAllergiesState extends State<AddAllergies> {
),
SizedBox(
height: 10,
), Container(
),
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: model.allergySeverityList != null

@ -43,8 +43,7 @@ final double height;
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
AppText(
//TODO change it edit By Jammal
'Dr. ',//${authProvider.doctorProfile.doctorName}',
'Dr. ${authProvider.doctorProfile.doctorName}',
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.5,
color: Colors.white,
@ -72,9 +71,7 @@ final double height;
height: 50,
width: 60,
child: Image.network(
//TODO change it edit By Jammal
'https://cdn.pixabay.com/photo/2015/04/23/22/00/tree-736885__340.jpg'
// authProvider.doctorProfile.doctorImageURL,
authProvider.doctorProfile.doctorImageURL,
// fit: BoxFit.fill,
),
),

@ -1,6 +1,8 @@
import 'package:autocomplete_textfield/autocomplete_textfield.dart';
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.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/screens/base/base_view.dart';
@ -14,6 +16,7 @@ import 'package:doctor_app_flutter/widgets/shared/dialogs/master_key_dailog.dart
import 'package:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:provider/provider.dart';
class UpdateAllergiesWidget extends StatefulWidget {
final List<MySelectedAllergy> myAllergiesList;
@ -144,10 +147,11 @@ class _AddAllergiesState extends State<AddAllergies> {
MasterKeyModel _selectedAllergySeverity;
MasterKeyModel _selectedAllergy;
TextEditingController remarkController = TextEditingController();
GlobalKey key = new GlobalKey<AutoCompleteTextFieldState<MasterKeyModel>>();
InputDecoration textFieldSelectorDecoration(String hintText,
String selectedText, bool isDropDown) {
String selectedText, bool isDropDown,{IconData icon}) {
return InputDecoration(
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
@ -162,7 +166,7 @@ class _AddAllergiesState extends State<AddAllergies> {
borderRadius: BorderRadius.circular(8),
),
hintText: selectedText != null ? selectedText : hintText,
suffixIcon: isDropDown ? Icon(Icons.arrow_drop_down) : null,
suffixIcon: isDropDown ? Icon(icon ?? Icons.arrow_drop_down) : null,
hintStyle: TextStyle(
fontSize: 14,
color: Colors.grey.shade600,
@ -172,6 +176,7 @@ class _AddAllergiesState extends State<AddAllergies> {
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
final screenSize = MediaQuery
.of(context)
.size;
@ -214,40 +219,32 @@ class _AddAllergiesState extends State<AddAllergies> {
child: InkWell(
onTap: model.allergiesList != null
? () {
MasterKeyDailog dialog = MasterKeyDailog(
list: model.allergiesList,
okText: TranslationBase
.of(context)
.ok,
okFunction: (MasterKeyModel selectedValue) {
setState(() {
_selectedAllergy = selectedValue;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
setState(() {
_selectedAllergy = null;
});
}
: null,
child: TextField(
decoration: textFieldSelectorDecoration(
"Select Allergy",
_selectedAllergy != null
? _selectedAllergy.nameEn
: null,
true),
child: _selectedAllergy==null? AutoCompleteTextField<MasterKeyModel>(
decoration: textFieldSelectorDecoration("Select Allergy", _selectedAllergy != null ? _selectedAllergy.nameEn : null, true,icon: EvaIcons.search),
itemSubmitted: (item) => setState(() => _selectedAllergy = item),
key: key,
suggestions: model.allergiesList,
itemBuilder: (context, suggestion) => new Padding(
child:Texts( projectViewModel.isArabic? suggestion.nameAr: suggestion.nameEn),
padding: EdgeInsets.all(8.0)),
itemSorter: (a, b) => 1,
itemFilter: (suggestion, input) =>
suggestion.nameAr.toLowerCase().startsWith(input.toLowerCase()) ||suggestion.nameEn.toLowerCase().startsWith(input.toLowerCase()),
):TextField(
decoration: textFieldSelectorDecoration("Select Allergy", _selectedAllergy != null ? _selectedAllergy.nameEn : null, true,icon: EvaIcons.search),
enabled: false,
),
),
),
SizedBox(
height: 10,
), Container(
),
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: model.allergySeverityList != null

@ -10,6 +10,7 @@ import 'package:doctor_app_flutter/widgets/shared/TextFields.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/divider_with_spaces_around.dart';
import 'package:doctor_app_flutter/widgets/shared/master_key_checkbox_search_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
import 'package:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/material.dart';
@ -280,273 +281,59 @@ class _AddHistoryDialogState extends State<AddHistoryDialog> {
},
scrollDirection: Axis.horizontal,
children: <Widget>[
Container(
child: Column(
children: [
NetworkBaseView(
baseViewModel: model,
child: Container(
height:
MediaQuery.of(context).size.height * 0.5,
child: Center(
child: Container(
margin: EdgeInsets.only(top: 15),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: ListView(
children: [
Column(
children: model.historyFamilyList
.map((historyInfo) {
return Column(
children: [
Row(
children: [
Checkbox(
value: isServiceSelected(
historyInfo),
activeColor:
Colors.red[800],
onChanged:
(bool newValue) {
setState(() {
if (isServiceSelected(
historyInfo
)) {
widget
.removeHistory(
historyInfo
);
}
else {
widget
.myHistoryList
.add(
historyInfo);
}
});
}),
Expanded(
child: Padding(
padding:
const EdgeInsets
.symmetric(
horizontal: 10,
vertical: 0),
child: Texts(
historyInfo.nameEn,
variant: "bodyText",
bold: true,
color:
Colors.black),
),
),
],
),
DividerWithSpacesAround(),
],
);
}).toList(),
),
],
),
)),
),
),
SizedBox(
height: 10,
),
if (model.state == ViewState.Idle)
AppButton(
title: "Add SELECTED HISTORIES"
.toUpperCase(),
onPressed: () {
widget.addSelectedHistories();
},
),
],
),
MasterKeyCheckboxSearchWidget(
model: model,
masterList: model.historyFamilyList,
removeHistory: (history){
setState(() {
widget.removeHistory(history);
});
},
addHistory: (history){
setState(() {
widget.myHistoryList.add(history);
});
},
addSelectedHistories: (){
widget.addSelectedHistories();
},
isServiceSelected: (master) =>isServiceSelected(master),
),
Container(
child: Column(
children: [
NetworkBaseView(
baseViewModel: model,
child: Container(
height:
MediaQuery.of(context).size.height * 0.5,
child: Center(
child: Container(
margin: EdgeInsets.only(top: 15),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: ListView(
children: [
Column(
children: model.mergeHistorySurgicalWithHistorySportList
.map((historyInfo) {
return Column(
children: [
Row(
children: [
Checkbox(
value: isServiceSelected(
historyInfo),
activeColor:
Colors.red[800],
onChanged:
(
bool newValue) {
setState(() {
if (isServiceSelected(
historyInfo
)) {
widget
.removeHistory(
historyInfo
);
}
else {
widget
.myHistoryList
.add(
historyInfo);
}
});
}),
Expanded(
child: Padding(
padding:
const EdgeInsets
.symmetric(
horizontal: 10,
vertical: 0),
child: Texts(
historyInfo.nameEn,
variant: "bodyText",
bold: true,
color:
Colors.black),
),
),
],
),
DividerWithSpacesAround(),
],
);
}).toList(),
),
],
),
)),
),
),
SizedBox(
height: 10,
),
if (model.state == ViewState.Idle)
AppButton(
title: "Add SELECTED HISTORIES"
.toUpperCase(),
onPressed: () {
widget.addSelectedHistories();
},
),
],
),
MasterKeyCheckboxSearchWidget(
model: model,
masterList: model.mergeHistorySurgicalWithHistorySportList,
removeHistory: (history){
setState(() {
widget.removeHistory(history);
});
},
addHistory: (history){
setState(() {
widget.myHistoryList.add(history);
});
},
addSelectedHistories: (){
widget.addSelectedHistories();
},
isServiceSelected: (master) =>isServiceSelected(master),
),
Container(
child: Column(
children: [
NetworkBaseView(
baseViewModel: model,
child: Container(
height:
MediaQuery.of(context).size.height * 0.5,
child: Center(
child: Container(
margin: EdgeInsets.only(top: 15),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: ListView(
children: [
Column(
children: model.historyMedicalList
.map((historyInfo) {
return Column(
children: [
Row(
children: [
Checkbox(
value: isServiceSelected(
historyInfo),
activeColor:
Colors.red[800],
onChanged:
(
bool newValue) {
setState(() {
if (isServiceSelected(
historyInfo
)) {
widget
.removeHistory(
historyInfo
);
}
else {
widget
.myHistoryList
.add(
historyInfo);
}
});
}),
Expanded(
child: Padding(
padding:
const EdgeInsets
.symmetric(
horizontal: 10,
vertical: 0),
child: Texts(
historyInfo.nameEn,
variant: "bodyText",
bold: true,
color:
Colors.black),
),
),
],
),
DividerWithSpacesAround(),
],
);
}).toList(),
),
],
),
)),
),
),
SizedBox(
height: 10,
),
if (model.state == ViewState.Idle)
AppButton(
title: "Add SELECTED HISTORIES"
.toUpperCase(),
onPressed: () {
setState(() {
widget.addSelectedHistories();
});
},
),
],
),
MasterKeyCheckboxSearchWidget(
model: model,
masterList: model.historyMedicalList,
removeHistory: (history){
setState(() {
widget.removeHistory(history);
});
},
addHistory: (history){
setState(() {
widget.myHistoryList.add(history);
});
},
addSelectedHistories: (){
widget.addSelectedHistories();
},
isServiceSelected: (master) =>isServiceSelected(master),
),
],
),

@ -1,7 +1,11 @@
import 'package:doctor_app_flutter/client/base_app_client.dart';
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/enum/master_lookup_key.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/ChiefComplaint/GetChiefComplaintReqModel.dart';
import 'package:doctor_app_flutter/models/SOAP/GeneralGetReqForSOAP.dart';
import 'package:doctor_app_flutter/models/SOAP/GetHistoryReqModel.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/post_allergy_request_model.dart';
@ -10,8 +14,6 @@ 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_update/subjective/update_allergies_widget.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/subjective/update_history_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/Text.dart';
@ -47,11 +49,114 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
TextEditingController illnessController = TextEditingController();
TextEditingController complaintsController = TextEditingController();
final formKey = GlobalKey<FormState>();
getHistory(SOAPViewModel model) async{
GetHistoryReqModel getHistoryMedicalReqModel = GetHistoryReqModel(
patientMRN: widget.patientInfo.patientMRN,
historyType:
MasterKeysService.HistoryMedical.getMasterKeyService());
GetHistoryReqModel getHistorySportsReqModel = GetHistoryReqModel(
patientMRN: widget.patientInfo.patientMRN,
historyType:
MasterKeysService.HistorySports.getMasterKeyService());
GetHistoryReqModel getHistorySurgicalReqModel = GetHistoryReqModel(
patientMRN: widget.patientInfo.patientMRN,
historyType:
MasterKeysService.HistorySurgical.getMasterKeyService());
GetHistoryReqModel getHistoryFamilyReqModel = GetHistoryReqModel(
patientMRN: widget.patientInfo.patientMRN,
historyType:
MasterKeysService.HistoryFamily.getMasterKeyService());
await model.getPatientHistories(getHistoryMedicalReqModel);
await model.getPatientHistories(getHistorySportsReqModel);
await model.getPatientHistories(getHistorySurgicalReqModel);
await model.getPatientHistories(getHistoryFamilyReqModel);
if(model.patientHistoryList.isNotEmpty) {
if (model.historyFamilyList.isEmpty) {
await model.getMasterLookup(MasterKeysService.HistoryFamily);
}
if (model.historyMedicalList.isEmpty) {
await model.getMasterLookup(MasterKeysService.HistoryMedical);
}
if (model.historySurgicalList.length == 0) {
await model.getMasterLookup(MasterKeysService.HistorySurgical);
await model.getMasterLookup(MasterKeysService.HistorySports);
}
model.patientHistoryList.forEach((element) {
if (element.historyType == MasterKeysService.HistoryFamily.getMasterKeyService()) {
widget.myHistoryList.add( model.getOneMasterKey(
masterKeys: MasterKeysService.HistoryFamily,
id: element.historyId,
));
}if (element.historyType == MasterKeysService.HistoryMedical.getMasterKeyService()) {
widget.myHistoryList.add( model.getOneMasterKey(
masterKeys: MasterKeysService.HistoryMedical,
id: element.historyId,
));
}if (element.historyType == MasterKeysService.HistorySports.getMasterKeyService()) {
widget.myHistoryList.add( model.getOneMasterKey(
masterKeys: MasterKeysService.HistorySports,
id: element.historyId,
));
}
if (element.historyType ==
MasterKeysService.HistorySurgical.getMasterKeyService()) {
widget.myHistoryList.add(model.getOneMasterKey(
masterKeys: MasterKeysService.HistorySurgical,
id: element.historyId,
));
}
});
}
}
@override
Widget build(BuildContext context) {
return BaseView<SOAPViewModel>(
// onModelReady: (model) => model.getMasterLookup(MasterKeysService.Allergies),
onModelReady: (model) async {
GeneralGetReqForSOAP generalGetReqForSOAP = GeneralGetReqForSOAP(
patientMRN: widget.patientInfo.patientMRN,
episodeId: widget.patientInfo.episodeNo,
appointmentNo: widget.patientInfo.appointmentNo);
GetChiefComplaintReqModel getChiefComplaintReqModel =
GetChiefComplaintReqModel(
patientMRN: widget.patientInfo.patientMRN,
appointmentNo: widget.patientInfo.appointmentNo,
episodeId: widget.patientInfo.episodeNo,
episodeID: widget.patientInfo.episodeNo);
await model.getPatientChiefComplaint(getChiefComplaintReqModel);
if (model.patientChiefComplaintList.isNotEmpty) {
complaintsController.text =
model.patientChiefComplaintList[0].chiefComplaint;
illnessController.text = model.patientChiefComplaintList[0].hopi;
}
await model.getPatientAllergy(generalGetReqForSOAP);
if (model.patientAllergiesList.isNotEmpty) {
if (model.allergiesList.isEmpty)
await model.getMasterLookup(MasterKeysService.Allergies);
if (model.allergySeverityList.isEmpty)
await model.getMasterLookup(MasterKeysService.AllergySeverity);
model.patientAllergiesList.forEach((element) {
MasterKeyModel selectedAllergy = model.getOneMasterKey(
masterKeys: MasterKeysService.Allergies,
id: element.allergyDiseaseId,
typeId: element.allergyDiseaseType);
MasterKeyModel selectedAllergySeverity = model.getOneMasterKey(
masterKeys: MasterKeysService.AllergySeverity,
id: element.severity,
);
MySelectedAllergy mySelectedAllergy = MySelectedAllergy(
selectedAllergy: selectedAllergy,
selectedAllergySeverity: selectedAllergySeverity);
widget.myAllergiesList.add(mySelectedAllergy);
});
}
await getHistory(model);
},
builder: (_, model, w) => AppScaffold(
isShowAppBar: false,
baseViewModel: model,
@ -279,45 +384,45 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
formKey.currentState.validate();
// 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');
// }
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');
}
widget.changePageViewIndex(1);
@ -334,22 +439,28 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
//TODO: make static value dynamic
postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM
.add(ListHisProgNotePatientAllergyDiseaseVM(
allergyDiseaseId: allergy.selectedAllergy.id,
allergyDiseaseType: allergy.selectedAllergy.typeId,
patientMRN: widget.patientInfo.patientMRN,
episodeId: widget.patientInfo.episodeNo,
appointmentNo: widget.patientInfo.appointmentNo,
severity: allergy.selectedAllergySeverity.id,
remarks: allergy.remark,
createdBy: 1485,
//
createdOn: DateTime.now().toIso8601String(),//"2020-08-14T20:37:22.780Z",
editedBy: 1485,
editedOn: DateTime.now().toIso8601String(),//"2020-08-14T20:37:22.780Z",
isChecked: false,
isUpdatedByNurse: false));
allergyDiseaseId: allergy.selectedAllergy.id,
allergyDiseaseType: allergy.selectedAllergy.id,
patientMRN: widget.patientInfo.patientMRN,
episodeId: widget.patientInfo.episodeNo,
appointmentNo: widget.patientInfo.appointmentNo,
severity: allergy.selectedAllergySeverity.id,
remarks: allergy.remark,
createdBy: 4709,
//
createdOn: DateTime.now().toIso8601String(),
//"2020-08-14T20:37:22.780Z",
editedBy: 4709,
editedOn: DateTime.now().toIso8601String(),
//"2020-08-14T20:37:22.780Z",
isChecked: false,
isUpdatedByNurse: false));
});
await model.patchAllergy(postAllergyRequestModel);
if (model.patientAllergiesList.isEmpty) {
await model.postAllergy(postAllergyRequestModel);
} else {
await model.patchAllergy(postAllergyRequestModel);
}
if (model.state == ViewState.ErrorLocal) {
helpers.showErrorToast(model.error);
@ -374,6 +485,14 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
isChecked: false,
));
});
if (model.patientAllergiesList.isEmpty) {
await model.postHistories(postHistoriesRequestModel);
} else {
await model.patchHistories(postHistoriesRequestModel);
}
await model.patchHistories(postHistoriesRequestModel);
if (model.state == ViewState.ErrorLocal) {
@ -386,19 +505,22 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
if(formKey.currentState.validate()){
PostChiefComplaintRequestModel postChiefComplaintRequestModel =
//TODO: make static value dynamic
new PostChiefComplaintRequestModel(
patientMRN: widget.patientInfo.patientMRN,
episodeID: widget.patientInfo.episodeNo,
appointmentNo: widget.patientInfo.appointmentNo,
chiefComplaint: complaintsController.text,
currentMedication: " currentMedication ",
hopi: illnessController.text,
isLactation: false,
ispregnant: false,
numberOfWeeks: 22);
await model.patchChiefComplaint(postChiefComplaintRequestModel);
new PostChiefComplaintRequestModel(
patientMRN: widget.patientInfo.patientMRN,
episodeID: widget.patientInfo.episodeNo,
appointmentNo: widget.patientInfo.appointmentNo,
chiefComplaint: complaintsController.text,
currentMedication: " currentMedication ",
hopi: illnessController.text,
isLactation: false,
ispregnant: true,
numberOfWeeks: 22);
if (model.patientChiefComplaintList.isEmpty) {
// TODO: make it postChiefComplaint after it start to work
await model.postChiefComplaint(postChiefComplaintRequestModel);
} else {
await model.patchChiefComplaint(postChiefComplaintRequestModel);
}
}
}

@ -1,3 +1,4 @@
import 'package:autocomplete_textfield/autocomplete_textfield.dart';
import 'package:doctor_app_flutter/client/base_app_client.dart';
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
@ -377,6 +378,7 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
TextEditingController remarkController = TextEditingController();
TextEditingController appointmentIdController = TextEditingController(
text: "234567");
GlobalKey key = new GlobalKey<AutoCompleteTextFieldState<MasterKeyModel>>();
@override
Widget build(BuildContext context) {
@ -385,7 +387,7 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
.of(context)
.size;
InputDecoration textFieldSelectorDecoration(String hintText,
String selectedText, bool isDropDown) {
String selectedText, bool isDropDown,{IconData icon}) {
//TODO: make one Input InputDecoration for all
return InputDecoration(
focusedBorder: OutlineInputBorder(
@ -401,7 +403,7 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
borderRadius: BorderRadius.circular(8),
),
hintText: selectedText != null ? selectedText : hintText,
suffixIcon: isDropDown ? Icon(Icons.arrow_drop_down) : null,
suffixIcon: isDropDown ? Icon(icon??Icons.arrow_drop_down) : null,
hintStyle: TextStyle(
fontSize: 14,
color: Colors.grey.shade600,
@ -418,9 +420,9 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
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(
@ -472,43 +474,28 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
child: InkWell(
onTap: model.listOfDiagnosisType != null
? () {
MasterKeyDailog dialog = MasterKeyDailog(
isICD: true,
list: model.listOfDiagnosisType,
selectedValue: widget
.mySelectedAssessment
.selectedICD,
okText: TranslationBase
.of(context)
.ok,
okFunction:
(MasterKeyModel selectedValue) {
setState(() {
widget.mySelectedAssessment
.selectedICD =
selectedValue;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
setState(() {
widget.mySelectedAssessment.selectedICD = null;
});
}
: null,
child: TextField(
child: widget.mySelectedAssessment.selectedICD == null ? AutoCompleteTextField<MasterKeyModel>(
decoration: textFieldSelectorDecoration("Name or ICD", widget.mySelectedAssessment.selectedICD != null ? widget.mySelectedAssessment.selectedICD.nameEn : null, true,icon: EvaIcons.search),
itemSubmitted: (item) => setState(() => widget.mySelectedAssessment.selectedICD = item),
key: key,
suggestions: model.listOfICD10,
itemBuilder: (context, suggestion) => new Padding(
child:Texts( suggestion.description +" / "+ suggestion.code.toString()),
padding: EdgeInsets.all(8.0)),
itemSorter: (a, b) => 1,
itemFilter: (suggestion, input) =>
suggestion.description.toLowerCase().startsWith(input.toLowerCase()) ||suggestion.description.toLowerCase().startsWith(input.toLowerCase())
||suggestion.code.toLowerCase().startsWith(input.toLowerCase())
,
): TextField(
decoration: textFieldSelectorDecoration(
"Name / ICD",
widget.mySelectedAssessment
.selectedICD !=
null
? widget.mySelectedAssessment
.selectedICD.nameEn
: null,
true),
widget.mySelectedAssessment.selectedICD != null ? widget.mySelectedAssessment.selectedICD.code :"Name or ICD",
widget.mySelectedAssessment.selectedICD != null ? widget.mySelectedAssessment.selectedICD.nameEn : null, true,icon: EvaIcons.search),
enabled: false,
),
),

@ -3,6 +3,7 @@ import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/enum/master_lookup_key.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/GetPhysicalExamReqModel.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';
@ -16,6 +17,7 @@ import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart';
import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart';
import 'package:doctor_app_flutter/widgets/shared/master_key_checkbox_search_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
import 'package:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/material.dart';
@ -53,40 +55,69 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
final screenSize = MediaQuery.of(context).size;
return BaseView<SOAPViewModel>(
// onModelReady: (model) => model.getMasterLookup(MasterKeysService.Allergies),
onModelReady: (model) async {
GetPhysicalExamReqModel getPhysicalExamReqModel =
GetPhysicalExamReqModel(
patientMRN: widget.patientInfo.patientMRN,
episodeID: widget.patientInfo.episodeNo.toString(),
appointmentNo: widget.patientInfo.appointmentNo);
await model.getPatientPhysicalExam(getPhysicalExamReqModel);
if (model.patientPhysicalExamList.isNotEmpty) {
if (model.physicalExaminationList.length == 0) {
await model
.getMasterLookup(MasterKeysService.PhysicalExamination);
}
model.patientPhysicalExamList.forEach((element) {
MasterKeyModel examMaster = model.getOneMasterKey(
masterKeys: MasterKeysService.PhysicalExamination,
id: element.examId,
);
MySelectedExamination tempEam = MySelectedExamination(
selectedExamination: examMaster,
remark: element.remarks,
isNormal: element.isNormal,
isAbnormal: element.isAbnormal);
widget.mySelectedExamination.add(tempEam);
});
}
},
builder: (_, model, w) => AppScaffold(
isShowAppBar: false,
body: SingleChildScrollView(
physics: ScrollPhysics(),
child: Center(
child: FractionallySizedBox(
widthFactor: 0.9,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
SizedBox(
height: 30,
),
HeaderBodyExpandableNotifier(
headerWidget: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
isShowAppBar: false,
//TODO: retrun it back
// baseViewModel: model,
body: SingleChildScrollView(
physics: ScrollPhysics(),
child: Center(
child: FractionallySizedBox(
widthFactor: 0.9,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
SizedBox(
height: 30,
),
HeaderBodyExpandableNotifier(
headerWidget: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts('Physical/System Examination',
variant:
isSysExaminationExpand ? "bodyText" : '',
bold: isSysExaminationExpand ? true : false,
color: Colors.black),
Icon(
FontAwesomeIcons.asterisk,
color: AppGlobal.appPrimaryColor,
size: 12,
)
],
),
InkWell(
onTap: () {
Row(
children: [
Texts('Physical/System Examination',
variant: isSysExaminationExpand
? "bodyText"
: '',
bold: isSysExaminationExpand ? true : false,
color: Colors.black),
Icon(
FontAwesomeIcons.asterisk,
color: AppGlobal.appPrimaryColor,
size: 12,
)
],
),
InkWell(
onTap: () {
setState(() {
isSysExaminationExpand =
!isSysExaminationExpand;
@ -469,96 +500,31 @@ class _AddExaminationDailogState extends State<AddExaminationDailog> {
),
NetworkBaseView(
baseViewModel: model,
child: Container(
height:
MediaQuery
.of(context)
.size
.height * 0.5,
child: Center(
child: Container(
margin: EdgeInsets.only(top: 15),
decoration: BoxDecoration(
borderRadius: BorderRadius
.circular(12),
color: Colors.white),
child: ListView(
children: [
Column(
children: model
.physicalExaminationList
.map((examinationInfo) {
return Column(
children: [
Row(
children: [
Checkbox(
value: isServiceSelected(
examinationInfo),
activeColor:
Colors.red[800],
onChanged:
(
bool newValue) {
setState(() {
if (isServiceSelected(
examinationInfo
)) {
widget
.removeExamination(
examinationInfo
);
}
else {
MySelectedExamination mySelectedExamination = new MySelectedExamination(
selectedExamination: examinationInfo
);
widget
.mySelectedExamination
.add(
mySelectedExamination);
}
});
}),
Expanded(
child: Padding(
padding:
const EdgeInsets
.symmetric(
horizontal: 10,
vertical: 0),
child: Texts(
examinationInfo
.nameEn,
variant: "bodyText",
bold: true,
color:
Colors.black),
),
),
],
),
DividerWithSpacesAround(),
],
);
}).toList(),
),
],
),
)),
),
),
SizedBox(
height: 10,
),
if (model.state == ViewState.Idle)
AppButton(
title: "Add SELECTED Examinations"
.toUpperCase(),
onPressed: () {
child: MasterKeyCheckboxSearchWidget(
model: model,
masterList: model.physicalExaminationList,
removeHistory: (history){
setState(() {
widget.removeExamination(history);
});
},
addHistory: (history){
setState(() {
MySelectedExamination mySelectedExamination = new MySelectedExamination(
selectedExamination: history
);
widget
.mySelectedExamination
.add(
mySelectedExamination);
});
},
addSelectedHistories: (){
widget.addSelectedExamination();
},
isServiceSelected: (master) =>isServiceSelected(master),
),
),
]),
))),
)),

@ -2,6 +2,7 @@ import 'package:doctor_app_flutter/client/base_app_client.dart';
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/GetGetProgressNoteReqModel.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';
@ -53,8 +54,21 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
final screenSize = MediaQuery.of(context).size;
return BaseView<SOAPViewModel>(
// onModelReady: (model) => model.getMasterLookup(MasterKeysService.Allergies),
onModelReady: (model) async {
GetGetProgressNoteReqModel getGetProgressNoteReqModel =
GetGetProgressNoteReqModel(
appointmentNo: widget.patientInfo.appointmentNo,
patientMRN: widget.patientInfo.patientMRN,
episodeID: widget.patientInfo.episodeNo.toString());
await model.getPatientProgressNote(getGetProgressNoteReqModel);
if (model.patientProgressNoteList.isNotEmpty) {
progressNoteController.text =
model.patientProgressNoteList[0].planNote;
}
},
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
isShowAppBar: false,
body: SingleChildScrollView(
physics: ScrollPhysics(),
@ -74,8 +88,7 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
Row(
children: [
Texts('Progress Note',
variant:
isProgressNoteExpand ? "bodyText" : '',
variant: isProgressNoteExpand ? "bodyText" : '',
bold: isProgressNoteExpand ? true : false,
color: Colors.black),
Icon(
@ -88,8 +101,7 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
InkWell(
onTap: () {
setState(() {
isProgressNoteExpand =
!isProgressNoteExpand;
isProgressNoteExpand = !isProgressNoteExpand;
});
},
child: Icon(isProgressNoteExpand
@ -105,7 +117,7 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
children: [
Container(
margin:
EdgeInsets.only(left: 10, right: 10, top: 15),
EdgeInsets.only(left: 10, right: 10, top: 15),
child: TextFields(
hintText: "Add Progress Note",
fontSize: 13.5,
@ -120,8 +132,7 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
// controller: messageController,
validator: (value) {
if (value == null)
return TranslationBase
.of(context)
return TranslationBase.of(context)
.emptyMessage;
else
return null;
@ -133,10 +144,10 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
if (progressNoteController.text.isNotEmpty)
Container(
margin:
EdgeInsets.only(left: 5, right: 5, top: 15),
EdgeInsets.only(left: 5, right: 5, top: 15),
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Column(
@ -144,9 +155,9 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
children: [
Column(
mainAxisAlignment:
MainAxisAlignment.start,
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: [
AppText(
"12".toUpperCase(),
@ -163,13 +174,12 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
],
),
Column(
crossAxisAlignment: CrossAxisAlignment
.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment:
MainAxisAlignment.start,
MainAxisAlignment.start,
children: [
SizedBox(
height: 6,
@ -177,25 +187,25 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
Padding(
padding: const EdgeInsets.all(0.0),
child: Container(
width: MediaQuery
.of(context)
.size
.width * 0.6,
width: MediaQuery.of(context)
.size
.width *
0.6,
child: AppText(
progressNoteController.text,
fontSize: 10,
color: Colors.grey,
),
),
),
],
), SizedBox(
),
SizedBox(
height: 8,
),
Row(
mainAxisAlignment:
MainAxisAlignment.start,
MainAxisAlignment.start,
children: [
AppText(
"Created By : ",
@ -211,7 +221,7 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
),
Row(
mainAxisAlignment:
MainAxisAlignment.start,
MainAxisAlignment.start,
children: [
AppText(
"Edited By : ",
@ -225,7 +235,6 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
),
],
),
],
),
Column(
@ -246,14 +255,13 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
]),
isExpand: isProgressNoteExpand,
),
DividerWithSpacesAround(height: 30,),
DividerWithSpacesAround(
height: 30,
),
AppButton(
title: TranslationBase
.of(context)
.next,
title: TranslationBase.of(context).next,
loading: model.state == ViewState.BusyLocal,
onPressed: () {
submitPlan(model);
// widget.changePageViewIndex(2);
},
@ -265,7 +273,9 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
),
),
),
),),);
),
),
);
}
submitPlan(SOAPViewModel model) async {
@ -276,8 +286,13 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
appointmentNo: widget.patientInfo.appointmentNo,
planNote: progressNoteController.text);
if(model.patientProgressNoteList.isEmpty){
await model.postProgressNote(postProgressNoteRequestModel);
}else {
await model.patchProgressNote(postProgressNoteRequestModel);
await model.patchProgressNote(postProgressNoteRequestModel);
}
if (model.state == ViewState.ErrorLocal) {
helpers.showErrorToast(model.error);

@ -6,7 +6,11 @@ import 'package:doctor_app_flutter/models/SOAP/my_selected_examination.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/assessment_page.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/objective_page.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/plan_page.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/steps_widget.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/patients/profile/soap_update/subjective/update_subjective_page.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/update_assessment_page.dart';

Loading…
Cancel
Save