first step from fixing Soap

merge-requests/752/head
Elham Rababah 5 years ago
parent 550d54c034
commit 9a2ce62216

@ -72,7 +72,7 @@ class ProcedureService extends BaseService {
templateList.clear(); templateList.clear();
response['DAPP_TemplateGetList'].forEach((template) { response['DAPP_TemplateGetList'].forEach((template) {
ProcedureTempleteDetailsModel templateElement = ProcedureTempleteDetailsModel.fromJson(template); ProcedureTempleteDetailsModel templateElement = ProcedureTempleteDetailsModel.fromJson(template);
if (categoryID != null) { if (categoryID != null ) {
if (categoryID == templateElement.categoryID) { if (categoryID == templateElement.categoryID) {
templateList.add(templateElement); templateList.add(templateElement);
} }
@ -80,9 +80,6 @@ class ProcedureService extends BaseService {
templateList.add(templateElement); templateList.add(templateElement);
} }
}); });
// response['HIS_ProcedureTemplateList'].forEach((template) {
// _templateList.add(ProcedureTempleteModel.fromJson(template));
// });
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;

@ -48,7 +48,7 @@ class PatientMedicalReportViewModel extends BaseViewModel {
} }
Future insertMedicalReport(PatiantInformtion patient, String htmlText) async { Future insertMedicalReport(PatiantInformtion patient, String htmlText) async {
setState(ViewState.Busy); setState(ViewState.BusyLocal);
await _service.insertMedicalReport(patient, htmlText); await _service.insertMedicalReport(patient, htmlText);
if (_service.hasError) { if (_service.hasError) {
error = _service.error!; error = _service.error!;

@ -3,14 +3,14 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class SOAPOpenItems extends StatelessWidget { class SOAPOpenItems extends StatelessWidget {
final Function onTap; final VoidCallback onTap;
final String label; final String label;
const SOAPOpenItems({Key? key, required this.onTap, required this.label}) : super(key: key); const SOAPOpenItems({Key? key, required this.onTap, required this.label}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return InkWell( return InkWell(
onTap: onTap(), onTap: onTap,
child: Container( child: Container(
padding: EdgeInsets.symmetric(vertical: 8, horizontal: 8.0), padding: EdgeInsets.symmetric(vertical: 8, horizontal: 8.0),
margin: EdgeInsets.symmetric(vertical: 8), margin: EdgeInsets.symmetric(vertical: 8),

@ -8,7 +8,7 @@ import 'package:hexcolor/hexcolor.dart';
class ExpandableSOAPWidget extends StatelessWidget { class ExpandableSOAPWidget extends StatelessWidget {
final bool isExpanded; final bool isExpanded;
final Widget child; final Widget child;
final Function onTap; final VoidCallback onTap;
final headerTitle; final headerTitle;
final bool isRequired; final bool isRequired;
@ -16,7 +16,7 @@ class ExpandableSOAPWidget extends StatelessWidget {
{Key? key, {Key? key,
required this.isExpanded, required this.isExpanded,
required this.child, required this.child,
required this.onTap, required this.onTap,
this.headerTitle, this.headerTitle,
this.isRequired = true}) this.isRequired = true})
: super(key: key); : super(key: key);
@ -34,12 +34,12 @@ class ExpandableSOAPWidget extends StatelessWidget {
), ),
child: HeaderBodyExpandableNotifier( child: HeaderBodyExpandableNotifier(
headerWidget: InkWell( headerWidget: InkWell(
onTap: onTap(), onTap: onTap,
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
InkWell( InkWell(
onTap: onTap(), onTap: onTap,
child: Row( child: Row(
children: [ children: [
AppText(headerTitle, variant: isExpanded ? "bodyText" : '', fontSize: 15, color: Colors.black), AppText(headerTitle, variant: isExpanded ? "bodyText" : '', fontSize: 15, color: Colors.black),
@ -52,7 +52,7 @@ class ExpandableSOAPWidget extends StatelessWidget {
), ),
), ),
InkWell( InkWell(
onTap: onTap(), onTap: onTap,
child: Icon(isExpanded ? EvaIcons.arrowIosUpwardOutline : EvaIcons.arrowIosDownwardOutline), child: Icon(isExpanded ? EvaIcons.arrowIosUpwardOutline : EvaIcons.arrowIosDownwardOutline),
) )
], ],

@ -41,7 +41,7 @@ class _AddMedicationState extends State<AddMedication> {
TextEditingController strengthController = TextEditingController(); TextEditingController strengthController = TextEditingController();
TextEditingController routeController = TextEditingController(); TextEditingController routeController = TextEditingController();
TextEditingController frequencyController = TextEditingController(); TextEditingController frequencyController = TextEditingController();
late GetMedicationResponseModel _selectedMedication; GetMedicationResponseModel? _selectedMedication;
GlobalKey key = new GlobalKey<AutoCompleteTextFieldState<GetMedicationResponseModel>>(); GlobalKey key = new GlobalKey<AutoCompleteTextFieldState<GetMedicationResponseModel>>();
bool isFormSubmitted = false; bool isFormSubmitted = false;
@ -127,8 +127,8 @@ class _AddMedicationState extends State<AddMedication> {
) )
: AppTextFieldCustom( : AppTextFieldCustom(
hintText: _selectedMedication != null hintText: _selectedMedication != null
? _selectedMedication.description! + ? _selectedMedication!.description! +
(' (${_selectedMedication.genericName} )') (' (${_selectedMedication!.genericName} )')
: TranslationBase.of(context).searchMedicineNameHere, : TranslationBase.of(context).searchMedicineNameHere,
minLines: 2, minLines: 2,
maxLines: 2, maxLines: 2,
@ -346,7 +346,7 @@ class _AddMedicationState extends State<AddMedication> {
_selectedMedicationRoute != null && _selectedMedicationRoute != null &&
_selectedMedicationFrequency != null) { _selectedMedicationFrequency != null) {
widget.medicationController.text = widget.medicationController.text + widget.medicationController.text = widget.medicationController.text +
'${_selectedMedication.description} (${TranslationBase.of(context).doseTime} ) ${doseController.text} (${TranslationBase.of(context).strength}) ${strengthController.text} (${TranslationBase.of(context).route}) ${routeController.text} (${TranslationBase.of(context).frequency}) ${frequencyController.text} \n \n'; '${_selectedMedication!.description} (${TranslationBase.of(context).doseTime} ) ${doseController.text} (${TranslationBase.of(context).strength}) ${strengthController.text} (${TranslationBase.of(context).route}) ${routeController.text} (${TranslationBase.of(context).frequency}) ${frequencyController.text} \n \n';
Navigator.of(context).pop(); Navigator.of(context).pop();
} }
}, },

@ -58,10 +58,10 @@ extension procedureType on ProcedureType {
} }
} }
String getCategoryId() { String ? getCategoryId() {
switch (this) { switch (this) {
case ProcedureType.PROCEDURE: case ProcedureType.PROCEDURE:
return ''; return null;
case ProcedureType.LAB_RESULT: case ProcedureType.LAB_RESULT:
return "02"; return "02";
case ProcedureType.RADIOLOGY: case ProcedureType.RADIOLOGY:
@ -69,7 +69,7 @@ extension procedureType on ProcedureType {
case ProcedureType.PRESCRIPTION: case ProcedureType.PRESCRIPTION:
return "55"; return "55";
default: default:
return ''; return null;
} }
} }

@ -47,7 +47,7 @@ class MasterKeyCheckboxSearchAllergiesWidget extends StatefulWidget {
class _MasterKeyCheckboxSearchAllergiesWidgetState extends State<MasterKeyCheckboxSearchAllergiesWidget> { class _MasterKeyCheckboxSearchAllergiesWidgetState extends State<MasterKeyCheckboxSearchAllergiesWidget> {
List<MasterKeyModel> items = []; List<MasterKeyModel> items = [];
late MasterKeyModel _selectedAllergySeverity; MasterKeyModel? _selectedAllergySeverity;
bool isSubmitted = false; bool isSubmitted = false;
@override @override

Loading…
Cancel
Save