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
5446ed83
Commit
5446ed83
authored
Aug 25, 2024
by
Almouhannad
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(F) add send to doctor
parent
71900f50
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
62 additions
and
12 deletions
+62
-12
doctor-item.component.html
...nents/receptionist/doctor-item/doctor-item.component.html
+1
-1
waiting-list-item.component.html
...ionist/waiting-list-item/waiting-list-item.component.html
+2
-2
waiting-list-item.component.ts
...ptionist/waiting-list-item/waiting-list-item.component.ts
+27
-9
doctors.service.ts
Clinics.Frontend/src/app/services/doctors/doctors.service.ts
+13
-0
waiting-list.service.ts
...tend/src/app/services/waitingList/waiting-list.service.ts
+19
-0
No files found.
Clinics.Frontend/src/app/components/receptionist/doctor-item/doctor-item.component.html
View file @
5446ed83
...
...
@@ -11,7 +11,7 @@
<!-- #region Name-->
<div
class=
"custom-user-full-name"
>
<h3
style=
"border:none;"
>
{{doctor.fullName}}
</h3>
<h3
style=
"border:none;"
>
د.
{{doctor.fullName}}
</h3>
</div>
<!-- #endregion -->
...
...
Clinics.Frontend/src/app/components/receptionist/waiting-list-item/waiting-list-item.component.html
View file @
5446ed83
...
...
@@ -31,7 +31,7 @@
<div
class=
"d-grid gap-3 custom-edit-button"
>
<a>
<button
class=
"btn btn-outline-secondary"
style=
"width: 100%;"
(
click
)="
openModal
(
SendToDoctorModal
)"
>
(
click
)="
o
nClickSend
();
o
penModal
(
SendToDoctorModal
)"
>
إرسال إلى طبيب
<i
class=
"fas fa-arrow-left"
></i>
</button>
</a>
...
...
@@ -88,7 +88,7 @@
<select
class=
"text-center mb-3 form-control"
[(
ngModel
)]="
selectedDoctorId
"
>
<option
value=
"-1"
disabled
>
يرجى اختيار الطبيب
</option>
<option
*
ngFor=
"let doctor of doctors"
[
ngValue
]="
doctor
.
id
"
>
{{doctor.name}}
</option>
<option
*
ngFor=
"let doctor of doctors"
[
ngValue
]="
doctor
.
id
"
>
د.
{{doctor.name}}
</option>
</select>
</div>
...
...
Clinics.Frontend/src/app/components/receptionist/waiting-list-item/waiting-list-item.component.ts
View file @
5446ed83
...
...
@@ -3,6 +3,7 @@ import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
import
{
WaitingListRecord
}
from
'../../../classes/waitingList/waiting-list-record'
;
import
{
WaitingListService
}
from
'../../../services/waitingList/waiting-list.service'
;
import
{
ToastrService
}
from
'ngx-toastr'
;
import
{
DoctorsService
}
from
'../../../services/doctors/doctors.service'
;
@
Component
({
selector
:
'app-waiting-list-item'
,
...
...
@@ -13,7 +14,8 @@ export class WaitingListItemComponent {
constructor
(
private
modalService
:
NgbModal
,
private
waitingListService
:
WaitingListService
,
private
toastrService
:
ToastrService
private
toastrService
:
ToastrService
,
private
doctorsService
:
DoctorsService
)
{}
@
Input
(
"model"
)
model
:
WaitingListRecord
=
new
WaitingListRecord
(
0
,
0
,
''
,
true
,
new
Date
(
Date
.
now
()));
...
...
@@ -49,15 +51,31 @@ export class WaitingListItemComponent {
})
}
selectedDoctorId
:
number
=
-
1
;
doctors
:
{
id
:
number
,
name
:
string
}[]
=
[
{
id
:
1
,
name
:
'A'
},
{
id
:
2
,
name
:
'B'
},
{
id
:
3
,
name
:
'C'
},
{
id
:
4
,
name
:
'D'
},
{
id
:
5
,
name
:
'E'
},
]
doctors
:
{
id
:
number
,
name
:
string
}[]
=
[]
onClickSend
():
void
{
this
.
doctorsService
.
getAvailable
()
.
subscribe
(
result
=>
{
if
(
result
===
null
)
{
this
.
toastrService
.
error
(
'حدثت مشكلة، يرجى إعادة المحاولة'
);
}
else
{
this
.
doctors
=
result
;
}
})
}
onSendToDoctor
():
void
{
console
.
log
(
this
.
selectedDoctorId
);
this
.
waitingListService
.
SendToDoctor
(
this
.
model
.
id
,
this
.
model
.
patientId
,
this
.
selectedDoctorId
)
.
subscribe
(
result
=>
{
if
(
result
.
status
===
true
)
{
this
.
toastrService
.
success
(
'تم الإرسال بنجاح ✔'
);
this
.
deleted
.
emit
();
}
else
{
this
.
toastrService
.
error
(
'حدثت مشكلة، يرجى اعادة المحاولة'
);
}
})
}
}
Clinics.Frontend/src/app/services/doctors/doctors.service.ts
View file @
5446ed83
...
...
@@ -25,4 +25,17 @@ export class DoctorsService {
})
)
}
getAvailable
():
Observable
<
{
id
:
number
,
name
:
string
}[]
|
null
>
{
return
this
.
http
.
get
<
{
availableDoctors
:
{
id
:
number
,
name
:
string
}[]
}
>
(
`
${
this
.
DOCTORS_ENDPOINT
}
/Available`
)
.
pipe
(
map
((
result
)
=>
{
return
result
.
availableDoctors
;
}),
catchError
((
error
:
HttpErrorResponse
)
=>
{
console
.
error
(
error
.
error
.
detail
);
return
of
(
null
);
})
);
}
}
Clinics.Frontend/src/app/services/waitingList/waiting-list.service.ts
View file @
5446ed83
...
...
@@ -51,4 +51,23 @@ export class WaitingListService {
);
}
public
SendToDoctor
(
waitingListRecordId
:
number
,
patientId
:
number
,
doctorId
:
number
)
:
Observable
<
{
status
:
boolean
,
errorMessage
:
string
|
null
}
>
{
var
body
:
any
=
{
waitingListRecordId
:
waitingListRecordId
,
patientId
:
patientId
,
doctorId
:
doctorId
}
return
this
.
http
.
post
(
`
${
this
.
WAITINGLIST_ENDPOINT
}
/SendToDoctor`
,
body
)
.
pipe
(
map
(
_
=>
{
return
{
status
:
true
,
errorMessage
:
null
};
}),
catchError
((
error
:
HttpErrorResponse
)
=>
{
console
.
error
(
error
.
error
.
detail
);
return
of
({
status
:
false
,
errorMessage
:
error
.
error
.
detail
})
})
);
}
}
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