diff --git a/angular.json b/angular.json index 53f378fa..6732fdc2 100644 --- a/angular.json +++ b/angular.json @@ -66,13 +66,7 @@ "vendorChunk": true, "extractLicenses": false, "sourceMap": true, - "namedChunks": true, - "fileReplacements": [ - { - "replace": "src/environments/environment.ts", - "with": "src/environments/environment.prod.ts" - } - ] + "namedChunks": true }, "ci": { "budgets": [ diff --git a/src/app/app-provider-admin/provider-admin/activities/work-location-mapping/work-location-mapping.component.html b/src/app/app-provider-admin/provider-admin/activities/work-location-mapping/work-location-mapping.component.html index 9ad4d8fd..5fe308f9 100644 --- a/src/app/app-provider-admin/provider-admin/activities/work-location-mapping/work-location-mapping.component.html +++ b/src/app/app-provider-admin/provider-admin/activities/work-location-mapping/work-location-mapping.component.html @@ -168,6 +168,7 @@

No Records Found allowSingleRoleOnlyForECD(Serviceline.serviceName); showBlockDrop(Serviceline.serviceName); resetBlockVillageFields(); - eSanjeevaniSaveFunction('Serviceline', Serviceline) + resetRole(); + teleConsultationSaveFunction('Serviceline', Serviceline) " required > @@ -373,7 +375,7 @@

[(ngModel)]="Role" name="role" required - (selectionChange)="eSanjeevaniSaveFunction('Role', Role)" + (selectionChange)="teleConsultationSaveFunction('Role', Role)" > {{ item.roleName }} @@ -381,38 +383,31 @@

-
- -
- ESanjeevaniTele Consultation: + + ESanjeevani + Swymed + Not Required +
>Outbound
+ +
+ +
@@ -512,10 +529,10 @@

{{ element.outbound }} - - ESanjeevani + + Tele Consultation - {{ element.isSanjeevani }} + {{ element.teleConsultation }} @@ -543,6 +560,7 @@

> [style.width]="'100%'" [(ngModel)]="serviceID_duringEdit" name="serviceID" - (selectionChange)=" - refresh2(); - eSanjeevaniEditSaveFunction( - item.serviceName, - roleID_duringEdit - ) - " + (selectionChange)="refresh2()" required > item.serviceName, roleID_duringEdit ); - showEditBlockDrop(item.serviceName) + showEditBlockDrop(item.serviceName); + teleConsultationEditSaveFunction( + item.serviceName, + roleID_duringEdit + ) " > {{ item.serviceName }} @@ -779,7 +795,7 @@

serviceID_duringEdit, roleID_duringEdit ); - eSanjeevaniEditSaveFunction( + teleConsultationEditSaveFunction( serviceID_duringEdit, roleID_duringEdit ) @@ -798,17 +814,28 @@

- ESanjeevaniTele Consultation: + + ESanjeevani + Swymed + Not Required +
(); bufferArray = new MatTableDataSource(); - setDataSourceAttributes() { - this.filteredmappedWorkLocationsList.paginator = this.paginator; - } + @ViewChild('paginatorFirst') paginatorFirst!: MatPaginator; + @ViewChild('paginatorSecond') paginatorSecond!: MatPaginator; @ViewChild('workplaceform') eForm!: NgForm; @ViewChild('workplaceeform') @@ -232,6 +226,8 @@ export class WorkLocationMappingComponent implements OnInit { ); this.mappedWorkLocationsList = response.data; this.filteredmappedWorkLocationsList.data = response.data; + this.filteredmappedWorkLocationsList.paginator = + this.paginatorFirst; } }, (err: any) => { @@ -321,7 +317,7 @@ export class WorkLocationMappingComponent implements OnInit { this.State = null; } }); - this.bufferArray.paginator = this.paginator; + this.bufferArray.paginator = this.paginatorSecond; } } @@ -363,6 +359,8 @@ export class WorkLocationMappingComponent implements OnInit { }, ); } else { + this.teleConsultationFlag = false; + this.teleConsultation = null; const psmID = providerServiceMapID ? providerServiceMapID : this.states_array[0].providerServiceMapID; @@ -410,12 +408,22 @@ export class WorkLocationMappingComponent implements OnInit { ) { if ( (serviceID === 2 || serviceID === 4) && + !this.editMode && parseInt(mappedWorkLocations.stateID) === this.State.stateID && parseInt(mappedWorkLocations.workingDistrictID) === this.District.districtID && !mappedWorkLocations.userServciceRoleDeleted ) { this.existingRoles.push(mappedWorkLocations.roleID); + } else if ( + (serviceID === 2 || serviceID === 4) && + this.editMode && + parseInt(mappedWorkLocations.stateID) === this.stateID_duringEdit && + parseInt(mappedWorkLocations.workingDistrictID) === + this.district_duringEdit && + !mappedWorkLocations.userServciceRoleDeleted + ) { + this.existingRoles.push(mappedWorkLocations.roleID); } else if ( serviceID !== 2 && serviceID !== 4 && @@ -531,34 +539,39 @@ export class WorkLocationMappingComponent implements OnInit { } } + resetRole() { + this.Role = null; + } + showTable() { if (this.editMode) { this.tableMode = true; this.formMode = false; this.editMode = false; this.bufferArray.data = []; - this.bufferArray.paginator = this.paginator; + this.bufferArray.paginator = this.paginatorSecond; this.editWorkplaceForm.resetForm(); this.showInOutBoundEdit = false; this.isOutboundEdit = false; this.isInboundEdit = false; this.searchTerm = null; this.disableSelectRoles = false; - this.eSanjivaniEditFlag = false; - this.eSanjeevaniEdit = false; + this.teleConsultationEditFlag = false; + this.teleConsultationEdit = null; } else { if (this.bufferArray.data.length > 0) { this.tableMode = true; this.formMode = false; this.editMode = false; this.bufferArray.data = []; - this.bufferArray.paginator = this.paginator; + this.bufferArray.paginator = this.paginatorSecond; this.eForm.resetForm(); this.isNational = false; this.isInbound = false; this.isOutbound = false; this.showInOutBound = false; - this.eSanjivaniFlag = false; + this.teleConsultation = null; + this.teleConsultationFlag = false; this.availableRoles = []; this.RolesList = []; this.searchTerm = null; @@ -568,13 +581,14 @@ export class WorkLocationMappingComponent implements OnInit { this.formMode = false; this.editMode = false; this.bufferArray.data = []; - this.bufferArray.paginator = this.paginator; + this.bufferArray.paginator = this.paginatorSecond; this.eForm.resetForm(); this.isNational = false; this.isInbound = false; this.isOutbound = false; this.showInOutBound = false; - this.eSanjivaniFlag = false; + this.teleConsultation = null; + this.teleConsultationFlag = false; this.availableRoles = []; this.RolesList = []; this.searchTerm = null; @@ -918,7 +932,7 @@ export class WorkLocationMappingComponent implements OnInit { } if (this.bufferArray.data.length > 0) { this.eForm.resetForm(); - this.bufferArray.paginator = this.paginator; + this.bufferArray.paginator = this.paginatorSecond; } console.log('Result Array', this.bufferArray); } @@ -931,12 +945,12 @@ export class WorkLocationMappingComponent implements OnInit { this.setWorkLocationObject(objectToBeAdded, obj, false, false); if (this.bufferArray.data.length > 0) { this.eForm.resetForm(); - this.bufferArray.paginator = this.paginator; + this.bufferArray.paginator = this.paginatorSecond; } console.log('Result Array', this.bufferArray); if (this.bufferArray.data.length > 0) { this.eForm.resetForm(); - this.bufferArray.paginator = this.paginator; + this.bufferArray.paginator = this.paginatorSecond; } } else if (objectToBeAdded.serviceline.serviceName === 'HWC') { const result: boolean = this.checkHWCDuplicateBufferArray(); @@ -953,12 +967,14 @@ export class WorkLocationMappingComponent implements OnInit { roleID1: objectToBeAdded.role[a].roleID, roleName: objectToBeAdded.role[a].roleName, screenName: objectToBeAdded.role[a].screenName, - isSanjeevani: + teleConsultation: objectToBeAdded.serviceline.serviceName === 'HWC' && - objectToBeAdded.role[a].roleName.toLowerCase() === 'nurse' && - this.isSanjeevani - ? true - : false, + (objectToBeAdded.role[a].roleName.toLowerCase() === 'nurse' || + objectToBeAdded.role[a].roleName.toLowerCase() === + 'doctor') && + this.teleConsultation + ? this.teleConsultation + : null, }; this.setWorkLocationObject(objectToBeAdded, obj, false, false); } @@ -977,13 +993,15 @@ export class WorkLocationMappingComponent implements OnInit { roleID1: objectToBeAdded.role[i].roleID, roleName: objectToBeAdded.role[i].roleName, screenName: objectToBeAdded.role[i].screenName, - isSanjeevani: + teleConsultation: objectToBeAdded.serviceline.serviceName === 'HWC' && - objectToBeAdded.role[i].roleName.toLowerCase() === - 'nurse' && - this.isSanjeevani - ? true - : false, + (objectToBeAdded.role[i].roleName.toLowerCase() === + 'nurse' || + objectToBeAdded.role[i].roleName.toLowerCase() === + 'doctor') && + this.teleConsultation + ? this.teleConsultation + : null, }; this.setWorkLocationObject( objectToBeAdded, @@ -999,7 +1017,7 @@ export class WorkLocationMappingComponent implements OnInit { } if (this.bufferArray.data.length > 0) { this.eForm.resetForm(); - this.bufferArray.paginator = this.paginator; + this.bufferArray.paginator = this.paginatorSecond; this.disableSelectRoles = false; } } @@ -1011,12 +1029,14 @@ export class WorkLocationMappingComponent implements OnInit { roleID1: objectToBeAdded.role[a].roleID, roleName: objectToBeAdded.role[a].roleName, screenName: objectToBeAdded.role[a].screenName, - isSanjeevani: - objectToBeAdded.serviceline.serviceName !== 'HWC' && - objectToBeAdded.role[a].roleName.toLowerCase() !== 'nurse' && - !this.isSanjeevani - ? false - : true, + teleConsultation: + objectToBeAdded.serviceline.serviceName === 'HWC' && + (objectToBeAdded.role[a].roleName.toLowerCase() === 'nurse' || + objectToBeAdded.role[a].roleName.toLowerCase() === + 'doctor') && + this.teleConsultation + ? this.teleConsultation + : null, }; this.setWorkLocationObject(objectToBeAdded, obj, false, false); } @@ -1035,13 +1055,15 @@ export class WorkLocationMappingComponent implements OnInit { roleID1: objectToBeAdded.role[i].roleID, roleName: objectToBeAdded.role[i].roleName, screenName: objectToBeAdded.role[i].screenName, - isSanjeevani: - objectToBeAdded.serviceline.serviceName !== 'HWC' && - objectToBeAdded.role[i].roleName.toLowerCase() !== - 'nurse' && - !this.isSanjeevani - ? false - : true, + teleConsultation: + objectToBeAdded.serviceline.serviceName === 'HWC' && + (objectToBeAdded.role[i].roleName.toLowerCase() === + 'nurse' || + objectToBeAdded.role[i].roleName.toLowerCase() === + 'doctor') && + this.teleConsultation + ? this.teleConsultation + : null, }; this.setWorkLocationObject(objectToBeAdded, obj, false, false); @@ -1055,7 +1077,7 @@ export class WorkLocationMappingComponent implements OnInit { if (this.bufferArray.data.length > 0) { this.eForm.resetForm(); - this.bufferArray.paginator = this.paginator; + this.bufferArray.paginator = this.paginatorSecond; this.disableSelectRoles = false; } console.log('Result Array', this.bufferArray); @@ -1080,7 +1102,7 @@ export class WorkLocationMappingComponent implements OnInit { } const allRolesArr = []; for (let i = 0; i < roleArr.length; i++) { - allRolesArr.push(roleArr[i].isSanjeevani); + allRolesArr.push(roleArr[i].teleConsultation); } const workLocationObj: any = { previleges: [], @@ -1126,7 +1148,7 @@ export class WorkLocationMappingComponent implements OnInit { : this.states_array[0].providerServiceMapID, createdBy: this.createdBy, workingLocationID: objectToBeAdded.worklocation.pSAddMapID, - isSanjeevani: allRolesArr, + teleConsultation: allRolesArr, }; if (objectToBeAdded.state) { workLocationObj['stateName'] = objectToBeAdded.state.stateName; @@ -1139,7 +1161,7 @@ export class WorkLocationMappingComponent implements OnInit { workLocationObj['district'] = null; } this.bufferArray.data.push(workLocationObj); - this.bufferArray.paginator = this.paginator; + this.bufferArray.paginator = this.paginatorSecond; } resetAllArrays() { @@ -1155,12 +1177,13 @@ export class WorkLocationMappingComponent implements OnInit { this.showInOutBound = false; - this.eSanjivaniFlag = false; + this.teleConsultationFlag = false; + this.teleConsultation = null; } deleteRow(i: any, serviceID: any, providerServiceMapID: any, userID: any) { this.bufferArray.data.splice(i, 1); - this.bufferArray.paginator = this.paginator; + this.bufferArray.paginator = this.paginatorSecond; this.getAllRoles(serviceID, providerServiceMapID, userID); this.availableRoles = []; this.RolesList = []; @@ -1168,7 +1191,7 @@ export class WorkLocationMappingComponent implements OnInit { removeRole(rowIndex: any, roleIndex: any) { this.bufferArray.data[rowIndex].roleID1.splice(roleIndex, 1); - this.bufferArray.paginator = this.paginator; + this.bufferArray.paginator = this.paginatorSecond; this.getAllRoles( this.bufferArray.data[rowIndex].serviceID, this.bufferArray.data[rowIndex].providerServiceMapID, @@ -1176,7 +1199,7 @@ export class WorkLocationMappingComponent implements OnInit { ); if (this.bufferArray.data[rowIndex].roleID1.length === 0) { this.bufferArray.data.splice(rowIndex, 1); - this.bufferArray.paginator = this.paginator; + this.bufferArray.paginator = this.paginatorSecond; } } @@ -1189,7 +1212,7 @@ export class WorkLocationMappingComponent implements OnInit { ID: [ { roleID: '', - isSanjeevani: '', + teleConsultation: '', inbound: '', outbound: '', }, @@ -1219,7 +1242,7 @@ export class WorkLocationMappingComponent implements OnInit { { roleID: this.bufferArray.data[i].roleID1[0].roleID1, - isSanjeevani: this.bufferArray.data[i].isSanjeevani[0], + teleConsultation: this.bufferArray.data[i].teleConsultation[0], inbound: this.bufferArray.data[i].serviceName === '1097' @@ -1260,7 +1283,7 @@ export class WorkLocationMappingComponent implements OnInit { console.log(requestArray, 'after modification array'); this.bufferArray.data = []; - this.bufferArray.paginator = this.paginator; + this.bufferArray.paginator = this.paginatorSecond; this.worklocationmapping .SaveWorkLocationMapping(requestArray) @@ -1284,7 +1307,7 @@ export class WorkLocationMappingComponent implements OnInit { this.filteredStates = []; this.bufferArray.data = []; - this.bufferArray.paginator = this.paginator; + this.bufferArray.paginator = this.paginatorSecond; }, (err: any) => { console.log(err, 'ERROR'); @@ -1358,8 +1381,6 @@ export class WorkLocationMappingComponent implements OnInit { this.isInboundEdit = this.edit_Details.inbound; - this.isSanjeevani = this.edit_Details.isSanjeevani; - this.isOutboundEdit = this.edit_Details.outbound; if ( @@ -1369,27 +1390,16 @@ export class WorkLocationMappingComponent implements OnInit { this.showInOutBoundEdit = true; } else if ( this.edit_Details.serviceName === 'HWC' && - this.edit_Details.roleName.toLowerCase() === 'nurse' + (this.edit_Details.roleName.toLowerCase() === 'nurse' || + this.edit_Details.roleName.toLowerCase() === 'doctor') && + this.edit_Details.teleConsultation ) { - if ( - this.edit_Details.isSanjeevani !== undefined && - this.edit_Details.isSanjeevani !== null && - this.edit_Details.isSanjeevani === true - ) { - this.eSanjivaniEditFlag = true; - - this.eSanjeevaniEdit = true; - } else { - this.eSanjivaniEditFlag = true; - - this.eSanjeevaniEdit = false; - } + this.teleConsultationEditFlag = true; + this.teleConsultationEdit = this.edit_Details.teleConsultation; } else { this.showInOutBoundEdit = false; - - this.eSanjivaniEditFlag = false; - - this.eSanjeevaniEdit = false; + this.teleConsultationEdit = null; + this.teleConsultationEditFlag = false; } this.getProviderServices(this.userID); @@ -1597,7 +1607,7 @@ export class WorkLocationMappingComponent implements OnInit { (response: any) => this.getStatesSuccessHandeler_duringEdit( serviceID, - response, + response.data, isNational, false, ), @@ -1616,7 +1626,7 @@ export class WorkLocationMappingComponent implements OnInit { if (response) { console.log(response, 'Provider States'); - this.states_array = response.data; + this.states_array = response; this.districts_array = []; @@ -1674,6 +1684,8 @@ export class WorkLocationMappingComponent implements OnInit { this.workLocationID_duringEdit = undefined; this.roleID_duringEdit = undefined; + + this.teleConsultationEditFlag = false; } refresh5() { @@ -1853,7 +1865,7 @@ export class WorkLocationMappingComponent implements OnInit { roleID: workLocations.role, - isSanjeevani: this.isSanjeevani, + teleConsultation: this.teleConsultationEdit, providerServiceMapID: this.providerServiceMapID_duringEdit, @@ -1889,7 +1901,7 @@ export class WorkLocationMappingComponent implements OnInit { this.getAllMappedWorkLocations(); this.bufferArray.data = []; - this.bufferArray.paginator = this.paginator; + this.bufferArray.paginator = this.paginatorSecond; }, (err: any) => { console.log(err, 'ERROR'); @@ -1906,7 +1918,7 @@ export class WorkLocationMappingComponent implements OnInit { roleID: workLocations.role, - isSanjeevani: this.isSanjeevani, + teleConsultation: this.teleConsultationEdit, inbound: roleValue.toLowerCase() === 'supervisor' ? false : this.isInboundEdit, @@ -1940,7 +1952,7 @@ export class WorkLocationMappingComponent implements OnInit { this.getAllMappedWorkLocations(); this.bufferArray.data = []; - this.bufferArray.paginator = this.paginator; + this.bufferArray.paginator = this.paginatorSecond; }, (err: any) => { console.log(err, 'ERROR'); @@ -1971,7 +1983,7 @@ export class WorkLocationMappingComponent implements OnInit { filterComponentList(searchTerm?: string) { if (!searchTerm) { this.filteredmappedWorkLocationsList.data = this.mappedWorkLocationsList; - this.filteredmappedWorkLocationsList.paginator = this.paginator; + this.filteredmappedWorkLocationsList.paginator = this.paginatorFirst; } else { this.filteredmappedWorkLocationsList.data = []; this.mappedWorkLocationsList.forEach((item: any) => { @@ -1994,7 +2006,7 @@ export class WorkLocationMappingComponent implements OnInit { } } }); - this.filteredmappedWorkLocationsList.paginator = this.paginator; + this.filteredmappedWorkLocationsList.paginator = this.paginatorFirst; } } @@ -2010,8 +2022,8 @@ export class WorkLocationMappingComponent implements OnInit { this.villageFlag = false; this.Serviceblock = undefined; this.Servicevillage = undefined; - this.eSanjivaniFlag = false; - this.isSanjeevani = false; + this.teleConsultation = null; + this.teleConsultationFlag = false; } resetBlockVillageFields() { @@ -2206,22 +2218,15 @@ export class WorkLocationMappingComponent implements OnInit { setUpdatedBlockName(blockname: any) { this.blockname = blockname; } - eSanjeevaniSaveFunction(source: string, selectedItem: any): void { - this.eSanjivaniFlag = false; - if (source === 'Serviceline') { - this.eSanjivaniFlag = false; - // Handle Serviceline selection change - this.handleSelectionChanges(); - } else if (source === 'Role') { - this.eSanjivaniFlag = false; - // Handle Role selection change + teleConsultationSaveFunction(source: string, selectedItem: any): void { + if (source === 'Serviceline' || source === 'Role') { this.handleSelectionChanges(); } } handleSelectionChanges() { const roleSanjArry: any = []; - if (this.Role !== undefined) { + if (this.Role) { this.Role.filter((item: any) => { roleSanjArry.push(item.roleName.toLowerCase()); }); @@ -2229,35 +2234,44 @@ export class WorkLocationMappingComponent implements OnInit { if ( this.Serviceline.serviceName === 'HWC' && - roleSanjArry.includes('nurse') + (roleSanjArry.includes('nurse') || roleSanjArry.includes('doctor')) ) { - this.eSanjivaniFlag = true; - } - } + this.teleConsultationFlag = true; - onESanjeevaniChange(event: any) { - if (event.checked) { - this.isSanjeevani = true; + if ( + this.teleConsultation !== 'ESanjeevani' && + this.teleConsultation !== 'Swymed' + ) { + this.teleConsultation = 'Not Required'; + } } else { - this.isSanjeevani = false; + this.teleConsultationFlag = false; + this.teleConsultation = null; } } - eSanjeevaniEditSaveFunction(value: any, role: any) { - const editRoleName = this.RolesList.filter((response: any) => { - if (role === response.roleID) { - return response; - } - })[0]; + teleConsultationEditSaveFunction(value: any, role: any) { + let editRoleName = null; + if (this.RolesList) { + editRoleName = this.RolesList.filter((response: any) => { + if (role === response.roleID) { + return response; + } + })[0]; + } - this.eSanjeevaniEdit = false; if ( - (this.edit_Details.serviceName === 'TM' || - this.edit_Details.serviceName === 'HWC') && - editRoleName.roleName.toLowerCase() === 'Nurse' - ) - this.eSanjivaniEditFlag = true; - else this.eSanjivaniEditFlag = false; + editRoleName && + this.edit_Details.serviceName === 'HWC' && + (editRoleName.roleName.toLowerCase() === 'nurse' || + editRoleName.roleName.toLowerCase() === 'doctor') + ) { + this.teleConsultationEdit = 'Not Required'; + this.teleConsultationEditFlag = true; + } else { + this.teleConsultationEdit = null; + this.teleConsultationEditFlag = false; + } } checkHWCDuplicateBufferArray() { diff --git a/src/environments/environment.prod.ts b/src/environments/environment.prod.ts index d8c5f158..e1090e6e 100644 --- a/src/environments/environment.prod.ts +++ b/src/environments/environment.prod.ts @@ -27,10 +27,10 @@ const ADMIN_API = 'https://amritwprdev.piramalswasthya.org/'; const COMMON_API = 'https://amritwprdev.piramalswasthya.org/'; const FHIR_API = 'https://amritwprdev.piramalswasthya.org/'; -const adminBaseUrl = `${ADMIN_API}adminapi-v1.0/`; -const superadminBaseURL = `${ADMIN_API}adminapi-v1.0/`; -const commonBaseURL = `${COMMON_API}commonapi-v1.0/`; -const fhirBaseUrl = `${FHIR_API}fhirapi-v1.0/`; +const adminBaseUrl = `${ADMIN_API}admin-api/`; +const superadminBaseURL = `${ADMIN_API}admin-api/`; +const commonBaseURL = `${COMMON_API}common-api/`; +const fhirBaseUrl = `${FHIR_API}fhir-api/`; const sessionStorageEncKey = ''; const siteKey = ''; diff --git a/src/environments/environment.test.ts b/src/environments/environment.test.ts index c76812d3..44d123c6 100644 --- a/src/environments/environment.test.ts +++ b/src/environments/environment.test.ts @@ -27,10 +27,10 @@ const ADMIN_API = 'https://amritwprdev.piramalswasthya.org/'; const COMMON_API = 'https://amritwprdev.piramalswasthya.org/'; const FHIR_API = 'https://amritwprdev.piramalswasthya.org/'; -const adminBaseUrl = `${ADMIN_API}adminapi-v1.0/`; -const superadminBaseURL = `${ADMIN_API}adminapi-v1.0/`; -const commonBaseURL = `${COMMON_API}commonapi-v1.0/`; -const fhirBaseUrl = `${FHIR_API}fhirapi-v1.0/`; +const adminBaseUrl = `${ADMIN_API}admin-api/`; +const superadminBaseURL = `${ADMIN_API}admin-api/`; +const commonBaseURL = `${COMMON_API}common-api/`; +const fhirBaseUrl = `${FHIR_API}fhir-api/`; const sessionStorageEncKey = ''; export const environment = {