tango-app-api-audit 3.5.50 → 3.5.52

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tango-app-api-audit",
3
- "version": "3.5.50",
3
+ "version": "3.5.52",
4
4
  "description": "audit & audit metrics apis",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -237,7 +237,7 @@ export async function getList( req, res ) {
237
237
  'Store Name': element?._source?.storeName,
238
238
  'Store ID': element?._source?.storeId || 'Un Assigned',
239
239
  'Store Name': element?._source?.storeName ||'Un Assigned',
240
- 'Optum ID': element?._source?.optumId,
240
+ 'Optom ID': element?._source?.optumId,
241
241
  'Queue ID': element?._source?.queueId,
242
242
  'Compliance Score': element?._source?.totalSteps>0 ? Math.round( ( element?._source?.coveredStepsAI/ element?._source?.totalSteps )*100 ): 0,
243
243
  'Steps Covered By AI': element?._source?.coveredStepsAI || 0,
@@ -399,6 +399,14 @@ export async function viewFile( req, res ) {
399
399
  const openSearch = JSON.parse( process.env.OPENSEARCH );
400
400
  const url = JSON.parse( process.env.URL );
401
401
  let isEnable =true;
402
+ const order = [
403
+ 'Distance-VA-Check',
404
+ 'Torchlight Check',
405
+ 'JCC Check',
406
+ 'Duochrome Check',
407
+ 'Near Addition Check',
408
+ 'Prescription Verification Check',
409
+ ];
402
410
 
403
411
  const getInput = await getOpenSearchById( openSearch.EyeTestInput, inputData.id );
404
412
  if ( !getInput || !getInput?.body ) {
@@ -479,9 +487,45 @@ export async function viewFile( req, res ) {
479
487
 
480
488
  switch ( getData?.auditStatus ) {
481
489
  case 'Yet-to-Audit':
490
+ response['steps'] = response?.steps?.map( ( step ) => {
491
+ if ( step.processName.toLowerCase() === 'near-va-check' ) {
492
+ return { ...step, processName: 'Near Addition Check' };
493
+ }
494
+ if ( step.processName.toLowerCase() === 'jcc' ) {
495
+ return { ...step, processName: 'JCC Check' };
496
+ }
497
+ if ( step.processName.toLowerCase() === 'duochrome-test' ) {
498
+ return { ...step, processName: 'Duochrome Check' };
499
+ }
500
+ if ( step.processName.toLowerCase() === 'torchlight' ) {
501
+ return { ...step, processName: 'Torchlight Check' };
502
+ }
503
+ if ( step.processName.toLowerCase() === 'prescription-verification' ) {
504
+ return { ...step, processName: 'Prescription Verification Check' };
505
+ }
506
+ return step;
507
+ } );
482
508
  isEnable=true;
483
509
  break;
484
510
  case 'In-Progress':
511
+ response['steps'] = response?.steps?.map( ( step ) => {
512
+ if ( step.processName.toLowerCase() === 'near-va-check' ) {
513
+ return { ...step, processName: 'Near Addition Check' };
514
+ }
515
+ if ( step.processName.toLowerCase() === 'jcc' ) {
516
+ return { ...step, processName: 'JCC Check' };
517
+ }
518
+ if ( step.processName.toLowerCase() === 'duochrome-test' ) {
519
+ return { ...step, processName: 'Duochrome Check' };
520
+ }
521
+ if ( step.processName.toLowerCase() === 'torchlight' ) {
522
+ return { ...step, processName: 'Torchlight Check' };
523
+ }
524
+ if ( step.processName.toLowerCase() === 'prescription-verification' ) {
525
+ return { ...step, processName: 'Prescription Verification Check' };
526
+ }
527
+ return step;
528
+ } );
485
529
  if ( searchData.lenght ==0 ) {
486
530
  return res.sendError( 'No saved records found', 400 );
487
531
  }
@@ -490,13 +534,49 @@ export async function viewFile( req, res ) {
490
534
  }
491
535
  break;
492
536
  case 'Audited':
493
- response['steps']= temp._source?.steps;
537
+ response['steps']= temp._source?.steps?.map( ( step ) => {
538
+ if ( step.processName.toLowerCase() === 'near-va-check' ) {
539
+ return { ...step, processName: 'Near Addition Check' };
540
+ }
541
+ if ( step.processName.toLowerCase() === 'jcc' ) {
542
+ return { ...step, processName: 'JCC Check' };
543
+ }
544
+ if ( step.processName.toLowerCase() === 'duochrome-test' ) {
545
+ return { ...step, processName: 'Duochrome Check' };
546
+ }
547
+ if ( step.processName.toLowerCase() === 'torchlight' ) {
548
+ return { ...step, processName: 'Torchlight Check' };
549
+ }
550
+ if ( step.processName.toLowerCase() === 'prescription-verification' ) {
551
+ return { ...step, processName: 'Prescription Verification Check' };
552
+ }
553
+ return step;
554
+ } );
494
555
  isEnable=true;
495
556
  case 'Re-Audited':
496
- response['steps']= temp._source?.steps;
557
+ response['steps']= temp._source?.steps.map( ( step ) => {
558
+ if ( step.processName.toLowerCase() === 'near-va-check' ) {
559
+ return { ...step, processName: 'Near Addition Check' };
560
+ }
561
+ if ( step.processName.toLowerCase() === 'jcc' ) {
562
+ return { ...step, processName: 'JCC Check' };
563
+ }
564
+ if ( step.processName.toLowerCase() === 'duochrome-test' ) {
565
+ return { ...step, processName: 'Duochrome Check' };
566
+ }
567
+ if ( step.processName.toLowerCase() === 'torchlight' ) {
568
+ return { ...step, processName: 'Torchlight Check' };
569
+ }
570
+ if ( step.processName.toLowerCase() === 'prescription-verification' ) {
571
+ return { ...step, processName: 'Prescription Verification Check' };
572
+ }
573
+ return step;
574
+ } );
497
575
  isEnable=true;
498
576
  }
499
-
577
+ response.steps.sort(
578
+ ( a, b ) => order.indexOf( a.processName ) - order.indexOf( b.processName ),
579
+ );
500
580
  return res.sendSuccess( { result: response, isEnable: isEnable } );
501
581
  } catch ( error ) {
502
582
  const err = error.message || 'Internal Server Error';
@@ -1773,7 +1853,7 @@ export async function summaryList( req, res ) {
1773
1853
  'Store Name': element?._source?.storeName,
1774
1854
  'Store ID': element?._source?.storeId || 'Un Assigned',
1775
1855
  'Store Name': element?._source?.storeName ||'Un Assigned',
1776
- 'Optum ID': element?._source?.optumId,
1856
+ 'Optom ID': element?._source?.optumId,
1777
1857
  'Queue ID': element?._source?.queueId,
1778
1858
  'Tango Score': `${element?._source?.totalSteps>0 ? Math.round( ( element?._source?.coveredStepsAI/ element?._source?.totalSteps )*100 ): 0} %`,
1779
1859
  'Steps Covered By AI': element?._source?.coveredStepsAI || 0,
@@ -2277,7 +2357,7 @@ export async function emailAlertLog( req, res ) {
2277
2357
  exportData.push( {
2278
2358
  'RM Email': element.RMEmail,
2279
2359
  'Cluster Name': element.cluster,
2280
- 'Optum Id': element.optumId,
2360
+ 'Optom Id': element.optumId,
2281
2361
  'Store Name': element.storeName,
2282
2362
  'Tango Score': element.complianceScore || 0,
2283
2363
  'Trust Score': element.trustScore || 0,