|
|
|
|
@ -11,6 +11,7 @@ import 'package:doctor_app_flutter/core/model/patient/patiant_info_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/widgets/shared/app_texts_widget.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_container.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
|
|
@ -38,8 +39,8 @@ class _DrugToDrug extends State<DrugToDrug> {
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
VitalSignsViewModel model = new VitalSignsViewModel();
|
|
|
|
|
SOAPViewModel model2 = new SOAPViewModel();
|
|
|
|
|
VitalSignsViewModel vitalSignsViewModel = new VitalSignsViewModel();
|
|
|
|
|
SOAPViewModel soapViewModel = new SOAPViewModel();
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
void initState() {
|
|
|
|
|
@ -52,18 +53,18 @@ class _DrugToDrug extends State<DrugToDrug> {
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
return isLoaded == true
|
|
|
|
|
? BaseView<PrescriptionViewModel>(
|
|
|
|
|
onModelReady: (model3) => model3.getDrugToDrug(
|
|
|
|
|
model.patientVitalSigns,
|
|
|
|
|
onModelReady: (prescriptionViewModel) => prescriptionViewModel.getDrugToDrug(
|
|
|
|
|
vitalSignsViewModel.patientVitalSigns,
|
|
|
|
|
widget.listAssessment,
|
|
|
|
|
model2.patientAllergiesList,
|
|
|
|
|
soapViewModel.patientAllergiesList,
|
|
|
|
|
widget.patient,
|
|
|
|
|
widget.prescription),
|
|
|
|
|
builder: (BuildContext context, PrescriptionViewModel model3,
|
|
|
|
|
builder: (BuildContext context, PrescriptionViewModel prescriptionViewModel,
|
|
|
|
|
Widget child) =>
|
|
|
|
|
NetworkBaseView(
|
|
|
|
|
baseViewModel: model3,
|
|
|
|
|
baseViewModel: prescriptionViewModel,
|
|
|
|
|
child: Container(
|
|
|
|
|
height: SizeConfig.realScreenHeight * .4,
|
|
|
|
|
height: SizeConfig.realScreenHeight * .9,
|
|
|
|
|
child: new ListView.builder(
|
|
|
|
|
itemCount: expandableList.length,
|
|
|
|
|
itemBuilder: (context, i) {
|
|
|
|
|
@ -73,7 +74,7 @@ class _DrugToDrug extends State<DrugToDrug> {
|
|
|
|
|
' ' +
|
|
|
|
|
'(' +
|
|
|
|
|
getDrugInfo(expandableList[i]['level'],
|
|
|
|
|
model3)
|
|
|
|
|
prescriptionViewModel)
|
|
|
|
|
.length
|
|
|
|
|
.toString() +
|
|
|
|
|
')',
|
|
|
|
|
@ -81,7 +82,7 @@ class _DrugToDrug extends State<DrugToDrug> {
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
),
|
|
|
|
|
children: getDrugInfo(
|
|
|
|
|
expandableList[i]['level'], model3)
|
|
|
|
|
expandableList[i]['level'], prescriptionViewModel)
|
|
|
|
|
.map((item) {
|
|
|
|
|
return Container(
|
|
|
|
|
padding: EdgeInsets.all(10),
|
|
|
|
|
@ -93,10 +94,8 @@ class _DrugToDrug extends State<DrugToDrug> {
|
|
|
|
|
}))))
|
|
|
|
|
: Container(
|
|
|
|
|
height: SizeConfig.realScreenHeight * .45,
|
|
|
|
|
child: Center(
|
|
|
|
|
child: CircularProgressIndicator(
|
|
|
|
|
valueColor: AlwaysStoppedAnimation<Color>(Colors.black),
|
|
|
|
|
)));
|
|
|
|
|
child: GifLoaderContainer()
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getTypeID() async {
|
|
|
|
|
@ -119,17 +118,17 @@ class _DrugToDrug extends State<DrugToDrug> {
|
|
|
|
|
editedBy: '');
|
|
|
|
|
/// TODO Elham* rename model to meaning full not just modle with number
|
|
|
|
|
|
|
|
|
|
await model.getPatientVitalSign(widget.patient);
|
|
|
|
|
await model2.getPatientAllergy(generalGetReqForSOAP);
|
|
|
|
|
await model2.getMasterLookup(MasterKeysService.DiagnosisType);
|
|
|
|
|
if (model.state == ViewState.Idle && model2.state == ViewState.Idle) {
|
|
|
|
|
await vitalSignsViewModel.getPatientVitalSign(widget.patient);
|
|
|
|
|
await soapViewModel.getPatientAllergy(generalGetReqForSOAP);
|
|
|
|
|
await soapViewModel.getMasterLookup(MasterKeysService.DiagnosisType);
|
|
|
|
|
if (vitalSignsViewModel.state == ViewState.Idle && soapViewModel.state == ViewState.Idle) {
|
|
|
|
|
setState(() {
|
|
|
|
|
isLoaded = true;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<dynamic> getDrugInfo(level, model3) {
|
|
|
|
|
return model3.drugToDrug.where((i) => i['Severity'] == level).toList();
|
|
|
|
|
List<dynamic> getDrugInfo(level, prescriptionViewModel) {
|
|
|
|
|
return prescriptionViewModel.drugToDrug.where((i) => i['Severity'] == level).toList();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|