Skip to content

Commit

Permalink
fix treatment validation
Browse files Browse the repository at this point in the history
  • Loading branch information
alisman committed Sep 27, 2024
1 parent f70b10c commit c6c996c
Showing 1 changed file with 8 additions and 14 deletions.
22 changes: 8 additions & 14 deletions src/shared/api/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,10 @@ function convertLegacySampleTreatmentCountsToCh(legacyData: any) {

legacyData.forEach((legacySampleTreatment: any) => {
let treatment = {
time: legacySampleTreatment['time'],
treatment: legacySampleTreatment['treatment'],
count: legacySampleTreatment['count'],
samples: new Array(),
time: legacySampleTreatment['time'],
treatment: legacySampleTreatment['treatment'],
};

treatments.push(treatment);
Expand All @@ -145,8 +145,8 @@ function convertLegacyPatientTreatmentCountsToCh(legacyData: any) {

legacyData.forEach((legacyTreatment: any) => {
let treatment = {
treatment: legacyTreatment['treatment'],
count: legacyTreatment['count'],
treatment: legacyTreatment['treatment'],
};
treatments.push(treatment);

Expand Down Expand Up @@ -302,18 +302,12 @@ export function validate(
return result;
});
});

// (() => {
// const result: any = {};
// result.url = url;
// result.hash = hash;
// result.status = false;
// result.data = params;
// result.httpError = true;
// return result;
// });
}

const red = '\x1b[31m';
const green = '\x1b[32m';
const reset = '\x1b[0m';

export function reportValidationResult(
result: any,
prefix = '',
Expand All @@ -324,7 +318,7 @@ export function reportValidationResult(

!result.status &&
console.groupCollapsed(
`${prefix} ${result.label} (${result.hash}) ${skipMessage} failed :(`
`${red} ${prefix} ${result.label} (${result.hash}) ${skipMessage} failed :( ${reset}`
);

logLevel === 'verbose' &&
Expand Down

0 comments on commit c6c996c

Please sign in to comment.