show progress_note part

merge-requests/537/head
Elham Rababah 5 years ago
parent f2011301c6
commit 82285ccf39

@ -4,8 +4,8 @@ const MAX_SMALL_SCREEN = 660;
const ONLY_NUMBERS = "[0-9]"; const ONLY_NUMBERS = "[0-9]";
const ONLY_LETTERS = "[a-zA-Z &'\"]"; const ONLY_LETTERS = "[a-zA-Z &'\"]";
const ONLY_DATE = "[0-9/]"; const ONLY_DATE = "[0-9/]";
// const BASE_URL = 'https://hmgwebservices.com/'; const BASE_URL = 'https://hmgwebservices.com/';
const BASE_URL = 'https://uat.hmgwebservices.com/'; // const BASE_URL = 'https://uat.hmgwebservices.com/';
const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh"; const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh";
const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList"; const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList";
const PATIENT_PROGRESS_NOTE_URL = const PATIENT_PROGRESS_NOTE_URL =
@ -252,7 +252,7 @@ const GET_PRESCRIPTION_REPORT_ENH =
'Services/Patients.svc/REST/GetPrescriptionReport_enh'; 'Services/Patients.svc/REST/GetPrescriptionReport_enh';
const GET_PHARMACY_LIST = "Services/Patients.svc/REST/GetPharmcyList"; const GET_PHARMACY_LIST = "Services/Patients.svc/REST/GetPharmcyList";
const UPDATE_PROGRESS_NOTE_FOR_INPATIENT = "Services/DoctorApplication.svc/REST/UpdateProgressNoteForInPatient"; const UPDATE_PROGRESS_NOTE_FOR_INPATIENT = "Services/DoctorApplication.svc/REST/UpdateProgressNoteForInPatient";
const CREATE_PROGRESS_NOTE_FOR_INPATIENT = "Services/DoctorApplication.svc/REST/CreateProgressNoteForInPatient";
var selectedPatientType = 1; var selectedPatientType = 1;
//*********change value to decode json from Dropdown ************ //*********change value to decode json from Dropdown ************

@ -0,0 +1,88 @@
class CreateNoteModel {
int visitType;
int admissionNo;
int projectID;
int patientTypeID;
int patientID;
int clinicID;
String notes;
int createdBy;
int editedBy;
String nursingRemarks;
int languageID;
String stamp;
String iPAdress;
double versionID;
int channel;
String tokenID;
String sessionID;
bool isLoginForDoctorApp;
bool patientOutSA;
CreateNoteModel(
{this.visitType,
this.admissionNo,
this.projectID,
this.patientTypeID,
this.patientID,
this.clinicID,
this.notes,
this.createdBy,
this.editedBy,
this.nursingRemarks,
this.languageID,
this.stamp,
this.iPAdress,
this.versionID,
this.channel,
this.tokenID,
this.sessionID,
this.isLoginForDoctorApp,
this.patientOutSA});
CreateNoteModel.fromJson(Map<String, dynamic> json) {
visitType = json['VisitType'];
admissionNo = json['AdmissionNo'];
projectID = json['ProjectID'];
patientTypeID = json['PatientTypeID'];
patientID = json['PatientID'];
clinicID = json['ClinicID'];
notes = json['Notes'];
createdBy = json['CreatedBy'];
editedBy = json['EditedBy'];
nursingRemarks = json['NursingRemarks'];
languageID = json['LanguageID'];
stamp = json['stamp'];
iPAdress = json['IPAdress'];
versionID = json['VersionID'];
channel = json['Channel'];
tokenID = json['TokenID'];
sessionID = json['SessionID'];
isLoginForDoctorApp = json['IsLoginForDoctorApp'];
patientOutSA = json['PatientOutSA'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['VisitType'] = this.visitType;
data['AdmissionNo'] = this.admissionNo;
data['ProjectID'] = this.projectID;
data['PatientTypeID'] = this.patientTypeID;
data['PatientID'] = this.patientID;
data['ClinicID'] = this.clinicID;
data['Notes'] = this.notes;
data['CreatedBy'] = this.createdBy;
data['EditedBy'] = this.editedBy;
data['NursingRemarks'] = this.nursingRemarks;
data['LanguageID'] = this.languageID;
data['stamp'] = this.stamp;
data['IPAdress'] = this.iPAdress;
data['VersionID'] = this.versionID;
data['Channel'] = this.channel;
data['TokenID'] = this.tokenID;
data['SessionID'] = this.sessionID;
data['IsLoginForDoctorApp'] = this.isLoginForDoctorApp;
data['PatientOutSA'] = this.patientOutSA;
return data;
}
}

@ -1,6 +1,7 @@
import 'package:doctor_app_flutter/client/base_app_client.dart'; import 'package:doctor_app_flutter/client/base_app_client.dart';
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/core/model/note/CreateNoteModel.dart';
import 'package:doctor_app_flutter/core/model/note/note_model.dart'; import 'package:doctor_app_flutter/core/model/note/note_model.dart';
import 'package:doctor_app_flutter/core/model/note/update_note_model.dart'; import 'package:doctor_app_flutter/core/model/note/update_note_model.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart';
@ -297,7 +298,23 @@ class PatientService extends BaseService {
hasError = false; hasError = false;
await baseAppClient.post( await baseAppClient.post(
PATIENT_PROGRESS_NOTE_URL, UPDATE_PROGRESS_NOTE_FOR_INPATIENT,
onSuccess: (dynamic response, int statusCode) {
print("ok");
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: req.toJson(),
);
}
Future createPatientProgressNote(CreateNoteModel req) async {
hasError = false;
await baseAppClient.post(
CREATE_PROGRESS_NOTE_FOR_INPATIENT,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
print("ok"); print("ok");
}, },

@ -1,4 +1,5 @@
import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/note/CreateNoteModel.dart';
import 'package:doctor_app_flutter/core/model/note/note_model.dart'; import 'package:doctor_app_flutter/core/model/note/note_model.dart';
import 'package:doctor_app_flutter/core/model/note/update_note_model.dart'; import 'package:doctor_app_flutter/core/model/note/update_note_model.dart';
import 'package:doctor_app_flutter/core/service/patient_service.dart'; import 'package:doctor_app_flutter/core/service/patient_service.dart';
@ -150,7 +151,17 @@ class PatientViewModel extends BaseViewModel {
Future updatePatientProgressNote(UpdateNoteReqModel req) async { Future updatePatientProgressNote(UpdateNoteReqModel req) async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
await _patientService.getPatientProgressNote(req); await _patientService.updatePatientProgressNote(req);
if (_patientService.hasError) {
error = _patientService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
}
Future createPatientProgressNote(CreateNoteModel req) async {
setState(ViewState.BusyLocal);
await _patientService.createPatientProgressNote(req);
if (_patientService.hasError) { if (_patientService.hasError) {
error = _patientService.error; error = _patientService.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);

@ -85,6 +85,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
patientModel: model, patientModel: model,
patient: patient, patient: patient,
visitType: widget.visitType, visitType: widget.visitType,
isUpdate: false,
)), )),
); );
},label: 'Add a New Order',), },label: 'Add a New Order',),
@ -191,6 +192,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
patientModel: model, patientModel: model,
patient: patient, patient: patient,
visitType: widget.visitType, visitType: widget.visitType,
isUpdate: true,
)), )),
); );

@ -1,23 +1,20 @@
import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/medical_file_model.dart'; import 'package:doctor_app_flutter/core/model/note/CreateNoteModel.dart';
import 'package:doctor_app_flutter/core/model/note/note_model.dart'; import 'package:doctor_app_flutter/core/model/note/note_model.dart';
import 'package:doctor_app_flutter/core/model/note/update_note_model.dart'; import 'package:doctor_app_flutter/core/model/note/update_note_model.dart';
import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/models/patient/progress_note_request.dart'; import 'package:doctor_app_flutter/models/patient/progress_note_request.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart';
import 'package:doctor_app_flutter/screens/procedures/entity_list_checkbox_search_widget.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -26,9 +23,10 @@ class UpdateNoteOrder extends StatefulWidget {
final PatientViewModel patientModel; final PatientViewModel patientModel;
final PatiantInformtion patient; final PatiantInformtion patient;
final int visitType; final int visitType;
final bool isUpdate;
const UpdateNoteOrder( const UpdateNoteOrder(
{Key key, this.note, this.patientModel, this.patient, this.visitType}) {Key key, this.note, this.patientModel, this.patient, this.visitType, this.isUpdate})
: super(key: key); : super(key: key);
@override @override
@ -108,22 +106,51 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
AppButton( AppButton(
title: 'Add Progress Note', title: 'Add Progress Note',
color: Color(0xff359846), color: Color(0xff359846),
disabled: progressNoteController.text.isEmpty, // disabled: progressNoteController.text.isEmpty,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
onPressed: () async { onPressed: () async {
GifLoaderDialogUtils.showMyDialog(context);
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
if (widget.isUpdate) {
UpdateNoteReqModel reqModel = UpdateNoteReqModel( UpdateNoteReqModel reqModel = UpdateNoteReqModel(
admissionNo: int.parse(widget.patient.admissionNo), admissionNo: int.parse(widget.patient.admissionNo),
cancelledNote: false, cancelledNote: false,
lineItemNo: 30, lineItemNo: 30,
notes createdBy: widget.note.createdBy,
:progressNoteController.text, verifiedNote: false); notes: progressNoteController.text
GifLoaderDialogUtils.showMyDialog(context); ,
verifiedNote: false,
patientTypeID: widget.patient.patientType,
patientOutSA: false,
);
await model.updatePatientProgressNote(reqModel); await model.updatePatientProgressNote(reqModel);
} else {
CreateNoteModel reqModel = CreateNoteModel(
admissionNo: int.parse(widget.patient.admissionNo),
createdBy: doctorProfile.doctorID,
visitType: widget.visitType,
patientID: widget.patient.patientId,
nursingRemarks: ' ',
patientTypeID: widget.patient.patientType,
patientOutSA: false,
notes: progressNoteController.text
);
await model.createPatientProgressNote(reqModel);
}
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
Helpers.showErrorToast("Error"); Helpers.showErrorToast("Error");
} else { } else {
ProgressNoteRequest progressNoteRequest = ProgressNoteRequest( ProgressNoteRequest progressNoteRequest =
ProgressNoteRequest(
visitType: widget.visitType, visitType: widget.visitType,
// if equal 5 then this will return progress note // if equal 5 then this will return progress note
admissionNo: int.parse(widget.patient.admissionNo), admissionNo: int.parse(widget.patient.admissionNo),
@ -131,7 +158,7 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
patientTypeID: widget.patient.patientType, patientTypeID: widget.patient.patientType,
languageID: 2); languageID: 2);
await widget.patientModel.getPatientProgressNote( await widget.patientModel.getPatientProgressNote(
progressNoteRequest); progressNoteRequest.toJson());
} }
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);

@ -95,7 +95,7 @@ class ProfileMedicalInfoWidgetInPatient extends StatelessWidget {
patient: patient, patient: patient,
patientType: patientType, patientType: patientType,
arrivalType: arrivalType, arrivalType: arrivalType,
route: null, route: ORDER_NOTE,
nameLine1: "Text", nameLine1: "Text",
nameLine2: TranslationBase.of(context).orders, nameLine2: TranslationBase.of(context).orders,
icon: 'patient/Progress_notes.png'), icon: 'patient/Progress_notes.png'),

@ -49,7 +49,7 @@ class _AppButtonState extends State<AppButton> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return IgnorePointer( return IgnorePointer(
ignoring: widget.loading, ignoring: widget.loading ||widget.disabled,
child: RawMaterialButton( child: RawMaterialButton(
fillColor: widget.color != null ? widget.color : HexColor("#B8382C"), fillColor: widget.color != null ? widget.color : HexColor("#B8382C"),
splashColor: widget.color, splashColor: widget.color,

Loading…
Cancel
Save