|
|
|
|
@ -3,6 +3,7 @@ import 'package:doctor_app_flutter/core/model/Prescription_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/model/calculate_box_request_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/model/get_medication_response_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/model/item_by_medicine_request_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/model/medical_file_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/model/prescription_req_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/model/post_prescrition_req_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/model/search_drug_model.dart';
|
|
|
|
|
@ -15,6 +16,7 @@ import 'package:doctor_app_flutter/models/SOAP/GetAssessmentResModel.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-data.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/util/date-utils.dart';
|
|
|
|
|
|
|
|
|
|
class PrescriptionService extends LookupService {
|
|
|
|
|
List<PrescriptionModel> _prescriptionList = List();
|
|
|
|
|
@ -25,6 +27,7 @@ class PrescriptionService extends LookupService {
|
|
|
|
|
List<GetMedicationResponseModel> allMedicationList = [];
|
|
|
|
|
List<dynamic> specialityList = [];
|
|
|
|
|
List<dynamic> drugToDrug = [];
|
|
|
|
|
List<dynamic> get drugToDrugList => drugToDrug;
|
|
|
|
|
List<dynamic> itemMedicineList = [];
|
|
|
|
|
List<dynamic> itemMedicineListRoute = [];
|
|
|
|
|
List<dynamic> itemMedicineListUnit = [];
|
|
|
|
|
@ -158,70 +161,71 @@ class PrescriptionService extends LookupService {
|
|
|
|
|
|
|
|
|
|
Future getDrugToDrug(
|
|
|
|
|
VitalSignData vital,
|
|
|
|
|
List<MasterKeyModel> diagnosis,
|
|
|
|
|
List<GetAssessmentResModel> lstAssessments,
|
|
|
|
|
List<GetAllergiesResModel> allergy,
|
|
|
|
|
PatiantInformtion patient,
|
|
|
|
|
List<PrescriptionModel> prescription) async {
|
|
|
|
|
List<dynamic> prescription) async {
|
|
|
|
|
// Map<String, dynamic> request = {
|
|
|
|
|
// "Prescription": {
|
|
|
|
|
// "objPatientInfo": {"Gender": "Male", "Age": "21/06/1967"},
|
|
|
|
|
// "objVitalSign": {"Height": "180", "Weight": "37"},
|
|
|
|
|
// "objPrescriptionItems": [
|
|
|
|
|
// {
|
|
|
|
|
// "DrugId": "83-20-00-30-20-03-03",
|
|
|
|
|
// "DrugName": "WARFARIN 1 MG TAB 28'S (N)",
|
|
|
|
|
// "Dose": "1",
|
|
|
|
|
// "DoseType": "04",
|
|
|
|
|
// "Unit": "actuation(s)",
|
|
|
|
|
// "FrequencyType": "1/3/Day",
|
|
|
|
|
// "Duration": "3/Day",
|
|
|
|
|
// "IsScreen": "true"
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// "DrugId": "64-20-00-10-00-03-15",
|
|
|
|
|
// "DrugName": "PANADOL 500 MG TAB 24'S(DIS)",
|
|
|
|
|
// "Dose": "1",
|
|
|
|
|
// "DoseType": "04",
|
|
|
|
|
// "Unit": "MG",
|
|
|
|
|
// "FrequencyType": "3/1/Day",
|
|
|
|
|
// "Duration": "4/Day",
|
|
|
|
|
// "RouteID": "24",
|
|
|
|
|
// "IsScreen": "true"
|
|
|
|
|
// }
|
|
|
|
|
// ],
|
|
|
|
|
// "objAllergies": {
|
|
|
|
|
// "Allergy": {
|
|
|
|
|
// "objProperties": {"Id": "26", "Name": "phenoxymethylpenicillin"}
|
|
|
|
|
// }
|
|
|
|
|
// },
|
|
|
|
|
// "objDiagnosis": {
|
|
|
|
|
// "Diagnosis": {
|
|
|
|
|
// "objProperties": {"Id": "A01.1", "Name": "Paratyphoid fever A"}
|
|
|
|
|
// }
|
|
|
|
|
// },
|
|
|
|
|
// "IsDoctor": "false",
|
|
|
|
|
// "IsPharmacist": "false"
|
|
|
|
|
// },
|
|
|
|
|
// "IPAdress": "10.10.10.10",
|
|
|
|
|
// "Channel": 9,
|
|
|
|
|
// "LanguageID": 2,
|
|
|
|
|
// "VersionID": 5.3,
|
|
|
|
|
// "SessionID": "BlUSkYymTt",
|
|
|
|
|
// "IsLoginForDoctorApp": true,
|
|
|
|
|
// "PatientOutSA": 0,
|
|
|
|
|
// "TokenID": "@dm!n",
|
|
|
|
|
// "OutSA": true
|
|
|
|
|
// };
|
|
|
|
|
Map<String, dynamic> request = {
|
|
|
|
|
"Prescription": {
|
|
|
|
|
"objPatientInfo": {"Gender": "Male", "Age": "21/06/1967"},
|
|
|
|
|
"objVitalSign": {"Height": "180", "Weight": "37"},
|
|
|
|
|
"objPrescriptionItems": [
|
|
|
|
|
{
|
|
|
|
|
"DrugId": "83-20-00-30-20-03-03",
|
|
|
|
|
"DrugName": "WARFARIN 1 MG TAB 28'S (N)",
|
|
|
|
|
"Dose": "1",
|
|
|
|
|
"DoseType": "04",
|
|
|
|
|
"Unit": "actuation(s)",
|
|
|
|
|
"FrequencyType": "1/3/Day",
|
|
|
|
|
"Duration": "3/Day",
|
|
|
|
|
"IsScreen": "true"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"DrugId": "64-20-00-10-00-03-15",
|
|
|
|
|
"DrugName": "PANADOL 500 MG TAB 24'S(DIS)",
|
|
|
|
|
"Dose": "1",
|
|
|
|
|
"DoseType": "04",
|
|
|
|
|
"Unit": "MG",
|
|
|
|
|
"FrequencyType": "3/1/Day",
|
|
|
|
|
"Duration": "4/Day",
|
|
|
|
|
"RouteID": "24",
|
|
|
|
|
"IsScreen": "true"
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
"objAllergies": {
|
|
|
|
|
"Allergy": {
|
|
|
|
|
"objProperties": {"Id": "26", "Name": "phenoxymethylpenicillin"}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"objDiagnosis": {
|
|
|
|
|
"Diagnosis": {
|
|
|
|
|
"objProperties": {"Id": "A01.1", "Name": "Paratyphoid fever A"}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"IsDoctor": "false",
|
|
|
|
|
"IsPharmacist": "false"
|
|
|
|
|
},
|
|
|
|
|
"IPAdress": "10.10.10.10",
|
|
|
|
|
"Channel": 9,
|
|
|
|
|
"LanguageID": 2,
|
|
|
|
|
"VersionID": 5.3,
|
|
|
|
|
"SessionID": "BlUSkYymTt",
|
|
|
|
|
"IsLoginForDoctorApp": true,
|
|
|
|
|
"PatientOutSA": 0,
|
|
|
|
|
"TokenID": "@dm!n",
|
|
|
|
|
"OutSA": true
|
|
|
|
|
};
|
|
|
|
|
Map<String, dynamic> requestN = {
|
|
|
|
|
"Prescription": {
|
|
|
|
|
"objPatientInfo": {
|
|
|
|
|
"Gender": patient.gender == 1 ? 'Male' : 'Female',
|
|
|
|
|
"Age": patient.age
|
|
|
|
|
"Age": DateUtils.convertDateFromServerFormat(
|
|
|
|
|
patient.dateofBirth, 'dd/MM/yyyy')
|
|
|
|
|
},
|
|
|
|
|
"objVitalSign": {"Height": vital.heightCm, "Weight": vital.weightKg},
|
|
|
|
|
"objPrescriptionItems": prescription[0].entityList,
|
|
|
|
|
"objAllergies": allergy,
|
|
|
|
|
"objDiagnosis": diagnosis,
|
|
|
|
|
"objVitalSign": {"Height": vital?.heightCm, "Weight": vital?.weightKg},
|
|
|
|
|
"objPrescriptionItems": prescription,
|
|
|
|
|
"objAllergies": getAllergiesObj(allergy),
|
|
|
|
|
"objDiagnosis": getDiagnosisObj(lstAssessments),
|
|
|
|
|
"IsDoctor": "false",
|
|
|
|
|
"IsPharmacist": "false"
|
|
|
|
|
}
|
|
|
|
|
@ -231,7 +235,8 @@ class PrescriptionService extends LookupService {
|
|
|
|
|
await baseAppClient.post(DRUG_TO_DRUG,
|
|
|
|
|
onSuccess: (dynamic response, int statusCode) {
|
|
|
|
|
drugToDrug = [];
|
|
|
|
|
//drugToDrug = //response['MedicationList']['entityList'];
|
|
|
|
|
drugToDrug =
|
|
|
|
|
response['DrugToDrugResponse']['objPrescriptionCheckerResult'];
|
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
|
hasError = true;
|
|
|
|
|
super.error = error;
|
|
|
|
|
@ -256,4 +261,27 @@ class PrescriptionService extends LookupService {
|
|
|
|
|
super.error = error;
|
|
|
|
|
}, body: _boxQuantityRequestModel.toJson());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getAllergiesObj(List<GetAllergiesResModel> allergies) {
|
|
|
|
|
var allergiesObj = [];
|
|
|
|
|
allergies.forEach((element) {
|
|
|
|
|
allergiesObj.add({
|
|
|
|
|
"objProperties": {
|
|
|
|
|
'Id': element.allergyDiseaseId,
|
|
|
|
|
'Name': element.allergyDiseaseName
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
return allergiesObj;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getDiagnosisObj(List<GetAssessmentResModel> lstAssessments) {
|
|
|
|
|
var lstAssessmentsObj = [];
|
|
|
|
|
lstAssessments.forEach((element) {
|
|
|
|
|
lstAssessmentsObj.add({
|
|
|
|
|
"objProperties": {'Id': element.icdCode10ID, 'Name': element.asciiDesc}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
return lstAssessmentsObj;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|