From 175ba545e7cdd622af9590bbb7ef38255625073d Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 10 Jan 2021 12:14:25 +0200 Subject: [PATCH] finish create episode --- lib/core/service/SOAP_service.dart | 3 +++ lib/core/viewModel/SOAP_view_model.dart | 2 ++ lib/widgets/patients/profile/profile_medical_info_widget.dart | 4 ++++ 3 files changed, 9 insertions(+) diff --git a/lib/core/service/SOAP_service.dart b/lib/core/service/SOAP_service.dart index 9707dc53..e3ab61b2 100644 --- a/lib/core/service/SOAP_service.dart +++ b/lib/core/service/SOAP_service.dart @@ -32,6 +32,7 @@ class SOAPService extends LookupService { List patientProgressNoteList = []; List patientAssessmentList = []; + int episodeID; Future getAllergies(GetAllergiesRequestModel getAllergiesRequestModel) async { await baseAppClient.post( GET_ALLERGIES, @@ -54,7 +55,9 @@ class SOAPService extends LookupService { await baseAppClient.post(POST_EPISODE, onSuccess: (dynamic response, int statusCode) { + print("Success"); + episodeID = response['EpisodeID']; }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; diff --git a/lib/core/viewModel/SOAP_view_model.dart b/lib/core/viewModel/SOAP_view_model.dart index 31764c45..ebb282ef 100644 --- a/lib/core/viewModel/SOAP_view_model.dart +++ b/lib/core/viewModel/SOAP_view_model.dart @@ -79,6 +79,8 @@ class SOAPViewModel extends BaseViewModel { List get patientAssessmentList => _SOAPService.patientAssessmentList; + int get episodeID => + _SOAPService.episodeID; Future getAllergies(GetAllergiesRequestModel getAllergiesRequestModel) async { setState(ViewState.Busy); diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index 34433fa7..a614ddb4 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -49,6 +49,10 @@ class ProfileMedicalInfoWidget extends StatelessWidget { appointmentNo: patient.appointmentNo, patientMRN: patient.patientMRN); await model.postEpisode(postEpisodeReqModel); + patient.episodeNo = model.episodeID; + Navigator.of(context).pushNamed(CREATE_EPISODE, arguments: {'patient': patient}); + + }, isLoading: model.state == ViewState.BusyLocal, icon: 'create-episod.png'