Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Get_Patient_plan_schedule_By_PATIENT_PLAN_ID_Subscription = new Subscription();
- data_params: Params_Get_Patient_plan_schedule_By_PATIENT_PLAN_ID = new Params_Get_Patient_plan_schedule_By_PATIENT_PLAN_ID();
- this.entry.My_Patient_plan_schedules = [];
- this.data_params.PATIENT_PLAN_ID=this.entry.PATIENT_PLAN_ID;
- fetchData(){
- this.entry.My_Patient_plan_schedules = [];
- this.data_params.PATIENT_PLAN_ID=this.entry.PATIENT_PLAN_ID;
- this.Get_Patient_plan_schedule_By_PATIENT_PLAN_ID_Subscription=this.proxy.Get_Patient_plan_schedule_By_PATIENT_PLAN_ID(this.data_params)
- .subscribe(result => {
- if (result != null) {
- result.forEach((element: any) => {
- this.entry.My_Patient_plan_schedules.push(element);
- });
- }
- })
- }
- Add_Patient_plan_schedule(entry) {
- if (entry.My_Patient_plan_schedules == null) {
- entry.My_Patient_plan_schedules = [];
- }
- if (entry.My_Patient_plan_schedules.filter(e => e.PATIENT_PLAN_SCHEDULE_ID === -1).length > 0) {
- return;
- }
- const child = new Patient_plan_schedule();
- child.PATIENT_PLAN_SCHEDULE_ID = -1;
- child.PATIENT_PLAN_ID = entry.PATIENT_PLAN_ID;
- entry.My_Patient_plan_schedules.unshift(child);
- }
- Edit_Patient_plan_schedule(entry: Patient_plan, Patient_plan_schedule: Patient_plan_schedule) {
- this.proxy.Edit_Patient_plan_schedule(Patient_plan_schedule).subscribe((result) => {
- if (result != null) {
- this.CmSvc.ShowMessage('Done');
- entry.My_Patient_plan_schedules.splice(entry.My_Patient_plan_schedules.indexOf(Patient_plan_schedule), 1);
- const newEntry: any = result;
- entry.My_Patient_plan_schedules.unshift(newEntry);
- }
- });
- }
- Delete_Patient_plan_schedule(entry: Patient_plan, Patient_plan_schedule: Patient_plan_schedule) {
- const dialogRef = this.dialog.open(DeleteConfirmationComponent);
- dialogRef.afterClosed().subscribe(response => {
- if (response) {
- const _params_Delete_Patient_plan_schedule = new Params_Delete_Patient_plan_schedule();
- _params_Delete_Patient_plan_schedule.PATIENT_PLAN_SCHEDULE_ID = Patient_plan_schedule.PATIENT_PLAN_SCHEDULE_ID;
- this.proxy.Delete_Patient_plan_schedule(_params_Delete_Patient_plan_schedule).subscribe(data => {
- if (data === "") {
- entry.My_Patient_plan_schedules.splice(entry.My_Patient_plan_schedules.indexOf(Patient_plan_schedule), 1);
- }
- });
- }
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement