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
Show 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,14 +71,21 @@ export class CreateVisitComponent implements OnInit {
diagnosis
:
string
;
medicines
:
VisitMedicine
[]
=
[];
onAddMedicine
(
visitMedicine
:
VisitMedicine
){
onAddMedicine
(
visitMedicine
:
VisitMedicine
)
{
const
existingMedicine
=
this
.
medicines
.
find
(
medicine
=>
medicine
.
id
===
visitMedicine
.
id
);
if
(
!
existingMedicine
)
{
this
.
medicines
.
push
(
visitMedicine
);
}
else
{
this
.
toastr
.
error
(
'هذا الدواء موجود بالفعل'
);
}
}
onDeleteMedicine
(
index
:
number
)
{
this
.
medicines
.
splice
(
index
,
1
);
}
onSubmit
():
void
{
if
(
this
.
medicines
.
length
!==
0
)
{
var
userId
=
this
.
authenticationService
.
getUserData
()
!
.
id
;
this
.
visitsService
.
create
(
userId
,
this
.
employeeId
,
this
.
diagnosis
,
this
.
medicines
)
...
...
@@ -94,6 +101,11 @@ export class CreateVisitComponent implements OnInit {
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 @@
.custom-field
.custom-input
:focus
{
box-shadow
:
0
0
0
0.1em
var
(
--heading-color
);
}
}
.custom-no-button
{
...
...
@@ -27,7 +27,7 @@
margin
:
auto
;
}
.custom-medicine-button
.btn
{
.custom-medicine-button
.btn
{
width
:
100%
;
font-weight
:
700
;
margin
:
auto
;
...
...
@@ -36,7 +36,7 @@
background-color
:
white
;
}
.custom-medicine-button
.btn
:hover
{
.custom-medicine-button
.btn
:hover
{
margin
:
auto
;
color
:
white
;
border-color
:
var
(
--heading-color
);
...
...
@@ -44,7 +44,7 @@
}
.custom-selected-button
.btn
{
.custom-selected-button
.btn
{
width
:
100%
;
font-weight
:
700
;
margin
:
auto
;
...
...
@@ -53,9 +53,24 @@
background-color
:
white
;
}
.custom-selected-button
.btn
:hover
{
.custom-selected-button
.btn
:hover
{
margin
:
auto
;
color
:
white
;
border-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 @@
<div
*
ngIf=
"isSelected"
>
<div
class=
"custom-field"
>
<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
class=
"custom-ok-button mt-3"
style=
"width:100%"
>
<button
class=
"btn btn-outline-primary"
(
click
)="
onSave
();
parentModal
.
dismiss
()"
[
disabled
]="
number =
==
null
"
>
حفظ
</button>
[
disabled
]="
number =
==
null
||
number
!
<=
0
"
>
حفظ
</button>
</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 {
// Listen to input changes with delay
this
.
prefix
.
valueChanges
.
pipe
(
debounceTime
(
10
00
),
debounceTime
(
5
00
),
distinctUntilChanged
(),
filter
(
value
=>
value
.
trim
().
length
>=
2
),
// igonre less than 2 letters
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