lab result & radiolgy fix

merge-requests/796/head
hussam al-habibeh 4 years ago
parent 1d6026f9fd
commit 528e16c3dc

@ -9,19 +9,14 @@ class RadiologyService extends BaseService {
List<FinalRadiology> finalRadiologyList = List(); List<FinalRadiology> finalRadiologyList = List();
String url = ''; String url = '';
Future getRadImageURL( Future getRadImageURL({int invoiceNo, int lineItem, int projectId, @required PatiantInformtion patient}) async {
{int invoiceNo,
int lineItem,
int projectId,
@required PatiantInformtion patient}) async {
hasError = false; hasError = false;
final Map<String, dynamic> body = new Map<String, dynamic>(); final Map<String, dynamic> body = new Map<String, dynamic>();
body['InvoiceNo'] = invoiceNo; body['InvoiceNo'] = invoiceNo;
body['LineItemNo'] = lineItem; body['LineItemNo'] = lineItem;
body['ProjectID'] = projectId; body['ProjectID'] = projectId;
await baseAppClient.postPatient(GET_RAD_IMAGE_URL, patient: patient, await baseAppClient.postPatient(GET_RAD_IMAGE_URL, patient: patient, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) {
url = response['Data']; url = response['Data'];
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
@ -29,24 +24,22 @@ class RadiologyService extends BaseService {
}, body: body); }, body: body);
} }
Future getPatientRadOrders(PatiantInformtion patient, Future getPatientRadOrders(PatiantInformtion patient, {isInPatient = false}) async {
{isInPatient = false}) async {
String url = GET_PATIENT_ORDERS; String url = GET_PATIENT_ORDERS;
final Map<String, dynamic> body = new Map<String, dynamic>(); final Map<String, dynamic> body = new Map<String, dynamic>();
if (isInPatient) { if (isInPatient) {
url = GET_IN_PATIENT_ORDERS; url = GET_IN_PATIENT_ORDERS;
body['ProjectID'] = patient.projectId; body['ProjectID'] = patient.projectId;
} }
finalRadiologyList.clear();
hasError = false; hasError = false;
await baseAppClient.postPatient(url, patient: patient, await baseAppClient.postPatient(url, patient: patient, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) {
finalRadiologyList = []; finalRadiologyList = [];
String label = "ListRAD"; String label = "ListRAD";
if (isInPatient) { if (isInPatient) {
label = "List_GetRadOreders"; label = "List_GetRadOreders";
} }
if(response[label] == null || response[label].length == 0){ if (response[label] == null || response[label].length == 0) {
label = "FinalRadiologyList"; label = "FinalRadiologyList";
} }
response[label].forEach((radiology) { response[label].forEach((radiology) {

@ -29,7 +29,6 @@ class _LabsHomePageState extends State<LabsHomePage> {
bool isInpatient; bool isInpatient;
bool isFromLiveCare; bool isFromLiveCare;
@override @override
void didChangeDependencies() { void didChangeDependencies() {
super.didChangeDependencies(); super.didChangeDependencies();
@ -66,8 +65,7 @@ class _LabsHomePageState extends State<LabsHomePage> {
SizedBox( SizedBox(
height: 12, height: 12,
), ),
if (model.patientLabOrdersList.isNotEmpty && if (model.patientLabOrdersList.isNotEmpty && patient.patientStatusType != 43)
patient.patientStatusType != 43)
Padding( Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Column( child: Column(
@ -87,8 +85,7 @@ class _LabsHomePageState extends State<LabsHomePage> {
], ],
), ),
), ),
if (patient.patientStatusType != null && if (patient.patientStatusType != null && patient.patientStatusType == 43)
patient.patientStatusType == 43)
Padding( Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Column( child: Column(
@ -108,8 +105,7 @@ class _LabsHomePageState extends State<LabsHomePage> {
], ],
), ),
), ),
if ((patient.patientStatusType != null && if ((patient.patientStatusType != null && patient.patientStatusType == 43) ||
patient.patientStatusType == 43) ||
(isFromLiveCare && patient.appointmentNo != null)) (isFromLiveCare && patient.appointmentNo != null))
AddNewOrder( AddNewOrder(
onTap: () { onTap: () {
@ -146,37 +142,26 @@ class _LabsHomePageState extends State<LabsHomePage> {
width: 20, width: 20,
height: 160, height: 160,
decoration: BoxDecoration( decoration: BoxDecoration(
color: model.patientLabOrdersList[index] color: model.patientLabOrdersList[index].isLiveCareAppointment
.isLiveCareAppointment
? Colors.red[900] ? Colors.red[900]
: !model.patientLabOrdersList[index] : !model.patientLabOrdersList[index].isInOutPatient
.isInOutPatient
? Colors.black ? Colors.black
: Color(0xffa9a089), : Color(0xffa9a089),
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
topLeft: projectViewModel.isArabic? Radius.circular(0):Radius.circular(8), topLeft: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(8),
bottomLeft: projectViewModel.isArabic? Radius.circular(0):Radius.circular(8), bottomLeft: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(8),
topRight: projectViewModel.isArabic? Radius.circular(8):Radius.circular(0), topRight: projectViewModel.isArabic ? Radius.circular(8) : Radius.circular(0),
bottomRight: projectViewModel.isArabic? Radius.circular(8):Radius.circular(0) bottomRight: projectViewModel.isArabic ? Radius.circular(8) : Radius.circular(0)),
),
), ),
child: RotatedBox( child: RotatedBox(
quarterTurns: 3, quarterTurns: 3,
child: Center( child: Center(
child: Text( child: Text(
model.patientLabOrdersList[index] model.patientLabOrdersList[index].isLiveCareAppointment
.isLiveCareAppointment ? TranslationBase.of(context).liveCare.toUpperCase()
? TranslationBase.of(context) : !model.patientLabOrdersList[index].isInOutPatient
.liveCare ? TranslationBase.of(context).inPatientLabel.toUpperCase()
.toUpperCase() : TranslationBase.of(context).outpatient.toUpperCase(),
: !model.patientLabOrdersList[index]
.isInOutPatient
? TranslationBase.of(context)
.inPatientLabel
.toUpperCase()
: TranslationBase.of(context)
.outpatient
.toUpperCase(),
style: TextStyle(color: Colors.white), style: TextStyle(color: Colors.white),
), ),
)), )),
@ -190,24 +175,18 @@ class _LabsHomePageState extends State<LabsHomePage> {
page: LaboratoryResultPage( page: LaboratoryResultPage(
patientLabOrders: model.patientLabOrdersList[index], patientLabOrders: model.patientLabOrdersList[index],
patient: patient, patient: patient,
isInpatient:isInpatient, isInpatient: isInpatient,
arrivalType: arrivalType, arrivalType: arrivalType,
patientType: patientType, patientType: patientType,
), ),
), ),
), ),
doctorName: doctorName: model.patientLabOrdersList[index].doctorName,
model.patientLabOrdersList[index].doctorName, invoiceNO: ' ${model.patientLabOrdersList[index].invoiceNo}',
invoiceNO: profileUrl: model.patientLabOrdersList[index].doctorImageURL,
' ${model.patientLabOrdersList[index].invoiceNo}', branch: model.patientLabOrdersList[index].projectName,
profileUrl: model clinic: model.patientLabOrdersList[index].clinicDescription,
.patientLabOrdersList[index].doctorImageURL, appointmentDate: model.patientLabOrdersList[index].orderDate,
branch:
model.patientLabOrdersList[index].projectName,
clinic: model
.patientLabOrdersList[index].clinicDescription,
appointmentDate:
model.patientLabOrdersList[index].orderDate.add(Duration(days: 1)),
orderNo: model.patientLabOrdersList[index].orderNo, orderNo: model.patientLabOrdersList[index].orderNo,
isShowTime: false, isShowTime: false,
), ),
@ -216,8 +195,7 @@ class _LabsHomePageState extends State<LabsHomePage> {
), ),
), ),
), ),
if (model.patientLabOrdersList.isEmpty && if (model.patientLabOrdersList.isEmpty && patient.patientStatusType != 43)
patient.patientStatusType != 43)
Center( Center(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,

@ -664,7 +664,7 @@ packages:
name: meta name: meta
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.3.0-nullsafety.3" version: "1.3.0-nullsafety.4"
mime: mime:
dependency: transitive dependency: transitive
description: description:
@ -956,7 +956,7 @@ packages:
name: stack_trace name: stack_trace
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.10.0-nullsafety.1" version: "1.10.0-nullsafety.2"
sticky_headers: sticky_headers:
dependency: "direct main" dependency: "direct main"
description: description:
@ -1154,5 +1154,5 @@ packages:
source: hosted source: hosted
version: "2.2.1" version: "2.2.1"
sdks: sdks:
dart: ">=2.10.0 <2.11.0" dart: ">=2.10.0 <=2.11.0-213.1.beta"
flutter: ">=1.22.0 <2.0.0" flutter: ">=1.22.0 <2.0.0"

Loading…
Cancel
Save