|
|
|
|
@ -3,15 +3,13 @@ import 'package:doctor_app_flutter/config/size_config.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/models/SOAP/GeneralGetReqForSOAP.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/models/SOAP/GetHistoryReqModel.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_allergy.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_history.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/models/SOAP/post_allergy_request_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/models/SOAP/post_chief_complaint_request_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/models/SOAP/post_histories_request_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_allergy.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_history.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/screens/base/base_view.dart';
|
|
|
|
|
@ -20,9 +18,7 @@ import 'package:doctor_app_flutter/screens/patients/profile/soap_update/subjecti
|
|
|
|
|
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/buttons/app_buttons_widget.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:hexcolor/hexcolor.dart';
|
|
|
|
|
|
|
|
|
|
import '../shared_soap_widgets/SOAP_step_header.dart';
|
|
|
|
|
import '../shared_soap_widgets/expandable_SOAP_widget.dart';
|
|
|
|
|
@ -57,33 +53,7 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> implements
|
|
|
|
|
|
|
|
|
|
getHistory(SOAPViewModel model) async {
|
|
|
|
|
widget.changeLoadingState(true);
|
|
|
|
|
|
|
|
|
|
model.complaintsControllerError = '';
|
|
|
|
|
model.medicationControllerError = '';
|
|
|
|
|
model.illnessControllerError = '';
|
|
|
|
|
GetHistoryReqModel getHistoryReqModel = GetHistoryReqModel(
|
|
|
|
|
patientMRN: widget.patientInfo.patientMRN,
|
|
|
|
|
episodeID: widget.patientInfo.episodeNo.toString(),
|
|
|
|
|
appointmentNo: int.parse(widget.patientInfo.appointmentNo.toString()),
|
|
|
|
|
doctorID: '',
|
|
|
|
|
editedBy: '');
|
|
|
|
|
|
|
|
|
|
await model.getPatientHistories(getHistoryReqModel, isFirst: true);
|
|
|
|
|
|
|
|
|
|
if (model.patientHistoryList.isNotEmpty) {
|
|
|
|
|
if (model.historyFamilyList.isEmpty) {
|
|
|
|
|
await model.getMasterLookup(MasterKeysService.HistoryFamily);
|
|
|
|
|
}
|
|
|
|
|
if (model.historyMedicalList.isEmpty) {
|
|
|
|
|
await model.getMasterLookup(MasterKeysService.HistoryMedical);
|
|
|
|
|
}
|
|
|
|
|
if (model.historySurgicalList.length == 0) {
|
|
|
|
|
await model.getMasterLookup(MasterKeysService.HistorySurgical);
|
|
|
|
|
}
|
|
|
|
|
if (model.historySportList.length == 0) {
|
|
|
|
|
await model.getMasterLookup(MasterKeysService.HistorySports);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
model.patientHistoryList.forEach((element) {
|
|
|
|
|
if (element.historyType == MasterKeysService.HistoryFamily.getMasterKeyService()) {
|
|
|
|
|
MasterKeyModel history = model.getOneMasterKey(
|
|
|
|
|
@ -138,17 +108,8 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> implements
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getAllergies(SOAPViewModel model) async {
|
|
|
|
|
GeneralGetReqForSOAP generalGetReqForSOAP = GeneralGetReqForSOAP(
|
|
|
|
|
patientMRN: widget.patientInfo.patientMRN,
|
|
|
|
|
episodeId: widget.patientInfo.episodeNo,
|
|
|
|
|
appointmentNo: int.parse(widget.patientInfo.appointmentNo.toString()),
|
|
|
|
|
doctorID: '',
|
|
|
|
|
editedBy: '');
|
|
|
|
|
await model.getPatientAllergy(generalGetReqForSOAP);
|
|
|
|
|
if (model.patientAllergiesList.isNotEmpty) {
|
|
|
|
|
if (model.allergiesList.isEmpty) await model.getMasterLookup(MasterKeysService.Allergies);
|
|
|
|
|
if (model.allergySeverityList.isEmpty) await model.getMasterLookup(MasterKeysService.AllergySeverity);
|
|
|
|
|
|
|
|
|
|
if (model.patientAllergiesList.isNotEmpty) {
|
|
|
|
|
model.patientAllergiesList.forEach((element) {
|
|
|
|
|
MasterKeyModel selectedAllergy = model.getOneMasterKey(
|
|
|
|
|
masterKeys: MasterKeysService.Allergies, id: element.allergyDiseaseId, typeId: element.allergyDiseaseType);
|
|
|
|
|
@ -183,16 +144,8 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> implements
|
|
|
|
|
myAllergiesList.clear();
|
|
|
|
|
myHistoryList.clear();
|
|
|
|
|
model.setSubjectiveCallBack(this);
|
|
|
|
|
GetChiefComplaintReqModel getChiefComplaintReqModel = GetChiefComplaintReqModel(
|
|
|
|
|
admissionNo: widget.patientInfo.admissionNo != null ? int.parse(widget.patientInfo.admissionNo) : null,
|
|
|
|
|
patientMRN: widget.patientInfo.patientMRN,
|
|
|
|
|
appointmentNo: widget.patientInfo.appointmentNo != null
|
|
|
|
|
? int.parse(widget.patientInfo.appointmentNo.toString())
|
|
|
|
|
: null,
|
|
|
|
|
episodeId: widget.patientInfo.episodeNo,
|
|
|
|
|
episodeID: widget.patientInfo.episodeNo,
|
|
|
|
|
doctorID: '');
|
|
|
|
|
await model.getPatientChiefComplaint(getChiefComplaintReqModel);
|
|
|
|
|
await model.onUpdateSubjectStepStart(widget.patientInfo);
|
|
|
|
|
|
|
|
|
|
if (model.patientChiefComplaintList.isNotEmpty) {
|
|
|
|
|
isChiefExpand = true;
|
|
|
|
|
complaintsController.text = Helpers.parseHtmlString(model.patientChiefComplaintList[0].chiefComplaint);
|
|
|
|
|
|