WD: plan and physical examination completed.

update_flutter_3.24_vida_plus_episode_v2
taha.alam 1 year ago
parent 63c1bc4cae
commit 074bee8c4c

@ -0,0 +1,4 @@
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M11.955 2.55763C8.35771 1.59711 4.67798 3.31429 3.05104 6.47547L4.24455 6.54813C4.58909 6.56911 4.85139 6.86542 4.83042 7.20996C4.80944 7.5545 4.51313 7.8168 4.16859 7.79582L2.07682 7.66848C1.87853 7.65641 1.69779 7.55079 1.58993 7.38396C1.48208 7.21713 1.45995 7.00897 1.53034 6.8232C3.14318 2.56627 7.76997 0.146382 12.2775 1.34994C17.0786 2.6319 19.936 7.5428 18.6506 12.3234C17.3654 17.1031 12.4283 19.9315 7.62802 18.6497C4.06206 17.6976 1.57008 14.7447 1.04876 11.3312C0.996642 10.99 1.23101 10.6711 1.57223 10.619C1.91345 10.5669 2.23231 10.8012 2.28443 11.1425C2.73296 14.0794 4.87811 16.6217 7.95049 17.442C12.0909 18.5476 16.339 16.1065 17.4435 11.9988C18.5478 7.89199 16.0946 3.66295 11.955 2.55763Z" fill="#2E303A"/>
<path d="M10.6249 6.66651C10.6249 6.32133 10.3451 6.04151 9.99993 6.04151C9.65475 6.04151 9.37493 6.32133 9.37493 6.66651V9.99984C9.37493 10.1656 9.44077 10.3246 9.55798 10.4418L11.2247 12.1085C11.4687 12.3525 11.8645 12.3525 12.1085 12.1085C12.3526 11.8644 12.3526 11.4686 12.1085 11.2246L10.6249 9.74096V6.66651Z" fill="#2E303A"/>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

@ -0,0 +1,5 @@
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M7.91667 14.375C7.57149 14.375 7.29167 14.0951 7.29167 13.75L7.29167 8.74996C7.29167 8.40478 7.57149 8.12496 7.91667 8.12496C8.26184 8.12496 8.54167 8.40478 8.54167 8.74996L8.54167 13.75C8.54167 14.0951 8.26184 14.375 7.91667 14.375Z" fill="#D02127"/>
<path d="M12.7083 8.74996C12.7083 8.40478 12.4285 8.12496 12.0833 8.12496C11.7382 8.12496 11.4583 8.40478 11.4583 8.74996V13.75C11.4583 14.0951 11.7382 14.375 12.0833 14.375C12.4285 14.375 12.7083 14.0951 12.7083 13.75V8.74996Z" fill="#D02127"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M10.0552 1.04163H10.0018C9.58075 1.04161 9.22356 1.04161 8.92715 1.06859C8.61261 1.09722 8.31962 1.15924 8.03631 1.30989C7.92449 1.36934 7.8178 1.43797 7.71732 1.51505C7.46273 1.71036 7.28477 1.95124 7.12826 2.22557C6.98076 2.48408 6.83263 2.80908 6.65799 3.19223L6.30879 3.95829H2.5C2.15482 3.95829 1.875 4.23812 1.875 4.58329C1.875 4.92847 2.15482 5.20829 2.5 5.20829H3.16161L3.63194 12.9992C3.6948 14.0406 3.74469 14.8669 3.84847 15.5271C3.95489 16.204 4.12601 16.7678 4.46926 17.261C4.78326 17.7122 5.18781 18.0931 5.65712 18.3793C6.17013 18.6922 6.74321 18.8291 7.42534 18.8945C8.09048 18.9583 8.91832 18.9583 9.96154 18.9583H10.0263C11.0681 18.9583 11.895 18.9583 12.5593 18.8946C13.2407 18.8293 13.8131 18.6927 14.3258 18.3804C14.7948 18.0947 15.1992 17.7145 15.5133 17.264C15.8567 16.7716 16.0283 16.2087 16.1355 15.5327C16.2401 14.8735 16.2911 14.0483 16.3554 13.0084L16.8376 5.20829H17.5C17.8452 5.20829 18.125 4.92847 18.125 4.58329C18.125 4.23812 17.8452 3.95829 17.5 3.95829H13.7714L13.3618 3.11338C13.1826 2.74382 13.0306 2.43011 12.8809 2.18069C12.722 1.91594 12.5433 1.68392 12.2918 1.4963C12.1924 1.42216 12.0871 1.35621 11.977 1.2991C11.6985 1.15458 11.4117 1.09503 11.1042 1.06752C10.8145 1.04161 10.4658 1.04162 10.0552 1.04163ZM15.5852 5.20829H13.3935C13.3847 5.20848 13.3758 5.20848 13.3669 5.20829H6.72416C6.715 5.2085 6.70582 5.2085 6.69663 5.20829H4.41389L4.87772 12.8916C4.94298 13.9725 4.98992 14.739 5.0833 15.3329C5.1751 15.9169 5.30366 16.2717 5.49526 16.547C5.71011 16.8557 5.9869 17.1163 6.30801 17.3122C6.59437 17.4868 6.95632 17.5938 7.54471 17.6502C8.14321 17.7076 8.91114 17.7083 9.99397 17.7083C11.0754 17.7083 11.8423 17.7076 12.44 17.6503C13.0277 17.594 13.3893 17.4873 13.6754 17.3129C13.9963 17.1174 14.2731 16.8573 14.488 16.5491C14.6796 16.2742 14.8085 15.9199 14.901 15.3368C14.9951 14.7437 15.043 13.9784 15.1098 12.899L15.5852 5.20829ZM12.3822 3.95829H7.68253L7.78421 3.73524C7.97304 3.32098 8.098 3.04828 8.21397 2.84502C8.32406 2.65207 8.40305 2.56445 8.47817 2.50682C8.52384 2.47178 8.57234 2.44059 8.62316 2.41356C8.70676 2.36911 8.81925 2.33358 9.04048 2.31344C9.27353 2.29222 9.5735 2.29163 10.0288 2.29163C10.4729 2.29163 10.7654 2.2922 10.9928 2.31255C11.2087 2.33185 11.319 2.36592 11.4014 2.40866C11.4514 2.43462 11.4992 2.4646 11.5444 2.4983C11.6188 2.55378 11.6976 2.63819 11.8091 2.82399C11.9267 3.01981 12.0547 3.28268 12.2485 3.68236L12.3822 3.95829Z" fill="#D02127"/>
</svg>

After

Width:  |  Height:  |  Size: 3.0 KiB

@ -0,0 +1,4 @@
<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="M11.67 0.495221C12.6572 -0.0918746 13.8747 -0.110273 14.8787 0.447126C15.2951 0.678342 15.675 1.06666 16.24 1.64419L16.3934 1.80091C16.9603 2.37969 17.3398 2.76705 17.5651 3.19051C18.1055 4.20643 18.0879 5.43543 17.5183 6.43501C17.2808 6.85167 16.8903 7.22757 16.307 7.78898L8.29149 15.5093C7.14079 16.618 6.43153 17.3014 5.53409 17.6519C4.63535 18.0029 3.65814 17.9772 2.07713 17.9356L1.67134 17.9249C1.43963 17.9189 1.2054 17.9129 1.012 17.8806C0.789896 17.8436 0.526089 17.7584 0.317383 17.5215C0.110543 17.2868 0.057465 17.0159 0.0450451 16.793C0.0340636 16.596 0.0525093 16.3599 0.0710464 16.1227L0.105143 15.685C0.212879 14.2995 0.27874 13.4525 0.613175 12.6828C0.948048 11.912 1.52012 11.2924 2.45351 10.2814L10.3439 1.73254C10.8921 1.13821 11.2605 0.73876 11.67 0.495221ZM14.2719 1.54C13.6571 1.19868 12.914 1.20973 12.309 1.56958C12.077 1.70753 11.8391 1.9556 11.1874 2.66174L11.1194 2.73538L15.3547 6.97069L15.3617 6.96398C16.0521 6.29893 16.296 6.05516 16.4323 5.81608C16.7896 5.18915 16.8008 4.41535 16.4615 3.77762C16.3321 3.53437 16.0952 3.28325 15.4242 2.5978C14.7524 1.91149 14.5076 1.67083 14.2719 1.54ZM3.45045 11.0443L10.2709 3.65466L14.4542 7.83799L7.52527 14.5117C6.23982 15.7498 5.71582 16.239 5.07932 16.4876C4.44421 16.7356 3.73723 16.7285 1.9708 16.6823L1.73747 16.6762C1.60454 16.6728 1.49925 16.67 1.40885 16.6652C1.362 16.6628 1.32348 16.66 1.29156 16.6569C1.29189 16.5567 1.30207 16.415 1.31983 16.187L1.34233 15.8982C1.46221 14.3595 1.51877 13.7353 1.75964 13.1809C2.00005 12.6275 2.41371 12.1675 3.45045 11.0443Z" fill="#2B353E"/>
<path d="M10.6667 16.7083C10.3216 16.7083 10.0417 16.9881 10.0417 17.3333C10.0417 17.6785 10.3216 17.9583 10.6667 17.9583H17.3334C17.6786 17.9583 17.9584 17.6785 17.9584 17.3333C17.9584 16.9881 17.6786 16.7083 17.3334 16.7083H10.6667Z" fill="#2B353E"/>
</svg>

After

Width:  |  Height:  |  Size: 1.9 KiB

@ -0,0 +1,4 @@
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M12.7941 6.92237C13.0273 6.66792 13.0101 6.27257 12.7557 6.03932C12.5013 5.80608 12.1059 5.82327 11.8727 6.07772L7.73041 10.5965L6.10865 8.97477C5.86457 8.73069 5.46884 8.73069 5.22477 8.97477C4.98069 9.21885 4.98069 9.61457 5.22477 9.85865L7.3081 11.942C7.42864 12.0625 7.59319 12.1286 7.76362 12.1249C7.93405 12.1212 8.09557 12.048 8.21076 11.9224L12.7941 6.92237Z" fill="#359846"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M9.04769 0.458374H8.95239C7.12681 0.458363 5.69291 0.458354 4.57339 0.608869C3.42618 0.763108 2.51597 1.08564 1.8008 1.8008C1.08564 2.51597 0.763108 3.42618 0.608869 4.57339C0.458354 5.69291 0.458363 7.12681 0.458374 8.95239V9.04769C0.458363 10.8733 0.458354 12.3072 0.608869 13.4267C0.763108 14.5739 1.08564 15.4841 1.8008 16.1993C2.51597 16.9144 3.42618 17.237 4.57339 17.3912C5.6929 17.5417 7.12679 17.5417 8.95237 17.5417H9.04768C10.8733 17.5417 12.3072 17.5417 13.4267 17.3912C14.5739 17.237 15.4841 16.9144 16.1993 16.1993C16.9144 15.4841 17.237 14.5739 17.3912 13.4267C17.5417 12.3072 17.5417 10.8733 17.5417 9.04771V8.9524C17.5417 7.12682 17.5417 5.6929 17.3912 4.57339C17.237 3.42618 16.9144 2.51597 16.1993 1.8008C15.4841 1.08564 14.5739 0.763108 13.4267 0.608869C12.3072 0.458354 10.8733 0.458363 9.04769 0.458374ZM2.68468 2.68468C3.12889 2.24048 3.73135 1.98333 4.73995 1.84772C5.76654 1.7097 7.11639 1.70837 9.00004 1.70837C10.8837 1.70837 12.2335 1.7097 13.2601 1.84772C14.2687 1.98333 14.8712 2.24048 15.3154 2.68468C15.7596 3.12889 16.0168 3.73135 16.1524 4.73995C16.2904 5.76654 16.2917 7.11639 16.2917 9.00004C16.2917 10.8837 16.2904 12.2335 16.1524 13.2601C16.0168 14.2687 15.7596 14.8712 15.3154 15.3154C14.8712 15.7596 14.2687 16.0168 13.2601 16.1524C12.2335 16.2904 10.8837 16.2917 9.00004 16.2917C7.11639 16.2917 5.76654 16.2904 4.73995 16.1524C3.73135 16.0168 3.12889 15.7596 2.68468 15.3154C2.24048 14.8712 1.98333 14.2687 1.84772 13.2601C1.7097 12.2335 1.70837 10.8837 1.70837 9.00004C1.70837 7.11639 1.7097 5.76654 1.84772 4.73995C1.98333 3.73135 2.24048 3.12889 2.68468 2.68468Z" fill="#359846"/>
</svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

@ -0,0 +1,6 @@
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M8.655 0.0416262H7.68289C6.05716 0.0416157 4.77679 0.0416073 3.77632 0.168644C2.75217 0.298686 1.92699 0.571419 1.27355 1.18855C0.615066 1.81045 0.319448 2.60386 0.179402 3.58764C0.0439182 4.53937 0.0439303 5.75446 0.0439456 7.28385V10.7161C0.0439303 12.2454 0.0439182 13.4605 0.179402 14.4123C0.319447 15.3961 0.615064 16.1895 1.27356 16.8114C1.927 17.4285 2.75218 17.7012 3.77632 17.8313C4.77679 17.9583 6.05717 17.9583 7.68291 17.9583H8.16895C8.51412 17.9583 8.79395 17.6785 8.79395 17.3333C8.79395 16.9881 8.51412 16.7083 8.16895 16.7083H7.72778C6.04728 16.7083 4.84633 16.7071 3.93378 16.5912C3.03571 16.4772 2.51212 16.2617 2.13181 15.9026C1.75657 15.5482 1.53532 15.0678 1.41693 14.2361C1.29543 13.3826 1.29395 12.2566 1.29395 10.6666V7.33329C1.29395 5.74327 1.29543 4.61727 1.41693 3.7638C1.53532 2.93216 1.75657 2.45173 2.13183 2.09732C2.51213 1.73814 3.03571 1.52272 3.93378 1.40869C4.84634 1.29281 6.04729 1.29163 7.72778 1.29163H8.61011C10.2906 1.29163 11.4916 1.29281 12.4041 1.40869C13.3022 1.52272 13.8258 1.73814 14.2061 2.09732C14.5813 2.45173 14.8026 2.93216 14.921 3.7638C15.0425 4.61727 15.0439 5.74327 15.0439 7.33329V8.16663C15.0439 8.5118 15.3238 8.79163 15.6689 8.79163C16.0141 8.79163 16.2939 8.5118 16.2939 8.16663V7.28387C16.294 5.75447 16.294 4.53937 16.1585 3.58764C16.0184 2.60385 15.7228 1.81045 15.0643 1.18855C14.4109 0.571419 13.5857 0.298687 12.5616 0.168644C11.5611 0.0416073 10.2807 0.0416157 8.655 0.0416262Z" fill="#449BF1"/>
<path d="M4.83561 4.20829C4.49043 4.20829 4.21061 4.48811 4.21061 4.83329C4.21061 5.17847 4.49043 5.45829 4.83561 5.45829H11.5023C11.8475 5.45829 12.1273 5.17847 12.1273 4.83329C12.1273 4.48811 11.8475 4.20829 11.5023 4.20829H4.83561Z" fill="#449BF1"/>
<path d="M4.21061 8.99996C4.21061 8.65478 4.49043 8.37496 4.83561 8.37496H11.5023C11.8475 8.37496 12.1273 8.65478 12.1273 8.99996C12.1273 9.34514 11.8475 9.62496 11.5023 9.62496H4.83561C4.49043 9.62496 4.21061 9.34514 4.21061 8.99996Z" fill="#449BF1"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M16.827 10.5902C16.0936 9.85877 14.9051 9.85877 14.1717 10.5902L11.1019 13.6515C10.7762 13.9762 10.5558 14.3913 10.4694 14.8428L10.0711 16.6982C9.91167 17.441 10.5742 18.0942 11.3117 17.9346L13.1822 17.5296C13.6335 17.4436 14.049 17.2243 14.3744 16.8998L17.4078 13.8178C18.14 13.0852 18.1392 11.8988 17.4056 11.1672L16.827 10.5902ZM15.0543 11.4753C15.2999 11.2304 15.6988 11.2304 15.9443 11.4753L16.5229 12.0523C16.7675 12.2962 16.7675 12.691 16.5229 12.9349L13.4899 16.0165C13.341 16.1642 13.1507 16.264 12.9436 16.3026C12.9377 16.3037 12.9317 16.3049 12.9258 16.3062L11.361 16.6449L11.6932 15.0977L11.6964 15.0816C11.735 14.8754 11.8354 14.6853 11.9845 14.5366L15.0543 11.4753Z" fill="#449BF1"/>
</svg>

After

Width:  |  Height:  |  Size: 2.8 KiB

@ -254,6 +254,7 @@ const Map<String, Map<String, String>> localizedValues = {
"beingBad": {"en": "being bad", "ar": "سيء"},
"beingGreat": {"en": "being great", "ar": "رائع"},
"cancel": {"en": "CANCEL", "ar": "الغاء"},
"cancelSmall": {"en": "Cancel", "ar": "الغاء"},
"ok": {"en": "OK", "ar": "موافق"},
"done": {"en": "DONE", "ar": "تأكيد"},
"resumecall": {"en": "Resume call", "ar": "استئناف المكالمة"},
@ -1173,9 +1174,23 @@ const Map<String, Map<String, String>> localizedValues = {
"previousChiefCompaints": {"en": "Previous Chief Compaints", "ar":"رئيس الرسامين السابق"},
"listOfActiveEpisodes": {"en": "List of active episodes , select one to procedd", "ar":"قائمة الحلقات النشطة ، حدد واحدة لتقديمها"},
"select": {"en": "Select", "ar":"اختار"},
"resolve": {"en": "Resolve", "ar":"حسم"},
"audit": {"en": "Audit", "ar":"مراجعه الحسابات"},
"delete": {"en": "Delete", "ar":"حذف"},
"progressNoteType": {"en": "Progress Note Type", "ar":"نوع ملاحظة التقدم"},
"doctorProgressNote": {"en": "Doctor Progress Note", "ar":"مذكرة تقدم الطبيب"},
"addYourNote": {"en": "Add Your Note", "ar":"أضف ملاحظتك"},
"saveAsDraft": {"en": "Save As Draft", "ar":"حفظ كمسودة"},
"nurseNote": {"en": "Nurse Note", "ar":"ملاحظة الممرضة"},
"patientCondition": {"en": "Patient Condition", "ar":"حالة المريض"},
"examinationPart": {"en": "Examination Part", "ar":"جزء الامتحان"},
"historyOfIllness": {"en": "History of Present Illness*", "ar":"تاريخ المرض الحالي*"},
"historyTakenFrom": {"en": "History taken from", "ar":"التاريخ مأخوذ من"},
"familySpecify": {"en": "Family, Specify", "ar":"العائلة، حدد"},
"otherSpecify": {"en": "Other, Specify", "ar":"أخرى، حدد"},
"physicalExamination": {"en": "Physical Examination", "ar":"الفحص البدني"},
"addPhysicalExamination": {"en": "Add Physical Examination", "ar":"إضافة الفحص البدني"},
"noPhysicalExamination": {"en": "No Physical Examination added, please add it from the button above", "ar":"لم يتم إضافة فحص بدني ، يرجى إضافته من الزر أعلاه"},
"noProgressNote": {"en": "No Diagnosis added, please add it from the button above", "ar":"لم يتم إضافة تشخيص ، يرجى إضافته من الزر أعلاه"},
};

@ -0,0 +1,233 @@
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_examination.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_header.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/expandable_SOAP_widget.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/objective/widget/examination_items.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/subjective/chief_complaint/widgets/add_soap_item.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../../../../../core/viewModel/project_view_model.dart';
class AddDetailsToExaminationVidaPlus extends StatefulWidget {
final List<MySelectedExamination>? mySelectedExamination;
const AddDetailsToExaminationVidaPlus({super.key, this.mySelectedExamination});
@override
State<AddDetailsToExaminationVidaPlus> createState() =>
_AddDetailsToExaminationVidaPlusState();
}
class _AddDetailsToExaminationVidaPlusState extends State<AddDetailsToExaminationVidaPlus> {
bool isSysExaminationExpand = false;
@override
Widget build(BuildContext context) {
print('the widget is build');
ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<SOAPViewModel>(
onModelReady: (model) async {},
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
isShowAppBar: true,
appBar: PatientSearchHeader(
title: TranslationBase.of(context).examinationPart),
backgroundColor: Colors.white,
body: Padding(
padding: const EdgeInsets.all(20.0),
child: Column(
children: [
Expanded(
child: ListView.separated(
itemBuilder: (context, index) {
return ExpandableSOAPWidget(
headerTitle:
projectViewModel.isArabic
? widget.mySelectedExamination![index].selectedExamination!.nameAr != null && widget.mySelectedExamination![index].selectedExamination!.nameAr != ""
? widget.mySelectedExamination![index].selectedExamination!.nameAr!
: widget.mySelectedExamination![index].selectedExamination!.nameEn!
: widget.mySelectedExamination![index].selectedExamination!.nameEn!,
onTap: () {
setState(() {
isSysExaminationExpand = !isSysExaminationExpand;
});
},
child: ExaminationItems(examination:widget.mySelectedExamination![index]),
isExpanded: isSysExaminationExpand,
);
},
separatorBuilder: (context, index) {
return SizedBox(height: 8,);
},
itemCount: widget?.mySelectedExamination?.length ?? 0),
),
],
),
)));
}
}
/* Container(
padding: EdgeInsets.symmetric(horizontal: 12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
margin: EdgeInsets.only(bottom: 8),
child: AppText(
TranslationBase.of(context).status,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier! * 1.6,
),
),
Row(
children: [
Expanded(
child: InkWell(
onTap: () {
setState(() {
status = 1;
});
examination.isNormal = true;
examination.isAbnormal = false;
examination.notExamined = false;
},
child: Row(
children: [
Container(
padding: EdgeInsets.all(2.0),
margin: EdgeInsets.symmetric(horizontal: 6),
width: 20,
height: 20,
decoration: BoxDecoration(
color: Colors.white,
shape: BoxShape.circle,
border: Border.all(color: Colors.grey, width: 1),
),
child: Container(
decoration: BoxDecoration(
color: status == 1 ? HexColor("#D02127") : Colors.white,
shape: BoxShape.circle,
),
),
),
AppText(
TranslationBase.of(context).normal,
fontWeight: FontWeight.normal,
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier! * 1.6,
),
],
),
)),
Expanded(
child: InkWell(
onTap: () {
setState(() {
status = 2;
});
examination.isNormal = false;
examination.isAbnormal = true;
examination.notExamined = false;
},
child: Row(
children: [
Container(
padding: EdgeInsets.all(2.0),
margin: EdgeInsets.symmetric(horizontal: 6),
width: 20,
height: 20,
decoration: BoxDecoration(
color: Colors.white,
shape: BoxShape.circle,
border: Border.all(color: Colors.grey, width: 1),
),
child: Container(
decoration: BoxDecoration(
color: status == 2 ? HexColor("#D02127") : Colors.white,
shape: BoxShape.circle,
),
),
),
AppText(
TranslationBase.of(context).abnormal,
fontWeight: FontWeight.normal,
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier! * 1.6,
),
],
),
)),
if (!examination.isLocal)
Expanded(
child: InkWell(
onTap: () {
setState(() {
status = 3;
});
examination.isNormal = false;
examination.isAbnormal = false;
examination.notExamined = true;
},
child: Row(
children: [
Container(
padding: EdgeInsets.all(2.0),
margin: EdgeInsets.symmetric(horizontal: 6),
width: 20,
height: 20,
decoration: BoxDecoration(
color: Colors.white,
shape: BoxShape.circle,
border: Border.all(color: Colors.grey, width: 1),
),
child: Container(
decoration: BoxDecoration(
color: status == 3 ? HexColor("#D02127") : Colors.white,
shape: BoxShape.circle,
),
),
),
Expanded(
child: AppText(
TranslationBase.of(context).notExamined,
fontWeight: FontWeight.normal,
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier! * 1.6,
),
),
],
),
)),
],
),
Container(
margin: EdgeInsets.only(top: 8),
child: AppTextFieldCustom(
hintText: TranslationBase.of(context).remarks,
controller: remarksController,
minLines: 2,
maxLines: 4,
inputType: TextInputType.multiline,
onChanged: (value) {
examination.remark = value;
},
onClick: () {},
onFieldSubmitted: () {},
),
),
],
),
);*/

@ -0,0 +1,154 @@
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_examination.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_header.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:flutter/material.dart';
import 'examinations_list_search_vida_plus_widget.dart';
class AddExaminationPageVidaPlus extends StatefulWidget {
final List<MySelectedExamination>? mySelectedExamination;
final Function(List<MySelectedExamination>) addSelectedExamination;
final Function(MasterKeyModel) removeExamination;
AddExaminationPageVidaPlus(
{this.mySelectedExamination,
required this.addSelectedExamination,
required this.removeExamination});
@override
_AddExaminationPageVidaPlusState createState() =>
_AddExaminationPageVidaPlusState();
}
class _AddExaminationPageVidaPlusState
extends State<AddExaminationPageVidaPlus> {
List<MySelectedExamination> mySelectedExaminationLocal = [];
@override
initState() {
super.initState();
mySelectedExaminationLocal = widget.mySelectedExamination!;
}
@override
Widget build(BuildContext context) {
return BaseView<SOAPViewModel>(
onModelReady: (model) async {
if (model.physicalExaminationList.length == 0) {
WidgetsBinding.instance.addPostFrameCallback((_) async {
await model.getMasterLookup(
MasterKeysService.PhysicalExamination,
);
});
}
},
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
isShowAppBar: true,
appBar: PatientSearchHeader(
title: TranslationBase.of(context).examinationPart),
backgroundColor: Colors.white,
body: Column(
mainAxisAlignment: MainAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: [
Flexible(
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Material(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
side: BorderSide(
width: 1,
color: Color(0xFFEFEFEF),
)),
color: Colors.white,
child: Padding(
padding: const EdgeInsets.all(16.0),
child: SingleChildScrollView(
child: Column(
mainAxisSize: MainAxisSize.max,
children: [
ExaminationsListSearchVidaPlusWidget(
mySelectedExamination: widget.mySelectedExamination,
masterList: model.physicalExaminationList,
isServiceSelected: (master) =>
isServiceSelected(master),
removeExamination: (selectedExamination) {
setState(() {
mySelectedExaminationLocal
.remove(selectedExamination);
});
},
addExamination: (selectedExamination) {
mySelectedExaminationLocal.insert(
0, selectedExamination);
//setState(() {});
},
),
],
),
),
),
),
),
),
],
),
bottomNavigationBar: Material(
color: Colors.white,
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Row(
children: [
Expanded(
child: AppButton(
title: TranslationBase.of(context).cancelSmall,
color: Color(0xffEAEAEA),
fontColor: Colors.black,
fontWeight: FontWeight.w600,
onPressed: () async {
Navigator.pop(context);
},
),
),
SizedBox(
width: 10,
),
Expanded(
child: AppButton(
title: TranslationBase.of(context).next,
color: Color(0xffD02127),
fontColor: Colors.white,
fontWeight: FontWeight.w600,
onPressed: () async {
Navigator.pop(context);
widget.addSelectedExamination(mySelectedExaminationLocal);
},
),
),
],
))),
),
);
}
isServiceSelected(MasterKeyModel masterKey) {
Iterable<MySelectedExamination> exam = mySelectedExaminationLocal.where(
(element) =>
masterKey.id == element.selectedExamination!.id &&
masterKey.typeId == element.selectedExamination!.typeId);
if (exam.length > 0) {
return true;
}
return false;
}
}

@ -0,0 +1,318 @@
// ignore: must_be_immutable
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_examination.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';
// ignore: must_be_immutable
class AddExaminationVidaPlusWidget extends StatefulWidget {
MasterKeyModel? item;
final Function(MySelectedExamination) removeExamination;
final Function(MySelectedExamination) addExamination;
final bool Function(MasterKeyModel) isServiceSelected;
bool isExpand;
final Function() expandClick;
final List<MySelectedExamination>? mySelectedExamination;
AddExaminationVidaPlusWidget({
this.item,
required this.removeExamination,
required this.addExamination,
required this.isServiceSelected,
this.isExpand = false,
required this.expandClick,
this.mySelectedExamination,
});
@override
_AddExaminationVidaPlusWidgetState createState() => _AddExaminationVidaPlusWidgetState();
}
class _AddExaminationVidaPlusWidgetState extends State<AddExaminationVidaPlusWidget> {
int status = 1;
TextEditingController remarksController = TextEditingController();
MySelectedExamination examination = MySelectedExamination();
@override
void initState() {
if (getSelectedExam(widget.item!) != null) {
examination = getSelectedExam(widget.item!)!;
status = examination.isNormal
? 1
: examination.isAbnormal
? 2
: 3;
remarksController.text = examination.remark!;
} else {
examination.selectedExamination = widget.item;
}
super.initState();
}
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
InkWell(
onTap: () {
onExamTap();
},
child: Row(
children: [
Checkbox(
value: widget.isServiceSelected(widget.item!),
activeColor: Colors.red[800],
onChanged: (bool? newValue) {
onExamTap();
}),
Container(
child: AppText(
projectViewModel.isArabic
? widget.item!.nameAr != null && widget.item!.nameAr != ""
? widget.item!.nameAr!
: widget.item!.nameEn!
: widget.item!.nameEn!,
color: Color(0xFF575757),
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge ? 3 : 3.8),
letterSpacing: -0.56,
),
),
],
),
),
],
);
// return Container(
// child: HeaderBodyExpandableNotifier(
// headerWidget: Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// children: [
// InkWell(
// onTap: () {
// onExamTap();
// },
// child: Row(
// children: [
// Checkbox(
// value: widget.isServiceSelected(widget.item!),
// activeColor: Colors.red[800],
// onChanged: (bool? newValue) {
// onExamTap();
// }),
// Container(
// child: AppText(
// projectViewModel.isArabic
// ? widget.item!.nameAr != null && widget.item!.nameAr != ""
// ? widget.item!.nameAr!
// : widget.item!.nameEn!
// : widget.item!.nameEn!,
// color: Color(0xFF575757),
// fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge ? 3 : 3.8),
// letterSpacing: -0.56,
// ),
// ),
// ],
// ),
// ),
// Container(
// margin: EdgeInsets.symmetric(horizontal: 8),
// child: InkWell(
// onTap: widget.expandClick,
// child: Icon(widget.isExpand ? Icons.keyboard_arrow_up : Icons.keyboard_arrow_down),
// ),
// ),
// ],
// ),
// bodyWidget: Container(
// padding: EdgeInsets.symmetric(horizontal: 12),
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Container(
// margin: EdgeInsets.only(bottom: 8),
// child: AppText(
// TranslationBase.of(context).status,
// fontWeight: FontWeight.bold,
// fontFamily: 'Poppins',
// fontSize: SizeConfig.textMultiplier! * 1.6,
// ),
// ),
// Row(
// children: [
// Expanded(
// child: InkWell(
// onTap: () {
// setState(() {
// status = 1;
// });
// examination.isNormal = true;
// examination.isAbnormal = false;
// examination.notExamined = false;
// },
// child: Row(
// children: [
// Container(
// padding: EdgeInsets.all(2.0),
// margin: EdgeInsets.symmetric(horizontal: 6),
// width: 20,
// height: 20,
// decoration: BoxDecoration(
// color: Colors.white,
// shape: BoxShape.circle,
// border: Border.all(color: Colors.grey, width: 1),
// ),
// child: Container(
// decoration: BoxDecoration(
// color: status == 1 ? HexColor("#D02127") : Colors.white,
// shape: BoxShape.circle,
// ),
// ),
// ),
// AppText(
// TranslationBase.of(context).normal,
// fontWeight: FontWeight.normal,
// fontFamily: 'Poppins',
// fontSize: SizeConfig.textMultiplier! * 1.6,
// ),
// ],
// ),
// )),
// Expanded(
// child: InkWell(
// onTap: () {
// setState(() {
// status = 2;
// });
// examination.isNormal = false;
// examination.isAbnormal = true;
// examination.notExamined = false;
// },
// child: Row(
// children: [
// Container(
// padding: EdgeInsets.all(2.0),
// margin: EdgeInsets.symmetric(horizontal: 6),
// width: 20,
// height: 20,
// decoration: BoxDecoration(
// color: Colors.white,
// shape: BoxShape.circle,
// border: Border.all(color: Colors.grey, width: 1),
// ),
// child: Container(
// decoration: BoxDecoration(
// color: status == 2 ? HexColor("#D02127") : Colors.white,
// shape: BoxShape.circle,
// ),
// ),
// ),
// AppText(
// TranslationBase.of(context).abnormal,
// fontWeight: FontWeight.normal,
// fontFamily: 'Poppins',
// fontSize: SizeConfig.textMultiplier! * 1.6,
// ),
// ],
// ),
// )),
// if (!examination.isLocal)
// Expanded(
// child: InkWell(
// onTap: () {
// setState(() {
// status = 3;
// });
// examination.isNormal = false;
// examination.isAbnormal = false;
// examination.notExamined = true;
// },
// child: Row(
// children: [
// Container(
// padding: EdgeInsets.all(2.0),
// margin: EdgeInsets.symmetric(horizontal: 6),
// width: 20,
// height: 20,
// decoration: BoxDecoration(
// color: Colors.white,
// shape: BoxShape.circle,
// border: Border.all(color: Colors.grey, width: 1),
// ),
// child: Container(
// decoration: BoxDecoration(
// color: status == 3 ? HexColor("#D02127") : Colors.white,
// shape: BoxShape.circle,
// ),
// ),
// ),
// Expanded(
// child: AppText(
// TranslationBase.of(context).notExamined,
// fontWeight: FontWeight.normal,
// fontFamily: 'Poppins',
// fontSize: SizeConfig.textMultiplier! * 1.6,
// ),
// ),
// ],
// ),
// )),
// ],
// ),
// Container(
// margin: EdgeInsets.only(top: 8),
// child: AppTextFieldCustom(
// hintText: TranslationBase.of(context).remarks,
// controller: remarksController,
// minLines: 2,
// maxLines: 4,
// inputType: TextInputType.multiline,
// onChanged: (value) {
// examination.remark = value;
// },
// onClick: () {},
// onFieldSubmitted: () {},
// ),
// ),
// ],
// ),
// ),
// isExpand: widget.isExpand,
// ),
// );
}
onExamTap() {
setState(() {
if (widget.isServiceSelected(widget.item!)) {
if (examination.isLocal) widget.removeExamination(examination);
widget.expandClick();
} else {
examination.isNormal = status == 1;
examination.isAbnormal = status == 2;
examination.notExamined = status == 3;
examination.remark = remarksController.text;
widget.addExamination(examination);
widget.expandClick();
}
});
}
MySelectedExamination? getSelectedExam(MasterKeyModel masterKey) {
Iterable<MySelectedExamination> exam = widget.mySelectedExamination!.where((element) => masterKey.id == element.selectedExamination!.id && masterKey.typeId == element.selectedExamination!.typeId);
if (exam.length > 0) {
return exam.first;
}
return null;
}
}

@ -0,0 +1,129 @@
import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_examination.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/objective/add_examination_vida_plus_widget.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
import 'package:flutter/material.dart';
class ExaminationsListSearchVidaPlusWidget extends StatefulWidget {
final Function(MySelectedExamination) removeExamination;
final Function(MySelectedExamination) addExamination;
final bool Function(MasterKeyModel) isServiceSelected;
final List<MasterKeyModel>? masterList;
final List<MySelectedExamination>? mySelectedExamination;
ExaminationsListSearchVidaPlusWidget({required this.removeExamination, required this.addExamination, required this.isServiceSelected, this.masterList, this.mySelectedExamination});
@override
_ExaminationsListSearchVidaPlusWidgetState createState() => _ExaminationsListSearchVidaPlusWidgetState();
}
class _ExaminationsListSearchVidaPlusWidgetState extends State<ExaminationsListSearchVidaPlusWidget> {
int expandedIndex = -1;
List<MasterKeyModel>? items = [];
TextEditingController filteredSearchController = TextEditingController();
@override
void initState() {
items!.addAll(widget.masterList!);
super.initState();
}
@override
Widget build(BuildContext context) {
return Column(
children: [
Material(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
side: BorderSide(
width: 1,
color: Color(0xFFEFEFEF),
)),
color: Colors.white,child: Padding(
padding: const EdgeInsets.all(8.0),
child: AppTextFieldCustom(
height: Utils.getTextFieldHeight(),
hintText: TranslationBase.of(context).searchExamination,
isTextFieldHasSuffix: false,
hasBorder: false,
controller: filteredSearchController,
onChanged: (value) {
if (value != null) filterSearchResults(value);
},
suffixWidget: InkWell(
child: Icon(
Icons.search,
color: Colors.black,
),
onTap: () {},
),
onClick: () {},
onFieldSubmitted: () {},
),
),
),
...items!.mapIndexed((index, item) {
return Column(
children: [
AddExaminationVidaPlusWidget(
item: item,
addExamination: widget.addExamination,
removeExamination: widget.removeExamination,
mySelectedExamination: widget.mySelectedExamination,
isServiceSelected: widget.isServiceSelected,
isExpand: index == expandedIndex,
expandClick: () {
setState(() {
if (expandedIndex == index) {
expandedIndex = -1;
} else {
expandedIndex = index;
}
});
},
),
Divider()
],
);
}).toList(),
],
);
}
void filterSearchResults(String query) {
List<MasterKeyModel> dummySearchList = [];
dummySearchList.addAll(widget.masterList as Iterable<MasterKeyModel>);
if (query.isNotEmpty) {
List<MasterKeyModel> dummyListData = [];
dummySearchList.forEach((item) {
if (item.nameAr!.toLowerCase().contains(query.toLowerCase()) || item.nameEn!.toLowerCase().contains(query.toLowerCase())) {
dummyListData.add(item);
}
});
setState(() {
items!.clear();
items!.addAll(dummyListData);
});
return;
} else {
setState(() {
items!.clear();
items!.addAll(widget.masterList as Iterable<MasterKeyModel>);
});
}
}
}
extension FicListExtension<T> on List<T> {
/// Maps each element of the list.
/// The [map] function gets both the original [item] and its [index].
Iterable<E> mapIndexed<E>(E Function(int index, T item) map) sync* {
for (var index = 0; index < length; index++) {
yield map(index, this[index]);
}
}
}

@ -0,0 +1,59 @@
import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_examination.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/widgets/SoapDetailItem.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../../../../../utils/translations_delegate_base_utils.dart';
class ListOfExamination extends StatelessWidget {
final List<MySelectedExamination> listOfSelection;
const ListOfExamination({super.key, required this.listOfSelection});
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return Flexible(
child: ListView.separated(
physics: NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemBuilder: (_, index) => SoapDetailItem(
title: projectViewModel.isArabic
? listOfSelection[index]
.selectedExamination!
.nameAr !=
null &&
listOfSelection[index]
.selectedExamination!
.nameAr !=
""
? listOfSelection[index]
.selectedExamination!
.nameAr!
: listOfSelection[index]
.selectedExamination!
.nameEn!
: listOfSelection[index]
.selectedExamination!
.nameEn!,
condition: getCondition(listOfSelection[index], context)??TranslationBase.of(context).notExamined,
remarks: listOfSelection[index].remark??'',
onSoapDetailActionClicked: (action) {
///todo handle the event as per the actiion
/// the action is [SoapDetailItemActions]
},
status: 'active',
),
separatorBuilder: (_, __) => Divider(),
itemCount: listOfSelection.length),
);
}
String? getCondition(MySelectedExamination examination, BuildContext context) => examination.isNormal
? TranslationBase.of(context).normal
: examination.isAbnormal
? TranslationBase.of(context).abnormal
: TranslationBase.of(context).notExamined;
}

@ -0,0 +1,389 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/physical_exam/post_physical_exam_request_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_examination.dart';
import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/objective/add_examination_page.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_step_header.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/expandable_SOAP_widget.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/soap_utils.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/objective/add_examination_page_vida_plus.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/objective/list_of_examination.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/objective/widget/EmptyExamination.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/subjective/chief_complaint/widgets/add_soap_item.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
import '../../soap_update/objective/examination_item_card.dart';
import '../../soap_update/objective/objective_call_back.dart';
import '../../soap_update/shared_soap_widgets/SOAP_open_items.dart';
import 'add_details_to_examination_vida_plus.dart';
class UpdateObjectivePageVidaPlus extends StatefulWidget {
final Function changePageViewIndex;
final Function changeLoadingState;
final int currentIndex;
final PatiantInformtion patientInfo;
UpdateObjectivePageVidaPlus(
{Key? key,
required this.changePageViewIndex,
required this.patientInfo,
required this.changeLoadingState,
required this.currentIndex});
@override
_UpdateObjectivePageVidaPlusState createState() =>
_UpdateObjectivePageVidaPlusState();
}
class _UpdateObjectivePageVidaPlusState
extends State<UpdateObjectivePageVidaPlus> implements ObjectiveCallBack {
bool isSysExaminationExpand = false;
List<MySelectedExamination> mySelectedExamination = [];
BoxDecoration containerBorderDecoration(
Color containerColor, Color borderColor) {
return BoxDecoration(
color: containerColor,
shape: BoxShape.rectangle,
borderRadius: BorderRadius.all(Radius.circular(6)),
border: Border.fromBorderSide(BorderSide(
color: borderColor,
width: 0.5,
)),
);
}
@override
Widget build(BuildContext context) {
return BaseView<SOAPViewModel>(
onModelReady: (model) async {
WidgetsBinding.instance.addPostFrameCallback((_) async {
model.setObjectiveCallBack(this);
mySelectedExamination.clear();
model.isAddExamInProgress = true;
await model.getPatientPhysicalExam(widget.patientInfo);
if (model.patientPhysicalExamList.isNotEmpty) {
if (model.physicalExaminationList.length == 0) {
await model.getMasterLookup(MasterKeysService.PhysicalExamination);
}
model.patientPhysicalExamList.forEach((element) {
MasterKeyModel? examMaster = model.getOneMasterKey(
masterKeys: MasterKeysService.PhysicalExamination,
id: element.examId,
);
MySelectedExamination tempEam =
SoapUtils.generateMySelectedExamination(
examination: examMaster,
remark: element.remarks,
isNormal: element.isNormal,
createdBy: element.createdBy,
createdOn: element.createdOn,
editedOn: element.editedOn,
notExamined: element.notExamined,
isNew: element.isNew,
isLocal: false,
isAbnormal: element.isAbnormal,
);
mySelectedExamination.add(tempEam);
});
}
widget.changeLoadingState(false);});
},
builder: (_, model, w) => AppScaffold(
isShowAppBar: false,
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
body: SingleChildScrollView(
physics: ScrollPhysics(),
child: Center(
child: FractionallySizedBox(
widthFactor: 0.9,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SOAPStepHeader(
currentIndex: widget.currentIndex,
changePageViewIndex: widget.changePageViewIndex,
patientInfo: widget.patientInfo,
),
ExpandableSOAPWidget(
headerTitle:
TranslationBase.of(context).physicalExamination,
onTap: () {
setState(() {
isSysExaminationExpand = !isSysExaminationExpand;
});
},
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
SizedBox(height: 10,),
AddSoapItem(
title:
TranslationBase.of(context).physicalExamination,
onAddSoapItemClicked: () {
openExaminationList(context);
}),
SizedBox(height: 16,),
if (mySelectedExamination.isEmpty) ...{
Center(
child: Padding(
padding: const EdgeInsets.all(65),
child: EmptyExamination(),
),
),
} else ...{
Divider(),
ListOfExamination(
listOfSelection: mySelectedExamination
)
}
// if (mySelectedExamination.isNotEmpty && mySelectedExamination.first.isLocal)
// Row(
// children: [
// AppText(
// "New",
// fontWeight: FontWeight.w600,
// fontFamily: 'Poppins',
// color: Color(0xFFCC9B14),
// ),
// ],
// ),
// Column(
// children: mySelectedExamination
// .sublist(0, model.getFirstIndexForOldExamination(mySelectedExamination) == -1 ? 0 : model.getFirstIndexForOldExamination(mySelectedExamination))
// .map((examination) {
// return ExaminationItemCard(examination, () {
// removeExamination(examination.selectedExamination!);
// });
// }).toList(),
// ),
// if (mySelectedExamination.isNotEmpty && model.getFirstIndexForOldExamination(mySelectedExamination) > -1)
// Row(
// children: [
// AppText(
// "Verified",
// fontWeight: FontWeight.w600,
// fontFamily: 'Poppins',
// color: AppGlobal.appGreenColor,
// ),
// ],
// ),
// Column(
// children: mySelectedExamination
// .sublist(model.getFirstIndexForOldExamination(mySelectedExamination) == -1 ? 0 : model.getFirstIndexForOldExamination(mySelectedExamination))
// .map((examination) {
// return ExaminationItemCard(examination, () {
// removeExamination(examination.selectedExamination!);
// });
// }).toList(),
// )
],
),
isExpanded: isSysExaminationExpand,
),
SizedBox(
height: SizeConfig.heightMultiplier! *
(SizeConfig.isHeightVeryShort ? 14 : 12),
)
],
),
),
),
),
),
);
}
submitUpdateObjectivePage(SOAPViewModel model) async {
if (mySelectedExamination.isNotEmpty) {
if (!model.isAddExamInProgress &&
widget.patientInfo.admissionNo != null &&
widget.patientInfo.admissionNo!.isNotEmpty) {
Navigator.of(context).pop();
} else {
widget.changeLoadingState(true);
Map<String, dynamic> profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
PostPhysicalExamRequestModel postPhysicalExamRequestModel =
new PostPhysicalExamRequestModel();
mySelectedExamination.forEach((exam) {
if (postPhysicalExamRequestModel
.listHisProgNotePhysicalExaminationVM ==
null)
postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM =
[];
ListHisProgNotePhysicalExaminationVM
listHisProgNotePhysicalExaminationVM =
ListHisProgNotePhysicalExaminationVM(
patientMRN: widget.patientInfo.patientMRN,
episodeId: widget.patientInfo.episodeNo == null
? 0
: widget.patientInfo.episodeNo,
appointmentNo: widget.patientInfo.appointmentNo == null
? 0
: widget.patientInfo.appointmentNo,
remarks: exam.remark ?? '',
createdBy: exam.createdBy ?? doctorProfile.doctorID,
createdOn: exam.createdOn ?? DateTime.now().toIso8601String(),
editedBy: doctorProfile.doctorID,
editedOn: DateTime.now().toIso8601String(),
examId: exam.selectedExamination!.id,
examType: exam.selectedExamination!.typeId,
isAbnormal: exam.isAbnormal,
isNormal: exam.isNormal,
notExamined: exam.notExamined,
examinationType: exam.isNormal
? 1
: exam.isAbnormal
? 2
: 3,
examinationTypeName: exam.isNormal
? "Normal"
: exam.isAbnormal
? 'AbNormal'
: "Not Examined",
isNew: exam.isNew,
);
if (widget.patientInfo.admissionNo != null &&
widget.patientInfo.admissionNo!.isNotEmpty) {
listHisProgNotePhysicalExaminationVM.admissionNo =
int.parse(widget.patientInfo.admissionNo!);
} else {
listHisProgNotePhysicalExaminationVM.admissionNo = 0;
}
postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM!
.add(listHisProgNotePhysicalExaminationVM);
});
if (model.patientPhysicalExamList.isEmpty) {
await model.postPhysicalExam(postPhysicalExamRequestModel);
} else {
await model.patchPhysicalExam(postPhysicalExamRequestModel);
}
if (model.state == ViewState.ErrorLocal) {
widget.changeLoadingState(false);
Utils.showErrorToast(model.error);
if (widget.patientInfo.admissionNo != null &&
widget.patientInfo.admissionNo!.isNotEmpty) {
// Navigator.of(context).pop();
model.isAddExamInProgress = false;
}
} else {
if (widget.patientInfo.admissionNo != null &&
widget.patientInfo.admissionNo!.isNotEmpty) {
// Navigator.of(context).pop();
widget.changeLoadingState(false);
model.isAddExamInProgress = false;
} else {
widget.changeLoadingState(true);
widget.changePageViewIndex(2);
}
}
}
} else {
Utils.showErrorToast(TranslationBase.of(context).examinationErrorMsg);
}
}
removeExamination(MasterKeyModel masterKey) {
Iterable<MySelectedExamination> history = mySelectedExamination.where(
(element) =>
masterKey.id == element.selectedExamination!.id &&
masterKey.typeId == element.selectedExamination!.typeId);
if (history.length > 0) {
setState(() {
if (history.first.isLocal) {
mySelectedExamination.remove(history.first);
} else {
history.first.notExamined = true;
history.first.isNormal = false;
history.first.isAbnormal = false;
}
});
}
}
openExaminationList(BuildContext context) {
Navigator.push(
context,
FadePage(
page: AddExaminationPageVidaPlus(
mySelectedExamination: mySelectedExamination,
addSelectedExamination:
(List<MySelectedExamination> mySelectedExaminationLocal) {
pushAddExamination(mySelectedExaminationLocal);
// mySelectedExaminationLocal.forEach((element) {
// if (mySelectedExamination.singleWhere(
// (it) =>
// it.selectedExamination!.id ==
// element.selectedExamination!.id,
// orElse: () => MySelectedExamination()) ==
// MySelectedExamination()) {
// mySelectedExamination.insert(0, element);
// }
// });
/// remove items.
// List<MySelectedExamination> removedList = [];
// mySelectedExamination.forEach((element) {
// if (mySelectedExaminationLocal.singleWhere(
// (it) =>
// it.selectedExamination!.id ==
// element.selectedExamination!.id,
// orElse: () => MySelectedExamination()) ==
// MySelectedExamination()) {
// removedList.add(element);
// }
// });
// removedList.forEach((element) {
// removeExamination(element.selectedExamination!);
// });
// Navigator.of(context).pop();
// setState(() {});
},
removeExamination: (masterKey) => removeExamination(masterKey)),
),
);
}
@override
nextFunction(model) async {
await submitUpdateObjectivePage(model);
}
void pushAddExamination(List<MySelectedExamination> mySelectedExaminationLocal) {
Navigator.push(
context,
FadePage(
page: AddDetailsToExaminationVidaPlus(
mySelectedExamination: mySelectedExamination,),
),
);
}
}

@ -0,0 +1,26 @@
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import '../../../../../../../utils/translations_delegate_base_utils.dart';
class EmptyExamination extends StatelessWidget{
@override
Widget build(BuildContext context) {
return Column(
mainAxisAlignment : MainAxisAlignment.center,
children: [
SvgPicture.asset('assets/images/svgs/unavailable.svg'),
SizedBox(height: 10,),
AppText(
TranslationBase.of(context).noPhysicalExamination,
fontSize: 12,
fontWeight: FontWeight.w400,
textAlign: TextAlign.center,
color: Color(0xFFADADAD),
)
],
);
}
}

@ -0,0 +1,247 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_examination.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';
class ExaminationItems extends StatefulWidget {
final MySelectedExamination? examination;
const ExaminationItems({super.key, this.examination});
@override
State<ExaminationItems> createState() => _ExaminationItemsState();
}
class _ExaminationItemsState extends State<ExaminationItems> {
bool isExpanded = false;
int status = 1;
TextEditingController remarksController = TextEditingController();
@override
void initState() {
// TODO: implement initState
super.initState();
remarksController.text = widget.examination?.remark ?? "";
}
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return Column(
children: [
ListTileTheme(
horizontalTitleGap: 0,
child: CheckboxListTile(
activeColor: Color(0xFFD02127),
checkColor: Colors.white,
contentPadding: EdgeInsets.zero,
side: MaterialStateBorderSide.resolveWith(
(Set<MaterialState> states) {
if (states.contains(MaterialState.selected)) {
return const BorderSide(color: Color(0xFFD02127));
}
return const BorderSide(color: Color(0xFFE6E6E6));
},
),
shape:
RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)),
value: isExpanded,
controlAffinity: ListTileControlAffinity.leading,
onChanged: (bool? value) {
setState(() {
isExpanded = value ?? false;
});
},
title: AppText(
projectViewModel.isArabic
? widget.examination!.selectedExamination!.nameAr != null &&
widget.examination!.selectedExamination!.nameAr != ""
? widget.examination!.selectedExamination!.nameAr!
: widget.examination!.selectedExamination!.nameEn!
: widget.examination!.selectedExamination!.nameEn!,
color: Color(0XFF575757),
fontSize: 14,
fontWeight: FontWeight.w400,
),
),
),
(isExpanded)
? Container(
padding: EdgeInsets.symmetric(horizontal: 12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
margin: EdgeInsets.only(bottom: 8),
child: AppText(
TranslationBase.of(context).condition,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier! * 1.6,
),
),
Row(
children: [
Expanded(
child: InkWell(
onTap: () {
setState(() {
status = 1;
});
widget.examination!.isNormal = true;
widget.examination!.isAbnormal = false;
widget.examination!.notExamined = false;
},
child: Row(
children: [
Container(
padding: EdgeInsets.all(2.0),
margin: EdgeInsets.symmetric(horizontal: 6),
width: 20,
height: 20,
decoration: BoxDecoration(
color: Colors.white,
shape: BoxShape.circle,
border:
Border.all(color: Colors.grey, width: 1),
),
child: Container(
decoration: BoxDecoration(
color: status == 1
? HexColor("#D02127")
: Colors.white,
shape: BoxShape.circle,
),
),
),
AppText(
TranslationBase.of(context).normal,
fontWeight: FontWeight.normal,
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier! * 1.6,
),
],
),
)),
Expanded(
child: InkWell(
onTap: () {
setState(() {
status = 2;
});
widget.examination!.isNormal = false;
widget.examination!.isAbnormal = true;
widget.examination!.notExamined = false;
},
child: Row(
children: [
Container(
padding: EdgeInsets.all(2.0),
margin: EdgeInsets.symmetric(horizontal: 6),
width: 20,
height: 20,
decoration: BoxDecoration(
color: Colors.white,
shape: BoxShape.circle,
border:
Border.all(color: Colors.grey, width: 1),
),
child: Container(
decoration: BoxDecoration(
color: status == 2
? HexColor("#D02127")
: Colors.white,
shape: BoxShape.circle,
),
),
),
AppText(
TranslationBase.of(context).abnormal,
fontWeight: FontWeight.normal,
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier! * 1.6,
),
],
),
)),
if (widget.examination?.isLocal == false)
Expanded(
child: InkWell(
onTap: () {
setState(() {
status = 3;
});
widget.examination!.isNormal = false;
widget.examination!.isAbnormal = false;
widget.examination!.notExamined = true;
},
child: Row(
children: [
Container(
padding: EdgeInsets.all(2.0),
margin: EdgeInsets.symmetric(horizontal: 6),
width: 20,
height: 20,
decoration: BoxDecoration(
color: Colors.white,
shape: BoxShape.circle,
border: Border.all(
color: Colors.grey, width: 1),
),
child: Container(
decoration: BoxDecoration(
color: status == 3
? HexColor("#D02127")
: Colors.white,
shape: BoxShape.circle,
),
),
),
Expanded(
child: AppText(
TranslationBase.of(context).notExamined,
fontWeight: FontWeight.normal,
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier! * 1.6,
),
),
],
),
)),
],
),
Container(
margin: EdgeInsets.only(top: 8),
child: AppTextFieldCustom(
hintText: TranslationBase.of(context).remarks,
controller: remarksController,
minLines: 2,
maxLines: 4,
inputType: TextInputType.multiline,
onChanged: (value) {
widget.examination!.remark = value;
},
onClick: () {},
onFieldSubmitted: () {},
),
),
],
),
)
: SizedBox.shrink(),
SizedBox(
height: 8,
),
Divider()
],
);
}
}

@ -0,0 +1,457 @@
import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/model/SOAP/progress_note/GetGetProgressNoteResModel.dart';
import 'package:doctor_app_flutter/core/model/SOAP/progress_note/get_progress_note_req_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/progress_note/post_progress_note_request_model.dart';
import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/plan/plan_call_back.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_step_header.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/expandable_SOAP_widget.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/objective/list_of_examination.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/plan/widget/add_progress_note.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/plan/widget/empty_progress_note.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/plan/widget/list_of_notes.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/subjective/chief_complaint/widgets/add_soap_item.dart';
import 'package:doctor_app_flutter/utils/date-utils.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
class UpdatePlanPageVidaPlus extends StatefulWidget {
final Function changePageViewIndex;
final PatiantInformtion patientInfo;
final Function changeLoadingState;
final Function changeStateFun;
final SOAPViewModel sOAPViewModel;
final int currentIndex;
UpdatePlanPageVidaPlus(
{Key? key,
required this.changePageViewIndex,
required this.patientInfo,
required this.changeLoadingState,
required this.currentIndex,
required this.sOAPViewModel,
required this.changeStateFun});
@override
_UpdatePlanPageVidaPlusState createState() => _UpdatePlanPageVidaPlusState();
}
class _UpdatePlanPageVidaPlusState extends State<UpdatePlanPageVidaPlus>
implements PlanCallBack {
bool isAddProgress = true;
bool isProgressExpanded = true;
List<GetPatientProgressNoteResModel> listOfProgressNote = [GetPatientProgressNoteResModel()];
GetPatientProgressNoteResModel patientProgressNote =
GetPatientProgressNoteResModel();
TextEditingController progressNoteController =
TextEditingController(text: null);
BoxDecoration containerBorderDecoration(
Color containerColor, Color borderColor) {
return BoxDecoration(
color: containerColor,
shape: BoxShape.rectangle,
borderRadius: BorderRadius.all(Radius.circular(6)),
border: Border.fromBorderSide(BorderSide(
color: borderColor,
width: 0.5,
)),
);
}
@override
void initState() {
super.initState();
if (patientProgressNote.planNote != null) {
setState(() {
isAddProgress = false;
});
}
}
getPatientProgressNote(SOAPViewModel model,
{bool isAddProgress = false}) async {
GetProgressNoteReqModel getGetProgressNoteReqModel =
GetProgressNoteReqModel(
appointmentNo:
int.parse(widget.patientInfo.appointmentNo.toString()),
patientMRN: widget.patientInfo.patientMRN,
episodeID: widget.patientInfo.episodeNo.toString(),
editedBy: '',
doctorID: '');
await widget.sOAPViewModel
.getPatientProgressNote(getGetProgressNoteReqModel);
///TODO set progressNote in model;
if (widget.sOAPViewModel.patientProgressNoteList.isNotEmpty) {
progressNoteController.text = Utils.parseHtmlString(
widget.sOAPViewModel.patientProgressNoteList[0].planNote!);
patientProgressNote.planNote = progressNoteController.text;
patientProgressNote.createdByName =
widget.sOAPViewModel.patientProgressNoteList[0].createdByName;
patientProgressNote.createdOn =
widget.sOAPViewModel.patientProgressNoteList[0].createdOn;
patientProgressNote.editedOn =
widget.sOAPViewModel.patientProgressNoteList[0].editedOn;
patientProgressNote.editedByName =
widget.sOAPViewModel.patientProgressNoteList[0].editedByName;
patientProgressNote.appointmentNo =
widget.sOAPViewModel.patientProgressNoteList[0].appointmentNo;
setState(() {
isAddProgress = isAddProgress;
widget.sOAPViewModel.isAddProgress = isAddProgress;
widget.sOAPViewModel.progressNoteText = progressNoteController.text;
});
}
}
@override
Widget build(BuildContext context) {
return BaseView<SOAPViewModel>(
onModelReady: (model) async {
widget.sOAPViewModel.setPlanCallBack(this);
GetProgressNoteReqModel getGetProgressNoteReqModel =
GetProgressNoteReqModel(
appointmentNo:
int.parse(widget.patientInfo.appointmentNo.toString()),
patientMRN: widget.patientInfo.patientMRN,
episodeID: widget.patientInfo.episodeNo.toString(),
editedBy: '',
doctorID: '');
await widget.sOAPViewModel
.getPatientProgressNote(getGetProgressNoteReqModel);
if (widget.sOAPViewModel.patientProgressNoteList.isNotEmpty) {
progressNoteController.text = Utils.parseHtmlString(
widget.sOAPViewModel.patientProgressNoteList[0].planNote!);
patientProgressNote.planNote = progressNoteController.text;
patientProgressNote.createdByName =
widget.sOAPViewModel.patientProgressNoteList[0].createdByName;
patientProgressNote.createdOn =
widget.sOAPViewModel.patientProgressNoteList[0].createdOn;
patientProgressNote.editedOn =
widget.sOAPViewModel.patientProgressNoteList[0].editedOn;
patientProgressNote.editedByName =
widget.sOAPViewModel.patientProgressNoteList[0].editedByName;
patientProgressNote.appointmentNo =
widget.sOAPViewModel.patientProgressNoteList[0].appointmentNo;
widget.sOAPViewModel.progressNoteText = progressNoteController.text;
setState(() {
isAddProgress = false;
widget.sOAPViewModel.isAddProgress = false;
});
}
widget.changeLoadingState(false);
},
builder: (_, model, w) => AppScaffold(
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
isShowAppBar: false,
body: SingleChildScrollView(
physics: ScrollPhysics(),
child: Center(
child: FractionallySizedBox(
widthFactor: 0.90,
child: Column(
children: [
SOAPStepHeader(
currentIndex: widget.currentIndex,
changePageViewIndex: widget.changePageViewIndex,
patientInfo: widget.patientInfo,
),
SizedBox(
height: 10,
),
ExpandableSOAPWidget(
headerTitle: TranslationBase.of(context).progressNote,
onTap: () {
setState(() {
isProgressExpanded = !isProgressExpanded;
});
},
child: Column(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.start,
children: [
SizedBox(
height: 10,
),
AddSoapItem(
title: TranslationBase.of(context)
.addProgressNote,
onAddSoapItemClicked: () {
navigateToAddPlan();
}),
SizedBox(
height: 16,
),
if (listOfProgressNote.isEmpty) ...{
Center(
child: Padding(
padding: const EdgeInsets.all(65),
child: EmptyProgressNote(),
),
),
} else ...{
Divider(),
ListOfNotes(
notes: listOfProgressNote
)
}
// if (mySelectedExamination.isEmpty) ...{
//
// Center(
// child: Padding(
// padding: const EdgeInsets.all(65),
// child: EmptyExamination(),
// ),
// ),
//
// } else ...{
// Divider(),
// ListOfExamination(
// listOfSelection: mySelectedExamination
// )
// }
// Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// if (isAddProgress)
// Container(
// margin: EdgeInsets.only(left: 10, right: 10, top: 15),
// child: AppTextFieldCustom(
// hintText: TranslationBase.of(context).progressNote,
// controller: progressNoteController,
// minLines: 2,
// maxLines: 4,
// inputType: TextInputType.multiline,
// onChanged: (value) {
// setState(() {
// patientProgressNote.planNote = value;
// model.progressNoteText = value!;
// widget.changeStateFun();
// });
// },
// onFieldSubmitted: () {},
// ),
// ),
// SizedBox(
// height: 9,
// ),
// if (patientProgressNote.planNote != null && !isAddProgress)
// Container(
// margin: EdgeInsets.only(
// left: 5,
// right: 5,
// ),
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Row(
// children: [
// AppText(
// 'Appointment No: ',
// fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3,
// letterSpacing: -0.4,
// color: Color(0xFF575757),
// ),
// AppText(
// patientProgressNote.appointmentNo != null ? patientProgressNote.appointmentNo.toString() : '',
// fontWeight: FontWeight.w600,
// letterSpacing: -0.48,
// color: Color(0xFF2B353E),
// fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.6,
// ),
// ],
// ),
// AppText(
// patientProgressNote.createdOn != null
// ? AppDateUtils.getDayMonthYearDateFormatted(DateTime.parse(patientProgressNote.createdOn!))
// : AppDateUtils.getDayMonthYearDateFormatted(DateTime.now()),
// fontWeight: FontWeight.w600,
// fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.6,
// )
// ],
// ),
// Row(
// mainAxisAlignment: MainAxisAlignment.end,
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// // Row(
// // children: [
// // AppText(
// // 'Condition: ',
// // fontSize: 12,
// // ),
// // AppText(
// // patientProgressNote.mName ??
// // '',
// // fontWeight: FontWeight.w600),
// // ],
// // ),
// AppText(
// patientProgressNote.createdOn != null ? AppDateUtils.getHour(DateTime.parse(patientProgressNote.createdOn!)) : AppDateUtils.getHour(DateTime.now()),
// fontWeight: FontWeight.w600,
// color: Color(0xFF575757),
// fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.6,
// )
// ],
// ),
// SizedBox(
// height: 8,
// ),
// Row(
// mainAxisAlignment: MainAxisAlignment.start,
// children: [
// Expanded(
// child: AppText(
// progressNoteController.text,
// fontSize: 10,
// ),
// ),
// InkWell(
// onTap: () {
// setState(() {
// isAddProgress = true;
// widget.sOAPViewModel.isAddProgress = true;
// });
// },
// child: Icon(
// DoctorApp.edit,
// size: 18,
// ))
// ],
// ),
// ],
// ),
// )
// ],
// ),
],
),
isExpanded: isProgressExpanded,
),
SizedBox(
height: SizeConfig.heightMultiplier! *
(SizeConfig.isHeightVeryShort ? 20 : 10),
),
],
),
),
),
),
));
}
submitPlan(SOAPViewModel model) async {
if (progressNoteController.text.isNotEmpty) {
widget.changeLoadingState(true);
PostProgressNoteRequestModel postProgressNoteRequestModel =
new PostProgressNoteRequestModel(
patientMRN: widget.patientInfo.patientMRN,
episodeId: widget.patientInfo.episodeNo,
appointmentNo: widget.patientInfo.appointmentNo,
planNote: patientProgressNote.planNote,
doctorID: widget.patientInfo.doctorId,
createdBy: widget.patientInfo.doctorId,
createdByName: widget.patientInfo.doctorName,
editedBy: '');
if (widget.sOAPViewModel.patientProgressNoteList.isEmpty) {
await widget.sOAPViewModel
.postProgressNote(postProgressNoteRequestModel);
} else {
Map<String, dynamic> profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
postProgressNoteRequestModel.editedBy = doctorProfile.doctorID;
await widget.sOAPViewModel
.patchProgressNote(postProgressNoteRequestModel);
}
if (widget.sOAPViewModel.state == ViewState.ErrorLocal) {
Utils.showErrorToast(widget.sOAPViewModel.error);
} else {
GetProgressNoteReqModel getGetProgressNoteReqModel =
GetProgressNoteReqModel(
appointmentNo:
int.parse(widget.patientInfo.appointmentNo.toString()),
patientMRN: widget.patientInfo.patientMRN,
episodeID: widget.patientInfo.episodeNo.toString(),
editedBy: '',
doctorID: '');
await widget.sOAPViewModel
.getPatientProgressNote(getGetProgressNoteReqModel);
if (widget.sOAPViewModel.patientProgressNoteList.isNotEmpty) {
progressNoteController.text = Utils.parseHtmlString(
widget.sOAPViewModel.patientProgressNoteList[0].planNote!);
patientProgressNote.planNote = progressNoteController.text;
patientProgressNote.createdByName =
widget.sOAPViewModel.patientProgressNoteList[0].createdByName;
patientProgressNote.createdOn =
widget.sOAPViewModel.patientProgressNoteList[0].createdOn;
patientProgressNote.editedOn =
widget.sOAPViewModel.patientProgressNoteList[0].editedOn;
patientProgressNote.editedByName =
widget.sOAPViewModel.patientProgressNoteList[0].editedByName;
patientProgressNote.appointmentNo =
widget.sOAPViewModel.patientProgressNoteList[0].appointmentNo;
setState(() {
isAddProgress = false;
widget.sOAPViewModel.isAddProgress = false;
});
}
Navigator.of(context).pop();
Utils.showErrorToast("Episode Created Successfully");
}
widget.changeLoadingState(false);
} else {
Utils.showErrorToast(TranslationBase.of(context).progressNoteErrorMsg);
}
}
@override
nextFunction(model) {
if (progressNoteController.text.isNotEmpty) {
if (isAddProgress) {
submitPlan(model);
} else {
Navigator.of(context).pop();
}
} else {
Utils.showErrorToast(TranslationBase.of(context).progressNoteErrorMsg);
}
}
void navigateToAddPlan() {
Navigator.push(
context,
FadePage(
page: AddProgressNote (
),
));
}
}

@ -0,0 +1,86 @@
import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/widgets/SoapDetailItem.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';
class ProgressNoteItem extends StatelessWidget {
final String type;
final String speciality;
final String Notes;
final String status;
const ProgressNoteItem(
{super.key,
required this.type,
required this.speciality,
required this.Notes,
required this.status});
@override
Widget build(BuildContext context) => Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Stack(
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
AppText(
"${TranslationBase.of(context).type}:",
color: Color(0XFF2B353E),
fontSize: 10,
fontWeight: FontWeight.w500,
),
SizedBox(
width: 4,
),
AppText(
type,
color: Color(0XFF2B353E),
fontSize: 10,
fontWeight: FontWeight.w500,
),
],
),
SizedBox(
height: 8,
),
Row(
children: [
AppText(
"${TranslationBase.of(context).speciality}:",
color: Color(0XFF2B353E),
fontSize: 10,
fontWeight: FontWeight.w500,
),
SizedBox(
width: 4,
),
AppText(
speciality,
color: Color(0XFF2B353E),
fontSize: 10,
fontWeight: FontWeight.w500,
),
],
),
],
),
Align(
alignment: Alignment.topRight, child: Status(status: status))
],
),
SizedBox(
height: 8,
),
AppText(
Notes,
color: Color(0XFF2B353E),
fontSize: 12,
fontWeight: FontWeight.w600,
),
],
);
}

@ -0,0 +1,65 @@
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_header.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/plan/widget/add_progress_note_details.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:flutter/material.dart';
class AddProgressNote extends StatelessWidget{
@override
Widget build(BuildContext context) {
return BaseView<SOAPViewModel>(
builder: (_, model, w) => AppScaffold(
isShowAppBar: true,
appBar: PatientSearchHeader(
title: TranslationBase.of(context).progressNote
),
body: Padding(
padding: const EdgeInsets.all(20.0),
child: SingleChildScrollView(
child: AddProgressNoteDetails(),
),
),
bottomNavigationBar: Material(
color: Colors.white,
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Row(
children: [
Expanded(
child: AppButton(
title: TranslationBase.of(context).cancelSmall,
color: Color(0xffEAEAEA),
fontColor: Colors.black,
fontWeight: FontWeight.w600,
onPressed: () async {
Navigator.pop(context);
},
),
),
SizedBox(
width: 10,
),
Expanded(
child: AppButton(
title: TranslationBase.of(context).save,
color: Color(0xff359846),
fontColor: Colors.white,
fontWeight: FontWeight.w600,
onPressed: () async {
Navigator.pop(context);
},
),
),
],
))),
),
);
}
}

@ -0,0 +1,296 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:hexcolor/hexcolor.dart';
List<String> patientState = ["","Stable", "Not Stable", "Not Defined"];
class AddProgressNoteDetails extends StatefulWidget {
@override
State<AddProgressNoteDetails> createState() => _AddProgressNoteDetailsState();
}
class _AddProgressNoteDetailsState extends State<AddProgressNoteDetails> {
String selectedItem = "Stable";
int status = 1;
final TextEditingController noteController = TextEditingController();
@override
Widget build(BuildContext context) {
return Material(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
side: BorderSide(
width: 1,
color: Color(0xFFEFEFEF),
)),
color: Colors.white,
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context).addProgressNote,
fontSize: 16,
fontWeight: FontWeight.w600,
textAlign: TextAlign.start,
color: Colors.black,
),
SizedBox(
height: 16,
),
Material(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
side: BorderSide(
width: 1,
color: Color(0xFFEFEFEF),
)),
color: Colors.white,
child: Padding(
padding:
const EdgeInsets.symmetric(horizontal: 16.0, vertical: 12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context).patientCondition,
textAlign: TextAlign.start,
fontWeight: FontWeight.w600,
fontSize: 11,
color: Color(0xFF2E303A),
),
SizedBox(
height: 4,
),
DropdownButtonHideUnderline(
child: DropdownButton(
dropdownColor: Colors.white,
iconEnabledColor: Colors.black,
icon: Icon(Icons.keyboard_arrow_down),
isExpanded: true,
value: selectedItem,
iconSize: 25,
elevation: 16,
onChanged: (newValue) async {
setState(() {
selectedItem = newValue ?? "";
});
},
items: patientState.map((item) {
return DropdownMenuItem(
child: AppText(
item,
fontSize: 14,
letterSpacing: -0.96,
color: AppGlobal.appTextColor,
fontWeight: FontWeight.normal,
textAlign: TextAlign.left,
),
value: item,
);
}).toList(),
),
),
],
),
),
),
SizedBox(
height: 16,
),
AppText(
TranslationBase.of(context).progressNoteType,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
fontSize: 11,
),
SizedBox(
height: 8,
),
Row(
children: [
Flexible(
child: InkWell(
onTap: () {
setState(() {
status = 1;
});
},
child: Row(
children: [
Container(
padding: EdgeInsets.all(2.0),
margin: EdgeInsets.symmetric(horizontal: 6),
width: 20,
height: 20,
decoration: BoxDecoration(
color: Colors.white,
shape: BoxShape.circle,
border: Border.all(color: Colors.grey, width: 1),
),
child: Container(
decoration: BoxDecoration(
color: status == 1
? HexColor("#D02127")
: Colors.white,
shape: BoxShape.circle,
),
),
),
AppText(
TranslationBase.of(context).doctorProgressNote,
fontWeight: FontWeight.w600,
fontFamily: 'Poppins',
fontSize: 12,
),
],
),
)),
Flexible(
child: InkWell(
onTap: () {
setState(() {
status = 2;
});
},
child: Row(
children: [
Container(
padding: EdgeInsets.all(2.0),
margin: EdgeInsets.symmetric(horizontal: 6),
width: 20,
height: 20,
decoration: BoxDecoration(
color: Colors.white,
shape: BoxShape.circle,
border: Border.all(color: Colors.grey, width: 1),
),
child: Container(
decoration: BoxDecoration(
color: status == 2
? HexColor("#D02127")
: Colors.white,
shape: BoxShape.circle,
),
),
),
AppText(
TranslationBase.of(context).nurseNote,
fontWeight: FontWeight.w600,
fontFamily: 'Poppins',
fontSize: 12,
),
],
),
),
),
],
),
SizedBox(
height: 24,
),
Material(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
side: BorderSide(
width: 1,
color: Color(0xFFEFEFEF),
)),
color: Colors.white,
child: Padding(
padding:
const EdgeInsets.symmetric(horizontal: 16.0, vertical: 12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context).speciality,
textAlign: TextAlign.start,
fontWeight: FontWeight.w600,
fontSize: 11,
color: Color(0xFF2E303A),
),
SizedBox(
height: 4,
),
DropdownButtonHideUnderline(
child: DropdownButton(
dropdownColor: Colors.white,
iconEnabledColor: Colors.black,
icon: Icon(Icons.keyboard_arrow_down),
isExpanded: true,
value: selectedItem,
iconSize: 25,
elevation: 16,
onChanged: (newValue) async {
setState(() {
selectedItem = newValue ?? "";
});
},
items: patientState.map((item) {
return DropdownMenuItem(
child: AppText(
"item",
fontSize: 14,
letterSpacing: -0.96,
color: AppGlobal.appTextColor,
fontWeight: FontWeight.normal,
textAlign: TextAlign.left,
),
value: item,
);
}).toList(),
),
),
],
),
),
),
SizedBox(
height: 16,
),
AppTextFieldCustom(
hintText: TranslationBase.of(context).addYourNote,
controller: noteController,
inputType: TextInputType.multiline,
maxLines: 25,
minLines: 4,
hasBorder: true,
onClick: () {},
onChanged: (value) {},
onFieldSubmitted: () {},
),
SizedBox(
height: 16,
),
Row(
children: [
SvgPicture.asset('assets/images/svgs/save_as_draft.svg'),
SizedBox(
width: 4,
),
AppText(
TranslationBase.of(context).saveAsDraft,
textAlign: TextAlign.start,
fontWeight: FontWeight.w600,
fontSize: 10,
color: Color(0xFF449BF1),
),
],
)
],
),
),
);
}
}

@ -0,0 +1,26 @@
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import '../../../../../../../utils/translations_delegate_base_utils.dart';
class EmptyProgressNote extends StatelessWidget{
@override
Widget build(BuildContext context) {
return Column(
mainAxisAlignment : MainAxisAlignment.center,
children: [
SvgPicture.asset('assets/images/svgs/unavailable.svg'),
SizedBox(height: 10,),
AppText(
TranslationBase.of(context).noProgressNote,
fontSize: 12,
fontWeight: FontWeight.w400,
textAlign: TextAlign.center,
color: Color(0xFFADADAD),
)
],
);
}
}

@ -0,0 +1,19 @@
import 'package:doctor_app_flutter/core/model/SOAP/progress_note/GetGetProgressNoteResModel.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/plan/widget/ProgressNoteItem.dart';
import 'package:flutter/material.dart';
class ListOfNotes extends StatelessWidget{
final List<GetPatientProgressNoteResModel> notes;
const ListOfNotes({super.key, required this.notes});
@override
Widget build(BuildContext context) => Flexible(
child: ListView.separated(
physics: NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemBuilder: (_, index) =>ProgressNoteItem(type: 'Doctor Note', speciality: "Internal Medicine", Notes: "Some lines of note for the progress ", status: "stable"),
separatorBuilder: (_, __) => Divider(),
itemCount: notes.length),
);
}

@ -11,7 +11,7 @@ import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../../../soap_update/shared_soap_widgets/SOAP_open_items.dart';
import '../chief_complaint/widgets/add_chief_complaint.dart';
import '../chief_complaint/widgets/add_soap_item.dart';
import 'add_allergies.dart';
// ignore: must_be_immutable

@ -1,5 +1,5 @@
import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/subjective/chief_complaint/AddChiefComplaints.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/subjective/chief_complaint/widgets/add_chief_complaint.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/subjective/chief_complaint/widgets/add_soap_item.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/subjective/chief_complaint/widgets/complaint_items.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/subjective/chief_complaint/widgets/empty_complaints.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';

@ -5,6 +5,8 @@ import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_al
import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_history.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/objective/update_objective_page_vida_plus.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/plan/update_plan_page_vida_plus.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/subjective/update_subjective_page_vida_plus.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart';
@ -14,20 +16,21 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
class UpdateSoapIndexVidaPlus extends StatefulWidget {
final bool isUpdate;
const UpdateSoapIndexVidaPlus({Key? key, this.isUpdate = false}) : super(key: key);
const UpdateSoapIndexVidaPlus({Key? key, this.isUpdate = false})
: super(key: key);
@override
_UpdateSoapIndexVidaPlusState createState() => _UpdateSoapIndexVidaPlusState();
_UpdateSoapIndexVidaPlusState createState() =>
_UpdateSoapIndexVidaPlusState();
}
class _UpdateSoapIndexVidaPlusState extends State<UpdateSoapIndexVidaPlus>
with TickerProviderStateMixin {
PageController? _controller;
int _currentIndex = 0;
int _currentIndex = 3;
List<MySelectedAllergy> myAllergiesList = [];
List<MySelectedHistory> myHistoryList = [];
@ -92,11 +95,24 @@ class _UpdateSoapIndexVidaPlusState extends State<UpdateSoapIndexVidaPlus>
},
scrollDirection: Axis.horizontal,
children: <Widget>[
UpdatePlanPageVidaPlus(
changePageViewIndex: changePageViewIndex,
currentIndex: _currentIndex,
patientInfo: patient,
changeLoadingState: changeLoadingState,
sOAPViewModel: model,
changeStateFun: changeStateFun,
),
UpdateObjectivePageVidaPlus(
changePageViewIndex: changePageViewIndex,
currentIndex: _currentIndex,
patientInfo: patient,
changeLoadingState: changeLoadingState),
UpdateSubjectivePageVidaPlus(
changePageViewIndex: changePageViewIndex,
currentIndex: _currentIndex,
patientInfo: patient,
changeLoadingState: changeLoadingState)
changeLoadingState: changeLoadingState),
],
),
)

@ -0,0 +1,194 @@
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
typedef OnSoapDetailActionClicked = Function(SoapDetailItemActions);
class SoapDetailItem extends StatelessWidget {
final String title;
final String condition;
final String status;
final String remarks;
final OnSoapDetailActionClicked onSoapDetailActionClicked;
const SoapDetailItem(
{super.key,
required this.title,
required this.condition,
required this.remarks,
required this.onSoapDetailActionClicked,
required this.status});
@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Stack(
children: [
Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
title,
color: Color(0XFF2B353E),
fontSize: 12,
fontWeight: FontWeight.bold,
),
Row(
children: [
AppText(
"${TranslationBase.of(context).condition}:",
color: Color(0XFF2B353E),
fontSize: 10,
fontWeight: FontWeight.w500,
),
SizedBox(
width: 4,
),
AppText(
condition,
color: Color(0xffD02127),
fontSize: 10,
fontWeight: FontWeight.w500,
),
],
),
Visibility(
visible: remarks.isNotEmpty,
child: Column(
children: [
SizedBox(
height: 8,
),
AppText(
remarks,
color: Color(0XFF2B353E),
fontSize: 10,
fontWeight: FontWeight.w400,
),
],
))
],
),
Align(
alignment: Alignment.topRight, child: Status(status: status))
],
),
SizedBox(
height: 16,
),
Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () =>
onSoapDetailActionClicked(SoapDetailItemActions.EDIT),
child: SoapDetailItemActionsView(
icon: 'assets/images/svgs/edit.svg',
fontColor: Color(0XFF2B353E),
text: TranslationBase.of(context).edit,
),
),
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () =>
onSoapDetailActionClicked(SoapDetailItemActions.RESOLVE),
child: SoapDetailItemActionsView(
icon: 'assets/images/svgs/resolve.svg',
fontColor: Color(0XFF359846),
text: TranslationBase.of(context).resolve,
),
),
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () =>
onSoapDetailActionClicked(SoapDetailItemActions.AUDIT),
child: SoapDetailItemActionsView(
icon: 'assets/images/svgs/audit.svg',
fontColor: Color(0XFF359846),
text: TranslationBase.of(context).audit,
),
),
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () =>
onSoapDetailActionClicked(SoapDetailItemActions.REMOVE),
child: SoapDetailItemActionsView(
icon: 'assets/images/svgs/delete.svg',
fontColor: Color(0XFFD02127),
text: TranslationBase.of(context).delete,
),
),
],
)
],
),
);
}
}
class SoapDetailItemActionsView extends StatelessWidget {
final String icon;
final String text;
final Color fontColor;
const SoapDetailItemActionsView(
{super.key,
required this.icon,
required this.text,
required this.fontColor});
@override
Widget build(BuildContext context) => Row(
children: [
SvgPicture.asset(icon),
SizedBox(
width: 8,
),
AppText(
text,
color: fontColor,
fontSize: 10,
fontWeight: FontWeight.w500,
),
],
);
}
class Status extends StatelessWidget {
final String status;
const Status({super.key, required this.status});
@override
Widget build(BuildContext context) {
return Material(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(3),
),
// color: Color(0xFF359846),
color: (status.toLowerCase() == 'active' || status.toLowerCase() == 'stable')
? Color(0xFFD8E8DB)
: Color(0x98d02127),
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 6),
child: AppText(
status,
color: (status.toLowerCase() == 'active' || status.toLowerCase() == 'stable')
? Color(0xFF359846)
: Colors.white,
fontSize: 8,
fontWeight: FontWeight.w600,
),
));
}
}
enum SoapDetailItemActions { EDIT, RESOLVE, AUDIT, REMOVE }

@ -502,6 +502,7 @@ class TranslationBase {
String get beingGreat => localizedValues['beingGreat']![locale.languageCode]!;
String get cancel => localizedValues['cancel']![locale.languageCode]!;
String get cancelSmall => localizedValues['cancelSmall']![locale.languageCode]!;
String get ok => localizedValues['ok']![locale.languageCode]!;
@ -1903,6 +1904,20 @@ class TranslationBase {
String get familySpecify => localizedValues['familySpecify']![locale.languageCode]!;
String get otherSpecify => localizedValues['otherSpecify']![locale.languageCode]!;
String get historyOfIllness => localizedValues['historyOfIllness']![locale.languageCode]!;
String get physicalExamination => localizedValues['physicalExamination']![locale.languageCode]!;
String get addPhysicalExamination => localizedValues['addPhysicalExamination']![locale.languageCode]!;
String get noPhysicalExamination => localizedValues['noPhysicalExamination']![locale.languageCode]!;
String get examinationPart => localizedValues['examinationPart']![locale.languageCode]!;
String get resolve => localizedValues['resolve']![locale.languageCode]!;
String get audit => localizedValues['audit']![locale.languageCode]!;
String get delete => localizedValues['delete']![locale.languageCode]!;
String get noProgressNote => localizedValues['noProgressNote']![locale.languageCode]!;
String get patientCondition => localizedValues['patientCondition']![locale.languageCode]!;
String get doctorProgressNote => localizedValues['doctorProgressNote']![locale.languageCode]!;
String get nurseNote => localizedValues['nurseNote']![locale.languageCode]!;
String get progressNoteType => localizedValues['progressNoteType']![locale.languageCode]!;
String get addYourNote => localizedValues['addYourNote']![locale.languageCode]!;
String get saveAsDraft => localizedValues['saveAsDraft']![locale.languageCode]!;
}
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -18,6 +18,7 @@ class AppTextFieldCustom extends StatefulWidget {
final bool hasBorder;
final String? dropDownText;
final IconButton? suffixIcon;
final Widget? suffixWidget;
final Color? dropDownColor;
final bool enabled;
final TextInputType? inputType;
@ -42,6 +43,7 @@ class AppTextFieldCustom extends StatefulWidget {
this.isTextFieldHasSuffix = false,
this.dropDownText,
this.suffixIcon,
this.suffixWidget,
this.dropDownColor,
this.enabled = true,
this.inputType,
@ -84,26 +86,32 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
@override
void dispose() {
// _focusNode.dispose();
// _focusNode.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
TextInputType localKeyboardType = widget.inputType ?? (widget.maxLines == 1 ? TextInputType.text : TextInputType.multiline);
TextInputType localKeyboardType = widget.inputType ??
(widget.maxLines == 1 ? TextInputType.text : TextInputType.multiline);
return Column(
children: [
Container(
height: widget.height != 0 && widget.maxLines == 1 ? widget.height + 8 : null, //MediaQuery.of(context).size.height * 0.098,
height: widget.height != 0 && widget.maxLines == 1
? widget.height + 8
: null, //MediaQuery.of(context).size.height * 0.098,
decoration: widget.hasBorder
? TextFieldsUtils.containerBorderDecoration(
Color(0Xffffffff),
widget.validationError == null ? Color(0xFFEFEFEF) : Colors.red.shade700,
widget.validationError == null
? Color(0xFFEFEFEF)
: Colors.red.shade700,
)
: null,
padding: EdgeInsets.only(top: 4.0, bottom: 0.0, left: 8.0, right: 8.0),
padding:
EdgeInsets.only(top: 4.0, bottom: 0.0, left: 8.0, right: 8.0),
child: InkWell(
onTap: widget.onClick,
child: Row(
@ -130,25 +138,40 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
),
widget.dropDownText == null
? Container(
height: widget.height != 0 && widget.maxLines == 1 ? widget.height - 22 : null,
height:
widget.height != 0 && widget.maxLines == 1
? widget.height - 22
: null,
child: RawKeyboardListener(
focusNode: FocusNode(),
autofocus: false,
onKey: (rawKeyEvent) {
final isFormSkippedEnterEvent = rawKeyEvent is RawKeyDownEvent && rawKeyEvent.isKeyPressed(LogicalKeyboardKey.enter);
final isFormSkippedEnterEvent =
rawKeyEvent is RawKeyDownEvent &&
rawKeyEvent.isKeyPressed(
LogicalKeyboardKey.enter);
final needToInsertNewLine = isFormSkippedEnterEvent && localKeyboardType == TextInputType.multiline;
final needToInsertNewLine =
isFormSkippedEnterEvent &&
localKeyboardType ==
TextInputType.multiline;
if (needToInsertNewLine) {
TextEditingControllerHelper.insertText(widget.controller!, '\n');
TextEditingControllerHelper.insertText(
widget.controller!, '\n');
}
},
child: TextFormField(
textAlign: projectViewModel.isArabic ? TextAlign.right : TextAlign.left,
textAlign: projectViewModel.isArabic
? TextAlign.right
: TextAlign.left,
focusNode: _focusNode,
textAlignVertical: TextAlignVertical.top,
decoration: TextFieldsUtils.textFieldSelectorDecoration(widget.hintText!, "", true),
decoration: TextFieldsUtils
.textFieldSelectorDecoration(
widget.hintText!, "", true),
style: TextStyle(
fontSize: SizeConfig.textMultiplier! * 1.7,
fontSize:
SizeConfig.textMultiplier! * 1.7,
fontFamily: 'Poppins',
color: Color(0xFF575757),
fontWeight: FontWeight.w400,
@ -159,14 +182,18 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
enabled: widget.enabled,
minLines: widget.minLines,
maxLines: widget.maxLines,
inputFormatters: widget.inputFormatters != null ? widget.inputFormatters : [],
inputFormatters:
widget.inputFormatters != null
? widget.inputFormatters
: [],
onChanged: (value) {
if (widget.onChanged != null) {
widget.onChanged(value);
}
setState(() {});
},
onFieldSubmitted: widget.onFieldSubmitted(),
onFieldSubmitted:
widget.onFieldSubmitted(),
obscureText: widget.isSecure),
),
)
@ -185,7 +212,8 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
? Container(
margin: EdgeInsets.only(
bottom: widget.isSearchTextField
? (widget.controller!.text.isEmpty || widget.controller == null)
? (widget.controller!.text.isEmpty ||
widget.controller == null)
? 10
: 25
: 0),
@ -193,16 +221,22 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
: InkWell(
child: Icon(
Icons.keyboard_arrow_down,
color: widget.dropDownColor != null ? widget.dropDownColor : Color(0xff2E303A),
color: widget.dropDownColor != null
? widget.dropDownColor
: Color(0xff2E303A),
size: 12.0,
),
)
: Container(),
: widget.suffixWidget != null
? widget.suffixWidget ?? SizedBox.shrink()
: Container(),
],
),
),
),
if (widget.validationError != null && widget.validationError!.isNotEmpty) TextFieldsError(error: widget.validationError!),
if (widget.validationError != null &&
widget.validationError!.isNotEmpty)
TextFieldsError(error: widget.validationError!),
],
);
}
@ -218,7 +252,8 @@ class TextEditingControllerHelper {
}
final text = controller.text;
final newText = text.replaceRange(selection.start, selection.end, textToInsert);
final newText =
text.replaceRange(selection.start, selection.end, textToInsert);
controller.value = controller.value.copyWith(
text: newText,
selection: TextSelection.collapsed(

Loading…
Cancel
Save