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_LETTERS = "[a-zA-Z &'\"]";
const ONLY_DATE = "[0-9/]";
// const BASE_URL = 'https://hmgwebservices.com/';
const BASE_URL = 'https://uat.hmgwebservices.com/';
const BASE_URL = 'https://hmgwebservices.com/';
// const BASE_URL = 'https://uat.hmgwebservices.com/';
const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh";
const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList";
const PATIENT_PROGRESS_NOTE_URL =
@ -252,7 +252,7 @@ const GET_PRESCRIPTION_REPORT_ENH =
'Services/Patients.svc/REST/GetPrescriptionReport_enh';
const GET_PHARMACY_LIST = "Services/Patients.svc/REST/GetPharmcyList";
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;
//*********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/config/config.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/update_note_model.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
@ -297,7 +298,23 @@ class PatientService extends BaseService {
hasError = false;
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) {
print("ok");
},

@ -1,4 +1,5 @@
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/update_note_model.dart';
import 'package:doctor_app_flutter/core/service/patient_service.dart';
@ -150,7 +151,17 @@ class PatientViewModel extends BaseViewModel {
Future updatePatientProgressNote(UpdateNoteReqModel req) async {
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) {
error = _patientService.error;
setState(ViewState.ErrorLocal);

@ -85,6 +85,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
patientModel: model,
patient: patient,
visitType: widget.visitType,
isUpdate: false,
)),
);
},label: 'Add a New Order',),
@ -191,6 +192,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
patientModel: model,
patient: patient,
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/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/update_note_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/progress_note_request.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/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/translations_delegate_base.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/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:flutter/material.dart';
@ -26,9 +23,10 @@ class UpdateNoteOrder extends StatefulWidget {
final PatientViewModel patientModel;
final PatiantInformtion patient;
final int visitType;
final bool isUpdate;
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);
@override
@ -107,23 +105,52 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
children: <Widget>[
AppButton(
title: 'Add Progress Note',
color: Color(0xff359846),
disabled: progressNoteController.text.isEmpty,
fontWeight: FontWeight.w700,
onPressed: () async {
UpdateNoteReqModel reqModel = UpdateNoteReqModel(
admissionNo: int.parse(widget.patient.admissionNo),
cancelledNote: false,
lineItemNo: 30,
notes
:progressNoteController.text, verifiedNote: false);
GifLoaderDialogUtils.showMyDialog(context);
await model.updatePatientProgressNote(reqModel);
if (model.state == ViewState.ErrorLocal) {
Helpers.showErrorToast("Error");
} else {
ProgressNoteRequest progressNoteRequest = ProgressNoteRequest(
color: Color(0xff359846),
// disabled: progressNoteController.text.isEmpty,
fontWeight: FontWeight.w700,
onPressed: () async {
GifLoaderDialogUtils.showMyDialog(context);
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
if (widget.isUpdate) {
UpdateNoteReqModel reqModel = UpdateNoteReqModel(
admissionNo: int.parse(widget.patient.admissionNo),
cancelledNote: false,
lineItemNo: 30,
createdBy: widget.note.createdBy,
notes: progressNoteController.text
,
verifiedNote: false,
patientTypeID: widget.patient.patientType,
patientOutSA: false,
);
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) {
Helpers.showErrorToast("Error");
} else {
ProgressNoteRequest progressNoteRequest =
ProgressNoteRequest(
visitType: widget.visitType,
// if equal 5 then this will return progress note
admissionNo: int.parse(widget.patient.admissionNo),
@ -131,7 +158,7 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
patientTypeID: widget.patient.patientType,
languageID: 2);
await widget.patientModel.getPatientProgressNote(
progressNoteRequest);
progressNoteRequest.toJson());
}
GifLoaderDialogUtils.hideDialog(context);

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

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

Loading…
Cancel
Save