Compare commits
No commits in common. 'main' and 'ambulance_ui' have entirely different histories.
main
...
ambulance_
@ -1,165 +1,16 @@
|
||||
# HMG Patient App
|
||||
# hmg_patient_app_new
|
||||
|
||||
A comprehensive Flutter-based mobile application for HMG (Habib Medical Group) patients,
|
||||
providing seamless healthcare services and patient management features.
|
||||
New HMG Patient App
|
||||
|
||||
## 📱 Features
|
||||
## Getting Started
|
||||
|
||||
- **Patient Registration & Authentication**: Secure login and registration system
|
||||
- **Appointment Management**: Book, reschedule, and manage medical appointments
|
||||
- **Medical Records**: Access to personal health records and medical history
|
||||
- **Doctor Consultation**: Video consultations and chat with healthcare providers
|
||||
- **Health Monitoring**: Track vital signs and health metrics
|
||||
- **Prescription Management**: View and manage prescriptions
|
||||
- **Payment Integration**: Secure payment processing for medical services
|
||||
- **Multi-language Support**: Available in English and Arabic
|
||||
- **Push Notifications**: Real-time updates for appointments and health reminders
|
||||
- **Calendar Integration**: Sync appointments with device calendar
|
||||
- **Location Services**: Find nearby hospitals and clinics
|
||||
This project is a starting point for a Flutter application.
|
||||
|
||||
## 🚀 Getting Started
|
||||
A few resources to get you started if this is your first Flutter project:
|
||||
|
||||
### Prerequisites
|
||||
- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab)
|
||||
- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook)
|
||||
|
||||
- Flutter SDK (>=3.0.0)
|
||||
- Dart SDK (>=3.0.0)
|
||||
- Android Studio / VS Code
|
||||
- Android SDK (for Android development)
|
||||
- Xcode (for iOS development, macOS only)
|
||||
|
||||
### Installation
|
||||
|
||||
1. **Clone the repository:**
|
||||
```bash
|
||||
git clone <repository-url>
|
||||
cd HMG_Patient_App_New
|
||||
```
|
||||
|
||||
2. **Install dependencies:**
|
||||
```bash
|
||||
flutter pub get
|
||||
```
|
||||
|
||||
3. **Configure Firebase:**
|
||||
- Add your `google-services.json` file to `android/app/`
|
||||
- Add your `GoogleService-Info.plist` file to `ios/Runner/`
|
||||
|
||||
4. **Run the application:**
|
||||
```bash
|
||||
flutter run
|
||||
```
|
||||
|
||||
## 🏗️ Project Structure
|
||||
|
||||
```
|
||||
lib/
|
||||
├── core/ # Core utilities and constants
|
||||
├── extensions/ # Dart extensions
|
||||
├── features/ # Feature-based modules
|
||||
├── generated/ # Generated files (localization, etc.)
|
||||
├── presentation/ # UI screens and widgets
|
||||
├── routes/ # App navigation and routing
|
||||
├── services/ # Business logic and API services
|
||||
├── theme/ # App theming and styling
|
||||
├── widgets/ # Reusable UI components
|
||||
├── main.dart # App entry point
|
||||
└── splashPage.dart # Splash screen
|
||||
|
||||
assets/
|
||||
├── animations/ # Lottie animations
|
||||
├── fonts/ # Custom fonts (Poppins, Gess Two)
|
||||
├── images/ # PNG and SVG images
|
||||
├── json/ # JSON data files
|
||||
└── langs/ # Localization files
|
||||
```
|
||||
|
||||
## 🛠️ Technologies Used
|
||||
|
||||
- **Framework**: Flutter
|
||||
- **Language**: Dart
|
||||
- **State Management**: [Your state management solution]
|
||||
- **Backend Services**: Firebase
|
||||
- **Authentication**: Firebase Auth
|
||||
- **Database**: Cloud Firestore
|
||||
- **Push Notifications**: Firebase Cloud Messaging
|
||||
- **Maps**: Google Maps
|
||||
- **Payment**: Amazon PayFort
|
||||
- **Video Calling**: Flutter Zoom Video SDK
|
||||
- **Local Storage**: SQLite, Shared Preferences
|
||||
|
||||
## 📱 Supported Platforms
|
||||
|
||||
- ✅ Android (API level 21+)
|
||||
- ✅ iOS (iOS 12.0+)
|
||||
- ✅ Foldable devices support
|
||||
- ✅ Tablet optimization
|
||||
|
||||
## 🌐 Localization
|
||||
|
||||
The app supports multiple languages:
|
||||
|
||||
- English (en-US)
|
||||
- Arabic (ar-SA)
|
||||
|
||||
## 🔧 Configuration
|
||||
|
||||
### Environment Setup
|
||||
|
||||
1. **API Keys**: Configure your API keys in the appropriate configuration files
|
||||
2. **Firebase**: Set up Firebase project and add configuration files
|
||||
3. **Maps**: Add Google Maps API key
|
||||
4. **Payment**: Configure PayFort credentials
|
||||
|
||||
### Build Variants
|
||||
|
||||
- **Debug**: Development build with debugging enabled
|
||||
- **Release**: Production-ready optimized build
|
||||
|
||||
## 📝 Development Guidelines
|
||||
|
||||
### Code Style
|
||||
|
||||
- Follow Dart/Flutter best practices
|
||||
- Use consistent naming conventions
|
||||
- Implement proper error handling
|
||||
- Write comprehensive documentation
|
||||
|
||||
### Testing
|
||||
|
||||
```bash
|
||||
# Run unit tests
|
||||
flutter test
|
||||
|
||||
# Run integration tests
|
||||
flutter test integration_test/
|
||||
```
|
||||
|
||||
### Building for Production
|
||||
|
||||
**Android:**
|
||||
|
||||
```bash
|
||||
flutter build apk --release
|
||||
# or
|
||||
flutter build appbundle --release
|
||||
```
|
||||
|
||||
**iOS:**
|
||||
|
||||
```bash
|
||||
flutter build ios --release
|
||||
```
|
||||
|
||||
## 🤝 Contributing
|
||||
|
||||
1. Fork the repository
|
||||
2. Create a feature branch (`git checkout -b feature/new-feature`)
|
||||
3. Commit your changes (`git commit -am 'Add new feature'`)
|
||||
4. Push to the branch (`git push origin feature/new-feature`)
|
||||
5. Create a Pull Request
|
||||
|
||||
## 📄 License
|
||||
|
||||
This project is proprietary software developed for HMG Healthcare Group.
|
||||
|
||||
**Built with ❤️ for better healthcare accessibility**
|
||||
For help getting started with Flutter development, view the
|
||||
[online documentation](https://docs.flutter.dev/), which offers tutorials,
|
||||
samples, guidance on mobile development, and a full API reference.
|
||||
|
||||
@ -0,0 +1,74 @@
|
||||
{
|
||||
"agcgw":{
|
||||
"backurl":"connect-drcn.hispace.hicloud.com",
|
||||
"url":"connect-drcn.dbankcloud.cn",
|
||||
"websocketbackurl":"connect-ws-drcn.hispace.dbankcloud.com",
|
||||
"websocketurl":"connect-ws-drcn.hispace.dbankcloud.cn"
|
||||
},
|
||||
"agcgw_all":{
|
||||
"CN":"connect-drcn.dbankcloud.cn",
|
||||
"CN_back":"connect-drcn.hispace.hicloud.com",
|
||||
"DE":"connect-dre.dbankcloud.cn",
|
||||
"DE_back":"connect-dre.hispace.hicloud.com",
|
||||
"RU":"connect-drru.dbankcloud.cn",
|
||||
"RU_back":"connect-drru.hispace.hicloud.com",
|
||||
"SG":"connect-dra.dbankcloud.cn",
|
||||
"SG_back":"connect-dra.hispace.hicloud.com"
|
||||
},
|
||||
"client":{
|
||||
"cp_id":"2640966000002322881",
|
||||
"product_id":"736430079244816567",
|
||||
"client_id":"563735388191982656",
|
||||
"client_secret":"650C7C799812AFFD53A10C7756CF05FB9F215A7E49032ABA8EBF3E14B77535CF",
|
||||
"project_id":"736430079244816567",
|
||||
"app_id":"102857389",
|
||||
"api_key":"CgB6e3x9DJzMgRCmnT6dyUEkp6UsIfddb6l3w0ZEXzeiRMHEFi3400Z5fJ5qaHneU0OrAI/JRpk+DMGVs3QpUxlI",
|
||||
"package_name":"com.ejada.hmg"
|
||||
},
|
||||
"oauth_client":{
|
||||
"client_id":"102857389",
|
||||
"client_type":1
|
||||
},
|
||||
"app_info":{
|
||||
"app_id":"102857389",
|
||||
"package_name":"com.ejada.hmg"
|
||||
},
|
||||
"service":{
|
||||
"analytics":{
|
||||
"collector_url":"datacollector-drcn.dt.hicloud.com,datacollector-drcn.dt.dbankcloud.cn",
|
||||
"collector_url_ru":"datacollector-drru.dt.hicloud.com,datacollector-drru.dt.dbankcloud.cn",
|
||||
"collector_url_sg":"datacollector-dra.dt.hicloud.com,datacollector-dra.dt.dbankcloud.cn",
|
||||
"collector_url_de":"datacollector-dre.dt.hicloud.com,datacollector-dre.dt.dbankcloud.cn",
|
||||
"collector_url_cn":"datacollector-drcn.dt.hicloud.com,datacollector-drcn.dt.dbankcloud.cn",
|
||||
"resource_id":"p1",
|
||||
"channel_id":""
|
||||
},
|
||||
"search":{
|
||||
"url":"https://search-drcn.cloud.huawei.com"
|
||||
},
|
||||
"cloudstorage":{
|
||||
"storage_url":"https://agc-storage-drcn.platform.dbankcloud.cn"
|
||||
},
|
||||
"ml":{
|
||||
"mlservice_url":"ml-api-drcn.ai.dbankcloud.com,ml-api-drcn.ai.dbankcloud.cn"
|
||||
}
|
||||
},
|
||||
"region":"CN",
|
||||
"configuration_version":"3.0",
|
||||
"appInfos":[
|
||||
{
|
||||
"package_name":"com.ejada.hmg",
|
||||
"client":{
|
||||
"app_id":"102857389"
|
||||
},
|
||||
"app_info":{
|
||||
"package_name":"com.ejada.hmg",
|
||||
"app_id":"102857389"
|
||||
},
|
||||
"oauth_client":{
|
||||
"client_type":1,
|
||||
"client_id":"102857389"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -1,27 +0,0 @@
|
||||
//package com.cloud.diplomaticquarterapp
|
||||
package com.ejada.hmg
|
||||
|
||||
|
||||
import io.flutter.app.FlutterApplication
|
||||
|
||||
class Application : FlutterApplication() {
|
||||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
}
|
||||
}
|
||||
|
||||
//import io.flutter.app.FlutterApplication
|
||||
//import io.flutter.plugin.common.PluginRegistry
|
||||
//import io.flutter.plugin.common.PluginRegistry.PluginRegistrantCallback
|
||||
//import io.flutter.plugins.firebasemessaging.FlutterFirebaseMessagingService
|
||||
//
|
||||
//class Application : FlutterApplication(), PluginRegistrantCallback {
|
||||
// override fun onCreate() {
|
||||
// super.onCreate()
|
||||
// FlutterFirebaseMessagingService.setPluginRegistrant(this)
|
||||
// }
|
||||
//
|
||||
// override fun registerWith(registry: PluginRegistry?) {
|
||||
// FirebaseCloudMessagingPluginRegistrant.registerWith(registry)
|
||||
// }
|
||||
//}
|
||||
@ -1,6 +0,0 @@
|
||||
package com.ejada.hmg
|
||||
|
||||
import io.flutter.embedding.android.FlutterFragmentActivity
|
||||
|
||||
|
||||
class MainActivity : FlutterFragmentActivity()
|
||||
|
Before Width: | Height: | Size: 2.5 KiB |
|
Before Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 1021 B |
|
Before Width: | Height: | Size: 180 B |
|
Before Width: | Height: | Size: 1.0 KiB |
@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/main"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context="com.cloud.diplomaticquarterapp.whatsapp.WhatsAppCodeActivity">
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@ -1,14 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_horizontal"
|
||||
android:layout_gravity="center_horizontal">
|
||||
<FrameLayout
|
||||
android:id="@+id/publisher_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#FF9800" />
|
||||
|
||||
</LinearLayout>
|
||||
@ -1,20 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_horizontal"
|
||||
android:layout_gravity="center_horizontal">
|
||||
<FrameLayout
|
||||
android:id="@+id/subscriber_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#3F51B5" />
|
||||
|
||||
<TextView
|
||||
android:text="Remote"
|
||||
android:textColor="#FFFFFF"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
Before Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 4.2 KiB |
|
Before Width: | Height: | Size: 5.6 KiB |
@ -1,3 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources xmlns:tools="http://schemas.android.com/tools"
|
||||
tools:keep="@drawable/*,@raw/slow_spring_board" />
|
||||
@ -1,23 +0,0 @@
|
||||
<resources>
|
||||
<string name="app_name">HMG Patient App</string>
|
||||
|
||||
<string name="geofence_unknown_error">
|
||||
Unknown error: the Geofence service is not available now.
|
||||
</string>
|
||||
<string name="geofence_not_available">
|
||||
Geofence service is not available now. Go to Settings>Location>Mode and choose High accuracy.
|
||||
</string>
|
||||
<string name="geofence_too_many_geofences">
|
||||
Your app has registered too many geofences.
|
||||
</string>
|
||||
<string name="geofence_too_many_pending_intents">
|
||||
You have provided too many PendingIntents to the addGeofences() call.
|
||||
</string>
|
||||
<string name="GEOFENCE_INSUFFICIENT_LOCATION_PERMISSION">
|
||||
App do not have permission to access location service.
|
||||
</string>
|
||||
<string name="GEOFENCE_REQUEST_TOO_FREQUENT">
|
||||
Geofence requests happened too frequently.
|
||||
</string>
|
||||
<string name="mapbox_access_token" translatable="false">sk.eyJ1IjoicndhaWQiLCJhIjoiY2x6NWo0bTMzMWZodzJrcGZpemYzc3Z4dSJ9.uSSZuwNSGCcCdPAiORECmg</string>
|
||||
</resources>
|
||||
|
Before Width: | Height: | Size: 148 KiB |
|
Before Width: | Height: | Size: 193 KiB |
|
Before Width: | Height: | Size: 543 KiB |
@ -1,5 +0,0 @@
|
||||
<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M2.88966 2.26044H6.1556C6.54339 2.26042 6.87763 2.2604 7.1452 2.29638C7.43199 2.33494 7.7069 2.42189 7.92987 2.64486C8.15285 2.86784 8.2398 3.14275 8.27836 3.42953C8.30096 3.59766 8.30936 3.79206 8.31247 4.00954C8.31248 4.01004 8.31288 4.01044 8.31338 4.01044C8.31369 4.01044 8.31396 4.0106 8.31413 4.01083C8.31413 4.01063 8.31423 4.01098 8.31413 4.01083L8.31429 6.19794C8.31429 6.43957 8.51017 6.63544 8.75179 6.63544C8.99342 6.63544 9.18929 6.43957 9.18929 6.19794V4.20362C9.18929 4.10493 9.2722 4.02578 9.37041 4.03551C9.63863 4.06206 9.88036 4.11895 10.1131 4.2507C10.3443 4.38162 10.5211 4.56074 10.6893 4.77855C10.8614 5.00128 11.0127 5.23986 11.1635 5.47761L11.164 5.4784C11.1889 5.51758 11.2137 5.55673 11.2386 5.59579C11.5034 6.01096 11.8302 6.35342 12.2362 6.63158C12.6288 6.90049 12.9411 7.11434 13.1141 7.46714C13.2034 7.64923 13.24 7.83466 13.2568 8.03171C13.2597 8.06529 13.2329 8.09377 13.1992 8.09377H12.6893C12.4477 8.09377 12.2518 8.28965 12.2518 8.53127C12.2518 8.7729 12.4477 8.96877 12.6893 8.96877H12.9207C13.0883 8.96877 13.1722 8.96877 13.2238 9.02251C13.2755 9.07625 13.2722 9.15762 13.2658 9.32036C13.2616 9.42578 13.2549 9.52356 13.244 9.61307C13.2135 9.86447 13.1447 10.1138 12.9593 10.3235C12.7687 10.5391 12.5059 10.6479 12.2248 10.6872C12.1439 10.6985 12.0789 10.625 12.0886 10.5439C12.0989 10.4578 12.1042 10.3701 12.1042 10.2813C12.1042 9.07315 11.1249 8.09377 9.91675 8.09377C8.71731 8.09377 7.72602 9.09672 7.72928 10.2935C7.73046 10.5082 7.73105 10.6156 7.67973 10.6672C7.62842 10.7188 7.53389 10.7188 7.34482 10.7188H6.65534C6.46628 10.7188 6.37175 10.7188 6.32043 10.6672C6.26912 10.6156 6.26971 10.5082 6.27088 10.2935C6.27415 9.09672 5.28286 8.09377 4.08342 8.09377C2.87529 8.09377 1.89592 9.07315 1.89592 10.2813C1.89592 10.4083 1.90675 10.5328 1.92753 10.6539C1.93036 10.6704 1.9166 10.6851 1.90005 10.6828C1.61327 10.6443 1.33836 10.5573 1.11539 10.3344C0.892408 10.1114 0.805457 9.83647 0.766899 9.54969C0.730924 9.28211 0.73094 8.94798 0.730958 8.56018V4.41914C0.73094 4.03135 0.730924 3.69711 0.766899 3.42953C0.805457 3.14275 0.892408 2.86784 1.11539 2.64486C1.33836 2.42189 1.61327 2.33494 1.90005 2.29638C2.16763 2.2604 2.50187 2.26042 2.88966 2.26044ZM5.10596 4.44794C5.10596 4.20631 4.91008 4.01044 4.66846 4.01044C4.42683 4.01044 4.23096 4.20631 4.23096 4.44794V5.17711H3.50179C3.26017 5.17711 3.06429 5.37298 3.06429 5.61461C3.06429 5.85623 3.26017 6.05211 3.50179 6.05211H4.23096V6.78127C4.23096 7.0229 4.42683 7.21877 4.66846 7.21877C4.91008 7.21877 5.10596 7.0229 5.10596 6.78127V6.05211H5.83513C6.07675 6.05211 6.27263 5.85623 6.27263 5.61461C6.27263 5.37298 6.07675 5.17711 5.83513 5.17711H5.10596V4.44794Z" fill="#2E3039"/>
|
||||
<path d="M11.3757 10.2813C11.3757 11.0867 10.7227 11.7396 9.91732 11.7396C9.1119 11.7396 8.45898 11.0867 8.45898 10.2813C8.45898 9.47586 9.1119 8.82294 9.91732 8.82294C10.7227 8.82294 11.3757 9.47586 11.3757 10.2813Z" fill="#2E3039"/>
|
||||
<path d="M4.08399 11.7396C4.8894 11.7396 5.54232 11.0867 5.54232 10.2813C5.54232 9.47586 4.8894 8.82294 4.08399 8.82294C3.27857 8.82294 2.62565 9.47586 2.62565 10.2813C2.62565 11.0867 3.27857 11.7396 4.08399 11.7396Z" fill="#2E3039"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 3.2 KiB |
@ -1,6 +0,0 @@
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M9 3.75C9 2.09315 10.3431 0.75 12 0.75C13.6569 0.75 15 2.09315 15 3.75C15 4.82282 14.4369 5.76411 13.5901 6.29442C16.5251 6.71056 18.309 9.97478 17.1349 12.8582C16.8794 13.4857 16.2803 13.9167 15.5919 13.9167H15.0998L14.272 17.4022C14.019 18.4673 13.0967 19.25 12 19.25C10.9033 19.25 9.98103 18.4673 9.72805 17.4022L8.9002 13.9167L8.40809 13.9167C7.71969 13.9167 7.12056 13.4857 6.86508 12.8582C5.69103 9.97478 7.47495 6.71056 10.4099 6.29442C9.56313 5.76411 9 4.82282 9 3.75Z" fill="white"/>
|
||||
<path d="M7 15.25H6C5.44772 15.25 5 15.6977 5 16.25C5 16.8023 5.44772 17.25 6 17.25H7C7.55228 17.25 8 16.8023 8 16.25C8 15.6977 7.55228 15.25 7 15.25Z" fill="white"/>
|
||||
<path d="M17 15.25C16.4477 15.25 16 15.6977 16 16.25C16 16.8023 16.4477 17.25 17 17.25H18C18.5523 17.25 19 16.8023 19 16.25C19 15.6977 18.5523 15.25 18 15.25H17Z" fill="white"/>
|
||||
<path d="M13 21.25C13 20.6977 12.5523 20.25 12 20.25C11.4477 20.25 11 20.6977 11 21.25V22.25C11 22.8023 11.4477 23.25 12 23.25C12.5523 23.25 13 22.8023 13 22.25V21.25Z" fill="white"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 1.1 KiB |
@ -1,7 +0,0 @@
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M14.0493 1.25C14.7141 1.24997 15.287 1.24994 15.7457 1.31161C16.2373 1.37771 16.7086 1.52677 17.0908 1.90902C17.4731 2.29126 17.6222 2.76253 17.6883 3.25416C17.7499 3.7129 17.7499 4.28574 17.7499 4.95059V6.04937C17.7499 6.71423 17.7499 7.28712 17.6883 7.74585C17.6222 8.23749 17.4731 8.70875 17.0908 9.091C16.7086 9.47324 16.2373 9.6223 15.7457 9.6884C15.287 9.75008 14.7141 9.75004 14.0492 9.75001L13.2269 9.75001L10.4159 11.624C10.1857 11.7775 9.88983 11.7918 9.64597 11.6613C9.4021 11.5307 9.24986 11.2766 9.24986 11V9.7469C8.87641 9.74158 8.54263 9.7272 8.25402 9.6884C7.76238 9.6223 7.29112 9.47324 6.90887 9.091C6.52662 8.70875 6.37756 8.23749 6.31147 7.74585C6.24979 7.28712 6.24982 6.71427 6.24986 6.04943V4.95063C6.24982 4.28579 6.24979 3.7129 6.31147 3.25416C6.37756 2.76253 6.52662 2.29126 6.90887 1.90902C7.29112 1.52677 7.76238 1.37771 8.25402 1.31161C8.71274 1.24994 9.28556 1.24997 9.95039 1.25L14.0493 1.25Z" fill="white"/>
|
||||
<path d="M3.17258 18.1177C4.89963 16.9608 7.10028 16.9608 8.82733 18.1177C9.13739 18.3137 9.84338 18.7614 10.2141 19.1697C10.4495 19.4288 10.6975 19.7967 10.7428 20.2626C10.7914 20.7627 10.5934 21.2221 10.2316 21.6099C9.68447 22.1963 8.95287 22.75 7.95957 22.75H4.04034C3.04704 22.75 2.31543 22.1963 1.76831 21.6099C1.40651 21.2221 1.20853 20.7627 1.25712 20.2626C1.30239 19.7967 1.55044 19.4288 1.78577 19.1697C2.15652 18.7614 2.86252 18.3137 3.17258 18.1177Z" fill="white"/>
|
||||
<path d="M20.8273 18.1177C19.1003 16.9608 16.8996 16.9608 15.1726 18.1177C14.8625 18.3137 14.1565 18.7614 13.7858 19.1697C13.5504 19.4288 13.3024 19.7967 13.2571 20.2626C13.2085 20.7627 13.4065 21.2221 13.7683 21.6099C14.3154 22.1963 15.047 22.75 16.0403 22.75H19.9596C20.9529 22.75 21.6845 22.1963 22.2316 21.6099C22.5934 21.2221 22.7914 20.7627 22.7428 20.2626C22.6975 19.7967 22.4495 19.4288 22.2141 19.1697C21.8434 18.7614 21.1374 18.3137 20.8273 18.1177Z" fill="white"/>
|
||||
<path d="M3.24986 13.5C3.24986 11.9812 4.48107 10.75 5.99986 10.75C7.51864 10.75 8.74986 11.9812 8.74986 13.5C8.74986 15.0188 7.51864 16.25 5.99986 16.25C4.48107 16.25 3.24986 15.0188 3.24986 13.5Z" fill="white"/>
|
||||
<path d="M17.9999 10.75C16.4811 10.75 15.2499 11.9812 15.2499 13.5C15.2499 15.0188 16.4811 16.25 17.9999 16.25C19.5186 16.25 20.7499 15.0188 20.7499 13.5C20.7499 11.9812 19.5186 10.75 17.9999 10.75Z" fill="white"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 2.4 KiB |
@ -1,5 +0,0 @@
|
||||
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M9.49411 2.85661C9.06887 2.71829 8.56575 2.71849 7.82926 2.71878L5.20973 2.7188C4.36011 2.71878 3.66581 2.71877 3.11767 2.79255C2.5447 2.86967 2.04795 3.03656 1.65143 3.43352C1.25491 3.83049 1.0882 4.32779 1.01117 4.90139C0.93747 5.45014 0.937484 6.14521 0.9375 6.99576V10.0798C0.937484 10.9303 0.93747 11.6254 1.01117 12.1741C1.0882 12.7477 1.25491 13.245 1.65143 13.642C1.76583 13.7565 1.89283 13.8531 2.02893 13.9345C2.22063 14.0492 2.31647 14.1065 2.39389 14.059C2.47131 14.0115 2.46224 13.8786 2.44411 13.6127C2.43973 13.5484 2.4375 13.4836 2.4375 13.4181C2.4375 11.8631 3.6967 10.6025 5.25 10.6025C6.8033 10.6025 8.0625 11.8631 8.0625 13.4181C8.0625 13.5947 8.04626 13.7675 8.01519 13.9351C7.97875 14.1317 7.96053 14.23 8.00499 14.2841C8.04945 14.3381 8.14092 14.3389 8.32387 14.3406C8.77449 14.3448 9.22551 14.3448 9.67614 14.3406C9.85908 14.3389 9.95055 14.3381 9.99501 14.2841C10.0395 14.23 10.0213 14.1317 9.98481 13.9351C9.95374 13.7675 9.9375 13.5947 9.9375 13.4181C9.9375 11.8631 11.1967 10.6025 12.75 10.6025C14.3033 10.6025 15.5625 11.8631 15.5625 13.4181C15.5625 13.4835 15.5603 13.5484 15.5559 13.6127C15.5378 13.8786 15.5287 14.0115 15.6061 14.059C15.6835 14.1065 15.7794 14.0492 15.9711 13.9345C16.1072 13.8531 16.2342 13.7565 16.3486 13.642C16.7451 13.245 16.9118 12.7477 16.9888 12.1741C17.0625 11.6254 17.0625 10.9303 17.0625 10.0798V8.55433C17.0654 8.4286 17.0367 8.30042 16.9729 8.18177L15.9988 6.37069C15.7544 5.91626 15.5451 5.52708 15.3388 5.22173C15.1184 4.89536 14.8689 4.61351 14.5195 4.40455C14.17 4.19558 13.8038 4.10932 13.4123 4.06973C13.046 4.0327 12.6044 4.03272 12.0889 4.03274L11.2524 4.03274C11.1353 4.03274 11.0767 4.03274 11.0295 4.00933C10.9823 3.98592 10.9424 3.93349 10.8626 3.82864C10.5202 3.37853 10.0455 3.03597 9.49411 2.85661ZM11.7406 5.53441C11.5945 5.53441 11.5214 5.53441 11.4773 5.57901C11.4333 5.62362 11.4342 5.69802 11.4359 5.84684C11.4377 5.99664 11.4376 6.15736 11.4375 6.33106C11.4375 6.93389 11.4444 7.20613 11.4834 7.32612C11.5761 7.61185 11.7999 7.83587 12.0853 7.92871C12.2052 7.96769 12.3728 7.97464 12.975 7.97464H14.6556C14.8798 7.97464 14.9919 7.97464 15.0355 7.90148C15.0792 7.82832 15.026 7.72952 14.9197 7.53192L14.6949 7.11386C14.429 6.61959 14.2551 6.29803 14.0963 6.06291C13.9469 5.84183 13.845 5.75037 13.7503 5.69375C13.6556 5.63714 13.5268 5.59062 13.2616 5.5638C12.9795 5.53529 12.6142 5.53441 12.0535 5.53441H11.7406ZM4.5001 5.53125C4.91431 5.53125 5.2501 5.86704 5.2501 6.28125V7.78125C5.2501 8.19546 4.91431 8.53125 4.5001 8.53125C4.08589 8.53125 3.7501 8.19546 3.7501 7.78125V6.28125C3.7501 5.86704 4.08589 5.53125 4.5001 5.53125ZM7.5001 5.53125C7.91431 5.53125 8.2501 5.86704 8.2501 6.28125V7.78125C8.2501 8.19546 7.91431 8.53125 7.5001 8.53125C7.08589 8.53125 6.7501 8.19546 6.7501 7.78125V6.28125C6.7501 5.86704 7.08589 5.53125 7.5001 5.53125Z" fill="#2E3039"/>
|
||||
<path d="M5.25 11.5312C4.21447 11.5312 3.375 12.3707 3.375 13.4062C3.375 14.4418 4.21447 15.2812 5.25 15.2812C6.28553 15.2812 7.125 14.4418 7.125 13.4062C7.125 12.3707 6.28553 11.5312 5.25 11.5312Z" fill="#2E3039"/>
|
||||
<path d="M12.75 11.5312C11.7145 11.5312 10.875 12.3707 10.875 13.4062C10.875 14.4418 11.7145 15.2812 12.75 15.2812C13.7855 15.2812 14.625 14.4418 14.625 13.4062C14.625 12.3707 13.7855 11.5312 12.75 11.5312Z" fill="#2E3039"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 3.4 KiB |
|
Before Width: | Height: | Size: 10 KiB |
@ -1,4 +0,0 @@
|
||||
<svg width="10" height="13" viewBox="0 0 10 13" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M5 2.85449C3.79188 2.85449 2.8125 3.83387 2.8125 5.04199C2.8125 6.25011 3.79188 7.22949 5 7.22949C6.20812 7.22949 7.1875 6.25011 7.1875 5.04199C7.1875 3.83387 6.20812 2.85449 5 2.85449ZM3.6875 5.04199C3.6875 4.31712 4.27513 3.72949 5 3.72949C5.72487 3.72949 6.3125 4.31712 6.3125 5.04199C6.3125 5.76687 5.72487 6.35449 5 6.35449C4.27513 6.35449 3.6875 5.76687 3.6875 5.04199Z" fill="#ED1C2B"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M5 0.229492C2.38798 0.229492 0.1875 2.42783 0.1875 5.09268C0.1875 7.8228 2.43772 9.64709 4.31579 10.8329L4.32334 10.8377L4.33107 10.8422C4.5346 10.9593 4.76514 11.0212 5 11.0212C5.23486 11.0212 5.4654 10.9593 5.66893 10.8422L5.67567 10.8383L5.68227 10.8342C7.56769 9.65737 9.8125 7.81358 9.8125 5.09268C9.8125 2.42783 7.61202 0.229492 5 0.229492ZM1.0625 5.09268C1.0625 2.90553 2.87676 1.10449 5 1.10449C7.12324 1.10449 8.9375 2.90553 8.9375 5.09268C8.9375 7.29808 7.10717 8.91207 5.22662 10.0871C5.15694 10.1259 5.079 10.1462 5 10.1462C4.92132 10.1462 4.84369 10.1261 4.77422 10.0876C2.89372 8.89884 1.0625 7.30546 1.0625 5.09268Z" fill="#ED1C2B"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 1.2 KiB |
@ -1,22 +1,21 @@
|
||||
import Flutter
|
||||
import UIKit
|
||||
//import FirebaseCore
|
||||
//import FirebaseMessaging
|
||||
import GoogleMaps
|
||||
import FirebaseCore
|
||||
import FirebaseMessaging
|
||||
|
||||
@main
|
||||
@objc class AppDelegate: FlutterAppDelegate {
|
||||
override func application(
|
||||
_ application: UIApplication,
|
||||
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
|
||||
) -> Bool {
|
||||
GMSServices.provideAPIKey("AIzaSyB6TERnxIr0yJ3qG4ULBZbu0sAD4tGqtng")
|
||||
// FirebaseApp.configure()
|
||||
FirebaseApp.configure()
|
||||
GeneratedPluginRegistrant.register(with: self)
|
||||
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
|
||||
}
|
||||
|
||||
override func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken:Data){
|
||||
// Messaging.messaging().apnsToken = deviceToken
|
||||
Messaging.messaging().apnsToken = deviceToken
|
||||
super.application(application, didRegisterForRemoteNotificationsWithDeviceToken: deviceToken)
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,143 +0,0 @@
|
||||
import 'package:dartz/dartz.dart';
|
||||
import 'package:hmg_patient_app_new/core/api/api_client.dart';
|
||||
import 'package:hmg_patient_app_new/core/api_consts.dart';
|
||||
import 'package:hmg_patient_app_new/core/common_models/generic_api_model.dart';
|
||||
import 'package:hmg_patient_app_new/core/exceptions/api_failure.dart';
|
||||
import 'package:hmg_patient_app_new/features/contact_us/models/req_models/request_insert_coc_item.dart';
|
||||
import 'package:hmg_patient_app_new/features/contact_us/models/resp_models/get_hmg_locations.dart';
|
||||
import 'package:hmg_patient_app_new/features/contact_us/models/resp_models/get_patient_ic_projects.dart';
|
||||
import 'package:hmg_patient_app_new/features/my_appointments/models/resp_models/patient_appointment_history_response_model.dart';
|
||||
import 'package:hmg_patient_app_new/services/logger_service.dart';
|
||||
|
||||
abstract class ContactUsRepo {
|
||||
Future<Either<Failure, GenericApiModel<List<GetHMGLocationsModel>>>> getHMGLocations();
|
||||
|
||||
Future<Either<Failure, GenericApiModel<List<GetPatientICProjectsModel>>>> getLiveChatProjectsList();
|
||||
|
||||
Future<Either<Failure, GenericApiModel<dynamic>>> insertCOCItem({required RequestInsertCOCItem requestInsertCOCItem, PatientAppointmentHistoryResponseModel? patientSelectedAppointment});
|
||||
}
|
||||
|
||||
class ContactUsRepoImp implements ContactUsRepo {
|
||||
final ApiClient apiClient;
|
||||
final LoggerService loggerService;
|
||||
|
||||
ContactUsRepoImp({required this.apiClient, required this.loggerService});
|
||||
|
||||
@override
|
||||
Future<Either<Failure, GenericApiModel<List<GetHMGLocationsModel>>>> getHMGLocations() async {
|
||||
Map<String, dynamic> mapDevice = {};
|
||||
|
||||
try {
|
||||
GenericApiModel<List<GetHMGLocationsModel>>? apiResponse;
|
||||
Failure? failure;
|
||||
await apiClient.post(
|
||||
GET_FINDUS_REQUEST,
|
||||
body: mapDevice,
|
||||
onFailure: (error, statusCode, {messageStatus, failureType}) {
|
||||
failure = failureType;
|
||||
},
|
||||
onSuccess: (response, statusCode, {messageStatus, errorMessage}) {
|
||||
try {
|
||||
final list = response['ListHMGLocation'];
|
||||
final hmgLocations = list.map((item) => GetHMGLocationsModel.fromJson(item as Map<String, dynamic>)).toList().cast<GetHMGLocationsModel>();
|
||||
|
||||
apiResponse = GenericApiModel<List<GetHMGLocationsModel>>(
|
||||
messageStatus: messageStatus,
|
||||
statusCode: statusCode,
|
||||
errorMessage: null,
|
||||
data: hmgLocations,
|
||||
);
|
||||
} catch (e) {
|
||||
failure = DataParsingFailure(e.toString());
|
||||
}
|
||||
},
|
||||
);
|
||||
if (failure != null) return Left(failure!);
|
||||
if (apiResponse == null) return Left(ServerFailure("Unknown error"));
|
||||
return Right(apiResponse!);
|
||||
} catch (e) {
|
||||
return Left(UnknownFailure(e.toString()));
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Future<Either<Failure, GenericApiModel<List<GetPatientICProjectsModel>>>> getLiveChatProjectsList() async {
|
||||
Map<String, dynamic> mapDevice = {};
|
||||
|
||||
try {
|
||||
GenericApiModel<List<GetPatientICProjectsModel>>? apiResponse;
|
||||
Failure? failure;
|
||||
await apiClient.post(
|
||||
GET_LIVECHAT_REQUEST,
|
||||
body: mapDevice,
|
||||
onFailure: (error, statusCode, {messageStatus, failureType}) {
|
||||
failure = failureType;
|
||||
},
|
||||
onSuccess: (response, statusCode, {messageStatus, errorMessage}) {
|
||||
try {
|
||||
final list = response['List_PatientICProjects'];
|
||||
final liveChatProjectsList = list.map((item) => GetPatientICProjectsModel.fromJson(item as Map<String, dynamic>)).toList().cast<GetPatientICProjectsModel>();
|
||||
|
||||
apiResponse = GenericApiModel<List<GetPatientICProjectsModel>>(
|
||||
messageStatus: messageStatus,
|
||||
statusCode: statusCode,
|
||||
errorMessage: null,
|
||||
data: liveChatProjectsList,
|
||||
);
|
||||
} catch (e) {
|
||||
failure = DataParsingFailure(e.toString());
|
||||
}
|
||||
},
|
||||
);
|
||||
if (failure != null) return Left(failure!);
|
||||
if (apiResponse == null) return Left(ServerFailure("Unknown error"));
|
||||
return Right(apiResponse!);
|
||||
} catch (e) {
|
||||
return Left(UnknownFailure(e.toString()));
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Future<Either<Failure, GenericApiModel<dynamic>>> insertCOCItem({required RequestInsertCOCItem requestInsertCOCItem, PatientAppointmentHistoryResponseModel? patientSelectedAppointment}) async {
|
||||
final Map<String, dynamic> body = requestInsertCOCItem.toJson();
|
||||
|
||||
if (patientSelectedAppointment != null) {
|
||||
body['AppoinmentNo'] = patientSelectedAppointment.appointmentNo;
|
||||
body['AppointmentDate'] = patientSelectedAppointment.appointmentDate;
|
||||
body['ClinicID'] = patientSelectedAppointment.clinicID;
|
||||
body['ClinicName'] = patientSelectedAppointment.clinicName;
|
||||
body['DoctorID'] = patientSelectedAppointment.doctorID;
|
||||
body['DoctorName'] = patientSelectedAppointment.doctorNameObj;
|
||||
body['ProjectName'] = patientSelectedAppointment.projectName;
|
||||
}
|
||||
|
||||
try {
|
||||
GenericApiModel<dynamic>? apiResponse;
|
||||
Failure? failure;
|
||||
await apiClient.post(
|
||||
SEND_FEEDBACK,
|
||||
body: body,
|
||||
onFailure: (error, statusCode, {messageStatus, failureType}) {
|
||||
failure = failureType;
|
||||
},
|
||||
onSuccess: (response, statusCode, {messageStatus, errorMessage}) {
|
||||
try {
|
||||
apiResponse = GenericApiModel<dynamic>(
|
||||
messageStatus: messageStatus,
|
||||
statusCode: statusCode,
|
||||
errorMessage: null,
|
||||
data: response,
|
||||
);
|
||||
} catch (e) {
|
||||
failure = DataParsingFailure(e.toString());
|
||||
}
|
||||
},
|
||||
);
|
||||
if (failure != null) return Left(failure!);
|
||||
if (apiResponse == null) return Left(ServerFailure("Unknown error"));
|
||||
return Right(apiResponse!);
|
||||
} catch (e) {
|
||||
return Left(UnknownFailure(e.toString()));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,198 +0,0 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hmg_patient_app_new/core/api_consts.dart';
|
||||
import 'package:hmg_patient_app_new/core/app_state.dart';
|
||||
import 'package:hmg_patient_app_new/core/utils/utils.dart';
|
||||
import 'package:hmg_patient_app_new/features/contact_us/contact_us_repo.dart';
|
||||
import 'package:hmg_patient_app_new/features/contact_us/models/feedback_type.dart';
|
||||
import 'package:hmg_patient_app_new/features/contact_us/models/req_models/request_insert_coc_item.dart';
|
||||
import 'package:hmg_patient_app_new/features/contact_us/models/resp_models/get_hmg_locations.dart';
|
||||
import 'package:hmg_patient_app_new/features/contact_us/models/resp_models/get_patient_ic_projects.dart';
|
||||
import 'package:hmg_patient_app_new/features/my_appointments/models/resp_models/patient_appointment_history_response_model.dart';
|
||||
import 'package:hmg_patient_app_new/services/error_handler_service.dart';
|
||||
|
||||
class ContactUsViewModel extends ChangeNotifier {
|
||||
ContactUsRepo contactUsRepo;
|
||||
ErrorHandlerService errorHandlerService;
|
||||
AppState appState;
|
||||
|
||||
bool isHMGLocationsListLoading = false;
|
||||
bool isHMGHospitalsListSelected = true;
|
||||
bool isLiveChatProjectsListLoading = false;
|
||||
bool isSendFeedbackTabSelected = true;
|
||||
|
||||
List<GetHMGLocationsModel> hmgHospitalsLocationsList = [];
|
||||
List<GetHMGLocationsModel> hmgPharmacyLocationsList = [];
|
||||
|
||||
List<GetPatientICProjectsModel> liveChatProjectsList = [];
|
||||
|
||||
int selectedLiveChatProjectIndex = -1;
|
||||
|
||||
List<String> feedbackAttachmentList = [];
|
||||
|
||||
PatientAppointmentHistoryResponseModel? patientFeedbackSelectedAppointment;
|
||||
|
||||
List<FeedbackType> feedbackTypeList = [
|
||||
FeedbackType(id: 1, nameEN: "Complaint for appointment", nameAR: 'شكوى على موعد'),
|
||||
FeedbackType(id: 2, nameEN: "Complaint without appointment", nameAR: 'شكوى بدون موعد'),
|
||||
FeedbackType(id: 3, nameEN: "Question", nameAR: 'سؤال'),
|
||||
FeedbackType(id: 4, nameEN: "Appreciation", nameAR: 'تقدير'),
|
||||
FeedbackType(id: 6, nameEN: "Suggestion", nameAR: 'إقتراح'),
|
||||
FeedbackType(id: 5, nameEN: "Not classified", nameAR: 'غير محدد'),
|
||||
];
|
||||
|
||||
FeedbackType selectedFeedbackType = FeedbackType(id: 5, nameEN: "Not classified", nameAR: 'غير محدد');
|
||||
|
||||
ContactUsViewModel({required this.contactUsRepo, required this.errorHandlerService, required this.appState});
|
||||
|
||||
initContactUsViewModel() {
|
||||
isHMGLocationsListLoading = true;
|
||||
isHMGHospitalsListSelected = true;
|
||||
isLiveChatProjectsListLoading = true;
|
||||
hmgHospitalsLocationsList.clear();
|
||||
hmgPharmacyLocationsList.clear();
|
||||
liveChatProjectsList.clear();
|
||||
feedbackAttachmentList.clear();
|
||||
selectedFeedbackType = FeedbackType(id: 5, nameEN: "Not classified", nameAR: 'غير محدد');
|
||||
setPatientFeedbackSelectedAppointment(null);
|
||||
getHMGLocations();
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
setHMGHospitalsListSelected(bool isSelected) {
|
||||
isHMGHospitalsListSelected = isSelected;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
setSelectedLiveChatProjectIndex(int index) {
|
||||
selectedLiveChatProjectIndex = index;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
setIsSendFeedbackTabSelected(bool isSelected) {
|
||||
isSendFeedbackTabSelected = isSelected;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
setSelectedFeedbackType(FeedbackType feedbackType) {
|
||||
selectedFeedbackType = feedbackType;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
addFeedbackAttachment(String attachmentPath) {
|
||||
feedbackAttachmentList.add(attachmentPath);
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
removeFeedbackAttachment(String attachmentPath) {
|
||||
feedbackAttachmentList.remove(attachmentPath);
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
setPatientFeedbackSelectedAppointment(PatientAppointmentHistoryResponseModel? appointment) {
|
||||
patientFeedbackSelectedAppointment = appointment;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
Future<void> getHMGLocations({Function(dynamic)? onSuccess, Function(String)? onError}) async {
|
||||
isHMGLocationsListLoading = true;
|
||||
hmgHospitalsLocationsList.clear();
|
||||
hmgPharmacyLocationsList.clear();
|
||||
notifyListeners();
|
||||
|
||||
final result = await contactUsRepo.getHMGLocations();
|
||||
|
||||
result.fold(
|
||||
(failure) async => await errorHandlerService.handleError(failure: failure),
|
||||
(apiResponse) {
|
||||
if (apiResponse.messageStatus == 2) {
|
||||
// dialogService.showErrorDialog(message: apiResponse.errorMessage!, onOkPressed: () {});
|
||||
} else if (apiResponse.messageStatus == 1) {
|
||||
// hmgLocationsList = apiResponse.data!;
|
||||
for (var location in apiResponse.data!) {
|
||||
if (location.locationType == 1) {
|
||||
hmgHospitalsLocationsList.add(location);
|
||||
} else if (location.locationType == 2) {
|
||||
hmgPharmacyLocationsList.add(location);
|
||||
}
|
||||
}
|
||||
isHMGLocationsListLoading = false;
|
||||
notifyListeners();
|
||||
if (onSuccess != null) {
|
||||
onSuccess(apiResponse);
|
||||
}
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> getLiveChatProjectsList({Function(dynamic)? onSuccess, Function(String)? onError}) async {
|
||||
isLiveChatProjectsListLoading = true;
|
||||
liveChatProjectsList.clear();
|
||||
|
||||
notifyListeners();
|
||||
|
||||
final result = await contactUsRepo.getLiveChatProjectsList();
|
||||
|
||||
result.fold(
|
||||
(failure) async => await errorHandlerService.handleError(failure: failure),
|
||||
(apiResponse) {
|
||||
if (apiResponse.messageStatus == 2) {
|
||||
// dialogService.showErrorDialog(message: apiResponse.errorMessage!, onOkPressed: () {});
|
||||
} else if (apiResponse.messageStatus == 1) {
|
||||
liveChatProjectsList = apiResponse.data!;
|
||||
liveChatProjectsList.sort((a, b) => b.distanceInKilometers.compareTo(a.distanceInKilometers));
|
||||
isLiveChatProjectsListLoading = false;
|
||||
notifyListeners();
|
||||
if (onSuccess != null) {
|
||||
onSuccess(apiResponse);
|
||||
}
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> insertCOCItem({required String subject, required String message, Function(dynamic)? onSuccess, Function(String)? onError}) async {
|
||||
RequestInsertCOCItem requestInsertCOCItem = RequestInsertCOCItem();
|
||||
requestInsertCOCItem.attachment = feedbackAttachmentList.isNotEmpty ? feedbackAttachmentList.first : "";
|
||||
requestInsertCOCItem.title = subject;
|
||||
requestInsertCOCItem.details = message;
|
||||
requestInsertCOCItem.cOCTypeName = selectedFeedbackType.id.toString();
|
||||
requestInsertCOCItem.formTypeID = selectedFeedbackType.id.toString();
|
||||
requestInsertCOCItem.mobileNo = "966${Utils.getPhoneNumberWithoutZero(appState.getAuthenticatedUser()!.mobileNumber!)}";
|
||||
requestInsertCOCItem.isUserLoggedIn = true;
|
||||
requestInsertCOCItem.projectID = 0;
|
||||
requestInsertCOCItem.patientName = "${appState.getAuthenticatedUser()!.firstName!} ${appState.getAuthenticatedUser()!.lastName!}";
|
||||
requestInsertCOCItem.fileName = "";
|
||||
requestInsertCOCItem.appVersion = ApiConsts.appVersionID;
|
||||
requestInsertCOCItem.uILanguage = appState.isArabic() ? "ar" : "en"; //TODO Change it to be dynamic
|
||||
requestInsertCOCItem.browserInfo = Platform.localHostname;
|
||||
requestInsertCOCItem.deviceInfo = Platform.localHostname;
|
||||
requestInsertCOCItem.resolution = "400x847";
|
||||
requestInsertCOCItem.projectID = 0;
|
||||
requestInsertCOCItem.tokenID = "C0c@@dm!n?T&A&A@Barcha202029582948";
|
||||
requestInsertCOCItem.identificationNo = int.parse(appState.getAuthenticatedUser()!.patientIdentificationNo!);
|
||||
if (BASE_URL.contains('uat')) {
|
||||
requestInsertCOCItem.forDemo = true;
|
||||
} else {
|
||||
requestInsertCOCItem.forDemo = false;
|
||||
}
|
||||
|
||||
final result = await contactUsRepo.insertCOCItem(requestInsertCOCItem: requestInsertCOCItem, patientSelectedAppointment: patientFeedbackSelectedAppointment);
|
||||
|
||||
result.fold(
|
||||
(failure) async => await errorHandlerService.handleError(failure: failure),
|
||||
(apiResponse) {
|
||||
if (apiResponse.messageStatus == 2) {
|
||||
// dialogService.showErrorDialog(message: apiResponse.errorMessage!, onOkPressed: () {});
|
||||
} else if (apiResponse.messageStatus == 1) {
|
||||
notifyListeners();
|
||||
if (onSuccess != null) {
|
||||
onSuccess(apiResponse);
|
||||
}
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -1,11 +0,0 @@
|
||||
class FeedbackType {
|
||||
final int id;
|
||||
final String nameEN;
|
||||
final String nameAR;
|
||||
|
||||
FeedbackType({
|
||||
required this.id,
|
||||
required this.nameEN,
|
||||
required this.nameAR,
|
||||
});
|
||||
}
|
||||
@ -1,137 +0,0 @@
|
||||
class RequestInsertCOCItem {
|
||||
bool? isUserLoggedIn;
|
||||
String? mobileNo;
|
||||
int? identificationNo;
|
||||
int? patientID;
|
||||
int? patientOutSA;
|
||||
int? patientTypeID;
|
||||
String? tokenID;
|
||||
String? patientName;
|
||||
int? projectID;
|
||||
String? fileName;
|
||||
String? attachment;
|
||||
String? uILanguage;
|
||||
String? browserInfo;
|
||||
String? cOCTypeName;
|
||||
String? formTypeID;
|
||||
String? details;
|
||||
String? deviceInfo;
|
||||
String? deviceType;
|
||||
String? title;
|
||||
String? resolution;
|
||||
double? versionID;
|
||||
int? channel;
|
||||
int? languageID;
|
||||
String? iPAdress;
|
||||
String? generalid;
|
||||
String? sessionID;
|
||||
bool? isDentalAllowedBackend;
|
||||
int? deviceTypeID;
|
||||
int? patientType;
|
||||
double? appVersion;
|
||||
bool? forDemo;
|
||||
|
||||
RequestInsertCOCItem(
|
||||
{this.isUserLoggedIn,
|
||||
this.mobileNo,
|
||||
this.identificationNo,
|
||||
this.patientID,
|
||||
this.patientOutSA,
|
||||
this.patientTypeID,
|
||||
this.tokenID,
|
||||
this.patientName,
|
||||
this.projectID,
|
||||
this.fileName,
|
||||
this.attachment,
|
||||
this.uILanguage,
|
||||
this.browserInfo,
|
||||
this.cOCTypeName,
|
||||
this.formTypeID,
|
||||
this.details,
|
||||
this.deviceInfo,
|
||||
this.deviceType,
|
||||
this.title,
|
||||
this.resolution,
|
||||
this.versionID,
|
||||
this.channel,
|
||||
this.languageID,
|
||||
this.iPAdress,
|
||||
this.generalid,
|
||||
this.sessionID,
|
||||
this.isDentalAllowedBackend,
|
||||
this.deviceTypeID,
|
||||
this.patientType,
|
||||
this.appVersion,
|
||||
this.forDemo});
|
||||
|
||||
RequestInsertCOCItem.fromJson(Map<String, dynamic> json) {
|
||||
isUserLoggedIn = json['IsUserLoggedIn'];
|
||||
mobileNo = json['MobileNo'];
|
||||
identificationNo = json['IdentificationNo'];
|
||||
patientID = json['PatientID'];
|
||||
patientOutSA = json['PatientOutSA'];
|
||||
patientTypeID = json['PatientTypeID'];
|
||||
tokenID = json['TokenID'];
|
||||
patientName = json['PatientName'];
|
||||
projectID = json['ProjectID'];
|
||||
fileName = json['FileName'];
|
||||
attachment = json['Attachment'];
|
||||
uILanguage = json['UILanguage'];
|
||||
browserInfo = json['BrowserInfo'];
|
||||
cOCTypeName = json['COCTypeName'];
|
||||
formTypeID = json['FormTypeID'];
|
||||
details = json['Details'];
|
||||
deviceInfo = json['DeviceInfo'];
|
||||
deviceType = json['DeviceType'];
|
||||
title = json['Title'];
|
||||
resolution = json['Resolution'];
|
||||
versionID = json['VersionID'];
|
||||
channel = json['Channel'];
|
||||
languageID = json['LanguageID'];
|
||||
iPAdress = json['IPAdress'];
|
||||
generalid = json['generalid'];
|
||||
sessionID = json['SessionID'];
|
||||
isDentalAllowedBackend = json['isDentalAllowedBackend'];
|
||||
deviceTypeID = json['DeviceTypeID'];
|
||||
patientType = json['PatientType'];
|
||||
appVersion = json['AppVersion'];
|
||||
forDemo = json['ForDemo'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['IsUserLoggedIn'] = this.isUserLoggedIn;
|
||||
data['MobileNo'] = this.mobileNo;
|
||||
data['IdentificationNo'] = this.identificationNo;
|
||||
data['PatientID'] = this.patientID;
|
||||
data['PatientOutSA'] = this.patientOutSA;
|
||||
data['PatientTypeID'] = this.patientTypeID;
|
||||
data['TokenID'] = this.tokenID;
|
||||
data['PatientName'] = this.patientName;
|
||||
data['ProjectID'] = this.projectID;
|
||||
data['FileName'] = this.fileName;
|
||||
data['Attachment'] = this.attachment;
|
||||
data['UILanguage'] = this.uILanguage;
|
||||
data['BrowserInfo'] = this.browserInfo;
|
||||
data['COCTypeName'] = this.cOCTypeName;
|
||||
data['FormTypeID'] = this.formTypeID;
|
||||
data['Details'] = this.details;
|
||||
data['DeviceInfo'] = this.deviceInfo;
|
||||
data['DeviceType'] = this.deviceType;
|
||||
data['Title'] = this.title;
|
||||
data['Resolution'] = this.resolution;
|
||||
data['VersionID'] = this.versionID;
|
||||
data['Channel'] = this.channel;
|
||||
data['LanguageID'] = this.languageID;
|
||||
data['IPAdress'] = this.iPAdress;
|
||||
data['generalid'] = this.generalid;
|
||||
data['SessionID'] = this.sessionID;
|
||||
data['isDentalAllowedBackend'] = this.isDentalAllowedBackend;
|
||||
data['DeviceTypeID'] = this.deviceTypeID;
|
||||
data['PatientType'] = this.patientType;
|
||||
data['AppVersion'] = this.appVersion;
|
||||
data['ForDemo'] = this.forDemo;
|
||||
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -1,80 +0,0 @@
|
||||
class GetHMGLocationsModel {
|
||||
dynamic cityID;
|
||||
String? cityName;
|
||||
dynamic cityNameN;
|
||||
dynamic distanceInKilometers;
|
||||
bool? isActive;
|
||||
String? latitude;
|
||||
int? locationID;
|
||||
String? locationName;
|
||||
dynamic locationNameN;
|
||||
dynamic locationType;
|
||||
String? longitude;
|
||||
int? pharmacyLocationID;
|
||||
String? phoneNumber;
|
||||
int? projectID;
|
||||
String? projectImageURL;
|
||||
int? setupID;
|
||||
dynamic sortOrder;
|
||||
|
||||
GetHMGLocationsModel(
|
||||
{this.cityID,
|
||||
this.cityName,
|
||||
this.cityNameN,
|
||||
this.distanceInKilometers,
|
||||
this.isActive,
|
||||
this.latitude,
|
||||
this.locationID,
|
||||
this.locationName,
|
||||
this.locationNameN,
|
||||
this.locationType,
|
||||
this.longitude,
|
||||
this.pharmacyLocationID,
|
||||
this.phoneNumber,
|
||||
this.projectID,
|
||||
this.projectImageURL,
|
||||
this.setupID,
|
||||
this.sortOrder});
|
||||
|
||||
GetHMGLocationsModel.fromJson(Map<String, dynamic> json) {
|
||||
cityID = json['CityID'];
|
||||
cityName = json['CityName'];
|
||||
cityNameN = json['CityNameN'];
|
||||
distanceInKilometers = json['DistanceInKilometers'];
|
||||
isActive = json['IsActive'];
|
||||
latitude = json['Latitude'];
|
||||
locationID = json['LocationID'];
|
||||
locationName = json['LocationName'];
|
||||
locationNameN = json['LocationNameN'];
|
||||
locationType = json['LocationType'];
|
||||
longitude = json['Longitude'];
|
||||
pharmacyLocationID = json['PharmacyLocationID'];
|
||||
phoneNumber = json['PhoneNumber'];
|
||||
projectID = json['ProjectID'];
|
||||
projectImageURL = json['ProjectImageURL'];
|
||||
setupID = json['SetupID'];
|
||||
sortOrder = json['SortOrder'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['CityID'] = this.cityID;
|
||||
data['CityName'] = this.cityName;
|
||||
data['CityNameN'] = this.cityNameN;
|
||||
data['DistanceInKilometers'] = this.distanceInKilometers;
|
||||
data['IsActive'] = this.isActive;
|
||||
data['Latitude'] = this.latitude;
|
||||
data['LocationID'] = this.locationID;
|
||||
data['LocationName'] = this.locationName;
|
||||
data['LocationNameN'] = this.locationNameN;
|
||||
data['LocationType'] = this.locationType;
|
||||
data['Longitude'] = this.longitude;
|
||||
data['PharmacyLocationID'] = this.pharmacyLocationID;
|
||||
data['PhoneNumber'] = this.phoneNumber;
|
||||
data['ProjectID'] = this.projectID;
|
||||
data['ProjectImageURL'] = this.projectImageURL;
|
||||
data['SetupID'] = this.setupID;
|
||||
data['SortOrder'] = this.sortOrder;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -1,48 +0,0 @@
|
||||
import 'package:hmg_patient_app_new/core/utils/date_util.dart';
|
||||
|
||||
class GetPatientICProjectsModel {
|
||||
int? id;
|
||||
String? projectName;
|
||||
String? projectNameN;
|
||||
String? value;
|
||||
dynamic languageId;
|
||||
DateTime? createdOn;
|
||||
String? createdBy;
|
||||
dynamic editedOn;
|
||||
dynamic editedBy;
|
||||
bool? isActive;
|
||||
dynamic distanceInKilometers;
|
||||
|
||||
GetPatientICProjectsModel(
|
||||
{this.id, this.projectName, this.projectNameN, this.value, this.languageId, this.createdOn, this.createdBy, this.editedOn, this.editedBy, this.distanceInKilometers, this.isActive});
|
||||
|
||||
GetPatientICProjectsModel.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
projectName = json['ProjectName'];
|
||||
projectNameN = json['ProjectNameN'];
|
||||
value = json['Value'];
|
||||
languageId = json['LanguageId'];
|
||||
createdOn = DateUtil.convertStringToDate(json['CreatedOn']);
|
||||
createdBy = json['CreatedBy'];
|
||||
editedOn = json['EditedOn'];
|
||||
editedBy = json['EditedBy'];
|
||||
isActive = json['IsActive'];
|
||||
distanceInKilometers = json['DistanceInKilometers'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['id'] = this.id;
|
||||
data['ProjectName'] = this.projectName;
|
||||
data['ProjectNameN'] = this.projectNameN;
|
||||
data['Value'] = this.value;
|
||||
data['LanguageId'] = this.languageId;
|
||||
data['CreatedOn'] = this.createdOn;
|
||||
data['CreatedBy'] = this.createdBy;
|
||||
data['EditedOn'] = this.editedOn;
|
||||
data['EditedBy'] = this.editedBy;
|
||||
data['IsActive'] = this.isActive;
|
||||
data['DistanceInKilometers'] = this.distanceInKilometers;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -1,4 +0,0 @@
|
||||
enum AmbulanceCallingPlace{
|
||||
FROM_HOSPITAL,
|
||||
TO_HOSPITAL
|
||||
}
|
||||
@ -1,3 +0,0 @@
|
||||
enum OrderDislpay{
|
||||
ALL,RRT,AMBULANCE
|
||||
}
|
||||
@ -1,3 +0,0 @@
|
||||
enum AmbulanceDirection{
|
||||
ONE_WAY, TWO_WAY
|
||||
}
|
||||
@ -1,205 +0,0 @@
|
||||
|
||||
import 'package:hmg_patient_app_new/features/emergency_services/models/resp_model/PatientERTransportationMethod.dart' show PatientERTransportationMethod;
|
||||
|
||||
class PatientER_RC {
|
||||
double? versionID;
|
||||
int? channel;
|
||||
int? languageID;
|
||||
String? iPAdress;
|
||||
String? generalid;
|
||||
bool? patientOutSA;
|
||||
String? sessionID;
|
||||
bool? isDentalAllowedBackend;
|
||||
int? deviceTypeID;
|
||||
int? patientID;
|
||||
String? tokenID;
|
||||
int? patientTypeID;
|
||||
int? patientType;
|
||||
int? orderServiceID;
|
||||
String? patientIdentificationID;
|
||||
dynamic patientOutSa;
|
||||
int? projectID;
|
||||
int? lineItemNo;
|
||||
TransportationDetails? transportationDetails;
|
||||
PatientERTransportationMethod? patientERTransportationMethod;
|
||||
|
||||
PatientER_RC(
|
||||
{this.versionID,
|
||||
this.channel,
|
||||
this.languageID,
|
||||
this.iPAdress,
|
||||
this.generalid,
|
||||
this.patientOutSA,
|
||||
this.sessionID,
|
||||
this.isDentalAllowedBackend,
|
||||
this.deviceTypeID,
|
||||
this.patientID,
|
||||
this.tokenID,
|
||||
this.patientTypeID,
|
||||
this.patientType,
|
||||
this.orderServiceID,
|
||||
this.patientIdentificationID,
|
||||
this.patientOutSa,
|
||||
this.projectID,
|
||||
this.lineItemNo,
|
||||
this.transportationDetails });
|
||||
|
||||
PatientER_RC.fromJson(Map<String, dynamic> json) {
|
||||
versionID = json['VersionID'];
|
||||
channel = json['Channel'];
|
||||
languageID = json['LanguageID'];
|
||||
iPAdress = json['IPAdress'];
|
||||
generalid = json['generalid'];
|
||||
patientOutSA = json['PatientOutSA'];
|
||||
sessionID = json['SessionID'];
|
||||
isDentalAllowedBackend = json['isDentalAllowedBackend'];
|
||||
deviceTypeID = json['DeviceTypeID'];
|
||||
patientID = json['PatientID'];
|
||||
tokenID = json['TokenID'];
|
||||
patientTypeID = json['PatientTypeID'];
|
||||
patientType = json['PatientType'];
|
||||
orderServiceID = json['OrderServiceID'];
|
||||
patientIdentificationID = json['PatientIdentificationID'];
|
||||
patientOutSa = json['patientOutSa'];
|
||||
projectID = json['projectID'];
|
||||
lineItemNo = json['lineItemNo'];
|
||||
transportationDetails = json['transportationDetails'] != null
|
||||
? new TransportationDetails.fromJson(json['transportationDetails'])
|
||||
: null;
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['VersionID'] = this.versionID;
|
||||
data['Channel'] = this.channel;
|
||||
data['LanguageID'] = this.languageID;
|
||||
data['IPAdress'] = this.iPAdress;
|
||||
data['generalid'] = this.generalid;
|
||||
data['PatientOutSA'] = this.patientOutSA;
|
||||
data['SessionID'] = this.sessionID;
|
||||
data['isDentalAllowedBackend'] = this.isDentalAllowedBackend;
|
||||
data['DeviceTypeID'] = this.deviceTypeID;
|
||||
data['PatientID'] = this.patientID;
|
||||
data['TokenID'] = this.tokenID;
|
||||
data['PatientTypeID'] = this.patientTypeID;
|
||||
data['PatientType'] = this.patientType;
|
||||
data['OrderServiceID'] = this.orderServiceID;
|
||||
data['PatientIdentificationID'] = this.patientIdentificationID;
|
||||
data['patientOutSa'] = this.patientOutSa;
|
||||
data['projectID'] = this.projectID;
|
||||
data['lineItemNo'] = this.lineItemNo;
|
||||
if (this.transportationDetails != null) {
|
||||
data['transportationDetails'] = this.transportationDetails!.toJson();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class TransportationDetails {
|
||||
int? direction;
|
||||
int? haveAppointment;
|
||||
int? tripType;
|
||||
int? pickupUrgency;
|
||||
int? pickupSpot;
|
||||
String? pickupDateTime;
|
||||
String? transportationType;
|
||||
int? ambulate;
|
||||
String? ambulateTitle;
|
||||
String? notes;
|
||||
int? requesterFileNo;
|
||||
String? requesterMobileNo;
|
||||
bool? requesterIsOutSA;
|
||||
String? pickupLocationName;
|
||||
String? dropoffLocationName;
|
||||
String? pickupLatitude;
|
||||
String? pickupLongitude;
|
||||
String? dropoffLatitude;
|
||||
String? dropoffLongitude;
|
||||
String? appointmentNo;
|
||||
String? appointmentClinicName;
|
||||
String? appointmentDoctorName;
|
||||
String? appointmentBranch;
|
||||
String? appointmentTime;
|
||||
|
||||
TransportationDetails(
|
||||
{this.direction,
|
||||
this.haveAppointment = 0,
|
||||
this.tripType,
|
||||
this.pickupUrgency,
|
||||
this.pickupSpot,
|
||||
this.pickupDateTime,
|
||||
this.transportationType,
|
||||
this.ambulate,
|
||||
this.ambulateTitle,
|
||||
this.notes,
|
||||
this.requesterFileNo,
|
||||
this.requesterMobileNo,
|
||||
this.requesterIsOutSA,
|
||||
this.pickupLocationName,
|
||||
this.dropoffLocationName,
|
||||
this.pickupLatitude,
|
||||
this.pickupLongitude,
|
||||
this.dropoffLatitude,
|
||||
this.dropoffLongitude,
|
||||
this.appointmentNo = "0",
|
||||
this.appointmentClinicName = "",
|
||||
this.appointmentDoctorName = "",
|
||||
this.appointmentBranch = "",
|
||||
this.appointmentTime = ""});
|
||||
|
||||
TransportationDetails.fromJson(Map<String, dynamic> json) {
|
||||
direction = json['direction'];
|
||||
haveAppointment = json['haveAppointment'];
|
||||
tripType = json['tripType'];
|
||||
pickupUrgency = json['pickupUrgency'];
|
||||
pickupSpot = json['pickupSpot'];
|
||||
pickupDateTime = json['pickupDateTime'];
|
||||
transportationType = json['transportationType'];
|
||||
ambulate = json['ambulate'];
|
||||
ambulateTitle = "";
|
||||
notes = json['notes'];
|
||||
requesterFileNo = json['requesterFileNo'];
|
||||
requesterMobileNo = json['requesterMobileNo'];
|
||||
requesterIsOutSA = json['requesterIsOutSA'];
|
||||
pickupLocationName = json['pickupLocationName'];
|
||||
dropoffLocationName = json['dropoffLocationName'];
|
||||
pickupLatitude = json['pickup_Latitude'];
|
||||
pickupLongitude = json['pickup_Longitude'];
|
||||
dropoffLatitude = json['dropoff_Latitude'];
|
||||
dropoffLongitude = json['dropoff_Longitude'];
|
||||
appointmentNo = json['appointmentNo'];
|
||||
appointmentClinicName = json['appointmentClinicName'];
|
||||
appointmentDoctorName = json['appointmentDoctorName'];
|
||||
appointmentBranch = json['appointmentBranch'];
|
||||
appointmentTime = json['appointmentTime'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['direction'] = this.direction;
|
||||
data['haveAppointment'] = this.haveAppointment;
|
||||
data['tripType'] = this.tripType;
|
||||
data['pickupUrgency'] = this.pickupUrgency;
|
||||
data['pickupSpot'] = this.pickupSpot;
|
||||
data['pickupDateTime'] = this.pickupDateTime;
|
||||
data['transportationType'] = this.transportationType;
|
||||
data['ambulate'] = this.ambulate;
|
||||
data['ambulateTitle'] = this.ambulateTitle;
|
||||
data['notes'] = this.notes;
|
||||
data['requesterFileNo'] = this.requesterFileNo;
|
||||
data['requesterMobileNo'] = this.requesterMobileNo;
|
||||
data['requesterIsOutSA'] = this.requesterIsOutSA;
|
||||
data['pickupLocationName'] = this.pickupLocationName;
|
||||
data['dropoffLocationName'] = this.dropoffLocationName;
|
||||
data['pickup_Latitude'] = this.pickupLatitude;
|
||||
data['pickup_Longitude'] = this.pickupLongitude;
|
||||
data['dropoff_Latitude'] = this.dropoffLatitude;
|
||||
data['dropoff_Longitude'] = this.dropoffLongitude;
|
||||
data['appointmentNo'] = this.appointmentNo;
|
||||
data['appointmentClinicName'] = this.appointmentClinicName;
|
||||
data['appointmentDoctorName'] = this.appointmentDoctorName;
|
||||
data['appointmentBranch'] = this.appointmentBranch;
|
||||
data['appointmentTime'] = this.appointmentTime;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -1,75 +0,0 @@
|
||||
class RRTRequestModel {
|
||||
num? patientId;
|
||||
int? patientOutSa;
|
||||
bool? isOutPatient;
|
||||
int? nearestProjectId;
|
||||
num? longitude;
|
||||
num? latitude;
|
||||
String? additionalDetails;
|
||||
String? nationality;
|
||||
num? paymentAmount;
|
||||
List<Procedures>? procedures;
|
||||
|
||||
RRTRequestModel(
|
||||
{this.patientId,
|
||||
this.patientOutSa,
|
||||
this.isOutPatient,
|
||||
this.nearestProjectId,
|
||||
this.longitude,
|
||||
this.latitude,
|
||||
this.additionalDetails,
|
||||
this.nationality,
|
||||
this.paymentAmount,
|
||||
this.procedures});
|
||||
|
||||
RRTRequestModel.fromJson(Map<String, dynamic> json) {
|
||||
patientId = json['patientId'];
|
||||
patientOutSa = json['patientOutSa'];
|
||||
isOutPatient = json['isOutPatient'];
|
||||
nearestProjectId = json['nearestProjectId'];
|
||||
longitude = json['longitude'];
|
||||
latitude = json['latitude'];
|
||||
additionalDetails = json['additionalDetails'];
|
||||
nationality = json['nationality'];
|
||||
paymentAmount = json['paymentAmount'];
|
||||
if (json['procedures'] != null) {
|
||||
procedures = <Procedures>[];
|
||||
json['procedures'].forEach((v) {
|
||||
procedures!.add(new Procedures.fromJson(v));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['patientId'] = this.patientId;
|
||||
data['patientOutSa'] = this.patientOutSa;
|
||||
data['isOutPatient'] = this.isOutPatient;
|
||||
data['nearestProjectId'] = this.nearestProjectId;
|
||||
data['longitude'] = this.longitude;
|
||||
data['latitude'] = this.latitude;
|
||||
data['additionalDetails'] = this.additionalDetails;
|
||||
data['nationality'] = this.nationality;
|
||||
data['paymentAmount'] = this.paymentAmount;
|
||||
if (this.procedures != null) {
|
||||
data['procedures'] = this.procedures!.map((v) => v.toJson()).toList();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class Procedures {
|
||||
String? serviceID;
|
||||
|
||||
Procedures({this.serviceID});
|
||||
|
||||
Procedures.fromJson(Map<String, dynamic> json) {
|
||||
serviceID = json['ServiceID'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['ServiceID'] = this.serviceID;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -1,53 +0,0 @@
|
||||
class ServicePrice {
|
||||
String? currency;
|
||||
dynamic maxPrice;
|
||||
dynamic maxTotalPrice;
|
||||
dynamic maxVAT;
|
||||
dynamic minPrice;
|
||||
dynamic minTotalPrice;
|
||||
dynamic minVAT;
|
||||
dynamic price;
|
||||
dynamic totalPrice;
|
||||
dynamic vat;
|
||||
|
||||
ServicePrice({
|
||||
this.currency,
|
||||
this.maxPrice,
|
||||
this.maxTotalPrice,
|
||||
this.maxVAT,
|
||||
this.minPrice,
|
||||
this.minTotalPrice,
|
||||
this.minVAT,
|
||||
this.price,
|
||||
this.totalPrice,
|
||||
this.vat});
|
||||
|
||||
ServicePrice.fromJson(dynamic json) {
|
||||
currency = json["Currency"];
|
||||
maxPrice = json["MaxPrice"];
|
||||
maxTotalPrice = json["MaxTotalPrice"];
|
||||
maxVAT = json["MaxVAT"];
|
||||
minPrice = json["MinPrice"];
|
||||
minTotalPrice = json["MinTotalPrice"];
|
||||
minVAT = json["MinVAT"];
|
||||
price = json["Price"];
|
||||
totalPrice = json["TotalPrice"];
|
||||
vat = json["VAT"];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
var map = <String, dynamic>{};
|
||||
map["Currency"] = currency;
|
||||
map["MaxPrice"] = maxPrice;
|
||||
map["MaxTotalPrice"] = maxTotalPrice;
|
||||
map["MaxVAT"] = maxVAT;
|
||||
map["MinPrice"] = minPrice;
|
||||
map["MinTotalPrice"] = minTotalPrice;
|
||||
map["MinVAT"] = minVAT;
|
||||
map["Price"] = price;
|
||||
map["TotalPrice"] = totalPrice;
|
||||
map["VAT"] = vat;
|
||||
return map;
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,346 +0,0 @@
|
||||
class AmbulanceRequestOrdersModel {
|
||||
String? statusText;
|
||||
num? paymentStatus;
|
||||
dynamic clientRequestid;
|
||||
dynamic paymentStatusText;
|
||||
dynamic projectName;
|
||||
String? nearestProjectName;
|
||||
num? paymentAmount;
|
||||
WFOrder? wFOrder;
|
||||
String? serviceText;
|
||||
bool? isSentForApproval;
|
||||
num? exaCartOrderId;
|
||||
String? exaCartGUID;
|
||||
bool? isTimer;
|
||||
num? timeSeconds;
|
||||
num? totalPendingSeconds;
|
||||
num? timeMinute;
|
||||
num? timeHour;
|
||||
num? timeTotalSeconds;
|
||||
num? timeTotalMinute;
|
||||
num? timeTotalHour;
|
||||
dynamic approvalStatus;
|
||||
bool? isActive;
|
||||
num? clickButton;
|
||||
dynamic orderHistory;
|
||||
String? pickupLocation;
|
||||
String? dropOffLocation;
|
||||
String? clinicName;
|
||||
String? doctorName;
|
||||
String? branch;
|
||||
String? time;
|
||||
String? notes;
|
||||
int? iD;
|
||||
num? patientId;
|
||||
num? patientOutSa;
|
||||
bool? isOutPatient;
|
||||
num? projectId;
|
||||
num? nearestProjectId;
|
||||
dynamic longitude;
|
||||
dynamic latitude;
|
||||
dynamic appointmentNo;
|
||||
dynamic dischargeId;
|
||||
int? statusId;
|
||||
num? serviceId;
|
||||
num? channel;
|
||||
Orderpayment? orderpayment;
|
||||
dynamic wforder;
|
||||
dynamic orderapprovalobj;
|
||||
String? created;
|
||||
dynamic createdBy;
|
||||
dynamic modified;
|
||||
dynamic modifiedBy;
|
||||
bool? isDeleted;
|
||||
|
||||
AmbulanceRequestOrdersModel(
|
||||
{this.statusText,
|
||||
this.paymentStatus,
|
||||
this.clientRequestid,
|
||||
this.paymentStatusText,
|
||||
this.projectName,
|
||||
this.nearestProjectName,
|
||||
this.paymentAmount,
|
||||
this.wFOrder,
|
||||
this.serviceText,
|
||||
this.isSentForApproval,
|
||||
this.exaCartOrderId,
|
||||
this.exaCartGUID,
|
||||
this.isTimer,
|
||||
this.timeSeconds,
|
||||
this.totalPendingSeconds,
|
||||
this.timeMinute,
|
||||
this.timeHour,
|
||||
this.timeTotalSeconds,
|
||||
this.timeTotalMinute,
|
||||
this.timeTotalHour,
|
||||
this.approvalStatus,
|
||||
this.isActive,
|
||||
this.clickButton,
|
||||
this.orderHistory,
|
||||
this.pickupLocation,
|
||||
this.dropOffLocation,
|
||||
this.clinicName,
|
||||
this.doctorName,
|
||||
this.branch,
|
||||
this.time,
|
||||
this.notes,
|
||||
this.iD,
|
||||
this.patientId,
|
||||
this.patientOutSa,
|
||||
this.isOutPatient,
|
||||
this.projectId,
|
||||
this.nearestProjectId,
|
||||
this.longitude,
|
||||
this.latitude,
|
||||
this.appointmentNo,
|
||||
this.dischargeId,
|
||||
this.statusId,
|
||||
this.serviceId,
|
||||
this.channel,
|
||||
this.orderpayment,
|
||||
this.wforder,
|
||||
this.orderapprovalobj,
|
||||
this.created,
|
||||
this.createdBy,
|
||||
this.modified,
|
||||
this.modifiedBy,
|
||||
this.isDeleted});
|
||||
|
||||
AmbulanceRequestOrdersModel.fromJson(Map<String, dynamic> json) {
|
||||
statusText = json['StatusText'];
|
||||
paymentStatus = json['PaymentStatus'];
|
||||
clientRequestid = json['ClientRequestid'];
|
||||
paymentStatusText = json['PaymentStatusText'];
|
||||
projectName = json['ProjectName'];
|
||||
nearestProjectName = json['NearestProjectName'];
|
||||
paymentAmount = json['PaymentAmount'];
|
||||
wFOrder = json['WF_order'] != null
|
||||
? new WFOrder.fromJson(json['WF_order'])
|
||||
: null;
|
||||
serviceText = json['ServiceText'];
|
||||
isSentForApproval = json['isSentForApproval'];
|
||||
exaCartOrderId = json['ExaCart_OrderId'];
|
||||
exaCartGUID = json['ExaCart_GUID'];
|
||||
isTimer = json['isTimer'];
|
||||
timeSeconds = json['TimeSeconds'];
|
||||
totalPendingSeconds = json['TotalPendingSeconds'];
|
||||
timeMinute = json['TimeMinute'];
|
||||
timeHour = json['TimeHour'];
|
||||
timeTotalSeconds = json['TimeTotalSeconds'];
|
||||
timeTotalMinute = json['TimeTotalMinute'];
|
||||
timeTotalHour = json['TimeTotalHour'];
|
||||
approvalStatus = json['ApprovalStatus'];
|
||||
isActive = json['isActive'];
|
||||
clickButton = json['ClickButton'];
|
||||
orderHistory = json['OrderHistory'];
|
||||
pickupLocation = json['PickupLocation'];
|
||||
dropOffLocation = json['DropOffLocation'];
|
||||
clinicName = json['clinicName'];
|
||||
doctorName = json['DoctorName'];
|
||||
branch = json['Branch'];
|
||||
time = json['Time'];
|
||||
notes = json['Notes'];
|
||||
iD = json['ID'];
|
||||
patientId = json['PatientId'];
|
||||
patientOutSa = json['PatientOutSa'];
|
||||
isOutPatient = json['IsOutPatient'];
|
||||
projectId = json['ProjectId'];
|
||||
nearestProjectId = json['NearestProjectId'];
|
||||
longitude = json['Longitude'];
|
||||
latitude = json['Latitude'];
|
||||
appointmentNo = json['AppointmentNo'];
|
||||
dischargeId = json['DischargeId'];
|
||||
statusId = json['StatusId'];
|
||||
serviceId = json['ServiceId'];
|
||||
channel = json['Channel'];
|
||||
orderpayment = json['orderpayment'] != null
|
||||
? new Orderpayment.fromJson(json['orderpayment'])
|
||||
: null;
|
||||
wforder = json['wforder'];
|
||||
orderapprovalobj = json['orderapprovalobj'];
|
||||
created = json['Created'];
|
||||
createdBy = json['CreatedBy'];
|
||||
modified = json['Modified'];
|
||||
modifiedBy = json['ModifiedBy'];
|
||||
isDeleted = json['IsDeleted'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['StatusText'] = this.statusText;
|
||||
data['PaymentStatus'] = this.paymentStatus;
|
||||
data['ClientRequestid'] = this.clientRequestid;
|
||||
data['PaymentStatusText'] = this.paymentStatusText;
|
||||
data['ProjectName'] = this.projectName;
|
||||
data['NearestProjectName'] = this.nearestProjectName;
|
||||
data['PaymentAmount'] = this.paymentAmount;
|
||||
if (this.wFOrder != null) {
|
||||
data['WF_order'] = this.wFOrder!.toJson();
|
||||
}
|
||||
data['ServiceText'] = this.serviceText;
|
||||
data['isSentForApproval'] = this.isSentForApproval;
|
||||
data['ExaCart_OrderId'] = this.exaCartOrderId;
|
||||
data['ExaCart_GUID'] = this.exaCartGUID;
|
||||
data['isTimer'] = this.isTimer;
|
||||
data['TimeSeconds'] = this.timeSeconds;
|
||||
data['TotalPendingSeconds'] = this.totalPendingSeconds;
|
||||
data['TimeMinute'] = this.timeMinute;
|
||||
data['TimeHour'] = this.timeHour;
|
||||
data['TimeTotalSeconds'] = this.timeTotalSeconds;
|
||||
data['TimeTotalMinute'] = this.timeTotalMinute;
|
||||
data['TimeTotalHour'] = this.timeTotalHour;
|
||||
data['ApprovalStatus'] = this.approvalStatus;
|
||||
data['isActive'] = this.isActive;
|
||||
data['ClickButton'] = this.clickButton;
|
||||
data['OrderHistory'] = this.orderHistory;
|
||||
data['PickupLocation'] = this.pickupLocation;
|
||||
data['DropOffLocation'] = this.dropOffLocation;
|
||||
data['clinicName'] = this.clinicName;
|
||||
data['DoctorName'] = this.doctorName;
|
||||
data['Branch'] = this.branch;
|
||||
data['Time'] = this.time;
|
||||
data['Notes'] = this.notes;
|
||||
data['ID'] = this.iD;
|
||||
data['PatientId'] = this.patientId;
|
||||
data['PatientOutSa'] = this.patientOutSa;
|
||||
data['IsOutPatient'] = this.isOutPatient;
|
||||
data['ProjectId'] = this.projectId;
|
||||
data['NearestProjectId'] = this.nearestProjectId;
|
||||
data['Longitude'] = this.longitude;
|
||||
data['Latitude'] = this.latitude;
|
||||
data['AppointmentNo'] = this.appointmentNo;
|
||||
data['DischargeId'] = this.dischargeId;
|
||||
data['StatusId'] = this.statusId;
|
||||
data['ServiceId'] = this.serviceId;
|
||||
data['Channel'] = this.channel;
|
||||
if (this.orderpayment != null) {
|
||||
data['orderpayment'] = this.orderpayment!.toJson();
|
||||
}
|
||||
data['wforder'] = this.wforder;
|
||||
data['orderapprovalobj'] = this.orderapprovalobj;
|
||||
data['Created'] = this.created;
|
||||
data['CreatedBy'] = this.createdBy;
|
||||
data['Modified'] = this.modified;
|
||||
data['ModifiedBy'] = this.modifiedBy;
|
||||
data['IsDeleted'] = this.isDeleted;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class WFOrder {
|
||||
dynamic wfButtonsDTO;
|
||||
num? iD;
|
||||
num? orderId;
|
||||
num? previousStep;
|
||||
num? nextStep;
|
||||
num? serviceId;
|
||||
dynamic order;
|
||||
String? created;
|
||||
dynamic createdBy;
|
||||
dynamic modified;
|
||||
dynamic modifiedBy;
|
||||
bool? isDeleted;
|
||||
|
||||
WFOrder(
|
||||
{this.wfButtonsDTO,
|
||||
this.iD,
|
||||
this.orderId,
|
||||
this.previousStep,
|
||||
this.nextStep,
|
||||
this.serviceId,
|
||||
this.order,
|
||||
this.created,
|
||||
this.createdBy,
|
||||
this.modified,
|
||||
this.modifiedBy,
|
||||
this.isDeleted});
|
||||
|
||||
WFOrder.fromJson(Map<String, dynamic> json) {
|
||||
wfButtonsDTO = json['wf_ButtonsDTO'];
|
||||
iD = json['ID'];
|
||||
orderId = json['OrderId'];
|
||||
previousStep = json['PreviousStep'];
|
||||
nextStep = json['NextStep'];
|
||||
serviceId = json['ServiceId'];
|
||||
order = json['Order'];
|
||||
created = json['Created'];
|
||||
createdBy = json['CreatedBy'];
|
||||
modified = json['Modified'];
|
||||
modifiedBy = json['ModifiedBy'];
|
||||
isDeleted = json['IsDeleted'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['wf_ButtonsDTO'] = this.wfButtonsDTO;
|
||||
data['ID'] = this.iD;
|
||||
data['OrderId'] = this.orderId;
|
||||
data['PreviousStep'] = this.previousStep;
|
||||
data['NextStep'] = this.nextStep;
|
||||
data['ServiceId'] = this.serviceId;
|
||||
data['Order'] = this.order;
|
||||
data['Created'] = this.created;
|
||||
data['CreatedBy'] = this.createdBy;
|
||||
data['Modified'] = this.modified;
|
||||
data['ModifiedBy'] = this.modifiedBy;
|
||||
data['IsDeleted'] = this.isDeleted;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class Orderpayment {
|
||||
num? iD;
|
||||
num? orderId;
|
||||
dynamic clientRequestId;
|
||||
num? totalAmount;
|
||||
num? paymentStatus;
|
||||
dynamic order;
|
||||
String? created;
|
||||
dynamic createdBy;
|
||||
dynamic modified;
|
||||
dynamic modifiedBy;
|
||||
bool? isDeleted;
|
||||
|
||||
Orderpayment(
|
||||
{this.iD,
|
||||
this.orderId,
|
||||
this.clientRequestId,
|
||||
this.totalAmount,
|
||||
this.paymentStatus,
|
||||
this.order,
|
||||
this.created,
|
||||
this.createdBy,
|
||||
this.modified,
|
||||
this.modifiedBy,
|
||||
this.isDeleted});
|
||||
|
||||
Orderpayment.fromJson(Map<String, dynamic> json) {
|
||||
iD = json['ID'];
|
||||
orderId = json['OrderId'];
|
||||
clientRequestId = json['ClientRequestId'];
|
||||
totalAmount = json['TotalAmount'];
|
||||
paymentStatus = json['PaymentStatus'];
|
||||
order = json['Order'];
|
||||
created = json['Created'];
|
||||
createdBy = json['CreatedBy'];
|
||||
modified = json['Modified'];
|
||||
modifiedBy = json['ModifiedBy'];
|
||||
isDeleted = json['IsDeleted'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['ID'] = this.iD;
|
||||
data['OrderId'] = this.orderId;
|
||||
data['ClientRequestId'] = this.clientRequestId;
|
||||
data['TotalAmount'] = this.totalAmount;
|
||||
data['PaymentStatus'] = this.paymentStatus;
|
||||
data['Order'] = this.order;
|
||||
data['Created'] = this.created;
|
||||
data['CreatedBy'] = this.createdBy;
|
||||
data['Modified'] = this.modified;
|
||||
data['ModifiedBy'] = this.modifiedBy;
|
||||
data['IsDeleted'] = this.isDeleted;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -1,108 +0,0 @@
|
||||
class EROnlineCheckInPaymentDetailsResponse {
|
||||
num? cashPrice;
|
||||
num? cashPriceTax;
|
||||
num? cashPriceWithTax;
|
||||
int? companyId;
|
||||
String? companyName;
|
||||
num? companyShareWithTax;
|
||||
dynamic errCode;
|
||||
int? groupID;
|
||||
String? insurancePolicyNo;
|
||||
String? message;
|
||||
String? patientCardID;
|
||||
num? patientShare;
|
||||
num? patientShareWithTax;
|
||||
num? patientTaxAmount;
|
||||
int? policyId;
|
||||
String? policyName;
|
||||
String? procedureId;
|
||||
String? procedureName;
|
||||
dynamic setupID;
|
||||
int? statusCode;
|
||||
String? subPolicyNo;
|
||||
bool? isCash;
|
||||
bool? isEligible;
|
||||
bool? isInsured;
|
||||
|
||||
EROnlineCheckInPaymentDetailsResponse(
|
||||
{this.cashPrice,
|
||||
this.cashPriceTax,
|
||||
this.cashPriceWithTax,
|
||||
this.companyId,
|
||||
this.companyName,
|
||||
this.companyShareWithTax,
|
||||
this.errCode,
|
||||
this.groupID,
|
||||
this.insurancePolicyNo,
|
||||
this.message,
|
||||
this.patientCardID,
|
||||
this.patientShare,
|
||||
this.patientShareWithTax,
|
||||
this.patientTaxAmount,
|
||||
this.policyId,
|
||||
this.policyName,
|
||||
this.procedureId,
|
||||
this.procedureName,
|
||||
this.setupID,
|
||||
this.statusCode,
|
||||
this.subPolicyNo,
|
||||
this.isCash,
|
||||
this.isEligible,
|
||||
this.isInsured});
|
||||
|
||||
EROnlineCheckInPaymentDetailsResponse.fromJson(Map<String, dynamic> json) {
|
||||
cashPrice = json['CashPrice'];
|
||||
cashPriceTax = json['CashPriceTax'];
|
||||
cashPriceWithTax = json['CashPriceWithTax'];
|
||||
companyId = json['CompanyId'];
|
||||
companyName = json['CompanyName'];
|
||||
companyShareWithTax = json['CompanyShareWithTax'];
|
||||
errCode = json['ErrCode'];
|
||||
groupID = json['GroupID'];
|
||||
insurancePolicyNo = json['InsurancePolicyNo'];
|
||||
message = json['Message'];
|
||||
patientCardID = json['PatientCardID'];
|
||||
patientShare = json['PatientShare'];
|
||||
patientShareWithTax = json['PatientShareWithTax'];
|
||||
patientTaxAmount = json['PatientTaxAmount'];
|
||||
policyId = json['PolicyId'];
|
||||
policyName = json['PolicyName'];
|
||||
procedureId = json['ProcedureId'];
|
||||
procedureName = json['ProcedureName'];
|
||||
setupID = json['SetupID'];
|
||||
statusCode = json['StatusCode'];
|
||||
subPolicyNo = json['SubPolicyNo'];
|
||||
isCash = json['IsCash'];
|
||||
isEligible = json['IsEligible'];
|
||||
isInsured = json['IsInsured'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['CashPrice'] = this.cashPrice;
|
||||
data['CashPriceTax'] = this.cashPriceTax;
|
||||
data['CashPriceWithTax'] = this.cashPriceWithTax;
|
||||
data['CompanyId'] = this.companyId;
|
||||
data['CompanyName'] = this.companyName;
|
||||
data['CompanyShareWithTax'] = this.companyShareWithTax;
|
||||
data['ErrCode'] = this.errCode;
|
||||
data['GroupID'] = this.groupID;
|
||||
data['InsurancePolicyNo'] = this.insurancePolicyNo;
|
||||
data['Message'] = this.message;
|
||||
data['PatientCardID'] = this.patientCardID;
|
||||
data['PatientShare'] = this.patientShare;
|
||||
data['PatientShareWithTax'] = this.patientShareWithTax;
|
||||
data['PatientTaxAmount'] = this.patientTaxAmount;
|
||||
data['PolicyId'] = this.policyId;
|
||||
data['PolicyName'] = this.policyName;
|
||||
data['ProcedureId'] = this.procedureId;
|
||||
data['ProcedureName'] = this.procedureName;
|
||||
data['SetupID'] = this.setupID;
|
||||
data['StatusCode'] = this.statusCode;
|
||||
data['SubPolicyNo'] = this.subPolicyNo;
|
||||
data['IsCash'] = this.isCash;
|
||||
data['IsEligible'] = this.isEligible;
|
||||
data['IsInsured'] = this.isInsured;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -1,56 +0,0 @@
|
||||
class PatientERTransportationMethod {
|
||||
int? iD;
|
||||
String? serviceID;
|
||||
int? orderServiceID;
|
||||
String? text;
|
||||
String? textN;
|
||||
dynamic price;
|
||||
dynamic priceVAT;
|
||||
dynamic priceTotal;
|
||||
bool? isEnabled;
|
||||
int? orderId;
|
||||
int? quantity;
|
||||
|
||||
PatientERTransportationMethod(
|
||||
{this.iD,
|
||||
this.serviceID,
|
||||
this.orderServiceID,
|
||||
this.text,
|
||||
this.textN,
|
||||
this.price,
|
||||
this.priceVAT,
|
||||
this.priceTotal,
|
||||
this.isEnabled,
|
||||
this.orderId,
|
||||
this.quantity});
|
||||
|
||||
PatientERTransportationMethod.fromJson(Map<String, dynamic> json) {
|
||||
iD = json['ID'];
|
||||
serviceID = json['ServiceID'];
|
||||
orderServiceID = json['OrderServiceID'];
|
||||
text = json['Text'];
|
||||
textN = json['TextN'];
|
||||
price = json['Price'];
|
||||
priceVAT = json['PriceVAT'];
|
||||
priceTotal = json['PriceTotal'];
|
||||
isEnabled = json['IsEnabled'];
|
||||
orderId = json['OrderId'];
|
||||
quantity = json['Quantity'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['ID'] = this.iD;
|
||||
data['ServiceID'] = this.serviceID;
|
||||
data['OrderServiceID'] = this.orderServiceID;
|
||||
data['Text'] = this.text;
|
||||
data['TextN'] = this.textN;
|
||||
data['Price'] = this.price;
|
||||
data['PriceVAT'] = this.priceVAT;
|
||||
data['PriceTotal'] = this.priceTotal;
|
||||
data['IsEnabled'] = this.isEnabled;
|
||||
data['OrderId'] = this.orderId;
|
||||
data['Quantity'] = this.quantity;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -1,406 +0,0 @@
|
||||
class RRTServiceData {
|
||||
List<GetCMCAllOrdersResponseModel> pendingOrders = [];
|
||||
List<GetCMCAllOrdersResponseModel> completedOrders = [];
|
||||
ServicePrice servicePrice = ServicePrice();
|
||||
}
|
||||
|
||||
class GetCMCAllOrdersResponseModel {
|
||||
int? iD;
|
||||
int? patientId;
|
||||
int? patientOutSa;
|
||||
bool? isOutPatient;
|
||||
int? projectId;
|
||||
int? nearestProjectId;
|
||||
dynamic longitude;
|
||||
dynamic latitude;
|
||||
dynamic appointmentNo;
|
||||
dynamic dischargeId;
|
||||
int? statusId;
|
||||
int? serviceId;
|
||||
int? channel;
|
||||
Orderpayment? orderpayment;
|
||||
dynamic orderselectedservice;
|
||||
dynamic wforder;
|
||||
dynamic orderapprovalobj;
|
||||
String? created;
|
||||
dynamic createdBy;
|
||||
dynamic modified;
|
||||
dynamic modifiedBy;
|
||||
bool? isDeleted;
|
||||
String? statusText;
|
||||
int? paymentStatus;
|
||||
dynamic clientRequestid;
|
||||
dynamic paymentStatusText;
|
||||
String? projectName;
|
||||
String? nearestProjectName;
|
||||
dynamic paymentAmount;
|
||||
WFOrder? wFOrder;
|
||||
String? serviceText;
|
||||
bool? isSentForApproval;
|
||||
int? exaCartOrderId;
|
||||
bool? isTimer;
|
||||
int? timeSeconds;
|
||||
int? totalPendingSeconds;
|
||||
int? timeMinute;
|
||||
int? timeHour;
|
||||
int? timeTotalSeconds;
|
||||
int? timeTotalMinute;
|
||||
int? timeTotalHour;
|
||||
dynamic approvalStatus;
|
||||
bool? isActive;
|
||||
int? clickButton;
|
||||
List<dynamic>? procedures;
|
||||
dynamic pickupLocation;
|
||||
dynamic dropOffLocation;
|
||||
dynamic clinicName;
|
||||
dynamic doctorName;
|
||||
dynamic branch;
|
||||
dynamic time;
|
||||
dynamic notes;
|
||||
|
||||
GetCMCAllOrdersResponseModel(
|
||||
{this.iD,
|
||||
this.patientId,
|
||||
this.patientOutSa,
|
||||
this.isOutPatient,
|
||||
this.projectId,
|
||||
this.nearestProjectId,
|
||||
this.longitude,
|
||||
this.latitude,
|
||||
this.appointmentNo,
|
||||
this.dischargeId,
|
||||
this.statusId,
|
||||
this.serviceId,
|
||||
this.channel,
|
||||
this.orderpayment,
|
||||
this.orderselectedservice,
|
||||
this.wforder,
|
||||
this.orderapprovalobj,
|
||||
this.created,
|
||||
this.createdBy,
|
||||
this.modified,
|
||||
this.modifiedBy,
|
||||
this.isDeleted,
|
||||
this.statusText,
|
||||
this.paymentStatus,
|
||||
this.clientRequestid,
|
||||
this.paymentStatusText,
|
||||
this.projectName,
|
||||
this.nearestProjectName,
|
||||
this.paymentAmount,
|
||||
this.wFOrder,
|
||||
this.serviceText,
|
||||
this.isSentForApproval,
|
||||
this.exaCartOrderId,
|
||||
this.isTimer,
|
||||
this.timeSeconds,
|
||||
this.totalPendingSeconds,
|
||||
this.timeMinute,
|
||||
this.timeHour,
|
||||
this.timeTotalSeconds,
|
||||
this.timeTotalMinute,
|
||||
this.timeTotalHour,
|
||||
this.approvalStatus,
|
||||
this.isActive,
|
||||
this.clickButton,
|
||||
this.procedures,
|
||||
this.pickupLocation,
|
||||
this.dropOffLocation,
|
||||
this.clinicName,
|
||||
this.doctorName,
|
||||
this.branch,
|
||||
this.time,
|
||||
this.notes});
|
||||
|
||||
GetCMCAllOrdersResponseModel.fromJson(Map<String, dynamic> json) {
|
||||
iD = json['ID'];
|
||||
patientId = json['PatientId'];
|
||||
patientOutSa = json['PatientOutSa'];
|
||||
isOutPatient = json['IsOutPatient'];
|
||||
projectId = json['ProjectId'];
|
||||
nearestProjectId = json['NearestProjectId'];
|
||||
longitude = json['Longitude'];
|
||||
latitude = json['Latitude'];
|
||||
appointmentNo = json['AppointmentNo'];
|
||||
dischargeId = json['DischargeId'];
|
||||
statusId = json['StatusId'];
|
||||
serviceId = json['ServiceId'];
|
||||
channel = json['Channel'];
|
||||
orderpayment = json['orderpayment'] != null
|
||||
? new Orderpayment.fromJson(json['orderpayment'])
|
||||
: null;
|
||||
orderselectedservice = json['orderselectedservice'];
|
||||
wforder = json['wforder'];
|
||||
orderapprovalobj = json['orderapprovalobj'];
|
||||
created = json['Created'];
|
||||
createdBy = json['CreatedBy'];
|
||||
modified = json['Modified'];
|
||||
modifiedBy = json['ModifiedBy'];
|
||||
isDeleted = json['IsDeleted'];
|
||||
statusText = json['StatusText'];
|
||||
paymentStatus = json['PaymentStatus'];
|
||||
clientRequestid = json['ClientRequestid'];
|
||||
paymentStatusText = json['PaymentStatusText'];
|
||||
projectName = json['ProjectName'];
|
||||
nearestProjectName = json['NearestProjectName'];
|
||||
paymentAmount = json['PaymentAmount'];
|
||||
wFOrder = json['WF_order'] != null
|
||||
? new WFOrder.fromJson(json['WF_order'])
|
||||
: null;
|
||||
serviceText = json['ServiceText'];
|
||||
isSentForApproval = json['isSentForApproval'];
|
||||
exaCartOrderId = json['ExaCart_OrderId'];
|
||||
isTimer = json['isTimer'];
|
||||
timeSeconds = json['TimeSeconds'];
|
||||
totalPendingSeconds = json['TotalPendingSeconds'];
|
||||
timeMinute = json['TimeMinute'];
|
||||
timeHour = json['TimeHour'];
|
||||
timeTotalSeconds = json['TimeTotalSeconds'];
|
||||
timeTotalMinute = json['TimeTotalMinute'];
|
||||
timeTotalHour = json['TimeTotalHour'];
|
||||
approvalStatus = json['ApprovalStatus'];
|
||||
isActive = json['isActive'];
|
||||
clickButton = json['ClickButton'];
|
||||
pickupLocation = json['PickupLocation'];
|
||||
dropOffLocation = json['DropOffLocation'];
|
||||
clinicName = json['clinicName'];
|
||||
doctorName = json['DoctorName'];
|
||||
branch = json['Branch'];
|
||||
time = json['Time'];
|
||||
notes = json['Notes'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['ID'] = this.iD;
|
||||
data['PatientId'] = this.patientId;
|
||||
data['PatientOutSa'] = this.patientOutSa;
|
||||
data['IsOutPatient'] = this.isOutPatient;
|
||||
data['ProjectId'] = this.projectId;
|
||||
data['NearestProjectId'] = this.nearestProjectId;
|
||||
data['Longitude'] = this.longitude;
|
||||
data['Latitude'] = this.latitude;
|
||||
data['AppointmentNo'] = this.appointmentNo;
|
||||
data['DischargeId'] = this.dischargeId;
|
||||
data['StatusId'] = this.statusId;
|
||||
data['ServiceId'] = this.serviceId;
|
||||
data['Channel'] = this.channel;
|
||||
if (this.orderpayment != null) {
|
||||
data['orderpayment'] = this.orderpayment!.toJson();
|
||||
}
|
||||
data['orderselectedservice'] = this.orderselectedservice;
|
||||
|
||||
data['wforder'] = this.wforder;
|
||||
data['orderapprovalobj'] = this.orderapprovalobj;
|
||||
data['Created'] = this.created;
|
||||
data['CreatedBy'] = this.createdBy;
|
||||
data['Modified'] = this.modified;
|
||||
data['ModifiedBy'] = this.modifiedBy;
|
||||
data['IsDeleted'] = this.isDeleted;
|
||||
data['StatusText'] = this.statusText;
|
||||
data['PaymentStatus'] = this.paymentStatus;
|
||||
data['ClientRequestid'] = this.clientRequestid;
|
||||
data['PaymentStatusText'] = this.paymentStatusText;
|
||||
data['ProjectName'] = this.projectName;
|
||||
data['NearestProjectName'] = this.nearestProjectName;
|
||||
data['PaymentAmount'] = this.paymentAmount;
|
||||
if (this.wFOrder != null) {
|
||||
data['WF_order'] = this.wFOrder!.toJson();
|
||||
}
|
||||
data['ServiceText'] = this.serviceText;
|
||||
data['isSentForApproval'] = this.isSentForApproval;
|
||||
data['ExaCart_OrderId'] = this.exaCartOrderId;
|
||||
data['isTimer'] = this.isTimer;
|
||||
data['TimeSeconds'] = this.timeSeconds;
|
||||
data['TotalPendingSeconds'] = this.totalPendingSeconds;
|
||||
data['TimeMinute'] = this.timeMinute;
|
||||
data['TimeHour'] = this.timeHour;
|
||||
data['TimeTotalSeconds'] = this.timeTotalSeconds;
|
||||
data['TimeTotalMinute'] = this.timeTotalMinute;
|
||||
data['TimeTotalHour'] = this.timeTotalHour;
|
||||
data['ApprovalStatus'] = this.approvalStatus;
|
||||
data['isActive'] = this.isActive;
|
||||
data['ClickButton'] = this.clickButton;
|
||||
data['PickupLocation'] = this.pickupLocation;
|
||||
data['DropOffLocation'] = this.dropOffLocation;
|
||||
data['clinicName'] = this.clinicName;
|
||||
data['DoctorName'] = this.doctorName;
|
||||
data['Branch'] = this.branch;
|
||||
data['Time'] = this.time;
|
||||
data['Notes'] = this.notes;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class Orderpayment {
|
||||
int? iD;
|
||||
int? orderId;
|
||||
dynamic clientRequestId;
|
||||
dynamic totalAmount;
|
||||
int? paymentStatus;
|
||||
dynamic order;
|
||||
String? created;
|
||||
dynamic createdBy;
|
||||
dynamic modified;
|
||||
dynamic modifiedBy;
|
||||
bool? isDeleted;
|
||||
|
||||
Orderpayment(
|
||||
{this.iD,
|
||||
this.orderId,
|
||||
this.clientRequestId,
|
||||
this.totalAmount,
|
||||
this.paymentStatus,
|
||||
this.order,
|
||||
this.created,
|
||||
this.createdBy,
|
||||
this.modified,
|
||||
this.modifiedBy,
|
||||
this.isDeleted});
|
||||
|
||||
Orderpayment.fromJson(Map<String, dynamic> json) {
|
||||
iD = json['ID'];
|
||||
orderId = json['OrderId'];
|
||||
clientRequestId = json['ClientRequestId'];
|
||||
totalAmount = json['TotalAmount'];
|
||||
paymentStatus = json['PaymentStatus'];
|
||||
order = json['Order'];
|
||||
created = json['Created'];
|
||||
createdBy = json['CreatedBy'];
|
||||
modified = json['Modified'];
|
||||
modifiedBy = json['ModifiedBy'];
|
||||
isDeleted = json['IsDeleted'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['ID'] = this.iD;
|
||||
data['OrderId'] = this.orderId;
|
||||
data['ClientRequestId'] = this.clientRequestId;
|
||||
data['TotalAmount'] = this.totalAmount;
|
||||
data['PaymentStatus'] = this.paymentStatus;
|
||||
data['Order'] = this.order;
|
||||
data['Created'] = this.created;
|
||||
data['CreatedBy'] = this.createdBy;
|
||||
data['Modified'] = this.modified;
|
||||
data['ModifiedBy'] = this.modifiedBy;
|
||||
data['IsDeleted'] = this.isDeleted;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class WFOrder {
|
||||
dynamic wfButtonsDTO;
|
||||
int? iD;
|
||||
int? orderId;
|
||||
int? previousStep;
|
||||
int? nextStep;
|
||||
int? serviceId;
|
||||
dynamic order;
|
||||
String? created;
|
||||
dynamic createdBy;
|
||||
dynamic modified;
|
||||
dynamic modifiedBy;
|
||||
bool? isDeleted;
|
||||
|
||||
WFOrder(
|
||||
{this.wfButtonsDTO,
|
||||
this.iD,
|
||||
this.orderId,
|
||||
this.previousStep,
|
||||
this.nextStep,
|
||||
this.serviceId,
|
||||
this.order,
|
||||
this.created,
|
||||
this.createdBy,
|
||||
this.modified,
|
||||
this.modifiedBy,
|
||||
this.isDeleted});
|
||||
|
||||
WFOrder.fromJson(Map<String, dynamic> json) {
|
||||
wfButtonsDTO = json['wf_ButtonsDTO'];
|
||||
iD = json['ID'];
|
||||
orderId = json['OrderId'];
|
||||
previousStep = json['PreviousStep'];
|
||||
nextStep = json['NextStep'];
|
||||
serviceId = json['ServiceId'];
|
||||
order = json['Order'];
|
||||
created = json['Created'];
|
||||
createdBy = json['CreatedBy'];
|
||||
modified = json['Modified'];
|
||||
modifiedBy = json['ModifiedBy'];
|
||||
isDeleted = json['IsDeleted'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['wf_ButtonsDTO'] = this.wfButtonsDTO;
|
||||
data['ID'] = this.iD;
|
||||
data['OrderId'] = this.orderId;
|
||||
data['PreviousStep'] = this.previousStep;
|
||||
data['NextStep'] = this.nextStep;
|
||||
data['ServiceId'] = this.serviceId;
|
||||
data['Order'] = this.order;
|
||||
data['Created'] = this.created;
|
||||
data['CreatedBy'] = this.createdBy;
|
||||
data['Modified'] = this.modified;
|
||||
data['ModifiedBy'] = this.modifiedBy;
|
||||
data['IsDeleted'] = this.isDeleted;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class ServicePrice {
|
||||
String? currency;
|
||||
dynamic maxPrice;
|
||||
dynamic maxTotalPrice;
|
||||
dynamic maxVAT;
|
||||
dynamic minPrice;
|
||||
dynamic minTotalPrice;
|
||||
dynamic minVAT;
|
||||
dynamic price;
|
||||
dynamic totalPrice;
|
||||
dynamic vat;
|
||||
|
||||
ServicePrice({
|
||||
this.currency,
|
||||
this.maxPrice,
|
||||
this.maxTotalPrice,
|
||||
this.maxVAT,
|
||||
this.minPrice,
|
||||
this.minTotalPrice,
|
||||
this.minVAT,
|
||||
this.price,
|
||||
this.totalPrice,
|
||||
this.vat});
|
||||
|
||||
ServicePrice.fromJson(dynamic json) {
|
||||
currency = json["Currency"];
|
||||
maxPrice = json["MaxPrice"];
|
||||
maxTotalPrice = json["MaxTotalPrice"];
|
||||
maxVAT = json["MaxVAT"];
|
||||
minPrice = json["MinPrice"];
|
||||
minTotalPrice = json["MinTotalPrice"];
|
||||
minVAT = json["MinVAT"];
|
||||
price = json["Price"];
|
||||
totalPrice = json["TotalPrice"];
|
||||
vat = json["VAT"];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
var map = <String, dynamic>{};
|
||||
map["Currency"] = currency;
|
||||
map["MaxPrice"] = maxPrice;
|
||||
map["MaxTotalPrice"] = maxTotalPrice;
|
||||
map["MaxVAT"] = maxVAT;
|
||||
map["MinPrice"] = minPrice;
|
||||
map["MinTotalPrice"] = minTotalPrice;
|
||||
map["MinVAT"] = minVAT;
|
||||
map["Price"] = price;
|
||||
map["TotalPrice"] = totalPrice;
|
||||
map["VAT"] = vat;
|
||||
return map;
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,522 +0,0 @@
|
||||
import 'dart:developer';
|
||||
|
||||
import 'package:dartz/dartz.dart';
|
||||
import 'package:hmg_patient_app_new/core/api/api_client.dart';
|
||||
import 'package:hmg_patient_app_new/core/api_consts.dart';
|
||||
import 'package:hmg_patient_app_new/core/common_models/generic_api_model.dart';
|
||||
import 'package:hmg_patient_app_new/core/exceptions/api_failure.dart';
|
||||
import 'package:hmg_patient_app_new/features/hmg_services/models/req_models/cmc_create_new_order_req_model.dart';
|
||||
import 'package:hmg_patient_app_new/features/hmg_services/models/req_models/order_update_req_model.dart';
|
||||
import 'package:hmg_patient_app_new/features/hmg_services/models/resq_models/get_cmc_all_orders_resp_model.dart';
|
||||
import 'package:hmg_patient_app_new/features/hmg_services/models/resq_models/get_cmc_services_resp_model.dart';
|
||||
import 'package:hmg_patient_app_new/features/my_appointments/models/resp_models/hospital_model.dart';
|
||||
import 'package:hmg_patient_app_new/services/logger_service.dart';
|
||||
|
||||
abstract class HmgServicesRepo {
|
||||
Future<Either<Failure, GenericApiModel<List<GetCMCAllOrdersResponseModel>>>> getAllComprehensiveCheckupOrders();
|
||||
|
||||
Future<Either<Failure, GenericApiModel<List<GetCMCAllOrdersResponseModel>>>> getAllHomeHealthCareCheckupOrders();
|
||||
|
||||
Future<Either<Failure, GenericApiModel<bool>>> updateCmcPresOrder(OrderUpdateRequestModel requestModel);
|
||||
|
||||
Future<Either<Failure, GenericApiModel<bool>>> updateHhcPresOrder(OrderUpdateRequestModel requestModel);
|
||||
|
||||
Future<Either<Failure, GenericApiModel<List<GetCMCServicesResponseModel>>>> getAllCmcServices({required int patientID});
|
||||
|
||||
Future<Either<Failure, GenericApiModel<List<GetCMCServicesResponseModel>>>> getAllHhcServices({required int patientID});
|
||||
|
||||
Future<Either<Failure, GenericApiModel<List<HospitalsModel>>>> getHospitalsList();
|
||||
|
||||
Future<Either<Failure, GenericApiModel<int>>> addCmcOrder({
|
||||
required int projectID,
|
||||
required int orderServiceID,
|
||||
required List<PatientERCMCInsertServicesList> services,
|
||||
});
|
||||
|
||||
Future<Either<Failure, GenericApiModel<int>>> addHhcOrder({
|
||||
required int projectID,
|
||||
required int orderServiceID,
|
||||
required List<PatientERCMCInsertServicesList> services,
|
||||
});
|
||||
}
|
||||
|
||||
class HmgServicesRepoImp implements HmgServicesRepo {
|
||||
final ApiClient apiClient;
|
||||
final LoggerService loggerService;
|
||||
|
||||
HmgServicesRepoImp({required this.apiClient, required this.loggerService});
|
||||
|
||||
@override
|
||||
Future<Either<Failure, GenericApiModel<List<GetCMCAllOrdersResponseModel>>>> getAllComprehensiveCheckupOrders() async {
|
||||
Map<String, dynamic> requestBody = {};
|
||||
|
||||
try {
|
||||
GenericApiModel<List<GetCMCAllOrdersResponseModel>>? apiResponse;
|
||||
Failure? failure;
|
||||
|
||||
await apiClient.post(
|
||||
ApiConsts.allCMCOrdersRc,
|
||||
isRCService: true,
|
||||
body: requestBody,
|
||||
onFailure: (error, statusCode, {messageStatus, failureType}) {
|
||||
failure = failureType;
|
||||
loggerService.logError("CMC Orders API Failed: $error, Status: $statusCode");
|
||||
},
|
||||
onSuccess: (response, statusCode, {messageStatus, errorMessage}) {
|
||||
try {
|
||||
List<GetCMCAllOrdersResponseModel> cmcOrdersList = [];
|
||||
// Log the full response for debugging
|
||||
// Extract MessageStatus and ErrorEndUserMessage from root level
|
||||
final apiErrorMessage = response['ErrorEndUserMessage'] as String?;
|
||||
// Parse the response array
|
||||
if (response['response'] != null && response['response'] is List) {
|
||||
final ordersList = response['response'] as List;
|
||||
|
||||
for (var orderJson in ordersList) {
|
||||
if (orderJson is Map<String, dynamic>) {
|
||||
try {
|
||||
cmcOrdersList.add(GetCMCAllOrdersResponseModel.fromJson(orderJson));
|
||||
} catch (e) {
|
||||
loggerService.logError("Error parsing individual order: ${e.toString()}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
apiResponse = GenericApiModel<List<GetCMCAllOrdersResponseModel>>(
|
||||
messageStatus: messageStatus,
|
||||
statusCode: statusCode,
|
||||
errorMessage: apiErrorMessage ?? errorMessage,
|
||||
data: cmcOrdersList,
|
||||
);
|
||||
} catch (e) {
|
||||
loggerService.logError("Error parsing CMC orders: ${e.toString()}");
|
||||
failure = DataParsingFailure(e.toString());
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
if (failure != null) return Left(failure!);
|
||||
if (apiResponse == null) return Left(ServerFailure("Unknown error"));
|
||||
return Right(apiResponse!);
|
||||
} catch (e) {
|
||||
loggerService.logError("Unknown error in getAllCmcOrders: ${e.toString()}");
|
||||
return Left(UnknownFailure(e.toString()));
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Future<Either<Failure, GenericApiModel<List<GetCMCAllOrdersResponseModel>>>> getAllHomeHealthCareCheckupOrders() async {
|
||||
Map<String, dynamic> requestBody = {};
|
||||
|
||||
try {
|
||||
GenericApiModel<List<GetCMCAllOrdersResponseModel>>? apiResponse;
|
||||
Failure? failure;
|
||||
|
||||
await apiClient.post(
|
||||
ApiConsts.allHHCOrdersRc,
|
||||
isRCService: true,
|
||||
body: requestBody,
|
||||
onFailure: (error, statusCode, {messageStatus, failureType}) {
|
||||
failure = failureType;
|
||||
loggerService.logError("HHC Orders API Failed: $error, Status: $statusCode");
|
||||
},
|
||||
onSuccess: (response, statusCode, {messageStatus, errorMessage}) {
|
||||
try {
|
||||
List<GetCMCAllOrdersResponseModel> cmcOrdersList = [];
|
||||
// Log the full response for debugging
|
||||
// Extract MessageStatus and ErrorEndUserMessage from root level
|
||||
final apiErrorMessage = response['ErrorEndUserMessage'] as String?;
|
||||
// Parse the response array
|
||||
if (response['response'] != null && response['response'] is List) {
|
||||
final ordersList = response['response'] as List;
|
||||
|
||||
for (var orderJson in ordersList) {
|
||||
if (orderJson is Map<String, dynamic>) {
|
||||
try {
|
||||
cmcOrdersList.add(GetCMCAllOrdersResponseModel.fromJson(orderJson));
|
||||
} catch (e) {
|
||||
loggerService.logError("Error parsing individual order: ${e.toString()}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
apiResponse = GenericApiModel<List<GetCMCAllOrdersResponseModel>>(
|
||||
messageStatus: messageStatus,
|
||||
statusCode: statusCode,
|
||||
errorMessage: apiErrorMessage ?? errorMessage,
|
||||
data: cmcOrdersList,
|
||||
);
|
||||
} catch (e) {
|
||||
loggerService.logError("Error parsing HHC orders: ${e.toString()}");
|
||||
failure = DataParsingFailure(e.toString());
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
if (failure != null) return Left(failure!);
|
||||
if (apiResponse == null) return Left(ServerFailure("Unknown error"));
|
||||
return Right(apiResponse!);
|
||||
} catch (e) {
|
||||
loggerService.logError("Unknown error in getAllHHCOrders: ${e.toString()}");
|
||||
return Left(UnknownFailure(e.toString()));
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Future<Either<Failure, GenericApiModel<List<GetCMCServicesResponseModel>>>> getAllCmcServices({required int patientID}) async {
|
||||
Map<String, dynamic> requestBody = {};
|
||||
|
||||
try {
|
||||
GenericApiModel<List<GetCMCServicesResponseModel>>? apiResponse;
|
||||
Failure? failure;
|
||||
|
||||
await apiClient.post(
|
||||
'${ApiConsts.allCMCServicesRc}?patientID=$patientID',
|
||||
isRCService: true,
|
||||
isAllowAny: true,
|
||||
body: requestBody,
|
||||
onFailure: (error, statusCode, {messageStatus, failureType}) {
|
||||
failure = failureType;
|
||||
loggerService.logError("CMC Services API Failed: $error, Status: $statusCode");
|
||||
},
|
||||
onSuccess: (response, statusCode, {messageStatus, errorMessage}) {
|
||||
try {
|
||||
List<GetCMCServicesResponseModel> cmcServicesList = [];
|
||||
|
||||
if (response['response'] != null && response['response'] is List) {
|
||||
final servicesList = response['response'] as List;
|
||||
|
||||
for (var serviceJson in servicesList) {
|
||||
if (serviceJson is Map<String, dynamic>) {
|
||||
cmcServicesList.add(GetCMCServicesResponseModel.fromJson(serviceJson));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
apiResponse = GenericApiModel<List<GetCMCServicesResponseModel>>(
|
||||
messageStatus: messageStatus,
|
||||
statusCode: statusCode,
|
||||
errorMessage: errorMessage,
|
||||
data: cmcServicesList,
|
||||
);
|
||||
} catch (e) {
|
||||
loggerService.logError("Error parsing CMC services: ${e.toString()}");
|
||||
failure = DataParsingFailure(e.toString());
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
if (failure != null) return Left(failure!);
|
||||
if (apiResponse == null) return Left(ServerFailure("Unknown error"));
|
||||
return Right(apiResponse!);
|
||||
} catch (e) {
|
||||
log("Unknown error in getAllCmcServices: ${e.toString()}");
|
||||
return Left(UnknownFailure(e.toString()));
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Future<Either<Failure, GenericApiModel<List<GetCMCServicesResponseModel>>>> getAllHhcServices({required int patientID}) async {
|
||||
Map<String, dynamic> requestBody = {};
|
||||
|
||||
try {
|
||||
GenericApiModel<List<GetCMCServicesResponseModel>>? apiResponse;
|
||||
Failure? failure;
|
||||
|
||||
await apiClient.post(
|
||||
'${ApiConsts.allHHCServicesRc}?patientID=$patientID',
|
||||
isRCService: true,
|
||||
isAllowAny: true,
|
||||
body: requestBody,
|
||||
onFailure: (error, statusCode, {messageStatus, failureType}) {
|
||||
failure = failureType;
|
||||
loggerService.logError("HHC Services API Failed: $error, Status: $statusCode");
|
||||
},
|
||||
onSuccess: (response, statusCode, {messageStatus, errorMessage}) {
|
||||
try {
|
||||
List<GetCMCServicesResponseModel> hhcServicesList = [];
|
||||
|
||||
if (response['response'] != null && response['response'] is List) {
|
||||
final servicesList = response['response'] as List;
|
||||
|
||||
for (var serviceJson in servicesList) {
|
||||
if (serviceJson is Map<String, dynamic>) {
|
||||
hhcServicesList.add(GetCMCServicesResponseModel.fromJson(serviceJson));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
apiResponse = GenericApiModel<List<GetCMCServicesResponseModel>>(
|
||||
messageStatus: messageStatus,
|
||||
statusCode: statusCode,
|
||||
errorMessage: errorMessage,
|
||||
data: hhcServicesList,
|
||||
);
|
||||
} catch (e) {
|
||||
loggerService.logError("Error parsing HHC services: ${e.toString()}");
|
||||
failure = DataParsingFailure(e.toString());
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
if (failure != null) return Left(failure!);
|
||||
if (apiResponse == null) return Left(ServerFailure("Unknown error"));
|
||||
return Right(apiResponse!);
|
||||
} catch (e) {
|
||||
log("Unknown error in getAllHhcServices: ${e.toString()}");
|
||||
return Left(UnknownFailure(e.toString()));
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Future<Either<Failure, GenericApiModel<bool>>> updateCmcPresOrder(OrderUpdateRequestModel requestModel) async {
|
||||
try {
|
||||
GenericApiModel<bool>? apiResponse;
|
||||
Failure? failure;
|
||||
|
||||
await apiClient.post(
|
||||
ApiConsts.updateCMCOrder,
|
||||
isRCService: true,
|
||||
body: requestModel.toJson(),
|
||||
onFailure: (error, statusCode, {messageStatus, failureType}) {
|
||||
failure = failureType;
|
||||
loggerService.logError("Update CMC Order API Failed: $error, Status: $statusCode");
|
||||
},
|
||||
onSuccess: (response, statusCode, {messageStatus, errorMessage}) {
|
||||
try {
|
||||
apiResponse = GenericApiModel<bool>(
|
||||
messageStatus: messageStatus,
|
||||
statusCode: statusCode,
|
||||
errorMessage: errorMessage,
|
||||
data: true,
|
||||
);
|
||||
|
||||
loggerService.logInfo("CMC Order updated successfully: PresOrderID=${requestModel.presOrderID}");
|
||||
} catch (e) {
|
||||
loggerService.logError("Error processing update CMC order response: ${e.toString()}");
|
||||
failure = DataParsingFailure(e.toString());
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
if (failure != null) return Left(failure!);
|
||||
if (apiResponse == null) return Left(ServerFailure("Unknown error"));
|
||||
return Right(apiResponse!);
|
||||
} catch (e) {
|
||||
loggerService.logError("Unknown error in updateCmcPresOrder: ${e.toString()}");
|
||||
return Left(UnknownFailure(e.toString()));
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Future<Either<Failure, GenericApiModel<bool>>> updateHhcPresOrder(OrderUpdateRequestModel requestModel) async {
|
||||
try {
|
||||
GenericApiModel<bool>? apiResponse;
|
||||
Failure? failure;
|
||||
|
||||
await apiClient.post(
|
||||
ApiConsts.updateHHCOrder,
|
||||
isRCService: true,
|
||||
body: requestModel.toJson(),
|
||||
onFailure: (error, statusCode, {messageStatus, failureType}) {
|
||||
failure = failureType;
|
||||
loggerService.logError("Update HHC Order API Failed: $error, Status: $statusCode");
|
||||
},
|
||||
onSuccess: (response, statusCode, {messageStatus, errorMessage}) {
|
||||
try {
|
||||
apiResponse = GenericApiModel<bool>(
|
||||
messageStatus: messageStatus,
|
||||
statusCode: statusCode,
|
||||
errorMessage: errorMessage,
|
||||
data: true,
|
||||
);
|
||||
|
||||
loggerService.logInfo("HHC Order updated successfully: PresOrderID=${requestModel.presOrderID}");
|
||||
} catch (e) {
|
||||
loggerService.logError("Error processing update HHC order response: ${e.toString()}");
|
||||
failure = DataParsingFailure(e.toString());
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
if (failure != null) return Left(failure!);
|
||||
if (apiResponse == null) return Left(ServerFailure("Unknown error"));
|
||||
return Right(apiResponse!);
|
||||
} catch (e) {
|
||||
loggerService.logError("Unknown error in updateHhcPresOrder: ${e.toString()}");
|
||||
return Left(UnknownFailure(e.toString()));
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Future<Either<Failure, GenericApiModel<List<HospitalsModel>>>> getHospitalsList() async {
|
||||
Map<String, dynamic> requestBody = {};
|
||||
|
||||
try {
|
||||
GenericApiModel<List<HospitalsModel>>? apiResponse;
|
||||
Failure? failure;
|
||||
|
||||
await apiClient.post(
|
||||
ApiConsts.getHospitalsList,
|
||||
isRCService: false, // This uses the base HIS API URL, not RC
|
||||
body: requestBody,
|
||||
onFailure: (error, statusCode, {messageStatus, failureType}) {
|
||||
failure = failureType;
|
||||
loggerService.logError("Get Hospitals List API Failed: $error, Status: $statusCode");
|
||||
},
|
||||
onSuccess: (response, statusCode, {messageStatus, errorMessage}) {
|
||||
try {
|
||||
List<HospitalsModel> hospitalsList = [];
|
||||
|
||||
loggerService.logInfo("Hospitals List Raw Response: $response");
|
||||
|
||||
if (response['ListProject'] != null && response['ListProject'] is List) {
|
||||
final projectsList = response['ListProject'] as List;
|
||||
|
||||
for (var projectJson in projectsList) {
|
||||
try {
|
||||
if (projectJson is Map<String, dynamic>) {
|
||||
hospitalsList.add(HospitalsModel.fromJson(projectJson));
|
||||
}
|
||||
} catch (e) {
|
||||
loggerService.logError('Error parsing hospital item: ${e.toString()}');
|
||||
}
|
||||
}
|
||||
} else {
|
||||
loggerService.logInfo('Hospitals list response array is empty or missing');
|
||||
}
|
||||
|
||||
apiResponse = GenericApiModel<List<HospitalsModel>>(
|
||||
messageStatus: messageStatus,
|
||||
statusCode: statusCode,
|
||||
errorMessage: errorMessage,
|
||||
data: hospitalsList,
|
||||
);
|
||||
|
||||
loggerService.logInfo("Hospitals fetched successfully: ${hospitalsList.length} hospitals");
|
||||
} catch (e) {
|
||||
loggerService.logError("Error parsing hospitals list: ${e.toString()}");
|
||||
failure = DataParsingFailure(e.toString());
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
if (failure != null) return Left(failure!);
|
||||
if (apiResponse == null) return Left(ServerFailure("Unknown error"));
|
||||
return Right(apiResponse!);
|
||||
} catch (e) {
|
||||
loggerService.logError("Unknown error in getHospitalsList: ${e.toString()}");
|
||||
return Left(UnknownFailure(e.toString()));
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Future<Either<Failure, GenericApiModel<int>>> addCmcOrder({
|
||||
required int projectID,
|
||||
required int orderServiceID,
|
||||
required List<PatientERCMCInsertServicesList> services,
|
||||
}) async {
|
||||
try {
|
||||
GenericApiModel<int>? apiResponse;
|
||||
Failure? failure;
|
||||
|
||||
final requestBody = {
|
||||
'ProjectID': projectID,
|
||||
'OrderServiceID': orderServiceID,
|
||||
'procedures': services.map((service) => service.toJson()).toList(),
|
||||
};
|
||||
|
||||
await apiClient.post(
|
||||
ApiConsts.addCMCOrder,
|
||||
isRCService: true,
|
||||
body: requestBody,
|
||||
onFailure: (error, statusCode, {messageStatus, failureType}) {
|
||||
failure = failureType;
|
||||
loggerService.logError("Add CMC Order API Failed: $error, Status: $statusCode");
|
||||
},
|
||||
onSuccess: (response, statusCode, {messageStatus, errorMessage}) {
|
||||
int requestId = 0;
|
||||
if (response is Map) {
|
||||
requestId = response['response'];
|
||||
}
|
||||
try {
|
||||
apiResponse = GenericApiModel<int>(
|
||||
messageStatus: messageStatus,
|
||||
statusCode: statusCode,
|
||||
errorMessage: errorMessage,
|
||||
data: requestId,
|
||||
);
|
||||
|
||||
loggerService.logInfo("CMC Order added successfully: ProjectID=$projectID, OrderServiceID=$orderServiceID");
|
||||
} catch (e) {
|
||||
loggerService.logError("Error processing add CMC order response: ${e.toString()}");
|
||||
failure = DataParsingFailure(e.toString());
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
if (failure != null) return Left(failure!);
|
||||
if (apiResponse == null) return Left(ServerFailure("Unknown error"));
|
||||
return Right(apiResponse!);
|
||||
} catch (e) {
|
||||
loggerService.logError("Unknown error in addCmcOrder: ${e.toString()}");
|
||||
return Left(UnknownFailure(e.toString()));
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Future<Either<Failure, GenericApiModel<int>>> addHhcOrder({
|
||||
required int projectID,
|
||||
required int orderServiceID,
|
||||
required List<PatientERCMCInsertServicesList> services,
|
||||
}) async {
|
||||
try {
|
||||
GenericApiModel<int>? apiResponse;
|
||||
Failure? failure;
|
||||
|
||||
final requestBody = {
|
||||
'ProjectID': projectID,
|
||||
'OrderServiceID': orderServiceID,
|
||||
'procedures': services.map((service) => service.toJson()).toList(),
|
||||
};
|
||||
|
||||
await apiClient.post(
|
||||
ApiConsts.addHHCOrder,
|
||||
isRCService: true,
|
||||
body: requestBody,
|
||||
onFailure: (error, statusCode, {messageStatus, failureType}) {
|
||||
failure = failureType;
|
||||
loggerService.logError("Add HHC Order API Failed: $error, Status: $statusCode");
|
||||
},
|
||||
onSuccess: (response, statusCode, {messageStatus, errorMessage}) {
|
||||
int requestId = 0;
|
||||
if (response is Map) {
|
||||
requestId = response['response'];
|
||||
}
|
||||
try {
|
||||
apiResponse = GenericApiModel<int>(
|
||||
messageStatus: messageStatus,
|
||||
statusCode: statusCode,
|
||||
errorMessage: errorMessage,
|
||||
data: requestId,
|
||||
);
|
||||
|
||||
loggerService.logInfo("HHC Order added successfully: ProjectID=$projectID, OrderServiceID=$orderServiceID");
|
||||
} catch (e) {
|
||||
loggerService.logError("Error processing add HHC order response: ${e.toString()}");
|
||||
failure = DataParsingFailure(e.toString());
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
if (failure != null) return Left(failure!);
|
||||
if (apiResponse == null) return Left(ServerFailure("Unknown error"));
|
||||
return Right(apiResponse!);
|
||||
} catch (e) {
|
||||
loggerService.logError("Unknown error in addHhcOrder: ${e.toString()}");
|
||||
return Left(UnknownFailure(e.toString()));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,515 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hmg_patient_app_new/features/book_appointments/book_appointments_repo.dart';
|
||||
import 'package:hmg_patient_app_new/features/hmg_services/hmg_services_repo.dart';
|
||||
import 'package:hmg_patient_app_new/features/hmg_services/models/req_models/cmc_create_new_order_req_model.dart';
|
||||
import 'package:hmg_patient_app_new/features/hmg_services/models/req_models/order_update_req_model.dart';
|
||||
import 'package:hmg_patient_app_new/features/hmg_services/models/resq_models/get_cmc_all_orders_resp_model.dart';
|
||||
import 'package:hmg_patient_app_new/features/hmg_services/models/resq_models/get_cmc_services_resp_model.dart';
|
||||
import 'package:hmg_patient_app_new/features/my_appointments/models/resp_models/hospital_model.dart';
|
||||
import 'package:hmg_patient_app_new/services/error_handler_service.dart';
|
||||
|
||||
class HmgServicesViewModel extends ChangeNotifier {
|
||||
final HmgServicesRepo hmgServicesRepo;
|
||||
final BookAppointmentsRepo bookAppointmentsRepo;
|
||||
final ErrorHandlerService errorHandlerService;
|
||||
|
||||
HmgServicesViewModel({required this.bookAppointmentsRepo, required this.hmgServicesRepo, required this.errorHandlerService});
|
||||
|
||||
bool isCmcOrdersLoading = false;
|
||||
bool isCmcServicesLoading = false;
|
||||
bool isUpdatingOrder = false;
|
||||
bool isHospitalListLoading = false;
|
||||
|
||||
// HHC specific loading states
|
||||
bool isHhcOrdersLoading = false;
|
||||
bool isHhcServicesLoading = false;
|
||||
|
||||
List<GetCMCAllOrdersResponseModel> cmcOrdersList = [];
|
||||
List<GetCMCServicesResponseModel> cmcServicesList = [];
|
||||
List<HospitalsModel> hospitalsList = [];
|
||||
List<HospitalsModel> filteredHospitalsList = [];
|
||||
HospitalsModel? selectedHospital;
|
||||
|
||||
// HHC specific lists
|
||||
List<GetCMCAllOrdersResponseModel> hhcOrdersList = [];
|
||||
List<GetCMCServicesResponseModel> hhcServicesList = [];
|
||||
|
||||
// CMC order creation state
|
||||
HospitalsModel? selectedHospitalForOrder;
|
||||
GetCMCServicesResponseModel? selectedServiceForOrder;
|
||||
|
||||
// HHC order creation state (no hospital selection needed for home healthcare)
|
||||
GetCMCServicesResponseModel? selectedServiceForHhcOrder;
|
||||
|
||||
// HHC multiple services selection
|
||||
List<GetCMCServicesResponseModel> selectedHhcServices = [];
|
||||
|
||||
Future<void> getCmcOrdersList() async {
|
||||
cmcOrdersList.clear();
|
||||
isCmcOrdersLoading = true;
|
||||
notifyListeners();
|
||||
await getAllCmcOrders();
|
||||
}
|
||||
|
||||
// Helper to sort hospitals by distance (ascending). Safely converts distanceinkMS to double.
|
||||
void _sortHospitalsByDistance(List<HospitalsModel> list) {
|
||||
double toDouble(dynamic v) {
|
||||
if (v == null) return double.infinity;
|
||||
if (v is num) return v.toDouble();
|
||||
if (v is String) return double.tryParse(v) ?? double.infinity;
|
||||
return double.infinity;
|
||||
}
|
||||
|
||||
list.sort((a, b) {
|
||||
final da = toDouble(a.distanceInKilometers);
|
||||
final db = toDouble(b.distanceInKilometers);
|
||||
return da.compareTo(db);
|
||||
});
|
||||
}
|
||||
|
||||
Future<void> getAllCmcOrders({
|
||||
Function(dynamic)? onSuccess,
|
||||
Function(String)? onError,
|
||||
}) async {
|
||||
isCmcOrdersLoading = true;
|
||||
notifyListeners();
|
||||
|
||||
final result = await hmgServicesRepo.getAllComprehensiveCheckupOrders();
|
||||
|
||||
result.fold(
|
||||
(failure) async {
|
||||
isCmcOrdersLoading = false;
|
||||
notifyListeners();
|
||||
await errorHandlerService.handleError(failure: failure);
|
||||
if (onError != null) {
|
||||
onError(failure.toString());
|
||||
}
|
||||
},
|
||||
(apiResponse) {
|
||||
isCmcOrdersLoading = false;
|
||||
if (apiResponse.messageStatus == 1) {
|
||||
cmcOrdersList = apiResponse.data ?? [];
|
||||
notifyListeners();
|
||||
if (onSuccess != null) {
|
||||
onSuccess(apiResponse);
|
||||
}
|
||||
} else {
|
||||
notifyListeners();
|
||||
if (onError != null) {
|
||||
onError(apiResponse.errorMessage ?? 'Unknown error');
|
||||
}
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> getAllCmcServices({required int patientID, Function(dynamic)? onSuccess, Function(String)? onError}) async {
|
||||
isCmcServicesLoading = true;
|
||||
notifyListeners();
|
||||
|
||||
final result = await hmgServicesRepo.getAllCmcServices(patientID: patientID);
|
||||
|
||||
result.fold(
|
||||
(failure) async {
|
||||
isCmcServicesLoading = false;
|
||||
notifyListeners();
|
||||
await errorHandlerService.handleError(failure: failure);
|
||||
if (onError != null) {
|
||||
onError(failure.toString());
|
||||
}
|
||||
},
|
||||
(apiResponse) {
|
||||
isCmcServicesLoading = false;
|
||||
if (apiResponse.messageStatus == 1) {
|
||||
cmcServicesList = apiResponse.data ?? [];
|
||||
notifyListeners();
|
||||
if (onSuccess != null) {
|
||||
onSuccess(apiResponse);
|
||||
}
|
||||
} else {
|
||||
notifyListeners();
|
||||
if (onError != null) {
|
||||
onError(apiResponse.errorMessage ?? 'Unknown error');
|
||||
}
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Future<bool> updateCmcPresOrder({
|
||||
required OrderUpdateRequestModel requestModel,
|
||||
Function(dynamic)? onSuccess,
|
||||
Function(String)? onError,
|
||||
}) async {
|
||||
isUpdatingOrder = true;
|
||||
notifyListeners();
|
||||
|
||||
final result = await hmgServicesRepo.updateCmcPresOrder(requestModel);
|
||||
|
||||
bool success = false;
|
||||
|
||||
result.fold(
|
||||
(failure) async {
|
||||
isUpdatingOrder = false;
|
||||
notifyListeners();
|
||||
await errorHandlerService.handleError(failure: failure);
|
||||
if (onError != null) {
|
||||
onError(failure.toString());
|
||||
}
|
||||
},
|
||||
(apiResponse) {
|
||||
isUpdatingOrder = false;
|
||||
if (apiResponse.messageStatus == 1) {
|
||||
success = true;
|
||||
notifyListeners();
|
||||
if (onSuccess != null) {
|
||||
onSuccess(apiResponse);
|
||||
}
|
||||
} else {
|
||||
notifyListeners();
|
||||
if (onError != null) {
|
||||
onError(apiResponse.errorMessage ?? 'Unknown error');
|
||||
}
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
Future<void> getHospitalsList({Function(dynamic)? onSuccess, Function(String)? onError}) async {
|
||||
isHospitalListLoading = true;
|
||||
notifyListeners();
|
||||
|
||||
final result = await hmgServicesRepo.getHospitalsList();
|
||||
|
||||
result.fold(
|
||||
(failure) async {
|
||||
isHospitalListLoading = false;
|
||||
notifyListeners();
|
||||
await errorHandlerService.handleError(failure: failure);
|
||||
if (onError != null) {
|
||||
onError(failure.toString());
|
||||
}
|
||||
},
|
||||
(apiResponse) {
|
||||
isHospitalListLoading = false;
|
||||
if (apiResponse.messageStatus == 1) {
|
||||
hospitalsList = apiResponse.data ?? [];
|
||||
filteredHospitalsList = List.from(hospitalsList);
|
||||
// ensure hospitals are sorted by distance before showing
|
||||
_sortHospitalsByDistance(filteredHospitalsList);
|
||||
notifyListeners();
|
||||
if (onSuccess != null) {
|
||||
onSuccess(apiResponse);
|
||||
}
|
||||
} else {
|
||||
notifyListeners();
|
||||
if (onError != null) {
|
||||
onError(apiResponse.errorMessage ?? 'Unknown error');
|
||||
}
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
void filterHospitalsByString(String searchText, bool isArabic) {
|
||||
if (searchText.isEmpty) {
|
||||
filteredHospitalsList = List.from(hospitalsList);
|
||||
_sortHospitalsByDistance(filteredHospitalsList);
|
||||
} else {
|
||||
filteredHospitalsList = hospitalsList.where((HospitalsModel hospital) {
|
||||
final name = isArabic ? (hospital.nameN ?? '') : (hospital.name ?? '');
|
||||
return name.toLowerCase().contains(searchText.toLowerCase());
|
||||
}).toList();
|
||||
_sortHospitalsByDistance(filteredHospitalsList);
|
||||
}
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setSelectedHospital(HospitalsModel? hospital) {
|
||||
selectedHospital = hospital;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void clearHospitalSelection() {
|
||||
selectedHospital = null;
|
||||
filteredHospitalsList = List.from(hospitalsList);
|
||||
_sortHospitalsByDistance(filteredHospitalsList);
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
// CMC Order management methods
|
||||
void setSelectedHospitalForOrder(HospitalsModel? hospital) {
|
||||
selectedHospitalForOrder = hospital;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setSelectedServiceForOrder(GetCMCServicesResponseModel? service) {
|
||||
selectedServiceForOrder = service;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void clearOrderSelection() {
|
||||
selectedHospitalForOrder = null;
|
||||
selectedServiceForOrder = null;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
bool get isOrderReadyToConfirm => selectedHospitalForOrder != null && selectedServiceForOrder != null;
|
||||
|
||||
Future<int?> addCmcOrder({
|
||||
required int projectID,
|
||||
required int orderServiceID,
|
||||
required List<PatientERCMCInsertServicesList> services,
|
||||
Function(int)? onSuccess,
|
||||
Function(String)? onError,
|
||||
}) async {
|
||||
isUpdatingOrder = true;
|
||||
notifyListeners();
|
||||
|
||||
final result = await hmgServicesRepo.addCmcOrder(
|
||||
projectID: projectID,
|
||||
orderServiceID: orderServiceID,
|
||||
services: services,
|
||||
);
|
||||
|
||||
int requestId = 0;
|
||||
|
||||
result.fold(
|
||||
(failure) async {
|
||||
isUpdatingOrder = false;
|
||||
notifyListeners();
|
||||
await errorHandlerService.handleError(failure: failure);
|
||||
if (onError != null) {
|
||||
onError(failure.toString());
|
||||
}
|
||||
},
|
||||
(apiResponse) {
|
||||
isUpdatingOrder = false;
|
||||
if (apiResponse.messageStatus == 1) {
|
||||
requestId = apiResponse.data ?? 0;
|
||||
notifyListeners();
|
||||
if (onSuccess != null) {
|
||||
onSuccess(requestId);
|
||||
}
|
||||
} else {
|
||||
notifyListeners();
|
||||
if (onError != null) {
|
||||
onError(apiResponse.errorMessage ?? 'Unknown error');
|
||||
}
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
return requestId;
|
||||
}
|
||||
|
||||
// ******************* HOME HEALTHCARE APIs ********************
|
||||
|
||||
Future<void> getHhcOrdersList() async {
|
||||
hhcOrdersList.clear();
|
||||
isHhcOrdersLoading = true;
|
||||
notifyListeners();
|
||||
await getAllHhcOrders();
|
||||
}
|
||||
|
||||
Future<void> getAllHhcOrders({
|
||||
Function(dynamic)? onSuccess,
|
||||
Function(String)? onError,
|
||||
}) async {
|
||||
isHhcOrdersLoading = true;
|
||||
notifyListeners();
|
||||
|
||||
final result = await hmgServicesRepo.getAllHomeHealthCareCheckupOrders();
|
||||
|
||||
result.fold(
|
||||
(failure) async {
|
||||
isHhcOrdersLoading = false;
|
||||
notifyListeners();
|
||||
await errorHandlerService.handleError(failure: failure);
|
||||
if (onError != null) {
|
||||
onError(failure.toString());
|
||||
}
|
||||
},
|
||||
(apiResponse) {
|
||||
isHhcOrdersLoading = false;
|
||||
if (apiResponse.messageStatus == 1) {
|
||||
hhcOrdersList = apiResponse.data ?? [];
|
||||
notifyListeners();
|
||||
if (onSuccess != null) {
|
||||
onSuccess(apiResponse);
|
||||
}
|
||||
} else {
|
||||
notifyListeners();
|
||||
if (onError != null) {
|
||||
onError(apiResponse.errorMessage ?? 'Unknown error');
|
||||
}
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> getAllHhcServices({required int patientID, Function(dynamic)? onSuccess, Function(String)? onError}) async {
|
||||
isHhcServicesLoading = true;
|
||||
notifyListeners();
|
||||
|
||||
final result = await hmgServicesRepo.getAllHhcServices(patientID: patientID);
|
||||
|
||||
result.fold(
|
||||
(failure) async {
|
||||
isHhcServicesLoading = false;
|
||||
notifyListeners();
|
||||
await errorHandlerService.handleError(failure: failure);
|
||||
if (onError != null) {
|
||||
onError(failure.toString());
|
||||
}
|
||||
},
|
||||
(apiResponse) {
|
||||
isHhcServicesLoading = false;
|
||||
if (apiResponse.messageStatus == 1) {
|
||||
hhcServicesList = apiResponse.data ?? [];
|
||||
notifyListeners();
|
||||
if (onSuccess != null) {
|
||||
onSuccess(apiResponse);
|
||||
}
|
||||
} else {
|
||||
notifyListeners();
|
||||
if (onError != null) {
|
||||
onError(apiResponse.errorMessage ?? 'Unknown error');
|
||||
}
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Future<bool> updateHhcPresOrder({
|
||||
required OrderUpdateRequestModel requestModel,
|
||||
Function(dynamic)? onSuccess,
|
||||
Function(String)? onError,
|
||||
}) async {
|
||||
isUpdatingOrder = true;
|
||||
notifyListeners();
|
||||
|
||||
final result = await hmgServicesRepo.updateHhcPresOrder(requestModel);
|
||||
|
||||
bool success = false;
|
||||
|
||||
result.fold(
|
||||
(failure) async {
|
||||
isUpdatingOrder = false;
|
||||
notifyListeners();
|
||||
await errorHandlerService.handleError(failure: failure);
|
||||
if (onError != null) {
|
||||
onError(failure.toString());
|
||||
}
|
||||
},
|
||||
(apiResponse) {
|
||||
isUpdatingOrder = false;
|
||||
if (apiResponse.messageStatus == 1) {
|
||||
success = true;
|
||||
notifyListeners();
|
||||
if (onSuccess != null) {
|
||||
onSuccess(apiResponse);
|
||||
}
|
||||
} else {
|
||||
notifyListeners();
|
||||
if (onError != null) {
|
||||
onError(apiResponse.errorMessage ?? 'Unknown error');
|
||||
}
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
Future<int?> addHhcOrder({
|
||||
required int projectID,
|
||||
required int orderServiceID,
|
||||
required List<PatientERCMCInsertServicesList> services,
|
||||
Function(int)? onSuccess,
|
||||
Function(String)? onError,
|
||||
}) async {
|
||||
isUpdatingOrder = true;
|
||||
notifyListeners();
|
||||
|
||||
final result = await hmgServicesRepo.addHhcOrder(
|
||||
projectID: projectID,
|
||||
orderServiceID: orderServiceID,
|
||||
services: services,
|
||||
);
|
||||
|
||||
int requestId = 0;
|
||||
|
||||
result.fold(
|
||||
(failure) async {
|
||||
isUpdatingOrder = false;
|
||||
notifyListeners();
|
||||
await errorHandlerService.handleError(failure: failure);
|
||||
if (onError != null) {
|
||||
onError(failure.toString());
|
||||
}
|
||||
},
|
||||
(apiResponse) {
|
||||
isUpdatingOrder = false;
|
||||
if (apiResponse.messageStatus == 1) {
|
||||
requestId = apiResponse.data ?? 0;
|
||||
notifyListeners();
|
||||
if (onSuccess != null) {
|
||||
onSuccess(requestId);
|
||||
}
|
||||
} else {
|
||||
notifyListeners();
|
||||
if (onError != null) {
|
||||
onError(apiResponse.errorMessage ?? 'Unknown error');
|
||||
}
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
return requestId;
|
||||
}
|
||||
|
||||
// HHC Order management methods (no hospital selection for home healthcare)
|
||||
void setSelectedServiceForHhcOrder(GetCMCServicesResponseModel? service) {
|
||||
selectedServiceForHhcOrder = service;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void clearHhcOrderSelection() {
|
||||
selectedServiceForHhcOrder = null;
|
||||
selectedHhcServices.clear();
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
bool get isHhcOrderReadyToConfirm => selectedServiceForHhcOrder != null;
|
||||
|
||||
// Multiple HHC services selection methods
|
||||
void toggleHhcServiceSelection(GetCMCServicesResponseModel service) {
|
||||
final index = selectedHhcServices.indexWhere((s) => s.iD == service.iD);
|
||||
if (index != -1) {
|
||||
selectedHhcServices.removeAt(index);
|
||||
} else {
|
||||
selectedHhcServices.add(service);
|
||||
}
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
bool isHhcServiceSelected(GetCMCServicesResponseModel service) {
|
||||
return selectedHhcServices.any((s) => s.iD == service.iD);
|
||||
}
|
||||
|
||||
double getHhcSelectedServicesTotal() {
|
||||
double total = 0.0;
|
||||
for (var service in selectedHhcServices) {
|
||||
total += (service.priceTotal ?? 0);
|
||||
}
|
||||
return total;
|
||||
}
|
||||
|
||||
void clearHhcServicesSelection() {
|
||||
selectedHhcServices.clear();
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
||||
@ -1,131 +0,0 @@
|
||||
class CMCInsertPresOrderRequestModel {
|
||||
double? versionID;
|
||||
int? channel;
|
||||
int? languageID;
|
||||
String? iPAdress;
|
||||
String? generalid;
|
||||
int? patientOutSA;
|
||||
String? sessionID;
|
||||
bool? isDentalAllowedBackend;
|
||||
int? deviceTypeID;
|
||||
int? patientID;
|
||||
String? tokenID;
|
||||
int? patientTypeID;
|
||||
int? patientType;
|
||||
double? latitude;
|
||||
double? longitude;
|
||||
int? createdBy;
|
||||
int? orderServiceID;
|
||||
int? projectID;
|
||||
List<PatientERCMCInsertServicesList>? patientERCMCInsertServicesList;
|
||||
|
||||
CMCInsertPresOrderRequestModel(
|
||||
{this.versionID,
|
||||
this.channel,
|
||||
this.languageID,
|
||||
this.iPAdress,
|
||||
this.generalid,
|
||||
this.patientOutSA,
|
||||
this.sessionID,
|
||||
this.isDentalAllowedBackend,
|
||||
this.deviceTypeID,
|
||||
this.patientID,
|
||||
this.tokenID,
|
||||
this.patientTypeID,
|
||||
this.patientType,
|
||||
this.latitude,
|
||||
this.longitude,
|
||||
this.createdBy,
|
||||
this.orderServiceID,
|
||||
this.projectID,
|
||||
this.patientERCMCInsertServicesList});
|
||||
|
||||
CMCInsertPresOrderRequestModel.fromJson(Map<String, dynamic> json) {
|
||||
versionID = json['VersionID'];
|
||||
channel = json['Channel'];
|
||||
languageID = json['LanguageID'];
|
||||
iPAdress = json['IPAdress'];
|
||||
generalid = json['generalid'];
|
||||
patientOutSA = json['PatientOutSA'];
|
||||
sessionID = json['SessionID'];
|
||||
isDentalAllowedBackend = json['isDentalAllowedBackend'];
|
||||
deviceTypeID = json['DeviceTypeID'];
|
||||
patientID = json['PatientID'];
|
||||
tokenID = json['TokenID'];
|
||||
patientTypeID = json['PatientTypeID'];
|
||||
patientType = json['PatientType'];
|
||||
latitude = json['Latitude'];
|
||||
longitude = json['Longitude'];
|
||||
createdBy = json['CreatedBy'];
|
||||
orderServiceID = json['OrderServiceID'];
|
||||
projectID = json['ProjectId'];
|
||||
if (json['PatientER_CMC_InsertServicesList'] != null) {
|
||||
patientERCMCInsertServicesList = <PatientERCMCInsertServicesList>[];
|
||||
json['PatientER_CMC_InsertServicesList'].forEach((v) {
|
||||
patientERCMCInsertServicesList!.add(
|
||||
new PatientERCMCInsertServicesList.fromJson(v),
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['VersionID'] = this.versionID;
|
||||
data['Channel'] = this.channel;
|
||||
data['LanguageID'] = this.languageID;
|
||||
data['IPAdress'] = this.iPAdress;
|
||||
data['generalid'] = this.generalid;
|
||||
data['isOutPatient'] = this.patientOutSA == 0 ? false : true;
|
||||
data['SessionID'] = this.sessionID;
|
||||
data['isDentalAllowedBackend'] = this.isDentalAllowedBackend;
|
||||
data['DeviceTypeID'] = this.deviceTypeID;
|
||||
data['TokenID'] = this.tokenID;
|
||||
data['PatientTypeID'] = this.patientTypeID;
|
||||
data['PatientType'] = this.patientType;
|
||||
data['latitude'] = this.latitude;
|
||||
data['longitude'] = this.longitude;
|
||||
// data['CreatedBy'] = this.createdBy;
|
||||
data['OrderServiceID'] = this.orderServiceID;
|
||||
data['ProjectID'] = this.projectID;
|
||||
if (this.patientERCMCInsertServicesList != null) {
|
||||
data['procedures'] = this.patientERCMCInsertServicesList!.map((v) => v.toJson()).toList();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class PatientERCMCInsertServicesList {
|
||||
int? recordID;
|
||||
String? serviceID;
|
||||
String? selectedServiceName;
|
||||
String? selectedServiceNameAR;
|
||||
dynamic price;
|
||||
dynamic vAT;
|
||||
dynamic totalPrice;
|
||||
|
||||
PatientERCMCInsertServicesList(
|
||||
{this.recordID, this.serviceID, this.selectedServiceName, this.selectedServiceNameAR, this.price, this.vAT, this.totalPrice});
|
||||
|
||||
PatientERCMCInsertServicesList.fromJson(Map<String, dynamic> json) {
|
||||
recordID = json['RecordID'];
|
||||
serviceID = json['ServiceID'];
|
||||
selectedServiceName = json['selectedServiceName'];
|
||||
selectedServiceNameAR = json['selectedServiceNameAR'];
|
||||
price = json['Price'];
|
||||
vAT = json['VAT'];
|
||||
totalPrice = json['TotalPrice'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['RecordID'] = this.recordID;
|
||||
data['ServiceID'] = this.serviceID;
|
||||
data['selectedServiceName'] = this.selectedServiceName;
|
||||
data['selectedServiceNameAR'] = this.selectedServiceNameAR;
|
||||
data['Price'] = this.price;
|
||||
data['VAT'] = this.vAT;
|
||||
data['TotalPrice'] = this.totalPrice;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -1,41 +0,0 @@
|
||||
class CmcCreateServiceOrderReqModel {
|
||||
int? recordID;
|
||||
String? serviceID;
|
||||
String? selectedServiceName;
|
||||
String? selectedServiceNameAR;
|
||||
dynamic price;
|
||||
dynamic vAT;
|
||||
dynamic totalPrice;
|
||||
|
||||
CmcCreateServiceOrderReqModel({
|
||||
this.recordID,
|
||||
this.serviceID,
|
||||
this.selectedServiceName,
|
||||
this.selectedServiceNameAR,
|
||||
this.price,
|
||||
this.vAT,
|
||||
this.totalPrice,
|
||||
});
|
||||
|
||||
CmcCreateServiceOrderReqModel.fromJson(Map<String, dynamic> json) {
|
||||
recordID = json['RecordID'];
|
||||
serviceID = json['ServiceID'];
|
||||
selectedServiceName = json['selectedServiceName'];
|
||||
selectedServiceNameAR = json['selectedServiceNameAR'];
|
||||
price = json['Price'];
|
||||
vAT = json['VAT'];
|
||||
totalPrice = json['TotalPrice'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['RecordID'] = recordID;
|
||||
data['ServiceID'] = serviceID;
|
||||
data['selectedServiceName'] = selectedServiceName;
|
||||
data['selectedServiceNameAR'] = selectedServiceNameAR;
|
||||
data['Price'] = price;
|
||||
data['VAT'] = vAT;
|
||||
data['TotalPrice'] = totalPrice;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -1,82 +0,0 @@
|
||||
class OrderUpdateRequestModel {
|
||||
double? versionID;
|
||||
int? channel;
|
||||
int? languageID;
|
||||
String? iPAdress;
|
||||
String? generalid;
|
||||
int? patientOutSA;
|
||||
String? sessionID;
|
||||
bool? isDentalAllowedBackend;
|
||||
int? deviceTypeID;
|
||||
int? patientID;
|
||||
String? tokenID;
|
||||
int? patientTypeID;
|
||||
int? patientType;
|
||||
int? presOrderID;
|
||||
int? presOrderStatus;
|
||||
int? editedBy;
|
||||
String? rejectionReason;
|
||||
|
||||
OrderUpdateRequestModel({
|
||||
this.versionID,
|
||||
this.channel,
|
||||
this.languageID,
|
||||
this.iPAdress,
|
||||
this.generalid,
|
||||
this.patientOutSA,
|
||||
this.sessionID,
|
||||
this.isDentalAllowedBackend,
|
||||
this.deviceTypeID,
|
||||
this.patientID,
|
||||
this.tokenID,
|
||||
this.patientTypeID,
|
||||
this.patientType,
|
||||
this.presOrderID,
|
||||
this.presOrderStatus,
|
||||
this.editedBy,
|
||||
this.rejectionReason,
|
||||
});
|
||||
|
||||
OrderUpdateRequestModel.fromJson(Map<String, dynamic> json) {
|
||||
versionID = json['VersionID'];
|
||||
channel = json['Channel'];
|
||||
languageID = json['LanguageID'];
|
||||
iPAdress = json['IPAdress'];
|
||||
generalid = json['generalid'];
|
||||
patientOutSA = json['PatientOutSA'];
|
||||
sessionID = json['SessionID'];
|
||||
isDentalAllowedBackend = json['isDentalAllowedBackend'];
|
||||
deviceTypeID = json['DeviceTypeID'];
|
||||
patientID = json['PatientID'];
|
||||
tokenID = json['TokenID'];
|
||||
patientTypeID = json['PatientTypeID'];
|
||||
patientType = json['PatientType'];
|
||||
presOrderID = json['PresOrderID'];
|
||||
presOrderStatus = json['PresOrderStatus'];
|
||||
editedBy = json['EditedBy'];
|
||||
rejectionReason = json['RejectionReason'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['VersionID'] = versionID;
|
||||
data['Channel'] = channel;
|
||||
data['LanguageID'] = languageID;
|
||||
data['IPAdress'] = iPAdress;
|
||||
data['generalid'] = generalid;
|
||||
data['PatientOutSA'] = patientOutSA;
|
||||
data['SessionID'] = sessionID;
|
||||
data['isDentalAllowedBackend'] = isDentalAllowedBackend;
|
||||
data['DeviceTypeID'] = deviceTypeID;
|
||||
data['PatientID'] = patientID;
|
||||
data['TokenID'] = tokenID;
|
||||
data['PatientTypeID'] = patientTypeID;
|
||||
data['PatientType'] = patientType;
|
||||
data['Id'] = presOrderID;
|
||||
data['ClickButton'] = 14;
|
||||
data['PresOrderStatus'] = presOrderStatus;
|
||||
data['EditedBy'] = editedBy;
|
||||
data['RejectionReason'] = rejectionReason;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -1,344 +0,0 @@
|
||||
import 'dart:developer';
|
||||
|
||||
class GetCMCAllOrdersResponseModel {
|
||||
int? iD;
|
||||
int? patientId;
|
||||
int? patientOutSa;
|
||||
bool? isOutPatient;
|
||||
int? projectId;
|
||||
int? nearestProjectId;
|
||||
dynamic longitude;
|
||||
dynamic latitude;
|
||||
dynamic appointmentNo;
|
||||
dynamic dischargeId;
|
||||
int? statusId;
|
||||
int? serviceId;
|
||||
int? channel;
|
||||
Orderpayment? orderpayment;
|
||||
dynamic orderselectedservice;
|
||||
dynamic wforder;
|
||||
dynamic orderapprovalobj;
|
||||
String? created;
|
||||
dynamic createdBy;
|
||||
dynamic modified;
|
||||
dynamic modifiedBy;
|
||||
bool? isDeleted;
|
||||
String? statusText;
|
||||
int? paymentStatus;
|
||||
dynamic clientRequestid;
|
||||
dynamic paymentStatusText;
|
||||
String? projectName;
|
||||
String? nearestProjectName;
|
||||
dynamic paymentAmount;
|
||||
WFOrder? wFOrder;
|
||||
String? serviceText;
|
||||
bool? isSentForApproval;
|
||||
int? exaCartOrderId;
|
||||
bool? isTimer;
|
||||
int? timeSeconds;
|
||||
int? totalPendingSeconds;
|
||||
int? timeMinute;
|
||||
int? timeHour;
|
||||
int? timeTotalSeconds;
|
||||
int? timeTotalMinute;
|
||||
int? timeTotalHour;
|
||||
dynamic approvalStatus;
|
||||
bool? isActive;
|
||||
int? clickButton;
|
||||
List<dynamic>? procedures;
|
||||
dynamic pickupLocation;
|
||||
dynamic dropOffLocation;
|
||||
dynamic clinicName;
|
||||
dynamic doctorName;
|
||||
dynamic branch;
|
||||
dynamic time;
|
||||
dynamic notes;
|
||||
|
||||
GetCMCAllOrdersResponseModel(
|
||||
{this.iD,
|
||||
this.patientId,
|
||||
this.patientOutSa,
|
||||
this.isOutPatient,
|
||||
this.projectId,
|
||||
this.nearestProjectId,
|
||||
this.longitude,
|
||||
this.latitude,
|
||||
this.appointmentNo,
|
||||
this.dischargeId,
|
||||
this.statusId,
|
||||
this.serviceId,
|
||||
this.channel,
|
||||
this.orderpayment,
|
||||
this.orderselectedservice,
|
||||
this.wforder,
|
||||
this.orderapprovalobj,
|
||||
this.created,
|
||||
this.createdBy,
|
||||
this.modified,
|
||||
this.modifiedBy,
|
||||
this.isDeleted,
|
||||
this.statusText,
|
||||
this.paymentStatus,
|
||||
this.clientRequestid,
|
||||
this.paymentStatusText,
|
||||
this.projectName,
|
||||
this.nearestProjectName,
|
||||
this.paymentAmount,
|
||||
this.wFOrder,
|
||||
this.serviceText,
|
||||
this.isSentForApproval,
|
||||
this.exaCartOrderId,
|
||||
this.isTimer,
|
||||
this.timeSeconds,
|
||||
this.totalPendingSeconds,
|
||||
this.timeMinute,
|
||||
this.timeHour,
|
||||
this.timeTotalSeconds,
|
||||
this.timeTotalMinute,
|
||||
this.timeTotalHour,
|
||||
this.approvalStatus,
|
||||
this.isActive,
|
||||
this.clickButton,
|
||||
this.procedures,
|
||||
this.pickupLocation,
|
||||
this.dropOffLocation,
|
||||
this.clinicName,
|
||||
this.doctorName,
|
||||
this.branch,
|
||||
this.time,
|
||||
this.notes});
|
||||
|
||||
GetCMCAllOrdersResponseModel.fromJson(Map<String, dynamic> json) {
|
||||
log("responseJson: $json");
|
||||
iD = json['ID'];
|
||||
patientId = json['PatientId'];
|
||||
patientOutSa = json['PatientOutSa'];
|
||||
isOutPatient = json['IsOutPatient'];
|
||||
projectId = json['ProjectId'];
|
||||
nearestProjectId = json['NearestProjectId'];
|
||||
longitude = json['Longitude'];
|
||||
latitude = json['Latitude'];
|
||||
appointmentNo = json['AppointmentNo'];
|
||||
dischargeId = json['DischargeId'];
|
||||
statusId = json['StatusId'];
|
||||
serviceId = json['ServiceId'];
|
||||
channel = json['Channel'];
|
||||
orderpayment = json['orderpayment'] != null ? Orderpayment.fromJson(json['orderpayment']) : null;
|
||||
orderselectedservice = json['orderselectedservice'];
|
||||
wforder = json['wforder'];
|
||||
orderapprovalobj = json['orderapprovalobj'];
|
||||
created = json['Created'];
|
||||
createdBy = json['CreatedBy'];
|
||||
modified = json['Modified'];
|
||||
modifiedBy = json['ModifiedBy'];
|
||||
isDeleted = json['IsDeleted'];
|
||||
statusText = json['StatusText'];
|
||||
paymentStatus = json['PaymentStatus'];
|
||||
clientRequestid = json['ClientRequestid'];
|
||||
paymentStatusText = json['PaymentStatusText'];
|
||||
projectName = json['ProjectName'];
|
||||
nearestProjectName = json['NearestProjectName'];
|
||||
paymentAmount = json['PaymentAmount'];
|
||||
wFOrder = json['WF_order'] != null ? WFOrder.fromJson(json['WF_order']) : null;
|
||||
serviceText = json['ServiceText'];
|
||||
isSentForApproval = json['isSentForApproval'];
|
||||
exaCartOrderId = json['ExaCart_OrderId'];
|
||||
isTimer = json['isTimer'];
|
||||
timeSeconds = json['TimeSeconds'];
|
||||
totalPendingSeconds = json['TotalPendingSeconds'];
|
||||
timeMinute = json['TimeMinute'];
|
||||
timeHour = json['TimeHour'];
|
||||
timeTotalSeconds = json['TimeTotalSeconds'];
|
||||
timeTotalMinute = json['TimeTotalMinute'];
|
||||
timeTotalHour = json['TimeTotalHour'];
|
||||
approvalStatus = json['ApprovalStatus'];
|
||||
isActive = json['isActive'];
|
||||
clickButton = json['ClickButton'];
|
||||
pickupLocation = json['PickupLocation'];
|
||||
dropOffLocation = json['DropOffLocation'];
|
||||
clinicName = json['clinicName'];
|
||||
doctorName = json['DoctorName'];
|
||||
branch = json['Branch'];
|
||||
time = json['Time'];
|
||||
notes = json['Notes'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['ID'] = iD;
|
||||
data['PatientId'] = patientId;
|
||||
data['PatientOutSa'] = patientOutSa;
|
||||
data['IsOutPatient'] = isOutPatient;
|
||||
data['ProjectId'] = projectId;
|
||||
data['NearestProjectId'] = nearestProjectId;
|
||||
data['Longitude'] = longitude;
|
||||
data['Latitude'] = latitude;
|
||||
data['AppointmentNo'] = appointmentNo;
|
||||
data['DischargeId'] = dischargeId;
|
||||
data['StatusId'] = statusId;
|
||||
data['ServiceId'] = serviceId;
|
||||
data['Channel'] = channel;
|
||||
if (orderpayment != null) {
|
||||
data['orderpayment'] = orderpayment!.toJson();
|
||||
}
|
||||
data['orderselectedservice'] = orderselectedservice;
|
||||
|
||||
data['wforder'] = wforder;
|
||||
data['orderapprovalobj'] = orderapprovalobj;
|
||||
data['Created'] = created;
|
||||
data['CreatedBy'] = createdBy;
|
||||
data['Modified'] = modified;
|
||||
data['ModifiedBy'] = modifiedBy;
|
||||
data['IsDeleted'] = isDeleted;
|
||||
data['StatusText'] = statusText;
|
||||
data['PaymentStatus'] = paymentStatus;
|
||||
data['ClientRequestid'] = clientRequestid;
|
||||
data['PaymentStatusText'] = paymentStatusText;
|
||||
data['ProjectName'] = projectName;
|
||||
data['NearestProjectName'] = nearestProjectName;
|
||||
data['PaymentAmount'] = paymentAmount;
|
||||
if (wFOrder != null) {
|
||||
data['WF_order'] = wFOrder!.toJson();
|
||||
}
|
||||
data['ServiceText'] = serviceText;
|
||||
data['isSentForApproval'] = isSentForApproval;
|
||||
data['ExaCart_OrderId'] = exaCartOrderId;
|
||||
data['isTimer'] = isTimer;
|
||||
data['TimeSeconds'] = timeSeconds;
|
||||
data['TotalPendingSeconds'] = totalPendingSeconds;
|
||||
data['TimeMinute'] = timeMinute;
|
||||
data['TimeHour'] = timeHour;
|
||||
data['TimeTotalSeconds'] = timeTotalSeconds;
|
||||
data['TimeTotalMinute'] = timeTotalMinute;
|
||||
data['TimeTotalHour'] = timeTotalHour;
|
||||
data['ApprovalStatus'] = approvalStatus;
|
||||
data['isActive'] = isActive;
|
||||
data['ClickButton'] = clickButton;
|
||||
data['PickupLocation'] = pickupLocation;
|
||||
data['DropOffLocation'] = dropOffLocation;
|
||||
data['clinicName'] = clinicName;
|
||||
data['DoctorName'] = doctorName;
|
||||
data['Branch'] = branch;
|
||||
data['Time'] = time;
|
||||
data['Notes'] = notes;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class Orderpayment {
|
||||
int? iD;
|
||||
int? orderId;
|
||||
dynamic clientRequestId;
|
||||
dynamic totalAmount;
|
||||
int? paymentStatus;
|
||||
dynamic order;
|
||||
String? created;
|
||||
dynamic createdBy;
|
||||
dynamic modified;
|
||||
dynamic modifiedBy;
|
||||
bool? isDeleted;
|
||||
|
||||
Orderpayment(
|
||||
{this.iD,
|
||||
this.orderId,
|
||||
this.clientRequestId,
|
||||
this.totalAmount,
|
||||
this.paymentStatus,
|
||||
this.order,
|
||||
this.created,
|
||||
this.createdBy,
|
||||
this.modified,
|
||||
this.modifiedBy,
|
||||
this.isDeleted});
|
||||
|
||||
Orderpayment.fromJson(Map<String, dynamic> json) {
|
||||
iD = json['ID'];
|
||||
orderId = json['OrderId'];
|
||||
clientRequestId = json['ClientRequestId'];
|
||||
totalAmount = json['TotalAmount'];
|
||||
paymentStatus = json['PaymentStatus'];
|
||||
order = json['Order'];
|
||||
created = json['Created'];
|
||||
createdBy = json['CreatedBy'];
|
||||
modified = json['Modified'];
|
||||
modifiedBy = json['ModifiedBy'];
|
||||
isDeleted = json['IsDeleted'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['ID'] = iD;
|
||||
data['OrderId'] = orderId;
|
||||
data['ClientRequestId'] = clientRequestId;
|
||||
data['TotalAmount'] = totalAmount;
|
||||
data['PaymentStatus'] = paymentStatus;
|
||||
data['Order'] = order;
|
||||
data['Created'] = created;
|
||||
data['CreatedBy'] = createdBy;
|
||||
data['Modified'] = modified;
|
||||
data['ModifiedBy'] = modifiedBy;
|
||||
data['IsDeleted'] = isDeleted;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class WFOrder {
|
||||
dynamic wfButtonsDTO;
|
||||
int? iD;
|
||||
int? orderId;
|
||||
int? previousStep;
|
||||
int? nextStep;
|
||||
int? serviceId;
|
||||
dynamic order;
|
||||
String? created;
|
||||
dynamic createdBy;
|
||||
dynamic modified;
|
||||
dynamic modifiedBy;
|
||||
bool? isDeleted;
|
||||
|
||||
WFOrder(
|
||||
{this.wfButtonsDTO,
|
||||
this.iD,
|
||||
this.orderId,
|
||||
this.previousStep,
|
||||
this.nextStep,
|
||||
this.serviceId,
|
||||
this.order,
|
||||
this.created,
|
||||
this.createdBy,
|
||||
this.modified,
|
||||
this.modifiedBy,
|
||||
this.isDeleted});
|
||||
|
||||
WFOrder.fromJson(Map<String, dynamic> json) {
|
||||
wfButtonsDTO = json['wf_ButtonsDTO'];
|
||||
iD = json['ID'];
|
||||
orderId = json['OrderId'];
|
||||
previousStep = json['PreviousStep'];
|
||||
nextStep = json['NextStep'];
|
||||
serviceId = json['ServiceId'];
|
||||
order = json['Order'];
|
||||
created = json['Created'];
|
||||
createdBy = json['CreatedBy'];
|
||||
modified = json['Modified'];
|
||||
modifiedBy = json['ModifiedBy'];
|
||||
isDeleted = json['IsDeleted'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['wf_ButtonsDTO'] = wfButtonsDTO;
|
||||
data['ID'] = iD;
|
||||
data['OrderId'] = orderId;
|
||||
data['PreviousStep'] = previousStep;
|
||||
data['NextStep'] = nextStep;
|
||||
data['ServiceId'] = serviceId;
|
||||
data['Order'] = order;
|
||||
data['Created'] = created;
|
||||
data['CreatedBy'] = createdBy;
|
||||
data['Modified'] = modified;
|
||||
data['ModifiedBy'] = modifiedBy;
|
||||
data['IsDeleted'] = isDeleted;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -1,57 +0,0 @@
|
||||
class GetCMCServicesResponseModel {
|
||||
int? iD;
|
||||
String? serviceID;
|
||||
int? orderServiceID;
|
||||
String? text;
|
||||
String? textN;
|
||||
dynamic price;
|
||||
dynamic priceVAT;
|
||||
dynamic priceTotal;
|
||||
bool? isEnabled;
|
||||
int? orderId;
|
||||
int? quantity;
|
||||
|
||||
GetCMCServicesResponseModel({
|
||||
this.iD,
|
||||
this.serviceID,
|
||||
this.orderServiceID,
|
||||
this.text,
|
||||
this.textN,
|
||||
this.price,
|
||||
this.priceVAT,
|
||||
this.priceTotal,
|
||||
this.isEnabled,
|
||||
this.orderId,
|
||||
this.quantity,
|
||||
});
|
||||
|
||||
GetCMCServicesResponseModel.fromJson(Map<String, dynamic> json) {
|
||||
iD = json['ID'];
|
||||
serviceID = json['ServiceID'];
|
||||
orderServiceID = json['OrderServiceID'];
|
||||
text = json['Text'];
|
||||
textN = json['TextN'];
|
||||
price = json['Price'];
|
||||
priceVAT = json['PriceVAT'];
|
||||
priceTotal = json['PriceTotal'];
|
||||
isEnabled = json['IsEnabled'];
|
||||
orderId = json['OrderId'];
|
||||
quantity = json['Quantity'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = {};
|
||||
data['ID'] = this.iD;
|
||||
data['ServiceID'] = this.serviceID;
|
||||
data['OrderServiceID'] = this.orderServiceID;
|
||||
data['Text'] = this.text;
|
||||
data['TextN'] = this.textN;
|
||||
data['Price'] = this.price;
|
||||
data['PriceVAT'] = this.priceVAT;
|
||||
data['PriceTotal'] = this.priceTotal;
|
||||
data['IsEnabled'] = this.isEnabled;
|
||||
data['OrderId'] = this.orderId;
|
||||
data['Quantity'] = this.quantity;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -1,25 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class HmgServicesComponentModel {
|
||||
int action;
|
||||
String title;
|
||||
String subTitle;
|
||||
String icon;
|
||||
bool isLogin;
|
||||
bool isLocked;
|
||||
Color bgColor;
|
||||
Color textColor;
|
||||
String route;
|
||||
|
||||
HmgServicesComponentModel(
|
||||
this.action,
|
||||
this.title,
|
||||
this.subTitle,
|
||||
this.icon,
|
||||
this.isLogin, {
|
||||
this.isLocked = false,
|
||||
this.bgColor = Colors.white,
|
||||
this.textColor = Colors.black,
|
||||
this.route = '',
|
||||
});
|
||||
}
|
||||
@ -1,80 +0,0 @@
|
||||
class GeocodeResponse {
|
||||
final List<GeocodeResult> results;
|
||||
final String status;
|
||||
|
||||
GeocodeResponse({
|
||||
required this.results,
|
||||
required this.status,
|
||||
});
|
||||
|
||||
factory GeocodeResponse.fromJson(Map<String, dynamic> json) {
|
||||
final resultsList = (json['results'] as List<dynamic>? ?? [])
|
||||
.map((e) => GeocodeResult.fromJson(e as Map<String, dynamic>))
|
||||
.toList();
|
||||
|
||||
return GeocodeResponse(
|
||||
results: resultsList,
|
||||
status: json['status'] ?? '',
|
||||
);
|
||||
}
|
||||
@override
|
||||
String toString() {
|
||||
return 'GeocodeResponse(status: $status, results: [${results.map((r) => r.toString()).join(', ')}])';
|
||||
}
|
||||
}
|
||||
|
||||
class GeocodeResult {
|
||||
final String formattedAddress;
|
||||
final Geometry geometry;
|
||||
final String placeId;
|
||||
|
||||
GeocodeResult({
|
||||
required this.formattedAddress,
|
||||
required this.geometry,
|
||||
required this.placeId,
|
||||
});
|
||||
|
||||
factory GeocodeResult.fromJson(Map<String, dynamic> json) {
|
||||
return GeocodeResult(
|
||||
formattedAddress: json['formatted_address'] ?? '',
|
||||
geometry: Geometry.fromJson(json['geometry']),
|
||||
placeId: json['place_id'] ?? '',
|
||||
);
|
||||
}
|
||||
@override
|
||||
String toString() {
|
||||
return 'GeocodeResult(formattedAddress: $formattedAddress, placeId: $placeId, geometry: ${geometry.toString()})';
|
||||
}
|
||||
}
|
||||
|
||||
class Geometry {
|
||||
final Location location;
|
||||
|
||||
Geometry({required this.location});
|
||||
|
||||
factory Geometry.fromJson(Map<String, dynamic> json) {
|
||||
return Geometry(
|
||||
location: Location.fromJson(json['location']),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() => 'Geometry(location: ${location.toString()})';
|
||||
}
|
||||
|
||||
class Location {
|
||||
final double lat;
|
||||
final double lng;
|
||||
|
||||
Location({required this.lat, required this.lng});
|
||||
|
||||
factory Location.fromJson(Map<String, dynamic> json) {
|
||||
return Location(
|
||||
lat: (json['lat'] as num).toDouble(),
|
||||
lng: (json['lng'] as num).toDouble(),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() => 'Location(lat: $lat, lng: $lng)';
|
||||
}
|
||||
@ -1,14 +0,0 @@
|
||||
class PlaceDetails {
|
||||
final double lat;
|
||||
final double lng;
|
||||
|
||||
PlaceDetails({required this.lat, required this.lng});
|
||||
|
||||
factory PlaceDetails.fromJson(Map<String, dynamic> json) {
|
||||
final loc = json['result']['geometry']['location'];
|
||||
return PlaceDetails(
|
||||
lat: (loc['lat'] as num).toDouble(),
|
||||
lng: (loc['lng'] as num).toDouble(),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -1,11 +0,0 @@
|
||||
class PlacePrediction {
|
||||
final String description;
|
||||
final String placeID;
|
||||
PlacePrediction({required this.description, required this.placeID});
|
||||
factory PlacePrediction.fromJson(Map<String, dynamic> json) {
|
||||
return PlacePrediction(
|
||||
description: json['description'] ?? '',
|
||||
placeID: json['place_id'] ?? '',
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -1,153 +0,0 @@
|
||||
import 'package:dartz/dartz.dart';
|
||||
import 'package:hmg_patient_app_new/core/api/api_client.dart';
|
||||
import 'package:hmg_patient_app_new/core/common_models/generic_api_model.dart';
|
||||
import 'package:hmg_patient_app_new/core/exceptions/api_failure.dart';
|
||||
import 'package:hmg_patient_app_new/features/location/GeocodeResponse.dart';
|
||||
import 'package:hmg_patient_app_new/features/location/PlaceDetails.dart';
|
||||
|
||||
import '../../core/api_consts.dart';
|
||||
import 'PlacePrediction.dart';
|
||||
|
||||
abstract class LocationRepo {
|
||||
Future<Either<Failure, GenericApiModel<List<PlacePrediction>>>>
|
||||
getPlacePredictionsAsInput(String input);
|
||||
|
||||
Future<Either<Failure, GenericApiModel<PlaceDetails>>>
|
||||
getPlaceDetailsOfSelectedPrediction(String placeId);
|
||||
|
||||
Future<Either<Failure, GenericApiModel<GeocodeResponse>>>
|
||||
getGeoCodeFromLatLng(double lat, double lng);
|
||||
}
|
||||
|
||||
class LocationRepoImpl implements LocationRepo {
|
||||
final ApiClient apiClient;
|
||||
|
||||
LocationRepoImpl({required this.apiClient});
|
||||
|
||||
@override
|
||||
Future<Either<Failure, GenericApiModel<List<PlacePrediction>>>> getPlacePredictionsAsInput(
|
||||
String input) async {
|
||||
final url = Uri.parse(
|
||||
'https://maps.googleapis.com/maps/api/place/autocomplete/json?input=$input®ion=SA&key=$GOOGLE_API_KEY',
|
||||
);
|
||||
|
||||
GenericApiModel<List<PlacePrediction>>? apiResponse;
|
||||
Failure? failure;
|
||||
|
||||
try {
|
||||
await apiClient.get(
|
||||
url.toString(),
|
||||
isExternal: true,
|
||||
onFailure: (error, statusCode, {messageStatus, failureType}) {
|
||||
failure = failureType;
|
||||
},
|
||||
onSuccess: (response, statusCode, {messageStatus, errorMessage}) {
|
||||
try {
|
||||
final list = response['predictions'];
|
||||
final predictionsList = list
|
||||
.map((item) =>
|
||||
PlacePrediction.fromJson(item as Map<String, dynamic>))
|
||||
.toList()
|
||||
.cast<PlacePrediction>();
|
||||
apiResponse = GenericApiModel<List<PlacePrediction>>(
|
||||
messageStatus: messageStatus,
|
||||
statusCode: statusCode,
|
||||
errorMessage: null,
|
||||
data: predictionsList,
|
||||
);
|
||||
} catch (e) {
|
||||
failure = DataParsingFailure(e.toString());
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
if (failure != null) return Left(failure!);
|
||||
if (apiResponse == null) return Left(ServerFailure("Unknown error"));
|
||||
return Right(apiResponse!);
|
||||
} catch (e) {
|
||||
return Left(UnknownFailure(e.toString()));
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Future<Either<Failure, GenericApiModel<GeocodeResponse>>> getGeoCodeFromLatLng(double lat, double lng) async {
|
||||
final url = Uri.parse(
|
||||
'https://maps.googleapis.com/maps/api/geocode/json?latlng=$lat,$lng&key=$GOOGLE_API_KEY',
|
||||
);
|
||||
|
||||
|
||||
GenericApiModel<GeocodeResponse>? apiResponse;
|
||||
Failure? failure;
|
||||
|
||||
try {
|
||||
await apiClient.get(
|
||||
url.toString(),
|
||||
isExternal: true,
|
||||
onFailure: (error, statusCode, {messageStatus, failureType}) {
|
||||
failure = failureType;
|
||||
},
|
||||
onSuccess: (response, statusCode, {messageStatus, errorMessage}) {
|
||||
try {
|
||||
final predictionsList = GeocodeResponse.fromJson(response);
|
||||
apiResponse = GenericApiModel<GeocodeResponse>(
|
||||
messageStatus: messageStatus,
|
||||
statusCode: statusCode,
|
||||
errorMessage: null,
|
||||
data: predictionsList,
|
||||
);
|
||||
} catch (e) {
|
||||
failure = DataParsingFailure(e.toString());
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
if (failure != null) return Left(failure!);
|
||||
if (apiResponse == null) return Left(ServerFailure("Unknown error"));
|
||||
return Right(apiResponse!);
|
||||
} catch (e) {
|
||||
return Left(UnknownFailure(e.toString()));
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Future<Either<Failure, GenericApiModel<PlaceDetails>>> getPlaceDetailsOfSelectedPrediction(String placeId) async {
|
||||
|
||||
|
||||
final url = Uri.parse(
|
||||
'https://maps.googleapis.com/maps/api/place/details/json'
|
||||
'?place_id=$placeId&fields=geometry&key=$GOOGLE_API_KEY',
|
||||
);
|
||||
|
||||
GenericApiModel<PlaceDetails>? apiResponse;
|
||||
Failure? failure;
|
||||
|
||||
try {
|
||||
await apiClient.get(
|
||||
url.toString(),
|
||||
isExternal: true,
|
||||
onFailure: (error, statusCode, {messageStatus, failureType}) {
|
||||
failure = failureType;
|
||||
},
|
||||
onSuccess: (response, statusCode, {messageStatus, errorMessage}) {
|
||||
try {
|
||||
final predictionsList = PlaceDetails.fromJson(response);
|
||||
apiResponse = GenericApiModel<PlaceDetails>(
|
||||
messageStatus: messageStatus,
|
||||
statusCode: statusCode,
|
||||
errorMessage: null,
|
||||
data: predictionsList,
|
||||
);
|
||||
} catch (e) {
|
||||
failure = DataParsingFailure(e.toString());
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
if (failure != null) return Left(failure!);
|
||||
if (apiResponse == null) return Left(ServerFailure("Unknown error"));
|
||||
return Right(apiResponse!);
|
||||
} catch (e) {
|
||||
return Left(UnknownFailure(e.toString()));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,172 +0,0 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/foundation.dart' show ChangeNotifier;
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:google_maps_flutter_platform_interface/src/types/camera.dart';
|
||||
import 'package:hmg_patient_app_new/core/app_state.dart';
|
||||
import 'package:hmg_patient_app_new/core/dependencies.dart';
|
||||
import 'package:hmg_patient_app_new/features/location/GeocodeResponse.dart';
|
||||
import 'package:hmg_patient_app_new/features/location/PlaceDetails.dart';
|
||||
import 'package:hmg_patient_app_new/features/location/location_repo.dart';
|
||||
import 'package:hmg_patient_app_new/services/error_handler_service.dart';
|
||||
import 'package:huawei_map/huawei_map.dart' as HMSCameraServices;
|
||||
import 'package:google_maps_flutter/google_maps_flutter.dart' as GMSMapServices;
|
||||
|
||||
|
||||
|
||||
import 'PlacePrediction.dart';
|
||||
|
||||
class LocationViewModel extends ChangeNotifier {
|
||||
final LocationRepo locationRepo;
|
||||
final ErrorHandlerService errorHandlerService;
|
||||
|
||||
LocationViewModel({required this.locationRepo, required this.errorHandlerService}){
|
||||
placeValueInController();
|
||||
}
|
||||
|
||||
List<PlacePrediction> predictions = [];
|
||||
PlacePrediction? selectedPrediction;
|
||||
bool isPredictionLoading = false;
|
||||
GeocodeResponse? geocodeResponse;
|
||||
PlaceDetails? placeDetails;
|
||||
|
||||
Location? mapCapturedLocation;
|
||||
|
||||
Completer<GMSMapServices.GoogleMapController>? gmsController;
|
||||
Completer<HMSCameraServices.HuaweiMapController>? hmsController;
|
||||
|
||||
HMSCameraServices.CameraPosition getHMSLocation() {
|
||||
return HMSCameraServices.CameraPosition(target: HMSCameraServices.LatLng(getIt<AppState>().userLat, getIt<AppState>().userLong), zoom: 18);
|
||||
}
|
||||
|
||||
|
||||
GMSMapServices.CameraPosition getGMSLocation() {
|
||||
return GMSMapServices.CameraPosition(target: GMSMapServices.LatLng(getIt<AppState>().userLat, getIt<AppState>().userLong), zoom: 18);
|
||||
}
|
||||
|
||||
void placeValueInController() async{
|
||||
if (await getIt<AppState>().isGMSAvailable) {
|
||||
gmsController = Completer<GMSMapServices.GoogleMapController>();
|
||||
} else {
|
||||
hmsController = Completer<HMSCameraServices.HuaweiMapController>();
|
||||
}
|
||||
}
|
||||
|
||||
FutureOr<void> getPlacesPrediction(String input) async {
|
||||
predictions = [];
|
||||
isPredictionLoading= true;
|
||||
final result = await locationRepo.getPlacePredictionsAsInput(input);
|
||||
result.fold(
|
||||
(failure) {
|
||||
errorHandlerService.handleError(failure: failure);
|
||||
},
|
||||
(apiModel) {
|
||||
predictions = apiModel.data??[];
|
||||
},
|
||||
);
|
||||
isPredictionLoading = false;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
FutureOr<void> getPlaceEncodedData(double? lat, double? lng) async {
|
||||
geocodeResponse = null;
|
||||
final result = await locationRepo.getGeoCodeFromLatLng(lat!, lng!);
|
||||
result.fold(
|
||||
(failure) {
|
||||
errorHandlerService.handleError(failure: failure);
|
||||
},
|
||||
(apiModel) {
|
||||
print("Geocode Response: ${apiModel.data}");
|
||||
geocodeResponse = apiModel.data;
|
||||
},
|
||||
);
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
FutureOr<void> getPlaceDetails(String placeID) async {
|
||||
placeDetails = null;
|
||||
final result = await locationRepo.getPlaceDetailsOfSelectedPrediction(placeID);
|
||||
result.fold(
|
||||
(failure) {
|
||||
errorHandlerService.handleError(failure: failure);
|
||||
},
|
||||
(apiModel) {
|
||||
placeDetails = apiModel.data;
|
||||
},
|
||||
);
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
handleGMSMapCameraMoved(GMSMapServices.CameraPosition value) {
|
||||
mapCapturedLocation = Location(lat: value.target.latitude, lng: value.target.longitude);
|
||||
|
||||
}
|
||||
|
||||
handleHMSMapCameraMoved(HMSCameraServices.CameraPosition value) {
|
||||
mapCapturedLocation = Location(lat: value.target.lat, lng: value.target.lng);
|
||||
}
|
||||
|
||||
handleOnCameraIdle(){
|
||||
if(mapCapturedLocation != null) {
|
||||
getPlaceEncodedData(mapCapturedLocation!.lat, mapCapturedLocation!.lng);
|
||||
}
|
||||
}
|
||||
|
||||
void updateSearchQuery(String? value) {
|
||||
if(value == null || value.isEmpty){
|
||||
predictions = [];
|
||||
return;
|
||||
}
|
||||
|
||||
getPlacesPrediction(value);
|
||||
}
|
||||
|
||||
void flushSearchPredictions() {
|
||||
predictions = [];
|
||||
mapCapturedLocation= null;
|
||||
placeDetails= null;
|
||||
geocodeResponse= null;
|
||||
selectedPrediction= null;
|
||||
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
FutureOr<void> selectPlacePrediction(PlacePrediction placePrediction) async{
|
||||
selectedPrediction= placePrediction;
|
||||
await getPlaceDetails(placePrediction.placeID);
|
||||
}
|
||||
|
||||
void moveToCurrentLocation() {
|
||||
moveController(Location(lat: getIt<AppState>().userLat, lng: getIt<AppState>().userLong));
|
||||
}
|
||||
|
||||
void moveController(Location location) {
|
||||
print("moving to location");
|
||||
print("gmsController is null or not $gmsController");
|
||||
if (getIt<AppState>().isGMSAvailable) {
|
||||
gmsController?.future.then((controller) {
|
||||
controller.animateCamera(
|
||||
GMSMapServices.CameraUpdate.newCameraPosition(
|
||||
GMSMapServices.CameraPosition(
|
||||
target: GMSMapServices.LatLng(location.lat, location.lng),
|
||||
zoom: 18,
|
||||
),
|
||||
),
|
||||
);
|
||||
});
|
||||
} else {
|
||||
print("hmsController is null or not $hmsController");
|
||||
|
||||
hmsController?.future.then((controller) {
|
||||
controller.animateCamera(
|
||||
HMSCameraServices.CameraUpdate.newCameraPosition(
|
||||
HMSCameraServices.CameraPosition(
|
||||
target: HMSCameraServices.LatLng(location.lat, location.lng),
|
||||
zoom: 18,
|
||||
),
|
||||
),
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,92 +0,0 @@
|
||||
class AskDocRequestType {
|
||||
String? setupID;
|
||||
int? parameterGroup;
|
||||
int? parameterType;
|
||||
int? parameterCode;
|
||||
String? description;
|
||||
String? descriptionN;
|
||||
String? alias;
|
||||
String? aliasN;
|
||||
String? prefix;
|
||||
String? suffix;
|
||||
String? isColorCodingRequired;
|
||||
String? backColor;
|
||||
String? foreColor;
|
||||
bool? isBuiltIn;
|
||||
bool? isActive;
|
||||
int? createdBy;
|
||||
String? createdOn;
|
||||
String? editedBy;
|
||||
String? editedOn;
|
||||
String? rowVer;
|
||||
|
||||
AskDocRequestType(
|
||||
{this.setupID,
|
||||
this.parameterGroup,
|
||||
this.parameterType,
|
||||
this.parameterCode,
|
||||
this.description,
|
||||
this.descriptionN,
|
||||
this.alias,
|
||||
this.aliasN,
|
||||
this.prefix,
|
||||
this.suffix,
|
||||
this.isColorCodingRequired,
|
||||
this.backColor,
|
||||
this.foreColor,
|
||||
this.isBuiltIn,
|
||||
this.isActive,
|
||||
this.createdBy,
|
||||
this.createdOn,
|
||||
this.editedBy,
|
||||
this.editedOn,
|
||||
this.rowVer});
|
||||
|
||||
AskDocRequestType.fromJson(Map<String, dynamic> json) {
|
||||
setupID = json['SetupID'];
|
||||
parameterGroup = json['ParameterGroup'];
|
||||
parameterType = json['ParameterType'];
|
||||
parameterCode = json['ParameterCode'];
|
||||
description = json['Description'];
|
||||
descriptionN = json['DescriptionN'];
|
||||
alias = json['Alias'];
|
||||
aliasN = json['AliasN'];
|
||||
prefix = json['Prefix'];
|
||||
suffix = json['Suffix'];
|
||||
isColorCodingRequired = json['IsColorCodingRequired'];
|
||||
backColor = json['BackColor'];
|
||||
foreColor = json['ForeColor'];
|
||||
isBuiltIn = json['IsBuiltIn'];
|
||||
isActive = json['IsActive'];
|
||||
createdBy = json['CreatedBy'];
|
||||
createdOn = json['CreatedOn'];
|
||||
editedBy = json['EditedBy'];
|
||||
editedOn = json['EditedOn'];
|
||||
rowVer = json['RowVer'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['SetupID'] = this.setupID;
|
||||
data['ParameterGroup'] = this.parameterGroup;
|
||||
data['ParameterType'] = this.parameterType;
|
||||
data['ParameterCode'] = this.parameterCode;
|
||||
data['Description'] = this.description;
|
||||
data['DescriptionN'] = this.descriptionN;
|
||||
data['Alias'] = this.alias;
|
||||
data['AliasN'] = this.aliasN;
|
||||
data['Prefix'] = this.prefix;
|
||||
data['Suffix'] = this.suffix;
|
||||
data['IsColorCodingRequired'] = this.isColorCodingRequired;
|
||||
data['BackColor'] = this.backColor;
|
||||
data['ForeColor'] = this.foreColor;
|
||||
data['IsBuiltIn'] = this.isBuiltIn;
|
||||
data['IsActive'] = this.isActive;
|
||||
data['CreatedBy'] = this.createdBy;
|
||||
data['CreatedOn'] = this.createdOn;
|
||||
data['EditedBy'] = this.editedBy;
|
||||
data['EditedOn'] = this.editedOn;
|
||||
data['RowVer'] = this.rowVer;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -1,318 +0,0 @@
|
||||
class PrescriptionDeliveryResponseModel {
|
||||
int? iD;
|
||||
int? patientId;
|
||||
int? patientOutSa;
|
||||
bool? isOutPatient;
|
||||
int? projectId;
|
||||
int? nearestProjectId;
|
||||
dynamic longitude;
|
||||
dynamic latitude;
|
||||
dynamic appointmentNo;
|
||||
dynamic dischargeId;
|
||||
int? statusId;
|
||||
int? serviceId;
|
||||
int? channel;
|
||||
Orderpayment? orderpayment;
|
||||
dynamic orderselectedservice;
|
||||
dynamic wforder;
|
||||
dynamic orderapprovalobj;
|
||||
String? created;
|
||||
dynamic createdBy;
|
||||
dynamic modified;
|
||||
dynamic modifiedBy;
|
||||
bool? isDeleted;
|
||||
String? statusText;
|
||||
int? paymentStatus;
|
||||
dynamic clientRequestid;
|
||||
dynamic paymentStatusText;
|
||||
String? projectName;
|
||||
String? nearestProjectName;
|
||||
dynamic paymentAmount;
|
||||
WFOrder? wFOrder;
|
||||
String? serviceText;
|
||||
bool? isSentForApproval;
|
||||
int? exaCartOrderId;
|
||||
bool? isTimer;
|
||||
int? timeSeconds;
|
||||
int? totalPendingSeconds;
|
||||
int? timeMinute;
|
||||
int? timeHour;
|
||||
int? timeTotalSeconds;
|
||||
int? timeTotalMinute;
|
||||
int? timeTotalHour;
|
||||
dynamic approvalStatus;
|
||||
bool? isActive;
|
||||
int? clickButton;
|
||||
List<dynamic>? procedures;
|
||||
dynamic pickupLocation;
|
||||
dynamic dropOffLocation;
|
||||
dynamic clinicName;
|
||||
dynamic doctorName;
|
||||
dynamic branch;
|
||||
dynamic time;
|
||||
dynamic notes;
|
||||
|
||||
PrescriptionDeliveryResponseModel(
|
||||
{this.iD,
|
||||
this.patientId,
|
||||
this.patientOutSa,
|
||||
this.isOutPatient,
|
||||
this.projectId,
|
||||
this.nearestProjectId,
|
||||
this.longitude,
|
||||
this.latitude,
|
||||
this.appointmentNo,
|
||||
this.dischargeId,
|
||||
this.statusId,
|
||||
this.serviceId,
|
||||
this.channel,
|
||||
this.orderpayment,
|
||||
this.orderselectedservice,
|
||||
this.wforder,
|
||||
this.orderapprovalobj,
|
||||
this.created,
|
||||
this.createdBy,
|
||||
this.modified,
|
||||
this.modifiedBy,
|
||||
this.isDeleted,
|
||||
this.statusText,
|
||||
this.paymentStatus,
|
||||
this.clientRequestid,
|
||||
this.paymentStatusText,
|
||||
this.projectName,
|
||||
this.nearestProjectName,
|
||||
this.paymentAmount,
|
||||
this.wFOrder,
|
||||
this.serviceText,
|
||||
this.isSentForApproval,
|
||||
this.exaCartOrderId,
|
||||
this.isTimer,
|
||||
this.timeSeconds,
|
||||
this.totalPendingSeconds,
|
||||
this.timeMinute,
|
||||
this.timeHour,
|
||||
this.timeTotalSeconds,
|
||||
this.timeTotalMinute,
|
||||
this.timeTotalHour,
|
||||
this.approvalStatus,
|
||||
this.isActive,
|
||||
this.clickButton,
|
||||
this.procedures,
|
||||
this.pickupLocation,
|
||||
this.dropOffLocation,
|
||||
this.clinicName,
|
||||
this.doctorName,
|
||||
this.branch,
|
||||
this.time,
|
||||
this.notes});
|
||||
|
||||
PrescriptionDeliveryResponseModel.fromJson(Map<String, dynamic> json) {
|
||||
iD = json['ID'];
|
||||
patientId = json['PatientId'];
|
||||
patientOutSa = json['PatientOutSa'];
|
||||
isOutPatient = json['IsOutPatient'];
|
||||
projectId = json['ProjectId'];
|
||||
nearestProjectId = json['NearestProjectId'];
|
||||
longitude = json['Longitude'];
|
||||
latitude = json['Latitude'];
|
||||
appointmentNo = json['AppointmentNo'];
|
||||
dischargeId = json['DischargeId'];
|
||||
statusId = json['StatusId'];
|
||||
serviceId = json['ServiceId'];
|
||||
channel = json['Channel'];
|
||||
orderpayment = json['orderpayment'] != null ? new Orderpayment.fromJson(json['orderpayment']) : null;
|
||||
orderselectedservice = json['orderselectedservice'];
|
||||
wforder = json['wforder'];
|
||||
orderapprovalobj = json['orderapprovalobj'];
|
||||
created = json['Created'];
|
||||
createdBy = json['CreatedBy'];
|
||||
modified = json['Modified'];
|
||||
modifiedBy = json['ModifiedBy'];
|
||||
isDeleted = json['IsDeleted'];
|
||||
statusText = json['StatusText'];
|
||||
paymentStatus = json['PaymentStatus'];
|
||||
clientRequestid = json['ClientRequestid'];
|
||||
paymentStatusText = json['PaymentStatusText'];
|
||||
projectName = json['ProjectName'];
|
||||
nearestProjectName = json['NearestProjectName'];
|
||||
paymentAmount = json['PaymentAmount'];
|
||||
wFOrder = json['WF_order'] != null ? new WFOrder.fromJson(json['WF_order']) : null;
|
||||
serviceText = json['ServiceText'];
|
||||
isSentForApproval = json['isSentForApproval'];
|
||||
exaCartOrderId = json['ExaCart_OrderId'];
|
||||
isTimer = json['isTimer'];
|
||||
timeSeconds = json['TimeSeconds'];
|
||||
totalPendingSeconds = json['TotalPendingSeconds'];
|
||||
timeMinute = json['TimeMinute'];
|
||||
timeHour = json['TimeHour'];
|
||||
timeTotalSeconds = json['TimeTotalSeconds'];
|
||||
timeTotalMinute = json['TimeTotalMinute'];
|
||||
timeTotalHour = json['TimeTotalHour'];
|
||||
approvalStatus = json['ApprovalStatus'];
|
||||
isActive = json['isActive'];
|
||||
clickButton = json['ClickButton'];
|
||||
pickupLocation = json['PickupLocation'];
|
||||
dropOffLocation = json['DropOffLocation'];
|
||||
clinicName = json['clinicName'];
|
||||
doctorName = json['DoctorName'];
|
||||
branch = json['Branch'];
|
||||
time = json['Time'];
|
||||
notes = json['Notes'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['ID'] = this.iD;
|
||||
data['PatientId'] = this.patientId;
|
||||
data['PatientOutSa'] = this.patientOutSa;
|
||||
data['IsOutPatient'] = this.isOutPatient;
|
||||
data['ProjectId'] = this.projectId;
|
||||
data['NearestProjectId'] = this.nearestProjectId;
|
||||
data['Longitude'] = this.longitude;
|
||||
data['Latitude'] = this.latitude;
|
||||
data['AppointmentNo'] = this.appointmentNo;
|
||||
data['DischargeId'] = this.dischargeId;
|
||||
data['StatusId'] = this.statusId;
|
||||
data['ServiceId'] = this.serviceId;
|
||||
data['Channel'] = this.channel;
|
||||
if (this.orderpayment != null) {
|
||||
data['orderpayment'] = this.orderpayment!.toJson();
|
||||
}
|
||||
data['orderselectedservice'] = this.orderselectedservice;
|
||||
|
||||
data['wforder'] = this.wforder;
|
||||
data['orderapprovalobj'] = this.orderapprovalobj;
|
||||
data['Created'] = this.created;
|
||||
data['CreatedBy'] = this.createdBy;
|
||||
data['Modified'] = this.modified;
|
||||
data['ModifiedBy'] = this.modifiedBy;
|
||||
data['IsDeleted'] = this.isDeleted;
|
||||
data['StatusText'] = this.statusText;
|
||||
data['PaymentStatus'] = this.paymentStatus;
|
||||
data['ClientRequestid'] = this.clientRequestid;
|
||||
data['PaymentStatusText'] = this.paymentStatusText;
|
||||
data['ProjectName'] = this.projectName;
|
||||
data['NearestProjectName'] = this.nearestProjectName;
|
||||
data['PaymentAmount'] = this.paymentAmount;
|
||||
if (this.wFOrder != null) {
|
||||
data['WF_order'] = this.wFOrder!.toJson();
|
||||
}
|
||||
data['ServiceText'] = this.serviceText;
|
||||
data['isSentForApproval'] = this.isSentForApproval;
|
||||
data['ExaCart_OrderId'] = this.exaCartOrderId;
|
||||
data['isTimer'] = this.isTimer;
|
||||
data['TimeSeconds'] = this.timeSeconds;
|
||||
data['TotalPendingSeconds'] = this.totalPendingSeconds;
|
||||
data['TimeMinute'] = this.timeMinute;
|
||||
data['TimeHour'] = this.timeHour;
|
||||
data['TimeTotalSeconds'] = this.timeTotalSeconds;
|
||||
data['TimeTotalMinute'] = this.timeTotalMinute;
|
||||
data['TimeTotalHour'] = this.timeTotalHour;
|
||||
data['ApprovalStatus'] = this.approvalStatus;
|
||||
data['isActive'] = this.isActive;
|
||||
data['ClickButton'] = this.clickButton;
|
||||
data['PickupLocation'] = this.pickupLocation;
|
||||
data['DropOffLocation'] = this.dropOffLocation;
|
||||
data['clinicName'] = this.clinicName;
|
||||
data['DoctorName'] = this.doctorName;
|
||||
data['Branch'] = this.branch;
|
||||
data['Time'] = this.time;
|
||||
data['Notes'] = this.notes;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class Orderpayment {
|
||||
int? iD;
|
||||
int? orderId;
|
||||
dynamic clientRequestId;
|
||||
dynamic totalAmount;
|
||||
int? paymentStatus;
|
||||
dynamic order;
|
||||
String? created;
|
||||
dynamic createdBy;
|
||||
dynamic modified;
|
||||
dynamic modifiedBy;
|
||||
bool? isDeleted;
|
||||
|
||||
Orderpayment({this.iD, this.orderId, this.clientRequestId, this.totalAmount, this.paymentStatus, this.order, this.created, this.createdBy, this.modified, this.modifiedBy, this.isDeleted});
|
||||
|
||||
Orderpayment.fromJson(Map<String, dynamic> json) {
|
||||
iD = json['ID'];
|
||||
orderId = json['OrderId'];
|
||||
clientRequestId = json['ClientRequestId'];
|
||||
totalAmount = json['TotalAmount'];
|
||||
paymentStatus = json['PaymentStatus'];
|
||||
order = json['Order'];
|
||||
created = json['Created'];
|
||||
createdBy = json['CreatedBy'];
|
||||
modified = json['Modified'];
|
||||
modifiedBy = json['ModifiedBy'];
|
||||
isDeleted = json['IsDeleted'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['ID'] = this.iD;
|
||||
data['OrderId'] = this.orderId;
|
||||
data['ClientRequestId'] = this.clientRequestId;
|
||||
data['TotalAmount'] = this.totalAmount;
|
||||
data['PaymentStatus'] = this.paymentStatus;
|
||||
data['Order'] = this.order;
|
||||
data['Created'] = this.created;
|
||||
data['CreatedBy'] = this.createdBy;
|
||||
data['Modified'] = this.modified;
|
||||
data['ModifiedBy'] = this.modifiedBy;
|
||||
data['IsDeleted'] = this.isDeleted;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class WFOrder {
|
||||
dynamic wfButtonsDTO;
|
||||
int? iD;
|
||||
int? orderId;
|
||||
int? previousStep;
|
||||
int? nextStep;
|
||||
int? serviceId;
|
||||
dynamic order;
|
||||
String? created;
|
||||
dynamic createdBy;
|
||||
dynamic modified;
|
||||
dynamic modifiedBy;
|
||||
bool? isDeleted;
|
||||
|
||||
WFOrder({this.wfButtonsDTO, this.iD, this.orderId, this.previousStep, this.nextStep, this.serviceId, this.order, this.created, this.createdBy, this.modified, this.modifiedBy, this.isDeleted});
|
||||
|
||||
WFOrder.fromJson(Map<String, dynamic> json) {
|
||||
wfButtonsDTO = json['wf_ButtonsDTO'];
|
||||
iD = json['ID'];
|
||||
orderId = json['OrderId'];
|
||||
previousStep = json['PreviousStep'];
|
||||
nextStep = json['NextStep'];
|
||||
serviceId = json['ServiceId'];
|
||||
order = json['Order'];
|
||||
created = json['Created'];
|
||||
createdBy = json['CreatedBy'];
|
||||
modified = json['Modified'];
|
||||
modifiedBy = json['ModifiedBy'];
|
||||
isDeleted = json['IsDeleted'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['wf_ButtonsDTO'] = this.wfButtonsDTO;
|
||||
data['ID'] = this.iD;
|
||||
data['OrderId'] = this.orderId;
|
||||
data['PreviousStep'] = this.previousStep;
|
||||
data['NextStep'] = this.nextStep;
|
||||
data['ServiceId'] = this.serviceId;
|
||||
data['Order'] = this.order;
|
||||
data['Created'] = this.created;
|
||||
data['CreatedBy'] = this.createdBy;
|
||||
data['Modified'] = this.modified;
|
||||
data['ModifiedBy'] = this.modifiedBy;
|
||||
data['IsDeleted'] = this.isDeleted;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -1,115 +0,0 @@
|
||||
// Dart model for the "AncillaryOrderList" structure
|
||||
// Uses DateUtil.convertStringToDate and DateUtil.dateToDotNetString from your project to parse/serialize .NET-style dates.
|
||||
import 'package:hmg_patient_app_new/core/utils/date_util.dart';
|
||||
|
||||
class AncillaryOrderListModel {
|
||||
List<AncillaryOrderGroup>? ancillaryOrderList;
|
||||
|
||||
AncillaryOrderListModel({this.ancillaryOrderList});
|
||||
|
||||
factory AncillaryOrderListModel.fromJson(Map<String, dynamic> json) => AncillaryOrderListModel(
|
||||
ancillaryOrderList: json['AncillaryOrderList'] != null
|
||||
? List<AncillaryOrderGroup>.from(
|
||||
(json['AncillaryOrderList'] as List).map(
|
||||
(x) => AncillaryOrderGroup.fromJson(x as Map<String, dynamic>),
|
||||
),
|
||||
)
|
||||
: null,
|
||||
);
|
||||
}
|
||||
|
||||
class AncillaryOrderGroup {
|
||||
List<AncillaryOrderItem>? ancillaryOrderList;
|
||||
dynamic errCode;
|
||||
String? message;
|
||||
int? patientID;
|
||||
String? patientName;
|
||||
int? patientType;
|
||||
int? projectID;
|
||||
String? projectName;
|
||||
String? setupID;
|
||||
int? statusCode;
|
||||
|
||||
AncillaryOrderGroup({
|
||||
this.ancillaryOrderList,
|
||||
this.errCode,
|
||||
this.message,
|
||||
this.patientID,
|
||||
this.patientName,
|
||||
this.patientType,
|
||||
this.projectID,
|
||||
this.projectName,
|
||||
this.setupID,
|
||||
this.statusCode,
|
||||
});
|
||||
|
||||
factory AncillaryOrderGroup.fromJson(Map<String, dynamic> json) => AncillaryOrderGroup(
|
||||
ancillaryOrderList: json['AncillaryOrderList'] != null
|
||||
? List<AncillaryOrderItem>.from(
|
||||
(json['AncillaryOrderList'] as List).map(
|
||||
(x) => AncillaryOrderItem.fromJson(x as Map<String, dynamic>),
|
||||
),
|
||||
)
|
||||
: null,
|
||||
errCode: json['ErrCode'],
|
||||
message: json['Message'] as String?,
|
||||
patientID: json['PatientID'] as int?,
|
||||
patientName: json['PatientName'] as String?,
|
||||
patientType: json['PatientType'] as int?,
|
||||
projectID: json['ProjectID'] as int?,
|
||||
projectName: json['ProjectName'] as String?,
|
||||
setupID: json['SetupID'] as String?,
|
||||
statusCode: json['StatusCode'] as int?,
|
||||
);
|
||||
}
|
||||
|
||||
class AncillaryOrderItem {
|
||||
dynamic ancillaryProcedureListModels;
|
||||
DateTime? appointmentDate;
|
||||
int? appointmentNo;
|
||||
int? clinicID;
|
||||
String? clinicName;
|
||||
int? doctorID;
|
||||
String? doctorName;
|
||||
int? invoiceNo;
|
||||
bool? isCheckInAllow;
|
||||
bool? isQueued;
|
||||
DateTime? orderDate;
|
||||
int? orderNo;
|
||||
String? projectName; // Added from parent AncillaryOrderGroup
|
||||
int? projectID; // Added from parent AncillaryOrderGroup
|
||||
|
||||
AncillaryOrderItem({
|
||||
this.ancillaryProcedureListModels,
|
||||
this.appointmentDate,
|
||||
this.appointmentNo,
|
||||
this.clinicID,
|
||||
this.clinicName,
|
||||
this.doctorID,
|
||||
this.doctorName,
|
||||
this.invoiceNo,
|
||||
this.isCheckInAllow,
|
||||
this.isQueued,
|
||||
this.orderDate,
|
||||
this.orderNo,
|
||||
this.projectName,
|
||||
this.projectID,
|
||||
});
|
||||
|
||||
factory AncillaryOrderItem.fromJson(Map<String, dynamic> json, {String? projectName, int? projectID}) => AncillaryOrderItem(
|
||||
ancillaryProcedureListModels: json['AncillaryProcedureListModels'],
|
||||
appointmentDate: DateUtil.convertStringToDate(json['AppointmentDate']),
|
||||
appointmentNo: json['AppointmentNo'] as int?,
|
||||
clinicID: json['ClinicID'] as int?,
|
||||
clinicName: json['ClinicName'] as String?,
|
||||
doctorID: json['DoctorID'] as int?,
|
||||
doctorName: json['DoctorName'] as String?,
|
||||
invoiceNo: json['Invoiceno'] as int?,
|
||||
isCheckInAllow: json['IsCheckInAllow'] as bool?,
|
||||
isQueued: json['IsQueued'] as bool?,
|
||||
orderDate: DateUtil.convertStringToDate(json['OrderDate']),
|
||||
orderNo: json['OrderNo'] as int?,
|
||||
projectName: projectName,
|
||||
projectID: projectID,
|
||||
);
|
||||
}
|
||||