Skip to content

Commit

Permalink
Merge branch 'main' into openshift-vars
Browse files Browse the repository at this point in the history
  • Loading branch information
vmanawat committed Jan 28, 2025
2 parents f24cca2 + f2fe73e commit ce8ea96
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 23 deletions.
6 changes: 3 additions & 3 deletions backend/src/aqi_api/aqi_api.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@ export class AqiApiService {
},
},
);
this.logger.log("AQI SPECIMEN DELETION: " + aqiDeletion.data);
this.logger.log("AQI SPECIMEN DELETION: " + aqiDeletion.status);

try {
const dbDeletion = await this.prisma.aqi_specimens.delete({
Expand Down Expand Up @@ -659,7 +659,7 @@ export class AqiApiService {
},
},
);
this.logger.log("AQI ACTIVITY DELETION: " + aqiDeletion.data);
this.logger.log("AQI ACTIVITY DELETION: " + aqiDeletion.status);

try {
const dbDeletion = await this.prisma.aqi_field_activities.delete({
Expand Down Expand Up @@ -698,7 +698,7 @@ export class AqiApiService {
},
},
);
this.logger.log("AQI VISIT DELETION: " + deletion.data);
this.logger.log("AQI VISIT DELETION: " + deletion.status);

try {
const dbDeletion = await this.prisma.aqi_field_visits.delete({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -609,10 +609,15 @@ export class FileParseValidateService {
const methodId = lookupResult.method_id;
const methodContext = lookupResult.method_context;
const methodName = lookupResult.method_name;

const concatAnalysisMethod = String(methodId) + ';' + String(methodName) + ';' + String(methodContext);

const concatAnalysisMethod =
String(methodId) +
";" +
String(methodName) +
";" +
String(methodContext);
// Add quotes around the newAnalysisMethod only if it isn't already enclosed in quotes
newObs["Lab: Analysis Method"] = concatAnalysisMethod
newObs["Lab: Analysis Method"] = concatAnalysisMethod;
}
}

Expand Down Expand Up @@ -1292,12 +1297,13 @@ export class FileParseValidateService {

ministryContacts.add(fieldVisit.MinistryContact); // getting the ministry contacts (this will result in a unique list at the end of all rows)

if (
rowData.DataClassification == "VERTICAL_PROFILE" ||
rowData.DataClassification == "FIELD_RESULT"
) {
if (rowData.DataClassification == "VERTICAL_PROFILE") {
rowData.SpecimenName = "";
rowData.ActivityName = "";
}

if (rowData.DataClassification == "FIELD_RESULT") { // TODO: add VERTICAL_PROFILE to this if when AQI fixed their bug and remove the if block above this
rowData.SpecimenName = "";
rowData.ActivityName == "";
}

const observation = this.filterFile<Observations>(
Expand All @@ -1312,13 +1318,12 @@ export class FileParseValidateService {
rowNumber,
);

const csvRow = Object.values(obsRecord)
const csvRow = Object.values(obsRecord);

csvStream.write(csvRow)
csvStream.write(csvRow);

this.logger.log(`Created observation object for row ${rowNumber}`);


this.logger.log(
`Wrote observation object to file for row ${rowNumber}`,
);
Expand Down Expand Up @@ -1445,8 +1450,14 @@ export class FileParseValidateService {
const rowData: Record<string, string> = rowHeaders
.map((header, colNumber) => {
const cellValue = row.getCell(colNumber + 1).value; // using getCell to access value with a 1-based index pattern
const value =
typeof cellValue === "object" &&
cellValue != null &&
"result" in cellValue
? cellValue.result
: cellValue ?? "";
return {
[header]: String(cellValue ?? ""),
[header]: String(value),
};
})
.reduce((acc, curr) => ({ ...acc, ...curr }), {});
Expand Down Expand Up @@ -1480,10 +1491,11 @@ export class FileParseValidateService {
null,
);

if (
rowData.DataClassification == "VERTICAL_PROFILE" ||
rowData.DataClassification == "FIELD_RESULT"
) {
if (rowData.DataClassification == "VERTICAL_PROFILE") {
specimen.SpecimenName = "";
}

if (rowData.DataClassification == "FIELD_RESULT") { // TODO: add VERTICAL_PROFILE to this if when AQI fixed their bug and remove the if block above this
specimen.SpecimenName = "";
fieldActivity.ActivityName == "";
}
Expand Down Expand Up @@ -2055,10 +2067,11 @@ export class FileParseValidateService {
null,
);

if (
rowData.DataClassification == "VERTICAL_PROFILE" ||
rowData.DataClassification == "FIELD_RESULT"
) {
if (rowData.DataClassification == "VERTICAL_PROFILE") {
specimen.SpecimenName = "";
}

if (rowData.DataClassification == "FIELD_RESULT") { // TODO: add VERTICAL_PROFILE to this if when AQI fixed their bug and remove the if block above this
specimen.SpecimenName = "";
fieldActivity.ActivityName == "";
}
Expand Down

0 comments on commit ce8ea96

Please sign in to comment.