Merge branch 'development' of https://gitlab.com/Cloud_Solution/doctor_app_flutter into favourite_prescription

 Conflicts:
	lib/core/service/patient/LiveCarePatientServices.dart
favourite_prescription
hussam al-habibeh 5 years ago
commit 25583d7bee

@ -70,7 +70,7 @@ dependencies {
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
//openTok
implementation 'com.opentok.android:opentok-android-sdk:2.16.5'
implementation 'com.opentok.android:opentok-android-sdk:2.20.1'
//permissions
implementation 'pub.devrel:easypermissions:0.4.0'
//retrofit

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.hmg.hmgDr">
<!--
io.flutter.app.FlutterApplication is an android.app.Application that
@ -11,6 +12,9 @@
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<application
android:name="io.flutter.app.FlutterApplication"
android:icon="@mipmap/ic_launcher"

@ -1,15 +0,0 @@
package com.example.doctor_app_flutter.Service;
import com.example.doctor_app_flutter.Model.GetSessionStatusModel;
import com.example.doctor_app_flutter.Model.SessionStatusModel;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.POST;
public interface SessionStatusAPI {
@POST("LiveCareApi/DoctorApp/GetSessionStatus")
Call<SessionStatusModel> getSessionStatusModelData(@Body GetSessionStatusModel getSessionStatusModel);
}

@ -1,18 +0,0 @@
package com.example.doctor_app_flutter.ui;
import com.example.doctor_app_flutter.Model.GetSessionStatusModel;
import com.example.doctor_app_flutter.Model.SessionStatusModel;
public interface VideoCallContract {
interface VideoCallView{
void onCallSuccessful(SessionStatusModel sessionStatusModel);
void onFailure();
}
interface VideoCallPresenter {
void callClintConnected(GetSessionStatusModel statusModel);
}
}

@ -3,9 +3,9 @@ package com.hmg.hmgDr
import android.app.Activity
import android.content.Intent
import androidx.annotation.NonNull
import com.example.doctor_app_flutter.Model.GetSessionStatusModel
import com.example.doctor_app_flutter.Model.SessionStatusModel
import com.example.doctor_app_flutter.ui.VideoCallActivity
import com.hmg.hmgDr.Model.GetSessionStatusModel
import com.hmg.hmgDr.Model.SessionStatusModel
import com.hmg.hmgDr.ui.VideoCallActivity
import com.google.gson.GsonBuilder
import io.flutter.embedding.android.FlutterFragmentActivity
import io.flutter.embedding.engine.FlutterEngine

@ -0,0 +1,137 @@
package com.hmg.hmgDr.Model;
import android.os.Parcel;
import android.os.Parcelable;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
public class ChangeCallStatusRequestModel implements Parcelable {
@SerializedName("CallStatus")
@Expose
private Integer callStatus;
@SerializedName("DoctorId")
@Expose
private Integer doctorId;
@SerializedName("generalid")
@Expose
private String generalid;
@SerializedName("TokenID")
@Expose
private String tokenID;
@SerializedName("VC_ID")
@Expose
private Integer vcId;
public ChangeCallStatusRequestModel(Integer callStatus, Integer doctorId, String generalid, String tokenID, Integer vcId) {
this.callStatus = callStatus;
this.doctorId = doctorId;
this.generalid = generalid;
this.tokenID = tokenID;
this.vcId = vcId;
}
protected ChangeCallStatusRequestModel(Parcel in) {
if (in.readByte() == 0) {
callStatus = null;
} else {
callStatus = in.readInt();
}
if (in.readByte() == 0) {
doctorId = null;
} else {
doctorId = in.readInt();
}
generalid = in.readString();
tokenID = in.readString();
if (in.readByte() == 0) {
vcId = null;
} else {
vcId = in.readInt();
}
}
public static final Creator<ChangeCallStatusRequestModel> CREATOR = new Creator<ChangeCallStatusRequestModel>() {
@Override
public ChangeCallStatusRequestModel createFromParcel(Parcel in) {
return new ChangeCallStatusRequestModel(in);
}
@Override
public ChangeCallStatusRequestModel[] newArray(int size) {
return new ChangeCallStatusRequestModel[size];
}
};
public Integer getCallStatus() {
return callStatus;
}
public void setCallStatus(Integer callStatus) {
this.callStatus = callStatus;
}
public Integer getDoctorId() {
return doctorId;
}
public void setDoctorId(Integer doctorId) {
this.doctorId = doctorId;
}
public String getGeneralid() {
return generalid;
}
public void setGeneralid(String generalid) {
this.generalid = generalid;
}
public String getTokenID() {
return tokenID;
}
public void setTokenID(String tokenID) {
this.tokenID = tokenID;
}
public Integer getVcId() {
return vcId;
}
public void setVcId(Integer vcId) {
this.vcId = vcId;
}
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel dest, int flags) {
if (callStatus == null) {
dest.writeByte((byte) 0);
} else {
dest.writeByte((byte) 1);
dest.writeInt(callStatus);
}
if (doctorId == null) {
dest.writeByte((byte) 0);
} else {
dest.writeByte((byte) 1);
dest.writeInt(doctorId);
}
dest.writeString(generalid);
dest.writeString(tokenID);
if (vcId == null) {
dest.writeByte((byte) 0);
} else {
dest.writeByte((byte) 1);
dest.writeInt(vcId);
}
}
}

@ -1,4 +1,4 @@
package com.example.doctor_app_flutter.Model;
package com.hmg.hmgDr.Model;
import android.os.Parcel;
import android.os.Parcelable;

@ -1,4 +1,4 @@
package com.example.doctor_app_flutter.Model;
package com.hmg.hmgDr.Model;
import android.os.Parcel;
import android.os.Parcelable;

@ -1,4 +1,4 @@
package com.example.doctor_app_flutter.Service;
package com.hmg.hmgDr.Service;
import android.app.Activity;
import android.app.Application;

@ -0,0 +1,19 @@
package com.hmg.hmgDr.Service;
import com.hmg.hmgDr.Model.ChangeCallStatusRequestModel;
import com.hmg.hmgDr.Model.GetSessionStatusModel;
import com.hmg.hmgDr.Model.SessionStatusModel;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.POST;
public interface SessionStatusAPI {
@POST("LiveCareApi/DoctorApp/GetSessionStatus")
Call<SessionStatusModel> getSessionStatusModelData(@Body GetSessionStatusModel getSessionStatusModel);
@POST("LiveCareApi/DoctorApp/ChangeCallStatus")
Call<SessionStatusModel> changeCallStatus(@Body ChangeCallStatusRequestModel changeCallStatusRequestModel);
}

@ -1,4 +1,4 @@
package com.example.doctor_app_flutter.ui;
package com.hmg.hmgDr.ui;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
@ -20,8 +20,9 @@ import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;
import com.example.doctor_app_flutter.Model.GetSessionStatusModel;
import com.example.doctor_app_flutter.Model.SessionStatusModel;
import com.hmg.hmgDr.Model.ChangeCallStatusRequestModel;
import com.hmg.hmgDr.Model.GetSessionStatusModel;
import com.hmg.hmgDr.Model.SessionStatusModel;
import com.hmg.hmgDr.R;
import com.opentok.android.Session;
import com.opentok.android.Stream;
@ -227,11 +228,15 @@ public class VideoCallActivity extends AppCompatActivity implements EasyPermissi
@AfterPermissionGranted(RC_VIDEO_APP_PERM)
private void requestPermissions() {
String[] perms = {Manifest.permission.INTERNET, Manifest.permission.CAMERA, Manifest.permission.RECORD_AUDIO};
String[] perms = {Manifest.permission.INTERNET, Manifest.permission.CAMERA,};
if (EasyPermissions.hasPermissions(this, perms)) {
mSession = new Session.Builder(VideoCallActivity.this, apiKey, sessionId).build();
mSession.setSessionListener(this);
mSession.connect(token);
try {
mSession = new Session.Builder(this, apiKey, sessionId).build();
mSession.setSessionListener(this);
mSession.connect(token);
} catch (Exception e) {
e.printStackTrace();
}
} else {
EasyPermissions.requestPermissions(this, getString(R.string.remaining_ar), RC_VIDEO_APP_PERM, perms);
}
@ -277,6 +282,7 @@ public class VideoCallActivity extends AppCompatActivity implements EasyPermissi
}
isConnected = true;
subscribeToStream(stream);
videoCallPresenter.callChangeCallStatus(new ChangeCallStatusRequestModel(3,sessionStatusModel.getDoctorId(), sessionStatusModel.getGeneralid(),token,sessionStatusModel.getVCID()));
}
@Override
@ -369,6 +375,7 @@ public class VideoCallActivity extends AppCompatActivity implements EasyPermissi
if (countDownTimer != null) {
countDownTimer.cancel();
}
videoCallPresenter.callChangeCallStatus(new ChangeCallStatusRequestModel(16,sessionStatusModel.getDoctorId(), sessionStatusModel.getGeneralid(),token,sessionStatusModel.getVCID()));
finish();
}
@ -423,6 +430,11 @@ public class VideoCallActivity extends AppCompatActivity implements EasyPermissi
}
}
@Override
public void onCallChangeCallStatusSuccessful(SessionStatusModel sessionStatusModel) {
}
@Override
public void onFailure() {

@ -0,0 +1,24 @@
package com.hmg.hmgDr.ui;
import com.hmg.hmgDr.Model.ChangeCallStatusRequestModel;
import com.hmg.hmgDr.Model.GetSessionStatusModel;
import com.hmg.hmgDr.Model.SessionStatusModel;
public interface VideoCallContract {
interface VideoCallView {
void onCallSuccessful(SessionStatusModel sessionStatusModel);
void onCallChangeCallStatusSuccessful(SessionStatusModel sessionStatusModel);
void onFailure();
}
interface VideoCallPresenter {
void callClintConnected(GetSessionStatusModel statusModel);
void callChangeCallStatus(ChangeCallStatusRequestModel statusModel);
}
}

@ -1,9 +1,10 @@
package com.example.doctor_app_flutter.ui;
package com.hmg.hmgDr.ui;
import com.example.doctor_app_flutter.Model.GetSessionStatusModel;
import com.example.doctor_app_flutter.Model.SessionStatusModel;
import com.example.doctor_app_flutter.Service.AppRetrofit;
import com.example.doctor_app_flutter.Service.SessionStatusAPI;
import com.hmg.hmgDr.Model.ChangeCallStatusRequestModel;
import com.hmg.hmgDr.Model.GetSessionStatusModel;
import com.hmg.hmgDr.Model.SessionStatusModel;
import com.hmg.hmgDr.Service.AppRetrofit;
import com.hmg.hmgDr.Service.SessionStatusAPI;
import org.jetbrains.annotations.NotNull;
@ -46,4 +47,25 @@ public class VideoCallPresenterImpl implements VideoCallContract.VideoCallPresen
});
}
@Override
public void callChangeCallStatus(ChangeCallStatusRequestModel statusModel) {
sessionStatusAPI = AppRetrofit.getRetrofit(baseUrl).create(SessionStatusAPI.class);
Call<SessionStatusModel> call = sessionStatusAPI.changeCallStatus(statusModel);
call.enqueue(new Callback<SessionStatusModel>() {
@Override
public void onResponse(@NotNull Call<SessionStatusModel> call, @NotNull Response<SessionStatusModel> response) {
if (!response.isSuccessful())
view.onFailure();
}
@Override
public void onFailure(@NotNull Call<SessionStatusModel> call, @NotNull Throwable t) {
view.onFailure();
}
});
}
}

@ -1,5 +1,5 @@
# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'
platform :ios, '11.0'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
@ -64,7 +64,7 @@ target 'Runner' do
# Keep pod path relative so it can be checked into Podfile.lock.
pod 'Flutter', :path => 'Flutter'
pod 'OpenTok'
pod 'Alamofire'
pod 'Alamofire', '~> 5.2'
# Plugin Pods
# Prepare symlinks folder. We use symlinks to avoid having Podfile.lock

@ -1,9 +1,8 @@
PODS:
- Alamofire (4.9.1)
- barcode_scan (0.0.1):
- Alamofire (5.4.3)
- barcode_scan_fix (0.0.1):
- Flutter
- MTBBarcodeScanner
- SwiftProtobuf
- connectivity (0.0.1):
- Flutter
- Reachability
@ -102,8 +101,8 @@ PODS:
- Flutter
- "permission_handler (5.1.0+2)":
- Flutter
- PromisesObjC (1.2.11)
- Protobuf (3.13.0)
- PromisesObjC (1.2.12)
- Protobuf (3.17.0)
- Reachability (3.2)
- screen (0.0.1):
- Flutter
@ -120,7 +119,6 @@ PODS:
- speech_to_text (0.0.1):
- Flutter
- Try
- SwiftProtobuf (1.9.0)
- Try (2.1.1)
- url_launcher (0.0.1):
- Flutter
@ -142,8 +140,8 @@ PODS:
- Flutter
DEPENDENCIES:
- Alamofire
- barcode_scan (from `.symlinks/plugins/barcode_scan/ios`)
- Alamofire (~> 5.2)
- barcode_scan_fix (from `.symlinks/plugins/barcode_scan_fix/ios`)
- connectivity (from `.symlinks/plugins/connectivity/ios`)
- connectivity_for_web (from `.symlinks/plugins/connectivity_for_web/ios`)
- connectivity_macos (from `.symlinks/plugins/connectivity_macos/ios`)
@ -197,12 +195,11 @@ SPEC REPOS:
- PromisesObjC
- Protobuf
- Reachability
- SwiftProtobuf
- Try
EXTERNAL SOURCES:
barcode_scan:
:path: ".symlinks/plugins/barcode_scan/ios"
barcode_scan_fix:
:path: ".symlinks/plugins/barcode_scan_fix/ios"
connectivity:
:path: ".symlinks/plugins/connectivity/ios"
connectivity_for_web:
@ -273,8 +270,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/webview_flutter/ios"
SPEC CHECKSUMS:
Alamofire: 85e8a02c69d6020a0d734f6054870d7ecb75cf18
barcode_scan: a5c27959edfafaa0c771905bad0b29d6d39e4479
Alamofire: e447a2774a40c996748296fa2c55112fdbbc42f9
barcode_scan_fix: 80dd65de55f27eec6591dd077c8b85f2b79e31f1
connectivity: c4130b2985d4ef6fd26f9702e886bd5260681467
connectivity_for_web: 2b8584556930d4bd490d82b836bcf45067ce345b
connectivity_macos: e2e9731b6b22dda39eb1b128f6969d574460e191
@ -304,8 +301,8 @@ SPEC CHECKSUMS:
path_provider_linux: 4d630dc393e1f20364f3e3b4a2ff41d9674a84e4
path_provider_windows: a2b81600c677ac1959367280991971cb9a1edb3b
permission_handler: ccb20a9fad0ee9b1314a52b70b76b473c5f8dab0
PromisesObjC: 8c196f5a328c2cba3e74624585467a557dcb482f
Protobuf: 3dac39b34a08151c6d949560efe3f86134a3f748
PromisesObjC: 3113f7f76903778cf4a0586bd1ab89329a0b7b97
Protobuf: 7327d4444215b5f18e560a97f879ff5503c4581c
Reachability: 33e18b67625424e47b6cde6d202dce689ad7af96
screen: abd91ca7bf3426e1cc3646d27e9b2358d6bf07b0
shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d
@ -314,7 +311,6 @@ SPEC CHECKSUMS:
shared_preferences_web: 141cce0c3ed1a1c5bf2a0e44f52d31eeb66e5ea9
shared_preferences_windows: 36b76d6f54e76ead957e60b49e2f124b4cd3e6ae
speech_to_text: b43a7d99aef037bd758ed8e45d79bbac035d2dfe
SwiftProtobuf: ecbec1be9036d15655f6b3443a1c4ea693c97932
Try: 5ef669ae832617b3cee58cb2c6f99fb767a4ff96
url_launcher: 6fef411d543ceb26efce54b05a0a40bfd74cbbef
url_launcher_linux: ac237cb7a8058736e4aae38bdbcc748a4b394cc0
@ -326,6 +322,6 @@ SPEC CHECKSUMS:
wakelock: 0d4a70faf8950410735e3f61fb15d517c8a6efc4
webview_flutter: d2b4d6c66968ad042ad94cbb791f5b72b4678a96
PODFILE CHECKSUM: 649616dc336b3659ac6b2b25159d8e488e042b69
PODFILE CHECKSUM: d0a3789a37635365b4345e456835ed9d30398217
COCOAPODS: 1.10.1

@ -43,10 +43,33 @@ class ViewController: UIViewController {
requestCameraPermissionsIfNeeded()
hideVideoMuted()
setupSession()
// Do any additional setup after loading the view.
}
private func changeCallStatus(callStatus:Int){
let URL_USER_REGISTER = baseUrl+"LiveCareApi/DoctorApp/ChangeCallStatus"
let headers: HTTPHeaders = ["Content-Type":"application/json","Accept":"application/json",]
let parameters = [
"CallStatus":callStatus,
"VC_ID": VC_ID,
"TokenID": TokenID,
"generalid": generalid,
"DoctorId" : DoctorId ,
] as [String : Any]
AF.request(URL_USER_REGISTER, method: .post,parameters: parameters, encoding: JSONEncoding.default, headers: headers).responseJSON{
response in
if let result = response.value {
let jsonData = result as! NSObject
let resultVal = jsonData.value(forKey: "Result")
print(resultVal as Any)
}
}
}
private func getSessionStatus() {
let URL_USER_REGISTER = baseUrl+"LiveCareApi/DoctorApp/GetSessionStatus"
let headers: HTTPHeaders = [
@ -61,11 +84,11 @@ class ViewController: UIViewController {
"generalid": generalid,
"DoctorId" : DoctorId ,
] as [String : Any]
Alamofire.request(URL_USER_REGISTER, method: .post,parameters: parameters, encoding: JSONEncoding.default, headers: headers).responseJSON{
AF.request(URL_USER_REGISTER, method: .post,parameters: parameters, encoding: JSONEncoding.default, headers: headers).responseJSON{
response in
if self.isUserConnect {
} else {
if let result = response.result.value {
if let result = response.value {
let jsonData = result as! NSObject
if((jsonData.value(forKey: "SessionStatus")) as! Int == 2 || (jsonData.value(forKey: "SessionStatus")) as! Int == 3) {
//jsonData
@ -81,7 +104,6 @@ class ViewController: UIViewController {
self.sessionDisconnect();
self.timer.invalidate()
}
//getting json value from the server
}
}
@ -160,6 +182,7 @@ class ViewController: UIViewController {
func sessionDisconnect() {
changeCallStatus(callStatus: 16)
if (session != nil) {
print("disconnecting....")
session!.disconnect(nil)
@ -168,7 +191,7 @@ class ViewController: UIViewController {
}
dismiss(animated: true)
}
// Converted to Swift 5.2 by Swiftify v5.2.26743 - https://swiftify.com/
func requestCameraPermissionsIfNeeded() {
// check camera authorization status
@ -306,6 +329,7 @@ extension ViewController: OTSessionDelegate {
}
func session(_ session: OTSession, didFailWithError error: OTError) {
changeCallStatus(callStatus: 16)
print("The client failed to connect to the OpenTok session: \(error).")
}
@ -377,6 +401,7 @@ extension ViewController: OTSessionDelegate {
if let connectionId = connection?.connectionId {
print("session connectionCreated (\(connectionId))")
}
changeCallStatus(callStatus: 3)
isUserConnect = true
timer.invalidate()
}

@ -79,11 +79,13 @@ class BaseAppClient {
await sharedPref.getString(VIDA_REFRESH_TOKEN_ID);
}
//int projectID = await sharedPref.getInt(PROJECT_ID);
//if (projectID == 2 || projectID == 3)
// body['PatientOutSA'] = true;
//else
body['PatientOutSA'] = false;
int projectID = await sharedPref.getInt(PROJECT_ID);
if (projectID == 2 || projectID == 3)
body['PatientOutSA'] = true;
else if(body.containsKey('facilityId') && body['facilityId']==2 || body['facilityId']==3)
body['PatientOutSA'] = true;
else
body['PatientOutSA'] = false;
body['DeviceTypeID'] = Platform.isAndroid ? 1 : 2;
print("URL : $url");

@ -651,6 +651,10 @@ const Map<String, Map<String, String>> localizedValues = {
'en': "add Selected Procedures",
'ar': "اضافة العمليات المختارة "
},
'addProcedures': {
'en': "Add Procedure",
'ar': "اضافة العمليات"
},
'updateProcedure': {'en': "Update Procedure", 'ar': "تحديث العملية"},
'orderProcedure': {'en': "order procedure", 'ar': "طلب العمليات"},
'nameOrICD': {'en': "Name or ICD", 'ar': "الاسم او  ICD"},
@ -998,4 +1002,10 @@ const Map<String, Map<String, String>> localizedValues = {
"onHold": {"en": "On Hold", "ar": "قيد الانتظار"},
"verified": {"en": "Verified", "ar": "تم التحقق"},
"endCall": {"en": "End Call", "ar": "انهاء"},
"favoriteTemplates": {"en": "Favorite Templates", "ar": "القوالب المفضلة"},
"allProcedures": {"en": "All Procedures", "ar": "جميع الإجراءات"},
"allRadiology": {"en": "All Radiology", "ar": "جميع الأشعة"},
"allLab": {"en": "All Lab", "ar": "جميع المختبرات"},
"allPrescription": {"en": "All Prescription", "ar": "جميع الوصفات"},
"addPrescription": {"en": "Add prescription", "ar": "إضافة الوصفات"},
};

@ -14,6 +14,8 @@ class LiveCarePatientServices extends BaseService {
bool _isFinished = false;
bool _isLive = false;
bool get isFinished => _isFinished;
setFinished(bool isFinished) {
@ -53,7 +55,7 @@ class LiveCarePatientServices extends BaseService {
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: endCallReq.toJson(), isLiveCare: true);
}, body: endCallReq.toJson(), isLiveCare:_isLive);
}
Future startCall(StartCallReq startCallReq) async {
@ -63,7 +65,7 @@ class LiveCarePatientServices extends BaseService {
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: startCallReq.toJson(), isLiveCare: true);
}, body: startCallReq.toJson(), isLiveCare:_isLive);
}
Future endCallWithCharge(int vcID) async {
@ -76,7 +78,7 @@ class LiveCarePatientServices extends BaseService {
}, body: {
"VC_ID": vcID,
"generalid": "Cs2020@2016\$2958",
}, isLiveCare: true);
}, isLiveCare: _isLive);
}
Future transferToAdmin(int vcID, String notes) async {
@ -90,7 +92,7 @@ class LiveCarePatientServices extends BaseService {
"VC_ID": vcID,
"IsOutKsa": false,
"Notes": notes,
}, isLiveCare: true);
}, isLiveCare: _isLive);
}
Future isLogin(LiveCareUserLoginRequestModel isLoginRequestModel) async {

@ -66,7 +66,7 @@ class ProcedureService extends BaseService {
Future getProcedureTemplate(
{int doctorId, int projectId, int clinicId, String categoryID}) async {
_procedureTempleteRequestModel = ProcedureTempleteRequestModel(
tokenID: "@dm!n",
// tokenID: "@dm!n",
patientID: 0,
searchType: 1,
);

@ -46,6 +46,9 @@ class RadiologyService extends BaseService {
if (isInPatient) {
label = "List_GetRadOreders";
}
if(response[label] == null || response[label].length == 0){
label = "FinalRadiologyList";
}
response[label].forEach((radiology) {
finalRadiologyList.add(FinalRadiology.fromJson(radiology));
});

@ -17,9 +17,9 @@ class UcafService extends LookupService {
Future getPatientChiefComplaint(PatiantInformtion patient) async {
hasError = false;
Map<String, dynamic> body = Map();
body['PatientMRN'] = patient.patientMRN;
body['PatientMRN'] = patient.patientMRN ;
body['AppointmentNo'] = patient.appointmentNo;
body['EpisodeID'] = patient.episodeNo;
body['EpisodeID'] = patient.episodeNo ;
body['DoctorID'] = "";
await baseAppClient.post(GET_CHIEF_COMPLAINT,

@ -17,14 +17,12 @@ import 'package:doctor_app_flutter/core/model/hospitals/get_hospitals_response_m
import 'package:doctor_app_flutter/core/service/authentication_service.dart';
import 'package:doctor_app_flutter/core/service/hospitals/hospitals_service.dart';
import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/locator.dart';
import 'package:doctor_app_flutter/models/doctor/clinic_model.dart';
import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/models/doctor/profile_req_Model.dart';
import 'package:doctor_app_flutter/models/doctor/user_model.dart';
import 'package:doctor_app_flutter/root_page.dart';
import 'package:doctor_app_flutter/screens/auth/login_screen.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
@ -34,7 +32,6 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:local_auth/auth_strings.dart';
import 'package:local_auth/local_auth.dart';
import 'package:provider/provider.dart';
enum APP_STATUS { LOADING, UNAUTHENTICATED, AUTHENTICATED, UNVERIFIED }
@ -76,7 +73,7 @@ class AuthenticationViewModel extends BaseViewModel {
APP_STATUS app_status = APP_STATUS.LOADING;
AuthenticationViewModel({bool checkDeviceInfo = false}) {
getDeviceInfoFromFirebase();
getDeviceInfoFromFirebase();
getDoctorProfile();
}
@ -303,7 +300,7 @@ class AuthenticationViewModel extends BaseViewModel {
license: true,
projectID: clinicInfo.projectID,
tokenID: '',
languageID: 2);
languageID: 2);//TODO change the lan
await _authService.getDoctorProfileBasedOnClinic(docInfo);
if (_authService.hasError) {
error = _authService.error;
@ -362,7 +359,12 @@ class AuthenticationViewModel extends BaseViewModel {
if (Platform.isIOS) {
_firebaseMessaging.requestNotificationPermissions();
}
setState(ViewState.Busy);
try {
setState(ViewState.Busy);
} catch (e) {
Helpers.showErrorToast("fdfdfdfdf"+e.toString());
}
var token = await _firebaseMessaging.getToken();
if (DEVICE_TOKEN == "") {
DEVICE_TOKEN = token;
@ -415,29 +417,24 @@ class AuthenticationViewModel extends BaseViewModel {
/// logout function
logout({bool isFromLogin = false}) async {
DEVICE_TOKEN = "";
String lang = await sharedPref.getString(APP_Language);
await Helpers.clearSharedPref();
doctorProfile = null;
sharedPref.setString(APP_Language, lang);
deleteUser();
await getDeviceInfoFromFirebase();
this.isFromLogin = isFromLogin;
app_status = APP_STATUS.UNAUTHENTICATED;
setState(ViewState.Idle);
Navigator.pushAndRemoveUntil(
AppGlobal.CONTEX,
FadePage(
page: RootPage(),
),
(r) => false);
DEVICE_TOKEN = "";
String lang = await sharedPref.getString(APP_Language);
await Helpers.clearSharedPref();
doctorProfile = null;
sharedPref.setString(APP_Language, lang);
deleteUser();
await getDeviceInfoFromFirebase();
this.isFromLogin = isFromLogin;
app_status = APP_STATUS.UNAUTHENTICATED;
setState(ViewState.Idle);
}
deleteUser(){
user = null;
unverified = false;
isLogin = false;
// notifyListeners();
}
}

@ -50,5 +50,6 @@ class BaseViewModel extends ChangeNotifier {
setDoctorProfile(DoctorProfileModel doctorProfile)async {
await sharedPref.setObj(DOCTOR_PROFILE, doctorProfile);
this.doctorProfile = doctorProfile;
notifyListeners();
}
}

@ -4,10 +4,10 @@ import 'package:doctor_app_flutter/core/model/labs/LabOrderResult.dart';
import 'package:doctor_app_flutter/core/model/labs/lab_result.dart';
import 'package:doctor_app_flutter/core/model/labs/patient_lab_orders.dart';
import 'package:doctor_app_flutter/core/model/labs/patient_lab_special_result.dart';
import 'package:doctor_app_flutter/core/model/procedure/ControlsModel.dart';
import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart';
import 'package:doctor_app_flutter/core/model/procedure/get_ordered_procedure_model.dart';
import 'package:doctor_app_flutter/core/model/procedure/post_procedure_req_model.dart';
import 'package:doctor_app_flutter/core/model/procedure/procedure_templateModel.dart';
import 'package:doctor_app_flutter/core/model/procedure/procedure_template_details_model.dart';
import 'package:doctor_app_flutter/core/model/procedure/procedure_valadate_model.dart';
import 'package:doctor_app_flutter/core/model/procedure/procedure_valadate_request_model.dart';
@ -19,8 +19,12 @@ import 'package:doctor_app_flutter/core/service/patient_medical_file/radiology/r
import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
import 'package:doctor_app_flutter/locator.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/procedures/ProcedureType.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:flutter/cupertino.dart';
import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart'
as cpe;
class ProcedureViewModel extends BaseViewModel {
//TODO Hussam clean it
@ -74,11 +78,15 @@ class ProcedureViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future getProcedureCategory({String categoryName, String categoryID, patientId}) async {
Future getProcedureCategory(
{String categoryName, String categoryID, patientId}) async {
if (categoryName == null) return;
hasError = false;
setState(ViewState.Busy);
await _procedureService.getProcedureCategory(
categoryName: categoryName, categoryID: categoryID, patientId: patientId);
categoryName: categoryName,
categoryID: categoryID,
patientId: patientId);
if (_procedureService.hasError) {
error = _procedureService.error;
setState(ViewState.ErrorLocal);
@ -305,4 +313,70 @@ class ProcedureViewModel extends BaseViewModel {
} else
DrAppToastMsg.showSuccesToast(mes);
}
Future preparePostProcedure(
{String remarks,
String orderType,
PatiantInformtion patient,
List<cpe.EntityList> entityList,
ProcedureType procedureType}) async {
PostProcedureReqModel postProcedureReqModel = new PostProcedureReqModel();
ProcedureValadteRequestModel procedureValadteRequestModel =
new ProcedureValadteRequestModel();
procedureValadteRequestModel.patientMRN = patient.patientMRN;
procedureValadteRequestModel.episodeID = patient.episodeNo;
procedureValadteRequestModel.appointmentNo = patient.appointmentNo;
List<Procedures> controlsProcedure = List();
postProcedureReqModel.appointmentNo = patient.appointmentNo;
postProcedureReqModel.episodeID = patient.episodeNo;
postProcedureReqModel.patientMRN = patient.patientMRN;
entityList.forEach((element) {
procedureValadteRequestModel.procedure = [element.procedureId];
List<Controls> controls = List();
controls.add(
Controls(
code: "remarks",
controlValue: element.remarks != null ? element.remarks : ""),
);
controls.add(
Controls(
code: "ordertype",
controlValue: procedureType == ProcedureType.PROCEDURE
? element.type ?? "1"
: "0"),
);
controlsProcedure.add(Procedures(
category: element.categoryID,
procedure: element.procedureId,
controls: controls));
});
postProcedureReqModel.procedures = controlsProcedure;
await valadteProcedure(procedureValadteRequestModel);
if (state == ViewState.Idle) {
if (valadteProcedureList[0].entityList.length == 0) {
await postProcedure(postProcedureReqModel, patient.patientMRN);
if (state == ViewState.ErrorLocal) {
Helpers.showErrorToast(error);
getProcedure(mrn: patient.patientMRN);
} else if (state == ViewState.Idle) {
DrAppToastMsg.showSuccesToast('procedure has been added');
}
} else {
if (state == ViewState.ErrorLocal) {
Helpers.showErrorToast(error);
getProcedure(mrn: patient.patientMRN);
} else if (state == ViewState.Idle) {
Helpers.showErrorToast(
valadteProcedureList[0].entityList[0].warringMessages);
}
}
} else {
Helpers.showErrorToast(error);
}
}
}

@ -4,12 +4,14 @@ class StartCallRes {
String openTokenID;
bool isAuthenticated;
int messageStatus;
String appointmentNo;
StartCallRes(
{this.result,
this.openSessionID,
this.openTokenID,
this.isAuthenticated,
this.appointmentNo,
this.messageStatus});
StartCallRes.fromJson(Map<String, dynamic> json) {
@ -18,6 +20,7 @@ class StartCallRes {
openTokenID = json['OpenTokenID'];
isAuthenticated = json['IsAuthenticated'];
messageStatus = json['MessageStatus'];
appointmentNo = json['AppointmentNo'];
}
Map<String, dynamic> toJson() {
@ -27,6 +30,7 @@ class StartCallRes {
data['OpenTokenID'] = this.openTokenID;
data['IsAuthenticated'] = this.isAuthenticated;
data['MessageStatus'] = this.messageStatus;
data['AppointmentNo'] = this.appointmentNo;
return data;
}
}

@ -2,11 +2,13 @@ class MedicalReportModel {
String reportData;
String setupID;
int projectID;
String projectName;
String projectNameN;
int patientID;
String invoiceNo;
int status;
String verifiedOn;
String verifiedBy;
dynamic verifiedBy;
String editedOn;
int editedBy;
int lineItemNo;
@ -19,12 +21,17 @@ class MedicalReportModel {
String doctorImageURL;
String doctorName;
String doctorNameN;
int clinicID;
String clinicName;
String clinicNameN;
String reportDataHtml;
MedicalReportModel(
{this.reportData,
this.setupID,
this.projectID,
this.projectName,
this.projectNameN,
this.patientID,
this.invoiceNo,
this.status,
@ -42,12 +49,17 @@ class MedicalReportModel {
this.doctorImageURL,
this.doctorName,
this.doctorNameN,
this.clinicID,
this.clinicName,
this.clinicNameN,
this.reportDataHtml});
MedicalReportModel.fromJson(Map<String, dynamic> json) {
reportData = json['ReportData'];
setupID = json['SetupID'];
projectID = json['ProjectID'];
projectName = json['ProjectName'];
projectNameN = json['ProjectNameN'];
patientID = json['PatientID'];
invoiceNo = json['InvoiceNo'];
status = json['Status'];
@ -65,6 +77,9 @@ class MedicalReportModel {
doctorImageURL = json['DoctorImageURL'];
doctorName = json['DoctorName'];
doctorNameN = json['DoctorNameN'];
clinicID = json['ClinicID'];
clinicName = json['ClinicName'];
clinicNameN = json['ClinicNameN'];
reportDataHtml = json['ReportDataHtml'];
}
@ -73,6 +88,8 @@ class MedicalReportModel {
data['ReportData'] = this.reportData;
data['SetupID'] = this.setupID;
data['ProjectID'] = this.projectID;
data['ProjectName'] = this.projectName;
data['ProjectNameN'] = this.projectNameN;
data['PatientID'] = this.patientID;
data['InvoiceNo'] = this.invoiceNo;
data['Status'] = this.status;
@ -90,6 +107,9 @@ class MedicalReportModel {
data['DoctorImageURL'] = this.doctorImageURL;
data['DoctorName'] = this.doctorName;
data['DoctorNameN'] = this.doctorNameN;
data['ClinicID'] = this.clinicID;
data['ClinicName'] = this.clinicName;
data['ClinicNameN'] = this.clinicNameN;
data['ReportDataHtml'] = this.reportDataHtml;
return data;
}

@ -224,7 +224,10 @@ class PatiantInformtion {
isSigned: json['isSigned'],
medicationOrders: json['medicationOrders'],
nationality: json['nationality'] ?? json['NationalityNameN'],
patientMRN: json['patientMRN'] ?? json['PatientMRN'],
patientMRN: json['patientMRN'] ?? json['PatientMRN']?? (
json["PatientID"] != null ?
int.parse(json["PatientID"].toString())
: int.parse(json["patientID"].toString())),
visitType: json['visitType'] ?? json['visitType'] ?? json['visitType'],
nationalityFlagURL:
json['NationalityFlagURL'] ?? json['NationalityFlagURL'],

@ -58,6 +58,8 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
projectsProvider = Provider.of<ProjectViewModel>(context);
authenticationViewModel = Provider.of<AuthenticationViewModel>(context);
return AppScaffold(
isShowAppBar: false,
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
@ -553,6 +555,8 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
Helpers.showErrorToast(authenticationViewModel.error);
} else {
await authenticationViewModel.onCheckActivationCodeSuccess();
Navigator.pop(context);
Navigator.pop(context);
navigateToLandingPage();
}
}
@ -561,11 +565,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
if (authenticationViewModel.state == ViewState.ErrorLocal) {
Helpers.showErrorToast(authenticationViewModel.error);
} else {
Navigator.pushAndRemoveUntil(
context,
FadePage(
page: LandingPage(),
), (r) => false);
authenticationViewModel.setAppStatus(APP_STATUS.AUTHENTICATED);
}
}

@ -428,10 +428,11 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
Padding(
padding: const EdgeInsets.all(8.0),
child: AppText(
model.patientVitalSignsHistory.length > 0
model.patientVitalSignsHistory.length == 0
? TranslationBase.of(context).vitalSignEmptyMsg
: TranslationBase.of(context).chiefComplaintEmptyMsg,
fontWeight: FontWeight.normal,
textAlign: TextAlign.center,
color: HexColor("#B8382B"),
fontSize: SizeConfig.textMultiplier * 2.5,
),

@ -3,8 +3,8 @@ import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/profile/lab_result/laboratory_result_page.dart';
import 'package:doctor_app_flutter/screens/procedures/add_lab_home_screen.dart';
import 'package:doctor_app_flutter/screens/procedures/add_lab_orders.dart';
import 'package:doctor_app_flutter/screens/procedures/ProcedureType.dart';
import 'package:doctor_app_flutter/screens/procedures/base_add_procedure_tab_page.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrder.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart';
@ -27,6 +27,9 @@ class _LabsHomePageState extends State<LabsHomePage> {
String arrivalType;
PatiantInformtion patient;
bool isInpatient;
bool isFromLiveCare;
@override
void didChangeDependencies() {
super.didChangeDependencies();
@ -35,6 +38,8 @@ class _LabsHomePageState extends State<LabsHomePage> {
patientType = routeArgs['patientType'];
arrivalType = routeArgs['arrivalType'];
isInpatient = routeArgs['isInpatient'];
isFromLiveCare = routeArgs['isFromLiveCare'];
print(arrivalType);
}
@ -105,17 +110,20 @@ class _LabsHomePageState extends State<LabsHomePage> {
],
),
),
if (patient.patientStatusType != null &&
patient.patientStatusType == 43)
if ((patient.patientStatusType != null &&
patient.patientStatusType == 43) ||
(isFromLiveCare && patient.appointmentNo != null))
AddNewOrder(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => AddLabHomeScreen(
patient: patient,
model: model,
)),
builder: (context) => BaseAddProcedureTabPage(
patient: patient,
model: model,
procedureType: ProcedureType.LAB_RESULT,
),
),
);
},
label: TranslationBase.of(context).applyForNewLabOrder,

@ -89,17 +89,15 @@ class MedicalReportPage extends StatelessWidget {
...List.generate(
model.medicalReportList.length,
(index) => InkWell(
onTap: (){
if (model.medicalReportList[index].status ==
1) {
onTap: () {
if (model.medicalReportList[index].status == 1) {
Navigator.of(context).pushNamed(
PATIENT_MEDICAL_REPORT_DETAIL,
arguments: {
'patient': patient,
'patientType': patientType,
'arrivalType': arrivalType,
'medicalReport':
model.medicalReportList[index]
'medicalReport': model.medicalReportList[index]
});
} else {
Navigator.of(context).pushNamed(
@ -109,8 +107,7 @@ class MedicalReportPage extends StatelessWidget {
'patientType': patientType,
'arrivalType': arrivalType,
'type': MedicalReportStatus.ADD,
'medicalReport':
model.medicalReportList[index]
'medicalReport': model.medicalReportList[index]
});
}
},
@ -132,12 +129,13 @@ class MedicalReportPage extends StatelessWidget {
AppText(
model.medicalReportList[index].status == 1
? TranslationBase.of(context).onHold
: TranslationBase.of(context).verified,
color:
model.medicalReportList[index].status ==
1
? Colors.red[700]
: Colors.green[700],
: TranslationBase.of(context)
.verified,
color: model.medicalReportList[index]
.status ==
1
? Colors.red[700]
: Colors.green[700],
fontSize: 1.4 * SizeConfig.textMultiplier,
bold: true,
),
@ -173,37 +171,55 @@ class MedicalReportPage extends StatelessWidget {
],
),
Row(
crossAxisAlignment: CrossAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
margin: EdgeInsets.only(
left: 0, top: 4, right: 8, bottom: 0),
child: LargeAvatar(
name: projectViewModel.isArabic
? model
.medicalReportList[index].doctorNameN
: model
.medicalReportList[index].doctorName,
url: model
.medicalReportList[index].doctorImageURL,
? model.medicalReportList[index]
.doctorNameN
: model.medicalReportList[index]
.doctorName,
url: model.medicalReportList[index]
.doctorImageURL,
),
width: 50,
height: 50,
),
Expanded(
child: Container(
height: 50,
child: AppText(
TranslationBase.of(context).showDetail,
fontSize: 1.4 * SizeConfig.textMultiplier,
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
AppText(
projectViewModel.isArabic
? model.medicalReportList[index]
.projectNameN
: model.medicalReportList[index]
.projectName,
fontSize:
1.6 * SizeConfig.textMultiplier,
color: Color(0xFF2E303A),
),
AppText(
projectViewModel.isArabic
? model.medicalReportList[index]
.clinicNameN
: model.medicalReportList[index]
.clinicName,
fontSize:
1.6 * SizeConfig.textMultiplier,
color: Color(0xFF2E303A),
),
],
),
),
// child: Html(
// data: model.medicalReportList[index]
// .reportDataHtml ??
// ""),
),
Container(
height: 50,
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
children: [
@ -224,7 +240,9 @@ class MedicalReportPage extends StatelessWidget {
),
),
),
SizedBox(height: 15,)
SizedBox(
height: 15,
)
],
),
),

@ -290,11 +290,15 @@ class _PatientProfileScreenState extends State<PatientProfileScreen>
} else {
GifLoaderDialogUtils.showMyDialog(context);
await model.startCall( isReCall : false, vCID: patient.vcId);
if(model.state == ViewState.ErrorLocal) {
GifLoaderDialogUtils.hideDialog(context);
Helpers.showErrorToast(model.error);
} else {
await model.getDoctorProfile();
patient.appointmentNo = model.startCallRes.appointmentNo;
patient.episodeNo = 0;
GifLoaderDialogUtils.hideDialog(context);
await VideoChannel.openVideoCallScreen(
kToken: model.startCallRes.openTokenID,

@ -107,8 +107,8 @@ class ProfileGridForOther extends StatelessWidget {
PATIENT_UCAF_REQUEST,
'patient/ucaf.png',
isInPatient: isInpatient,
isDisable: patient.patientStatusType != 43 ||
patient.appointmentNo == null ? true : false),
isDisable: isFromLiveCare?patient.appointmentNo == null:patient.patientStatusType != 43 ||
patient.appointmentNo == null ),
if (isFromLiveCare ||
(patient.appointmentNo != null && patient.appointmentNo != 0))
PatientProfileCardModel(
@ -121,8 +121,9 @@ class ProfileGridForOther extends StatelessWidget {
REFER_PATIENT_TO_DOCTOR,
'patient/refer_patient.png',
isInPatient: isInpatient,
isDisable: patient.patientStatusType != 43 ||
patient.appointmentNo == null ? true : false),
isDisable: isFromLiveCare?patient.appointmentNo == null:patient.patientStatusType != 43 ||
patient.appointmentNo == null ,
),
if (isFromLiveCare ||
(patient.appointmentNo != null && patient.appointmentNo != 0))
PatientProfileCardModel(
@ -135,8 +136,9 @@ class ProfileGridForOther extends StatelessWidget {
PATIENT_ADMISSION_REQUEST,
'patient/admission_req.png',
isInPatient: isInpatient,
isDisable: patient.patientStatusType != 43 ||
patient.appointmentNo == null ? true : false),
isDisable: isFromLiveCare?patient.appointmentNo == null:patient.patientStatusType != 43 ||
patient.appointmentNo == null
),
];
return Column(

@ -3,8 +3,8 @@ import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/profile/radiology/radiology_details_page.dart';
import 'package:doctor_app_flutter/screens/procedures/add_radiology_order.dart';
import 'package:doctor_app_flutter/screens/procedures/add_radiology_screen.dart';
import 'package:doctor_app_flutter/screens/procedures/ProcedureType.dart';
import 'package:doctor_app_flutter/screens/procedures/base_add_procedure_tab_page.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrder.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart';
@ -100,9 +100,7 @@ class _RadiologyHomePageState extends State<RadiologyHomePage> {
fontSize: 13,
),
AppText(
TranslationBase
.of(context)
.result,
TranslationBase.of(context).result,
bold: true,
fontSize: 22,
),
@ -110,18 +108,19 @@ class _RadiologyHomePageState extends State<RadiologyHomePage> {
),
),
if ((patient.patientStatusType != null &&
patient.patientStatusType == 43) ||
patient.patientStatusType == 43) ||
(isFromLiveCare && patient.appointmentNo != null))
AddNewOrder(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
AddRadiologyScreen(
patient: patient,
model: model,
)),
builder: (context) => BaseAddProcedureTabPage(
patient: patient,
model: model,
procedureType: ProcedureType.RADIOLOGY,
),
),
);
},
label: TranslationBase.of(context).applyForRadiologyOrder,
@ -153,11 +152,18 @@ class _RadiologyHomePageState extends State<RadiologyHomePage> {
? Colors.black
: Color(0xffa9a089),
borderRadius: BorderRadius.only(
topLeft: 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),
bottomRight: projectViewModel.isArabic? Radius.circular(8):Radius.circular(0)
),
topLeft: 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),
bottomRight: projectViewModel.isArabic
? Radius.circular(8)
: Radius.circular(0)),
),
child: RotatedBox(
quarterTurns: 3,

@ -1,118 +0,0 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/model/procedure/procedure_template_details_model.dart';
import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/prescription/prescription_checkout_screen.dart';
import 'package:doctor_app_flutter/screens/procedures/entity_list_fav_procedure.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.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:doctor_app_flutter/widgets/shared/network_base_view.dart';
import 'package:flutter/material.dart';
class AddFavPrescription extends StatefulWidget {
final PrescriptionViewModel model;
final PatiantInformtion patient;
final String categoryID;
const AddFavPrescription({Key key, this.model, this.patient, this.categoryID}) : super(key: key);
@override
_AddFavPrescriptionState createState() => _AddFavPrescriptionState();
}
class _AddFavPrescriptionState extends State<AddFavPrescription> {
MedicineViewModel model;
PatiantInformtion patient;
List<ProcedureTempleteDetailsModel> entityList = List();
ProcedureTempleteDetailsModel groupProcedures;
@override
Widget build(BuildContext context) {
return BaseView<ProcedureViewModel>(
onModelReady: (model) => model.getProcedureTemplate(categoryID: widget.categoryID),
builder: (BuildContext context, ProcedureViewModel model, Widget child) => AppScaffold(
isShowAppBar: false,
baseViewModel: model,
body: Column(
children: [
Container(
height: MediaQuery.of(context).size.height * 0.070,
),
if (model.templateList.length != 0)
Expanded(
child: NetworkBaseView(
baseViewModel: model,
child: EntityListCheckboxSearchFavProceduresWidget(
isProcedure: false,
model: model,
removeFavProcedure: (item) {
setState(() {
entityList.remove(item);
});
},
addFavProcedure: (history) {
setState(() {
entityList.add(history);
});
},
isEntityFavListSelected: (master) => isEntityListSelected(master),
groupProcedures: groupProcedures,
selectProcedures: (valasd) {
setState(() {
groupProcedures = valasd;
});
},
),
),
),
Container(
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5),
child: Wrap(
alignment: WrapAlignment.center,
children: <Widget>[
AppButton(
title: 'Add Selected Prescription',
color: Color(0xff359846),
fontWeight: FontWeight.w700,
onPressed: () {
if (groupProcedures == null) {
DrAppToastMsg.showErrorToast(
'Please Select item ',
);
return;
}
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => PrescriptionCheckOutScreen(
patient: widget.patient,
model: widget.model,
groupProcedures: groupProcedures,
),
),
);
},
),
],
),
),
],
),
),
);
}
bool isEntityListSelected(ProcedureTempleteDetailsModel masterKey) {
Iterable<ProcedureTempleteDetailsModel> history = entityList.where(
(element) => masterKey.templateID == element.templateID && masterKey.procedureName == element.procedureName);
if (history.length > 0) {
return true;
}
return false;
}
}

@ -1,203 +0,0 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/prescription/add_favourite_prescription.dart';
import 'package:doctor_app_flutter/screens/prescription/add_prescription_form.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart';
import 'package:flutter/material.dart';
class PrescriptionHomeScreen extends StatefulWidget {
final PrescriptionViewModel model;
final PatiantInformtion patient;
const PrescriptionHomeScreen({Key key, this.model, this.patient}) : super(key: key);
@override
_PrescriptionHomeScreenState createState() => _PrescriptionHomeScreenState();
}
class _PrescriptionHomeScreenState extends State<PrescriptionHomeScreen> with SingleTickerProviderStateMixin {
PrescriptionViewModel model;
PatiantInformtion patient;
TabController _tabController;
int _activeTab = 0;
@override
void initState() {
super.initState();
_tabController = TabController(length: 2, vsync: this);
_tabController.addListener(_handleTabSelection);
}
@override
void dispose() {
super.dispose();
_tabController.dispose();
}
_handleTabSelection() {
setState(() {
_activeTab = _tabController.index;
});
}
@override
Widget build(BuildContext context) {
final screenSize = MediaQuery.of(context).size;
return BaseView<ProcedureViewModel>(
//onModelReady: (model) => model.getCategory(),
builder: (BuildContext context, ProcedureViewModel model, Widget child) => AppScaffold(
isShowAppBar: false,
body: NetworkBaseView(
baseViewModel: model,
child: DraggableScrollableSheet(
minChildSize: 0.90,
initialChildSize: 0.95,
maxChildSize: 1.0,
builder: (BuildContext context, ScrollController scrollController) {
return Container(
height: MediaQuery.of(context).size.height * 1.20,
child: Padding(
padding: EdgeInsets.all(12.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(children: [
InkWell(
child: Icon(
Icons.arrow_back_ios,
size: 24.0,
),
onTap: () {
Navigator.pop(context);
},
),
SizedBox(
width: 7.0,
),
AppText(
'Add prescription',
fontWeight: FontWeight.w700,
fontSize: 20,
),
]),
SizedBox(
height: MediaQuery.of(context).size.height * 0.04,
),
Expanded(
child: Scaffold(
extendBodyBehindAppBar: true,
appBar: PreferredSize(
preferredSize: Size.fromHeight(MediaQuery.of(context).size.height * 0.070),
child: Container(
height: MediaQuery.of(context).size.height * 0.070,
decoration: BoxDecoration(
border: Border(
bottom:
BorderSide(color: Theme.of(context).dividerColor, width: 0.5), //width: 0.7
),
color: Colors.white),
child: Center(
child: TabBar(
isScrollable: false,
controller: _tabController,
indicatorColor: Colors.transparent,
indicatorWeight: 1.0,
indicatorSize: TabBarIndicatorSize.tab,
labelColor: Theme.of(context).primaryColor,
labelPadding: EdgeInsets.only(top: 0, left: 0, right: 0, bottom: 0),
unselectedLabelColor: Colors.grey[800],
tabs: [
tabWidget(
screenSize,
_activeTab == 0,
"Favorite Templates",
),
tabWidget(
screenSize,
_activeTab == 1,
'All Prescription',
),
],
),
),
),
),
body: Column(
children: [
Expanded(
child: TabBarView(
physics: BouncingScrollPhysics(),
controller: _tabController,
children: [
AddFavPrescription(
model: widget.model,
patient: widget.patient,
categoryID: '55',
),
PrescriptionFormWidget(
widget.model, widget.patient, widget.model.prescriptionList),
],
),
),
],
),
),
),
],
),
),
);
}),
),
),
);
}
Widget tabWidget(Size screenSize, bool isActive, String title, {int counter = -1}) {
return Center(
child: Container(
height: screenSize.height * 0.070,
decoration: TextFieldsUtils.containerBorderDecoration(
isActive ? Color(0xFFD02127 /*B8382B*/) : Color(0xFFEAEAEA),
isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA),
borderRadius: 4,
borderWidth: 0),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
AppText(
title,
fontSize: SizeConfig.textMultiplier * 1.5,
color: isActive ? Colors.white : Color(0xFF2B353E),
fontWeight: FontWeight.w700,
),
if (counter != -1)
Container(
margin: EdgeInsets.all(4),
width: 15,
height: 15,
decoration: BoxDecoration(
color: isActive ? Colors.white : Color(0xFFD02127),
shape: BoxShape.circle,
),
child: Center(
child: FittedBox(
child: AppText(
"$counter",
fontSize: SizeConfig.textMultiplier * 1.5,
color: !isActive ? Colors.white : Color(0xFFD02127),
fontWeight: FontWeight.w700,
),
),
),
),
],
),
),
);
}
}

@ -1,4 +1,3 @@
import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart';
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/dialogs/dailog-list-select.dart';

@ -1,10 +1,10 @@
import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/prescription/add_prescription_form.dart';
import 'package:doctor_app_flutter/screens/prescription/prescription_home_screen.dart';
import 'package:doctor_app_flutter/screens/prescription/prescription_item_in_patient_page.dart';
import 'package:doctor_app_flutter/screens/prescription/prescription_items_page.dart';
import 'package:doctor_app_flutter/screens/procedures/ProcedureType.dart';
import 'package:doctor_app_flutter/screens/procedures/base_add_procedure_tab_page.dart';
import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrder.dart';
@ -50,7 +50,8 @@ class PrescriptionsPage extends StatelessWidget {
SizedBox(
height: 12,
),
if (model.prescriptionsList.isNotEmpty && patient.patientStatusType != 43)
if (model.prescriptionsList.isNotEmpty &&
patient.patientStatusType != 43)
Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
@ -70,7 +71,8 @@ class PrescriptionsPage extends StatelessWidget {
],
),
),
if (patient.patientStatusType != null && patient.patientStatusType == 43)
if (patient.patientStatusType != null &&
patient.patientStatusType == 43)
Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
@ -90,20 +92,25 @@ class PrescriptionsPage extends StatelessWidget {
],
),
),
if ((patient.patientStatusType != null && patient.patientStatusType == 43) ||
if ((patient.patientStatusType != null &&
patient.patientStatusType == 43) ||
(isFromLiveCare && patient.appointmentNo != null))
AddNewOrder(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => PrescriptionHomeScreen(
builder: (context) =>
BaseAddProcedureTabPage(
patient: patient,
model: model,
prescriptionModel: model,
procedureType:
ProcedureType.PRESCRIPTION,
)),
);
},
label: TranslationBase.of(context).applyForNewPrescriptionsOrder,
label: TranslationBase.of(context)
.applyForNewPrescriptionsOrder,
),
...List.generate(
model.prescriptionsList.length,
@ -112,7 +119,8 @@ class PrescriptionsPage extends StatelessWidget {
context,
FadePage(
page: PrescriptionItemsPage(
prescriptions: model.prescriptionsList[index],
prescriptions:
model.prescriptionsList[index],
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
@ -120,16 +128,22 @@ class PrescriptionsPage extends StatelessWidget {
),
),
child: DoctorCard(
doctorName: model.prescriptionsList[index].doctorName,
profileUrl: model.prescriptionsList[index].doctorImageURL,
doctorName:
model.prescriptionsList[index].doctorName,
profileUrl: model
.prescriptionsList[index].doctorImageURL,
branch: model.prescriptionsList[index].name,
clinic: model.prescriptionsList[index].clinicDescription,
clinic: model.prescriptionsList[index]
.clinicDescription,
isPrescriptions: true,
appointmentDate: AppDateUtils.getDateTimeFromServerFormat(
model.prescriptionsList[index].appointmentDate,
appointmentDate:
AppDateUtils.getDateTimeFromServerFormat(
model.prescriptionsList[index]
.appointmentDate,
),
))),
if (model.prescriptionsList.isEmpty && patient.patientStatusType != 43)
if (model.prescriptionsList.isEmpty &&
patient.patientStatusType != 43)
Center(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
@ -140,7 +154,8 @@ class PrescriptionsPage extends StatelessWidget {
Image.asset('assets/images/no-data.png'),
Padding(
padding: const EdgeInsets.all(8.0),
child: AppText(TranslationBase.of(context).noPrescriptionsFound),
child: AppText(TranslationBase.of(context)
.noPrescriptionsFound),
)
],
),
@ -165,29 +180,38 @@ class PrescriptionsPage extends StatelessWidget {
FadePage(
page: PrescriptionItemsInPatientPage(
prescriptionIndex: index,
prescriptions: model.inPatientPrescription[index],
prescriptions: model
.inPatientPrescription[index],
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
startOn: AppDateUtils.getDateTimeFromServerFormat(
model.inPatientPrescription[index].startDatetime,
startOn: AppDateUtils
.getDateTimeFromServerFormat(
model.inPatientPrescription[index]
.startDatetime,
),
stopOn: AppDateUtils.getDateTimeFromServerFormat(
model.inPatientPrescription[index].stopDatetime,
stopOn: AppDateUtils
.getDateTimeFromServerFormat(
model.inPatientPrescription[index]
.stopDatetime,
),
),
),
),
child: InPatientDoctorCard(
doctorName: model.inPatientPrescription[index].itemDescription,
doctorName: model.inPatientPrescription[index]
.itemDescription,
profileUrl: 'sss',
branch: 'hamza',
clinic: 'basheer',
isPrescriptions: true,
appointmentDate: AppDateUtils.getDateTimeFromServerFormat(
model.inPatientPrescription[index].prescriptionDatetime,
appointmentDate:
AppDateUtils.getDateTimeFromServerFormat(
model.inPatientPrescription[index]
.prescriptionDatetime,
),
createdBy: model.inPatientPrescription[index].createdByName,
createdBy: model.inPatientPrescription[index]
.createdByName,
))),
if (model.inPatientPrescription.length == 0)
Center(
@ -200,7 +224,8 @@ class PrescriptionsPage extends StatelessWidget {
Image.asset('assets/images/no-data.png'),
Padding(
padding: const EdgeInsets.all(8.0),
child: AppText(TranslationBase.of(context).noPrescriptionsFound),
child: AppText(TranslationBase.of(context)
.noPrescriptionsFound),
)
],
),

@ -0,0 +1,88 @@
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:flutter/material.dart';
enum ProcedureType {
PROCEDURE,
LAB_RESULT,
RADIOLOGY,
PRESCRIPTION,
}
extension procedureType on ProcedureType {
String getFavouriteTabName(BuildContext context) {
return TranslationBase.of(context).favoriteTemplates;
}
String getAllLabelName(BuildContext context) {
switch (this) {
case ProcedureType.PROCEDURE:
return TranslationBase.of(context).allProcedures;
case ProcedureType.LAB_RESULT:
return TranslationBase.of(context).allLab;
case ProcedureType.RADIOLOGY:
return TranslationBase.of(context).allRadiology;
case ProcedureType.PRESCRIPTION:
return TranslationBase.of(context).allPrescription;
default:
return "";
}
}
String getToolbarLabel(BuildContext context) {
switch (this) {
case ProcedureType.PROCEDURE:
return TranslationBase.of(context).addProcedures;
case ProcedureType.LAB_RESULT:
return TranslationBase.of(context).addLabOrder;
case ProcedureType.RADIOLOGY:
return TranslationBase.of(context).addRadiologyOrder;
case ProcedureType.PRESCRIPTION:
return TranslationBase.of(context).addPrescription;
default:
return "";
}
}
String getAddButtonTitle(BuildContext context) {
switch (this) {
case ProcedureType.PROCEDURE:
return TranslationBase.of(context).addProcedures;
case ProcedureType.LAB_RESULT:
return TranslationBase.of(context).addLabOrder;
case ProcedureType.RADIOLOGY:
return TranslationBase.of(context).addRadiologyOrder;
case ProcedureType.PRESCRIPTION:
return TranslationBase.of(context).addPrescription;
default:
return "";
}
}
String getCategoryId() {
switch (this) {
case ProcedureType.PROCEDURE:
return null;
case ProcedureType.LAB_RESULT:
return "02";
case ProcedureType.RADIOLOGY:
return "03";
case ProcedureType.PRESCRIPTION:
return "55";
default:
return null;
}
}
String getCategoryName() {
switch (this) {
case ProcedureType.PROCEDURE:
return null;
case ProcedureType.LAB_RESULT:
return "Laboratory";
case ProcedureType.RADIOLOGY:
return "Radiology";
default:
return null;
}
}
}

@ -1,12 +1,10 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart';
import 'package:doctor_app_flutter/core/model/procedure/procedure_templateModel.dart';
import 'package:doctor_app_flutter/core/model/procedure/procedure_template_details_model.dart';
import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/procedures/add_procedure_homeScreen.dart';
import 'package:doctor_app_flutter/screens/procedures/entity_list_checkbox_search_widget.dart';
import 'package:doctor_app_flutter/screens/prescription/prescription_checkout_screen.dart';
import 'package:doctor_app_flutter/screens/procedures/entity_list_fav_procedure.dart';
import 'package:doctor_app_flutter/screens/procedures/procedure_checkout_screen.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
@ -17,20 +15,21 @@ import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'ProcedureType.dart';
class AddFavouriteProcedure extends StatefulWidget {
final ProcedureViewModel model;
final PrescriptionViewModel prescriptionModel;
final PatiantInformtion patient;
final String categoryID;
final String addButtonTitle;
final String toolbarTitle;
final ProcedureType procedureType;
AddFavouriteProcedure(
{Key key,
this.model,
this.patient,
this.categoryID,
@required this.addButtonTitle,
@required this.toolbarTitle});
AddFavouriteProcedure({
Key key,
this.model,
this.prescriptionModel,
this.patient,
@required this.procedureType,
});
@override
_AddFavouriteProcedureState createState() => _AddFavouriteProcedureState();
@ -42,12 +41,13 @@ class _AddFavouriteProcedureState extends State<AddFavouriteProcedure> {
ProcedureViewModel model;
PatiantInformtion patient;
List<ProcedureTempleteDetailsModel> entityList = List();
ProcedureTempleteDetailsModel groupProcedures;
@override
Widget build(BuildContext context) {
return BaseView<ProcedureViewModel>(
onModelReady: (model) =>
model.getProcedureTemplate(categoryID: widget.categoryID),
model.getProcedureTemplate(categoryID: widget.procedureType.getCategoryId()),
builder: (BuildContext context, ProcedureViewModel model, Widget child) =>
AppScaffold(
isShowAppBar: false,
@ -59,23 +59,27 @@ class _AddFavouriteProcedureState extends State<AddFavouriteProcedure> {
),
if (model.templateList.length != 0)
Expanded(
child: NetworkBaseView(
baseViewModel: model,
child: EntityListCheckboxSearchFavProceduresWidget(
model: model,
removeFavProcedure: (item) {
setState(() {
entityList.remove(item);
});
},
addFavProcedure: (history) {
setState(() {
entityList.add(history);
});
},
isEntityFavListSelected: (master) =>
isEntityListSelected(master),
),
child: EntityListCheckboxSearchFavProceduresWidget(
isProcedure: !(widget.procedureType == ProcedureType.PRESCRIPTION),
model: model,
removeFavProcedure: (item) {
setState(() {
entityList.remove(item);
});
},
addFavProcedure: (history) {
setState(() {
entityList.add(history);
});
},
isEntityFavListSelected: (master) =>
isEntityListSelected(master),
groupProcedures: groupProcedures,
selectProcedures: (selectedProcedure) {
setState(() {
groupProcedures = selectedProcedure;
});
},
),
),
Container(
@ -84,31 +88,50 @@ class _AddFavouriteProcedureState extends State<AddFavouriteProcedure> {
alignment: WrapAlignment.center,
children: <Widget>[
AppButton(
title: widget.addButtonTitle ??
title: widget.procedureType.getAddButtonTitle(context) ??
TranslationBase.of(context).addSelectedProcedures,
color: Color(0xff359846),
fontWeight: FontWeight.w700,
onPressed: () {
if (entityList.isEmpty == true) {
DrAppToastMsg.showErrorToast(
TranslationBase.of(context)
.fillTheMandatoryProcedureDetails,
);
return;
}
if(widget.procedureType == ProcedureType.PRESCRIPTION){
if (groupProcedures == null) {
DrAppToastMsg.showErrorToast(
'Please Select item ',
);
return;
}
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => ProcedureCheckOutScreen(
items: entityList,
model: model,
patient: widget.patient,
addButtonTitle: widget.addButtonTitle,
toolbarTitle: widget.toolbarTitle,
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => PrescriptionCheckOutScreen(
patient: widget.patient,
model: widget.prescriptionModel,
groupProcedures: groupProcedures,
),
),
);
} else {
if (entityList.isEmpty == true) {
DrAppToastMsg.showErrorToast(
TranslationBase.of(context)
.fillTheMandatoryProcedureDetails,
);
return;
}
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => ProcedureCheckOutScreen(
items: entityList,
model: model,
patient: widget.patient,
addButtonTitle: widget.procedureType.getAddButtonTitle(context),
toolbarTitle: widget.procedureType.getToolbarLabel(context),
),
),
),
);
);
}
},
),
],

@ -1,355 +0,0 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/procedure/ControlsModel.dart';
import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart';
import 'package:doctor_app_flutter/core/model/procedure/post_procedure_req_model.dart';
import 'package:doctor_app_flutter/core/model/procedure/procedure_valadate_request_model.dart';
import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
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/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
import 'package:flutter/material.dart';
import 'entity_list_checkbox_search_widget.dart';
valdateProcedure(ProcedureViewModel model, PatiantInformtion patient,
List<EntityList> entityList) async {
ProcedureValadteRequestModel procedureValadteRequestModel =
new ProcedureValadteRequestModel();
procedureValadteRequestModel.patientMRN = patient.appointmentNo;
procedureValadteRequestModel.episodeID = patient.episodeNo;
procedureValadteRequestModel.appointmentNo = patient.appointmentNo;
}
postProcedure(
{ProcedureViewModel model,
String remarks,
String orderType,
PatiantInformtion patient,
List<EntityList> entityList}) async {
PostProcedureReqModel postProcedureReqModel = new PostProcedureReqModel();
ProcedureValadteRequestModel procedureValadteRequestModel =
new ProcedureValadteRequestModel();
procedureValadteRequestModel.patientMRN = patient.patientMRN;
procedureValadteRequestModel.episodeID = patient.episodeNo;
procedureValadteRequestModel.appointmentNo = patient.appointmentNo;
List<Procedures> controlsProcedure = List();
postProcedureReqModel.appointmentNo = patient.appointmentNo;
postProcedureReqModel.episodeID = patient.episodeNo;
postProcedureReqModel.patientMRN = patient.patientMRN;
entityList.forEach((element) {
procedureValadteRequestModel.procedure = [element.procedureId];
List<Controls> controls = List();
controls.add(
Controls(
code: "remarks",
controlValue: element.remarks != null ? element.remarks : ""),
);
controls.add(
Controls(code: "ordertype", controlValue: element.type ?? "1"),
);
controlsProcedure.add(Procedures(
category: element.categoryID,
procedure: element.procedureId,
controls: controls));
});
postProcedureReqModel.procedures = controlsProcedure;
await model.valadteProcedure(procedureValadteRequestModel);
if (model.state == ViewState.Idle) {
if (model.valadteProcedureList[0].entityList.length == 0) {
await model.postProcedure(postProcedureReqModel, patient.patientMRN);
if (model.state == ViewState.ErrorLocal) {
Helpers.showErrorToast(model.error);
model.getProcedure(mrn: patient.patientMRN);
} else if (model.state == ViewState.Idle) {
DrAppToastMsg.showSuccesToast('procedure has been added');
}
} else {
if (model.state == ViewState.ErrorLocal) {
Helpers.showErrorToast(model.error);
model.getProcedure(mrn: patient.patientMRN);
} else if (model.state == ViewState.Idle) {
Helpers.showErrorToast(
model.valadteProcedureList[0].entityList[0].warringMessages);
}
}
} else {
Helpers.showErrorToast(model.error);
}
}
void addSelectedProcedure(
context, ProcedureViewModel model, PatiantInformtion patient) {
showModalBottomSheet(
context: context,
isScrollControlled: true,
builder: (BuildContext bc) {
return AddSelectedProcedure(
model: model,
patient: patient,
);
});
}
class AddSelectedProcedure extends StatefulWidget {
final ProcedureViewModel model;
final PatiantInformtion patient;
const AddSelectedProcedure({Key key, this.model, this.patient})
: super(key: key);
@override
_AddSelectedProcedureState createState() =>
_AddSelectedProcedureState(patient: patient, model: model);
}
class _AddSelectedProcedureState extends State<AddSelectedProcedure> {
int selectedType;
ProcedureViewModel model;
PatiantInformtion patient;
_AddSelectedProcedureState({this.patient, this.model});
TextEditingController procedureController = TextEditingController();
TextEditingController remarksController = TextEditingController();
List<EntityList> entityList = List();
List<EntityList> entityListProcedure = List();
TextEditingController procedureName = TextEditingController();
dynamic selectedCategory;
setSelectedType(int val) {
setState(() {
selectedType = val;
});
}
@override
Widget build(BuildContext context) {
return BaseView<ProcedureViewModel>(
builder: (BuildContext context, ProcedureViewModel model, Widget child) =>
AppScaffold(
isShowAppBar: false,
body: Column(
children: [
Container(
height: MediaQuery.of(context).size.height * 0.070,
),
Expanded(
child: NetworkBaseView(
baseViewModel: model,
child: DraggableScrollableSheet(
minChildSize: 0.90,
initialChildSize: 0.95,
maxChildSize: 1.0,
builder: (BuildContext context,
ScrollController scrollController) {
return SingleChildScrollView(
child: Container(
height: MediaQuery.of(context).size.height * 1.20,
child: Padding(
padding: EdgeInsets.all(12.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
AppText(
TranslationBase.of(context)
.pleaseEnterProcedure,
fontWeight: FontWeight.w700,
fontSize: 20,
),
]),
SizedBox(
height:
MediaQuery.of(context).size.height * 0.04,
),
Row(
children: [
Container(
width: MediaQuery.of(context).size.width *
0.79,
child: AppTextFieldCustom(
hintText: TranslationBase.of(context)
.searchProcedureHere,
isTextFieldHasSuffix: false,
maxLines: 1,
minLines: 1,
hasBorder: true,
controller: procedureName,
// onSubmitted: (_) {
// model.getProcedureCategory(
// categoryName: procedureName.text);
// },
onClick: () {
if (procedureName.text.isNotEmpty &&
procedureName.text.length >= 3)
model.getProcedureCategory(
patientId: patient.patientId,
categoryName:
procedureName.text);
else
DrAppToastMsg.showErrorToast(
TranslationBase.of(context)
.atLeastThreeCharacters,
);
},
),
),
SizedBox(
width: MediaQuery.of(context).size.width *
0.02,
),
Expanded(
child: InkWell(
onTap: () {
if (procedureName.text.isNotEmpty &&
procedureName.text.length >= 3)
model.getProcedureCategory(
patientId: patient.patientId,
categoryName: procedureName.text);
else
DrAppToastMsg.showErrorToast(
TranslationBase.of(context)
.atLeastThreeCharacters,
);
},
child: Icon(
Icons.search,
size: 25.0,
),
),
),
],
),
if (procedureName.text.isNotEmpty &&
model.procedureList.length != 0)
NetworkBaseView(
baseViewModel: model,
child: EntityListCheckboxSearchWidget(
model: widget.model,
masterList: widget
.model.categoriesList[0].entityList,
removeHistory: (item) {
setState(() {
entityList.remove(item);
});
},
addHistory: (history) {
setState(() {
entityList.add(history);
});
},
addSelectedHistories: () {
//TODO build your fun herr
// widget.addSelectedHistories();
},
isEntityListSelected: (master) =>
isEntityListSelected(master),
)),
SizedBox(
height: 115.0,
),
],
),
),
),
);
}),
),
),
Container(
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5),
child: Wrap(
alignment: WrapAlignment.center,
children: <Widget>[
AppButton(
title: TranslationBase.of(context).addSelectedProcedures,
color: Color(0xff359846),
fontWeight: FontWeight.w700,
onPressed: () {
if (entityList.isEmpty == true) {
DrAppToastMsg.showErrorToast(
TranslationBase.of(context)
.fillTheMandatoryProcedureDetails,
);
return;
}
Navigator.pop(context);
postProcedure(
orderType: selectedType.toString(),
entityList: entityList,
patient: patient,
model: widget.model,
remarks: remarksController.text);
},
),
],
),
),
],
),
),
);
}
bool isEntityListSelected(EntityList masterKey) {
Iterable<EntityList> history = entityList
.where((element) => masterKey.procedureId == element.procedureId);
if (history.length > 0) {
return true;
}
return false;
}
InputDecoration textFieldSelectorDecoration(
String hintText, String selectedText, bool isDropDown,
{Icon suffixIcon}) {
return InputDecoration(
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
disabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
hintText: selectedText != null ? selectedText : hintText,
suffixIcon: isDropDown
? suffixIcon != null
? suffixIcon
: Icon(
Icons.arrow_drop_down,
color: Colors.black,
)
: null,
hintStyle: TextStyle(
fontSize: 14,
color: Colors.grey.shade600,
),
);
}
}

@ -0,0 +1,221 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart';
import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.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/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
import 'package:flutter/material.dart';
import 'ProcedureType.dart';
import 'entity_list_checkbox_search_widget.dart';
class AddProcedurePage extends StatefulWidget {
final ProcedureViewModel model;
final PatiantInformtion patient;
final ProcedureType procedureType;
const AddProcedurePage(
{Key key, this.model, this.patient, @required this.procedureType})
: super(key: key);
@override
_AddProcedurePageState createState() => _AddProcedurePageState(
patient: patient, model: model, procedureType: this.procedureType);
}
class _AddProcedurePageState extends State<AddProcedurePage> {
int selectedType;
ProcedureViewModel model;
PatiantInformtion patient;
ProcedureType procedureType;
_AddProcedurePageState({this.patient, this.model, this.procedureType});
TextEditingController procedureController = TextEditingController();
TextEditingController remarksController = TextEditingController();
List<EntityList> entityList = List();
List<EntityList> entityListProcedure = List();
TextEditingController procedureName = TextEditingController();
dynamic selectedCategory;
setSelectedType(int val) {
setState(() {
selectedType = val;
});
}
@override
Widget build(BuildContext context) {
return BaseView<ProcedureViewModel>(
onModelReady: (model) {
model.getProcedureCategory(
categoryName: procedureType.getCategoryName(),
categoryID: procedureType.getCategoryId(),
patientId: patient.patientId);
},
builder: (BuildContext context, ProcedureViewModel model, Widget child) =>
AppScaffold(
isShowAppBar: false,
body: Column(
children: [
Container(
height: MediaQuery.of(context).size.height * 0.070,
),
Expanded(
child: NetworkBaseView(
baseViewModel: model,
child: SingleChildScrollView(
child: Container(
child: Padding(
padding: EdgeInsets.all(12.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
if (procedureType == ProcedureType.PROCEDURE)
Column(
children: [
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
AppText(
TranslationBase.of(context)
.pleaseEnterProcedure,
fontWeight: FontWeight.w700,
fontSize: 20,
),
],
),
SizedBox(
height:
MediaQuery.of(context).size.height * 0.02,
),
Row(
children: [
Container(
width: MediaQuery.of(context).size.width *
0.79,
child: AppTextFieldCustom(
hintText: TranslationBase.of(context)
.searchProcedureHere,
isTextFieldHasSuffix: false,
maxLines: 1,
minLines: 1,
hasBorder: true,
controller: procedureName,
),
),
SizedBox(
width: MediaQuery.of(context).size.width *
0.02,
),
Expanded(
child: InkWell(
onTap: () {
if (procedureName.text.isNotEmpty &&
procedureName.text.length >= 3)
model.getProcedureCategory(
patientId: patient.patientId,
categoryName:
procedureName.text);
else
DrAppToastMsg.showErrorToast(
TranslationBase.of(context)
.atLeastThreeCharacters,
);
},
child: Icon(
Icons.search,
size: 25.0,
),
),
),
],
),
],
),
if ((procedureType == ProcedureType.PROCEDURE
? procedureName.text.isNotEmpty
: true) &&
model.categoriesList.length != 0)
NetworkBaseView(
baseViewModel: model,
child: EntityListCheckboxSearchWidget(
model: widget.model,
masterList:
model.categoriesList[0].entityList,
removeHistory: (item) {
setState(() {
entityList.remove(item);
});
},
addHistory: (history) {
setState(() {
entityList.add(history);
});
},
addSelectedHistories: () {
//TODO build your fun herr
// widget.addSelectedHistories();
},
isEntityListSelected: (master) =>
isEntityListSelected(master),
)),
],
),
),
),
),
),
),
Container(
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5),
child: Wrap(
alignment: WrapAlignment.center,
children: <Widget>[
AppButton(
title: procedureType.getAddButtonTitle(context),
fontWeight: FontWeight.w700,
color: Color(0xff359846),
onPressed: () async {
if (entityList.isEmpty == true) {
DrAppToastMsg.showErrorToast(
TranslationBase.of(context)
.fillTheMandatoryProcedureDetails,
);
return;
}
await this.model.preparePostProcedure(
orderType: selectedType.toString(),
entityList: entityList,
patient: patient,
remarks: remarksController.text);
Navigator.pop(context);
},
),
],
),
),
],
),
),
);
}
bool isEntityListSelected(EntityList masterKey) {
Iterable<EntityList> history = entityList
.where((element) => masterKey.procedureId == element.procedureId);
if (history.length > 0) {
return true;
}
return false;
}
}

@ -1,218 +0,0 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/procedures/add-favourite-procedure.dart';
import 'package:doctor_app_flutter/screens/procedures/add-procedure-form.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/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'add_lab_orders.dart';
class AddLabHomeScreen extends StatefulWidget {
final ProcedureViewModel model;
final PatiantInformtion patient;
const AddLabHomeScreen({Key key, this.model, this.patient}) : super(key: key);
@override
_AddLabHomeScreenState createState() =>
_AddLabHomeScreenState(patient: patient, model: model);
}
class _AddLabHomeScreenState extends State<AddLabHomeScreen>
with SingleTickerProviderStateMixin {
_AddLabHomeScreenState({this.patient, this.model});
ProcedureViewModel model;
PatiantInformtion patient;
TabController _tabController;
int _activeTab = 0;
@override
void initState() {
super.initState();
_tabController = TabController(length: 2, vsync: this);
_tabController.addListener(_handleTabSelection);
}
@override
void dispose() {
super.dispose();
_tabController.dispose();
}
_handleTabSelection() {
setState(() {
_activeTab = _tabController.index;
});
}
@override
Widget build(BuildContext context) {
final screenSize = MediaQuery.of(context).size;
return BaseView<ProcedureViewModel>(
builder: (BuildContext context, ProcedureViewModel model, Widget child) =>
AppScaffold(
isShowAppBar: false,
body: NetworkBaseView(
baseViewModel: model,
child: DraggableScrollableSheet(
minChildSize: 0.90,
initialChildSize: 0.95,
maxChildSize: 1.0,
builder:
(BuildContext context, ScrollController scrollController) {
return Container(
height: MediaQuery.of(context).size.height * 1.20,
child: Padding(
padding: EdgeInsets.all(12.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
AppText(
'Add Procedure',
fontWeight: FontWeight.w700,
fontSize: 20,
),
InkWell(
child: Icon(
Icons.close,
size: 24.0,
),
onTap: () {
Navigator.pop(context);
},
)
]),
SizedBox(
height: MediaQuery.of(context).size.height * 0.04,
),
Expanded(
child: Scaffold(
extendBodyBehindAppBar: true,
appBar: PreferredSize(
preferredSize: Size.fromHeight(
MediaQuery.of(context).size.height * 0.070),
child: Container(
height:
MediaQuery.of(context).size.height * 0.070,
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: Theme.of(context).dividerColor,
width: 0.5), //width: 0.7
),
color: Colors.white),
child: Center(
child: TabBar(
isScrollable: false,
controller: _tabController,
indicatorColor: Colors.transparent,
indicatorWeight: 1.0,
indicatorSize: TabBarIndicatorSize.tab,
labelColor: Theme.of(context).primaryColor,
labelPadding: EdgeInsets.only(
top: 0, left: 0, right: 0, bottom: 0),
unselectedLabelColor: Colors.grey[800],
tabs: [
tabWidget(
screenSize,
_activeTab == 0,
"Favorite Templates",
),
tabWidget(
screenSize,
_activeTab == 1,
'All Lab',
),
],
),
),
),
),
body: Column(
children: [
Expanded(
child: TabBarView(
physics: BouncingScrollPhysics(),
controller: _tabController,
children: [
AddFavouriteProcedure(
patient: patient,
model: model,
addButtonTitle: TranslationBase.of(context).addLabOrder,
toolbarTitle: TranslationBase.of(context).applyForNewLabOrder,
categoryID: "02",
),
AddSelectedLabOrder(
model: model,
patient: patient,
),
],
),
),
],
),
),
),
],
),
),
);
}),
),
),
);
}
Widget tabWidget(Size screenSize, bool isActive, String title,
{int counter = -1}) {
return Center(
child: Container(
height: screenSize.height * 0.070,
decoration: TextFieldsUtils.containerBorderDecoration(
isActive ? Color(0xFFD02127 /*B8382B*/) : Color(0xFFEAEAEA),
isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA),
borderRadius: 4,
borderWidth: 0),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
AppText(
title,
fontSize: SizeConfig.textMultiplier * 1.5,
color: isActive ? Colors.white : Color(0xFF2B353E),
fontWeight: FontWeight.w700,
),
if (counter != -1)
Container(
margin: EdgeInsets.all(4),
width: 15,
height: 15,
decoration: BoxDecoration(
color: isActive ? Colors.white : Color(0xFFD02127),
shape: BoxShape.circle,
),
child: Center(
child: FittedBox(
child: AppText(
"$counter",
fontSize: SizeConfig.textMultiplier * 1.5,
color: !isActive ? Colors.white : Color(0xFFD02127),
fontWeight: FontWeight.w700,
),
),
),
),
],
),
),
);
}
}

@ -1,269 +0,0 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/procedure/ControlsModel.dart';
import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart';
import 'package:doctor_app_flutter/core/model/procedure/post_procedure_req_model.dart';
import 'package:doctor_app_flutter/core/model/procedure/procedure_valadate_request_model.dart';
import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
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/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
import 'package:flutter/material.dart';
import 'entity_list_checkbox_search_widget.dart';
valdateProcedure(ProcedureViewModel model, PatiantInformtion patient,
List<EntityList> entityList) async {
ProcedureValadteRequestModel procedureValadteRequestModel =
new ProcedureValadteRequestModel();
procedureValadteRequestModel.patientMRN = patient.appointmentNo;
procedureValadteRequestModel.episodeID = patient.episodeNo;
procedureValadteRequestModel.appointmentNo = patient.appointmentNo;
}
postProcedure(
{ProcedureViewModel model,
String remarks,
String orderType,
PatiantInformtion patient,
List<EntityList> entityList}) async {
PostProcedureReqModel postProcedureReqModel = new PostProcedureReqModel();
ProcedureValadteRequestModel procedureValadteRequestModel =
new ProcedureValadteRequestModel();
procedureValadteRequestModel.patientMRN = patient.patientMRN;
procedureValadteRequestModel.episodeID = patient.episodeNo;
procedureValadteRequestModel.appointmentNo = patient.appointmentNo;
List<Procedures> controlsProcedure = List();
postProcedureReqModel.appointmentNo = patient.appointmentNo;
postProcedureReqModel.episodeID = patient.episodeNo;
postProcedureReqModel.patientMRN = patient.patientMRN;
entityList.forEach((element) {
procedureValadteRequestModel.procedure = [element.procedureId];
List<Controls> controls = List();
controls.add(
Controls(
code: "remarks",
controlValue: element.remarks != null ? element.remarks : ""),
);
controls.add(
Controls(code: "ordertype", controlValue: "0"),
);
controlsProcedure.add(Procedures(
category: element.categoryID,
procedure: element.procedureId,
controls: controls));
});
postProcedureReqModel.procedures = controlsProcedure;
await model.valadteProcedure(procedureValadteRequestModel);
if (model.state == ViewState.Idle) {
if (model.valadteProcedureList[0].entityList.length == 0) {
await model.postProcedure(postProcedureReqModel, patient.patientMRN);
if (model.state == ViewState.ErrorLocal) {
Helpers.showErrorToast(model.error);
model.getLabs(patient);
} else if (model.state == ViewState.Idle) {
DrAppToastMsg.showSuccesToast('procedure has been added');
}
} else {
if (model.state == ViewState.ErrorLocal) {
Helpers.showErrorToast(model.error);
model.getLabs(patient);
} else if (model.state == ViewState.Idle) {
Helpers.showErrorToast(
model.valadteProcedureList[0].entityList[0].warringMessages);
}
}
} else {
Helpers.showErrorToast(model.error);
}
}
void addSelectedLabOrder(
context, ProcedureViewModel model, PatiantInformtion patient) {
showModalBottomSheet(
context: context,
isScrollControlled: true,
builder: (BuildContext bc) {
return AddSelectedLabOrder(
model: model,
patient: patient,
);
});
}
class AddSelectedLabOrder extends StatefulWidget {
final ProcedureViewModel model;
final PatiantInformtion patient;
const AddSelectedLabOrder({Key key, this.model, this.patient})
: super(key: key);
@override
_AddSelectedLabOrderState createState() =>
_AddSelectedLabOrderState(patient: patient, model: model);
}
class _AddSelectedLabOrderState extends State<AddSelectedLabOrder> {
int selectedType;
ProcedureViewModel model;
PatiantInformtion patient;
_AddSelectedLabOrderState({this.patient, this.model});
TextEditingController procedureController = TextEditingController();
TextEditingController remarksController = TextEditingController();
List<EntityList> entityList = List();
List<EntityList> entityListProcedure = List();
dynamic selectedCategory;
setSelectedType(int val) {
setState(() {
selectedType = val;
});
}
@override
Widget build(BuildContext context) {
final screenSize = MediaQuery.of(context).size;
return BaseView<ProcedureViewModel>(
onModelReady: (model) => model.getProcedureCategory(
categoryName: "Laboratory", categoryID: "02",patientId: patient.patientId),
builder: (BuildContext context, ProcedureViewModel model, Widget child) =>
AppScaffold(
isShowAppBar: false,
body: NetworkBaseView(
baseViewModel: model,
child: DraggableScrollableSheet(
minChildSize: 0.90,
initialChildSize: 0.95,
maxChildSize: 1.0,
builder:
(BuildContext context, ScrollController scrollController) {
return SingleChildScrollView(
child: Container(
height: MediaQuery.of(context).size.height * .90,
child: Padding(
padding: EdgeInsets.all(12.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 10.0,
),
if (widget.model.categoriesList.length != 0)
NetworkBaseView(
baseViewModel: model,
child: EntityListCheckboxSearchWidget(
model: widget.model,
masterList:
widget.model.categoriesList[0].entityList,
removeHistory: (item) {
setState(() {
entityList.remove(item);
});
},
addHistory: (history) {
setState(() {
entityList.add(history);
});
},
addSelectedHistories: () {
//TODO build your fun herr
// widget.addSelectedHistories();
},
isEntityListSelected: (master) =>
isEntityListSelected(master),
)),
],
),
),
),
);
}),
),
bottomSheet: Container(
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5),
child: Wrap(
alignment: WrapAlignment.center,
children: <Widget>[
AppButton(
title: TranslationBase.of(context).addLabOrder,
fontWeight: FontWeight.w700,
color: Color(0xff359846),
onPressed: () {
if (entityList.isEmpty == true) {
DrAppToastMsg.showErrorToast(
TranslationBase.of(context)
.fillTheMandatoryProcedureDetails,
);
return;
}
Navigator.pop(context);
postProcedure(
orderType: selectedType.toString(),
entityList: entityList,
patient: patient,
model: widget.model,
remarks: remarksController.text);
},
),
],
),
),
),
);
}
bool isEntityListSelected(EntityList masterKey) {
Iterable<EntityList> history = entityList
.where((element) => masterKey.procedureId == element.procedureId);
if (history.length > 0) {
return true;
}
return false;
}
InputDecoration textFieldSelectorDecoration(
String hintText, String selectedText, bool isDropDown,
{Icon suffixIcon}) {
return InputDecoration(
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
disabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
hintText: selectedText != null ? selectedText : hintText,
suffixIcon: isDropDown
? suffixIcon != null
? suffixIcon
: Icon(
Icons.arrow_drop_down,
color: Colors.black,
)
: null,
hintStyle: TextStyle(
fontSize: 14,
color: Colors.grey.shade600,
),
);
}
}

@ -1,270 +0,0 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/procedure/ControlsModel.dart';
import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart';
import 'package:doctor_app_flutter/core/model/procedure/post_procedure_req_model.dart';
import 'package:doctor_app_flutter/core/model/procedure/procedure_valadate_request_model.dart';
import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
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/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
import 'package:flutter/material.dart';
import 'entity_list_checkbox_search_widget.dart';
valdateProcedure(ProcedureViewModel model, PatiantInformtion patient,
List<EntityList> entityList) async {
ProcedureValadteRequestModel procedureValadteRequestModel =
new ProcedureValadteRequestModel();
procedureValadteRequestModel.patientMRN = patient.appointmentNo;
procedureValadteRequestModel.episodeID = patient.episodeNo;
procedureValadteRequestModel.appointmentNo = patient.appointmentNo;
}
postProcedure(
{ProcedureViewModel model,
String remarks,
String orderType,
PatiantInformtion patient,
List<EntityList> entityList}) async {
PostProcedureReqModel postProcedureReqModel = new PostProcedureReqModel();
ProcedureValadteRequestModel procedureValadteRequestModel =
new ProcedureValadteRequestModel();
procedureValadteRequestModel.patientMRN = patient.patientMRN;
procedureValadteRequestModel.episodeID = patient.episodeNo;
procedureValadteRequestModel.appointmentNo = patient.appointmentNo;
List<Procedures> controlsProcedure = List();
postProcedureReqModel.appointmentNo = patient.appointmentNo;
postProcedureReqModel.episodeID = patient.episodeNo;
postProcedureReqModel.patientMRN = patient.patientMRN;
entityList.forEach((element) {
procedureValadteRequestModel.procedure = [element.procedureId];
List<Controls> controls = List();
controls.add(
Controls(
code: "remarks",
controlValue: element.remarks != null ? element.remarks : ""),
);
controls.add(
Controls(code: "ordertype", controlValue: "0"),
);
controlsProcedure.add(Procedures(
category: element.categoryID,
procedure: element.procedureId,
controls: controls));
});
postProcedureReqModel.procedures = controlsProcedure;
await model.valadteProcedure(procedureValadteRequestModel);
if (model.state == ViewState.Idle) {
if (model.valadteProcedureList[0].entityList.length == 0) {
await model.postProcedure(postProcedureReqModel, patient.patientMRN);
if (model.state == ViewState.ErrorLocal) {
Helpers.showErrorToast(model.error);
model.getPatientRadOrders(patient);
} else if (model.state == ViewState.Idle) {
DrAppToastMsg.showSuccesToast('procedure has been added');
}
} else {
if (model.state == ViewState.ErrorLocal) {
Helpers.showErrorToast(model.error);
model.getPatientRadOrders(patient);
} else if (model.state == ViewState.Idle) {
Helpers.showErrorToast(
model.valadteProcedureList[0].entityList[0].warringMessages);
}
}
} else {
Helpers.showErrorToast(model.error);
}
}
void addSelectedRadiologyOrder(
context, ProcedureViewModel model, PatiantInformtion patient) {
showModalBottomSheet(
context: context,
isScrollControlled: true,
builder: (BuildContext bc) {
return AddSelectedRadiologyOrder(
model: model,
patient: patient,
);
});
}
class AddSelectedRadiologyOrder extends StatefulWidget {
final ProcedureViewModel model;
final PatiantInformtion patient;
const AddSelectedRadiologyOrder({Key key, this.model, this.patient})
: super(key: key);
@override
_AddSelectedRadiologyOrderState createState() =>
_AddSelectedRadiologyOrderState(patient: patient, model: model);
}
class _AddSelectedRadiologyOrderState extends State<AddSelectedRadiologyOrder> {
int selectedType;
ProcedureViewModel model;
PatiantInformtion patient;
_AddSelectedRadiologyOrderState({this.patient, this.model});
TextEditingController procedureController = TextEditingController();
TextEditingController remarksController = TextEditingController();
List<EntityList> entityList = List();
List<EntityList> entityListProcedure = List();
dynamic selectedCategory;
setSelectedType(int val) {
setState(() {
selectedType = val;
});
}
@override
Widget build(BuildContext context) {
final screenSize = MediaQuery.of(context).size;
return BaseView<ProcedureViewModel>(
onModelReady: (model) => model.getProcedureCategory(
categoryName: "Radiology", categoryID: "03",patientId: patient.patientId),
builder: (BuildContext context, ProcedureViewModel model, Widget child) =>
AppScaffold(
isShowAppBar: false,
body: NetworkBaseView(
baseViewModel: model,
child: DraggableScrollableSheet(
minChildSize: 0.90,
initialChildSize: 0.95,
maxChildSize: 1.0,
builder:
(BuildContext context, ScrollController scrollController) {
return SingleChildScrollView(
child: Container(
height: MediaQuery.of(context).size.height * 1.0,
child: Padding(
padding: EdgeInsets.all(12.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 10.0,
),
if (widget.model.categoriesList.length != 0)
NetworkBaseView(
baseViewModel: model,
child: EntityListCheckboxSearchWidget(
model: widget.model,
masterList:
widget.model.categoriesList[0].entityList,
removeHistory: (item) {
setState(() {
entityList.remove(item);
});
},
addHistory: (history) {
setState(() {
entityList.add(history);
});
},
addSelectedHistories: () {
//TODO build your fun herr
// widget.addSelectedHistories();
},
isEntityListSelected: (master) =>
isEntityListSelected(master),
)),
],
),
),
),
);
}),
),
bottomSheet: Container(
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5),
child: Wrap(
alignment: WrapAlignment.center,
children: <Widget>[
AppButton(
title: TranslationBase.of(context).addRadiologyOrder,
color: Color(0xff359846),
fontWeight: FontWeight.w700,
onPressed: () {
if (entityList.isEmpty == true) {
DrAppToastMsg.showErrorToast(TranslationBase.of(context)
.fillTheMandatoryProcedureDetails);
return;
}
Navigator.pop(context);
postProcedure(
orderType: selectedType.toString(),
entityList: entityList,
patient: patient,
model: widget.model,
remarks: remarksController.text);
},
),
],
),
),
),
);
}
bool isEntityListSelected(EntityList masterKey) {
Iterable<EntityList> history = entityList
.where((element) => masterKey.procedureId == element.procedureId);
if (history.length > 0) {
return true;
}
return false;
}
InputDecoration textFieldSelectorDecoration(
String hintText, String selectedText, bool isDropDown,
{Icon suffixIcon}) {
return InputDecoration(
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
disabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
hintText: selectedText != null ? selectedText : hintText,
suffixIcon: isDropDown
? suffixIcon != null
? suffixIcon
: Icon(
Icons.arrow_drop_down,
color: Colors.black,
)
: null,
hintStyle: TextStyle(
fontSize: 14,
color: Colors.grey.shade600,
),
);
}
}

@ -1,219 +0,0 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/procedures/add-favourite-procedure.dart';
import 'package:doctor_app_flutter/screens/procedures/add-procedure-form.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/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'add_lab_orders.dart';
import 'add_radiology_order.dart';
class AddRadiologyScreen extends StatefulWidget {
final ProcedureViewModel model;
final PatiantInformtion patient;
const AddRadiologyScreen({Key key, this.model, this.patient}) : super(key: key);
@override
_AddRadiologyScreenState createState() =>
_AddRadiologyScreenState(patient: patient, model: model);
}
class _AddRadiologyScreenState extends State<AddRadiologyScreen>
with SingleTickerProviderStateMixin {
_AddRadiologyScreenState({this.patient, this.model});
ProcedureViewModel model;
PatiantInformtion patient;
TabController _tabController;
int _activeTab = 0;
@override
void initState() {
super.initState();
_tabController = TabController(length: 2, vsync: this);
_tabController.addListener(_handleTabSelection);
}
@override
void dispose() {
super.dispose();
_tabController.dispose();
}
_handleTabSelection() {
setState(() {
_activeTab = _tabController.index;
});
}
@override
Widget build(BuildContext context) {
final screenSize = MediaQuery.of(context).size;
return BaseView<ProcedureViewModel>(
builder: (BuildContext context, ProcedureViewModel model, Widget child) =>
AppScaffold(
isShowAppBar: false,
body: NetworkBaseView(
baseViewModel: model,
child: DraggableScrollableSheet(
minChildSize: 0.90,
initialChildSize: 0.95,
maxChildSize: 1.0,
builder:
(BuildContext context, ScrollController scrollController) {
return Container(
height: MediaQuery.of(context).size.height * 1.20,
child: Padding(
padding: EdgeInsets.all(12.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
AppText(
TranslationBase.of(context).addRadiologyOrder,
fontWeight: FontWeight.w700,
fontSize: 20,
),
InkWell(
child: Icon(
Icons.close,
size: 24.0,
),
onTap: () {
Navigator.pop(context);
},
)
]),
SizedBox(
height: MediaQuery.of(context).size.height * 0.04,
),
Expanded(
child: Scaffold(
extendBodyBehindAppBar: true,
appBar: PreferredSize(
preferredSize: Size.fromHeight(
MediaQuery.of(context).size.height * 0.070),
child: Container(
height:
MediaQuery.of(context).size.height * 0.070,
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: Theme.of(context).dividerColor,
width: 0.5), //width: 0.7
),
color: Colors.white),
child: Center(
child: TabBar(
isScrollable: false,
controller: _tabController,
indicatorColor: Colors.transparent,
indicatorWeight: 1.0,
indicatorSize: TabBarIndicatorSize.tab,
labelColor: Theme.of(context).primaryColor,
labelPadding: EdgeInsets.only(
top: 0, left: 0, right: 0, bottom: 0),
unselectedLabelColor: Colors.grey[800],
tabs: [
tabWidget(
screenSize,
_activeTab == 0,
"Favorite Templates",
),
tabWidget(
screenSize,
_activeTab == 1,
'All Radiology',
),
],
),
),
),
),
body: Column(
children: [
Expanded(
child: TabBarView(
physics: BouncingScrollPhysics(),
controller: _tabController,
children: [
AddFavouriteProcedure(
patient: patient,
model: model,
addButtonTitle: TranslationBase.of(context).addRadiologyOrder,
toolbarTitle: TranslationBase.of(context).addRadiologyOrder,
categoryID: "03",
),
AddSelectedRadiologyOrder(
model: model,
patient: patient,
),
],
),
),
],
),
),
),
],
),
),
);
}),
),
),
);
}
Widget tabWidget(Size screenSize, bool isActive, String title,
{int counter = -1}) {
return Center(
child: Container(
height: screenSize.height * 0.070,
decoration: TextFieldsUtils.containerBorderDecoration(
isActive ? Color(0xFFD02127 /*B8382B*/) : Color(0xFFEAEAEA),
isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA),
borderRadius: 4,
borderWidth: 0),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
AppText(
title,
fontSize: SizeConfig.textMultiplier * 1.5,
color: isActive ? Colors.white : Color(0xFF2B353E),
fontWeight: FontWeight.w700,
),
if (counter != -1)
Container(
margin: EdgeInsets.all(4),
width: 15,
height: 15,
decoration: BoxDecoration(
color: isActive ? Colors.white : Color(0xFFD02127),
shape: BoxShape.circle,
),
child: Center(
child: FittedBox(
child: AppText(
"$counter",
fontSize: SizeConfig.textMultiplier * 1.5,
color: !isActive ? Colors.white : Color(0xFFD02127),
fontWeight: FontWeight.w700,
),
),
),
),
],
),
),
);
}
}

@ -1,31 +1,46 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/procedures/add-favourite-procedure.dart';
import 'package:doctor_app_flutter/screens/procedures/add-procedure-form.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/screens/prescription/add_prescription_form.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class AddProcedureHome extends StatefulWidget {
import 'ProcedureType.dart';
import 'add-favourite-procedure.dart';
import 'add-procedure-page.dart';
class BaseAddProcedureTabPage extends StatefulWidget {
final ProcedureViewModel model;
final PrescriptionViewModel prescriptionModel;
final PatiantInformtion patient;
const AddProcedureHome({Key key, this.model, this.patient}) : super(key: key);
final ProcedureType procedureType;
const BaseAddProcedureTabPage(
{Key key,
this.model,
this.prescriptionModel,
this.patient,
@required this.procedureType})
: super(key: key);
@override
_AddProcedureHomeState createState() =>
_AddProcedureHomeState(patient: patient, model: model);
_BaseAddProcedureTabPageState createState() => _BaseAddProcedureTabPageState(
patient: patient, model: model, procedureType: procedureType);
}
class _AddProcedureHomeState extends State<AddProcedureHome>
class _BaseAddProcedureTabPageState extends State<BaseAddProcedureTabPage>
with SingleTickerProviderStateMixin {
_AddProcedureHomeState({this.patient, this.model});
ProcedureViewModel model;
PatiantInformtion patient;
final ProcedureViewModel model;
final PatiantInformtion patient;
final ProcedureType procedureType;
_BaseAddProcedureTabPageState({this.patient, this.model, this.procedureType});
TabController _tabController;
int _activeTab = 0;
@ -50,11 +65,9 @@ class _AddProcedureHomeState extends State<AddProcedureHome>
@override
Widget build(BuildContext context) {
//final routeArgs = ModalRoute.of(context).settings.arguments as Map;
//PatiantInformtion patient = routeArgs['patient'];
final screenSize = MediaQuery.of(context).size;
return BaseView<ProcedureViewModel>(
//onModelReady: (model) => model.getCategory(),
builder: (BuildContext context, ProcedureViewModel model, Widget child) =>
AppScaffold(
isShowAppBar: false,
@ -67,7 +80,7 @@ class _AddProcedureHomeState extends State<AddProcedureHome>
builder:
(BuildContext context, ScrollController scrollController) {
return Container(
height: MediaQuery.of(context).size.height * 1.20,
height: MediaQuery.of(context).size.height * 1.25,
child: Padding(
padding: EdgeInsets.all(12.0),
child: Column(
@ -77,7 +90,7 @@ class _AddProcedureHomeState extends State<AddProcedureHome>
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
AppText(
'Add Procedure',
procedureType.getToolbarLabel(context),
fontWeight: FontWeight.w700,
fontSize: 20,
),
@ -125,12 +138,13 @@ class _AddProcedureHomeState extends State<AddProcedureHome>
tabWidget(
screenSize,
_activeTab == 0,
"Favorite Templates",
procedureType
.getFavouriteTabName(context),
),
tabWidget(
screenSize,
_activeTab == 1,
'All Procedures',
procedureType.getAllLabelName(context),
),
],
),
@ -145,15 +159,25 @@ class _AddProcedureHomeState extends State<AddProcedureHome>
controller: _tabController,
children: [
AddFavouriteProcedure(
model: this.model,
prescriptionModel:
widget.prescriptionModel,
patient: patient,
model: model,
addButtonTitle: TranslationBase.of(context).addSelectedProcedures,
toolbarTitle: 'Add Procedure',
),
AddSelectedProcedure(
model: model,
patient: patient,
procedureType: procedureType,
),
if (widget.procedureType ==
ProcedureType.PRESCRIPTION)
PrescriptionFormWidget(
widget.prescriptionModel,
widget.patient,
widget.prescriptionModel
.prescriptionList)
else
AddProcedurePage(
model: this.model,
patient: patient,
procedureType: procedureType,
),
],
),
),
@ -177,7 +201,7 @@ class _AddProcedureHomeState extends State<AddProcedureHome>
child: Container(
height: screenSize.height * 0.070,
decoration: TextFieldsUtils.containerBorderDecoration(
isActive ? Color(0xFFD02127 /*B8382B*/) : Color(0xFFEAEAEA),
isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA),
isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA),
borderRadius: 4,
borderWidth: 0),

@ -19,6 +19,7 @@ class EntityListCheckboxSearchWidget extends StatefulWidget {
final bool Function(EntityList) isEntityListSelected;
final List<EntityList> masterList;
/// todo clear the function here
EntityListCheckboxSearchWidget(
{Key key,
this.model,

@ -85,7 +85,7 @@ class _EntityListCheckboxSearchFavProceduresWidgetState extends State<EntityList
NetworkBaseView(
baseViewModel: widget.model,
child: Container(
height: MediaQuery.of(context).size.height * 0.65,
height: MediaQuery.of(context).size.height * 0.60,
child: Center(
child: Container(
margin: EdgeInsets.only(top: 15),

@ -1,168 +0,0 @@
import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart';
import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/TextFields.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart';
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
import 'package:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class ProcedureListWidget extends StatefulWidget {
final ProcedureViewModel model;
final Function addSelectedHistories;
final Function(EntityList) removeHistory;
final Function(EntityList) addHistory;
final Function(EntityList) addRemarks;
final bool Function(EntityList) isEntityListSelected;
final List<EntityList> masterList;
ProcedureListWidget(
{Key key,
this.model,
this.addSelectedHistories,
this.removeHistory,
this.masterList,
this.addHistory,
this.isEntityListSelected,
this.addRemarks})
: super(key: key);
@override
_ProcedureListWidgetState createState() => _ProcedureListWidgetState();
}
class _ProcedureListWidgetState extends State<ProcedureListWidget> {
int selectedType = 0;
int typeUrgent;
int typeRegular;
setSelectedType(int val) {
setState(() {
selectedType = val;
});
}
List<EntityList> items = List();
List<String> remarksList = List();
List<int> typeList = List();
@override
void initState() {
items.addAll(widget.masterList);
super.initState();
}
TextEditingController remarksController = TextEditingController();
@override
Widget build(BuildContext context) {
return Container(
child: Column(
children: [
NetworkBaseView(
baseViewModel: widget.model,
child: Container(
height: MediaQuery.of(context).size.height * 0.75,
child: Center(
child: Container(
margin: EdgeInsets.only(top: 15),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: ListView(
children: [
TextFields(
hintText: TranslationBase.of(context).searchProcedures,
suffixIcon: EvaIcons.search,
onChanged: (value) {
filterSearchResults(value);
},
),
SizedBox(
height: 15,
),
items.length != 0
? Column(
children: items.map((historyInfo) {
return Column(
children: [
Row(
children: [
Checkbox(
value: widget.isEntityListSelected(
historyInfo),
activeColor: Colors.red[800],
onChanged: (bool newValue) {
setState(() {
if (widget.isEntityListSelected(
historyInfo)) {
widget
.removeHistory(historyInfo);
} else {
widget.addHistory(historyInfo);
}
});
}),
Expanded(
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 10, vertical: 0),
child: AppText(
historyInfo.procedureName,
variant: "bodyText",
bold: true,
color: Colors.black),
),
),
],
),
DividerWithSpacesAround(),
],
);
}).toList(),
)
: Center(
child: Container(
child: AppText(
"There's no procedures for this category",
color: Color(0xFFB9382C)),
),
)
],
),
)),
),
),
SizedBox(
height: 10,
),
],
),
);
}
void filterSearchResults(String query) {
List<EntityList> dummySearchList = List();
dummySearchList.addAll(widget.masterList);
if (query.isNotEmpty) {
List<EntityList> dummyListData = List();
dummySearchList.forEach((item) {
if (item.procedureName.toLowerCase().contains(query.toLowerCase())) {
dummyListData.add(item);
}
});
setState(() {
items.clear();
items.addAll(dummyListData);
});
return;
} else {
setState(() {
items.clear();
items.addAll(widget.masterList);
});
}
}
}

@ -4,7 +4,7 @@ import 'package:doctor_app_flutter/core/model/procedure/procedure_template_detai
import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/procedures/add-procedure-form.dart';
import 'package:doctor_app_flutter/screens/procedures/add-procedure-page.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/TextFields.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
@ -223,10 +223,9 @@ class _ProcedureCheckOutScreenState extends State<ProcedureCheckOutScreen> {
);
});
Navigator.pop(context);
await postProcedure(
await model.preparePostProcedure(
entityList: entityList,
patient: widget.patient,
model: widget.model,
remarks: remarksController.text);
Navigator.pop(context);
Navigator.pop(context);

@ -5,7 +5,6 @@ import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.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';
import 'package:doctor_app_flutter/screens/procedures/add_procedure_homeScreen.dart';
import 'package:doctor_app_flutter/screens/procedures/update-procedure.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
@ -15,6 +14,8 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';
import 'ProcedureCard.dart';
import 'ProcedureType.dart';
import 'base_add_procedure_tab_page.dart';
class ProcedureScreen extends StatelessWidget {
int doctorNameP;
@ -107,10 +108,12 @@ class ProcedureScreen extends StatelessWidget {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => AddProcedureHome(
patient: patient,
model: model,
)),
builder: (context) => BaseAddProcedureTabPage(
patient: patient,
model: model,
procedureType: ProcedureType.PROCEDURE,
),
),
);
},
child: Container(

@ -1,4 +1,4 @@
import 'package:barcode_scan/platform_wrapper.dart';
import 'package:barcode_scan_fix/barcode_scan.dart';
import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart';
@ -137,8 +137,8 @@ class _QrReaderScreenState extends State<QrReaderScreen> {
/// var result = await BarcodeScanner.scan();
/// int patientID = get from qr result
var result = await BarcodeScanner.scan();
if (result.rawContent != "") {
List<String> listOfParams = result.rawContent.split(',');
if (result != "") {
List<String> listOfParams = result.split(',');
String patientType = "1";
setState(() {
isLoading = true;

@ -1035,6 +1035,8 @@ class TranslationBase {
String get addSelectedProcedures =>
localizedValues['addSelectedProcedures'][locale.languageCode];
String get addProcedures =>
localizedValues['addProcedures'][locale.languageCode];
String get updateProcedure =>
localizedValues['updateProcedure'][locale.languageCode];
@ -1355,6 +1357,12 @@ class TranslationBase {
String get impressionRecommendation => localizedValues['impressionRecommendation'][locale.languageCode];
String get onHold => localizedValues['onHold'][locale.languageCode];
String get verified => localizedValues['verified'][locale.languageCode];
String get favoriteTemplates => localizedValues['favoriteTemplates'][locale.languageCode];
String get allProcedures => localizedValues['allProcedures'][locale.languageCode];
String get allRadiology => localizedValues['allRadiology'][locale.languageCode];
String get allLab => localizedValues['allLab'][locale.languageCode];
String get allPrescription => localizedValues['allPrescription'][locale.languageCode];
String get addPrescription => localizedValues['addPrescription'][locale.languageCode];
}
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -440,6 +440,35 @@ class PatientCard extends StatelessWidget {
fontWeight: FontWeight.w700,
fontSize: 13)),
]))),
if (isFromLiveCare)
Column(
children: [
Container(
child: RichText(
text: new TextSpan(
style: new TextStyle(
fontSize: 2.0 * SizeConfig.textMultiplier,
color: Colors.black,
fontFamily: 'Poppins',
),
children: <TextSpan>[
new TextSpan(
text:
TranslationBase.of(context).clinic +
" : ",
style: TextStyle(fontSize: 12)),
new TextSpan(
text:
patientInfo.clinicName,
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 13)),
],
),
),
),
],
),
]))
]),
isFromLiveCare

@ -173,9 +173,8 @@ class _AppDrawerState extends State<AppDrawer> {
),
onTap: () async {
Navigator.pop(context);
GifLoaderDialogUtils.showMyDialog(context);
await authenticationViewModel.logout(isFromLogin: false);
// GifLoaderDialogUtils.showMyDialog(context);
},
),
],

@ -43,13 +43,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.7.3"
barcode_scan:
barcode_scan_fix:
dependency: "direct main"
description:
name: barcode_scan
name: barcode_scan_fix
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.1"
version: "1.0.2"
bazel_worker:
dependency: transitive
description:
@ -587,7 +587,7 @@ packages:
name: js
url: "https://pub.dartlang.org"
source: hosted
version: "0.6.3-nullsafety.1"
version: "0.6.2"
json_annotation:
dependency: transitive
description:
@ -629,7 +629,7 @@ packages:
name: meta
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0-nullsafety.4"
version: "1.3.0-nullsafety.3"
mime:
dependency: transitive
description:
@ -921,7 +921,7 @@ packages:
name: stack_trace
url: "https://pub.dartlang.org"
source: hosted
version: "1.10.0-nullsafety.2"
version: "1.10.0-nullsafety.1"
sticky_headers:
dependency: "direct main"
description:
@ -1119,5 +1119,5 @@ packages:
source: hosted
version: "2.2.1"
sdks:
dart: ">=2.10.0 <=2.11.0-213.1.beta"
dart: ">=2.10.0 <2.11.0"
flutter: ">=1.22.0 <2.0.0"

@ -51,7 +51,7 @@ dependencies:
expandable: ^4.1.4
# Qr code Scanner
barcode_scan: ^3.0.1
barcode_scan_fix: ^1.0.2
# permissions
permission_handler: ^5.0.0+hotfix.3
device_info: ^0.4.2+4

Loading…
Cancel
Save