Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
H
HIAST-Clinics
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
almohanad.hafez
HIAST-Clinics
Commits
a6b2cfad
Commit
a6b2cfad
authored
Aug 27, 2024
by
Almouhannad
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(F) Change srarch to medicine behavior
parent
beead90c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
55 additions
and
25 deletions
+55
-25
create-visit.component.ts
.../components/doctor/create-visit/create-visit.component.ts
+29
-17
search-for-medicine.component.css
...tor/search-for-medicine/search-for-medicine.component.css
+20
-5
search-for-medicine.component.html
...or/search-for-medicine/search-for-medicine.component.html
+5
-2
search-for-medicine.component.ts
...ctor/search-for-medicine/search-for-medicine.component.ts
+1
-1
No files found.
Clinics.Frontend/src/app/components/doctor/create-visit/create-visit.component.ts
View file @
a6b2cfad
...
@@ -71,29 +71,41 @@ export class CreateVisitComponent implements OnInit {
...
@@ -71,29 +71,41 @@ export class CreateVisitComponent implements OnInit {
diagnosis
:
string
;
diagnosis
:
string
;
medicines
:
VisitMedicine
[]
=
[];
medicines
:
VisitMedicine
[]
=
[];
onAddMedicine
(
visitMedicine
:
VisitMedicine
){
onAddMedicine
(
visitMedicine
:
VisitMedicine
)
{
this
.
medicines
.
push
(
visitMedicine
);
const
existingMedicine
=
this
.
medicines
.
find
(
medicine
=>
medicine
.
id
===
visitMedicine
.
id
);
if
(
!
existingMedicine
)
{
this
.
medicines
.
push
(
visitMedicine
);
}
else
{
this
.
toastr
.
error
(
'هذا الدواء موجود بالفعل'
);
}
}
}
onDeleteMedicine
(
index
:
number
)
{
onDeleteMedicine
(
index
:
number
)
{
this
.
medicines
.
splice
(
index
,
1
);
this
.
medicines
.
splice
(
index
,
1
);
}
}
onSubmit
():
void
{
onSubmit
():
void
{
var
userId
=
this
.
authenticationService
.
getUserData
()
!
.
id
;
if
(
this
.
medicines
.
length
!==
0
)
{
this
.
visitsService
.
create
(
userId
,
var
userId
=
this
.
authenticationService
.
getUserData
()
!
.
id
;
this
.
employeeId
,
this
.
diagnosis
,
this
.
medicines
)
this
.
visitsService
.
create
(
userId
,
.
subscribe
(
result
=>
{
this
.
employeeId
,
this
.
diagnosis
,
this
.
medicines
)
if
(
result
.
status
===
false
)
{
.
subscribe
(
result
=>
{
this
.
toastr
.
error
(
"حدثت مشكلة، يرجى إعادة المحاولة"
);
if
(
result
.
status
===
false
)
{
this
.
router
.
navigateByUrl
(
'doctor/waitinglist'
);
this
.
toastr
.
error
(
"حدثت مشكلة، يرجى إعادة المحاولة"
);
}
this
.
router
.
navigateByUrl
(
'doctor/waitinglist'
);
else
{
}
this
.
doctorsService
.
changeStatusByUserId
(
userId
,
'متاح'
)
else
{
.
subscribe
(
_
=>
{});
this
.
doctorsService
.
changeStatusByUserId
(
userId
,
'متاح'
)
this
.
toastr
.
success
(
'تم تسجيل الزيارة بنجاح ✔'
);
.
subscribe
(
_
=>
{});
this
.
router
.
navigateByUrl
(
`doctor/history/
${
this
.
employeeId
}
`
);
this
.
toastr
.
success
(
'تم تسجيل الزيارة بنجاح ✔'
);
}
this
.
router
.
navigateByUrl
(
`doctor/history/
${
this
.
employeeId
}
`
);
})
}
})
}
else
{
this
.
toastr
.
error
(
"يرجى إضافة أدوية"
);
}
}
}
}
}
Clinics.Frontend/src/app/components/doctor/search-for-medicine/search-for-medicine.component.css
View file @
a6b2cfad
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
.custom-field
.custom-input
:focus
{
.custom-field
.custom-input
:focus
{
box-shadow
:
0
0
0
0.1em
var
(
--heading-color
);
box-shadow
:
0
0
0
0.1em
var
(
--heading-color
);
}
}
.custom-no-button
{
.custom-no-button
{
...
@@ -27,7 +27,7 @@
...
@@ -27,7 +27,7 @@
margin
:
auto
;
margin
:
auto
;
}
}
.custom-medicine-button
.btn
{
.custom-medicine-button
.btn
{
width
:
100%
;
width
:
100%
;
font-weight
:
700
;
font-weight
:
700
;
margin
:
auto
;
margin
:
auto
;
...
@@ -36,7 +36,7 @@
...
@@ -36,7 +36,7 @@
background-color
:
white
;
background-color
:
white
;
}
}
.custom-medicine-button
.btn
:hover
{
.custom-medicine-button
.btn
:hover
{
margin
:
auto
;
margin
:
auto
;
color
:
white
;
color
:
white
;
border-color
:
var
(
--heading-color
);
border-color
:
var
(
--heading-color
);
...
@@ -44,7 +44,7 @@
...
@@ -44,7 +44,7 @@
}
}
.custom-selected-button
.btn
{
.custom-selected-button
.btn
{
width
:
100%
;
width
:
100%
;
font-weight
:
700
;
font-weight
:
700
;
margin
:
auto
;
margin
:
auto
;
...
@@ -53,9 +53,24 @@
...
@@ -53,9 +53,24 @@
background-color
:
white
;
background-color
:
white
;
}
}
.custom-selected-button
.btn
:hover
{
.custom-selected-button
.btn
:hover
{
margin
:
auto
;
margin
:
auto
;
color
:
white
;
color
:
white
;
border-color
:
var
(
--accent-color
);
border-color
:
var
(
--accent-color
);
background-color
:
var
(
--accent-color
);
background-color
:
var
(
--accent-color
);
}
}
.custom-medicine-button
{
animation
:
fade-in
0.5s
;
}
@keyframes
fade-in
{
from
{
opacity
:
0
;
}
to
{
opacity
:
1
;
}
}
\ No newline at end of file
Clinics.Frontend/src/app/components/doctor/search-for-medicine/search-for-medicine.component.html
View file @
a6b2cfad
...
@@ -31,12 +31,15 @@
...
@@ -31,12 +31,15 @@
<div
*
ngIf=
"isSelected"
>
<div
*
ngIf=
"isSelected"
>
<div
class=
"custom-field"
>
<div
class=
"custom-field"
>
<input
class=
"form-control custom-input"
type=
"number"
placeholder=
"يرجى ادخال الكمية"
dir=
"ltr"
<input
class=
"form-control custom-input"
type=
"number"
placeholder=
"يرجى ادخال الكمية"
dir=
"ltr"
[(
ngModel
)]="
number
"
>
min=
"1"
[(
ngModel
)]="
number
"
#
numberField=
"ngModel"
>
<p
*
ngIf=
"numberField.errors && numberField.errors['min']"
class=
"text-danger text-center"
style=
"font-weight: 800;"
>
يرجى ادخال قيمة صالحة
</p>
</div>
</div>
<div
class=
"custom-ok-button mt-3"
style=
"width:100%"
>
<div
class=
"custom-ok-button mt-3"
style=
"width:100%"
>
<button
class=
"btn btn-outline-primary"
(
click
)="
onSave
();
parentModal
.
dismiss
()"
<button
class=
"btn btn-outline-primary"
(
click
)="
onSave
();
parentModal
.
dismiss
()"
[
disabled
]="
number =
==
null
"
>
حفظ
</button>
[
disabled
]="
number =
==
null
||
number
!
<=
0
"
>
حفظ
</button>
</div>
</div>
</div>
</div>
...
...
Clinics.Frontend/src/app/components/doctor/search-for-medicine/search-for-medicine.component.ts
View file @
a6b2cfad
...
@@ -22,7 +22,7 @@ export class SearchForMedicineComponent implements OnInit {
...
@@ -22,7 +22,7 @@ export class SearchForMedicineComponent implements OnInit {
// Listen to input changes with delay
// Listen to input changes with delay
this
.
prefix
.
valueChanges
.
pipe
(
this
.
prefix
.
valueChanges
.
pipe
(
debounceTime
(
10
00
),
debounceTime
(
5
00
),
distinctUntilChanged
(),
distinctUntilChanged
(),
filter
(
value
=>
value
.
trim
().
length
>=
2
),
// igonre less than 2 letters
filter
(
value
=>
value
.
trim
().
length
>=
2
),
// igonre less than 2 letters
switchMap
(
value
=>
this
.
medicinesService
.
getAll
(
value
))
switchMap
(
value
=>
this
.
medicinesService
.
getAll
(
value
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment