some fixes

merge-requests/574/head
mosazaid 4 years ago
parent 6f6e2d3397
commit 1b8e3eb895

@ -862,4 +862,5 @@ const Map<String, Map<String, String>> localizedValues = {
"try-saying": {"en": "Try saying something", "ar": 'حاول قول شيء ما'},
"refClinic": {"en": "Ref Clinic", "ar": "Ref Clinic"},
"acknowledged": {"en": "Acknowledged", "ar": "إقرار"},
"showDetail": {"en": "Show Detail", "ar": "أظهر المعلومات"},
};

@ -8,11 +8,12 @@ import 'package:doctor_app_flutter/models/SOAP/GetAssessmentResModel.dart';
import 'package:doctor_app_flutter/models/SOAP/order-procedure.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_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';
class UcafService extends LookupService {
List<GetChiefComplaintResModel> patientChiefComplaintList = [];
VitalSignData patientVitalSigns;
List<VitalSignHistory> patientVitalSignsHistory = [];
List<GetAssessmentResModel> patientAssessmentList = [];
List<OrderProcedure> orderProcedureList = [];
PrescriptionModel prescriptionList;
@ -38,21 +39,28 @@ class UcafService extends LookupService {
}, body: body);
}
Future getPatientVitalSign(PatiantInformtion patient) async {
patientVitalSigns = null;
Future getPatientVitalSignsHistory(
PatiantInformtion patient, String fromDate, String toDate) async {
hasError = false;
Map<String, dynamic> body = Map();
body['PatientMRN'] = patient.patientMRN;
body['AppointmentNo'] = patient.appointmentNo;
body['PatientMRN'] = patient.patientId; // patient.patientMRN
// body['AppointmentNo'] = patient.appointmentNo;
// body['EpisodeID'] = patient.episodeNo;
body['PatientTypeID'] = 1;
body['PatientType'] = 1;
body['DeviceTypeID'] = 1;
body['isDentalAllowedBackend'] = false;
body['From'] = fromDate;
body['To'] = toDate;
await baseAppClient.post(
GET_PATIENT_VITAL_SIGN_DATA,
onSuccess: (dynamic response, int statusCode) {
if(response['VitalSignsList'] != null){
if(response['VitalSignsList']['entityList'] != null && (response['VitalSignsList']['entityList'] as List).length > 0){
patientVitalSigns = VitalSignData.fromJson(response['VitalSignsList']['entityList'][0]);
}
patientVitalSignsHistory.clear();
if (response['VitalSignsHistory'] != null) {
response['VitalSignsHistory'].forEach((v) {
patientVitalSignsHistory.add(new VitalSignHistory.fromJson(v));
});
}
},
onFailure: (String error, int statusCode) {

@ -10,6 +10,8 @@ import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/models/SOAP/order-procedure.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_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:flutter/material.dart';
import '../../locator.dart';
@ -20,7 +22,8 @@ class UcafViewModel extends BaseViewModel {
List<GetChiefComplaintResModel> get patientChiefComplaintList =>
_ucafService.patientChiefComplaintList;
VitalSignData get patientVitalSigns => _ucafService.patientVitalSigns;
List<VitalSignHistory> get patientVitalSignsHistory =>
_ucafService.patientVitalSignsHistory;
List<GetAssessmentResModel> get patientAssessmentList =>
_ucafService.patientAssessmentList;
@ -35,6 +38,13 @@ class UcafViewModel extends BaseViewModel {
List<OrderProcedure> get orderProcedures => _ucafService.orderProcedureList;
String selectedLanguage;
String heightCm = "0";
String weightKg = "0";
String bodyMax = "0";
String temperatureCelcius = "0";
String hartRat = "0";
String respirationBeatPerMinute = "0";
String bloodPressure = "0 / 0";
resetDataInFirst(){
_ucafService.patientAssessmentList = [];
@ -48,13 +58,54 @@ class UcafViewModel extends BaseViewModel {
Future getUCAFData(PatiantInformtion patient) async {
setState(ViewState.Busy);
await _ucafService.getPatientVitalSign(patient);
String from;
String to;
if (from == null || from == "0") {
from = DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd');
}
if (to == null || to == "0") {
to = DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd');
}
await _ucafService.getPatientVitalSignsHistory(patient, from, to);
await _ucafService.getPatientChiefComplaint(patient);
if (_ucafService.hasError) {
error = _ucafService.error;
setState(ViewState.Error);
} else {
patientVitalSignsHistory.forEach((element) {
if (heightCm == "0" || heightCm == null || heightCm == 'null') {
heightCm = element.heightCm.toString();
}
if (weightKg == "0" || weightKg == null || weightKg == 'null') {
weightKg = element.weightKg.toString();
}
if (bodyMax == "0" || bodyMax == null || bodyMax == 'null') {
bodyMax = element.bodyMassIndex.toString();
}
if (temperatureCelcius == "0" ||
temperatureCelcius == null ||
temperatureCelcius == 'null') {
temperatureCelcius = element.temperatureCelcius.toString();
}
if (hartRat == "0" || hartRat == null || hartRat == 'null') {
hartRat = element.pulseBeatPerMinute.toString();
}
if (respirationBeatPerMinute == "0" ||
respirationBeatPerMinute == null ||
respirationBeatPerMinute == 'null') {
respirationBeatPerMinute =
element.respirationBeatPerMinute.toString();
}
if (bloodPressure == "0 / 0" ||
bloodPressure == null ||
bloodPressure == 'null') {
bloodPressure = element.bloodPressure.toString();
}
});
setState(ViewState.Idle);
}
}

@ -70,7 +70,7 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
appBar: PatientProfileHeaderNewDesignAppBar(
patient, patientType, arrivalType),
appBarTitle: TranslationBase.of(context).ucaf,
body: model.patientVitalSigns != null &&
body: model.patientVitalSignsHistory.length > 0 &&
model.patientChiefComplaintList != null &&
model.patientChiefComplaintList.length > 0
? Column(
@ -186,7 +186,7 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
width: 8,
),
AppText(
"${model.patientVitalSigns.bloodPressureHigher}/${model.patientVitalSigns.bloodPressureLower}",
"${model.bloodPressure}",
fontSize:
SizeConfig.textMultiplier * 2,
color: Colors.grey.shade800,
@ -212,7 +212,7 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
),
Expanded(
child: AppText(
"${model.patientVitalSigns.temperatureCelcius}(C), ${(model.patientVitalSigns.temperatureCelcius * (9 / 5) + 32).toStringAsFixed(2)}(F)",
"${model.temperatureCelcius}(C), ${(double.parse(model.temperatureCelcius) * (9 / 5) + 32).toStringAsFixed(2)}(F)",
fontSize:
SizeConfig.textMultiplier * 2,
color: Colors.grey.shade800,
@ -244,7 +244,7 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
width: 4,
),
AppText(
"${model.patientVitalSigns.pulseBeatPerMinute}",
"${model.hartRat}",
fontSize:
SizeConfig.textMultiplier * 2,
color: Colors.grey.shade800,
@ -430,7 +430,7 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
Padding(
padding: const EdgeInsets.all(8.0),
child: AppText(
model.patientVitalSigns == null
model.patientVitalSignsHistory.length > 0
? TranslationBase.of(context).vitalSignEmptyMsg
: TranslationBase.of(context).chiefComplaintEmptyMsg,
fontWeight: FontWeight.normal,

@ -76,8 +76,10 @@ class ReferredPatientDetailScreen extends StatelessWidget {
"patientType": "1",
"isInpatient": true,
"arrivalType": "1",
"from": DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'),
"to": DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'),
"from": DateUtils.convertDateToFormat(
DateTime.now(), 'yyyy-MM-dd'),
"to": DateUtils.convertDateToFormat(
DateTime.now(), 'yyyy-MM-dd'),
});
},
child: Icon(
@ -90,17 +92,47 @@ class ReferredPatientDetailScreen extends StatelessWidget {
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(left: 12.0),
child: Container(
width: 60,
height: 60,
child: Image.asset(
referredPatient.gender == 1
? 'assets/images/male_avatar.png'
: 'assets/images/female_avatar.png',
fit: BoxFit.cover,
),
InkWell(
onTap: (){
PatiantInformtion patient =
model.getPatientFromReferral(referredPatient);
Navigator.of(context)
.pushNamed(PATIENTS_PROFILE, arguments: {
"patient": patient,
"patientType": "1",
"isInpatient": true,
"arrivalType": "1",
"from": DateUtils.convertDateToFormat(
DateTime.now(), 'yyyy-MM-dd'),
"to": DateUtils.convertDateToFormat(
DateTime.now(), 'yyyy-MM-dd'),
});
},
child: Column(
children: [
Padding(
padding: EdgeInsets.only(left: 12.0),
child: Container(
width: 60,
height: 60,
child: Image.asset(
referredPatient.gender == 1
? 'assets/images/male_avatar.png'
: 'assets/images/female_avatar.png',
fit: BoxFit.cover,
),
),
),
SizedBox(
height: 20,
),
AppText(
TranslationBase.of(context).showDetail,
fontWeight: FontWeight.w700,
fontSize: 1.7 * SizeConfig.textMultiplier,
color: Colors.blue,
)
],
),
),
SizedBox(
@ -148,14 +180,15 @@ class ReferredPatientDetailScreen extends StatelessWidget {
.fileNumber,
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 1.7 * SizeConfig.textMultiplier,
fontSize:
1.7 * SizeConfig.textMultiplier,
color: Color(0XFF575757),
),
AppText(
"${referredPatient.patientID}",
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize:14,
fontSize: 14,
color: Color(0XFF2E303A),
),
],
@ -284,7 +317,7 @@ class ReferredPatientDetailScreen extends StatelessWidget {
referredPatient.priorityDescription,
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize:14,
fontSize: 14,
color: Color(0XFF2E303A),
),
],
@ -382,7 +415,8 @@ class ReferredPatientDetailScreen extends StatelessWidget {
color: Colors.black,
),
AppText(
referredPatient.referralClinicDescription,
referredPatient
.referralClinicDescription,
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize: 1.3 *
@ -480,7 +514,10 @@ class ReferredPatientDetailScreen extends StatelessWidget {
color: Color(0XFF2E303A),
),
AppText(
referredPatient.referredDoctorRemarks.isNotEmpty? referredPatient.referredDoctorRemarks:" Not Replied yet",
referredPatient
.referredDoctorRemarks.isNotEmpty
? referredPatient.referredDoctorRemarks
: " Not Replied yet",
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 1.6 * SizeConfig.textMultiplier,
@ -496,28 +533,31 @@ class ReferredPatientDetailScreen extends StatelessWidget {
),
),
),
if(referredPatient.referralStatus ==1)
Container(
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16),
child: AppButton(
title: TranslationBase.of(context).acknowledged,
color: Colors.red[700],
fontColor: Colors.white,
fontWeight: FontWeight.w700,
fontSize: 1.8,
hPadding: 8,
vPadding: 12,
onPressed: () async {
await model.verifyReferralDoctorRemarks(referredPatient);
if (model.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(model.error);
} else {
DrAppToastMsg.showSuccesToast("Referral is acknowledged");
Navigator.pop(context);
}
},
Container(
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16),
child: AppButton(
title: TranslationBase.of(context).acknowledged,
color: Colors.red[700],
fontColor: Colors.white,
fontWeight: FontWeight.w700,
fontSize: 1.8,
hPadding: 8,
vPadding: 12,
disabled: referredPatient.referredDoctorRemarks.isNotEmpty
? false
: true,
onPressed: () async {
await model.verifyReferralDoctorRemarks(referredPatient);
if (model.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(model.error);
} else {
DrAppToastMsg.showSuccesToast(
"Referral is acknowledged");
Navigator.pop(context);
}
},
),
),
),
],
),
),

@ -1172,8 +1172,8 @@ class TranslationBase {
localizedValues['SpecialResult'][locale.languageCode];
String get noDataAvailable =>
localizedValues['noDataAvailable'][locale.languageCode];
String get showMoreBtn =>
localizedValues['show-more-btn'][locale.languageCode];
String get showMoreBtn => localizedValues['show-more-btn'][locale.languageCode];
String get showDetail => localizedValues['showDetail'][locale.languageCode];
String get fileNumber => localizedValues['fileNumber'][locale.languageCode];
String get reschedule => localizedValues['reschedule'][locale.languageCode];

@ -51,7 +51,8 @@ class _AppButtonState extends State<AppButton> {
return IgnorePointer(
ignoring: widget.loading ||widget.disabled,
child: RawMaterialButton(
fillColor: widget.color != null ? widget.color : HexColor("#B8382C"),
fillColor: widget.disabled
? Colors.grey : widget.color != null ? widget.color : HexColor("#B8382C"),
splashColor: widget.color,
child: Padding(
padding: (widget.hPadding > 0 || widget.vPadding > 0)
@ -103,11 +104,12 @@ class _AppButtonState extends State<AppButton> {
],
),
),
onPressed: widget.onPressed,
onPressed: widget.disabled ? (){} : widget.onPressed,
shape: RoundedRectangleBorder(
side: BorderSide(
color:
widget.hasBorder ? widget.borderColor : widget.color ?? Color(0xFFB8382C),
widget.hasBorder ? widget.borderColor : widget.disabled
? Colors.grey : widget.color ?? Color(0xFFB8382C),
width: 0.8,
),
borderRadius: BorderRadius.all(Radius.circular(widget.radius))),

Loading…
Cancel
Save