diff --git a/src/registrar/beneficiary-details/beneficiary-details.component.ts b/src/registrar/beneficiary-details/beneficiary-details.component.ts index 938470f..efe6c50 100644 --- a/src/registrar/beneficiary-details/beneficiary-details.component.ts +++ b/src/registrar/beneficiary-details/beneficiary-details.component.ts @@ -37,6 +37,7 @@ import { import { HttpServiceService } from 'src/app/app-modules/core/services/http-service.service'; import { RegistrarService } from '../services/registrar.service'; import { SessionStorageService } from '../services/session-storage.service'; +import { environment } from 'src/environments/environment'; @Component({ selector: 'app-beneficiary-details', @@ -61,6 +62,7 @@ export class BeneficiaryDetailsComponent implements OnInit, DoCheck, OnDestroy { firstName: any; lastName: any; regDate: any; + isEnableES: boolean = false; constructor( private router: Router, @@ -73,6 +75,7 @@ export class BeneficiaryDetailsComponent implements OnInit, DoCheck, OnDestroy { ) {} ngOnInit() { + this.isEnableES = environment.isEnableES || false; this.assignSelectedLanguage(); this.today = new Date(); this.getHealthIDDetails(); @@ -136,41 +139,97 @@ export class BeneficiaryDetailsComponent implements OnInit, DoCheck, OnDestroy { getBenFamilyDetails() { this.route.params.subscribe((param) => { - const reqObj = { - beneficiaryRegID: null, - beneficiaryName: null, - beneficiaryID: param['beneficiaryId'], - phoneNo: null, - HealthID: null, - HealthIDNumber: null, - familyId: null, - identity: null, - }; - this.registrarService - .identityQuickSearch(reqObj) - .subscribe((res: any) => { - if (res && res.data.length === 1) { - this.beneficiary = res.data[0]; - this.benFamilyId = res.data[0].familyId; - this.beneficiaryName = - this.beneficiary.firstName + - (this.beneficiary.lastName !== undefined - ? ' ' + this.beneficiary.lastName - : ''); - this.regDate = moment - .utc(this.beneficiary.createdDate) - .format('DD-MM-YYYY hh:mm A'); - } - }); - const benFlowID: any = param['beneficiaryRegID']; - this.beneficiaryDetailsService - .getBeneficiaryImage(benFlowID) - .subscribe((data: any) => { - if (data && data.benImage) { + const beneficiaryId = param['beneficiaryId']; + const benFlowID = param['beneficiaryRegID']; + + // Fetch beneficiary details based on search method + const searchObservable = this.isEnableES + ? this.searchWithElasticsearch(beneficiaryId) + : this.searchTraditional(beneficiaryId); + + searchObservable.subscribe({ + next: (res: any) => this.handleSearchResponse(res), + error: (err: any) => this.handleSearchError(err), + }); + + // Fetch beneficiary image independently + this.fetchBeneficiaryImage(benFlowID); + }); + } + + private searchWithElasticsearch(searchTerm: string) { + return this.registrarService.identityQuickSearchES({ search: searchTerm }); + } + + private searchTraditional(beneficiaryId: string) { + const reqObj = { + beneficiaryRegID: null, + beneficiaryName: null, + beneficiaryID: beneficiaryId, + phoneNo: null, + HealthID: null, + HealthIDNumber: null, + familyId: null, + identity: null, + }; + return this.registrarService.identityQuickSearch(reqObj); + } + + private handleSearchResponse(res: any) { + if (!res?.data || res.data.length === 0) { + this.showAlert( + this.current_language_set?.alerts?.info?.beneficiarynotfound || + 'Beneficiary not found', + 'info' + ); + return; + } + + if (res.data.length > 1) { + this.showAlert( + 'Multiple beneficiaries found with this ID. Please use advanced search.', + 'info' + ); + return; + } + + // Single result found + this.beneficiary = res.data[0]; + this.benFamilyId = res.data[0].familyID || res.data[0].familyId; + this.beneficiaryName = this.formatBeneficiaryName(this.beneficiary); + this.regDate = moment + .utc(this.beneficiary.createdDate) + .format('DD-MM-YYYY hh:mm A'); + } + + private formatBeneficiaryName(beneficiary: any): string { + const { firstName, lastName } = beneficiary; + return lastName?.trim() ? `${firstName} ${lastName}` : firstName; + } + + private handleSearchError(err: any) { + console.error('Error fetching beneficiary details:', err); + this.showAlert('Error fetching beneficiary details', 'error'); + } + + private fetchBeneficiaryImage(benFlowID: string) { + this.beneficiaryDetailsService + .getBeneficiaryImage(benFlowID) + .subscribe({ + next: (data: any) => { + if (data?.benImage) { this.beneficiary.benImage = data.benImage; } - }); - }); + }, + error: (err: any) => { + console.error('Error fetching beneficiary image:', err); + // Optionally show error to user or handle silently + }, + }); + } + + private showAlert(message: string, type: string) { + this.confirmationService.alert(message, type); } getHealthIDDetails() { diff --git a/src/registrar/family-tagging/create-family-tagging/create-family-tagging.component.html b/src/registrar/family-tagging/create-family-tagging/create-family-tagging.component.html index 95fcea8..15d51de 100644 --- a/src/registrar/family-tagging/create-family-tagging/create-family-tagging.component.html +++ b/src/registrar/family-tagging/create-family-tagging/create-family-tagging.component.html @@ -114,7 +114,7 @@

{{ currentLanguageSet?.createFamilyTagging }}

- + diff --git a/src/registrar/registration/location-information/location-information.component.html b/src/registrar/registration/location-information/location-information.component.html index 726cfc5..6e45106 100644 --- a/src/registrar/registration/location-information/location-information.component.html +++ b/src/registrar/registration/location-information/location-information.component.html @@ -7,15 +7,16 @@ *ngIf="item?.fieldType?.toLowerCase() === 'text'" > - {{ item.fieldTitle }} + {{ item.fieldTitle | titlecase }} + formControlName="{{ item.fieldName }}" + /> @@ -75,16 +76,16 @@ - {{ item.fieldTitle }} + {{ item.fieldTitle | titlecase }} - {{ option }} + {{ option | titlecase }} @@ -110,18 +111,22 @@ *ngFor="let option of item.options" [value]="option" > - {{ option }} + {{ option | titlecase }} -
- - - {{ item.fieldTitle }} +
+ + {{ item.fieldTitle | titlecase }} - - - - {{ option }} + + + {{ option | titlecase }}
- +
diff --git a/src/registrar/registration/personal-information/personal-information.component.ts b/src/registrar/registration/personal-information/personal-information.component.ts index f90d181..1d0cca2 100644 --- a/src/registrar/registration/personal-information/personal-information.component.ts +++ b/src/registrar/registration/personal-information/personal-information.component.ts @@ -28,6 +28,7 @@ import { import { HttpServiceService } from 'src/app/app-modules/core/services/http-service.service'; import { AmritTrackingService } from 'Common-UI/src/tracking'; import { Injector } from '@angular/core'; +import { environment } from 'src/environments/environment'; @Component({ @@ -83,6 +84,7 @@ export class PersonalInformationComponent { ageforMarriage = 12; maritalStatusMaster: any; personalInfoSubscription!: Subscription; + isEnableES: boolean = false; constructor( private fb: FormBuilder, @@ -116,6 +118,7 @@ export class PersonalInformationComponent { } ngOnInit() { + this.isEnableES = environment.isEnableES || false; this.fetchLanguageResponse(); this.formData.forEach((item: any) => { if (item.fieldName && item.allowText) { @@ -333,55 +336,96 @@ export class PersonalInformationComponent { /** * Phone Number Parent Relations */ - getParentDetails() { + getParentDetails() { const searchTerm = this.personalInfoFormGroup.value.phoneNo; - const searchObject = { - beneficiaryRegID: null, - beneficiaryID: null, - phoneNo: null, - }; + if (searchTerm && searchTerm.trim().length === 10) { - searchObject['phoneNo'] = searchTerm; - this.registrarService.identityQuickSearch(searchObject).subscribe( - (beneficiaryList: any) => { - if ( - beneficiaryList && - beneficiaryList.length > 0 && - beneficiaryList[0].benPhoneMaps.length > 0 - ) { - console.log( - 'ta d ad a d a', - JSON.stringify(beneficiaryList, null, 4) - ); - this.personalInfoFormGroup.patchValue({ - parentRegID: beneficiaryList[0].benPhoneMaps[0].parentBenRegID, - parentRelation: 11, - }); - console.log(this.personalInfoFormGroup.value.parentRegID); - } else { + if (this.isEnableES) { + // Use Elasticsearch search + this.registrarService.identityQuickSearchES({ search: searchTerm }).subscribe( + (response: any) => { + if ( + response && + response.data && + response.data.length > 0 && + response.data[0].benPhoneMaps && + response.data[0].benPhoneMaps.length > 0 + ) { + console.log('ES Parent search result:', JSON.stringify(response, null, 4)); + this.personalInfoFormGroup.patchValue({ + parentRegID: response.data[0].benPhoneMaps[0].parentBenRegID, + parentRelation: 11, + }); + console.log('Parent Reg ID (ES):', this.personalInfoFormGroup.value.parentRegID); + } else { + this.personalInfoFormGroup.patchValue({ + parentRegID: null, + parentRelation: 1, + }); + console.log('No parent found (ES):', this.personalInfoFormGroup.value.parentRegID); + + if (this.patientRevisit) { + this.personalInfoFormGroup.patchValue({ + parentRegID: this.personalInfoFormGroup.value.beneficiaryRegID, + }); + console.log('Patient revisit parent (ES):', this.personalInfoFormGroup.value.parentRegID); + } + } + }, + error => { + this.confirmationService.alert(error, 'error'); this.personalInfoFormGroup.patchValue({ parentRegID: null, parentRelation: 1, + phoneNo: null, }); - console.log(this.personalInfoFormGroup.value.parentRegID); - - if (this.patientRevisit) { + } + ); + } else { + const searchObject = { + beneficiaryRegID: null, + beneficiaryID: null, + phoneNo: searchTerm, + }; + + this.registrarService.identityQuickSearch(searchObject).subscribe( + (beneficiaryList: any) => { + if ( + beneficiaryList && + beneficiaryList.length > 0 && + beneficiaryList[0].benPhoneMaps.length > 0 + ) { + console.log('Traditional search result:', JSON.stringify(beneficiaryList, null, 4)); + this.personalInfoFormGroup.patchValue({ + parentRegID: beneficiaryList[0].benPhoneMaps[0].parentBenRegID, + parentRelation: 11, + }); + console.log('Parent Reg ID:', this.personalInfoFormGroup.value.parentRegID); + } else { this.personalInfoFormGroup.patchValue({ - parentRegID: this.personalInfoFormGroup.value.beneficiaryRegID, + parentRegID: null, + parentRelation: 1, }); - console.log(this.personalInfoFormGroup.value.parentRegID); + console.log('No parent found:', this.personalInfoFormGroup.value.parentRegID); + + if (this.patientRevisit) { + this.personalInfoFormGroup.patchValue({ + parentRegID: this.personalInfoFormGroup.value.beneficiaryRegID, + }); + console.log('Patient revisit parent:', this.personalInfoFormGroup.value.parentRegID); + } } + }, + error => { + this.confirmationService.alert(error, 'error'); + this.personalInfoFormGroup.patchValue({ + parentRegID: null, + parentRelation: 1, + phoneNo: null, + }); } - }, - error => { - this.confirmationService.alert(error, 'error'); - this.personalInfoFormGroup.patchValue({ - parentRegID: null, - parentRelation: 1, - phoneNo: null, - }); - } - ); + ); + } } else { if (this.patientRevisit) { this.personalInfoFormGroup.patchValue({ @@ -398,7 +442,8 @@ export class PersonalInformationComponent { } } } - /** + + /** * * Age Entered in Input */ diff --git a/src/registrar/registration/registration.component.html b/src/registrar/registration/registration.component.html index ee5612e..ed7d4a9 100644 --- a/src/registrar/registration/registration.component.html +++ b/src/registrar/registration/registration.component.html @@ -18,15 +18,16 @@ - Personal Information + {{currentLanguageSet?.ro?.personalInfo?.personalInformation}} - Personal Information + {{currentLanguageSet?.ro?.personalInfo?.personalInformation}} + [formData]="personalInfoData" [patientRevisit]="patientRevisit" [revisitData]="revisitData" + >
@@ -41,11 +42,11 @@ - Location Information + {{currentLanguageSet?.ro?.locInfo?.locInformation}} - Location Information + {{currentLanguageSet?.ro?.locInfo?.locInformation}} - Other Information + {{currentLanguageSet?.ro?.otherInfo?.otherInformation}} - Other Information + {{currentLanguageSet?.ro?.otherInfo?.otherInformation}} - ABHA Information + {{currentLanguageSet?.ro?.abhaInfo?.abhaInformation}} - ABHA Information + {{currentLanguageSet?.ro?.abhaInfo?.abhaInformation}} diff --git a/src/registrar/search-dialog/search-dialog.component.html b/src/registrar/search-dialog/search-dialog.component.html index d870741..57f388d 100644 --- a/src/registrar/search-dialog/search-dialog.component.html +++ b/src/registrar/search-dialog/search-dialog.component.html @@ -135,7 +135,7 @@

{{ currentLanguageSet?.common?.advanceBeneficiarySearch }}

- {{ currentLanguageSet?.village }} + {{ currentLanguageSet?.ro?.locInfo?.village }} diff --git a/src/registrar/search/search.component.html b/src/registrar/search/search.component.html index 083e407..8196a72 100644 --- a/src/registrar/search/search.component.html +++ b/src/registrar/search/search.component.html @@ -9,12 +9,13 @@
-
+ \ No newline at end of file diff --git a/src/registrar/search/search.component.ts b/src/registrar/search/search.component.ts index 814ea12..0577a3d 100644 --- a/src/registrar/search/search.component.ts +++ b/src/registrar/search/search.component.ts @@ -27,6 +27,7 @@ import { ViewChild, DoCheck, AfterViewChecked, + OnDestroy, } from '@angular/core'; import { Router, ActivatedRoute } from '@angular/router'; import { SearchDialogComponent } from '../search-dialog/search-dialog.component'; @@ -45,6 +46,8 @@ import * as moment from 'moment'; import { environment } from 'src/environments/environment'; import { SessionStorageService } from '../services/session-storage.service'; import { HealthIdDisplayModalComponent } from '../abha-components/health-id-display-modal/health-id-display-modal.component'; +import { Subject } from 'rxjs'; +import { debounceTime, distinctUntilChanged, switchMap } from 'rxjs/operators'; export interface Consent { consentGranted: string; @@ -55,7 +58,7 @@ export interface Consent { templateUrl: './search.component.html', styleUrls: ['./search.component.css'], }) -export class SearchComponent implements OnInit, DoCheck, AfterViewChecked { +export class SearchComponent implements OnInit, DoCheck, AfterViewChecked, OnDestroy { rowsPerPage = 5; activePage = 1; pagedList = []; @@ -69,6 +72,7 @@ export class SearchComponent implements OnInit, DoCheck, AfterViewChecked { currentLanguageSet: any; searchPattern!: string; consentGranted: any; + isEnableES: boolean = false; displayedColumns: string[] = [ 'edit', 'beneficiaryID', @@ -86,6 +90,10 @@ export class SearchComponent implements OnInit, DoCheck, AfterViewChecked { dataSource = new MatTableDataSource(); searchCategory: any; + // Add these for debounced search + private searchSubject$ = new Subject(); + private searchSubscription: any; + constructor( private changeDetectorRef: ChangeDetectorRef, private dialog: MatDialog, @@ -94,20 +102,159 @@ export class SearchComponent implements OnInit, DoCheck, AfterViewChecked { private registrarService: RegistrarService, private cameraService: CameraService, private router: Router, - private sessionstorage:SessionStorageService, + private sessionstorage: SessionStorageService, private beneficiaryDetailsService: BeneficiaryDetailsService, ) {} ngOnInit() { this.fetchLanguageResponse(); - this.searchPattern = '/^[a-zA-Z0-9](.|@|-)*$/;'; + this.isEnableES = environment.isEnableES || false; + + this.searchPattern = this.isEnableES ? '/^[a-zA-Z0-9]*$/;' : '/^[a-zA-Z0-9](.|@|-)*$/;'; + if (this.isEnableES) { + this.setupDebouncedSearch(); + } } ngAfterViewChecked() { this.changeDetectorRef.detectChanges(); } + ngOnDestroy() { + if (this.searchSubscription) { + this.searchSubscription.unsubscribe(); + } + } + + // Setup debounced search for typing + setupDebouncedSearch() { + this.searchSubscription = this.searchSubject$ + .pipe( + debounceTime(500), // 500ms delay after typing stops + distinctUntilChanged(), // Only emit if value changed + switchMap((searchTerm: string) => { + // Validate alphanumeric + const alphanumericPattern = /^[a-zA-Z0-9\s]*$/; + if (!alphanumericPattern.test(searchTerm)) { + this.confirmationService.alert( + 'Please enter valid alphanumeric input', + 'info' + ); + return []; + } + return this.registrarService.identityQuickSearchES({ search: searchTerm }); + }) + ) + .subscribe( + (response: any) => { + this.handleESSearchResponse(response); + }, + (error: any) => { + this.confirmationService.alert(error, 'error'); + } + ); + } + + // Method to handle input changes with debounce (for typing) + onSearchInputChange(searchTerm: string) { + const trimmed = searchTerm?.trim() || ''; + if (trimmed.length >= 3) { + this.searchSubject$.next(trimmed); + } else if (trimmed.length === 0) { + this.resetWorklist(); + } + } + + onSearchButtonClick(searchTerm: any) { + if (this.isEnableES) { + if (!searchTerm || searchTerm.trim().length < 3) { + this.confirmationService.alert( + 'Please enter at least 3 characters', + 'info' + ); + this.resetWorklist(); + return; + } + + const trimmed = searchTerm.trim(); + const alphanumericPattern = /^[a-zA-Z0-9\s]*$/; + if (!alphanumericPattern.test(trimmed)) { + this.confirmationService.alert( + 'Please enter valid alphanumeric input', + 'info' + ); + return; + } + + this.registrarService.identityQuickSearchES({ search: trimmed }) + .subscribe( + (response: any) => { + this.handleESSearchResponse(response); + }, + (error: any) => { + this.confirmationService.alert(error, 'error'); + } + ); + } else { + this.identityQuickSearch(searchTerm); + } + } + + + // Common method to handle ES API response + handleESSearchResponse(response: any) { + if (!response?.data || response.data.length === 0) { + this.resetWorklist(); + this.confirmationService.alert( + this.currentLanguageSet?.alerts?.info?.beneficiarynotfound || 'Beneficiary not found', + 'info' + ); + } else { + this.beneficiaryList = this.searchRestructES(response.data); + this.filteredBeneficiaryList = this.beneficiaryList; + this.dataSource.data = this.beneficiaryList; + this.dataSource.paginator = this.paginator; + this.changeDetectorRef.detectChanges(); + } + } + + // Restructure ES API response + searchRestructES(benList: any[]) { + const requiredBenData: any[] = []; + benList.forEach((element: any) => { + requiredBenData.push({ + beneficiaryID: element.beneficiaryID, + beneficiaryRegID: element.beneficiaryRegID, + benName: `${element.firstName} ${element.lastName || ''}`, + genderName: element.m_gender?.genderName || element.genderName || 'Not Available', + fatherName: element.fatherName || 'Not Available', + districtName: element.i_bendemographics?.m_district?.districtName || + element.i_bendemographics?.districtName || 'Not Available', + villageName: element.i_bendemographics?.m_districtbranchmapping?.villageName || + element.i_bendemographics?.villageName || + element.i_bendemographics?.districtBranchName || 'Not Available', + phoneNo: element.benPhoneMaps?.[0]?.phoneNo || 'Not Available', + age: moment(element.dob || element.dOB).fromNow(true) === 'a few seconds' + ? 'Not Available' + : moment(element.dob || element.dOB).fromNow(true), + registeredOn: moment(element.createdDate).format('DD-MM-YYYY'), + benObject: element, + }); + }); + console.log('Restructured ES data:', requiredBenData); + return requiredBenData; + } + + // Reset worklist + resetWorklist() { + this.beneficiaryList = []; + this.filteredBeneficiaryList = []; + this.dataSource.data = []; + this.pagedList = []; + } + identityQuickSearch(searchTerm: any) { + const searchObject = { beneficiaryRegID: null, beneficiaryID: null, @@ -242,7 +389,7 @@ export class SearchComponent implements OnInit, DoCheck, AfterViewChecked { } getCorrectPhoneNo(phoneMaps: any[], benObject: any): string { - if (!phoneMaps.length) { + if (!phoneMaps || !phoneMaps.length) { return 'Not Available'; } @@ -289,7 +436,7 @@ export class SearchComponent implements OnInit, DoCheck, AfterViewChecked { benObject && benObject.m_gender && benObject.m_gender.genderName && - benObject.dOB + benObject.dob ) { const action = false; console.log(JSON.stringify(benObject, null, 4), 'benObject'); @@ -308,7 +455,7 @@ export class SearchComponent implements OnInit, DoCheck, AfterViewChecked { .subscribe((result) => { if (result) this.sendToNurseWindow(result, benObject); }); - } else if (!benObject.m_gender.genderName && !benObject.dOB) { + } else if (!benObject.m_gender.genderName && !benObject.dob) { this.confirmationService.alert( this.currentLanguageSet.alerts.info.genderAndAgeDetails, 'info', @@ -318,7 +465,7 @@ export class SearchComponent implements OnInit, DoCheck, AfterViewChecked { this.currentLanguageSet.alerts.info.noGenderDetails, 'info', ); - } else if (!benObject.dOB) { + } else if (!benObject.dob) { this.confirmationService.alert( this.currentLanguageSet.alerts.info.noAgeDetailsAvail, 'info', @@ -378,18 +525,51 @@ export class SearchComponent implements OnInit, DoCheck, AfterViewChecked { } openSearchDialog() { - const mdDialogRef: MatDialogRef = this.dialog.open( - SearchDialogComponent, - { - width: '60%', - disableClose: false, - }, - ); - - mdDialogRef.afterClosed().subscribe((result) => { + const mdDialogRef: MatDialogRef = this.dialog.open( + SearchDialogComponent, + { + width: '60%', + disableClose: false, + }, + ); + + mdDialogRef.afterClosed().subscribe((result) => { + if (result) { + this.advanceSearchTerm = result; - if (result) { - this.advanceSearchTerm = result; + // Use ES-based advanced search if Elasticsearch is enabled + if (this.isEnableES) { + this.registrarService + .advanceSearchIdentityES(this.advanceSearchTerm) + .subscribe( + (response: any) => { + if (!response?.data || response.data.length === 0) { + this.resetWorklist(); + this.quicksearchTerm = null; + this.confirmationService.alert( + this.currentLanguageSet.alerts.info.beneficiaryNotFound, + 'info', + ); + } else { + this.beneficiaryList = this.searchRestructES(response.data); + this.filteredBeneficiaryList = this.beneficiaryList; + this.dataSource.data = this.beneficiaryList; + this.dataSource.paginator = this.paginator; + this.dataSource.data.forEach( + (sectionCount: any, index: number) => { + sectionCount.sno = index + 1; + }, + ); + this.changeDetectorRef.detectChanges(); + } + console.log('ES Advanced Search Result:', JSON.stringify(response, null, 4)); + }, + (error) => { + this.confirmationService.alert(error, 'error'); + }, + ); + } else { + // Use regular advanced search for non-ES mode this.registrarService .advanceSearchIdentity(this.advanceSearchTerm) .subscribe( @@ -427,8 +607,9 @@ export class SearchComponent implements OnInit, DoCheck, AfterViewChecked { }, ); } - }); - } + } + }); +} navigateTORegistrar() { const link = '/registrar/registration'; const currentRoute = this.router.routerState.snapshot.url; @@ -469,4 +650,4 @@ export class SearchComponent implements OnInit, DoCheck, AfterViewChecked { this.currentLanguageSet = this.languageComponent.currentLanguageObject; } //--End-- -} +} \ No newline at end of file diff --git a/src/registrar/services/registrar.service.ts b/src/registrar/services/registrar.service.ts index 640429f..51bf1ae 100644 --- a/src/registrar/services/registrar.service.ts +++ b/src/registrar/services/registrar.service.ts @@ -121,6 +121,9 @@ export class RegistrarService { return this.http.post(environment.identityQuickSearchUrl, searchTerm); } + identityQuickSearchES(searchTerm: any) { + return this.http.post(environment.elasticSearchUrl, searchTerm); + } clearBeneficiaryEditDetails() { this.beneficiaryEditDetails.next(null); } @@ -137,6 +140,11 @@ export class RegistrarService { return this.http.post(environment.advanceSearchIdentityUrl, searchTerms); } + // New ES Advance Search + advanceSearchIdentityES(searchTerms: any) { + return this.http.post(environment.advanceElasticSearchUrl, searchTerms); + } + loadMasterData(servicePointID: any) { const tmpSPID = { spID: servicePointID }; return this.http.post(environment.registrarMasterDataUrl, tmpSPID);