diff --git a/src/app/annual-health-checkup/add-dependants/add-dependants.component.html b/src/app/annual-health-checkup/add-dependants/add-dependants.component.html
index 16c3248c..cee063e7 100644
--- a/src/app/annual-health-checkup/add-dependants/add-dependants.component.html
+++ b/src/app/annual-health-checkup/add-dependants/add-dependants.component.html
@@ -1,4 +1,5 @@
+
+
Annual Health Check-up 2021-22
+
The rates of optional tests across empanelled hospitals in Pune are as follows:
+
+
+
+ Hospital Name |
+ HIV-I & HIV-II by Tridot/ ELISA technique/HIV Rapid |
+ Hb1Ac |
+ Eye Check Package & Ophthalmologist consultation |
+ Treadmill Test |
+
+
+
+
+ Apollo Hospital |
+ Rs.500 |
+ Rs.500 |
+ Rs.300 |
+ Rs.1000 |
+
+
+ PCMC Hospital |
+ Rs.700 |
+ Rs.350 |
+ Rs.400 |
+ Rs.1000 |
+
+
+ Deenanath Mangesh Hospital |
+ Rs.405 |
+ Rs.405 |
+ Rs.360 |
+ Rs.1080 |
+
+
+ Express Clinics |
+ Rs.350 |
+ Rs.350 |
+ Rs.450 |
+ Rs.1000 |
+
+
+ Ruby Hall Clinic |
+ Rs.595 |
+ Rs.808 |
+ Rs.600 |
+ Rs.1530 |
+
+
+
\ No newline at end of file
diff --git a/src/app/annual-health-checkup/schedule-appointment/schedule-appointment.component.ts b/src/app/annual-health-checkup/schedule-appointment/schedule-appointment.component.ts
index 32f78564..d575edc1 100644
--- a/src/app/annual-health-checkup/schedule-appointment/schedule-appointment.component.ts
+++ b/src/app/annual-health-checkup/schedule-appointment/schedule-appointment.component.ts
@@ -1,66 +1,137 @@
-import { Component, ElementRef, OnInit, ViewChild } from '@angular/core';
-import { FormBuilder, FormGroup, Validators } from '@angular/forms';
-import { Router } from '@angular/router';
-import { ADDITIONAL_TEST, ELIGIBLE_PACKAGE, SELECT_HOSPITAL } from 'src/constants/constants';
-import { RouterService } from '../../shared/services/routerService';
-
+import { THIS_EXPR } from "@angular/compiler/src/output/output_ast";
+import { Component, ElementRef, OnInit, ViewChild } from "@angular/core";
+import { FormBuilder, FormGroup, Validators } from "@angular/forms";
+import { Router } from "@angular/router";
+import {
+ SELECT_HOSPITAL,
+ SENIOR_LEVEL_PACKAGE,
+ MIDDLE_LEVEL_PACKAGE,
+ SENIOR_LEVEL_ADDITONAL_TEST,
+ MIDDLE_LEVEL_ADDITONAL_TEST,
+ SCHEDULE_APPOINTMENT,
+ ADD_DEPENDENTS,
+} from "src/constants/constants";
+import { jsPDF } from "jspdf";
+import * as pdfMake from "pdfmake/build/pdfmake";
+import { MatSelectChange } from "@angular/material/select";
+var pdfFonts = require("pdfmake/build/vfs_fonts.js");
+(pdfMake as any).vfs = pdfFonts.pdfMake.vfs;
+var htmlToPdfmake = require("html-to-pdfmake");
@Component({
- selector: 'app-schedule-appointment',
- templateUrl: './schedule-appointment.component.html',
- styleUrls: ['./schedule-appointment.component.scss']
+ selector: "app-schedule-appointment",
+ templateUrl: "./schedule-appointment.component.html",
+ styleUrls: ["./schedule-appointment.component.scss"],
})
export class ScheduleAppointmentComponent implements OnInit {
+ scheduleAppointmentForm!: FormGroup;
+ name = "Angular Html To Pdf ";
+ additionalTests: string[] = SENIOR_LEVEL_ADDITONAL_TEST;
+ hospitalList: any[] = SELECT_HOSPITAL;
+ todayDate: any = new Date();
+ downloadPDF: boolean = false;
+ level: string = "";
+ hospitalObject: any;
+ additionaltest: any;
+ interval: any;
- generateLetterForm!: FormGroup;
- name = 'Angular Html To Pdf ';
- additionalTests:string[] = ADDITIONAL_TEST;
- hospitalList:any[] = SELECT_HOSPITAL;
- eligiblePackage:string[] = ELIGIBLE_PACKAGE;
- todayDate:Date = new Date();
+ @ViewChild("pdfTable", { static: false }) pdfTable: ElementRef | undefined;
+ @ViewChild("scheduleAppointmentPDF")
+ scheduleAppointmentPDF!: ElementRef;
- @ViewChild('pdfTable', {static: false}) pdfTable: ElementRef | undefined;
- @ViewChild('content')
- content!: ElementRef;
-
- constructor(
- private formBuilder: FormBuilder,
- private router: Router
- ) {
- this.createNewForm();
- }
+ constructor(private formBuilder: FormBuilder, private router: Router) {}
ngOnInit(): void {
+ this.downloadPDF = false;
+ this.createNewForm();
+ let packageName = "";
+ this.level = this.scheduleAppointmentForm?.get("level")?.value;
+ packageName =
+ this.level === "L3" ? SENIOR_LEVEL_PACKAGE : MIDDLE_LEVEL_PACKAGE;
+ this.additionalTests =
+ this.level === "L3"
+ ? SENIOR_LEVEL_ADDITONAL_TEST
+ : MIDDLE_LEVEL_ADDITONAL_TEST;
+ this.scheduleAppointmentForm?.controls["eligiblePackage"].setValue(
+ packageName
+ );
+ this.todayDate.setDate(this.todayDate.getDate() + 1);
}
/**
* @description to create the new form on the initialization of the component.
* @returns Void();
*/
-
- createNewForm(): void {
- this.generateLetterForm = this.formBuilder.group({
- employeeId: [{value:"1234", disabled:true}],
- employeeName: [{value:"bajaj", disabled:true}],
- level: [{value:"L3", disabled:true}],
- designation: [{value:"developer", disabled:true}],
- department: [{value:"MIS", disabled:true}],
- location: [{value:"Akrudi", disabled:true}],
- additonalTest: [""],
- eligiblePackage: ["eligiblePackage"],
- hospitalName: ["hospitalName"],
- preferredDate: ['preferredDate'],
- contactNumber: ['9730370631'],
- date: ["22/02/2022"],
- gender: ["Male"]
+ createNewForm(): void {
+ this.scheduleAppointmentForm = this.formBuilder.group({
+ employeeId: [{ value: "1234", disabled: true }, Validators.required],
+ employeeName: [{ value: "bajaj", disabled: true }, Validators.required],
+ level: [{ value: "L3", disabled: true }, Validators.required],
+ designation: [
+ { value: "developer", disabled: true },
+ Validators.required,
+ ],
+ department: [{ value: "MIS", disabled: true }],
+ location: [{ value: "Akrudi", disabled: true }],
+ eligiblePackage: [{ value: "eligiblePackage", disabled: true }],
+ preferredDate: ["", Validators.required],
+ contactNumber: ["9730370631", Validators.required],
+ gender: ["Male"],
});
}
- createEnquirySubmitHandler(){
+ createEnquirySubmitHandler() {
+ let responseObject = {
+ employeeId: this.scheduleAppointmentForm?.get("employeeId")?.value,
+ employeeName: this.scheduleAppointmentForm?.get("employeeName")?.value,
+ level: this.level,
+ department: this.scheduleAppointmentForm?.get("department")?.value,
+ location: this.scheduleAppointmentForm?.get("location")?.value,
+ additonalTest: this.additionaltest,
+ eligiblePackage:
+ this.scheduleAppointmentForm?.get("eligiblePackage")?.value,
+ hospitalName: this.hospitalObject,
+ preferredDate: this.scheduleAppointmentForm?.get("preferredDate")?.value,
+ contactNumber: this.scheduleAppointmentForm?.get("contactNumber")?.value,
+ };
+ console.log(responseObject);
+ }
+ addDependants() {
+ console.log('click');
+ this.router.navigate([ADD_DEPENDENTS]);
}
- addDependants(){
- this.router.navigate(['addDependants']);
+ selectHospital(event: MatSelectChange) {
+ let selectedData;
+ selectedData = {
+ value: event.value,
+ text: event.source.triggerValue,
+ };
+ console.log(selectedData);
+ this.hospitalObject = selectedData.value;
}
-}
\ No newline at end of file
+ selectedAdditonalTest(event: MatSelectChange) {
+ let selectedData;
+ selectedData = {
+ value: event.value,
+ text: event.source.triggerValue,
+ };
+ this.additionaltest = selectedData.value;
+ }
+
+ downloadAppointment() {
+ this.downloadPDF = true;
+ this.interval = setInterval(() => {
+ const doc = new jsPDF();
+ //get table html
+ const pdfTable = this.scheduleAppointmentPDF?.nativeElement;
+ //html to pdf format
+ var html = htmlToPdfmake(pdfTable?.innerHTML);
+ const documentDefinition = { content: html };
+ pdfMake.createPdf(documentDefinition).download();
+ this.downloadPDF = false;
+ clearInterval(this.interval);
+ }, 1000);
+ }
+}
diff --git a/src/constants/constants.ts b/src/constants/constants.ts
index 88009bfd..e5a445a2 100644
--- a/src/constants/constants.ts
+++ b/src/constants/constants.ts
@@ -6,26 +6,6 @@ of the constant name and also the naming convention should be in
all caps.
*/
-export const ALPHABETS_STRING = 'abcdefghijklmnopqrstuvwxyz';
-export const NUMBERS_STRING = '0123456789';
-export const SALT_VALUE = 'You can count on my steel';
-export const NO_FINGERPRINT = 'No fingerprint available';
-export const MAX_RETRY_ATTEMPTS = 1;
-export const ENDPOINTS_TO_EXCLUDE = {
- 'tokenCall': 'oauth2/v6/tokens'
-};
-export const CLIENT_ID_FOR_TOKEN_GEN = {
- 'SIDWEB': 'SIDWeb'
-};
-
-export const ADDITIONAL_TEST = [
- 'HIV-I & HIV-II',
- 'Tridot/ ELISA',
- 'technique/HIV',
- 'Rapid',
- 'Hb1Ac', 'Eye Check Package', 'Ophthalmologist consultation'
-];
-
export const SELECT_HOSPITAL = [
{value:'Ruby Hall, Pune', mail:'health@rubyhall.com'},
{value:'Deenanath Mangeshkar Hospital, Pune', mail:'pr@dmhospital.org'},
@@ -40,16 +20,21 @@ export const SELECT_HOSPITAL = [
{value:'Express Clinics, Shop No 18, 19, 20, Empire Estate, Old Mumbai-Pune Highway, Chinchwad, Pune – 411019',mail:'chipnq@expressclinics.in'}
];
-export const ELIGIBLE_PACKAGE = [
- 'Senior Level Package (L0-L1)',
- 'Middle Level Package (L2-L3)'
-];
+export const MIDDLE_LEVEL_ADDITONAL_TEST= ['HIV-I & HIV-II by Tridot/ ELISA technique/HIV Rapid','Hb1Ac','Eye Check Package & Ophthalmologist consultation'];
+export const SENIOR_LEVEL_ADDITONAL_TEST= ['HIV-I & HIV-II by Tridot/ ELISA technique/HIV Rapid','Hb1Ac','Eye Check Package & Ophthalmologist consultation','Treadmill Test'];
+
+export const SENIOR_LEVEL_PACKAGE = 'Middle Level Package (L2-L3)';
+export const MIDDLE_LEVEL_PACKAGE = 'Senior Level Package (L0-L1)';
export const GENDER_LIST = [
'Male',
'Female'
];
+export const SCHEDULE_APPOINTMENT = 'scheduleAppointment';
+export const ADD_DEPENDENTS = 'addDependants';
+
+