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
Show 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 @@
...
@@ -11,7 +11,7 @@
<!-- #region Name-->
<!-- #region Name-->
<div
class=
"custom-user-full-name"
>
<div
class=
"custom-user-full-name"
>
<h3
style=
"border:none;"
>
{{doctor.fullName}}
</h3>
<h3
style=
"border:none;"
>
د.
{{doctor.fullName}}
</h3>
</div>
</div>
<!-- #endregion -->
<!-- #endregion -->
...
...
Clinics.Frontend/src/app/components/receptionist/waiting-list-item/waiting-list-item.component.html
View file @
5446ed83
...
@@ -31,7 +31,7 @@
...
@@ -31,7 +31,7 @@
<div
class=
"d-grid gap-3 custom-edit-button"
>
<div
class=
"d-grid gap-3 custom-edit-button"
>
<a>
<a>
<button
class=
"btn btn-outline-secondary"
style=
"width: 100%;"
<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>
إرسال إلى طبيب
<i
class=
"fas fa-arrow-left"
></i>
</button>
</button>
</a>
</a>
...
@@ -88,7 +88,7 @@
...
@@ -88,7 +88,7 @@
<select
class=
"text-center mb-3 form-control"
<select
class=
"text-center mb-3 form-control"
[(
ngModel
)]="
selectedDoctorId
"
>
[(
ngModel
)]="
selectedDoctorId
"
>
<option
value=
"-1"
disabled
>
يرجى اختيار الطبيب
</option>
<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>
</select>
</div>
</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';
...
@@ -3,6 +3,7 @@ import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
import
{
WaitingListRecord
}
from
'../../../classes/waitingList/waiting-list-record'
;
import
{
WaitingListRecord
}
from
'../../../classes/waitingList/waiting-list-record'
;
import
{
WaitingListService
}
from
'../../../services/waitingList/waiting-list.service'
;
import
{
WaitingListService
}
from
'../../../services/waitingList/waiting-list.service'
;
import
{
ToastrService
}
from
'ngx-toastr'
;
import
{
ToastrService
}
from
'ngx-toastr'
;
import
{
DoctorsService
}
from
'../../../services/doctors/doctors.service'
;
@
Component
({
@
Component
({
selector
:
'app-waiting-list-item'
,
selector
:
'app-waiting-list-item'
,
...
@@ -13,7 +14,8 @@ export class WaitingListItemComponent {
...
@@ -13,7 +14,8 @@ export class WaitingListItemComponent {
constructor
(
private
modalService
:
NgbModal
,
constructor
(
private
modalService
:
NgbModal
,
private
waitingListService
:
WaitingListService
,
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
()));
@
Input
(
"model"
)
model
:
WaitingListRecord
=
new
WaitingListRecord
(
0
,
0
,
''
,
true
,
new
Date
(
Date
.
now
()));
...
@@ -49,15 +51,31 @@ export class WaitingListItemComponent {
...
@@ -49,15 +51,31 @@ export class WaitingListItemComponent {
})
})
}
}
selectedDoctorId
:
number
=
-
1
;
selectedDoctorId
:
number
=
-
1
;
doctors
:
{
id
:
number
,
name
:
string
}[]
=
[
doctors
:
{
id
:
number
,
name
:
string
}[]
=
[]
{
id
:
1
,
name
:
'A'
},
onClickSend
():
void
{
{
id
:
2
,
name
:
'B'
},
this
.
doctorsService
.
getAvailable
()
{
id
:
3
,
name
:
'C'
},
.
subscribe
(
result
=>
{
{
id
:
4
,
name
:
'D'
},
if
(
result
===
null
)
{
{
id
:
5
,
name
:
'E'
},
this
.
toastrService
.
error
(
'حدثت مشكلة، يرجى إعادة المحاولة'
);
]
}
else
{
this
.
doctors
=
result
;
}
})
}
onSendToDoctor
():
void
{
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 {
...
@@ -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 {
...
@@ -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