|
|
|
@ -274,34 +274,35 @@ class _PatientsScreenState extends State<PatientsScreen> {
|
|
|
|
|
.then((res) {
|
|
|
|
|
setState(() {
|
|
|
|
|
_isLoading = false;
|
|
|
|
|
// if (res['MessageStatus'] == 1) {
|
|
|
|
|
if (val2 == 7) {
|
|
|
|
|
print("Assad");
|
|
|
|
|
if (res[SERVICES_PATIANT2[val2]] == null) {
|
|
|
|
|
_isError = true;
|
|
|
|
|
_isLoading = false;
|
|
|
|
|
this.error = error.toString();
|
|
|
|
|
if (res['MessageStatus'] == 1) {
|
|
|
|
|
if (val2 == 7) {
|
|
|
|
|
if (res[SERVICES_PATIANT2[val2]] == null) {
|
|
|
|
|
_isError = true;
|
|
|
|
|
_isLoading = false;
|
|
|
|
|
this.error = error.toString();
|
|
|
|
|
} else {
|
|
|
|
|
var localList = [];
|
|
|
|
|
res["patientArrivalList"]["entityList"].forEach((v) {
|
|
|
|
|
Map<String, dynamic> mergedPatient = {
|
|
|
|
|
...v,
|
|
|
|
|
...v["patientDetails"]
|
|
|
|
|
};
|
|
|
|
|
localList.add(mergedPatient);
|
|
|
|
|
});
|
|
|
|
|
print(localList.toString());
|
|
|
|
|
lItems = localList;
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
var localList=[];
|
|
|
|
|
res["patientArrivalList"]["entityList"].forEach((v) {
|
|
|
|
|
Map<String,dynamic> mergedPatient= {...v,...v["patientDetails"]};
|
|
|
|
|
localList.add(mergedPatient);
|
|
|
|
|
});
|
|
|
|
|
print(localList.toString());
|
|
|
|
|
lItems = localList;//res[SERVICES_PATIANT2[val2]]["entityList"];
|
|
|
|
|
lItems = res[SERVICES_PATIANT2[val2]];
|
|
|
|
|
}
|
|
|
|
|
parsed = lItems;
|
|
|
|
|
responseModelList = new ModelResponse.fromJson(parsed).list;
|
|
|
|
|
responseModelList2 = responseModelList;
|
|
|
|
|
_isError = false;
|
|
|
|
|
} else {
|
|
|
|
|
lItems = res[SERVICES_PATIANT2[val2]];
|
|
|
|
|
_isError = true;
|
|
|
|
|
error = res['ErrorEndUserMessage'] ?? res['ErrorMessage'];
|
|
|
|
|
}
|
|
|
|
|
parsed = lItems;
|
|
|
|
|
responseModelList = new ModelResponse.fromJson(parsed).list;
|
|
|
|
|
responseModelList2 = responseModelList;
|
|
|
|
|
_isError = false;
|
|
|
|
|
// } else {
|
|
|
|
|
// _isError = true;
|
|
|
|
|
// error = res['ErrorEndUserMessage'] ?? res['ErrorMessage'];
|
|
|
|
|
// }
|
|
|
|
|
});
|
|
|
|
|
}).catchError((error) {
|
|
|
|
|
setState(() {
|
|
|
|
@ -679,7 +680,8 @@ class _PatientsScreenState extends State<PatientsScreen> {
|
|
|
|
|
.pushNamed(
|
|
|
|
|
PATIENTS_PROFILE,
|
|
|
|
|
arguments: {
|
|
|
|
|
"patient": item
|
|
|
|
|
"patient": item,
|
|
|
|
|
"patientType":patientType
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|