add fixes on episode

merge-requests/773/head
Elham Rababh 5 years ago
parent eabe16a1d3
commit b015cb06f7

@ -372,7 +372,7 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
),
),
),
bottomSheet: Container(
bottomSheet: model.state == ViewState.Busy?Container(height: 0,):Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(

@ -71,6 +71,38 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
}
}
getPatientProgressNote(model, {bool isAddProgress = false}) async {
GetGetProgressNoteReqModel getGetProgressNoteReqModel =
GetGetProgressNoteReqModel(
appointmentNo:
int.parse(widget.patientInfo.appointmentNo.toString()),
patientMRN: widget.patientInfo.patientMRN,
episodeID: widget.patientInfo.episodeNo.toString(),
editedBy: '',
doctorID: '');
await model.getPatientProgressNote(getGetProgressNoteReqModel);
if (model.patientProgressNoteList.isNotEmpty) {
progressNoteController.text = Helpers.parseHtmlString(
model.patientProgressNoteList[0].planNote);
patientProgressNote.planNote = progressNoteController.text;
patientProgressNote.createdByName =
model.patientProgressNoteList[0].createdByName;
patientProgressNote.createdOn =
model.patientProgressNoteList[0].createdOn;
patientProgressNote.editedOn =
model.patientProgressNoteList[0].editedOn;
patientProgressNote.editedByName =
model.patientProgressNoteList[0].editedByName;
patientProgressNote.appointmentNo =
model.patientProgressNoteList[0].appointmentNo;
setState(() {
isAddProgress = isAddProgress;
});
}
}
@override
Widget build(BuildContext context) {
return BaseView<SOAPViewModel>(
@ -210,22 +242,22 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
),
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
MainAxisAlignment.end,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Row(
children: [
AppText(
'Condition: ',
fontSize: 12,
),
AppText(
patientProgressNote.mName ??
'',
fontWeight: FontWeight.w600),
],
),
// Row(
// children: [
// AppText(
// 'Condition: ',
// fontSize: 12,
// ),
// AppText(
// patientProgressNote.mName ??
// '',
// fontWeight: FontWeight.w600),
// ],
// ),
AppText(
patientProgressNote.createdOn !=
null
@ -326,21 +358,6 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
onPressed: () async {
if (progressNoteController.text.isNotEmpty) {
if (isAddProgress) {
Map profile =
await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile =
DoctorProfileModel.fromJson(profile);
setState(() {
patientProgressNote.createdByName =
patientProgressNote.createdByName ??
doctorProfile.doctorName;
patientProgressNote.editedByName =
doctorProfile.doctorName;
patientProgressNote.createdOn =
DateTime.now().toString();
patientProgressNote.planNote =
progressNoteController.text;
});
submitPlan(model);
} else {
Navigator.of(context).pop();
@ -391,10 +408,35 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
if (model.state == ViewState.ErrorLocal) {
Helpers.showErrorToast(model.error);
} else {
setState(() {
isAddProgress = !isAddProgress;
});
GetGetProgressNoteReqModel getGetProgressNoteReqModel =
GetGetProgressNoteReqModel(
appointmentNo:
int.parse(widget.patientInfo.appointmentNo.toString()),
patientMRN: widget.patientInfo.patientMRN,
episodeID: widget.patientInfo.episodeNo.toString(),
editedBy: '',
doctorID: '');
await model.getPatientProgressNote(getGetProgressNoteReqModel);
if (model.patientProgressNoteList.isNotEmpty) {
progressNoteController.text = Helpers.parseHtmlString(
model.patientProgressNoteList[0].planNote);
patientProgressNote.planNote = progressNoteController.text;
patientProgressNote.createdByName =
model.patientProgressNoteList[0].createdByName;
patientProgressNote.createdOn =
model.patientProgressNoteList[0].createdOn;
patientProgressNote.editedOn =
model.patientProgressNoteList[0].editedOn;
patientProgressNote.editedByName =
model.patientProgressNoteList[0].editedByName;
patientProgressNote.appointmentNo =
model.patientProgressNoteList[0].appointmentNo;
setState(() {
isAddProgress = false;
});
}
}
widget.changeLoadingState(false);
} else {

@ -159,6 +159,9 @@ class _AddAllergiesItemState extends State<AddAllergiesItem> {
maxLines: 25,
minLines: 3,
hasBorder: true,
onChanged: (value){
mySelectedAllergy.remark = value;
},
inputType: TextInputType.multiline,
),

@ -188,6 +188,7 @@ class _AddMedicationState extends State<AddMedication> {
list: model.medicationDoseTimeList,
okText:
TranslationBase.of(context).ok,
selectedValue: _selectedMedicationDose,
okFunction: (selectedValue) {
setState(() {
_selectedMedicationDose =
@ -236,6 +237,7 @@ class _AddMedicationState extends State<AddMedication> {
list: model.medicationStrengthList,
okText:
TranslationBase.of(context).ok,
selectedValue: _selectedMedicationStrength,
okFunction: (selectedValue) {
setState(() {
_selectedMedicationStrength =
@ -284,6 +286,7 @@ class _AddMedicationState extends State<AddMedication> {
MasterKeyDailog dialog =
MasterKeyDailog(
list: model.medicationRouteList,
selectedValue: _selectedMedicationRoute,
okText:
TranslationBase.of(context).ok,
okFunction: (selectedValue) {
@ -333,6 +336,7 @@ class _AddMedicationState extends State<AddMedication> {
list: model.medicationFrequencyList,
okText:
TranslationBase.of(context).ok,
selectedValue: _selectedMedicationFrequency,
okFunction: (selectedValue) {
setState(() {
_selectedMedicationFrequency =

Loading…
Cancel
Save