|
|
|
|
@ -15,54 +15,35 @@ class RadiologyViewModel extends BaseViewModel {
|
|
|
|
|
List<FinalRadiologyList> _finalRadiologyListClinic = List();
|
|
|
|
|
List<FinalRadiologyList> _finalRadiologyListHospital = List();
|
|
|
|
|
|
|
|
|
|
List<FinalRadiologyList> get finalRadiologyList =>
|
|
|
|
|
filterType == FilterType.Clinic
|
|
|
|
|
? _finalRadiologyListClinic
|
|
|
|
|
: _finalRadiologyListHospital;
|
|
|
|
|
List<FinalRadiologyList> get finalRadiologyList => filterType == FilterType.Clinic ? _finalRadiologyListClinic : _finalRadiologyListHospital;
|
|
|
|
|
|
|
|
|
|
void getPatientRadOrders(PatiantInformtion patient,
|
|
|
|
|
{isInPatient = false}) async {
|
|
|
|
|
void getPatientRadOrders(PatiantInformtion patient, {isInPatient = false}) async {
|
|
|
|
|
setState(ViewState.Busy);
|
|
|
|
|
await _radiologyService.getPatientRadOrders(patient,
|
|
|
|
|
isInPatient: isInPatient);
|
|
|
|
|
await _radiologyService.getPatientRadOrders(patient, isInPatient: isInPatient);
|
|
|
|
|
if (_radiologyService.hasError) {
|
|
|
|
|
error = _radiologyService.error;
|
|
|
|
|
setState(ViewState.Error);
|
|
|
|
|
} else {
|
|
|
|
|
_radiologyService.finalRadiologyList.forEach((element) {
|
|
|
|
|
List<FinalRadiologyList> finalRadiologyListClinic =
|
|
|
|
|
_finalRadiologyListClinic
|
|
|
|
|
.where((elementClinic) =>
|
|
|
|
|
elementClinic.filterName == element.clinicDescription)
|
|
|
|
|
.toList();
|
|
|
|
|
List<FinalRadiologyList> finalRadiologyListClinic = _finalRadiologyListClinic.where((elementClinic) => elementClinic.filterName == element.clinicDescription).toList();
|
|
|
|
|
|
|
|
|
|
if (finalRadiologyListClinic.length != 0) {
|
|
|
|
|
_finalRadiologyListClinic[
|
|
|
|
|
finalRadiologyListClinic.indexOf(finalRadiologyListClinic[0])]
|
|
|
|
|
.finalRadiologyList
|
|
|
|
|
.add(element);
|
|
|
|
|
_finalRadiologyListClinic[finalRadiologyListClinic.indexOf(finalRadiologyListClinic[0])].finalRadiologyList.add(element);
|
|
|
|
|
} else {
|
|
|
|
|
_finalRadiologyListClinic.add(FinalRadiologyList(
|
|
|
|
|
filterName: element.clinicDescription, finalRadiology: element));
|
|
|
|
|
_finalRadiologyListClinic.add(FinalRadiologyList(filterName: element.clinicDescription, finalRadiology: element));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// FinalRadiologyList list sort via project
|
|
|
|
|
List<FinalRadiologyList> finalRadiologyListHospital =
|
|
|
|
|
_finalRadiologyListHospital
|
|
|
|
|
.where(
|
|
|
|
|
(elementClinic) =>
|
|
|
|
|
elementClinic.filterName == element.projectName,
|
|
|
|
|
)
|
|
|
|
|
.toList();
|
|
|
|
|
List<FinalRadiologyList> finalRadiologyListHospital = _finalRadiologyListHospital
|
|
|
|
|
.where(
|
|
|
|
|
(elementClinic) => elementClinic.filterName == element.projectName,
|
|
|
|
|
)
|
|
|
|
|
.toList();
|
|
|
|
|
|
|
|
|
|
if (finalRadiologyListHospital.length != 0) {
|
|
|
|
|
_finalRadiologyListHospital[finalRadiologyListHospital
|
|
|
|
|
.indexOf(finalRadiologyListHospital[0])]
|
|
|
|
|
.finalRadiologyList
|
|
|
|
|
.add(element);
|
|
|
|
|
_finalRadiologyListHospital[finalRadiologyListHospital.indexOf(finalRadiologyListHospital[0])].finalRadiologyList.add(element);
|
|
|
|
|
} else {
|
|
|
|
|
_finalRadiologyListHospital.add(FinalRadiologyList(
|
|
|
|
|
filterName: element.projectName, finalRadiology: element));
|
|
|
|
|
_finalRadiologyListHospital.add(FinalRadiologyList(filterName: element.projectName, finalRadiology: element));
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
@ -72,17 +53,9 @@ class RadiologyViewModel extends BaseViewModel {
|
|
|
|
|
|
|
|
|
|
String get radImageURL => _radiologyService.url;
|
|
|
|
|
|
|
|
|
|
getRadImageURL(
|
|
|
|
|
{int invoiceNo,
|
|
|
|
|
int lineItem,
|
|
|
|
|
int projectId,
|
|
|
|
|
@required PatiantInformtion patient}) async {
|
|
|
|
|
getRadImageURL({int invoiceNo, int lineItem, int projectId, @required PatiantInformtion patient}) async {
|
|
|
|
|
setState(ViewState.Busy);
|
|
|
|
|
await _radiologyService.getRadImageURL(
|
|
|
|
|
invoiceNo: invoiceNo,
|
|
|
|
|
lineItem: lineItem,
|
|
|
|
|
projectId: projectId,
|
|
|
|
|
patient: patient);
|
|
|
|
|
await _radiologyService.getRadImageURL(invoiceNo: invoiceNo, lineItem: lineItem, projectId: projectId, patient: patient);
|
|
|
|
|
if (_radiologyService.hasError) {
|
|
|
|
|
error = _radiologyService.error;
|
|
|
|
|
setState(ViewState.Error);
|
|
|
|
|
|