Ai Analysis & PMA-(1078,1079)
parent
7014ac397e
commit
2c7f4ddc48
@ -0,0 +1,19 @@
|
||||
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M14.4375 0.9375C14.5976 0.9375 14.7363 1.04846 14.7715 1.20465L14.9472 1.98451C15.0671 2.51701 15.483 2.93285 16.0155 3.05281L16.7954 3.22848C16.9515 3.26366 17.0625 3.40239 17.0625 3.5625C17.0625 3.72261 16.9515 3.86134 16.7954 3.89652L16.0155 4.07219C15.483 4.19215 15.0671 4.60799 14.9472 5.14049L14.7715 5.92035C14.7363 6.07654 14.5976 6.1875 14.4375 6.1875C14.2774 6.1875 14.1387 6.07654 14.1035 5.92035L13.9278 5.14049C13.8079 4.60799 13.392 4.19215 12.8595 4.07219L12.0796 3.89652C11.9235 3.86134 11.8125 3.72261 11.8125 3.5625C11.8125 3.40239 11.9235 3.26366 12.0796 3.22848L12.8595 3.05281C13.392 2.93285 13.8079 2.51701 13.9278 1.98451L14.1035 1.20465C14.1387 1.04846 14.2774 0.9375 14.4375 0.9375Z" fill="url(#paint0_linear_9523_4592)"/>
|
||||
<path d="M9 1.6875C9.31066 1.6875 9.5625 1.93934 9.5625 2.25C9.5625 3.75456 10.3204 5.3062 11.5071 6.49288C12.6938 7.67956 14.2454 8.4375 15.75 8.4375C16.0607 8.4375 16.3125 8.68934 16.3125 9C16.3125 9.31066 16.0607 9.5625 15.75 9.5625C14.2454 9.5625 12.6938 10.3204 11.5071 11.5071C10.3204 12.6938 9.5625 14.2454 9.5625 15.75C9.5625 16.0607 9.31066 16.3125 9 16.3125C8.68934 16.3125 8.4375 16.0607 8.4375 15.75C8.4375 14.2454 7.67956 12.6938 6.49288 11.5071C5.3062 10.3204 3.75456 9.5625 2.25 9.5625C1.93934 9.5625 1.6875 9.31066 1.6875 9C1.6875 8.68934 1.93934 8.4375 2.25 8.4375C3.75456 8.4375 5.3062 7.67956 6.49288 6.49288C7.67956 5.3062 8.4375 3.75456 8.4375 2.25C8.4375 1.93934 8.68934 1.6875 9 1.6875Z" fill="url(#paint1_linear_9523_4592)"/>
|
||||
<path d="M3.89652 12.0796C3.86134 11.9235 3.72261 11.8125 3.5625 11.8125C3.40239 11.8125 3.26366 11.9235 3.22848 12.0796L3.05281 12.8595C2.93285 13.392 2.51701 13.8079 1.98451 13.9278L1.20465 14.1035C1.04846 14.1387 0.9375 14.2774 0.9375 14.4375C0.9375 14.5976 1.04846 14.7363 1.20465 14.7715L1.98451 14.9472C2.51701 15.0671 2.93285 15.483 3.05281 16.0155L3.22848 16.7954C3.26366 16.9515 3.40239 17.0625 3.5625 17.0625C3.72261 17.0625 3.86134 16.9515 3.89652 16.7954L4.07219 16.0155C4.19215 15.483 4.60799 15.0671 5.14049 14.9472L5.92035 14.7715C6.07654 14.7363 6.1875 14.5976 6.1875 14.4375C6.1875 14.2774 6.07654 14.1387 5.92035 14.1035L5.14049 13.9278C4.60799 13.8079 4.19215 13.392 4.07219 12.8595L3.89652 12.0796Z" fill="url(#paint2_linear_9523_4592)"/>
|
||||
<defs>
|
||||
<linearGradient id="paint0_linear_9523_4592" x1="9" y1="0.9375" x2="9" y2="17.0625" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#8A38F5"/>
|
||||
<stop offset="1" stop-color="#E20BBB"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint1_linear_9523_4592" x1="9" y1="0.9375" x2="9" y2="17.0625" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#8A38F5"/>
|
||||
<stop offset="1" stop-color="#E20BBB"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint2_linear_9523_4592" x1="9" y1="0.9375" x2="9" y2="17.0625" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#8A38F5"/>
|
||||
<stop offset="1" stop-color="#E20BBB"/>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.9 KiB |
@ -0,0 +1,3 @@
|
||||
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M9.03901 1.3125L8.961 1.3125C7.31466 1.31249 6.02729 1.31249 5.0234 1.43396C4.00096 1.55768 3.18715 1.81548 2.54214 2.39599C1.88865 2.98413 1.59058 3.73922 1.4491 4.68627C1.31247 5.60088 1.31249 6.769 1.3125 8.24081L1.3125 9.75917C1.31249 11.231 1.31247 12.3991 1.4491 13.3137C1.59058 14.2608 1.88865 15.0159 2.54214 15.604C3.18715 16.1845 4.00096 16.4423 5.0234 16.566C6.02729 16.6875 7.31465 16.6875 8.96099 16.6875H9.03901C10.6854 16.6875 11.9727 16.6875 12.9766 16.566C13.999 16.4423 14.8129 16.1845 15.4579 15.604C16.1114 15.0159 16.4094 14.2608 16.5509 13.3137C16.6875 12.3991 16.6875 11.231 16.6875 9.75919V8.24081C16.6875 6.76899 16.6875 5.60087 16.5509 4.68627C16.4094 3.73922 16.1114 2.98413 15.4579 2.39599C14.8129 1.81548 13.999 1.55768 12.9766 1.43396C11.9727 1.31249 10.6853 1.31249 9.03901 1.3125ZM12.5625 4.5C12.5625 4.18934 12.3107 3.9375 12 3.9375C11.6893 3.9375 11.4375 4.18934 11.4375 4.5L11.4375 5.4375H10.5C10.1893 5.4375 9.9375 5.68934 9.9375 6C9.9375 6.31066 10.1893 6.5625 10.5 6.5625H11.4375V7.5C11.4375 7.81066 11.6893 8.0625 12 8.0625C12.3107 8.0625 12.5625 7.81066 12.5625 7.5V6.5625H13.5C13.8107 6.5625 14.0625 6.31066 14.0625 6C14.0625 5.68934 13.8107 5.4375 13.5 5.4375H12.5625L12.5625 4.5ZM9.9375 13.125C9.9375 12.8143 10.1893 12.5625 10.5 12.5625L13.5 12.5625C13.8107 12.5625 14.0625 12.8143 14.0625 13.125C14.0625 13.4357 13.8107 13.6875 13.5 13.6875L10.5 13.6875C10.1893 13.6875 9.9375 13.4357 9.9375 13.125ZM10.5 10.3125C10.1893 10.3125 9.9375 10.5643 9.9375 10.875C9.9375 11.1857 10.1893 11.4375 10.5 11.4375L13.5 11.4375C13.8107 11.4375 14.0625 11.1857 14.0625 10.875C14.0625 10.5643 13.8107 10.3125 13.5 10.3125L10.5 10.3125ZM7.89775 10.1023C8.11742 10.3219 8.11742 10.6781 7.89775 10.8977L6.983 11.8125L7.89775 12.7273C8.11742 12.9469 8.11742 13.3031 7.89775 13.5227C7.67808 13.7424 7.32192 13.7424 7.10225 13.5227L6.1875 12.608L5.27275 13.5227C5.05308 13.7424 4.69692 13.7424 4.47725 13.5227C4.25758 13.3031 4.25758 12.9469 4.47725 12.7273L5.392 11.8125L4.47725 10.8977C4.25758 10.6781 4.25758 10.3219 4.47725 10.1023C4.69692 9.88258 5.05308 9.88258 5.27275 10.1023L6.1875 11.017L7.10225 10.1023C7.32192 9.88258 7.67808 9.88258 7.89775 10.1023ZM4.5 5.4375C4.18934 5.4375 3.9375 5.68934 3.9375 6C3.9375 6.31066 4.18934 6.5625 4.5 6.5625L7.5 6.5625C7.81066 6.5625 8.0625 6.31066 8.0625 6C8.0625 5.68934 7.81066 5.4375 7.5 5.4375L4.5 5.4375Z" fill="#8F9AA3"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.5 KiB |
@ -0,0 +1,5 @@
|
||||
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M9.56265 5.25C9.56265 4.93934 9.31081 4.6875 9.00015 4.6875C8.68949 4.6875 8.43765 4.93934 8.43765 5.25L8.43765 6.75C8.43765 7.06066 8.68949 7.3125 9.00015 7.3125C9.31081 7.3125 9.56265 7.06066 9.56265 6.75V5.25Z" fill="#2E3039"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.9988 0.9375C7.73784 0.9375 6.71271 1.36345 5.81862 1.82666C5.54843 1.96664 5.29743 2.1051 5.05759 2.23741C4.47075 2.56113 3.95062 2.84805 3.37945 3.03029L3.36037 3.03638C3.02491 3.14341 2.74681 3.23213 2.53612 3.3147C2.33781 3.39241 2.10212 3.4989 1.9349 3.68475C1.78469 3.85169 1.70752 4.0391 1.65635 4.21837C1.6099 4.38111 1.57434 4.57846 1.53625 4.78983L1.53211 4.81279C0.603657 9.96205 2.6339 14.8403 7.59174 16.7384L7.61642 16.7479C8.10374 16.9345 8.43795 17.0625 9.00126 17.0625C9.56458 17.0625 9.89877 16.9345 10.3861 16.7479L10.4107 16.7384C15.3684 14.8402 17.3966 9.96183 16.4679 4.81275L16.4638 4.78975C16.4257 4.57837 16.3901 4.38099 16.3437 4.21825C16.2925 4.03897 16.2153 3.85153 16.065 3.68458C15.8978 3.49874 15.6621 3.39228 15.4638 3.31459C15.2531 3.23206 14.975 3.14338 14.6395 3.0364L14.6205 3.03033C14.049 2.84808 13.5285 2.56109 12.9412 2.23732C12.7012 2.10503 12.4501 1.96659 12.1799 1.82665C11.2853 1.36346 10.2598 0.9375 8.9988 0.9375ZM5.69431 3.17268C5.91405 3.05144 6.12837 2.9332 6.33612 2.82557C7.16979 2.39367 8.00392 2.0625 8.9988 2.0625C9.99375 2.0625 10.8283 2.39372 11.6626 2.82567C11.8704 2.9333 12.0848 3.05153 12.3047 3.17275C12.9278 3.51634 13.5945 3.88397 14.2787 4.10215C14.638 4.21674 14.8809 4.29449 15.0535 4.3621C15.1671 4.4066 15.2164 4.43472 15.2324 4.44405C15.2383 4.45602 15.2486 4.48074 15.2619 4.52707C15.291 4.62916 15.3171 4.77013 15.3608 5.01244C16.2166 9.75713 14.3493 14.0257 10.0085 15.6878C9.5102 15.8786 9.34656 15.9375 9.00125 15.9375C8.65594 15.9375 8.49229 15.8786 7.99399 15.6878C3.65273 14.0257 1.78378 9.75694 2.63926 5.01241C2.68294 4.77015 2.70902 4.62921 2.73815 4.52713C2.75137 4.48082 2.7617 4.45611 2.76765 4.44414C2.78356 4.4348 2.83295 4.40667 2.94657 4.36215C3.11916 4.29452 3.36205 4.21672 3.72141 4.10206C4.40531 3.88385 5.0716 3.51625 5.69431 3.17268ZM15.2282 4.43645C15.2272 4.43489 15.2267 4.43428 15.2267 4.43436C15.2267 4.43441 15.2269 4.43474 15.2273 4.43527C15.2275 4.43559 15.2278 4.43599 15.2282 4.43645Z" fill="#2E3039"/>
|
||||
<path d="M2.77331 4.43444C2.77332 4.43453 2.77283 4.43532 2.7718 4.43654M3.37945 3.03029C3.95062 2.84805 4.47075 2.56113 5.05759 2.23741C5.29743 2.1051 5.54843 1.96664 5.81862 1.82666C6.71271 1.36345 7.73784 0.9375 8.9988 0.9375C10.2598 0.9375 11.2853 1.36346 12.1799 1.82665C12.4501 1.96659 12.7012 2.10503 12.9412 2.23732C13.5285 2.56109 14.049 2.84808 14.6205 3.03033L14.6395 3.0364C14.975 3.14338 15.2531 3.23206 15.4638 3.31459C15.6621 3.39228 15.8978 3.49874 16.065 3.68458C16.2153 3.85153 16.2925 4.03897 16.3437 4.21825C16.3901 4.38099 16.4257 4.57837 16.4638 4.78975L16.4679 4.81275C17.3966 9.96183 15.3684 14.8402 10.4107 16.7384L10.3861 16.7479C9.89877 16.9345 9.56458 17.0625 9.00126 17.0625C8.43795 17.0625 8.10374 16.9345 7.61642 16.7479L7.59174 16.7384C2.6339 14.8403 0.603657 9.96205 1.53211 4.81279L1.53625 4.78983C1.57434 4.57846 1.6099 4.38111 1.65635 4.21837C1.70752 4.0391 1.78469 3.85169 1.9349 3.68475C2.10212 3.4989 2.33781 3.39241 2.53612 3.3147C2.74681 3.23213 3.02491 3.14341 3.36037 3.03638L3.37945 3.03029ZM3.37945 3.03029L3.55043 3.56618M5.69431 3.17268C5.91405 3.05144 6.12837 2.9332 6.33612 2.82557C7.16979 2.39367 8.00392 2.0625 8.9988 2.0625C9.99375 2.0625 10.8283 2.39372 11.6626 2.82567C11.8704 2.9333 12.0848 3.05153 12.3047 3.17275C12.9278 3.51634 13.5945 3.88397 14.2787 4.10215C14.638 4.21674 14.8809 4.29449 15.0535 4.3621C15.1671 4.4066 15.2164 4.43472 15.2324 4.44405C15.2383 4.45602 15.2486 4.48074 15.2619 4.52707C15.291 4.62916 15.3171 4.77013 15.3608 5.01244C16.2166 9.75713 14.3493 14.0257 10.0085 15.6878C9.5102 15.8786 9.34656 15.9375 9.00125 15.9375C8.65594 15.9375 8.49229 15.8786 7.99399 15.6878C3.65273 14.0257 1.78378 9.75694 2.63926 5.01241C2.68294 4.77015 2.70902 4.62921 2.73815 4.52713C2.75137 4.48082 2.7617 4.45611 2.76765 4.44414C2.78356 4.4348 2.83295 4.40667 2.94657 4.36215C3.11916 4.29452 3.36205 4.21672 3.72141 4.10206C4.40531 3.88385 5.0716 3.51625 5.69431 3.17268ZM15.2282 4.43645C15.2272 4.43489 15.2267 4.43428 15.2267 4.43436C15.2267 4.43441 15.2269 4.43474 15.2273 4.43527C15.2275 4.43559 15.2278 4.43599 15.2282 4.43645ZM9.56265 5.25C9.56265 4.93934 9.31081 4.6875 9.00015 4.6875C8.68949 4.6875 8.43765 4.93934 8.43765 5.25L8.43765 6.75C8.43765 7.06066 8.68949 7.3125 9.00015 7.3125C9.31081 7.3125 9.56265 7.06066 9.56265 6.75V5.25Z" stroke="#2E3039" stroke-width="0.5" stroke-linecap="round"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 4.7 KiB |
@ -0,0 +1,5 @@
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M10.9922 16C10.9922 15.4477 11.4399 15 11.9922 15H12.0012C12.5535 15 13.0012 15.4477 13.0012 16C13.0012 16.5523 12.5535 17 12.0012 17H11.9922C11.4399 17 10.9922 16.5523 10.9922 16Z" fill="#ED1C2B"/>
|
||||
<path d="M11.25 13C11.25 13.4142 11.5858 13.75 12 13.75C12.4142 13.75 12.75 13.4142 12.75 13L12.75 9C12.75 8.58579 12.4142 8.25 12 8.25C11.5858 8.25 11.25 8.58579 11.25 9L11.25 13Z" fill="#ED1C2B"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M10.362 2.015C11.4264 1.66167 12.5736 1.66167 13.638 2.015C14.6981 2.36687 15.5304 3.20141 16.3665 4.37395C17.1999 5.5426 18.1208 7.17206 19.3078 9.2725L19.3544 9.35496C20.5417 11.4557 21.4625 13.0851 22.0364 14.4065C22.613 15.7343 22.9002 16.8807 22.6711 17.9821C22.4403 19.0911 21.8714 20.0995 21.0428 20.8617C20.2162 21.622 19.0907 21.9428 17.6736 22.0968C16.2645 22.25 14.4212 22.25 12.0488 22.25H11.9513C9.57882 22.25 7.73554 22.25 6.32642 22.0968C4.90927 21.9428 3.78379 21.622 2.95722 20.8617C2.12862 20.0995 1.55968 19.0911 1.32895 17.9821C1.0998 16.8807 1.387 15.7343 1.96365 14.4065C2.53752 13.0851 3.45835 11.4557 4.64558 9.35495L4.69218 9.2725C5.87921 7.17207 6.80008 5.5426 7.63347 4.37395C8.46963 3.20141 9.30194 2.36687 10.362 2.015ZM13.1655 3.43862C12.4078 3.18713 11.5922 3.18713 10.8345 3.43862C10.2386 3.63645 9.63943 4.1445 8.85474 5.24486C8.07275 6.34143 7.18998 7.90144 5.97466 10.0519C4.75941 12.2023 3.87825 13.7635 3.33951 15.004C2.79983 16.2467 2.66463 17.0379 2.7975 17.6766C2.96511 18.4821 3.37754 19.2102 3.97272 19.7577C4.44016 20.1877 5.16852 20.4621 6.48854 20.6056C7.80696 20.7489 9.56861 20.75 12 20.75C14.4314 20.75 16.193 20.7489 17.5115 20.6056C18.8315 20.4621 19.5599 20.1877 20.0273 19.7577C20.6225 19.2102 21.0349 18.4821 21.2025 17.6766C21.3354 17.0379 21.2002 16.2467 20.6605 15.004C20.1218 13.7635 19.2406 12.2023 18.0254 10.0519C16.81 7.90144 15.9273 6.34143 15.1453 5.24486C14.3606 4.1445 13.7615 3.63645 13.1655 3.43862Z" fill="#ED1C2B"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.0 KiB |
@ -0,0 +1,3 @@
|
||||
<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M0.729492 7.0013C0.729492 10.4646 3.53704 13.2721 7.00033 13.2721C10.4636 13.2721 13.2712 10.4646 13.2712 7.0013C13.2712 3.53802 10.4636 0.730469 7.00033 0.730469C3.53704 0.730469 0.729492 3.53802 0.729492 7.0013ZM6.81476 6.43387C6.95887 6.45324 7.15822 6.50511 7.32738 6.67427C7.49654 6.84343 7.5484 7.04278 7.56778 7.18689C7.58383 7.30627 7.58374 7.44509 7.58367 7.56168L7.58366 9.91799C7.58366 10.2402 7.32249 10.5013 7.00033 10.5013C6.67816 10.5013 6.41699 10.2402 6.41699 9.91799L6.41699 7.58466C6.09483 7.58466 5.83366 7.32349 5.83366 7.00132C5.83366 6.67916 6.09483 6.41799 6.41699 6.41799L6.43997 6.41798C6.55656 6.41791 6.69537 6.41782 6.81476 6.43387ZM6.99767 4.08464C6.67694 4.08464 6.41694 4.3458 6.41694 4.66797C6.41694 4.99014 6.67694 5.2513 6.99767 5.2513H7.00288C7.32361 5.2513 7.58361 4.99014 7.58361 4.66797C7.58361 4.3458 7.32361 4.08464 7.00288 4.08464H6.99767Z" fill="#2E3039"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.0 KiB |
@ -0,0 +1,69 @@
|
||||
import 'dart:convert';
|
||||
|
||||
class AiLabOrdersOverView {
|
||||
String? orderDate;
|
||||
String? clinic;
|
||||
String? doctor;
|
||||
List<Result>? results;
|
||||
|
||||
AiLabOrdersOverView({
|
||||
this.orderDate,
|
||||
this.clinic,
|
||||
this.doctor,
|
||||
this.results,
|
||||
});
|
||||
|
||||
factory AiLabOrdersOverView.fromRawJson(String str) => AiLabOrdersOverView.fromJson(json.decode(str));
|
||||
|
||||
String toRawJson() => json.encode(toJson());
|
||||
|
||||
factory AiLabOrdersOverView.fromJson(Map<String, dynamic> json) => AiLabOrdersOverView(
|
||||
orderDate: json["order_date"] == null ? null : json["order_date"],
|
||||
clinic: json["clinic"],
|
||||
doctor: json["doctor"],
|
||||
results: json["results"] == null ? [] : List<Result>.from(json["results"]!.map((x) => Result.fromJson(x))),
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"order_date": orderDate,
|
||||
"clinic": clinic,
|
||||
"doctor": doctor,
|
||||
"results": results == null ? [] : List<dynamic>.from(results!.map((x) => x.toJson())),
|
||||
};
|
||||
}
|
||||
|
||||
class Result {
|
||||
String? testName;
|
||||
String? resultValue;
|
||||
String? referenceRange;
|
||||
String? unit;
|
||||
String? flag;
|
||||
|
||||
Result({
|
||||
this.testName,
|
||||
this.resultValue,
|
||||
this.referenceRange,
|
||||
this.unit,
|
||||
this.flag,
|
||||
});
|
||||
|
||||
factory Result.fromRawJson(String str) => Result.fromJson(json.decode(str));
|
||||
|
||||
String toRawJson() => json.encode(toJson());
|
||||
|
||||
factory Result.fromJson(Map<String, dynamic> json) => Result(
|
||||
testName: json["test_name"],
|
||||
resultValue: json["result_value"],
|
||||
referenceRange: json["reference_range"],
|
||||
unit: json["unit"],
|
||||
flag: json["flag"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"test_name": testName,
|
||||
"result_value": resultValue,
|
||||
"reference_range": referenceRange,
|
||||
"unit": unit,
|
||||
"flag": flag,
|
||||
};
|
||||
}
|
||||
@ -0,0 +1,177 @@
|
||||
import 'dart:convert';
|
||||
|
||||
class LabOrdersResponseByAi {
|
||||
Analysis? analysis;
|
||||
String? patientId;
|
||||
int? totalOrders;
|
||||
int? totalResults;
|
||||
|
||||
LabOrdersResponseByAi({
|
||||
this.analysis,
|
||||
this.patientId,
|
||||
this.totalOrders,
|
||||
this.totalResults,
|
||||
});
|
||||
|
||||
factory LabOrdersResponseByAi.fromRawJson(String str) => LabOrdersResponseByAi.fromJson(json.decode(str));
|
||||
|
||||
String toRawJson() => json.encode(toJson());
|
||||
|
||||
factory LabOrdersResponseByAi.fromJson(Map<String, dynamic> json) => LabOrdersResponseByAi(
|
||||
analysis: json["analysis"] == null ? null : Analysis.fromJson(json["analysis"]),
|
||||
patientId: json["patient_id"],
|
||||
totalOrders: json["total_orders"],
|
||||
totalResults: json["total_results"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"analysis": analysis?.toJson(),
|
||||
"patient_id": patientId,
|
||||
"total_orders": totalOrders,
|
||||
"total_results": totalResults,
|
||||
};
|
||||
}
|
||||
|
||||
class Analysis {
|
||||
List<AiGeneratedAttribute>? aiGeneratedAttributes;
|
||||
List<String>? aiPredictions;
|
||||
List<AiRecommendation>? aiRecommendations;
|
||||
List<String>? prevention;
|
||||
String? rawMessage;
|
||||
List<RiskFactor>? riskFactors;
|
||||
List<dynamic>? suggestedDoctors;
|
||||
String? summary;
|
||||
|
||||
Analysis({
|
||||
this.aiGeneratedAttributes,
|
||||
this.aiPredictions,
|
||||
this.aiRecommendations,
|
||||
this.prevention,
|
||||
this.rawMessage,
|
||||
this.riskFactors,
|
||||
this.suggestedDoctors,
|
||||
this.summary,
|
||||
});
|
||||
|
||||
factory Analysis.fromRawJson(String str) => Analysis.fromJson(json.decode(str));
|
||||
|
||||
String toRawJson() => json.encode(toJson());
|
||||
|
||||
factory Analysis.fromJson(Map<String, dynamic> json) => Analysis(
|
||||
aiGeneratedAttributes: json["ai_generated_attributes"] == null ? [] : List<AiGeneratedAttribute>.from(json["ai_generated_attributes"]!.map((x) => AiGeneratedAttribute.fromJson(x))),
|
||||
aiPredictions: json["ai_predictions"] == null ? [] : List<String>.from(json["ai_predictions"]!.map((x) => x)),
|
||||
aiRecommendations: json["ai_recommendations"] == null ? [] : List<AiRecommendation>.from(json["ai_recommendations"]!.map((x) => AiRecommendation.fromJson(x))),
|
||||
prevention: json["prevention"] == null ? [] : List<String>.from(json["prevention"]!.map((x) => x)),
|
||||
rawMessage: json["raw_message"],
|
||||
riskFactors: json["riskFactors"] == null ? [] : List<RiskFactor>.from(json["riskFactors"]!.map((x) => RiskFactor.fromJson(x))),
|
||||
suggestedDoctors: json["suggested_doctors"] == null ? [] : List<dynamic>.from(json["suggested_doctors"]!.map((x) => x)),
|
||||
summary: json["summary"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"ai_generated_attributes": aiGeneratedAttributes == null ? [] : List<dynamic>.from(aiGeneratedAttributes!.map((x) => x.toJson())),
|
||||
"ai_predictions": aiPredictions == null ? [] : List<dynamic>.from(aiPredictions!.map((x) => x)),
|
||||
"ai_recommendations": aiRecommendations == null ? [] : List<dynamic>.from(aiRecommendations!.map((x) => x.toJson())),
|
||||
"prevention": prevention == null ? [] : List<dynamic>.from(prevention!.map((x) => x)),
|
||||
"raw_message": rawMessage,
|
||||
"riskFactors": riskFactors == null ? [] : List<dynamic>.from(riskFactors!.map((x) => x.toJson())),
|
||||
"suggested_doctors": suggestedDoctors == null ? [] : List<dynamic>.from(suggestedDoctors!.map((x) => x)),
|
||||
"summary": summary,
|
||||
};
|
||||
}
|
||||
|
||||
class AiGeneratedAttribute {
|
||||
String? calculatedResultFlag;
|
||||
String? description;
|
||||
String? referanceRange;
|
||||
String? resultValue;
|
||||
String? testShortDescription;
|
||||
String? uom;
|
||||
String? calculationFormula;
|
||||
|
||||
AiGeneratedAttribute({
|
||||
this.calculatedResultFlag,
|
||||
this.description,
|
||||
this.referanceRange,
|
||||
this.resultValue,
|
||||
this.testShortDescription,
|
||||
this.uom,
|
||||
this.calculationFormula,
|
||||
});
|
||||
|
||||
factory AiGeneratedAttribute.fromRawJson(String str) => AiGeneratedAttribute.fromJson(json.decode(str));
|
||||
|
||||
String toRawJson() => json.encode(toJson());
|
||||
|
||||
factory AiGeneratedAttribute.fromJson(Map<String, dynamic> json) => AiGeneratedAttribute(
|
||||
calculatedResultFlag: json["CalculatedResultFlag"],
|
||||
description: json["Description"],
|
||||
referanceRange: json["ReferanceRange"],
|
||||
resultValue: json["ResultValue"],
|
||||
testShortDescription: json["TestShortDescription"],
|
||||
uom: json["UOM"],
|
||||
calculationFormula: json["calculationFormula"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"CalculatedResultFlag": calculatedResultFlag,
|
||||
"Description": description,
|
||||
"ReferanceRange": referanceRange,
|
||||
"ResultValue": resultValue,
|
||||
"TestShortDescription": testShortDescription,
|
||||
"UOM": uom,
|
||||
"calculationFormula": calculationFormula,
|
||||
};
|
||||
}
|
||||
|
||||
class AiRecommendation {
|
||||
String? priority;
|
||||
String? recommendation;
|
||||
|
||||
AiRecommendation({
|
||||
this.priority,
|
||||
this.recommendation,
|
||||
});
|
||||
|
||||
factory AiRecommendation.fromRawJson(String str) => AiRecommendation.fromJson(json.decode(str));
|
||||
|
||||
String toRawJson() => json.encode(toJson());
|
||||
|
||||
factory AiRecommendation.fromJson(Map<String, dynamic> json) => AiRecommendation(
|
||||
priority: json["priority"],
|
||||
recommendation: json["recommendation"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"priority": priority,
|
||||
"recommendation": recommendation,
|
||||
};
|
||||
}
|
||||
|
||||
class RiskFactor {
|
||||
String? description;
|
||||
String? factor;
|
||||
String? risk;
|
||||
|
||||
RiskFactor({
|
||||
this.description,
|
||||
this.factor,
|
||||
this.risk,
|
||||
});
|
||||
|
||||
factory RiskFactor.fromRawJson(String str) => RiskFactor.fromJson(json.decode(str));
|
||||
|
||||
String toRawJson() => json.encode(toJson());
|
||||
|
||||
factory RiskFactor.fromJson(Map<String, dynamic> json) => RiskFactor(
|
||||
description: json["description"],
|
||||
factor: json["factor"],
|
||||
risk: json["risk"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"description": description,
|
||||
"factor": factor,
|
||||
"risk": risk,
|
||||
};
|
||||
}
|
||||
@ -0,0 +1,145 @@
|
||||
import 'dart:convert';
|
||||
|
||||
class LabOrderResponseByAi {
|
||||
String? summary;
|
||||
List<AiGeneratedAttribute>? aiGeneratedAttributes;
|
||||
List<String>? aiPredictions;
|
||||
List<AiRecommendation>? aiRecommendations;
|
||||
List<RiskFactor>? riskFactors;
|
||||
List<String>? prevention;
|
||||
List<dynamic>? suggestedDoctors;
|
||||
String? rawMessage;
|
||||
|
||||
LabOrderResponseByAi({
|
||||
this.summary,
|
||||
this.aiGeneratedAttributes,
|
||||
this.aiPredictions,
|
||||
this.aiRecommendations,
|
||||
this.riskFactors,
|
||||
this.prevention,
|
||||
this.suggestedDoctors,
|
||||
this.rawMessage,
|
||||
});
|
||||
|
||||
factory LabOrderResponseByAi.fromRawJson(String str) => LabOrderResponseByAi.fromJson(json.decode(str));
|
||||
|
||||
String toRawJson() => json.encode(toJson());
|
||||
|
||||
factory LabOrderResponseByAi.fromJson(Map<String, dynamic> json) => LabOrderResponseByAi(
|
||||
summary: json["summary"],
|
||||
aiGeneratedAttributes: json["ai_generated_attributes"] == null ? [] : List<AiGeneratedAttribute>.from(json["ai_generated_attributes"]!.map((x) => AiGeneratedAttribute.fromJson(x))),
|
||||
aiPredictions: json["ai_predictions"] == null ? [] : List<String>.from(json["ai_predictions"]!.map((x) => x)),
|
||||
aiRecommendations: json["ai_recommendations"] == null ? [] : List<AiRecommendation>.from(json["ai_recommendations"]!.map((x) => AiRecommendation.fromJson(x))),
|
||||
riskFactors: json["riskFactors"] == null ? [] : List<RiskFactor>.from(json["riskFactors"]!.map((x) => RiskFactor.fromJson(x))),
|
||||
prevention: json["prevention"] == null ? [] : List<String>.from(json["prevention"]!.map((x) => x)),
|
||||
suggestedDoctors: json["suggested_doctors"] == null ? [] : List<dynamic>.from(json["suggested_doctors"]!.map((x) => x)),
|
||||
rawMessage: json["raw_message"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"summary": summary,
|
||||
"ai_generated_attributes": aiGeneratedAttributes == null ? [] : List<dynamic>.from(aiGeneratedAttributes!.map((x) => x.toJson())),
|
||||
"ai_predictions": aiPredictions == null ? [] : List<dynamic>.from(aiPredictions!.map((x) => x)),
|
||||
"ai_recommendations": aiRecommendations == null ? [] : List<dynamic>.from(aiRecommendations!.map((x) => x.toJson())),
|
||||
"riskFactors": riskFactors == null ? [] : List<dynamic>.from(riskFactors!.map((x) => x.toJson())),
|
||||
"prevention": prevention == null ? [] : List<dynamic>.from(prevention!.map((x) => x)),
|
||||
"suggested_doctors": suggestedDoctors == null ? [] : List<dynamic>.from(suggestedDoctors!.map((x) => x)),
|
||||
"raw_message": rawMessage,
|
||||
};
|
||||
}
|
||||
|
||||
class AiGeneratedAttribute {
|
||||
String? description;
|
||||
String? resultValue;
|
||||
String? referanceRange;
|
||||
String? calculatedResultFlag;
|
||||
String? uom;
|
||||
String? calculationFormula;
|
||||
String? testShortDescription;
|
||||
|
||||
AiGeneratedAttribute({
|
||||
this.description,
|
||||
this.resultValue,
|
||||
this.referanceRange,
|
||||
this.calculatedResultFlag,
|
||||
this.uom,
|
||||
this.calculationFormula,
|
||||
this.testShortDescription,
|
||||
});
|
||||
|
||||
factory AiGeneratedAttribute.fromRawJson(String str) => AiGeneratedAttribute.fromJson(json.decode(str));
|
||||
|
||||
String toRawJson() => json.encode(toJson());
|
||||
|
||||
factory AiGeneratedAttribute.fromJson(Map<String, dynamic> json) => AiGeneratedAttribute(
|
||||
description: json["Description"],
|
||||
resultValue: json["ResultValue"],
|
||||
referanceRange: json["ReferanceRange"],
|
||||
calculatedResultFlag: json["CalculatedResultFlag"],
|
||||
uom: json["UOM"],
|
||||
calculationFormula: json["calculationFormula"],
|
||||
testShortDescription: json["TestShortDescription"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"Description": description,
|
||||
"ResultValue": resultValue,
|
||||
"ReferanceRange": referanceRange,
|
||||
"CalculatedResultFlag": calculatedResultFlag,
|
||||
"UOM": uom,
|
||||
"calculationFormula": calculationFormula,
|
||||
"TestShortDescription": testShortDescription,
|
||||
};
|
||||
}
|
||||
|
||||
class AiRecommendation {
|
||||
String? recommendation;
|
||||
String? priority;
|
||||
|
||||
AiRecommendation({
|
||||
this.recommendation,
|
||||
this.priority,
|
||||
});
|
||||
|
||||
factory AiRecommendation.fromRawJson(String str) => AiRecommendation.fromJson(json.decode(str));
|
||||
|
||||
String toRawJson() => json.encode(toJson());
|
||||
|
||||
factory AiRecommendation.fromJson(Map<String, dynamic> json) => AiRecommendation(
|
||||
recommendation: json["recommendation"],
|
||||
priority: json["priority"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"recommendation": recommendation,
|
||||
"priority": priority,
|
||||
};
|
||||
}
|
||||
|
||||
class RiskFactor {
|
||||
String? factor;
|
||||
String? risk;
|
||||
String? description;
|
||||
|
||||
RiskFactor({
|
||||
this.factor,
|
||||
this.risk,
|
||||
this.description,
|
||||
});
|
||||
|
||||
factory RiskFactor.fromRawJson(String str) => RiskFactor.fromJson(json.decode(str));
|
||||
|
||||
String toRawJson() => json.encode(toJson());
|
||||
|
||||
factory RiskFactor.fromJson(Map<String, dynamic> json) => RiskFactor(
|
||||
factor: json["factor"],
|
||||
risk: json["risk"],
|
||||
description: json["description"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"factor": factor,
|
||||
"risk": risk,
|
||||
"description": description,
|
||||
};
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@ -0,0 +1,100 @@
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:hmg_patient_app_new/core/app_assets.dart';
|
||||
import 'package:hmg_patient_app_new/core/utils/size_utils.dart';
|
||||
import 'package:hmg_patient_app_new/extensions/string_extensions.dart';
|
||||
import 'package:hmg_patient_app_new/features/lab/models/resp_models/patient_lab_order_response_by_ai_model.dart';
|
||||
import 'package:hmg_patient_app_new/generated/locale_keys.g.dart';
|
||||
import 'package:hmg_patient_app_new/theme/colors.dart';
|
||||
|
||||
class AiAnalysisWidget extends StatelessWidget {
|
||||
final LabOrderResponseByAi data;
|
||||
|
||||
const AiAnalysisWidget({super.key, required this.data});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
decoration: BoxDecoration(borderRadius: BorderRadius.circular(24.r), gradient: AppColors.aiLinearGradient),
|
||||
padding: EdgeInsets.all(1.5.r), // Border thickness
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(22.r),
|
||||
),
|
||||
padding: EdgeInsets.all(20.r),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
LocaleKeys.aiAnalysis.tr().toText18(weight: FontWeight.w700, color: AppColors.blackColor),
|
||||
Container(
|
||||
padding: EdgeInsets.all(8.r),
|
||||
decoration: BoxDecoration(gradient: AppColors.aiLinearGradient, borderRadius: BorderRadius.circular(8.r)),
|
||||
child: SvgPicture.asset(AppAssets.aiOverView, colorFilter: const ColorFilter.mode(Colors.white, BlendMode.srcIn), height: 18.r, width: 18.r),
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 16.h),
|
||||
if (data.summary != null && data.summary!.isNotEmpty) ...[
|
||||
LocaleKeys.suggestion.tr().toText16(weight: FontWeight.w700, color: AppColors.blackColor),
|
||||
SizedBox(height: 8.h),
|
||||
data.summary!.toText14(color: AppColors.textColorLight, height: 1.5, weight: FontWeight.w400),
|
||||
SizedBox(height: 16.h),
|
||||
const Divider(color: AppColors.dividerColor, thickness: 1),
|
||||
SizedBox(height: 16.h),
|
||||
],
|
||||
if (data.aiPredictions != null && data.aiPredictions!.isNotEmpty) ...[
|
||||
LocaleKeys.prediction.tr().toText16(weight: FontWeight.w700, color: AppColors.blackColor),
|
||||
SizedBox(height: 12.h),
|
||||
...data.aiPredictions!.map((item) => _buildBulletItem(item)),
|
||||
SizedBox(height: 16.h),
|
||||
const Divider(color: AppColors.dividerColor, thickness: 1),
|
||||
SizedBox(height: 16.h),
|
||||
],
|
||||
if (data.prevention != null && data.prevention!.isNotEmpty) ...[
|
||||
LocaleKeys.prevention.tr().toText16(weight: FontWeight.w700, color: AppColors.blackColor),
|
||||
SizedBox(height: 12.h),
|
||||
...data.prevention!.map((item) => _buildBulletItem(item)),
|
||||
SizedBox(height: 20.h),
|
||||
],
|
||||
Row(
|
||||
children: [
|
||||
Icon(Icons.info_outline, color: AppColors.greyTextColor, size: 20.r),
|
||||
SizedBox(width: 8.w),
|
||||
Expanded(
|
||||
child: ("${LocaleKeys.disclaimer.tr()}:${LocaleKeys.thisAboveInfo.tr()}").toText12(color: AppColors.greyTextColor, fontWeight: FontWeight.w400),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildBulletItem(String text) {
|
||||
return Padding(
|
||||
padding: EdgeInsets.only(bottom: 12.h),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.only(top: 8.h, right: 12.w, left: 4.w),
|
||||
child: Container(
|
||||
width: 5.r,
|
||||
height: 5.r,
|
||||
decoration: const BoxDecoration(color: AppColors.blackColor, shape: BoxShape.circle),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: text.toText14(color: AppColors.textColorLight, height: 1.5, weight: FontWeight.w400),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,538 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hmg_patient_app_new/core/app_assets.dart';
|
||||
import 'package:hmg_patient_app_new/core/utils/size_utils.dart';
|
||||
import 'package:hmg_patient_app_new/core/utils/utils.dart';
|
||||
import 'package:hmg_patient_app_new/extensions/string_extensions.dart';
|
||||
import 'package:hmg_patient_app_new/extensions/widget_extensions.dart';
|
||||
import 'package:hmg_patient_app_new/features/lab/lab_view_model.dart';
|
||||
import 'package:hmg_patient_app_new/generated/locale_keys.g.dart';
|
||||
import 'package:hmg_patient_app_new/theme/colors.dart';
|
||||
import 'package:hmg_patient_app_new/widgets/appbar/collapsing_list_view.dart';
|
||||
import 'package:hmg_patient_app_new/widgets/expandable_list_widget.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import '../../features/lab/models/resp_models/ai_overview_labresults_by_ai_model.dart';
|
||||
|
||||
class LabAiAnalysisDetailedPage extends StatefulWidget {
|
||||
const LabAiAnalysisDetailedPage({super.key});
|
||||
|
||||
@override
|
||||
State<LabAiAnalysisDetailedPage> createState() => _LabAiAnalysisDetailedPageState();
|
||||
}
|
||||
|
||||
class _LabAiAnalysisDetailedPageState extends State<LabAiAnalysisDetailedPage> {
|
||||
late LabViewModel labProvider;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
labProvider = Provider.of<LabViewModel>(context, listen: false);
|
||||
return CollapsingListView(
|
||||
title: LocaleKeys.aiAnalysis.tr(context: context),
|
||||
child: Consumer<LabViewModel>(
|
||||
builder: (context, model, child) {
|
||||
if (model.labOrdersResponseByAi == null || model.labOrdersResponseByAi?.analysis == null) {
|
||||
return Utils.getNoDataWidget(context);
|
||||
}
|
||||
|
||||
final analysis = model.labOrdersResponseByAi!.analysis!;
|
||||
List<ExpandableListItem> expandableItems = [];
|
||||
|
||||
// Summary Section
|
||||
if (analysis.summary != null && analysis.summary!.isNotEmpty) {
|
||||
expandableItems.add(
|
||||
ExpandableListItem(
|
||||
title: LocaleKeys.summary.tr(context: context).toText18(weight: FontWeight.w700, color: AppColors.blackColor),
|
||||
initiallyExpanded: true,
|
||||
children: [
|
||||
SizedBox(height: 10.h),
|
||||
Container(
|
||||
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 12.r, side: BorderSide(width: 1, color: Color(0xFF0B85F7))),
|
||||
padding: EdgeInsets.all(16.r),
|
||||
child: (analysis.summary ?? "").toText14(color: AppColors.textColorLight, height: 1.5, weight: FontWeight.w400),
|
||||
),
|
||||
SizedBox(height: 8.h),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
// AI Generated Attributes Section (Lab Test Results)
|
||||
if (analysis.aiGeneratedAttributes != null && analysis.aiGeneratedAttributes!.isNotEmpty) {
|
||||
expandableItems.add(
|
||||
ExpandableListItem(
|
||||
title: LocaleKeys.labResults.tr(context: context).toText18(weight: FontWeight.w700, color: AppColors.blackColor),
|
||||
children: [
|
||||
SizedBox(height: 10.h),
|
||||
...analysis.aiGeneratedAttributes!.map((attr) {
|
||||
return Column(
|
||||
children: [
|
||||
_buildCombinedLabCard(attr),
|
||||
SizedBox(height: 16.h),
|
||||
],
|
||||
);
|
||||
}).toList(),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
// AI Predictions Section
|
||||
if (analysis.aiPredictions != null && analysis.aiPredictions!.isNotEmpty) {
|
||||
expandableItems.add(
|
||||
ExpandableListItem(
|
||||
title: LocaleKeys.prediction.tr(context: context).toText18(weight: FontWeight.w700, color: AppColors.blackColor),
|
||||
children: [
|
||||
SizedBox(height: 10.h),
|
||||
Container(
|
||||
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 12.r, side: BorderSide(width: 1, color: Color(0xFFFFAF15))),
|
||||
padding: EdgeInsets.all(16.r),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: analysis.aiPredictions!.map((prediction) => _buildBulletItem(prediction)).toList(),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 8.h),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
// AI Recommendations Section
|
||||
if (analysis.aiRecommendations != null && analysis.aiRecommendations!.isNotEmpty) {
|
||||
expandableItems.add(
|
||||
ExpandableListItem(
|
||||
title: LocaleKeys.suggestions.tr(context: context).toText18(weight: FontWeight.w700, color: AppColors.blackColor),
|
||||
children: [
|
||||
SizedBox(height: 10.h),
|
||||
Container(
|
||||
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 12.r),
|
||||
padding: EdgeInsets.all(16.r),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: analysis.aiRecommendations!.asMap().entries.map((entry) {
|
||||
final rec = entry.value;
|
||||
final isLast = entry.key == analysis.aiRecommendations!.length - 1;
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
if (rec.priority != null) ...[
|
||||
Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: 8.w, vertical: 4.h),
|
||||
decoration: BoxDecoration(color: _getPriorityColor(rec.priority), borderRadius: BorderRadius.circular(4.r)),
|
||||
child: rec.priority!.toText12(fontWeight: FontWeight.w600, color: _getPriorityTextColor(rec.priority)),
|
||||
),
|
||||
SizedBox(height: 8.h),
|
||||
],
|
||||
(rec.recommendation ?? "").toText14(
|
||||
color: AppColors.textColorLight,
|
||||
height: 1.5,
|
||||
weight: FontWeight.w400,
|
||||
),
|
||||
if (!isLast) ...[
|
||||
SizedBox(height: 12.h),
|
||||
const Divider(color: AppColors.dividerColor, thickness: 1),
|
||||
SizedBox(height: 12.h),
|
||||
],
|
||||
],
|
||||
);
|
||||
}).toList(),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 8.h),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
// Risk Factors Section
|
||||
if (analysis.riskFactors != null && analysis.riskFactors!.isNotEmpty) {
|
||||
expandableItems.add(
|
||||
ExpandableListItem(
|
||||
title: LocaleKeys.riskFactors.tr(context: context).toText18(weight: FontWeight.w700, color: AppColors.blackColor),
|
||||
children: [
|
||||
SizedBox(height: 10.h),
|
||||
...analysis.riskFactors!.asMap().entries.map((entry) {
|
||||
final risk = entry.value;
|
||||
return Column(
|
||||
children: [
|
||||
Container(
|
||||
decoration: RoundedRectangleBorder()
|
||||
.toSmoothCornerDecoration(color: Color(0xFFFBCB6E).withOpacity(0.10), borderRadius: 12.r, side: BorderSide(width: 1, color: Color(0xFFFBCB6E).withOpacity(0.10))),
|
||||
padding: EdgeInsets.all(16.r),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Container(
|
||||
decoration: BoxDecoration(color: Color(0xFFFBCB6E).withAlpha(38), borderRadius: BorderRadius.circular(8)),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: (risk.risk ?? "").toText10(weight: FontWeight.w500, color: AppColors.blackColor),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
if (risk.risk != null && risk.risk!.isNotEmpty) ...[
|
||||
SizedBox(height: 4.h),
|
||||
Row(
|
||||
children: [
|
||||
Utils.buildSvgWithAssets(icon: AppAssets.guradIcon),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: (risk.factor ?? "").toText16(weight: FontWeight.w700, color: AppColors.blackColor),
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 4.h),
|
||||
(risk.description ?? "").toText14(
|
||||
color: AppColors.textColorLight,
|
||||
height: 1.5,
|
||||
weight: FontWeight.w400,
|
||||
),
|
||||
],
|
||||
if (risk.description != null && risk.description!.isNotEmpty) ...[
|
||||
SizedBox(height: 8.h),
|
||||
(risk.description ?? "").toText14(
|
||||
color: AppColors.textColorLight,
|
||||
height: 1.5,
|
||||
weight: FontWeight.w400,
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(height: 16.h),
|
||||
],
|
||||
);
|
||||
}).toList(),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
// Prevention Section
|
||||
if (analysis.prevention != null && analysis.prevention!.isNotEmpty) {
|
||||
expandableItems.add(
|
||||
ExpandableListItem(
|
||||
title: LocaleKeys.prevention.tr(context: context).toText18(weight: FontWeight.w700, color: AppColors.blackColor),
|
||||
children: [
|
||||
SizedBox(height: 10.h),
|
||||
Container(
|
||||
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 12.r, side: BorderSide(width: 1, color: Color(0xFF18C273))),
|
||||
padding: EdgeInsets.all(16.r),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: analysis.prevention!.map((prevention) => _buildBulletItem(prevention)).toList(),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 8.h),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
// // Suggested Doctors Section
|
||||
// if (analysis.suggestedDoctors != null && analysis.suggestedDoctors!.isNotEmpty) {
|
||||
// expandableItems.add(
|
||||
// ExpandableListItem(
|
||||
// title: "Suggested Doctors".toText18(weight: FontWeight.w700, color: AppColors.blackColor),
|
||||
// children: [
|
||||
// SizedBox(height: 10.h),
|
||||
// Container(
|
||||
// decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
|
||||
// color: AppColors.whiteColor,
|
||||
// borderRadius: 12.r,
|
||||
// side: BorderSide(width: 1, color: Color(0xFF3498DB)),
|
||||
// ),
|
||||
// padding: EdgeInsets.all(16.r),
|
||||
// child: Column(
|
||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
||||
// children: analysis.suggestedDoctors!.asMap().entries.map((entry) {
|
||||
// final doctor = entry.value;
|
||||
// final isLast = entry.key == analysis.suggestedDoctors!.length - 1;
|
||||
// return Column(
|
||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
||||
// children: [
|
||||
// Row(
|
||||
// children: [
|
||||
// Container(
|
||||
// width: 40.r,
|
||||
// height: 40.r,
|
||||
// decoration: BoxDecoration(
|
||||
// gradient: AppColors.aiLinearGradient,
|
||||
// shape: BoxShape.circle,
|
||||
// ),
|
||||
// child: Icon(
|
||||
// Icons.person,
|
||||
// color: Colors.white,
|
||||
// size: 24.r,
|
||||
// ),
|
||||
// ),
|
||||
// SizedBox(width: 12.w),
|
||||
// Expanded(
|
||||
// child: doctor.toString().toText14(
|
||||
// color: AppColors.textColorLight,
|
||||
// height: 1.5,
|
||||
// weight: FontWeight.w600,
|
||||
// ),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// if (!isLast) ...[
|
||||
// SizedBox(height: 12.h),
|
||||
// const Divider(color: AppColors.dividerColor, thickness: 1),
|
||||
// SizedBox(height: 12.h),
|
||||
// ],
|
||||
// ],
|
||||
// );
|
||||
// }).toList(),
|
||||
// ),
|
||||
// ),
|
||||
// SizedBox(height: 8.h),
|
||||
// ],
|
||||
// ),
|
||||
// );
|
||||
// }
|
||||
|
||||
return Column(
|
||||
children: [
|
||||
if (expandableItems.isEmpty)
|
||||
Utils.getNoDataWidget(context)
|
||||
else
|
||||
CustomExpandableList(
|
||||
expansionMode: ExpansionMode.exactlyOne,
|
||||
dividerColor: Color(0xff2b353e1a),
|
||||
itemPadding: EdgeInsets.symmetric(vertical: 16.h, horizontal: 14.h),
|
||||
items: expandableItems,
|
||||
theme: ExpandableListTheme.custom(
|
||||
defaultTrailingIcon: Utils.buildSvgWithAssets(icon: AppAssets.arrow_down, height: 22.h, width: 22.w, iconColor: AppColors.textColor),
|
||||
),
|
||||
).paddingSymmetrical(16.w, 0.0),
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Color _getPriorityColor(String? priority) {
|
||||
if (priority == null) return AppColors.primaryRedColor;
|
||||
switch (priority.toLowerCase()) {
|
||||
case 'high':
|
||||
return Color(0xFFED1C2B).withOpacity(.10);
|
||||
case 'medium' || 'moderate':
|
||||
return AppColors.lightGreenButtonColor;
|
||||
case 'low':
|
||||
return AppColors.warningColorYellow.withOpacity(.3);
|
||||
default:
|
||||
return AppColors.primaryRedColor;
|
||||
}
|
||||
}
|
||||
|
||||
Color _getPriorityTextColor(String? priority) {
|
||||
if (priority == null) return AppColors.whiteColor;
|
||||
switch (priority.toLowerCase()) {
|
||||
case 'high':
|
||||
return AppColors.primaryRedColor;
|
||||
case 'medium' || 'moderate':
|
||||
return AppColors.lightGreenColor;
|
||||
case 'low':
|
||||
return AppColors.alertColor;
|
||||
default:
|
||||
return AppColors.primaryRedColor;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Color _getResultFlagColor(String? flag) {
|
||||
if (flag == null || flag.isEmpty) return Colors.grey;
|
||||
switch (flag.toUpperCase()) {
|
||||
case 'H': // High
|
||||
case 'HH': // Very High
|
||||
case 'CRITICAL HIGH':
|
||||
return AppColors.lightRedButtonColor;
|
||||
case 'L': // Low
|
||||
case 'LL': // Very Low
|
||||
case 'CRITICAL LOW':
|
||||
return AppColors.chipColorSeekMedicalAdvice;
|
||||
case 'N': // Normal
|
||||
return AppColors.lightGreenButtonColor;
|
||||
case 'A': // Abnormal
|
||||
return Colors.deepOrange;
|
||||
default:
|
||||
return AppColors.greyLightColor;
|
||||
}
|
||||
}
|
||||
|
||||
Color _getResultTextColor(String? priority) {
|
||||
if (priority == null) return AppColors.whiteColor;
|
||||
switch (priority.toUpperCase()) {
|
||||
case 'H': // High
|
||||
case 'HH': // Very High
|
||||
case 'CRITICAL HIGH':
|
||||
return AppColors.primaryRedColor;
|
||||
case 'N':
|
||||
return AppColors.lightGreenColor;
|
||||
case 'L': // Low
|
||||
case 'LL': // Very Low
|
||||
case 'CRITICAL LOW':
|
||||
return AppColors.chipTextColorSeekMedicalAdvice;
|
||||
default:
|
||||
return AppColors.textColor;
|
||||
}
|
||||
}
|
||||
|
||||
Widget _buildBulletItem(String text) {
|
||||
return Padding(
|
||||
padding: EdgeInsets.only(bottom: 12.h),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Expanded(
|
||||
child: text.toText14(color: AppColors.textColorLight, height: 1.5, weight: FontWeight.w400),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildCombinedLabCard(AiGeneratedAttribute attr) {
|
||||
return Container(
|
||||
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 24.h, hasShadow: true),
|
||||
padding: EdgeInsets.all(16.h),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
spacing: 2.h,
|
||||
children: [
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
if (attr.calculatedResultFlag != null && attr.calculatedResultFlag!.isNotEmpty && attr.calculatedResultFlag == "-") ...[
|
||||
Row(
|
||||
children: [
|
||||
Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: 8.w, vertical: 4.h),
|
||||
decoration: BoxDecoration(color: AppColors.greyLightColor, borderRadius: BorderRadius.circular(4.r)),
|
||||
child: Row(
|
||||
children: [
|
||||
Utils.buildSvgWithAssets(icon: AppAssets.informationIcon, width: 14.w, height: 14.h),
|
||||
SizedBox(width: 4.w),
|
||||
LocaleKeys.contextDependent.tr().toText12(fontWeight: FontWeight.w600, color: AppColors.textColor),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
] else ...[
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: 8.w, vertical: 4.h),
|
||||
decoration: BoxDecoration(color: _getResultFlagColor(attr.calculatedResultFlag), borderRadius: BorderRadius.circular(4.r)),
|
||||
child: Row(
|
||||
children: [
|
||||
(attr.calculatedResultFlag ?? "").toText12(fontWeight: FontWeight.w600, color: _getResultTextColor(attr.calculatedResultFlag)),
|
||||
],
|
||||
),
|
||||
),
|
||||
if (attr.calculatedResultFlag != null && attr.calculatedResultFlag!.isNotEmpty && attr.calculatedResultFlag == "H")
|
||||
Utils.buildSvgWithAssets(icon: AppAssets.highCautionIcon, iconColor: AppColors.primaryRedColor, width: 24.w, height: 24.h),
|
||||
],
|
||||
),
|
||||
],
|
||||
SizedBox(height: 4.h),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Expanded(child: (attr.description ?? "").toText16(isBold: true, color: _getResultTextColor(attr.calculatedResultFlag))),
|
||||
|
||||
// if (attr.calculatedResultFlag != null && attr.calculatedResultFlag!.isNotEmpty)
|
||||
// Column(
|
||||
// spacing: 2.h,
|
||||
// children: [
|
||||
// Consumer<LabViewModel>(
|
||||
// builder: (context, labViewModel, child) {
|
||||
// return labViewModel.getSeverityText(attr.calculatedResultFlag ?? "").tr(context: context).toText10(weight: FontWeight.w500, color: AppColors.greyTextColor);
|
||||
// },
|
||||
// ),
|
||||
// Consumer<LabViewModel>(
|
||||
// builder: (context, labViewModel, child) {
|
||||
// return Utils.buildSvgWithAssets(
|
||||
// icon: AppAssets.lab_result_indicator,
|
||||
// width: 21,
|
||||
// height: 23,
|
||||
// iconColor: labViewModel.getColor(attr.calculatedResultFlag ?? ""),
|
||||
// );
|
||||
// },
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 4.h),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Expanded(child: (attr.testShortDescription ?? "").toText12(color: AppColors.textColor)),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 4.h)
|
||||
],
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: 8.w, vertical: 4.h),
|
||||
decoration: BoxDecoration(color: _getResultFlagColor(attr.calculatedResultFlag), borderRadius: BorderRadius.circular(4.r)),
|
||||
child: ("${LocaleKeys.calculatedValue.tr()}: ${attr.resultValue!}").toText12(fontWeight: FontWeight.w600, color: _getResultTextColor(attr.calculatedResultFlag)),
|
||||
),
|
||||
SizedBox(width: 8.h),
|
||||
Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: 8.w, vertical: 4.h),
|
||||
decoration: BoxDecoration(color: AppColors.greyLightColor, borderRadius: BorderRadius.circular(4.r)),
|
||||
child: ("${LocaleKeys.unit.tr()}: ${attr.uom!}").toText12(fontWeight: FontWeight.w600, color: AppColors.textColor),
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 4.h,
|
||||
),
|
||||
if (attr.referanceRange != null && attr.referanceRange!.isNotEmpty)
|
||||
Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: 8.w, vertical: 4.h),
|
||||
decoration: BoxDecoration(color: AppColors.greyLightColor, borderRadius: BorderRadius.circular(4.r)),
|
||||
child: ("${LocaleKeys.referenceRange.tr(context: context)}: ${attr.referanceRange!.trim()}").toText12(fontWeight: FontWeight.w600, color: AppColors.textColor),
|
||||
),
|
||||
if (attr.calculationFormula != null && attr.calculationFormula!.isNotEmpty) ...[
|
||||
SizedBox(height: 8.h),
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Utils.buildSvgWithAssets(icon: AppAssets.calendar, iconColor: Colors.grey),
|
||||
SizedBox(width: 8.w),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
LocaleKeys.calculationFormula.tr().toText16(weight: FontWeight.w600),
|
||||
(attr.calculationFormula ?? "").toText12(fontWeight: FontWeight.w500, color: AppColors.textColorLight),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue