Merge branch 'progress_note' into 'development'

add the new logic

See merge request Cloud_Solution/doctor_app_flutter!550
merge-requests/552/merge
Mohammad Aljammal 5 years ago
commit 0336a65039

@ -27,9 +27,9 @@ class RadiologyService extends BaseService {
}, body: body);
}
Future getPatientRadOrders(PatiantInformtion patient) async {
Future getPatientRadOrders(PatiantInformtion patient , {isInPatient = false}) async {
String url = GET_PATIENT_ORDERS;
if(patient.patientType == 1) {
if(isInPatient) {
url = GET_IN_PATIENT_ORDERS;
}
hasError = false;
@ -38,7 +38,7 @@ class RadiologyService extends BaseService {
onSuccess: (dynamic response, int statusCode) {
finalRadiologyList.clear();
String label = "ListRAD";
if(patient.patientType == 1) {
if(isInPatient) {
label ="List_GetRadOreders";
}
response[label].forEach((radiology) {

@ -137,11 +137,12 @@ class ProcedureViewModel extends BaseViewModel {
} else
setState(ViewState.Idle);
//await getProcedure(mrn: mrn);
}
void getPatientRadOrders(PatiantInformtion patient,{String patientType}) async {
void getPatientRadOrders(PatiantInformtion patient,{String patientType, bool isInPatient = false}) async {
setState(ViewState.Busy);
await _radiologyService.getPatientRadOrders(patient);
await _radiologyService.getPatientRadOrders(patient, isInPatient:isInPatient);
if (_radiologyService.hasError) {
error = _radiologyService.error;
if(patientType=="7")

@ -20,9 +20,9 @@ class RadiologyViewModel extends BaseViewModel {
? _finalRadiologyListClinic
: _finalRadiologyListHospital;
void getPatientRadOrders(PatiantInformtion patient) async {
void getPatientRadOrders(PatiantInformtion patient, {isInPatient = false}) async {
setState(ViewState.Busy);
await _radiologyService.getPatientRadOrders(patient);
await _radiologyService.getPatientRadOrders(patient, isInPatient:isInPatient);
if (_radiologyService.hasError) {
error = _radiologyService.error;
setState(ViewState.Error);

@ -644,6 +644,7 @@ class _PatientsScreenState extends State<PatientsScreen> {
isSearch,
"arrivalType":
arrivalType,
"isInpatient":isInpatient
});
},
);

@ -26,6 +26,7 @@ import '../../../routes.dart';
class PatientProfileScreen extends StatelessWidget {
PatiantInformtion patient;
bool isFromSearch = false;
bool isInpatient = false;
@override
Widget build(BuildContext context) {
@ -39,52 +40,10 @@ class PatientProfileScreen extends StatelessWidget {
String to = routeArgs['to'];
if (routeArgs.containsKey("isSearch")) {
isFromSearch = routeArgs['isSearch'];
isInpatient = routeArgs['isInpatient'];
}
return BaseView<PatientViewModel>(
onModelReady: (patientViewModel) async {
PatientModel patientReq = PatientModel(
ProjectID: 0,
ClinicID: 0,
DoctorID: 0,
FirstName: "0",
MiddleName: "0",
LastName: "0",
PatientMobileNumber: "0",
PatientIdentificationID: "0",
PatientID: patient.patientId,
From: "0",
To: "0",
LanguageID: 2,
stamp: "2020-03-02T13:56:39.170Z",
IPAdress: "11.11.11.11",
VersionID: 1.2,
Channel: 9,
TokenID: "@dm!n",
SessionID: "5G0yXn0Jnq",
IsLoginForDoctorApp: true,
PatientOutSA: false);
if (patientType == "1" &&
(patient.admissionNo == null ||
patient.admissionNo == "0")) {
patientViewModel
.getPatientList(patientReq, "1", isBusyLocal: false)
.then((response) {
if (response['MessageStatus'] == 1) {
if (response['List_MyInPatient'] != null) {
List<PatiantInformtion> patientList = ModelResponse.fromJson(response['List_MyInPatient']).list;
patient.admissionNo = patientList[0].admissionNo;
patient.admissionDate = patientList[0].admissionDate;
} else {
DrAppToastMsg.showErrorToast('No patient');
}
}
}).catchError((error) {
print(error);
});
}
},
builder: (_, patientViewModel, w) => AppScaffold(
baseViewModel: patientViewModel,
appBarTitle: TranslationBase.of(context).patientProfile,
@ -115,21 +74,27 @@ class PatientProfileScreen extends StatelessWidget {
arrivalType: arrivalType,
from: from,
to: to,
isInpatient:false
// isFromSearch:isFromSearch
)
: patientType == "1"
: isInpatient
? ProfileMedicalInfoWidgetInPatient(
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
from: from,
to: to,
)
isInpatient:isInpatient,
)
: ProfileMedicalInfoWidget(
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
from: from,
to: to,
isInpatient:isInpatient
),
],
),

@ -28,10 +28,11 @@ class RadiologyHomePage extends StatelessWidget {
PatiantInformtion patient = routeArgs['patient'];
String patientType = routeArgs['patientType'];
String arrivalType = routeArgs['arrivalType'];
bool isInpatient = routeArgs['isInpatient'];
return BaseView<ProcedureViewModel>(
onModelReady: (model) =>
model.getPatientRadOrders(patient, patientType: patientType),
model.getPatientRadOrders(patient, patientType: patientType, isInPatient: isInpatient),
builder: (_, model, widget) => AppScaffold(
isShowAppBar: true,
backgroundColor: Colors.grey[100],

@ -18,6 +18,7 @@ class PatientProfileButton extends StatelessWidget {
final String url = "assets/images/";
final bool isDisable;
final bool isLoading;
final bool isInpatient;
final Function onTap;
PatientProfileButton(
@ -33,7 +34,7 @@ class PatientProfileButton extends StatelessWidget {
this.onTap,
this.isLoading = false,
this.from,
this.to})
this.to, this.isInpatient})
: super(key: key);
@override
@ -127,7 +128,8 @@ class PatientProfileButton extends StatelessWidget {
'from': from,
'to': to,
'patientType': patientType,
'arrivalType': arrivalType
'arrivalType': arrivalType,
'isInpatient':isInpatient
});
}
}

@ -22,6 +22,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
final PatiantInformtion patient;
final String patientType;
final String arrivalType;
final bool isInpatient;
ProfileMedicalInfoWidget(
{Key key,
@ -29,7 +30,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
this.patientType,
this.arrivalType,
this.from,
this.to});
this.to, this.isInpatient});
@override
Widget build(BuildContext context) {
@ -80,6 +81,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
isInpatient:isInpatient,
route: RADIOLOGY_PATIENT,
nameLine1: TranslationBase.of(context).radiology,
nameLine2: TranslationBase.of(context).service,
@ -165,7 +167,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
nameLine1: TranslationBase.of(context).admission,
nameLine2: TranslationBase.of(context).request,
icon: 'patient/admission_req.png'),
if (patientType == "1")
if (isInpatient)
PatientProfileButton(
key: key,
patient: patient,
@ -175,7 +177,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
nameLine1: TranslationBase.of(context).progress,
nameLine2: TranslationBase.of(context).note,
icon: 'patient/Progress_notes.png'),
if (patientType == "1")
if (isInpatient)
PatientProfileButton(
key: key,
patient: patient,

@ -22,6 +22,9 @@ class ProfileMedicalInfoWidgetInPatient extends StatelessWidget {
final PatiantInformtion patient;
final String patientType;
final String arrivalType;
final bool isInpatient;
ProfileMedicalInfoWidgetInPatient(
{Key key,
@ -29,7 +32,7 @@ class ProfileMedicalInfoWidgetInPatient extends StatelessWidget {
this.patientType,
this.arrivalType,
this.from,
this.to});
this.to, this.isInpatient});
@override
Widget build(BuildContext context) {
@ -68,6 +71,7 @@ class ProfileMedicalInfoWidgetInPatient extends StatelessWidget {
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
isInpatient: isInpatient,
route: RADIOLOGY_PATIENT,
nameLine1: TranslationBase.of(context).radiology,
nameLine2: TranslationBase.of(context).result,

@ -13,6 +13,7 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget {
final PatiantInformtion patient;
final String patientType;
final String arrivalType;
final bool isInpatient;
ProfileMedicalInfoWidgetSearch(
{Key key,
@ -20,7 +21,7 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget {
this.patientType,
this.arrivalType,
this.from,
this.to});
this.to, this.isInpatient});
@override
Widget build(BuildContext context) {
@ -68,6 +69,7 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget {
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
isInpatient:isInpatient,
route: RADIOLOGY_PATIENT,
nameLine1: TranslationBase.of(context).radiology,
nameLine2: TranslationBase.of(context).service,

Loading…
Cancel
Save