Merge branch 'development' of https://gitlab.com/Cloud_Solution/doctor_app_flutter into tasks-translation
Conflicts: lib/config/localized_values.dart lib/util/translations_delegate_base.dart lib/widgets/patients/profile/profile_medical_info_widget.dartmerge-requests/256/head
@ -0,0 +1,39 @@
|
|||||||
|
{
|
||||||
|
"project_info": {
|
||||||
|
"project_number": "1008895414777",
|
||||||
|
"project_id": "doctorapp-9f172",
|
||||||
|
"storage_bucket": "doctorapp-9f172.appspot.com"
|
||||||
|
},
|
||||||
|
"client": [
|
||||||
|
{
|
||||||
|
"client_info": {
|
||||||
|
"mobilesdk_app_id": "1:1008895414777:android:d00fe21d6955c21b1f6d28",
|
||||||
|
"android_client_info": {
|
||||||
|
"package_name": "com.example.doctor_app_flutter"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"oauth_client": [
|
||||||
|
{
|
||||||
|
"client_id": "1008895414777-3mg88j5ocs5r1au7rf4sh3f4pgsri2f2.apps.googleusercontent.com",
|
||||||
|
"client_type": 3
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"api_key": [
|
||||||
|
{
|
||||||
|
"current_key": "AIzaSyCNncEIj8ehVUSxV89rx0x1NaWp8t1YVkw"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"services": {
|
||||||
|
"appinvite_service": {
|
||||||
|
"other_platform_oauth_client": [
|
||||||
|
{
|
||||||
|
"client_id": "1008895414777-3mg88j5ocs5r1au7rf4sh3f4pgsri2f2.apps.googleusercontent.com",
|
||||||
|
"client_type": 3
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"configuration_version": "1"
|
||||||
|
}
|
||||||
@ -0,0 +1,39 @@
|
|||||||
|
{
|
||||||
|
"project_info": {
|
||||||
|
"project_number": "1008895414777",
|
||||||
|
"project_id": "doctorapp-9f172",
|
||||||
|
"storage_bucket": "doctorapp-9f172.appspot.com"
|
||||||
|
},
|
||||||
|
"client": [
|
||||||
|
{
|
||||||
|
"client_info": {
|
||||||
|
"mobilesdk_app_id": "1:1008895414777:android:d00fe21d6955c21b1f6d28",
|
||||||
|
"android_client_info": {
|
||||||
|
"package_name": "com.example.doctor_app_flutter"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"oauth_client": [
|
||||||
|
{
|
||||||
|
"client_id": "1008895414777-3mg88j5ocs5r1au7rf4sh3f4pgsri2f2.apps.googleusercontent.com",
|
||||||
|
"client_type": 3
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"api_key": [
|
||||||
|
{
|
||||||
|
"current_key": "AIzaSyCNncEIj8ehVUSxV89rx0x1NaWp8t1YVkw"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"services": {
|
||||||
|
"appinvite_service": {
|
||||||
|
"other_platform_oauth_client": [
|
||||||
|
{
|
||||||
|
"client_id": "1008895414777-3mg88j5ocs5r1au7rf4sh3f4pgsri2f2.apps.googleusercontent.com",
|
||||||
|
"client_type": 3
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"configuration_version": "1"
|
||||||
|
}
|
||||||
@ -1,4 +1,5 @@
|
|||||||
org.gradle.jvmargs=-Xmx1536M
|
|
||||||
android.enableR8=true
|
android.enableR8=true
|
||||||
android.useAndroidX=true
|
android.useAndroidX=true
|
||||||
android.enableJetifier=true
|
android.enableJetifier=true
|
||||||
|
org.gradle.jvmargs=-Xmx4608m
|
||||||
|
|||||||
|
After Width: | Height: | Size: 3.4 KiB |
|
After Width: | Height: | Size: 3.9 KiB |
|
After Width: | Height: | Size: 2.3 KiB |
|
After Width: | Height: | Size: 4.9 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 488 B |
|
After Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 140 KiB |
|
After Width: | Height: | Size: 3.0 KiB |
|
After Width: | Height: | Size: 2.3 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 2.1 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 2.2 KiB |
@ -0,0 +1,124 @@
|
|||||||
|
class GetIMEIDetailsModel {
|
||||||
|
int iD;
|
||||||
|
String iMEI;
|
||||||
|
int logInTypeID;
|
||||||
|
bool outSA;
|
||||||
|
String mobile;
|
||||||
|
Null identificationNo;
|
||||||
|
int doctorID;
|
||||||
|
String doctorName;
|
||||||
|
String doctorNameN;
|
||||||
|
int clinicID;
|
||||||
|
String clinicDescription;
|
||||||
|
Null clinicDescriptionN;
|
||||||
|
int projectID;
|
||||||
|
String projectName;
|
||||||
|
String genderDescription;
|
||||||
|
Null genderDescriptionN;
|
||||||
|
String titleDescription;
|
||||||
|
Null titleDescriptionN;
|
||||||
|
Null zipCode;
|
||||||
|
String createdOn;
|
||||||
|
Null createdBy;
|
||||||
|
String editedOn;
|
||||||
|
int editedBy;
|
||||||
|
bool biometricEnabled;
|
||||||
|
Null preferredLanguage;
|
||||||
|
bool isActive;
|
||||||
|
String vidaAuthTokenID;
|
||||||
|
String vidaRefreshTokenID;
|
||||||
|
|
||||||
|
GetIMEIDetailsModel(
|
||||||
|
{this.iD,
|
||||||
|
this.iMEI,
|
||||||
|
this.logInTypeID,
|
||||||
|
this.outSA,
|
||||||
|
this.mobile,
|
||||||
|
this.identificationNo,
|
||||||
|
this.doctorID,
|
||||||
|
this.doctorName,
|
||||||
|
this.doctorNameN,
|
||||||
|
this.clinicID,
|
||||||
|
this.clinicDescription,
|
||||||
|
this.clinicDescriptionN,
|
||||||
|
this.projectID,
|
||||||
|
this.projectName,
|
||||||
|
this.genderDescription,
|
||||||
|
this.genderDescriptionN,
|
||||||
|
this.titleDescription,
|
||||||
|
this.titleDescriptionN,
|
||||||
|
this.zipCode,
|
||||||
|
this.createdOn,
|
||||||
|
this.createdBy,
|
||||||
|
this.editedOn,
|
||||||
|
this.editedBy,
|
||||||
|
this.biometricEnabled,
|
||||||
|
this.preferredLanguage,
|
||||||
|
this.isActive,
|
||||||
|
this.vidaAuthTokenID,
|
||||||
|
this.vidaRefreshTokenID});
|
||||||
|
|
||||||
|
GetIMEIDetailsModel.fromJson(Map<String, dynamic> json) {
|
||||||
|
iD = json['ID'];
|
||||||
|
iMEI = json['IMEI'];
|
||||||
|
logInTypeID = json['LogInTypeID'];
|
||||||
|
outSA = json['OutSA'];
|
||||||
|
mobile = json['Mobile'];
|
||||||
|
identificationNo = json['IdentificationNo'];
|
||||||
|
doctorID = json['DoctorID'];
|
||||||
|
doctorName = json['DoctorName'];
|
||||||
|
doctorNameN = json['DoctorNameN'];
|
||||||
|
clinicID = json['ClinicID'];
|
||||||
|
clinicDescription = json['ClinicDescription'];
|
||||||
|
clinicDescriptionN = json['ClinicDescriptionN'];
|
||||||
|
projectID = json['ProjectID'];
|
||||||
|
projectName = json['ProjectName'];
|
||||||
|
genderDescription = json['Gender_Description'];
|
||||||
|
genderDescriptionN = json['Gender_DescriptionN'];
|
||||||
|
titleDescription = json['Title_Description'];
|
||||||
|
titleDescriptionN = json['Title_DescriptionN'];
|
||||||
|
zipCode = json['ZipCode'];
|
||||||
|
createdOn = json['CreatedOn'];
|
||||||
|
createdBy = json['CreatedBy'];
|
||||||
|
editedOn = json['EditedOn'];
|
||||||
|
editedBy = json['EditedBy'];
|
||||||
|
biometricEnabled = json['BiometricEnabled'];
|
||||||
|
preferredLanguage = json['PreferredLanguage'];
|
||||||
|
isActive = json['IsActive'];
|
||||||
|
vidaAuthTokenID = json['VidaAuthTokenID'];
|
||||||
|
vidaRefreshTokenID = json['VidaRefreshTokenID'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['ID'] = this.iD;
|
||||||
|
data['IMEI'] = this.iMEI;
|
||||||
|
data['LogInTypeID'] = this.logInTypeID;
|
||||||
|
data['OutSA'] = this.outSA;
|
||||||
|
data['Mobile'] = this.mobile;
|
||||||
|
data['IdentificationNo'] = this.identificationNo;
|
||||||
|
data['DoctorID'] = this.doctorID;
|
||||||
|
data['DoctorName'] = this.doctorName;
|
||||||
|
data['DoctorNameN'] = this.doctorNameN;
|
||||||
|
data['ClinicID'] = this.clinicID;
|
||||||
|
data['ClinicDescription'] = this.clinicDescription;
|
||||||
|
data['ClinicDescriptionN'] = this.clinicDescriptionN;
|
||||||
|
data['ProjectID'] = this.projectID;
|
||||||
|
data['ProjectName'] = this.projectName;
|
||||||
|
data['Gender_Description'] = this.genderDescription;
|
||||||
|
data['Gender_DescriptionN'] = this.genderDescriptionN;
|
||||||
|
data['Title_Description'] = this.titleDescription;
|
||||||
|
data['Title_DescriptionN'] = this.titleDescriptionN;
|
||||||
|
data['ZipCode'] = this.zipCode;
|
||||||
|
data['CreatedOn'] = this.createdOn;
|
||||||
|
data['CreatedBy'] = this.createdBy;
|
||||||
|
data['EditedOn'] = this.editedOn;
|
||||||
|
data['EditedBy'] = this.editedBy;
|
||||||
|
data['BiometricEnabled'] = this.biometricEnabled;
|
||||||
|
data['PreferredLanguage'] = this.preferredLanguage;
|
||||||
|
data['IsActive'] = this.isActive;
|
||||||
|
data['VidaAuthTokenID'] = this.vidaAuthTokenID;
|
||||||
|
data['VidaRefreshTokenID'] = this.vidaRefreshTokenID;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,140 @@
|
|||||||
|
class InsertIMEIDetailsModel {
|
||||||
|
String iMEI;
|
||||||
|
int logInTypeID;
|
||||||
|
Null outSA;
|
||||||
|
Null mobile;
|
||||||
|
Null identificationNo;
|
||||||
|
int doctorID;
|
||||||
|
String doctorName;
|
||||||
|
String doctorNameN;
|
||||||
|
int clinicID;
|
||||||
|
String clinicDescription;
|
||||||
|
Null clinicDescriptionN;
|
||||||
|
String projectName;
|
||||||
|
String genderDescription;
|
||||||
|
Null genderDescriptionN;
|
||||||
|
String titleDescription;
|
||||||
|
Null titleDescriptionN;
|
||||||
|
bool bioMetricEnabled;
|
||||||
|
Null preferredLanguage;
|
||||||
|
bool isActive;
|
||||||
|
int editedBy;
|
||||||
|
int projectID;
|
||||||
|
String tokenID;
|
||||||
|
int languageID;
|
||||||
|
String stamp;
|
||||||
|
String iPAdress;
|
||||||
|
double versionID;
|
||||||
|
int channel;
|
||||||
|
String sessionID;
|
||||||
|
bool isLoginForDoctorApp;
|
||||||
|
int patientOutSA;
|
||||||
|
String vidaAuthTokenID;
|
||||||
|
String vidaRefreshTokenID;
|
||||||
|
|
||||||
|
InsertIMEIDetailsModel(
|
||||||
|
{this.iMEI,
|
||||||
|
this.logInTypeID,
|
||||||
|
this.outSA,
|
||||||
|
this.mobile,
|
||||||
|
this.identificationNo,
|
||||||
|
this.doctorID,
|
||||||
|
this.doctorName,
|
||||||
|
this.doctorNameN,
|
||||||
|
this.clinicID,
|
||||||
|
this.clinicDescription,
|
||||||
|
this.clinicDescriptionN,
|
||||||
|
this.projectName,
|
||||||
|
this.genderDescription,
|
||||||
|
this.genderDescriptionN,
|
||||||
|
this.titleDescription,
|
||||||
|
this.titleDescriptionN,
|
||||||
|
this.bioMetricEnabled,
|
||||||
|
this.preferredLanguage,
|
||||||
|
this.isActive,
|
||||||
|
this.editedBy,
|
||||||
|
this.projectID,
|
||||||
|
this.tokenID,
|
||||||
|
this.languageID,
|
||||||
|
this.stamp,
|
||||||
|
this.iPAdress,
|
||||||
|
this.versionID,
|
||||||
|
this.channel,
|
||||||
|
this.sessionID,
|
||||||
|
this.isLoginForDoctorApp,
|
||||||
|
this.patientOutSA,
|
||||||
|
this.vidaAuthTokenID,
|
||||||
|
this.vidaRefreshTokenID});
|
||||||
|
|
||||||
|
InsertIMEIDetailsModel.fromJson(Map<String, dynamic> json) {
|
||||||
|
iMEI = json['IMEI'];
|
||||||
|
logInTypeID = json['LogInTypeID'];
|
||||||
|
outSA = json['OutSA'];
|
||||||
|
mobile = json['Mobile'];
|
||||||
|
identificationNo = json['IdentificationNo'];
|
||||||
|
doctorID = json['DoctorID'];
|
||||||
|
doctorName = json['DoctorName'];
|
||||||
|
doctorNameN = json['DoctorNameN'];
|
||||||
|
clinicID = json['ClinicID'];
|
||||||
|
clinicDescription = json['ClinicDescription'];
|
||||||
|
clinicDescriptionN = json['ClinicDescriptionN'];
|
||||||
|
projectName = json['ProjectName'];
|
||||||
|
genderDescription = json['GenderDescription'];
|
||||||
|
genderDescriptionN = json['GenderDescriptionN'];
|
||||||
|
titleDescription = json['TitleDescription'];
|
||||||
|
titleDescriptionN = json['Title_DescriptionN'];
|
||||||
|
bioMetricEnabled = json['BioMetricEnabled'];
|
||||||
|
preferredLanguage = json['PreferredLanguage'];
|
||||||
|
isActive = json['IsActive'];
|
||||||
|
editedBy = json['EditedBy'];
|
||||||
|
projectID = json['ProjectID'];
|
||||||
|
tokenID = json['TokenID'];
|
||||||
|
languageID = json['LanguageID'];
|
||||||
|
stamp = json['stamp'];
|
||||||
|
iPAdress = json['IPAdress'];
|
||||||
|
versionID = json['VersionID'];
|
||||||
|
channel = json['Channel'];
|
||||||
|
sessionID = json['SessionID'];
|
||||||
|
isLoginForDoctorApp = json['IsLoginForDoctorApp'];
|
||||||
|
patientOutSA = json['PatientOutSA'];
|
||||||
|
vidaAuthTokenID = json['VidaAuthTokenID'];
|
||||||
|
vidaRefreshTokenID = json['VidaRefreshTokenID'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['IMEI'] = this.iMEI;
|
||||||
|
data['LogInTypeID'] = this.logInTypeID;
|
||||||
|
data['OutSA'] = this.outSA;
|
||||||
|
data['Mobile'] = this.mobile;
|
||||||
|
data['IdentificationNo'] = this.identificationNo;
|
||||||
|
data['DoctorID'] = this.doctorID;
|
||||||
|
data['DoctorName'] = this.doctorName;
|
||||||
|
data['DoctorNameN'] = this.doctorNameN;
|
||||||
|
data['ClinicID'] = this.clinicID;
|
||||||
|
data['ClinicDescription'] = this.clinicDescription;
|
||||||
|
data['ClinicDescriptionN'] = this.clinicDescriptionN;
|
||||||
|
data['ProjectName'] = this.projectName;
|
||||||
|
data['GenderDescription'] = this.genderDescription;
|
||||||
|
data['GenderDescriptionN'] = this.genderDescriptionN;
|
||||||
|
data['TitleDescription'] = this.titleDescription;
|
||||||
|
data['Title_DescriptionN'] = this.titleDescriptionN;
|
||||||
|
data['BioMetricEnabled'] = this.bioMetricEnabled;
|
||||||
|
data['PreferredLanguage'] = this.preferredLanguage;
|
||||||
|
data['IsActive'] = this.isActive;
|
||||||
|
data['EditedBy'] = this.editedBy;
|
||||||
|
data['ProjectID'] = this.projectID;
|
||||||
|
data['TokenID'] = this.tokenID;
|
||||||
|
data['LanguageID'] = this.languageID;
|
||||||
|
data['stamp'] = this.stamp;
|
||||||
|
data['IPAdress'] = this.iPAdress;
|
||||||
|
data['VersionID'] = this.versionID;
|
||||||
|
data['Channel'] = this.channel;
|
||||||
|
data['SessionID'] = this.sessionID;
|
||||||
|
data['IsLoginForDoctorApp'] = this.isLoginForDoctorApp;
|
||||||
|
data['PatientOutSA'] = this.patientOutSA;
|
||||||
|
data['VidaAuthTokenID'] = this.vidaAuthTokenID;
|
||||||
|
data['VidaRefreshTokenID'] = this.vidaRefreshTokenID;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,29 @@
|
|||||||
|
import 'package:doctor_app_flutter/config/config.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/model/imei_details.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
|
||||||
|
import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart';
|
||||||
|
|
||||||
|
class AuthService extends BaseService {
|
||||||
|
List<GetIMEIDetailsModel> _imeiDetails = [];
|
||||||
|
List<GetIMEIDetailsModel> get dashboardItemsList => _imeiDetails;
|
||||||
|
|
||||||
|
Future selectDeviceImei(imei) async {
|
||||||
|
try {
|
||||||
|
// dynamic localRes;
|
||||||
|
await baseAppClient.post(SELECT_DEVICE_IMEI,
|
||||||
|
onSuccess: (dynamic response, int statusCode) {
|
||||||
|
_imeiDetails = [];
|
||||||
|
response['List_DoctorDeviceDetails'].forEach((v) {
|
||||||
|
_imeiDetails.add(GetIMEIDetailsModel.fromJson(v));
|
||||||
|
});
|
||||||
|
}, onFailure: (String error, int statusCode) {
|
||||||
|
hasError = true;
|
||||||
|
super.error = error;
|
||||||
|
}, body: {"IMEI": imei, "TokenID": "@dm!n"});
|
||||||
|
//return Future.value(localRes);
|
||||||
|
} catch (error) {
|
||||||
|
hasError = true;
|
||||||
|
super.error = error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,21 @@
|
|||||||
|
import 'package:doctor_app_flutter/client/base_app_client.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/model/imei_details.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/service/auth_service.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
|
||||||
|
import 'package:doctor_app_flutter/locator.dart';
|
||||||
|
|
||||||
|
class IMEIViewModel extends BaseViewModel {
|
||||||
|
AuthService _authService = locator<AuthService>();
|
||||||
|
List<GetIMEIDetailsModel> get imeiDetails => _authService.dashboardItemsList;
|
||||||
|
|
||||||
|
Future selectDeviceImei(imei) async {
|
||||||
|
setState(ViewState.Busy);
|
||||||
|
await _authService.selectDeviceImei(imei);
|
||||||
|
if (_authService.hasError) {
|
||||||
|
error = _authService.error;
|
||||||
|
setState(ViewState.Error);
|
||||||
|
} else
|
||||||
|
setState(ViewState.Idle);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,28 @@
|
|||||||
|
class PostEpisodeReqModel {
|
||||||
|
int appointmentNo;
|
||||||
|
int patientMRN;
|
||||||
|
int doctorID;
|
||||||
|
String vidaAuthTokenID;
|
||||||
|
|
||||||
|
PostEpisodeReqModel(
|
||||||
|
{this.appointmentNo,
|
||||||
|
this.patientMRN,
|
||||||
|
this.doctorID,
|
||||||
|
this.vidaAuthTokenID});
|
||||||
|
|
||||||
|
PostEpisodeReqModel.fromJson(Map<String, dynamic> json) {
|
||||||
|
appointmentNo = json['AppointmentNo'];
|
||||||
|
patientMRN = json['PatientMRN'];
|
||||||
|
doctorID = json['DoctorID'];
|
||||||
|
vidaAuthTokenID = json['VidaAuthTokenID'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['AppointmentNo'] = this.appointmentNo;
|
||||||
|
data['PatientMRN'] = this.patientMRN;
|
||||||
|
data['DoctorID'] = this.doctorID;
|
||||||
|
data['VidaAuthTokenID'] = this.vidaAuthTokenID;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,60 @@
|
|||||||
|
class ActivationCodeModel2 {
|
||||||
|
int oTPSendType;
|
||||||
|
String mobileNumber;
|
||||||
|
String zipCode;
|
||||||
|
int channel;
|
||||||
|
int languageID;
|
||||||
|
double versionID;
|
||||||
|
int memberID;
|
||||||
|
int facilityId;
|
||||||
|
String generalid;
|
||||||
|
int isMobileFingerPrint;
|
||||||
|
String vidaAuthTokenID;
|
||||||
|
String vidaRefreshTokenID;
|
||||||
|
|
||||||
|
ActivationCodeModel2(
|
||||||
|
{this.oTPSendType,
|
||||||
|
this.mobileNumber,
|
||||||
|
this.zipCode,
|
||||||
|
this.channel,
|
||||||
|
this.languageID,
|
||||||
|
this.versionID,
|
||||||
|
this.memberID,
|
||||||
|
this.facilityId,
|
||||||
|
this.generalid,
|
||||||
|
this.isMobileFingerPrint,
|
||||||
|
this.vidaAuthTokenID,
|
||||||
|
this.vidaRefreshTokenID});
|
||||||
|
|
||||||
|
ActivationCodeModel2.fromJson(Map<String, dynamic> json) {
|
||||||
|
oTPSendType = json['OTP_SendType'];
|
||||||
|
mobileNumber = json['MobileNumber'];
|
||||||
|
zipCode = json['ZipCode'];
|
||||||
|
channel = json['Channel'];
|
||||||
|
languageID = json['LanguageID'];
|
||||||
|
versionID = json['VersionID'];
|
||||||
|
memberID = json['MemberID'];
|
||||||
|
facilityId = json['facilityId'];
|
||||||
|
generalid = json['generalid'];
|
||||||
|
isMobileFingerPrint = json['IsMobileFingerPrint'];
|
||||||
|
vidaAuthTokenID = json['VidaAuthTokenID'];
|
||||||
|
vidaRefreshTokenID = json['VidaRefreshTokenID'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['OTP_SendType'] = this.oTPSendType;
|
||||||
|
data['MobileNumber'] = this.mobileNumber;
|
||||||
|
data['ZipCode'] = this.zipCode;
|
||||||
|
data['Channel'] = this.channel;
|
||||||
|
data['LanguageID'] = this.languageID;
|
||||||
|
data['VersionID'] = this.versionID;
|
||||||
|
data['MemberID'] = this.memberID;
|
||||||
|
data['facilityId'] = this.facilityId;
|
||||||
|
data['generalid'] = this.generalid;
|
||||||
|
data['IsMobileFingerPrint'] = this.isMobileFingerPrint;
|
||||||
|
data['VidaAuthTokenID'] = this.vidaAuthTokenID;
|
||||||
|
data['VidaRefreshTokenID'] = this.vidaRefreshTokenID;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,257 @@
|
|||||||
|
class VitalSignHistory {
|
||||||
|
var transNo;
|
||||||
|
var projectID;
|
||||||
|
var weightKg;
|
||||||
|
var heightCm;
|
||||||
|
var temperatureCelcius;
|
||||||
|
var pulseBeatPerMinute;
|
||||||
|
var respirationBeatPerMinute;
|
||||||
|
var bloodPressureLower;
|
||||||
|
var bloodPressureHigher;
|
||||||
|
var sAO2;
|
||||||
|
var fIO2;
|
||||||
|
var painScore;
|
||||||
|
var bodyMassIndex;
|
||||||
|
var headCircumCm;
|
||||||
|
var leanBodyWeightLbs;
|
||||||
|
var idealBodyWeightLbs;
|
||||||
|
var temperatureCelciusMethod;
|
||||||
|
var pulseRhythm;
|
||||||
|
var respirationPattern;
|
||||||
|
var bloodPressureCuffLocation;
|
||||||
|
var bloodPressureCuffSize;
|
||||||
|
var bloodPressurePatientPosition;
|
||||||
|
var painLocation;
|
||||||
|
var painDuration;
|
||||||
|
var painCharacter;
|
||||||
|
var painFrequency;
|
||||||
|
bool isPainManagementDone;
|
||||||
|
var status;
|
||||||
|
bool isVitalsRequired;
|
||||||
|
var patientID;
|
||||||
|
var createdOn;
|
||||||
|
var doctorID;
|
||||||
|
var clinicID;
|
||||||
|
var triageCategory;
|
||||||
|
var gCScore;
|
||||||
|
var lineItemNo;
|
||||||
|
DateTime vitalSignDate;
|
||||||
|
var actualTimeTaken;
|
||||||
|
var sugarLevel;
|
||||||
|
var fBS;
|
||||||
|
var rBS;
|
||||||
|
var observationType;
|
||||||
|
var heartRate;
|
||||||
|
var muscleTone;
|
||||||
|
var reflexIrritability;
|
||||||
|
var bodyColor;
|
||||||
|
var isFirstAssessment;
|
||||||
|
var dateofBirth;
|
||||||
|
var timeOfBirth;
|
||||||
|
var bloodPressure;
|
||||||
|
var bloodPressureCuffLocationDesc;
|
||||||
|
var bloodPressureCuffSizeDesc;
|
||||||
|
var bloodPressurePatientPositionDesc;
|
||||||
|
var clinicName;
|
||||||
|
var doctorImageURL;
|
||||||
|
var doctorName;
|
||||||
|
var painScoreDesc;
|
||||||
|
var pulseRhythmDesc;
|
||||||
|
var respirationPatternDesc;
|
||||||
|
var temperatureCelciusMethodDesc;
|
||||||
|
var time;
|
||||||
|
|
||||||
|
VitalSignHistory(
|
||||||
|
{this.transNo,
|
||||||
|
this.projectID,
|
||||||
|
this.weightKg,
|
||||||
|
this.heightCm,
|
||||||
|
this.temperatureCelcius,
|
||||||
|
this.pulseBeatPerMinute,
|
||||||
|
this.respirationBeatPerMinute,
|
||||||
|
this.bloodPressureLower,
|
||||||
|
this.bloodPressureHigher,
|
||||||
|
this.sAO2,
|
||||||
|
this.fIO2,
|
||||||
|
this.painScore,
|
||||||
|
this.bodyMassIndex,
|
||||||
|
this.headCircumCm,
|
||||||
|
this.leanBodyWeightLbs,
|
||||||
|
this.idealBodyWeightLbs,
|
||||||
|
this.temperatureCelciusMethod,
|
||||||
|
this.pulseRhythm,
|
||||||
|
this.respirationPattern,
|
||||||
|
this.bloodPressureCuffLocation,
|
||||||
|
this.bloodPressureCuffSize,
|
||||||
|
this.bloodPressurePatientPosition,
|
||||||
|
this.painLocation,
|
||||||
|
this.painDuration,
|
||||||
|
this.painCharacter,
|
||||||
|
this.painFrequency,
|
||||||
|
this.isPainManagementDone,
|
||||||
|
this.status,
|
||||||
|
this.isVitalsRequired,
|
||||||
|
this.patientID,
|
||||||
|
this.createdOn,
|
||||||
|
this.doctorID,
|
||||||
|
this.clinicID,
|
||||||
|
this.triageCategory,
|
||||||
|
this.gCScore,
|
||||||
|
this.lineItemNo,
|
||||||
|
this.vitalSignDate,
|
||||||
|
this.actualTimeTaken,
|
||||||
|
this.sugarLevel,
|
||||||
|
this.fBS,
|
||||||
|
this.rBS,
|
||||||
|
this.observationType,
|
||||||
|
this.heartRate,
|
||||||
|
this.muscleTone,
|
||||||
|
this.reflexIrritability,
|
||||||
|
this.bodyColor,
|
||||||
|
this.isFirstAssessment,
|
||||||
|
this.dateofBirth,
|
||||||
|
this.timeOfBirth,
|
||||||
|
this.bloodPressure,
|
||||||
|
this.bloodPressureCuffLocationDesc,
|
||||||
|
this.bloodPressureCuffSizeDesc,
|
||||||
|
this.bloodPressurePatientPositionDesc,
|
||||||
|
this.clinicName,
|
||||||
|
this.doctorImageURL,
|
||||||
|
this.doctorName,
|
||||||
|
this.painScoreDesc,
|
||||||
|
this.pulseRhythmDesc,
|
||||||
|
this.respirationPatternDesc,
|
||||||
|
this.temperatureCelciusMethodDesc,
|
||||||
|
this.time});
|
||||||
|
|
||||||
|
VitalSignHistory.fromJson(Map<String, dynamic> json) {
|
||||||
|
transNo = json['TransNo'];
|
||||||
|
projectID = json['ProjectID'];
|
||||||
|
weightKg = json['WeightKg'];
|
||||||
|
heightCm = json['HeightCm'];
|
||||||
|
temperatureCelcius = json['TemperatureCelcius'];
|
||||||
|
pulseBeatPerMinute = json['PulseBeatPerMinute'];
|
||||||
|
respirationBeatPerMinute = json['RespirationBeatPerMinute'];
|
||||||
|
bloodPressureLower = json['BloodPressureLower'];
|
||||||
|
bloodPressureHigher = json['BloodPressureHigher'];
|
||||||
|
sAO2 = json['SAO2'];
|
||||||
|
fIO2 = json['FIO2'];
|
||||||
|
painScore = json['PainScore'];
|
||||||
|
bodyMassIndex = json['BodyMassIndex'];
|
||||||
|
headCircumCm = json['HeadCircumCm'];
|
||||||
|
leanBodyWeightLbs = json['LeanBodyWeightLbs'];
|
||||||
|
idealBodyWeightLbs = json['IdealBodyWeightLbs'];
|
||||||
|
temperatureCelciusMethod = json['TemperatureCelciusMethod'];
|
||||||
|
pulseRhythm = json['PulseRhythm'];
|
||||||
|
respirationPattern = json['RespirationPattern'];
|
||||||
|
bloodPressureCuffLocation = json['BloodPressureCuffLocation'];
|
||||||
|
bloodPressureCuffSize = json['BloodPressureCuffSize'];
|
||||||
|
bloodPressurePatientPosition = json['BloodPressurePatientPosition'];
|
||||||
|
painLocation = json['PainLocation'];
|
||||||
|
painDuration = json['PainDuration'];
|
||||||
|
painCharacter = json['PainCharacter'];
|
||||||
|
painFrequency = json['PainFrequency'];
|
||||||
|
isPainManagementDone = json['IsPainManagementDone'];
|
||||||
|
status = json['Status'];
|
||||||
|
isVitalsRequired = json['IsVitalsRequired'];
|
||||||
|
patientID = json['PatientID'];
|
||||||
|
createdOn = json['CreatedOn'];
|
||||||
|
doctorID = json['DoctorID'];
|
||||||
|
clinicID = json['ClinicID'];
|
||||||
|
triageCategory = json['TriageCategory'];
|
||||||
|
gCScore = json['GCScore'];
|
||||||
|
lineItemNo = json['LineItemNo'];
|
||||||
|
vitalSignDate = json['VitalSignDate'];
|
||||||
|
actualTimeTaken = json['ActualTimeTaken'];
|
||||||
|
sugarLevel = json['SugarLevel'];
|
||||||
|
fBS = json['FBS'];
|
||||||
|
rBS = json['RBS'];
|
||||||
|
observationType = json['ObservationType'];
|
||||||
|
heartRate = json['HeartRate'];
|
||||||
|
muscleTone = json['MuscleTone'];
|
||||||
|
reflexIrritability = json['ReflexIrritability'];
|
||||||
|
bodyColor = json['BodyColor'];
|
||||||
|
isFirstAssessment = json['IsFirstAssessment'];
|
||||||
|
dateofBirth = json['DateofBirth'];
|
||||||
|
timeOfBirth = json['TimeOfBirth'];
|
||||||
|
bloodPressure = json['BloodPressure'];
|
||||||
|
bloodPressureCuffLocationDesc = json['BloodPressureCuffLocationDesc'];
|
||||||
|
bloodPressureCuffSizeDesc = json['BloodPressureCuffSizeDesc'];
|
||||||
|
bloodPressurePatientPositionDesc = json['BloodPressurePatientPositionDesc'];
|
||||||
|
clinicName = json['ClinicName'];
|
||||||
|
doctorImageURL = json['DoctorImageURL'];
|
||||||
|
doctorName = json['DoctorName'];
|
||||||
|
painScoreDesc = json['PainScoreDesc'];
|
||||||
|
pulseRhythmDesc = json['PulseRhythmDesc'];
|
||||||
|
respirationPatternDesc = json['RespirationPatternDesc'];
|
||||||
|
temperatureCelciusMethodDesc = json['TemperatureCelciusMethodDesc'];
|
||||||
|
time = json['Time'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['TransNo'] = this.transNo;
|
||||||
|
data['ProjectID'] = this.projectID;
|
||||||
|
data['WeightKg'] = this.weightKg;
|
||||||
|
data['HeightCm'] = this.heightCm;
|
||||||
|
data['TemperatureCelcius'] = this.temperatureCelcius;
|
||||||
|
data['PulseBeatPerMinute'] = this.pulseBeatPerMinute;
|
||||||
|
data['RespirationBeatPerMinute'] = this.respirationBeatPerMinute;
|
||||||
|
data['BloodPressureLower'] = this.bloodPressureLower;
|
||||||
|
data['BloodPressureHigher'] = this.bloodPressureHigher;
|
||||||
|
data['SAO2'] = this.sAO2;
|
||||||
|
data['FIO2'] = this.fIO2;
|
||||||
|
data['PainScore'] = this.painScore;
|
||||||
|
data['BodyMassIndex'] = this.bodyMassIndex;
|
||||||
|
data['HeadCircumCm'] = this.headCircumCm;
|
||||||
|
data['LeanBodyWeightLbs'] = this.leanBodyWeightLbs;
|
||||||
|
data['IdealBodyWeightLbs'] = this.idealBodyWeightLbs;
|
||||||
|
data['TemperatureCelciusMethod'] = this.temperatureCelciusMethod;
|
||||||
|
data['PulseRhythm'] = this.pulseRhythm;
|
||||||
|
data['RespirationPattern'] = this.respirationPattern;
|
||||||
|
data['BloodPressureCuffLocation'] = this.bloodPressureCuffLocation;
|
||||||
|
data['BloodPressureCuffSize'] = this.bloodPressureCuffSize;
|
||||||
|
data['BloodPressurePatientPosition'] = this.bloodPressurePatientPosition;
|
||||||
|
data['PainLocation'] = this.painLocation;
|
||||||
|
data['PainDuration'] = this.painDuration;
|
||||||
|
data['PainCharacter'] = this.painCharacter;
|
||||||
|
data['PainFrequency'] = this.painFrequency;
|
||||||
|
data['IsPainManagementDone'] = this.isPainManagementDone;
|
||||||
|
data['Status'] = this.status;
|
||||||
|
data['IsVitalsRequired'] = this.isVitalsRequired;
|
||||||
|
data['PatientID'] = this.patientID;
|
||||||
|
data['CreatedOn'] = this.createdOn;
|
||||||
|
data['DoctorID'] = this.doctorID;
|
||||||
|
data['ClinicID'] = this.clinicID;
|
||||||
|
data['TriageCategory'] = this.triageCategory;
|
||||||
|
data['GCScore'] = this.gCScore;
|
||||||
|
data['LineItemNo'] = this.lineItemNo;
|
||||||
|
data['VitalSignDate'] = this.vitalSignDate;
|
||||||
|
data['ActualTimeTaken'] = this.actualTimeTaken;
|
||||||
|
data['SugarLevel'] = this.sugarLevel;
|
||||||
|
data['FBS'] = this.fBS;
|
||||||
|
data['RBS'] = this.rBS;
|
||||||
|
data['ObservationType'] = this.observationType;
|
||||||
|
data['HeartRate'] = this.heartRate;
|
||||||
|
data['MuscleTone'] = this.muscleTone;
|
||||||
|
data['ReflexIrritability'] = this.reflexIrritability;
|
||||||
|
data['BodyColor'] = this.bodyColor;
|
||||||
|
data['IsFirstAssessment'] = this.isFirstAssessment;
|
||||||
|
data['DateofBirth'] = this.dateofBirth;
|
||||||
|
data['TimeOfBirth'] = this.timeOfBirth;
|
||||||
|
data['BloodPressure'] = this.bloodPressure;
|
||||||
|
data['BloodPressureCuffLocationDesc'] = this.bloodPressureCuffLocationDesc;
|
||||||
|
data['BloodPressureCuffSizeDesc'] = this.bloodPressureCuffSizeDesc;
|
||||||
|
data['BloodPressurePatientPositionDesc'] =
|
||||||
|
this.bloodPressurePatientPositionDesc;
|
||||||
|
data['ClinicName'] = this.clinicName;
|
||||||
|
data['DoctorImageURL'] = this.doctorImageURL;
|
||||||
|
data['DoctorName'] = this.doctorName;
|
||||||
|
data['PainScoreDesc'] = this.painScoreDesc;
|
||||||
|
data['PulseRhythmDesc'] = this.pulseRhythmDesc;
|
||||||
|
data['RespirationPatternDesc'] = this.respirationPatternDesc;
|
||||||
|
data['TemperatureCelciusMethodDesc'] = this.temperatureCelciusMethodDesc;
|
||||||
|
data['Time'] = this.time;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,217 @@
|
|||||||
|
import 'package:doctor_app_flutter/widgets/charts/app_time_series_chart.dart';
|
||||||
|
import 'package:fl_chart/fl_chart.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class LineChartCurved extends StatelessWidget {
|
||||||
|
final String title;
|
||||||
|
final List<TimeSeriesSales2> timeSeries;
|
||||||
|
final int indexes;
|
||||||
|
|
||||||
|
LineChartCurved({this.title, this.timeSeries, this.indexes});
|
||||||
|
|
||||||
|
List<int> xAxixs = List();
|
||||||
|
List<double> yAxixs = List();
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
getXaxix();
|
||||||
|
getYaxix();
|
||||||
|
return AspectRatio(
|
||||||
|
aspectRatio: 1.1,
|
||||||
|
child: Container(
|
||||||
|
decoration: const BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.all(Radius.circular(18)),
|
||||||
|
// color: Colors.white,
|
||||||
|
),
|
||||||
|
child: Stack(
|
||||||
|
children: <Widget>[
|
||||||
|
Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
|
children: <Widget>[
|
||||||
|
const SizedBox(
|
||||||
|
height: 4,
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
title,
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.black,
|
||||||
|
fontSize: 15,
|
||||||
|
letterSpacing: 2),
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
),
|
||||||
|
SizedBox(height: 10,),
|
||||||
|
Expanded(
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.only(right: 18.0, left: 16.0),
|
||||||
|
child: LineChart(
|
||||||
|
sampleData1(context),
|
||||||
|
swapAnimationDuration: const Duration(milliseconds: 250),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
height: 10,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
getXaxix() {
|
||||||
|
for (int index = 0; index < timeSeries.length; index++) {
|
||||||
|
int mIndex = indexes * index;
|
||||||
|
if (mIndex < timeSeries.length) {
|
||||||
|
xAxixs.add(mIndex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
getYaxix() {
|
||||||
|
int indexess= (timeSeries.length*0.30).toInt();
|
||||||
|
for (int index = 0; index < timeSeries.length; index++) {
|
||||||
|
int mIndex = indexess * index;
|
||||||
|
if (mIndex < timeSeries.length) {
|
||||||
|
yAxixs.add(timeSeries[mIndex].sales);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
LineChartData sampleData1(context) {
|
||||||
|
return LineChartData(
|
||||||
|
lineTouchData: LineTouchData(
|
||||||
|
touchTooltipData: LineTouchTooltipData(
|
||||||
|
tooltipBgColor: Colors.white,
|
||||||
|
|
||||||
|
),
|
||||||
|
touchCallback: (LineTouchResponse touchResponse) {},
|
||||||
|
handleBuiltInTouches: true,
|
||||||
|
),
|
||||||
|
gridData: FlGridData(
|
||||||
|
show: true, drawVerticalLine: true, drawHorizontalLine: true),
|
||||||
|
titlesData: FlTitlesData(
|
||||||
|
bottomTitles: SideTitles(
|
||||||
|
showTitles: true,
|
||||||
|
getTextStyles: (value) => const TextStyle(
|
||||||
|
color: Colors.black,
|
||||||
|
fontSize: 10,
|
||||||
|
),
|
||||||
|
rotateAngle:-65,
|
||||||
|
//rotateAngle:-65,
|
||||||
|
margin: 22,
|
||||||
|
getTitles: (value) {
|
||||||
|
if (timeSeries.length < 15) {
|
||||||
|
if (timeSeries.length > value.toInt()) {
|
||||||
|
return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}';
|
||||||
|
} else
|
||||||
|
return '';
|
||||||
|
} else {
|
||||||
|
if (value.toInt() == 0)
|
||||||
|
return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}';
|
||||||
|
if (value.toInt() == timeSeries.length - 1)
|
||||||
|
return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}';
|
||||||
|
if (xAxixs.contains(value.toInt())) {
|
||||||
|
return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return '';
|
||||||
|
},
|
||||||
|
),
|
||||||
|
leftTitles: SideTitles(
|
||||||
|
showTitles: true,
|
||||||
|
getTextStyles: (value) => const TextStyle(
|
||||||
|
color: Colors.black,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
fontSize: 10,
|
||||||
|
),
|
||||||
|
getTitles: (value) {
|
||||||
|
// if (timeSeries.length < 10) {
|
||||||
|
// return '${value.toInt()}';
|
||||||
|
// } else {
|
||||||
|
// if (value == getMinY())
|
||||||
|
// return '${value.toInt()}';
|
||||||
|
// if (value == getMaxY())
|
||||||
|
// return '${value.toInt()}';
|
||||||
|
// if (yAxixs.contains(value)) {
|
||||||
|
// return '${value.toInt()}';
|
||||||
|
// }
|
||||||
|
// return '';
|
||||||
|
// }
|
||||||
|
return '${value.toInt()}';
|
||||||
|
},
|
||||||
|
margin: 12,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
borderData: FlBorderData(
|
||||||
|
show: true,
|
||||||
|
border: const Border(
|
||||||
|
bottom: BorderSide(
|
||||||
|
color: Colors.black,
|
||||||
|
width: 0.5,
|
||||||
|
),
|
||||||
|
left: BorderSide(
|
||||||
|
color: Colors.black,
|
||||||
|
),
|
||||||
|
right: BorderSide(
|
||||||
|
color: Colors.black,
|
||||||
|
),
|
||||||
|
top: BorderSide(
|
||||||
|
color: Colors.transparent,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
minX: 0,
|
||||||
|
maxX: (timeSeries.length - 1).toDouble(),
|
||||||
|
maxY: getMaxY()+0.3,
|
||||||
|
minY: getMinY(),
|
||||||
|
lineBarsData: getData(context),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
double getMaxY() {
|
||||||
|
double max = 0;
|
||||||
|
timeSeries.forEach((element) {
|
||||||
|
double resultValueDouble = element.sales;
|
||||||
|
if (resultValueDouble > max) max = resultValueDouble;
|
||||||
|
});
|
||||||
|
|
||||||
|
return max.roundToDouble() ;
|
||||||
|
}
|
||||||
|
|
||||||
|
double getMinY() {
|
||||||
|
double min = timeSeries[0].sales;
|
||||||
|
timeSeries.forEach((element) {
|
||||||
|
double resultValueDouble = element.sales;
|
||||||
|
if (resultValueDouble < min) min = resultValueDouble;
|
||||||
|
});
|
||||||
|
int value = min.toInt();
|
||||||
|
|
||||||
|
return value.toDouble();
|
||||||
|
}
|
||||||
|
|
||||||
|
List<LineChartBarData> getData(context) {
|
||||||
|
List<FlSpot> spots = List();
|
||||||
|
for (int index = 0; index < timeSeries.length; index++) {
|
||||||
|
spots.add(FlSpot(index.toDouble(), timeSeries[index].sales));
|
||||||
|
}
|
||||||
|
|
||||||
|
final LineChartBarData lineChartBarData1 = LineChartBarData(
|
||||||
|
spots: spots,
|
||||||
|
isCurved: true,
|
||||||
|
colors: [Theme.of(context).primaryColor],
|
||||||
|
barWidth: 5,
|
||||||
|
isStrokeCapRound: true,
|
||||||
|
dotData: FlDotData(
|
||||||
|
show: false,
|
||||||
|
),
|
||||||
|
belowBarData: BarAreaData(
|
||||||
|
show: false,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
return [
|
||||||
|
lineChartBarData1,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,257 @@
|
|||||||
|
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/charts/app_time_series_chart.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
||||||
|
import 'package:fl_chart/fl_chart.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class LineChartCurvedBloodPressure extends StatelessWidget {
|
||||||
|
final String title;
|
||||||
|
final List<TimeSeriesSales2> timeSeries1;
|
||||||
|
final List<TimeSeriesSales2> timeSeries2;
|
||||||
|
final int indexes;
|
||||||
|
|
||||||
|
LineChartCurvedBloodPressure(
|
||||||
|
{this.title, this.timeSeries1, this.indexes, this.timeSeries2});
|
||||||
|
|
||||||
|
List<int> xAxixs = List();
|
||||||
|
List<double> yAxixs = List();
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
getXaxix();
|
||||||
|
return AspectRatio(
|
||||||
|
aspectRatio: 1.1,
|
||||||
|
child: Container(
|
||||||
|
decoration: const BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.all(Radius.circular(18)),
|
||||||
|
// color: Colors.white,
|
||||||
|
),
|
||||||
|
child: Stack(
|
||||||
|
children: <Widget>[
|
||||||
|
Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
|
children: <Widget>[
|
||||||
|
const SizedBox(
|
||||||
|
height: 15,
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
title,
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.black, fontSize: 15, letterSpacing: 2),
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 10,
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: Padding(
|
||||||
|
padding:
|
||||||
|
const EdgeInsets.only(right: 18.0, left: 16.0, top: 15),
|
||||||
|
child: LineChart(
|
||||||
|
sampleData1(context),
|
||||||
|
swapAnimationDuration: const Duration(milliseconds: 250),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 10,
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
width: 20,
|
||||||
|
height: 20,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
shape: BoxShape.rectangle,
|
||||||
|
color: Theme.of(context).primaryColor),
|
||||||
|
),
|
||||||
|
SizedBox(width: 5,),
|
||||||
|
AppText(TranslationBase.of(context).systolicLng)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
SizedBox(width: 15,),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
width: 20,
|
||||||
|
height: 20,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
shape: BoxShape.rectangle,
|
||||||
|
color: Colors.grey),
|
||||||
|
),
|
||||||
|
SizedBox(width: 5,),
|
||||||
|
AppText(TranslationBase.of(context).diastolicLng)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
getXaxix() {
|
||||||
|
for (int index = 0; index < timeSeries1.length; index++) {
|
||||||
|
int mIndex = indexes * index;
|
||||||
|
if (mIndex < timeSeries1.length) {
|
||||||
|
xAxixs.add(mIndex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
LineChartData sampleData1(context) {
|
||||||
|
return LineChartData(
|
||||||
|
lineTouchData: LineTouchData(
|
||||||
|
touchTooltipData: LineTouchTooltipData(
|
||||||
|
tooltipBgColor: Colors.white,
|
||||||
|
),
|
||||||
|
touchCallback: (LineTouchResponse touchResponse) {},
|
||||||
|
handleBuiltInTouches: true,
|
||||||
|
),
|
||||||
|
gridData: FlGridData(
|
||||||
|
show: true, drawVerticalLine: true, drawHorizontalLine: true),
|
||||||
|
titlesData: FlTitlesData(
|
||||||
|
bottomTitles: SideTitles(
|
||||||
|
showTitles: true,
|
||||||
|
getTextStyles: (value) => const TextStyle(
|
||||||
|
color: Colors.black,
|
||||||
|
fontSize: 10,
|
||||||
|
),
|
||||||
|
rotateAngle: -65,
|
||||||
|
//rotateAngle:-65,
|
||||||
|
margin: 22,
|
||||||
|
getTitles: (value) {
|
||||||
|
if (timeSeries1.length < 15) {
|
||||||
|
if (timeSeries1.length > value.toInt()) {
|
||||||
|
return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}';
|
||||||
|
} else
|
||||||
|
return '';
|
||||||
|
} else {
|
||||||
|
if (value.toInt() == 0)
|
||||||
|
return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}';
|
||||||
|
if (value.toInt() == timeSeries1.length - 1)
|
||||||
|
return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}';
|
||||||
|
if (xAxixs.contains(value.toInt())) {
|
||||||
|
return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return '';
|
||||||
|
},
|
||||||
|
),
|
||||||
|
leftTitles: SideTitles(
|
||||||
|
showTitles: true,
|
||||||
|
getTextStyles: (value) => const TextStyle(
|
||||||
|
color: Colors.black,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
fontSize: 10,
|
||||||
|
),
|
||||||
|
getTitles: (value) {
|
||||||
|
return '${value.toInt()}';
|
||||||
|
},
|
||||||
|
margin: 12,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
borderData: FlBorderData(
|
||||||
|
show: true,
|
||||||
|
border: const Border(
|
||||||
|
bottom: BorderSide(
|
||||||
|
color: Colors.black,
|
||||||
|
width: 0.5,
|
||||||
|
),
|
||||||
|
left: BorderSide(
|
||||||
|
color: Colors.black,
|
||||||
|
),
|
||||||
|
right: BorderSide(
|
||||||
|
color: Colors.black,
|
||||||
|
),
|
||||||
|
top: BorderSide(
|
||||||
|
color: Colors.transparent,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
minX: 0,
|
||||||
|
maxX: (timeSeries1.length - 1).toDouble(),
|
||||||
|
maxY: getMaxY() + 0.3,
|
||||||
|
minY: getMinY(),
|
||||||
|
lineBarsData: getData(context),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
double getMaxY() {
|
||||||
|
double max = 0;
|
||||||
|
timeSeries1.forEach((element) {
|
||||||
|
double resultValueDouble = element.sales;
|
||||||
|
if (resultValueDouble > max) max = resultValueDouble;
|
||||||
|
});
|
||||||
|
timeSeries2.forEach((element) {
|
||||||
|
double resultValueDouble = element.sales;
|
||||||
|
if (resultValueDouble > max) max = resultValueDouble;
|
||||||
|
});
|
||||||
|
|
||||||
|
return max.roundToDouble();
|
||||||
|
}
|
||||||
|
|
||||||
|
double getMinY() {
|
||||||
|
double min = timeSeries1[0].sales;
|
||||||
|
timeSeries1.forEach((element) {
|
||||||
|
double resultValueDouble = element.sales;
|
||||||
|
if (resultValueDouble < min) min = resultValueDouble;
|
||||||
|
});
|
||||||
|
timeSeries2.forEach((element) {
|
||||||
|
double resultValueDouble = element.sales;
|
||||||
|
if (resultValueDouble < min) min = resultValueDouble;
|
||||||
|
});
|
||||||
|
|
||||||
|
int value = min.toInt();
|
||||||
|
|
||||||
|
return value.toDouble();
|
||||||
|
}
|
||||||
|
|
||||||
|
List<LineChartBarData> getData(context) {
|
||||||
|
List<FlSpot> spots = List();
|
||||||
|
for (int index = 0; index < timeSeries1.length; index++) {
|
||||||
|
spots.add(FlSpot(index.toDouble(), timeSeries1[index].sales));
|
||||||
|
}
|
||||||
|
|
||||||
|
List<FlSpot> spots2 = List();
|
||||||
|
for (int index = 0; index < timeSeries2.length; index++) {
|
||||||
|
spots2.add(FlSpot(index.toDouble(), timeSeries2[index].sales));
|
||||||
|
}
|
||||||
|
|
||||||
|
final LineChartBarData lineChartBarData1 = LineChartBarData(
|
||||||
|
spots: spots,
|
||||||
|
isCurved: true,
|
||||||
|
colors: [Theme.of(context).primaryColor],
|
||||||
|
barWidth: 5,
|
||||||
|
isStrokeCapRound: true,
|
||||||
|
dotData: FlDotData(
|
||||||
|
show: false,
|
||||||
|
),
|
||||||
|
belowBarData: BarAreaData(
|
||||||
|
show: false,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
final LineChartBarData lineChartBarData2 = LineChartBarData(
|
||||||
|
spots: spots2,
|
||||||
|
isCurved: true,
|
||||||
|
colors: [Colors.grey],
|
||||||
|
barWidth: 5,
|
||||||
|
isStrokeCapRound: true,
|
||||||
|
dotData: FlDotData(
|
||||||
|
show: false,
|
||||||
|
),
|
||||||
|
belowBarData: BarAreaData(
|
||||||
|
show: false,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
return [lineChartBarData1, lineChartBarData2];
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,146 @@
|
|||||||
|
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
|
||||||
|
import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-data.dart';
|
||||||
|
import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-history.dart';
|
||||||
|
import 'package:doctor_app_flutter/util/date-utils.dart';
|
||||||
|
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
|
class VitalSignBloodPressureWidget extends StatefulWidget {
|
||||||
|
final List<VitalSignHistory> vitalList;
|
||||||
|
final String title1;
|
||||||
|
final String title2;
|
||||||
|
final String title3;
|
||||||
|
final String viewKey1;
|
||||||
|
final String viewKey2;
|
||||||
|
|
||||||
|
VitalSignBloodPressureWidget(
|
||||||
|
{Key key, this.vitalList, this.title1, this.title2, this.viewKey1, this.title3, this.viewKey2});
|
||||||
|
|
||||||
|
@override
|
||||||
|
_VitalSignDetailsWidgetState createState() => _VitalSignDetailsWidgetState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _VitalSignDetailsWidgetState extends State<VitalSignBloodPressureWidget> {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
ProjectViewModel projectViewModel = Provider.of(context);
|
||||||
|
return Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.transparent,
|
||||||
|
borderRadius: BorderRadius.only(
|
||||||
|
topLeft: Radius.circular(10.0), topRight: Radius.circular(10.0)),
|
||||||
|
border: Border.all(color: Colors.grey, width: 1),
|
||||||
|
),
|
||||||
|
margin: EdgeInsets.all(20),
|
||||||
|
child: Container(
|
||||||
|
color: Colors.transparent,
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: <Widget>[
|
||||||
|
Table(
|
||||||
|
border: TableBorder.symmetric(
|
||||||
|
inside: BorderSide(width: 2.0, color: Colors.grey[300]),
|
||||||
|
),
|
||||||
|
children: fullData(projectViewModel),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
List<TableRow> fullData(ProjectViewModel projectViewModel) {
|
||||||
|
List<TableRow> tableRow = [];
|
||||||
|
tableRow.add(TableRow(children: [
|
||||||
|
Container(
|
||||||
|
child: Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Theme.of(context).primaryColor,
|
||||||
|
borderRadius: BorderRadius.only(
|
||||||
|
topLeft:projectViewModel.isArabic? Radius.circular(0.0):Radius.circular(10.0),
|
||||||
|
topRight: projectViewModel.isArabic? Radius.circular(10.0):Radius.circular(0.0)
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: Center(
|
||||||
|
child: AppText(
|
||||||
|
TranslationBase.of(context).date,
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
height: 60,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
child: Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Theme.of(context).primaryColor,
|
||||||
|
|
||||||
|
),
|
||||||
|
child: Center(
|
||||||
|
child: AppText(widget.title2, color: Colors.white),
|
||||||
|
),
|
||||||
|
height: 60),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
child: Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Theme.of(context).primaryColor,
|
||||||
|
borderRadius: BorderRadius.only(
|
||||||
|
topRight: projectViewModel.isArabic? Radius.circular(0.0):Radius.circular(10.0),
|
||||||
|
topLeft: projectViewModel.isArabic? Radius.circular(10.0):Radius.circular(0.0)
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: Center(
|
||||||
|
child: AppText(widget.title3, color: Colors.white),
|
||||||
|
),
|
||||||
|
height: 60),
|
||||||
|
),
|
||||||
|
]));
|
||||||
|
widget.vitalList.forEach((vital) {
|
||||||
|
var data = vital.toJson()[widget.viewKey1];
|
||||||
|
if (data != 0)
|
||||||
|
tableRow.add(TableRow(children: [
|
||||||
|
Container(
|
||||||
|
child: Container(
|
||||||
|
padding: EdgeInsets.all(10),
|
||||||
|
color: Colors.white,
|
||||||
|
child: Center(
|
||||||
|
child: AppText(
|
||||||
|
'${projectViewModel.isArabic ? DateUtils.getWeekDayArabic(vital.vitalSignDate.weekday) : DateUtils.getWeekDay(vital.vitalSignDate.weekday)}, ${vital.vitalSignDate.day} ${projectViewModel.isArabic ? DateUtils.getMonthArabic(vital.vitalSignDate.month) : DateUtils.getMonth(vital.vitalSignDate.month)}, ${vital.vitalSignDate.year} ',
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
child: Container(
|
||||||
|
padding: EdgeInsets.all(10),
|
||||||
|
color: Colors.white,
|
||||||
|
child: Center(
|
||||||
|
child: AppText(
|
||||||
|
'${vital.toJson()[widget.viewKey1]}',
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
child: Container(
|
||||||
|
padding: EdgeInsets.all(10),
|
||||||
|
color: Colors.white,
|
||||||
|
child: Center(
|
||||||
|
child: AppText(
|
||||||
|
'${vital.toJson()[widget.viewKey2]}',
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
]));
|
||||||
|
});
|
||||||
|
return tableRow;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,246 +1,197 @@
|
|||||||
import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart';
|
import 'package:doctor_app_flutter/core/viewModel/patient-vital-sign-viewmodel.dart';
|
||||||
import 'package:doctor_app_flutter/models/patient/vital_sign/vital_sign_req_model.dart';
|
import 'package:doctor_app_flutter/lookups/patient_lookup.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/screens/base/base_view.dart';
|
||||||
|
import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sign_item.dart';
|
||||||
|
import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart';
|
||||||
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
||||||
import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.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:doctor_app_flutter/widgets/transitions/fade_page.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import '../../../../config/shared_pref_kay.dart';
|
class VitalSignDetailsScreen extends StatelessWidget {
|
||||||
import '../../../../config/size_config.dart';
|
|
||||||
import '../../../../lookups/patient_lookup.dart';
|
|
||||||
import '../../../../models/patient/patiant_info_model.dart';
|
|
||||||
import '../../../../models/patient/vital_sign/vital_sign_res_model.dart';
|
|
||||||
import '../../../../routes.dart';
|
|
||||||
import '../../../../screens/patients/profile/vital_sign/vital_sign_item.dart';
|
|
||||||
import '../../../../util/dr_app_shared_pref.dart';
|
|
||||||
import '../../../../widgets/shared/app_scaffold_widget.dart';
|
|
||||||
|
|
||||||
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
|
int appointmentNo;
|
||||||
|
int projectID;
|
||||||
|
bool isNotOneAppointment;
|
||||||
|
VitalSignDetailsScreen({this.appointmentNo, this.projectID,this.isNotOneAppointment=true});
|
||||||
|
|
||||||
class VitalSignDetailsScreen extends StatefulWidget {
|
|
||||||
// VitalSignDetailsScreen({Key key, this.vitalSing}) : super(key: key);
|
|
||||||
@override
|
@override
|
||||||
_VitalSignDetailsScreenState createState() => _VitalSignDetailsScreenState();
|
Widget build(BuildContext context) {
|
||||||
}
|
|
||||||
|
|
||||||
class _VitalSignDetailsScreenState extends State<VitalSignDetailsScreen> {
|
|
||||||
VitalSignResModel vitalSing;
|
|
||||||
String url = "assets/images/";
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
*@author: Elham Rababah
|
|
||||||
*@Date:28/4/2020
|
|
||||||
*@param: context
|
|
||||||
*@return:
|
|
||||||
*@desc: getVitalSignList Function
|
|
||||||
*/
|
|
||||||
getVitalSignList(BuildContext context, PatientViewModel model) async {
|
|
||||||
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
|
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
|
||||||
PatiantInformtion patient = routeArgs['patient'];
|
PatiantInformtion patient = routeArgs['patient'];
|
||||||
String token = await sharedPref.getString(TOKEN);
|
String from = routeArgs['from'];
|
||||||
String type = await sharedPref.getString(SLECTED_PATIENT_TYPE);
|
String to = routeArgs['to'];
|
||||||
int inOutpatientType = 1;
|
String imageBasePath = 'assets/images/';
|
||||||
if (type == '0') {
|
|
||||||
inOutpatientType = 2;
|
|
||||||
}
|
|
||||||
print(type);
|
|
||||||
VitalSignReqModel vitalSignReqModel = VitalSignReqModel(
|
|
||||||
patientID: patient.patientId,
|
|
||||||
projectID: patient.projectId,
|
|
||||||
tokenID: token,
|
|
||||||
patientTypeID: patient.patientType,
|
|
||||||
inOutpatientType: inOutpatientType,
|
|
||||||
languageID: 2,
|
|
||||||
transNo:
|
|
||||||
patient.admissionNo != null ? int.parse(patient.admissionNo) : 0);
|
|
||||||
model.getPatientVitalSign(vitalSignReqModel.toJson());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
final double contWidth = SizeConfig.realScreenWidth * 0.70;
|
|
||||||
|
|
||||||
@override
|
return BaseView<VitalSignsViewModel>(
|
||||||
Widget build(BuildContext context) {
|
onModelReady: (model) => model.getPatientVitalSignHistory(patient, from, to),
|
||||||
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
|
builder: (_, mode, widget) => AppScaffold(
|
||||||
vitalSing = routeArgs['vitalSing'];
|
isShowAppBar: true,
|
||||||
return BaseView<PatientViewModel>(
|
baseViewModel: mode,
|
||||||
onModelReady: (model) => getVitalSignList(context, model),
|
|
||||||
builder: (_, model, w) => AppScaffold(
|
|
||||||
baseViewModel: model,
|
|
||||||
appBarTitle: TranslationBase.of(context).vitalSign,
|
appBarTitle: TranslationBase.of(context).vitalSign,
|
||||||
body: model.patientVitalSignOrderdSubList.length == 0
|
body: mode.patientVitalSignsHistory.length > 0
|
||||||
? DrAppEmbeddedError(
|
? Container(
|
||||||
error: 'You don\'t have any vital Sings')
|
child: ListView(
|
||||||
: Container(
|
children: <Widget>[
|
||||||
child: Column(
|
Row(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Row(
|
InkWell(
|
||||||
children: <Widget>[
|
onTap: () =>isNotOneAppointment? Navigator.push(
|
||||||
InkWell(
|
context,
|
||||||
onTap: () {
|
FadePage(
|
||||||
Navigator.of(context).pushNamed(
|
page: VitalSignItemDetailsScreen(
|
||||||
BODY_MEASUREMENTS,
|
pageKey: vitalSignDetails.Height,
|
||||||
arguments: {
|
pageTitle: TranslationBase.of(context).height,
|
||||||
'title': TranslationBase.of(context)
|
vitalList: mode.patientVitalSignsHistory,
|
||||||
.bodyMeasurements,
|
),
|
||||||
'key':
|
),
|
||||||
vitalSignDetails.bodyMeasurements
|
):null,
|
||||||
});
|
child: Container(
|
||||||
},
|
child: VitalSignItem(
|
||||||
child: Container(
|
des: TranslationBase.of(context).height,
|
||||||
child: VitalSignItem(
|
imagePath: "${imageBasePath}vital_height.png",
|
||||||
des: TranslationBase.of(context)
|
lastVal: mode.heightCm,
|
||||||
.bodyMeasurements,
|
unit: TranslationBase.of(context).cm,
|
||||||
url: url + 'heartbeat.png',
|
),
|
||||||
lastVal: model
|
),
|
||||||
.patientVitalSignOrderdSubList[0]
|
),
|
||||||
.heightCm
|
InkWell(
|
||||||
.toString(),
|
onTap: () => isNotOneAppointment ? Navigator.push(
|
||||||
unit: 'Cm',
|
context,
|
||||||
),
|
FadePage(
|
||||||
),
|
page: VitalSignItemDetailsScreen(
|
||||||
),
|
pageKey: vitalSignDetails.Weight,
|
||||||
InkWell(
|
pageTitle: TranslationBase.of(context).weight,
|
||||||
onTap: () {
|
vitalList: mode.patientVitalSignsHistory,
|
||||||
Navigator.of(context).pushNamed(
|
),
|
||||||
BODY_MEASUREMENTS,
|
),
|
||||||
arguments: {
|
):null,
|
||||||
'title': TranslationBase.of(context)
|
child: VitalSignItem(
|
||||||
.temperature,
|
des: TranslationBase.of(context).weight,
|
||||||
'key': vitalSignDetails.temperature,
|
imagePath: "${imageBasePath}vital_weight.png",
|
||||||
});
|
unit: TranslationBase.of(context).kg,
|
||||||
},
|
lastVal: mode.weightKg,
|
||||||
child: Container(
|
),
|
||||||
child: VitalSignItem(
|
),
|
||||||
des: TranslationBase.of(context)
|
],
|
||||||
.temperature,
|
),
|
||||||
url: url + 'heartbeat.png',
|
Row(
|
||||||
lastVal: model
|
children: <Widget>[
|
||||||
.patientVitalSignOrderdSubList[0]
|
InkWell(
|
||||||
.temperatureCelcius
|
onTap: () => isNotOneAppointment ? Navigator.push(
|
||||||
.toString(),
|
context,
|
||||||
unit: 'C',
|
FadePage(
|
||||||
),
|
page: VitalSignItemDetailsScreen(
|
||||||
),
|
pageKey: vitalSignDetails.BodyMeasurements,
|
||||||
),
|
pageTitle: TranslationBase.of(context)
|
||||||
],
|
.bodyMeasurements,
|
||||||
|
vitalList: mode.patientVitalSignsHistory,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
): null,
|
||||||
|
child: VitalSignItem(
|
||||||
|
des: TranslationBase.of(context).body,
|
||||||
|
imagePath: "${imageBasePath}vital_body_mass.png",
|
||||||
|
lastVal: mode.bodyMax,
|
||||||
|
unit: TranslationBase.of(context).mass,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
InkWell(
|
||||||
|
onTap: () => isNotOneAppointment ? Navigator.push(
|
||||||
|
context,
|
||||||
|
FadePage(
|
||||||
|
page: VitalSignItemDetailsScreen(
|
||||||
|
pageKey: vitalSignDetails.Temperature,
|
||||||
|
pageTitle:
|
||||||
|
TranslationBase.of(context).temperature,
|
||||||
|
vitalList: mode.patientVitalSignsHistory,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
):null,
|
||||||
|
child: Container(
|
||||||
|
child: VitalSignItem(
|
||||||
|
des: TranslationBase.of(context).temperature,
|
||||||
|
imagePath: "${imageBasePath}vital_temperature.png",
|
||||||
|
lastVal: mode.temperatureCelcius,
|
||||||
|
unit: TranslationBase.of(context).tempC,
|
||||||
),
|
),
|
||||||
Row(
|
),
|
||||||
children: <Widget>[
|
),
|
||||||
InkWell(
|
],
|
||||||
onTap: () {
|
),
|
||||||
Navigator.of(context).pushNamed(
|
Row(
|
||||||
BODY_MEASUREMENTS,
|
children: <Widget>[
|
||||||
arguments: {
|
InkWell(
|
||||||
'title':
|
onTap: () => isNotOneAppointment ? Navigator.push(
|
||||||
TranslationBase.of(context).pulse,
|
context,
|
||||||
'key': vitalSignDetails.pulse
|
FadePage(
|
||||||
});
|
page: VitalSignItemDetailsScreen(
|
||||||
},
|
pageKey: vitalSignDetails.heart,
|
||||||
child: VitalSignItem(
|
pageTitle: TranslationBase.of(context).heart,
|
||||||
des: TranslationBase.of(context).pulse,
|
vitalList: mode.patientVitalSignsHistory,
|
||||||
url: url + 'heartbeat.png',
|
),
|
||||||
lastVal: model
|
|
||||||
.patientVitalSignOrderdSubList[0]
|
|
||||||
.pulseBeatPerMinute
|
|
||||||
.toString(),
|
|
||||||
unit: 'M',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
InkWell(
|
|
||||||
onTap: () {
|
|
||||||
Navigator.of(context).pushNamed(
|
|
||||||
BODY_MEASUREMENTS,
|
|
||||||
arguments: {
|
|
||||||
'title': TranslationBase.of(context)
|
|
||||||
.respiration,
|
|
||||||
'key': vitalSignDetails.pespiration
|
|
||||||
});
|
|
||||||
},
|
|
||||||
child: VitalSignItem(
|
|
||||||
des:
|
|
||||||
TranslationBase.of(context).respiration,
|
|
||||||
url: url + 'heartbeat.png',
|
|
||||||
lastVal: model
|
|
||||||
.patientVitalSignOrderdSubList[0]
|
|
||||||
.respirationBeatPerMinute
|
|
||||||
.toString(),
|
|
||||||
unit: 'M',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
Row(
|
):null,
|
||||||
children: <Widget>[
|
child: VitalSignItem(
|
||||||
InkWell(
|
des: TranslationBase.of(context).heart,
|
||||||
onTap: () {
|
imagePath: "${imageBasePath}vital_heart_rate.png",
|
||||||
Navigator.of(context).pushNamed(
|
lastVal: mode.hartRat,
|
||||||
BODY_MEASUREMENTS,
|
unit: TranslationBase.of(context).bpm,
|
||||||
arguments: {
|
),
|
||||||
'title': TranslationBase.of(context)
|
),
|
||||||
.bloodPressure,
|
InkWell(
|
||||||
'key': vitalSignDetails.bloodPressure
|
onTap: () => isNotOneAppointment ? Navigator.push(
|
||||||
});
|
context,
|
||||||
},
|
FadePage(
|
||||||
child: VitalSignItem(
|
page: VitalSignItemDetailsScreen(
|
||||||
des: TranslationBase.of(context)
|
pageKey: vitalSignDetails.Respiration,
|
||||||
.bloodPressure,
|
pageTitle:
|
||||||
url: url + 'heartbeat.png',
|
TranslationBase.of(context).respirationRate,
|
||||||
lastVal: model
|
vitalList: mode.patientVitalSignsHistory,
|
||||||
.patientVitalSignOrderdSubList[0]
|
),
|
||||||
.bloodPressure
|
|
||||||
.toString(),
|
|
||||||
unit: '',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
InkWell(
|
|
||||||
onTap: () {
|
|
||||||
Navigator.of(context).pushNamed(
|
|
||||||
BODY_MEASUREMENTS,
|
|
||||||
arguments: {
|
|
||||||
'title': TranslationBase.of(context)
|
|
||||||
.oxygenation,
|
|
||||||
'key': vitalSignDetails.oxygenation
|
|
||||||
});
|
|
||||||
},
|
|
||||||
child: VitalSignItem(
|
|
||||||
des:
|
|
||||||
TranslationBase.of(context).oxygenation,
|
|
||||||
url: url + 'heartbeat.png',
|
|
||||||
lastVal: model
|
|
||||||
.patientVitalSignOrderdSubList[0].fIO2
|
|
||||||
.toString(),
|
|
||||||
unit: '',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
Row(
|
):null,
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
child: VitalSignItem(
|
||||||
children: <Widget>[
|
des: TranslationBase.of(context).respirationRate,
|
||||||
InkWell(
|
imagePath: "${imageBasePath}vital_respiration.png",
|
||||||
onTap: () {
|
lastVal: mode.respirationBeatPerMinute,
|
||||||
Navigator.of(context).pushNamed(
|
unit: TranslationBase.of(context).respirationSigns,
|
||||||
BODY_MEASUREMENTS,
|
),
|
||||||
arguments: {
|
),
|
||||||
'title': TranslationBase.of(context)
|
],
|
||||||
.painScale,
|
),
|
||||||
'key': vitalSignDetails.painScale
|
Row(
|
||||||
});
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
},
|
children: <Widget>[
|
||||||
child: VitalSignItem(
|
InkWell(
|
||||||
des: TranslationBase
|
onTap: () => isNotOneAppointment ? Navigator.push(
|
||||||
.of(context)
|
context,
|
||||||
.painScale,
|
FadePage(
|
||||||
url: url + 'heartbeat.png',
|
page: VitalSignItemDetailsScreen(
|
||||||
),
|
pageKey: vitalSignDetails.BloodPressure,
|
||||||
),
|
pageTitle: TranslationBase.of(context).bloodPressure,
|
||||||
],
|
vitalList: mode.patientVitalSignsHistory,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
],
|
):null,
|
||||||
|
child: VitalSignItem(
|
||||||
|
des: TranslationBase.of(context).bloodPressure,
|
||||||
|
imagePath: "${imageBasePath}vital_blood-pressure.png",
|
||||||
|
lastVal: mode.bloodPressure,
|
||||||
|
unit: TranslationBase.of(context).sysDias,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
)
|
||||||
|
: Center(
|
||||||
|
child: AppText('No Data'),
|
||||||
),
|
),
|
||||||
),),);
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,122 @@
|
|||||||
|
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
|
||||||
|
import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-data.dart';
|
||||||
|
import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-history.dart';
|
||||||
|
import 'package:doctor_app_flutter/util/date-utils.dart';
|
||||||
|
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:hexcolor/hexcolor.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
|
class VitalSignDetailsWidget extends StatefulWidget {
|
||||||
|
final List<VitalSignHistory> vitalList;
|
||||||
|
final String title1;
|
||||||
|
final String title2;
|
||||||
|
final String viewKey;
|
||||||
|
|
||||||
|
VitalSignDetailsWidget(
|
||||||
|
{Key key, this.vitalList, this.title1, this.title2, this.viewKey});
|
||||||
|
|
||||||
|
@override
|
||||||
|
_VitalSignDetailsWidgetState createState() => _VitalSignDetailsWidgetState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _VitalSignDetailsWidgetState extends State<VitalSignDetailsWidget> {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
ProjectViewModel projectViewModel = Provider.of(context);
|
||||||
|
return Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.transparent,
|
||||||
|
borderRadius: BorderRadius.only(
|
||||||
|
topLeft: Radius.circular(10.0), topRight: Radius.circular(10.0)),
|
||||||
|
border: Border.all(color: Colors.grey, width: 1),
|
||||||
|
),
|
||||||
|
margin: EdgeInsets.all(20),
|
||||||
|
child: Container(
|
||||||
|
color: Colors.transparent,
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: <Widget>[
|
||||||
|
Table(
|
||||||
|
border: TableBorder.symmetric(
|
||||||
|
inside: BorderSide(width: 2.0, color: Colors.grey[300]),
|
||||||
|
),
|
||||||
|
children: fullData(projectViewModel),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
List<TableRow> fullData(ProjectViewModel projectViewModel) {
|
||||||
|
List<TableRow> tableRow = [];
|
||||||
|
tableRow.add(TableRow(children: [
|
||||||
|
Container(
|
||||||
|
child: Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Theme.of(context).primaryColor,
|
||||||
|
borderRadius: BorderRadius.only(
|
||||||
|
topLeft:projectViewModel.isArabic? Radius.circular(0.0):Radius.circular(10.0),
|
||||||
|
topRight: projectViewModel.isArabic? Radius.circular(10.0):Radius.circular(0.0)
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: Center(
|
||||||
|
child: AppText(
|
||||||
|
TranslationBase.of(context).date,
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
height: 60,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
child: Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Theme.of(context).primaryColor,
|
||||||
|
borderRadius: BorderRadius.only(
|
||||||
|
topRight: projectViewModel.isArabic? Radius.circular(0.0):Radius.circular(10.0),
|
||||||
|
topLeft: projectViewModel.isArabic? Radius.circular(10.0):Radius.circular(0.0)
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: Center(
|
||||||
|
child: AppText(widget.title2, color: Colors.white),
|
||||||
|
),
|
||||||
|
height: 60),
|
||||||
|
)
|
||||||
|
]));
|
||||||
|
widget.vitalList.forEach((vital) {
|
||||||
|
var data = vital.toJson()[widget.viewKey];
|
||||||
|
if (data != 0)
|
||||||
|
tableRow.add(TableRow(children: [
|
||||||
|
Container(
|
||||||
|
child: Container(
|
||||||
|
padding: EdgeInsets.all(10),
|
||||||
|
color: Colors.white,
|
||||||
|
child: Center(
|
||||||
|
child: AppText(
|
||||||
|
'${projectViewModel.isArabic ? DateUtils.getWeekDayArabic(vital.vitalSignDate.weekday) : DateUtils.getWeekDay(vital.vitalSignDate.weekday)}, ${vital.vitalSignDate.day} ${projectViewModel.isArabic ? DateUtils.getMonthArabic(vital.vitalSignDate.month) : DateUtils.getMonth(vital.vitalSignDate.month)}, ${vital.vitalSignDate.year} ',
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
child: Container(
|
||||||
|
padding: EdgeInsets.all(10),
|
||||||
|
color: Colors.white,
|
||||||
|
child: Center(
|
||||||
|
child: AppText(
|
||||||
|
'${vital.toJson()[widget.viewKey]}',
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
]));
|
||||||
|
});
|
||||||
|
return tableRow;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,85 @@
|
|||||||
|
import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-data.dart';
|
||||||
|
import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-history.dart';
|
||||||
|
import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sign_details_blood_pressurewideget.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/charts/app_time_series_chart.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/shared/app_expandable_notifier.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
import 'package:charts_flutter/flutter.dart' as charts;
|
||||||
|
|
||||||
|
import 'LineChartCurved.dart';
|
||||||
|
import 'LineChartCurvedBloodPressure.dart';
|
||||||
|
|
||||||
|
class VitalSingChartBloodPressure extends StatelessWidget {
|
||||||
|
VitalSingChartBloodPressure({
|
||||||
|
Key key,
|
||||||
|
@required this.vitalList,
|
||||||
|
@required this.name,
|
||||||
|
@required this.viewKey1,
|
||||||
|
@required this.viewKey2,
|
||||||
|
@required this.title1,
|
||||||
|
@required this.title2,
|
||||||
|
@required this.title3,
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
|
final List<VitalSignHistory> vitalList;
|
||||||
|
final String name;
|
||||||
|
final String viewKey1;
|
||||||
|
final String viewKey2;
|
||||||
|
final String title1;
|
||||||
|
final String title2;
|
||||||
|
final String title3;
|
||||||
|
List<TimeSeriesSales2> timeSeriesData1 = [];
|
||||||
|
List<TimeSeriesSales2> timeSeriesData2 = [];
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
generateData();
|
||||||
|
return Column(
|
||||||
|
children: <Widget>[
|
||||||
|
AppExpandableNotifier(
|
||||||
|
// isExpand: true,
|
||||||
|
headerWid: LineChartCurvedBloodPressure(
|
||||||
|
title: name,
|
||||||
|
timeSeries1: timeSeriesData1,
|
||||||
|
timeSeries2: timeSeriesData2,
|
||||||
|
indexes: timeSeriesData1.length ~/ 5.5,
|
||||||
|
),
|
||||||
|
bodyWid: VitalSignBloodPressureWidget(
|
||||||
|
vitalList: vitalList,
|
||||||
|
title1: title1,
|
||||||
|
title2: title2,
|
||||||
|
title3: title3,
|
||||||
|
viewKey1: viewKey1,
|
||||||
|
viewKey2: viewKey2,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
generateData() {
|
||||||
|
if (vitalList.length > 0) {
|
||||||
|
vitalList.reversed.toList().forEach(
|
||||||
|
(element) {
|
||||||
|
if (element.toJson()[viewKey1]?.toInt() != 0)
|
||||||
|
timeSeriesData1.add(
|
||||||
|
TimeSeriesSales2(
|
||||||
|
new DateTime(element.vitalSignDate.year,
|
||||||
|
element.vitalSignDate.month, element.vitalSignDate.day),
|
||||||
|
element.toJson()[viewKey1].toDouble(),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
if (element.toJson()[viewKey2]?.toInt() != 0)
|
||||||
|
timeSeriesData2.add(
|
||||||
|
TimeSeriesSales2(
|
||||||
|
new DateTime(element.vitalSignDate.year,
|
||||||
|
element.vitalSignDate.month, element.vitalSignDate.day),
|
||||||
|
element.toJson()[viewKey2].toDouble(),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,89 @@
|
|||||||
|
import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
|
||||||
|
import 'package:doctor_app_flutter/config/size_config.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/viewModel/patient-vital-sign-viewmodel.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart';
|
||||||
|
import 'package:doctor_app_flutter/models/SOAP/GeneralGetReqForSOAP.dart';
|
||||||
|
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
|
||||||
|
import 'package:doctor_app_flutter/models/patient/vital_sign/vital_sign_req_model.dart';
|
||||||
|
import 'package:doctor_app_flutter/screens/base/base_view.dart';
|
||||||
|
import 'package:doctor_app_flutter/screens/medicine/medicine_search_screen.dart';
|
||||||
|
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class DrugToDrug extends StatefulWidget {
|
||||||
|
final PatiantInformtion patient;
|
||||||
|
DrugToDrug(this.patient);
|
||||||
|
@override
|
||||||
|
_DrugToDrug createState() => _DrugToDrug();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _DrugToDrug extends State<DrugToDrug> {
|
||||||
|
int typeID = 1;
|
||||||
|
List<Map<dynamic, dynamic>> expandableList = [
|
||||||
|
{'name': 'CRITICAL'},
|
||||||
|
{'name': 'HIGH'},
|
||||||
|
{'name': 'MODERATE'},
|
||||||
|
{'name': 'LOW'},
|
||||||
|
{'name': 'INFO'},
|
||||||
|
];
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
getTypeID();
|
||||||
|
super.initState();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
GeneralGetReqForSOAP generalGetReqForSOAP = GeneralGetReqForSOAP(
|
||||||
|
patientMRN: 2954208, //widget.patient.patientMRN,
|
||||||
|
episodeId: 210011002, //widget.patient.episodeNo,
|
||||||
|
appointmentNo: 2016055308, //widget.patient.appointmentNo,
|
||||||
|
doctorID: '',
|
||||||
|
editedBy: '');
|
||||||
|
|
||||||
|
return BaseView<VitalSignsViewModel>(
|
||||||
|
onModelReady: (model) => model.getPatientVitalSign(widget.patient),
|
||||||
|
builder: (BuildContext context, model, Widget child) {
|
||||||
|
return BaseView<SOAPViewModel>(
|
||||||
|
onModelReady: (model2) =>
|
||||||
|
model2.getPatientAllergy(generalGetReqForSOAP),
|
||||||
|
builder: (BuildContext context, model2, Widget child) {
|
||||||
|
return BaseView<PrescriptionViewModel>(
|
||||||
|
onModelReady: (model3) => model3.getDrugToDrug(
|
||||||
|
model.patientVitalSigns, model2.patientAllergiesList),
|
||||||
|
builder: (BuildContext context,
|
||||||
|
PrescriptionViewModel model3, Widget child) =>
|
||||||
|
NetworkBaseView(
|
||||||
|
baseViewModel: model3,
|
||||||
|
child: Container(
|
||||||
|
height: SizeConfig.realScreenHeight * .45,
|
||||||
|
child: new ListView.builder(
|
||||||
|
itemCount: expandableList.length,
|
||||||
|
itemBuilder: (context, i) {
|
||||||
|
return new ExpansionTile(
|
||||||
|
title: new Text(
|
||||||
|
expandableList[i]['name'],
|
||||||
|
style: new TextStyle(
|
||||||
|
fontSize: 20.0,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
fontStyle: FontStyle.italic),
|
||||||
|
),
|
||||||
|
children: <Widget>[Text('Hi')],
|
||||||
|
);
|
||||||
|
}))));
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
getTypeID() async {
|
||||||
|
var type = await sharedPref.getString(SLECTED_PATIENT_TYPE) == '0' ? 2 : 1;
|
||||||
|
setState(() {
|
||||||
|
typeID = type;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,43 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:charts_flutter/flutter.dart' as charts;
|
||||||
|
|
||||||
|
class AppBarChart extends StatelessWidget {
|
||||||
|
const AppBarChart({
|
||||||
|
Key key,
|
||||||
|
@required this.seriesList,
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
|
final List<charts.Series> seriesList;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Container(
|
||||||
|
height: 400,
|
||||||
|
margin: EdgeInsets.only(top: 60),
|
||||||
|
child: charts.BarChart(
|
||||||
|
seriesList,
|
||||||
|
// animate: animate,
|
||||||
|
|
||||||
|
/// Customize the primary measure axis using a small tick renderer.
|
||||||
|
/// Use String instead of num for ordinal domain axis
|
||||||
|
/// (typically bar charts).
|
||||||
|
primaryMeasureAxis: new charts.NumericAxisSpec(
|
||||||
|
renderSpec: new charts.GridlineRendererSpec(
|
||||||
|
// Display the measure axis labels below the gridline.
|
||||||
|
//
|
||||||
|
// 'Before' & 'after' follow the axis value direction.
|
||||||
|
// Vertical axes draw 'before' below & 'after' above the tick.
|
||||||
|
// Horizontal axes draw 'before' left & 'after' right the tick.
|
||||||
|
labelAnchor: charts.TickLabelAnchor.before,
|
||||||
|
|
||||||
|
// Left justify the text in the axis.
|
||||||
|
//
|
||||||
|
// Note: outside means that the secondary measure axis would right
|
||||||
|
// justify.
|
||||||
|
labelJustification:
|
||||||
|
charts.TickLabelJustification.outside,
|
||||||
|
)),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,44 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:charts_flutter/flutter.dart' as charts;
|
||||||
|
|
||||||
|
/// chart line
|
||||||
|
/// [seriesList] charts series
|
||||||
|
/// [chartTitle] the charts title
|
||||||
|
/// [animate] enable and disable animate on create chart
|
||||||
|
/// [includeArea] chart include Area
|
||||||
|
/// [stacked] stacked chart over the design
|
||||||
|
class AppLineChart extends StatelessWidget {
|
||||||
|
final List<charts.Series> seriesList;
|
||||||
|
final String chartTitle;
|
||||||
|
final bool animate;
|
||||||
|
final bool includeArea;
|
||||||
|
final bool stacked;
|
||||||
|
|
||||||
|
AppLineChart(
|
||||||
|
{Key key,
|
||||||
|
@required this.seriesList,
|
||||||
|
this.chartTitle,
|
||||||
|
this.animate = true,
|
||||||
|
this.includeArea = false,
|
||||||
|
this.stacked = true});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Container(
|
||||||
|
child: Column(
|
||||||
|
children: <Widget>[
|
||||||
|
Text(
|
||||||
|
chartTitle,
|
||||||
|
style: TextStyle(fontSize: 24.0, fontWeight: FontWeight.bold),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: charts.LineChart(seriesList,
|
||||||
|
defaultRenderer: charts.LineRendererConfig(
|
||||||
|
includeArea: false, stacked: true),
|
||||||
|
animate: animate),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,71 @@
|
|||||||
|
import 'package:charts_flutter/flutter.dart' as charts;
|
||||||
|
import 'package:charts_flutter/flutter.dart';
|
||||||
|
import 'package:doctor_app_flutter/config/size_config.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/data_display/list/flexible_container.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
/// App Time Series Chart
|
||||||
|
/// [seriesList] the series list
|
||||||
|
/// [chartName] the name of the chart
|
||||||
|
/// [startDate] the start date
|
||||||
|
/// [endDate] the end date
|
||||||
|
class AppTimeSeriesChart extends StatelessWidget {
|
||||||
|
AppTimeSeriesChart({
|
||||||
|
Key key,
|
||||||
|
@required this.seriesList,
|
||||||
|
this.chartName = '',
|
||||||
|
this.startDate,
|
||||||
|
this.endDate,
|
||||||
|
});
|
||||||
|
|
||||||
|
final String chartName;
|
||||||
|
final List<Series<dynamic, DateTime>> seriesList;
|
||||||
|
final DateTime startDate;
|
||||||
|
final DateTime endDate;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return FlexibleContainer(
|
||||||
|
heightFactor: 0.47,
|
||||||
|
child: Column(
|
||||||
|
children: <Widget>[
|
||||||
|
AppText(chartName, fontSize: SizeConfig.textMultiplier * 3),
|
||||||
|
Container(
|
||||||
|
height: SizeConfig.realScreenHeight * 0.37,
|
||||||
|
child: Center(
|
||||||
|
child: Container(
|
||||||
|
child: charts.TimeSeriesChart(
|
||||||
|
seriesList,
|
||||||
|
animate: true,
|
||||||
|
behaviors: [
|
||||||
|
charts.RangeAnnotation(
|
||||||
|
[
|
||||||
|
charts.RangeAnnotationSegment(startDate, endDate,
|
||||||
|
charts.RangeAnnotationAxisType.domain ),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class TimeSeriesSales {
|
||||||
|
final DateTime time;
|
||||||
|
final int sales;
|
||||||
|
|
||||||
|
TimeSeriesSales(this.time, this.sales);
|
||||||
|
}
|
||||||
|
|
||||||
|
class TimeSeriesSales2 {
|
||||||
|
final DateTime time;
|
||||||
|
final double sales;
|
||||||
|
|
||||||
|
TimeSeriesSales2(this.time, this.sales);
|
||||||
|
}
|
||||||
@ -0,0 +1,93 @@
|
|||||||
|
import 'package:eva_icons_flutter/eva_icons_flutter.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
/// Custom Item widget
|
||||||
|
/// [startIcon] icon at the start of the widget
|
||||||
|
/// [startIconSize] icon size of start icon
|
||||||
|
/// [startIconColor] icon color of start icon
|
||||||
|
/// [endIcon] icon at the end of the widget
|
||||||
|
/// [endIconSize] icon size of end icon
|
||||||
|
/// [endIconColor] icon color of end icon
|
||||||
|
/// [disabled] disabled on tap function
|
||||||
|
/// [onTap] opTap function
|
||||||
|
/// [padding] padding of the widget
|
||||||
|
/// [child] child of the widget
|
||||||
|
/// [decoration] decoration of the widget
|
||||||
|
class CustomItem extends StatelessWidget {
|
||||||
|
final IconData startIcon;
|
||||||
|
final double startIconSize;
|
||||||
|
final Color startIconColor;
|
||||||
|
final IconData endIcon;
|
||||||
|
final double endIconSize;
|
||||||
|
final Color endIconColor;
|
||||||
|
final bool disabled;
|
||||||
|
final Function onTap;
|
||||||
|
final EdgeInsets padding;
|
||||||
|
final Widget child;
|
||||||
|
final BoxDecoration decoration;
|
||||||
|
|
||||||
|
CustomItem(
|
||||||
|
{Key key,
|
||||||
|
this.startIcon,
|
||||||
|
this.disabled: false,
|
||||||
|
this.onTap,
|
||||||
|
this.startIconColor,
|
||||||
|
this.endIcon = EvaIcons.chevronRight,
|
||||||
|
this.padding,
|
||||||
|
this.child,
|
||||||
|
this.endIconColor,
|
||||||
|
this.endIconSize = 20,
|
||||||
|
this.decoration,
|
||||||
|
this.startIconSize = 19})
|
||||||
|
: super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return IgnorePointer(
|
||||||
|
ignoring: disabled,
|
||||||
|
child: Container(
|
||||||
|
decoration: decoration != null ? decoration : BoxDecoration(),
|
||||||
|
child: InkWell(
|
||||||
|
onTap: () {
|
||||||
|
if (onTap != null) onTap();
|
||||||
|
},
|
||||||
|
child: Padding(
|
||||||
|
padding: padding != null
|
||||||
|
? padding
|
||||||
|
: const EdgeInsets.symmetric(horizontal: 24.0, vertical: 16.0),
|
||||||
|
child: Row(
|
||||||
|
children: <Widget>[
|
||||||
|
if (startIcon != null)
|
||||||
|
Expanded(
|
||||||
|
flex: 1,
|
||||||
|
child: Icon(
|
||||||
|
startIcon,
|
||||||
|
color: startIconColor ?? Theme.of(context).primaryColor,
|
||||||
|
size: startIconSize,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
if (startIcon != null) SizedBox(width: 18.0),
|
||||||
|
Expanded(
|
||||||
|
child: child,
|
||||||
|
flex: 10,
|
||||||
|
),
|
||||||
|
endIcon == null
|
||||||
|
? Expanded(child: Container())
|
||||||
|
: Expanded(
|
||||||
|
flex: 1,
|
||||||
|
child: Icon(
|
||||||
|
endIcon,
|
||||||
|
color: endIconColor != null
|
||||||
|
? endIconColor
|
||||||
|
: Colors.grey[500],
|
||||||
|
size: endIconSize,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,50 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
/// Flexible container widget
|
||||||
|
/// [widthFactor] If non-null, the fraction of the incoming width given to the child.
|
||||||
|
/// If non-null, the child is given a tight width constraint that is the max
|
||||||
|
/// incoming width constraint multiplied by this factor.
|
||||||
|
/// If null, the incoming width constraints are passed to the child
|
||||||
|
|
||||||
|
/// [heightFactor]If non-null, the fraction of the incoming height given to the child.
|
||||||
|
/// If non-null, the child is given a tight height constraint that is the max
|
||||||
|
/// incoming height constraint multiplied by this factor.
|
||||||
|
/// If null, the incoming height constraints are passed to the child
|
||||||
|
/// [padding] add padding to the container
|
||||||
|
/// [child] child widget inside the container
|
||||||
|
class FlexibleContainer extends StatelessWidget {
|
||||||
|
final double widthFactor;
|
||||||
|
final double heightFactor;
|
||||||
|
final EdgeInsets padding;
|
||||||
|
final Widget child;
|
||||||
|
|
||||||
|
FlexibleContainer({
|
||||||
|
Key key,
|
||||||
|
this.widthFactor = 0.9,
|
||||||
|
this.heightFactor = 1,
|
||||||
|
this.padding,
|
||||||
|
this.child,
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Container(
|
||||||
|
// widthFactor: widthFactor,
|
||||||
|
// heightFactor: heightFactor,
|
||||||
|
child: ClipRRect(
|
||||||
|
borderRadius: BorderRadius.circular(8.0),
|
||||||
|
child: Material(
|
||||||
|
color: Theme.of(context).backgroundColor,
|
||||||
|
child: Container(
|
||||||
|
padding: padding,
|
||||||
|
width: double.infinity,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
border: Border.all(
|
||||||
|
color: Theme.of(context).dividerColor, width: 2.0),
|
||||||
|
borderRadius: BorderRadius.circular(8.0)),
|
||||||
|
child: child,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,346 @@
|
|||||||
|
import 'dart:async';
|
||||||
|
|
||||||
|
import 'package:doctor_app_flutter/config/size_config.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
|
||||||
|
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'dart:math';
|
||||||
|
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
|
class SMSOTP {
|
||||||
|
final type;
|
||||||
|
final mobileNo;
|
||||||
|
final Function onSuccess;
|
||||||
|
final Function onFailure;
|
||||||
|
final context;
|
||||||
|
|
||||||
|
int remainingTime = 600;
|
||||||
|
|
||||||
|
Future<Null> timer;
|
||||||
|
|
||||||
|
static BuildContext _context;
|
||||||
|
|
||||||
|
static bool _loading;
|
||||||
|
|
||||||
|
SMSOTP(
|
||||||
|
this.context,
|
||||||
|
this.type,
|
||||||
|
this.mobileNo,
|
||||||
|
this.onSuccess,
|
||||||
|
this.onFailure,
|
||||||
|
);
|
||||||
|
|
||||||
|
final verifyAccountForm = GlobalKey<FormState>();
|
||||||
|
|
||||||
|
TextEditingController digit1 = TextEditingController(text: "");
|
||||||
|
TextEditingController digit2 = TextEditingController(text: "");
|
||||||
|
TextEditingController digit3 = TextEditingController(text: "");
|
||||||
|
TextEditingController digit4 = TextEditingController(text: "");
|
||||||
|
|
||||||
|
Map verifyAccountFormValue = {
|
||||||
|
'digit1': '',
|
||||||
|
'digit2': '',
|
||||||
|
'digit3': '',
|
||||||
|
'digit4': '',
|
||||||
|
};
|
||||||
|
final focusD1 = FocusNode();
|
||||||
|
final focusD2 = FocusNode();
|
||||||
|
final focusD3 = FocusNode();
|
||||||
|
final focusD4 = FocusNode();
|
||||||
|
String errorMsg;
|
||||||
|
ProjectViewModel projectProvider;
|
||||||
|
String displayTime = '';
|
||||||
|
|
||||||
|
displayDialog(BuildContext context) async {
|
||||||
|
return showDialog(
|
||||||
|
context: context,
|
||||||
|
builder: (context) {
|
||||||
|
projectProvider = Provider.of(context);
|
||||||
|
return AlertDialog(
|
||||||
|
title: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
|
children: <Widget>[
|
||||||
|
IconButton(
|
||||||
|
icon: Icon(Icons.close),
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.pop(context);
|
||||||
|
this.onFailure();
|
||||||
|
},
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.all(Radius.circular(10.0))),
|
||||||
|
content: StatefulBuilder(builder: (context, setState) {
|
||||||
|
if (displayTime == '') {
|
||||||
|
startTimer(setState);
|
||||||
|
}
|
||||||
|
return Container(
|
||||||
|
color: Colors.white,
|
||||||
|
height: SizeConfig.realScreenHeight * 0.5,
|
||||||
|
width: SizeConfig.realScreenWidth * 0.8,
|
||||||
|
child: Center(
|
||||||
|
child: SingleChildScrollView(
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
children: <Widget>[
|
||||||
|
type == 1
|
||||||
|
? Image.asset('assets/images/login/103.png')
|
||||||
|
: Image.asset('assets/images/login/104.png'),
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsets.only(top: 5),
|
||||||
|
child: AppText(
|
||||||
|
TranslationBase.of(context).verificationMessage +
|
||||||
|
' XXXXXX' +
|
||||||
|
mobileNo
|
||||||
|
.toString()
|
||||||
|
.substring(mobileNo.toString().length - 3),
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
)),
|
||||||
|
Form(
|
||||||
|
key: verifyAccountForm,
|
||||||
|
child: Padding(
|
||||||
|
padding: EdgeInsets.only(top: 20),
|
||||||
|
child: Directionality(
|
||||||
|
textDirection: TextDirection.ltr,
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
|
children: <Widget>[
|
||||||
|
Container(
|
||||||
|
width: SizeConfig.realScreenWidth * 0.15,
|
||||||
|
child: TextFormField(
|
||||||
|
textInputAction: TextInputAction.next,
|
||||||
|
style: buildTextStyle(),
|
||||||
|
autofocus: true,
|
||||||
|
maxLength: 1,
|
||||||
|
controller: digit1,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
keyboardType: TextInputType.number,
|
||||||
|
decoration: buildInputDecoration(context),
|
||||||
|
onSaved: (val) {},
|
||||||
|
validator: validateCodeDigit,
|
||||||
|
onFieldSubmitted: (_) {
|
||||||
|
FocusScope.of(context)
|
||||||
|
.requestFocus(focusD2);
|
||||||
|
},
|
||||||
|
onChanged: (val) {
|
||||||
|
if (val.length == 1) {
|
||||||
|
FocusScope.of(context)
|
||||||
|
.requestFocus(focusD2);
|
||||||
|
verifyAccountFormValue['digit1'] =
|
||||||
|
val.trim();
|
||||||
|
checkValue();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
width: SizeConfig.realScreenWidth * 0.15,
|
||||||
|
child: TextFormField(
|
||||||
|
focusNode: focusD2,
|
||||||
|
textInputAction: TextInputAction.next,
|
||||||
|
maxLength: 1,
|
||||||
|
controller: digit2,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: buildTextStyle(),
|
||||||
|
keyboardType: TextInputType.number,
|
||||||
|
decoration: buildInputDecoration(context),
|
||||||
|
onSaved: (val) {},
|
||||||
|
onFieldSubmitted: (_) {
|
||||||
|
FocusScope.of(context)
|
||||||
|
.requestFocus(focusD3);
|
||||||
|
},
|
||||||
|
onChanged: (val) {
|
||||||
|
if (val.length == 1) {
|
||||||
|
FocusScope.of(context)
|
||||||
|
.requestFocus(focusD3);
|
||||||
|
verifyAccountFormValue['digit2'] =
|
||||||
|
val.trim();
|
||||||
|
checkValue();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
validator: validateCodeDigit),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
width: SizeConfig.realScreenWidth * 0.15,
|
||||||
|
child: TextFormField(
|
||||||
|
focusNode: focusD3,
|
||||||
|
textInputAction: TextInputAction.next,
|
||||||
|
maxLength: 1,
|
||||||
|
controller: digit3,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: buildTextStyle(),
|
||||||
|
keyboardType: TextInputType.number,
|
||||||
|
decoration:
|
||||||
|
buildInputDecoration(context),
|
||||||
|
onSaved: (val) {},
|
||||||
|
onFieldSubmitted: (_) {
|
||||||
|
FocusScope.of(context)
|
||||||
|
.requestFocus(focusD4);
|
||||||
|
},
|
||||||
|
onChanged: (val) {
|
||||||
|
if (val.length == 1) {
|
||||||
|
FocusScope.of(context)
|
||||||
|
.requestFocus(focusD4);
|
||||||
|
verifyAccountFormValue['digit3'] =
|
||||||
|
val.trim();
|
||||||
|
checkValue();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
validator: validateCodeDigit)),
|
||||||
|
Container(
|
||||||
|
width: SizeConfig.realScreenWidth * 0.15,
|
||||||
|
child: TextFormField(
|
||||||
|
focusNode: focusD4,
|
||||||
|
maxLength: 1,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: buildTextStyle(),
|
||||||
|
controller: digit4,
|
||||||
|
keyboardType: TextInputType.number,
|
||||||
|
decoration:
|
||||||
|
buildInputDecoration(context),
|
||||||
|
onFieldSubmitted: (_) {
|
||||||
|
FocusScope.of(context)
|
||||||
|
.requestFocus(focusD4);
|
||||||
|
},
|
||||||
|
onChanged: (val) {
|
||||||
|
if (val.length == 1) {
|
||||||
|
verifyAccountFormValue['digit4'] =
|
||||||
|
val.trim();
|
||||||
|
checkValue();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
validator: validateCodeDigit)),
|
||||||
|
],
|
||||||
|
)),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsets.only(top: 10),
|
||||||
|
child: AppText(
|
||||||
|
TranslationBase.of(context).validationMessage +
|
||||||
|
' ' +
|
||||||
|
displayTime,
|
||||||
|
color: Colors.red,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
))
|
||||||
|
],
|
||||||
|
))),
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
TextStyle buildTextStyle() {
|
||||||
|
return TextStyle(
|
||||||
|
fontSize: SizeConfig.textMultiplier * 3,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
InputDecoration buildInputDecoration(BuildContext context) {
|
||||||
|
return InputDecoration(
|
||||||
|
counterText: " ",
|
||||||
|
// ts/images/password_icon.png
|
||||||
|
// contentPadding: EdgeInsets.only(top: 20, bottom: 20),
|
||||||
|
enabledBorder: OutlineInputBorder(
|
||||||
|
borderRadius: BorderRadius.all(Radius.circular(10)),
|
||||||
|
borderSide: BorderSide(color: Colors.black),
|
||||||
|
),
|
||||||
|
focusedBorder: OutlineInputBorder(
|
||||||
|
borderRadius: BorderRadius.all(Radius.circular(10.0)),
|
||||||
|
borderSide: BorderSide(color: Theme.of(context).primaryColor),
|
||||||
|
),
|
||||||
|
errorBorder: OutlineInputBorder(
|
||||||
|
borderRadius: BorderRadius.all(Radius.circular(10.0)),
|
||||||
|
borderSide: BorderSide(color: Theme.of(context).errorColor),
|
||||||
|
),
|
||||||
|
focusedErrorBorder: OutlineInputBorder(
|
||||||
|
borderRadius: BorderRadius.all(Radius.circular(10.0)),
|
||||||
|
borderSide: BorderSide(color: Theme.of(context).errorColor),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
String validateCodeDigit(value) {
|
||||||
|
if (value.isEmpty) {
|
||||||
|
return ' ';
|
||||||
|
} else if (value.length == 3) {
|
||||||
|
print(value);
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
checkValue() {
|
||||||
|
//print(verifyAccountFormValue);
|
||||||
|
if (verifyAccountForm.currentState.validate()) {
|
||||||
|
onSuccess(digit1.text.toString() +
|
||||||
|
digit2.text.toString() +
|
||||||
|
digit3.text.toString() +
|
||||||
|
digit4.text.toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
getSecondsAsDigitalClock(int inputSeconds) {
|
||||||
|
var sec_num =
|
||||||
|
int.parse(inputSeconds.toString()); // don't forget the second param
|
||||||
|
var hours = (sec_num / 3600).floor();
|
||||||
|
var minutes = ((sec_num - hours * 3600) / 60).floor();
|
||||||
|
var seconds = sec_num - hours * 3600 - minutes * 60;
|
||||||
|
var minutesString = "";
|
||||||
|
var secondsString = "";
|
||||||
|
minutesString =
|
||||||
|
minutes < 10 ? "0" + minutes.toString() : minutes.toString();
|
||||||
|
secondsString =
|
||||||
|
seconds < 10 ? "0" + seconds.toString() : seconds.toString();
|
||||||
|
return minutesString + ":" + secondsString;
|
||||||
|
}
|
||||||
|
|
||||||
|
startTimer(setState) {
|
||||||
|
this.remainingTime--;
|
||||||
|
setState(() {
|
||||||
|
displayTime = this.getSecondsAsDigitalClock(this.remainingTime);
|
||||||
|
});
|
||||||
|
|
||||||
|
timer = Future.delayed(Duration(seconds: 1), () {
|
||||||
|
if (this.remainingTime > 0) {
|
||||||
|
startTimer(setState);
|
||||||
|
} else {
|
||||||
|
Navigator.pop(context);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
static void showLoadingDialog(BuildContext context, bool _loading) async {
|
||||||
|
_context = context;
|
||||||
|
|
||||||
|
if (_loading == false) {
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_loading = true;
|
||||||
|
await showDialog(
|
||||||
|
context: _context,
|
||||||
|
barrierDismissible: false,
|
||||||
|
builder: (BuildContext context) {
|
||||||
|
return SimpleDialog(
|
||||||
|
elevation: 0.0,
|
||||||
|
backgroundColor: Colors.transparent,
|
||||||
|
children: <Widget>[
|
||||||
|
Center(
|
||||||
|
child: CircularProgressIndicator(
|
||||||
|
valueColor: AlwaysStoppedAnimation<Color>(Colors.black),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
static void hideSMSBox(context) {
|
||||||
|
Navigator.pop(context);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,92 +1,109 @@
|
|||||||
|
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
|
||||||
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
|
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
|
||||||
|
import 'package:doctor_app_flutter/models/SOAP/GeneralGetReqForSOAP.dart';
|
||||||
import 'package:doctor_app_flutter/models/patient/patiant_info_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/util/translations_delegate_base.dart';
|
||||||
import 'package:doctor_app_flutter/widgets/patients/profile/patient_profile_widget.dart';
|
import 'package:doctor_app_flutter/widgets/patients/profile/patient_profile_widget.dart';
|
||||||
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
class PatientPageHeaderWidget extends StatelessWidget {
|
class PatientPageHeaderWidget extends StatelessWidget {
|
||||||
|
|
||||||
final PatiantInformtion patient;
|
final PatiantInformtion patient;
|
||||||
|
|
||||||
PatientPageHeaderWidget(this.patient);
|
PatientPageHeaderWidget(this.patient);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Container(
|
return BaseView<SOAPViewModel>(
|
||||||
child: Column(
|
onModelReady: (model) async {
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
GeneralGetReqForSOAP generalGetReqForSOAP = GeneralGetReqForSOAP(
|
||||||
children: [
|
patientMRN: patient.patientMRN,
|
||||||
Padding(
|
episodeId: patient.episodeNo,
|
||||||
padding: const EdgeInsets.all(8.0),
|
appointmentNo: patient.appointmentNo,
|
||||||
child: Row(
|
doctorID: '',
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
editedBy: '');
|
||||||
mainAxisSize: MainAxisSize.min,
|
await model.getPatientAllergy(generalGetReqForSOAP);
|
||||||
children: <Widget>[
|
|
||||||
AvatarWidget(
|
},
|
||||||
Icon(
|
builder: (_, model, w) => Container(
|
||||||
patient.genderDescription == "Male"
|
child: Column(
|
||||||
? DoctorApp.male
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
: DoctorApp.female_icon,
|
children: [
|
||||||
size: 70,
|
Padding(
|
||||||
color: Colors.white,
|
padding: const EdgeInsets.all(8.0),
|
||||||
),
|
child: Row(
|
||||||
),
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
SizedBox(
|
mainAxisSize: MainAxisSize.min,
|
||||||
width: 20,
|
children: <Widget>[
|
||||||
),
|
AvatarWidget(
|
||||||
Expanded(
|
Icon(
|
||||||
child: Column(
|
patient.genderDescription == "Male"
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
? DoctorApp.male
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
: DoctorApp.female_icon,
|
||||||
children: [
|
size: 70,
|
||||||
SizedBox(
|
color: Colors.white,
|
||||||
height: 5,
|
|
||||||
),
|
|
||||||
AppText(
|
|
||||||
patient.firstName + ' ' + patient.lastName,
|
|
||||||
color: Colors.black,
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
),
|
|
||||||
Row(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
AppText(
|
|
||||||
TranslationBase.of(context).age,
|
|
||||||
color: Colors.black,
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
),
|
|
||||||
SizedBox(
|
|
||||||
width: 20,
|
|
||||||
),
|
),
|
||||||
AppText(
|
),
|
||||||
patient.age.toString(),
|
SizedBox(
|
||||||
color: Colors.black,
|
width: 20,
|
||||||
fontWeight: FontWeight.normal,
|
),
|
||||||
|
Expanded(
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
SizedBox(
|
||||||
|
height: 5,
|
||||||
|
),
|
||||||
|
AppText(
|
||||||
|
patient.firstName + ' ' + patient.lastName,
|
||||||
|
color: Colors.black,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
AppText(
|
||||||
|
TranslationBase.of(context).age,
|
||||||
|
color: Colors.black,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
width: 20,
|
||||||
|
),
|
||||||
|
AppText(
|
||||||
|
patient.age.toString(),
|
||||||
|
color: Colors.black,
|
||||||
|
fontWeight: FontWeight.normal,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
NetworkBaseView(
|
||||||
|
baseViewModel: model,
|
||||||
|
child: model.patientAllergiesList.isNotEmpty ?AppText(
|
||||||
|
"ALLERGIC TO: "+model.getAllergicNames(),
|
||||||
|
color: Color(0xFFB9382C),
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
) : AppText(''),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
],
|
)
|
||||||
),
|
],
|
||||||
AppText(
|
),
|
||||||
"ALLERGIC TO: FOOD, ASPIRIN, EGG WHITE",
|
),
|
||||||
color: Color(0xFFB9382C),
|
Container(
|
||||||
fontWeight: FontWeight.bold,
|
width: double.infinity,
|
||||||
),
|
height: 1,
|
||||||
],
|
color: Color(0xffCCCCCC),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
width: 20,
|
||||||
),
|
),
|
||||||
)
|
],
|
||||||
],
|
),
|
||||||
),
|
));
|
||||||
),
|
|
||||||
Container(
|
|
||||||
width: double.infinity,
|
|
||||||
height: 1,
|
|
||||||
color: Color(0xffCCCCCC),
|
|
||||||
),
|
|
||||||
SizedBox(
|
|
||||||
width: 20,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,33 @@
|
|||||||
|
|
||||||
|
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
// ignore: must_be_immutable
|
||||||
|
class CustomValidationError extends StatelessWidget {
|
||||||
|
String error;
|
||||||
|
CustomValidationError({
|
||||||
|
Key key, this.error,
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
if(error == null )
|
||||||
|
error = TranslationBase
|
||||||
|
.of(context)
|
||||||
|
.emptyMessage;
|
||||||
|
return Column(
|
||||||
|
children: [
|
||||||
|
SizedBox(
|
||||||
|
height: 2,
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
margin: EdgeInsets.symmetric(horizontal: 3),
|
||||||
|
child: AppText(error, color: Theme
|
||||||
|
.of(context)
|
||||||
|
.errorColor, fontSize: 14,),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||