WIP: Infectious disease approval
parent
26a60cc26f
commit
8456ed8530
@ -0,0 +1,57 @@
|
|||||||
|
class InterventionHistoryList{
|
||||||
|
List<InterventionHistory>? history = [];
|
||||||
|
InterventionHistoryList.fromJson(Map<String, dynamic> json){
|
||||||
|
var entryList = json['entityList'] ?? {};
|
||||||
|
List<InterventionHistory> tempList = [];
|
||||||
|
for(var item in entryList){
|
||||||
|
var medication = InterventionHistory.fromJson(item);
|
||||||
|
tempList.add(medication);
|
||||||
|
}
|
||||||
|
history?.addAll(tempList);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class InterventionHistory {
|
||||||
|
String? authizationFormText;
|
||||||
|
int? authorizedAction;
|
||||||
|
int? commentedBy;
|
||||||
|
String? commentedByName;
|
||||||
|
String? interventionDesc;
|
||||||
|
int? interventionId;
|
||||||
|
String? remark;
|
||||||
|
|
||||||
|
InterventionHistory({
|
||||||
|
this.authizationFormText,
|
||||||
|
this.authorizedAction,
|
||||||
|
this.commentedBy,
|
||||||
|
this.commentedByName,
|
||||||
|
this.interventionDesc,
|
||||||
|
this.interventionId,
|
||||||
|
this.remark,
|
||||||
|
});
|
||||||
|
|
||||||
|
factory InterventionHistory.fromJson(Map<String, dynamic> json) {
|
||||||
|
print('the remark is ${json['remark']}');
|
||||||
|
return InterventionHistory(
|
||||||
|
authizationFormText: json['authizationFormText'] ?? '',
|
||||||
|
authorizedAction: json['authorizedAction'] ?? '',
|
||||||
|
commentedBy: json['commentedBy'] ?? '',
|
||||||
|
commentedByName: json['commentedByName'] ?? '',
|
||||||
|
interventionDesc: json['interventionDesc'] ?? '',
|
||||||
|
interventionId: json['interventionId'] ?? '',
|
||||||
|
remark: json['remark'] ?? '',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
return {
|
||||||
|
'authizationFormText': authizationFormText,
|
||||||
|
'authorizedAction': authorizedAction,
|
||||||
|
'commentedBy': commentedBy,
|
||||||
|
'commentedByName': commentedByName,
|
||||||
|
'interventionDesc': interventionDesc,
|
||||||
|
'interventionId': interventionId,
|
||||||
|
'remark': remark,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,159 @@
|
|||||||
|
class MedicationList{
|
||||||
|
List<Medication>? medication = [];
|
||||||
|
MedicationList.fromJson(Map<String, dynamic> json){
|
||||||
|
var entryList = json['entityList'] ?? {};
|
||||||
|
List<Medication> tempList = [];
|
||||||
|
for(var item in entryList){
|
||||||
|
var medication = Medication.fromJson(item);
|
||||||
|
tempList.add(medication);
|
||||||
|
}
|
||||||
|
medication?.addAll(tempList);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class Medication {
|
||||||
|
int? accessLevel;
|
||||||
|
int? admissionNo;
|
||||||
|
String? authorizedBy;
|
||||||
|
String? authorizedByName;
|
||||||
|
String? createdBy;
|
||||||
|
String? doctorComments;
|
||||||
|
String? doctorName;
|
||||||
|
String? dosageDetail;
|
||||||
|
int? itemID;
|
||||||
|
int? lineItemNo;
|
||||||
|
String? medication;
|
||||||
|
String? nursingStation;
|
||||||
|
int? orderNo;
|
||||||
|
int? patientID;
|
||||||
|
String? patientName;
|
||||||
|
String? pharmacyRemarks;
|
||||||
|
int? prescriptionNo;
|
||||||
|
DateTime? startDatetime;
|
||||||
|
int? status;
|
||||||
|
String? statusName;
|
||||||
|
DateTime? stopDatetime;
|
||||||
|
|
||||||
|
Medication({
|
||||||
|
this.accessLevel,
|
||||||
|
this.admissionNo,
|
||||||
|
this.authorizedBy,
|
||||||
|
this.authorizedByName,
|
||||||
|
this.createdBy,
|
||||||
|
this.doctorComments,
|
||||||
|
this.doctorName,
|
||||||
|
this.dosageDetail,
|
||||||
|
this.itemID,
|
||||||
|
this.lineItemNo,
|
||||||
|
this.medication,
|
||||||
|
this.nursingStation,
|
||||||
|
this.orderNo,
|
||||||
|
this.patientID,
|
||||||
|
this.patientName,
|
||||||
|
this.pharmacyRemarks,
|
||||||
|
this.prescriptionNo,
|
||||||
|
this.startDatetime,
|
||||||
|
this.status,
|
||||||
|
this.statusName,
|
||||||
|
this.stopDatetime,
|
||||||
|
});
|
||||||
|
|
||||||
|
dynamic? getValue(int index){
|
||||||
|
switch (index) {
|
||||||
|
case 0:
|
||||||
|
return this.accessLevel;
|
||||||
|
case 1:
|
||||||
|
return this.patientID;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
return this.patientName;
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
return this.nursingStation;
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
return this.admissionNo;
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
return this.medication;
|
||||||
|
break;
|
||||||
|
case 6:
|
||||||
|
return this.dosageDetail;
|
||||||
|
break;
|
||||||
|
case 7:
|
||||||
|
return this.doctorComments;
|
||||||
|
break;
|
||||||
|
case 8:
|
||||||
|
return this.startDatetime;
|
||||||
|
break;
|
||||||
|
case 9:
|
||||||
|
return this.stopDatetime;
|
||||||
|
break;
|
||||||
|
case 10:
|
||||||
|
return this.status;
|
||||||
|
break;
|
||||||
|
case 11:
|
||||||
|
return this.doctorName;
|
||||||
|
break;
|
||||||
|
case 12:
|
||||||
|
return this.authorizedBy;
|
||||||
|
break;
|
||||||
|
case 13:
|
||||||
|
return this.pharmacyRemarks;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return index;
|
||||||
|
}
|
||||||
|
|
||||||
|
factory Medication.fromJson(Map<String, dynamic> json) {
|
||||||
|
return Medication(
|
||||||
|
accessLevel: json['accessLevel'] ?? '',
|
||||||
|
admissionNo: json['admissionNo']?? '',
|
||||||
|
authorizedBy: json['authorizedby']?? '-',
|
||||||
|
authorizedByName: json['authorizedbyName']?? '',
|
||||||
|
createdBy: json['createdBy']?? '',
|
||||||
|
doctorComments: json['doctorComments']?? '',
|
||||||
|
doctorName: json['doctorName']?? '',
|
||||||
|
dosageDetail: json['dosageDetail']?? '',
|
||||||
|
itemID: json['itemID']?? '',
|
||||||
|
lineItemNo: json['lineItemNo']?? '',
|
||||||
|
medication: json['medication']?? '',
|
||||||
|
nursingStation: json['nursingStation']?? '',
|
||||||
|
orderNo: json['orderNo']?? '',
|
||||||
|
patientID: json['patientID']?? '',
|
||||||
|
patientName: json['patientName']?? '',
|
||||||
|
pharmacyRemarks: json['pharmacyRemarks']?? '-',
|
||||||
|
prescriptionNo: json['prescriptionNo']?? '',
|
||||||
|
startDatetime: json['startDatetime'] != null ? DateTime.parse(json['startDatetime']) : null,
|
||||||
|
status: json['status']?? '',
|
||||||
|
statusName: json['statusName']?? '',
|
||||||
|
stopDatetime: json['stopDatetime'] != null ? DateTime.parse(json['stopDatetime']) : null,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
return {
|
||||||
|
'accessLevel': accessLevel,
|
||||||
|
'admissionNo': admissionNo,
|
||||||
|
'authorizedby': authorizedBy,
|
||||||
|
'authorizedbyName': authorizedByName,
|
||||||
|
'createdBy': createdBy,
|
||||||
|
'doctorComments': doctorComments,
|
||||||
|
'doctorName': doctorName,
|
||||||
|
'dosageDetail': dosageDetail,
|
||||||
|
'itemID': itemID,
|
||||||
|
'lineItemNo': lineItemNo,
|
||||||
|
'medication': medication,
|
||||||
|
'nursingStation': nursingStation,
|
||||||
|
'orderNo': orderNo,
|
||||||
|
'patientID': patientID,
|
||||||
|
'patientName': patientName,
|
||||||
|
'pharmacyRemarks': pharmacyRemarks,
|
||||||
|
'prescriptionNo': prescriptionNo,
|
||||||
|
'startDatetime': startDatetime?.toIso8601String(),
|
||||||
|
'status': status,
|
||||||
|
'statusName': statusName,
|
||||||
|
'stopDatetime': stopDatetime?.toIso8601String(),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,300 +0,0 @@
|
|||||||
import 'dart:ui';
|
|
||||||
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
|
|
||||||
import 'package:doctor_app_flutter/screens/patients/ReferralDischargedPatientPage.dart';
|
|
||||||
import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_header.dart';
|
|
||||||
import 'package:doctor_app_flutter/screens/patients/profile/referral/refer_details/referred-patient-screen.dart';
|
|
||||||
import 'package:doctor_app_flutter/utils/tab_utils.dart';
|
|
||||||
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.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/cupertino.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:provider/provider.dart';
|
|
||||||
import 'package:intl/intl.dart';
|
|
||||||
|
|
||||||
import '../../config/config.dart';
|
|
||||||
|
|
||||||
class PharmacyIntervention extends StatefulWidget {
|
|
||||||
@override
|
|
||||||
_PharmacyIntervention createState() => _PharmacyIntervention();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _PharmacyIntervention extends State<PharmacyIntervention>
|
|
||||||
with SingleTickerProviderStateMixin {
|
|
||||||
TabController? _tabController;
|
|
||||||
int index = 0;
|
|
||||||
List<dynamic> listOfPharmacyIntervention = List.empty();
|
|
||||||
|
|
||||||
@override
|
|
||||||
void initState() {
|
|
||||||
super.initState();
|
|
||||||
_tabController = TabController(length: 3, vsync: this);
|
|
||||||
_tabController!.addListener(_handleTabSelection);
|
|
||||||
}
|
|
||||||
|
|
||||||
_handleTabSelection() {
|
|
||||||
setState(() {
|
|
||||||
index = _tabController!.index;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
void dispose() {
|
|
||||||
super.dispose();
|
|
||||||
_tabController!.dispose();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
ProjectViewModel projectsProvider = Provider.of<ProjectViewModel>(context);
|
|
||||||
|
|
||||||
return AppScaffold(
|
|
||||||
isShowAppBar: true,
|
|
||||||
appBar: PatientSearchHeader(
|
|
||||||
title: TranslationBase.of(context).pharmacyApproval,
|
|
||||||
fontSize: 18,
|
|
||||||
showSearchIcon: true,
|
|
||||||
onSearchPressed: () {
|
|
||||||
SearchDialog();
|
|
||||||
},
|
|
||||||
),
|
|
||||||
appBarTitle: TranslationBase.of(context).pharmacyApproval,
|
|
||||||
body: Column(
|
|
||||||
children: [
|
|
||||||
SizedBox(
|
|
||||||
height: 56,
|
|
||||||
child: Row(
|
|
||||||
mainAxisSize: MainAxisSize.max,
|
|
||||||
children: [
|
|
||||||
Expanded(
|
|
||||||
child: Container(
|
|
||||||
decoration: TabUtils.getBoxTabsBoxDecoration(
|
|
||||||
isActive: index == 0,
|
|
||||||
isFirst: true,
|
|
||||||
projectViewModel: projectsProvider),
|
|
||||||
child: Center(
|
|
||||||
child: TabUtils.getTabText(
|
|
||||||
title: TranslationBase.of(context).pending,
|
|
||||||
isActive: index == 0)),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Expanded(
|
|
||||||
child: Container(
|
|
||||||
decoration: TabUtils.getBoxTabsBoxDecoration(
|
|
||||||
isActive: index == 1,
|
|
||||||
isMiddle: true,
|
|
||||||
projectViewModel: projectsProvider),
|
|
||||||
child: Center(
|
|
||||||
child: TabUtils.getTabText(
|
|
||||||
title: TranslationBase.of(context).accepted,
|
|
||||||
isActive: index == 1)),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Expanded(
|
|
||||||
child: Container(
|
|
||||||
decoration: TabUtils.getBoxTabsBoxDecoration(
|
|
||||||
isActive: index == 2,
|
|
||||||
isLast: true,
|
|
||||||
projectViewModel: projectsProvider),
|
|
||||||
child: Center(
|
|
||||||
child: TabUtils.getTabText(
|
|
||||||
title: TranslationBase.of(context).rejected,
|
|
||||||
isActive: index == 2),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Expanded(
|
|
||||||
child: ListView.builder(
|
|
||||||
itemCount: listOfPharmacyIntervention.length,
|
|
||||||
itemBuilder: (context, item) => SizedBox.shrink()),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
));
|
|
||||||
}
|
|
||||||
|
|
||||||
void SearchDialog() {
|
|
||||||
showDialog(
|
|
||||||
context: context,
|
|
||||||
barrierDismissible: true, // user must tap button!
|
|
||||||
builder: (_) {
|
|
||||||
return PharmacyInterventionDialog(
|
|
||||||
onDispose: (dateFrom, dateTo, admissionNumber, patientId) {});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class PharmacyInterventionDialog extends StatefulWidget {
|
|
||||||
final Function(
|
|
||||||
String,
|
|
||||||
String,
|
|
||||||
String,
|
|
||||||
String,
|
|
||||||
) onDispose;
|
|
||||||
|
|
||||||
const PharmacyInterventionDialog({super.key, required this.onDispose});
|
|
||||||
|
|
||||||
@override
|
|
||||||
State<PharmacyInterventionDialog> createState() =>
|
|
||||||
_PharmacyInterventionDialogState();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _PharmacyInterventionDialogState
|
|
||||||
extends State<PharmacyInterventionDialog> {
|
|
||||||
final TextEditingController admissionNumber = TextEditingController();
|
|
||||||
final TextEditingController nursingStation = TextEditingController();
|
|
||||||
|
|
||||||
final TextEditingController patientId = TextEditingController();
|
|
||||||
|
|
||||||
String dateFrom = '';
|
|
||||||
|
|
||||||
String dateTo = '';
|
|
||||||
|
|
||||||
@override
|
|
||||||
void initState() {
|
|
||||||
super.initState();
|
|
||||||
initFromDate();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return Dialog(
|
|
||||||
backgroundColor: Colors.white,
|
|
||||||
shape: RoundedRectangleBorder(
|
|
||||||
borderRadius: BorderRadius.circular(8),
|
|
||||||
),
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.all(24),
|
|
||||||
child: Column(
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
children: [
|
|
||||||
_titleAndTextField(TranslationBase.of(context).nursingStation,
|
|
||||||
nursingStation, TextInputType.number),
|
|
||||||
SizedBox(
|
|
||||||
height: 4,
|
|
||||||
),
|
|
||||||
_titleAndTextField(TranslationBase.of(context).admissionNumber,
|
|
||||||
admissionNumber, TextInputType.number),
|
|
||||||
SizedBox(
|
|
||||||
height: 4,
|
|
||||||
),
|
|
||||||
_titleAndTextField(TranslationBase.of(context).patientID, patientId,
|
|
||||||
TextInputType.number),
|
|
||||||
SizedBox(
|
|
||||||
height: 4,
|
|
||||||
),
|
|
||||||
_dateSelection(TranslationBase.of(context).dateFrom, (date) {
|
|
||||||
setState(() {
|
|
||||||
dateFrom = date;
|
|
||||||
});
|
|
||||||
}, dateFrom),
|
|
||||||
SizedBox(
|
|
||||||
height: 4,
|
|
||||||
),
|
|
||||||
_dateSelection(TranslationBase.of(context).dateTo, (date) {
|
|
||||||
setState(() {
|
|
||||||
dateTo = date;
|
|
||||||
});
|
|
||||||
}, dateTo),
|
|
||||||
SizedBox(
|
|
||||||
height: 8,
|
|
||||||
),
|
|
||||||
Row(children: [
|
|
||||||
Expanded(
|
|
||||||
child: AppButton(
|
|
||||||
title: TranslationBase.of(context).search,
|
|
||||||
hasBorder: true,
|
|
||||||
borderColor: Color(0xFFB8382B),
|
|
||||||
color: AppGlobal.appRedColor,
|
|
||||||
fontColor: Colors.white,
|
|
||||||
onPressed: () async {},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
]),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
Widget _dateSelection(
|
|
||||||
String title, Function(String) onDateSelected, String selectedDate) {
|
|
||||||
return GestureDetector(
|
|
||||||
onTap: () => _selectDate(onDateSelected),
|
|
||||||
child: Row(
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
children: [
|
|
||||||
Text(title),
|
|
||||||
Expanded(
|
|
||||||
child: ListTile(
|
|
||||||
title: Text(
|
|
||||||
selectedDate,
|
|
||||||
),
|
|
||||||
trailing: Icon(Icons.arrow_drop_down_outlined),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
Future _selectDate(Function(String) updateDate) async {
|
|
||||||
final DateTime? picked = await showDatePicker(
|
|
||||||
context: context,
|
|
||||||
initialDate: DateTime.now(),
|
|
||||||
firstDate: DateTime(DateTime.now().year - 150),
|
|
||||||
lastDate: DateTime(DateTime.now().year + 150),
|
|
||||||
initialEntryMode: DatePickerEntryMode.calendar,
|
|
||||||
builder: (_, child) {
|
|
||||||
return Theme(
|
|
||||||
data: ThemeData.light().copyWith(
|
|
||||||
colorScheme: ColorScheme.fromSwatch(
|
|
||||||
primarySwatch: Colors.red,
|
|
||||||
accentColor: AppGlobal.appRedColor,
|
|
||||||
),
|
|
||||||
dialogBackgroundColor: Colors.white,
|
|
||||||
),
|
|
||||||
child: child!,
|
|
||||||
);
|
|
||||||
});
|
|
||||||
if (picked != null) {
|
|
||||||
updateDate(getFormattedDate(picked));
|
|
||||||
}
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
|
|
||||||
Widget _titleAndTextField(String title, TextEditingController controller,
|
|
||||||
TextInputType? inputType) {
|
|
||||||
return Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
children: [
|
|
||||||
Text(title),
|
|
||||||
Expanded(
|
|
||||||
child: TextFormField(
|
|
||||||
keyboardType: inputType,
|
|
||||||
decoration: InputDecoration(
|
|
||||||
hintText: '',
|
|
||||||
focusedBorder: InputBorder.none,
|
|
||||||
enabledBorder: InputBorder.none,
|
|
||||||
contentPadding: EdgeInsetsDirectional.only(start: 10.0),
|
|
||||||
),
|
|
||||||
textAlign: TextAlign.end,
|
|
||||||
controller: controller,
|
|
||||||
),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
void initFromDate() {
|
|
||||||
var time = DateTime.now();
|
|
||||||
dateFrom = getFormattedDate(time);
|
|
||||||
}
|
|
||||||
|
|
||||||
String getFormattedDate(DateTime time) {
|
|
||||||
return DateFormat('MM/dd/yyyy').format(time);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,110 @@
|
|||||||
|
import 'dart:async';
|
||||||
|
|
||||||
|
import 'package:doctor_app_flutter/config/config.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/model/pharmacy-intervention-model/intervention_history.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/model/pharmacy-intervention-model/pharmacy_intervention_item.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
|
||||||
|
|
||||||
|
class PharmacyInterventionService extends BaseService {
|
||||||
|
FutureOr<MedicationList?> getMedicationList(
|
||||||
|
{String nursingStationId = '',
|
||||||
|
String admissionId = '',
|
||||||
|
String patientID = '',
|
||||||
|
String fromDate = '',
|
||||||
|
String toDate = ''}) async {
|
||||||
|
var request = {
|
||||||
|
"nursingStationID": nursingStationId,
|
||||||
|
"admissionNo": admissionId,
|
||||||
|
"patientID": patientID,
|
||||||
|
"fromDate": fromDate,
|
||||||
|
"toDate": toDate,
|
||||||
|
};
|
||||||
|
hasError = false;
|
||||||
|
await baseAppClient.post(GET_MEDICINE_WITH_INTERVAL,
|
||||||
|
onSuccess: (dynamic response, int statusCode) {
|
||||||
|
return MedicationList.fromJson(response['List_MedicineWithIntervention']);
|
||||||
|
}, onFailure: (String error, int statusCode) {
|
||||||
|
hasError = true;
|
||||||
|
super.error = super.error! + "\n" + error;
|
||||||
|
return null;
|
||||||
|
}, body: request);
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
FutureOr<bool> getInfectiousDiseaseConsultantStatus() async {
|
||||||
|
hasError = false;
|
||||||
|
await baseAppClient.post(IS_INFECTIOUS_DISEASE,
|
||||||
|
onSuccess: (dynamic response, int statusCode) {
|
||||||
|
return response['IsInfectiousDiseases'];
|
||||||
|
}, onFailure: (String error, int statusCode) {
|
||||||
|
hasError = true;
|
||||||
|
super.error = super.error! + "\n" + error;
|
||||||
|
return false;
|
||||||
|
}, body: {});
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
FutureOr<InterventionHistoryList?> getInfectiousDiseaseHistory({
|
||||||
|
String admissionNumber = '',
|
||||||
|
String prescriptionNumber = '',
|
||||||
|
String orderNumber = '',
|
||||||
|
String itemID = '',
|
||||||
|
}) async {
|
||||||
|
var request = {
|
||||||
|
"AdmissionNo": admissionNumber,
|
||||||
|
"PrescriptionNo": prescriptionNumber,
|
||||||
|
"OrderNo": orderNumber,
|
||||||
|
"ItemID": itemID,
|
||||||
|
};
|
||||||
|
|
||||||
|
hasError = false;
|
||||||
|
await baseAppClient.post(INFECTIOUS_HISTORY,
|
||||||
|
onSuccess: (dynamic response, int statusCode) {
|
||||||
|
return InterventionHistoryList.fromJson(
|
||||||
|
response['List_MedicineInterventionHistory']);
|
||||||
|
}, onFailure: (String error, int statusCode) {
|
||||||
|
hasError = true;
|
||||||
|
super.error = super.error! + "\n" + error;
|
||||||
|
return null;
|
||||||
|
}, body: request);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
FutureOr<bool> updateInterventionStatus({
|
||||||
|
String admissionNo = '',
|
||||||
|
String prescriptionNo = '',
|
||||||
|
String orderNo = '',
|
||||||
|
String itemID = '',
|
||||||
|
String interventionID = '',
|
||||||
|
String isAccepted = '',
|
||||||
|
String remarks = '',
|
||||||
|
String authorizeID = '',
|
||||||
|
String lineItemNo = '',
|
||||||
|
String status = '',
|
||||||
|
}) async {
|
||||||
|
var request = {
|
||||||
|
"AdmissionNo": admissionNo,
|
||||||
|
"PrescriptionNo": prescriptionNo,
|
||||||
|
"OrderNo": orderNo,
|
||||||
|
"ItemID": itemID,
|
||||||
|
"InterventionID": interventionID,
|
||||||
|
"IsAccepted": isAccepted,
|
||||||
|
"Remarks": remarks,
|
||||||
|
"AuthorizeID": authorizeID,
|
||||||
|
"LineItemNo": lineItemNo,
|
||||||
|
"Status": status,
|
||||||
|
};
|
||||||
|
|
||||||
|
hasError = false;
|
||||||
|
await baseAppClient.post(INFECTIOUS_HISTORY,
|
||||||
|
onSuccess: (dynamic response, int statusCode) {
|
||||||
|
return response['IsAccepted'];
|
||||||
|
}, onFailure: (String error, int statusCode) {
|
||||||
|
hasError = true;
|
||||||
|
super.error = super.error! + "\n" + error;
|
||||||
|
return false;
|
||||||
|
}, body: request);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,608 @@
|
|||||||
|
import 'package:doctor_app_flutter/core/enum/view_state.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/model/pharmacy-intervention-model/intervention_history.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/model/pharmacy-intervention-model/pharmacy_intervention_item.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
|
||||||
|
import 'package:doctor_app_flutter/locator.dart';
|
||||||
|
import 'package:doctor_app_flutter/screens/pharmacy_intervention/viewmodel/pharmacy_intervention_service.dart';
|
||||||
|
import 'package:intl/intl.dart';
|
||||||
|
|
||||||
|
class PharmacyInterventionViewModel extends BaseViewModel {
|
||||||
|
PharmacyInterventionService _service = locator<PharmacyInterventionService>();
|
||||||
|
MedicationList? medicationList;
|
||||||
|
// MedicationList? medicationList = MedicationList.fromJson({
|
||||||
|
// "entityList": [
|
||||||
|
// {
|
||||||
|
// "accessLevel": 4,
|
||||||
|
// "admissionNo": 2020000098,
|
||||||
|
// "authorizedby": null,
|
||||||
|
// "authorizedbyName": null,
|
||||||
|
// "createdBy": "1485",
|
||||||
|
// "doctorComments": "asdf",
|
||||||
|
// "doctorName": null,
|
||||||
|
// "dosageDetail": "0/VIALS/BID/Parenteral",
|
||||||
|
// "itemID": 107476,
|
||||||
|
// "lineItemNo": 1,
|
||||||
|
// "medication": "TARGOPLANIN 200 MG INJ VIAL 1'S",
|
||||||
|
// "nursingStation": "New Pediatric Building 1st Floor ",
|
||||||
|
// "orderNo": 1448172,
|
||||||
|
// "patientID": 3120412,
|
||||||
|
// "patientName": "HABAB AABER CHINAN",
|
||||||
|
// "pharmacyRemarks": null,
|
||||||
|
// "prescriptionNo": 2686564,
|
||||||
|
// "startDatetime": "2024-12-24T10:33:18",
|
||||||
|
// "status": 62,
|
||||||
|
// "statusName": "RejectWithIntervention",
|
||||||
|
// "stopDatetime": "2024-12-24T20:00:00"
|
||||||
|
// },{
|
||||||
|
// "accessLevel": 4,
|
||||||
|
// "patientID": 3648880,
|
||||||
|
// "patientName": "JEHAD BADEI ALI",
|
||||||
|
// "nursingStation": "New Pediatric Building 3rd Floor ",
|
||||||
|
// "admissionNo": 2022000100,
|
||||||
|
// "orderNo": 1447979,
|
||||||
|
// "prescriptionNo": 2686333,
|
||||||
|
// "lineItemNo": 3,
|
||||||
|
// "itemID": 67507,
|
||||||
|
// "medication": "DIPEPTIVEN 20% CONCENTRATED -100ML",
|
||||||
|
// "dosageDetail": "1 MG/BOTTLE/As Directed/Oral",
|
||||||
|
// "doctorComments": "Test PHR: (Pharmacy Intervention Accepted)Test",
|
||||||
|
// "startDatetime": "2024-05-08T12:56:00",
|
||||||
|
// "stopDatetime": "2024-05-08T12:57:00",
|
||||||
|
// "status": 52,
|
||||||
|
// "statusName": "Discontinue",
|
||||||
|
// "createdBy": "2804",
|
||||||
|
// "authorizedby": null,
|
||||||
|
// "doctorName": null,
|
||||||
|
// "authorizedbyName": null,
|
||||||
|
// "pharmacyRemarks": null
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// "accessLevel": 4,
|
||||||
|
// "patientID": 3648880,
|
||||||
|
// "patientName": "JEHAD BADEI ALI",
|
||||||
|
// "nursingStation": "New Pediatric Building 3rd Floor ",
|
||||||
|
// "admissionNo": 2022000100,
|
||||||
|
// "orderNo": 1447979,
|
||||||
|
// "prescriptionNo": 2686333,
|
||||||
|
// "lineItemNo": 3,
|
||||||
|
// "itemID": 67507,
|
||||||
|
// "medication": "DIPEPTIVEN 20% CONCENTRATED -100ML",
|
||||||
|
// "dosageDetail": "1 MG/BOTTLE/As Directed/Oral",
|
||||||
|
// "doctorComments": "Test PHR: (Pharmacy Intervention Accepted)Test",
|
||||||
|
// "startDatetime": "2024-05-08T12:56:00",
|
||||||
|
// "stopDatetime": "2024-05-08T12:57:00",
|
||||||
|
// "status": 52,
|
||||||
|
// "statusName": "Discontinue",
|
||||||
|
// "createdBy": "2804",
|
||||||
|
// "authorizedby": null,
|
||||||
|
// "doctorName": null,
|
||||||
|
// "authorizedbyName": null,
|
||||||
|
// "pharmacyRemarks": null
|
||||||
|
// }
|
||||||
|
// ],
|
||||||
|
// "rowcount": 1,
|
||||||
|
// "statusMessage": null,
|
||||||
|
// "success": null
|
||||||
|
// });
|
||||||
|
|
||||||
|
InterventionHistoryList? interventionHistoryList;
|
||||||
|
// InterventionHistoryList? interventionHistoryList = InterventionHistoryList.fromJson({
|
||||||
|
// "entityList": [
|
||||||
|
// {
|
||||||
|
// "authizationFormText": "Intervention Approval Level 3",
|
||||||
|
// "authorizedAction": 51,
|
||||||
|
// "commentedBy": 1005,
|
||||||
|
// "commentedByName": "TEMP - PHARMACIST ",
|
||||||
|
// "interventionDesc": "Drug information :administration related",
|
||||||
|
// "interventionId": 29,
|
||||||
|
// "remark": "asdfasdf"
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// "authizationFormText": "Intervention Approval Level 3",
|
||||||
|
// "authorizedAction": 51,
|
||||||
|
// "commentedBy": 0,
|
||||||
|
// "commentedByName": "lorem ipsum1 ",
|
||||||
|
// "interventionDesc": "",
|
||||||
|
// "interventionId": 1485,
|
||||||
|
// "remark": "loremIpsum"
|
||||||
|
// }, {
|
||||||
|
// "authizationFormText": "Intervention Approval Level 3",
|
||||||
|
// "authorizedAction": 51,
|
||||||
|
// "commentedBy": 1005,
|
||||||
|
// "commentedByName": "TEMP - PHARMACIST ",
|
||||||
|
// "interventionDesc": "Drug information :administration related",
|
||||||
|
// "interventionId": 29,
|
||||||
|
// "remark": "asdfasdf"
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// "authizationFormText": "Intervention Approval Level 3",
|
||||||
|
// "authorizedAction": 51,
|
||||||
|
// "commentedBy": 0,
|
||||||
|
// "commentedByName": "lorem ipsum1 ",
|
||||||
|
// "interventionDesc": "",
|
||||||
|
// "interventionId": 1485,
|
||||||
|
// "remark": "loremIpsum"
|
||||||
|
// }, {
|
||||||
|
// "authizationFormText": "Intervention Approval Level 3",
|
||||||
|
// "authorizedAction": 51,
|
||||||
|
// "commentedBy": 1005,
|
||||||
|
// "commentedByName": "TEMP - PHARMACIST ",
|
||||||
|
// "interventionDesc": "Drug information :administration related",
|
||||||
|
// "interventionId": 29,
|
||||||
|
// "remark": "asdfasdf"
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// "authizationFormText": "Intervention Approval Level 3",
|
||||||
|
// "authorizedAction": 51,
|
||||||
|
// "commentedBy": 0,
|
||||||
|
// "commentedByName": "lorem ipsum1 ",
|
||||||
|
// "interventionDesc": "",
|
||||||
|
// "interventionId": 1485,
|
||||||
|
// "remark": "loremIpsum"
|
||||||
|
// }, {
|
||||||
|
// "authizationFormText": "Intervention Approval Level 3",
|
||||||
|
// "authorizedAction": 51,
|
||||||
|
// "commentedBy": 1005,
|
||||||
|
// "commentedByName": "TEMP - PHARMACIST ",
|
||||||
|
// "interventionDesc": "Drug information :administration related",
|
||||||
|
// "interventionId": 29,
|
||||||
|
// "remark": "asdfasdf"
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// "authizationFormText": "Intervention Approval Level 3",
|
||||||
|
// "authorizedAction": 51,
|
||||||
|
// "commentedBy": 0,
|
||||||
|
// "commentedByName": "lorem ipsum1 ",
|
||||||
|
// "interventionDesc": "",
|
||||||
|
// "interventionId": 1485,
|
||||||
|
// "remark": "loremIpsum"
|
||||||
|
// }, {
|
||||||
|
// "authizationFormText": "Intervention Approval Level 3",
|
||||||
|
// "authorizedAction": 51,
|
||||||
|
// "commentedBy": 1005,
|
||||||
|
// "commentedByName": "TEMP - PHARMACIST ",
|
||||||
|
// "interventionDesc": "Drug information :administration related",
|
||||||
|
// "interventionId": 29,
|
||||||
|
// "remark": "asdfasdf"
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// "authizationFormText": "Intervention Approval Level 3",
|
||||||
|
// "authorizedAction": 51,
|
||||||
|
// "commentedBy": 0,
|
||||||
|
// "commentedByName": "lorem ipsum1 ",
|
||||||
|
// "interventionDesc": "",
|
||||||
|
// "interventionId": 1485,
|
||||||
|
// "remark": "loremIpsum"
|
||||||
|
// }, {
|
||||||
|
// "authizationFormText": "Intervention Approval Level 3",
|
||||||
|
// "authorizedAction": 51,
|
||||||
|
// "commentedBy": 1005,
|
||||||
|
// "commentedByName": "TEMP - PHARMACIST ",
|
||||||
|
// "interventionDesc": "Drug information :administration related",
|
||||||
|
// "interventionId": 29,
|
||||||
|
// "remark": "asdfasdf"
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// "authizationFormText": "Intervention Approval Level 3",
|
||||||
|
// "authorizedAction": 51,
|
||||||
|
// "commentedBy": 0,
|
||||||
|
// "commentedByName": "lorem ipsum1 ",
|
||||||
|
// "interventionDesc": "",
|
||||||
|
// "interventionId": 1485,
|
||||||
|
// "remark": "loremIpsum"
|
||||||
|
// }, {
|
||||||
|
// "authizationFormText": "Intervention Approval Level 3",
|
||||||
|
// "authorizedAction": 51,
|
||||||
|
// "commentedBy": 1005,
|
||||||
|
// "commentedByName": "TEMP - PHARMACIST ",
|
||||||
|
// "interventionDesc": "Drug information :administration related",
|
||||||
|
// "interventionId": 29,
|
||||||
|
// "remark": "asdfasdf"
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// "authizationFormText": "Intervention Approval Level 3",
|
||||||
|
// "authorizedAction": 51,
|
||||||
|
// "commentedBy": 0,
|
||||||
|
// "commentedByName": "lorem ipsum1 ",
|
||||||
|
// "interventionDesc": "",
|
||||||
|
// "interventionId": 1485,
|
||||||
|
// "remark": "loremIpsum"
|
||||||
|
// }, {
|
||||||
|
// "authizationFormText": "Intervention Approval Level 3",
|
||||||
|
// "authorizedAction": 51,
|
||||||
|
// "commentedBy": 1005,
|
||||||
|
// "commentedByName": "TEMP - PHARMACIST ",
|
||||||
|
// "interventionDesc": "Drug information :administration related",
|
||||||
|
// "interventionId": 29,
|
||||||
|
// "remark": "asdfasdf"
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// "authizationFormText": "Intervention Approval Level 3",
|
||||||
|
// "authorizedAction": 51,
|
||||||
|
// "commentedBy": 0,
|
||||||
|
// "commentedByName": "lorem ipsum1 ",
|
||||||
|
// "interventionDesc": "",
|
||||||
|
// "interventionId": 1485,
|
||||||
|
// "remark": "loremIpsum"
|
||||||
|
// }, {
|
||||||
|
// "authizationFormText": "Intervention Approval Level 3",
|
||||||
|
// "authorizedAction": 51,
|
||||||
|
// "commentedBy": 1005,
|
||||||
|
// "commentedByName": "TEMP - PHARMACIST ",
|
||||||
|
// "interventionDesc": "Drug information :administration related",
|
||||||
|
// "interventionId": 29,
|
||||||
|
// "remark": "asdfasdf"
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// "authizationFormText": "Intervention Approval Level 3",
|
||||||
|
// "authorizedAction": 51,
|
||||||
|
// "commentedBy": 0,
|
||||||
|
// "commentedByName": "lorem ipsum1 ",
|
||||||
|
// "interventionDesc": "",
|
||||||
|
// "interventionId": 1485,
|
||||||
|
// "remark": "loremIpsum"
|
||||||
|
// }, {
|
||||||
|
// "authizationFormText": "Intervention Approval Level 3",
|
||||||
|
// "authorizedAction": 51,
|
||||||
|
// "commentedBy": 1005,
|
||||||
|
// "commentedByName": "TEMP - PHARMACIST ",
|
||||||
|
// "interventionDesc": "Drug information :administration related",
|
||||||
|
// "interventionId": 29,
|
||||||
|
// "remark": "asdfasdf"
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// "authizationFormText": "Intervention Approval Level 3",
|
||||||
|
// "authorizedAction": 51,
|
||||||
|
// "commentedBy": 0,
|
||||||
|
// "commentedByName": "lorem ipsum1 ",
|
||||||
|
// "interventionDesc": "",
|
||||||
|
// "interventionId": 1485,
|
||||||
|
// "remark": "loremIpsum"
|
||||||
|
// }, {
|
||||||
|
// "authizationFormText": "Intervention Approval Level 3",
|
||||||
|
// "authorizedAction": 51,
|
||||||
|
// "commentedBy": 1005,
|
||||||
|
// "commentedByName": "TEMP - PHARMACIST ",
|
||||||
|
// "interventionDesc": "Drug information :administration related",
|
||||||
|
// "interventionId": 29,
|
||||||
|
// "remark": "asdfasdf"
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// "authizationFormText": "Intervention Approval Level 3",
|
||||||
|
// "authorizedAction": 51,
|
||||||
|
// "commentedBy": 0,
|
||||||
|
// "commentedByName": "lorem ipsum1 ",
|
||||||
|
// "interventionDesc": "",
|
||||||
|
// "interventionId": 1485,
|
||||||
|
// "remark": "loremIpsum"
|
||||||
|
// }, {
|
||||||
|
// "authizationFormText": "Intervention Approval Level 3",
|
||||||
|
// "authorizedAction": 51,
|
||||||
|
// "commentedBy": 1005,
|
||||||
|
// "commentedByName": "TEMP - PHARMACIST ",
|
||||||
|
// "interventionDesc": "Drug information :administration related",
|
||||||
|
// "interventionId": 29,
|
||||||
|
// "remark": "asdfasdf"
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// "authizationFormText": "Intervention Approval Level 3",
|
||||||
|
// "authorizedAction": 51,
|
||||||
|
// "commentedBy": 0,
|
||||||
|
// "commentedByName": "lorem ipsum1 ",
|
||||||
|
// "interventionDesc": "",
|
||||||
|
// "interventionId": 1485,
|
||||||
|
// "remark": "loremIpsum"
|
||||||
|
// }, {
|
||||||
|
// "authizationFormText": "Intervention Approval Level 3",
|
||||||
|
// "authorizedAction": 51,
|
||||||
|
// "commentedBy": 1005,
|
||||||
|
// "commentedByName": "TEMP - PHARMACIST ",
|
||||||
|
// "interventionDesc": "Drug information :administration related",
|
||||||
|
// "interventionId": 29,
|
||||||
|
// "remark": "asdfasdf"
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// "authizationFormText": "Intervention Approval Level 3",
|
||||||
|
// "authorizedAction": 51,
|
||||||
|
// "commentedBy": 0,
|
||||||
|
// "commentedByName": "lorem ipsum1 ",
|
||||||
|
// "interventionDesc": "",
|
||||||
|
// "interventionId": 1485,
|
||||||
|
// "remark": "loremIpsum"
|
||||||
|
// }, {
|
||||||
|
// "authizationFormText": "Intervention Approval Level 3",
|
||||||
|
// "authorizedAction": 51,
|
||||||
|
// "commentedBy": 1005,
|
||||||
|
// "commentedByName": "TEMP - PHARMACIST ",
|
||||||
|
// "interventionDesc": "Drug information :administration related",
|
||||||
|
// "interventionId": 29,
|
||||||
|
// "remark": "asdfasdf"
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// "authizationFormText": "Intervention Approval Level 3",
|
||||||
|
// "authorizedAction": 51,
|
||||||
|
// "commentedBy": 0,
|
||||||
|
// "commentedByName": "lorem ipsum1 ",
|
||||||
|
// "interventionDesc": "",
|
||||||
|
// "interventionId": 1485,
|
||||||
|
// "remark": "loremIpsum"
|
||||||
|
// }, {
|
||||||
|
// "authizationFormText": "Intervention Approval Level 3",
|
||||||
|
// "authorizedAction": 51,
|
||||||
|
// "commentedBy": 1005,
|
||||||
|
// "commentedByName": "TEMP - PHARMACIST ",
|
||||||
|
// "interventionDesc": "Drug information :administration related",
|
||||||
|
// "interventionId": 29,
|
||||||
|
// "remark": "asdfasdf"
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// "authizationFormText": "Intervention Approval Level 3",
|
||||||
|
// "authorizedAction": 51,
|
||||||
|
// "commentedBy": 0,
|
||||||
|
// "commentedByName": "lorem ipsum1 ",
|
||||||
|
// "interventionDesc": "",
|
||||||
|
// "interventionId": 1485,
|
||||||
|
// "remark": "loremIpsum"
|
||||||
|
// }, {
|
||||||
|
// "authizationFormText": "Intervention Approval Level 3",
|
||||||
|
// "authorizedAction": 51,
|
||||||
|
// "commentedBy": 1005,
|
||||||
|
// "commentedByName": "TEMP - PHARMACIST ",
|
||||||
|
// "interventionDesc": "Drug information :administration related",
|
||||||
|
// "interventionId": 29,
|
||||||
|
// "remark": "asdfasdf"
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// "authizationFormText": "Intervention Approval Level 3",
|
||||||
|
// "authorizedAction": 51,
|
||||||
|
// "commentedBy": 0,
|
||||||
|
// "commentedByName": "lorem ipsum1 ",
|
||||||
|
// "interventionDesc": "",
|
||||||
|
// "interventionId": 1485,
|
||||||
|
// "remark": "loremIpsum"
|
||||||
|
// }, {
|
||||||
|
// "authizationFormText": "Intervention Approval Level 3",
|
||||||
|
// "authorizedAction": 51,
|
||||||
|
// "commentedBy": 1005,
|
||||||
|
// "commentedByName": "TEMP - PHARMACIST ",
|
||||||
|
// "interventionDesc": "Drug information :administration related",
|
||||||
|
// "interventionId": 29,
|
||||||
|
// "remark": "asdfasdf"
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// "authizationFormText": "Intervention Approval Level 3",
|
||||||
|
// "authorizedAction": 51,
|
||||||
|
// "commentedBy": 0,
|
||||||
|
// "commentedByName": "lorem ipsum1 ",
|
||||||
|
// "interventionDesc": "",
|
||||||
|
// "interventionId": 1485,
|
||||||
|
// "remark": "loremIpsum"
|
||||||
|
// }, {
|
||||||
|
// "authizationFormText": "Intervention Approval Level 3",
|
||||||
|
// "authorizedAction": 51,
|
||||||
|
// "commentedBy": 1005,
|
||||||
|
// "commentedByName": "TEMP - PHARMACIST ",
|
||||||
|
// "interventionDesc": "Drug information :administration related",
|
||||||
|
// "interventionId": 29,
|
||||||
|
// "remark": "asdfasdf"
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// "authizationFormText": "Intervention Approval Level 3",
|
||||||
|
// "authorizedAction": 51,
|
||||||
|
// "commentedBy": 0,
|
||||||
|
// "commentedByName": "lorem ipsum1 ",
|
||||||
|
// "interventionDesc": "",
|
||||||
|
// "interventionId": 1485,
|
||||||
|
// "remark": "loremIpsum"
|
||||||
|
// }, {
|
||||||
|
// "authizationFormText": "Intervention Approval Level 3",
|
||||||
|
// "authorizedAction": 51,
|
||||||
|
// "commentedBy": 1005,
|
||||||
|
// "commentedByName": "TEMP - PHARMACIST ",
|
||||||
|
// "interventionDesc": "Drug information :administration related",
|
||||||
|
// "interventionId": 29,
|
||||||
|
// "remark": "asdfasdf"
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// "authizationFormText": "Intervention Approval Level 3",
|
||||||
|
// "authorizedAction": 51,
|
||||||
|
// "commentedBy": 0,
|
||||||
|
// "commentedByName": "lorem ipsum1 ",
|
||||||
|
// "interventionDesc": "",
|
||||||
|
// "interventionId": 1485,
|
||||||
|
// "remark": "loremIpsum"
|
||||||
|
// }, {
|
||||||
|
// "authizationFormText": "Intervention Approval Level 3",
|
||||||
|
// "authorizedAction": 51,
|
||||||
|
// "commentedBy": 1005,
|
||||||
|
// "commentedByName": "TEMP - PHARMACIST ",
|
||||||
|
// "interventionDesc": "Drug information :administration related",
|
||||||
|
// "interventionId": 29,
|
||||||
|
// "remark": "asdfasdf"
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// "authizationFormText": "Intervention Approval Level 3",
|
||||||
|
// "authorizedAction": 51,
|
||||||
|
// "commentedBy": 0,
|
||||||
|
// "commentedByName": "lorem ipsum1 ",
|
||||||
|
// "interventionDesc": "",
|
||||||
|
// "interventionId": 1485,
|
||||||
|
// "remark": "loremIpsum"
|
||||||
|
// }, {
|
||||||
|
// "authizationFormText": "Intervention Approval Level 3",
|
||||||
|
// "authorizedAction": 51,
|
||||||
|
// "commentedBy": 1005,
|
||||||
|
// "commentedByName": "TEMP - PHARMACIST ",
|
||||||
|
// "interventionDesc": "Drug information :administration related",
|
||||||
|
// "interventionId": 29,
|
||||||
|
// "remark": "asdfasdf"
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// "authizationFormText": "Intervention Approval Level 3",
|
||||||
|
// "authorizedAction": 51,
|
||||||
|
// "commentedBy": 0,
|
||||||
|
// "commentedByName": "lorem ipsum1 ",
|
||||||
|
// "interventionDesc": "",
|
||||||
|
// "interventionId": 1485,
|
||||||
|
// "remark": "loremIpsum"
|
||||||
|
// }, {
|
||||||
|
// "authizationFormText": "Intervention Approval Level 3",
|
||||||
|
// "authorizedAction": 51,
|
||||||
|
// "commentedBy": 1005,
|
||||||
|
// "commentedByName": "TEMP - PHARMACIST ",
|
||||||
|
// "interventionDesc": "Drug information :administration related",
|
||||||
|
// "interventionId": 29,
|
||||||
|
// "remark": "asdfasdf"
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// "authizationFormText": "Intervention Approval Level 3",
|
||||||
|
// "authorizedAction": 51,
|
||||||
|
// "commentedBy": 0,
|
||||||
|
// "commentedByName": "lorem ipsum1 ",
|
||||||
|
// "interventionDesc": "",
|
||||||
|
// "interventionId": 1485,
|
||||||
|
// "remark": "loremIpsum"
|
||||||
|
// }, {
|
||||||
|
// "authizationFormText": "Intervention Approval Level 3",
|
||||||
|
// "authorizedAction": 51,
|
||||||
|
// "commentedBy": 1005,
|
||||||
|
// "commentedByName": "TEMP - PHARMACIST ",
|
||||||
|
// "interventionDesc": "Drug information :administration related",
|
||||||
|
// "interventionId": 29,
|
||||||
|
// "remark": "asdfasdf"
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// "authizationFormText": "Intervention Approval Level 3",
|
||||||
|
// "authorizedAction": 51,
|
||||||
|
// "commentedBy": 0,
|
||||||
|
// "commentedByName": "lorem ipsum1 ",
|
||||||
|
// "interventionDesc": "",
|
||||||
|
// "interventionId": 1485,
|
||||||
|
// "remark": "loremIpsum"
|
||||||
|
// },
|
||||||
|
// ],
|
||||||
|
// "rowcount": 2,
|
||||||
|
// "statusMessage": null,
|
||||||
|
// "success": null
|
||||||
|
// });
|
||||||
|
|
||||||
|
bool isInfectiousDiseaseConsultant = false;
|
||||||
|
|
||||||
|
String nursingStationId = '';
|
||||||
|
String admissionId = '';
|
||||||
|
String patientID = '';
|
||||||
|
String fromDate = '';
|
||||||
|
String toDate = '';
|
||||||
|
|
||||||
|
String getDate(String dateTime) {
|
||||||
|
if (dateTime.isEmpty) return '';
|
||||||
|
DateTime now = DateTime.now();
|
||||||
|
return DateFormat('dd MMM yyyy').format(now);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future getPharmacyIntervention(
|
||||||
|
{String nursingStationId = '',
|
||||||
|
String admissionId = '',
|
||||||
|
String patientID = '',
|
||||||
|
String fromDate = '',
|
||||||
|
String toDate = ''}) async {
|
||||||
|
setState(ViewState.BusyLocal);
|
||||||
|
MedicationList? result = await _service.getMedicationList(
|
||||||
|
nursingStationId: nursingStationId,
|
||||||
|
admissionId: admissionId,
|
||||||
|
patientID: patientID,
|
||||||
|
fromDate: fromDate,
|
||||||
|
toDate: toDate);
|
||||||
|
|
||||||
|
this.nursingStationId = nursingStationId;
|
||||||
|
this.admissionId = admissionId;
|
||||||
|
this.patientID = patientID;
|
||||||
|
this.fromDate = fromDate;
|
||||||
|
this.toDate = toDate;
|
||||||
|
|
||||||
|
if (_service.hasError || result == null) {
|
||||||
|
error = _service.error;
|
||||||
|
setState(ViewState.ErrorLocal);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
medicationList = result;
|
||||||
|
setState(ViewState.Idle);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future getInfectiousDiseaseConsultantStatus() async {
|
||||||
|
setState(ViewState.BusyLocal);
|
||||||
|
bool result = await _service.getInfectiousDiseaseConsultantStatus();
|
||||||
|
if (_service.hasError) {
|
||||||
|
error = _service.error;
|
||||||
|
setState(ViewState.ErrorLocal);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
isInfectiousDiseaseConsultant = result;
|
||||||
|
setState(ViewState.Idle);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future updateInterventionDiseaseStatus({
|
||||||
|
String admissionNo = '',
|
||||||
|
String prescriptionNo = '',
|
||||||
|
String orderNo = '',
|
||||||
|
String itemID = '',
|
||||||
|
String interventionID = '',
|
||||||
|
String isAccepted = '',
|
||||||
|
String remarks = '',
|
||||||
|
String authorizeID = '',
|
||||||
|
String lineItemNo = '',
|
||||||
|
String status = '',
|
||||||
|
}) async {
|
||||||
|
setState(ViewState.BusyLocal);
|
||||||
|
bool result = await _service.getInfectiousDiseaseConsultantStatus();
|
||||||
|
if (_service.hasError) {
|
||||||
|
error = _service.error;
|
||||||
|
setState(ViewState.ErrorLocal);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
isInfectiousDiseaseConsultant = result;
|
||||||
|
setState(ViewState.Idle);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future getInterventionHistory({
|
||||||
|
String admissionNo = '',
|
||||||
|
String prescriptionNo = '',
|
||||||
|
String orderNo = '',
|
||||||
|
String itemID = '',
|
||||||
|
String interventionID = '',
|
||||||
|
String isAccepted = '',
|
||||||
|
String remarks = '',
|
||||||
|
String authorizeID = '',
|
||||||
|
String lineItemNo = '',
|
||||||
|
String status = '',
|
||||||
|
}) async {
|
||||||
|
setState(ViewState.BusyLocal);
|
||||||
|
bool? result = await _service.updateInterventionStatus(
|
||||||
|
admissionNo: admissionNo,
|
||||||
|
prescriptionNo: prescriptionNo,
|
||||||
|
orderNo: orderNo,
|
||||||
|
itemID: itemID,
|
||||||
|
interventionID: interventionID,
|
||||||
|
isAccepted: isAccepted,
|
||||||
|
remarks: remarks,
|
||||||
|
authorizeID: authorizeID,
|
||||||
|
lineItemNo: lineItemNo,
|
||||||
|
status: status);
|
||||||
|
if (_service.hasError || !result) {
|
||||||
|
error = _service.error;
|
||||||
|
setState(ViewState.ErrorLocal);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
await getPharmacyIntervention(
|
||||||
|
nursingStationId: nursingStationId,
|
||||||
|
admissionId: admissionNo,
|
||||||
|
patientID: patientID,
|
||||||
|
fromDate: fromDate,
|
||||||
|
toDate: toDate);
|
||||||
|
setState(ViewState.Idle);
|
||||||
|
}
|
||||||
|
|
||||||
|
toggleShowBottomSheetValue() {
|
||||||
|
interventionHistoryList = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue