|
|
|
|
@ -27,28 +27,20 @@ class PatientsSearchResultScreen extends StatefulWidget {
|
|
|
|
|
final String? searchKey;
|
|
|
|
|
|
|
|
|
|
PatientsSearchResultScreen(
|
|
|
|
|
{this.selectedPatientType,
|
|
|
|
|
this.patientSearchRequestModel,
|
|
|
|
|
this.isSearchWithKeyInfo = true,
|
|
|
|
|
this.isSearch = false,
|
|
|
|
|
this.isInpatient = false,
|
|
|
|
|
this.searchKey,
|
|
|
|
|
this.isSearchAndOut = false});
|
|
|
|
|
{this.selectedPatientType, this.patientSearchRequestModel, this.isSearchWithKeyInfo = true, this.isSearch = false, this.isInpatient = false, this.searchKey, this.isSearchAndOut = false});
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
_PatientsSearchResultScreenState createState() =>
|
|
|
|
|
_PatientsSearchResultScreenState();
|
|
|
|
|
_PatientsSearchResultScreenState createState() => _PatientsSearchResultScreenState();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class _PatientsSearchResultScreenState
|
|
|
|
|
extends State<PatientsSearchResultScreen> {
|
|
|
|
|
class _PatientsSearchResultScreenState extends State<PatientsSearchResultScreen> {
|
|
|
|
|
int? clinicId;
|
|
|
|
|
AuthenticationViewModel authenticationViewModel = AuthenticationViewModel();
|
|
|
|
|
|
|
|
|
|
String? patientType;
|
|
|
|
|
String patientType = '';
|
|
|
|
|
String? patientTypeTitle;
|
|
|
|
|
var selectedFilter = 1;
|
|
|
|
|
String? arrivalType;
|
|
|
|
|
String arrivalType = '';
|
|
|
|
|
late ProjectViewModel projectsProvider;
|
|
|
|
|
var isView;
|
|
|
|
|
final _controller = TextEditingController();
|
|
|
|
|
@ -60,12 +52,10 @@ class _PatientsSearchResultScreenState
|
|
|
|
|
authenticationViewModel = Provider.of(context);
|
|
|
|
|
return BaseView<PatientSearchViewModel>(
|
|
|
|
|
onModelReady: (model) async {
|
|
|
|
|
if (!widget.isSearchWithKeyInfo &&
|
|
|
|
|
widget.selectedPatientType == PatientType.OutPatient) {
|
|
|
|
|
if (!widget.isSearchWithKeyInfo && widget.selectedPatientType == PatientType.OutPatient) {
|
|
|
|
|
await model.getOutPatient(widget.patientSearchRequestModel!);
|
|
|
|
|
} else {
|
|
|
|
|
await model
|
|
|
|
|
.getPatientFileInformation(widget.patientSearchRequestModel!);
|
|
|
|
|
await model.getPatientFileInformation(widget.patientSearchRequestModel!);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
builder: (_, model, w) => AppScaffold(
|
|
|
|
|
@ -89,9 +79,10 @@ class _PatientsSearchResultScreenState
|
|
|
|
|
DoctorApp.filter_1,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
),
|
|
|
|
|
iconSize: 20, onPressed: () { },
|
|
|
|
|
iconSize: 20, onPressed: () {},
|
|
|
|
|
// padding: EdgeInsets.only(bottom: 30),
|
|
|
|
|
), onFieldSubmitted: (){},
|
|
|
|
|
),
|
|
|
|
|
onFieldSubmitted: () {},
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10.0,
|
|
|
|
|
@ -101,8 +92,7 @@ class _PatientsSearchResultScreenState
|
|
|
|
|
child: model.filterData.isEmpty
|
|
|
|
|
? Center(
|
|
|
|
|
child: ErrorMessage(
|
|
|
|
|
error: TranslationBase.of(context)
|
|
|
|
|
.youDontHaveAnyPatient,
|
|
|
|
|
error: TranslationBase.of(context).youDontHaveAnyPatient,
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
: ListView.builder(
|
|
|
|
|
@ -114,27 +104,27 @@ class _PatientsSearchResultScreenState
|
|
|
|
|
padding: EdgeInsets.all(8.0),
|
|
|
|
|
child: PatientCard(
|
|
|
|
|
patientInfo: model.filterData[index],
|
|
|
|
|
patientType: patientType!,
|
|
|
|
|
arrivalType: arrivalType!,
|
|
|
|
|
patientType: patientType,
|
|
|
|
|
arrivalType: arrivalType,
|
|
|
|
|
isFromSearch: widget.isSearchAndOut,
|
|
|
|
|
isInpatient: widget.isInpatient,
|
|
|
|
|
onTap: () {
|
|
|
|
|
print("TODO change the parameter to daynamic");
|
|
|
|
|
print("TODO change the parameter to daynamic");
|
|
|
|
|
print("TODO change the parameter to daynamic");
|
|
|
|
|
print("TODO change the parameter to daynamic");
|
|
|
|
|
print("TODO change the parameter to daynamic");
|
|
|
|
|
// TODO change the parameter to daynamic
|
|
|
|
|
Navigator.of(context).pushNamed(
|
|
|
|
|
PATIENTS_PROFILE,
|
|
|
|
|
arguments: {
|
|
|
|
|
"patient": model.filterData[index],
|
|
|
|
|
"patientType": "1",
|
|
|
|
|
"from": widget
|
|
|
|
|
.patientSearchRequestModel!.from,
|
|
|
|
|
"to": widget
|
|
|
|
|
.patientSearchRequestModel!.from,
|
|
|
|
|
"isSearch": widget.isSearch,
|
|
|
|
|
"isInpatient": widget.isInpatient,
|
|
|
|
|
"arrivalType": "7",
|
|
|
|
|
"isSearchAndOut":
|
|
|
|
|
widget.isSearchAndOut,
|
|
|
|
|
});
|
|
|
|
|
Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: {
|
|
|
|
|
"patient": model.filterData[index],
|
|
|
|
|
"patientType": "1",
|
|
|
|
|
"from": widget.patientSearchRequestModel!.from,
|
|
|
|
|
"to": widget.patientSearchRequestModel!.from,
|
|
|
|
|
"isSearch": widget.isSearch,
|
|
|
|
|
"isInpatient": widget.isInpatient,
|
|
|
|
|
"arrivalType": "7",
|
|
|
|
|
"isSearchAndOut": widget.isSearchAndOut,
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
// isFromSearch: widget.isSearch,
|
|
|
|
|
),
|
|
|
|
|
|