Skip to content

Commit

Permalink
Revert "Kavitha|update vitals fetch with debug logs"
Browse files Browse the repository at this point in the history
This reverts commit 530dd33.
  • Loading branch information
kavitha-sundararajan committed Oct 24, 2024
1 parent 530dd33 commit 531425f
Showing 1 changed file with 20 additions and 26 deletions.
46 changes: 20 additions & 26 deletions src/features/DisplayControls/Vitals/utils/VitalsUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export const getConceptDetails = (conceptConfig, conceptDetails, intl) => {
id: concept,
defaultMessage: concept,
});
return field.fullName?.toLowerCase() === conceptByLocale?.toLowerCase();
return field.fullName.toLowerCase() === conceptByLocale.toLowerCase();
});
});

Expand All @@ -62,7 +62,7 @@ export const getConceptDetails = (conceptConfig, conceptDetails, intl) => {
defaultMessage: conceptConfig[conceptName],
});
obj = conceptDetails.find(
(field) => field.fullName?.toLowerCase() === conceptByLocale?.toLowerCase()
(field) => field.fullName.toLowerCase() === conceptByLocale.toLowerCase()
);
concepts[conceptName] = { name: obj?.name, unit: obj?.units };
}
Expand All @@ -72,22 +72,19 @@ export const getConceptDetails = (conceptConfig, conceptDetails, intl) => {

export const getPatientVitals = async (patientUuid, conceptValues, intl) => {
const queryParams = Object.values(conceptValues).flatMap((concept) => {
console.log("vitals concept -- ", concept);
if (Array.isArray(concept)) {
concept.map((value) => {
let conceptByLocale = intl.formatMessage({
let conceptByLocale = intl.formatMessage({
id: concept,
defaultMessage: concept,
});
return Array.isArray(concept)
? concept.map((value) => {
conceptByLocale = intl.formatMessage({
id: value,
defaultMessage: value,
});
return `obsConcepts=${conceptByLocale}`;
});
} else {
let conceptByLocale = intl.formatMessage({
id: concept,
defaultMessage: concept,
});
return `obsConcepts=${conceptByLocale}`;
}
})
: `obsConcepts=${conceptByLocale}`;
});
const conceptParams = queryParams.join("&");
try {
Expand All @@ -109,22 +106,19 @@ export const getPatientVitalsHistory = async (
intl
) => {
const queryParams = Object.values(conceptValues).flatMap((concept) => {
console.log("vitals history concept -- ", concept);
if (Array.isArray(concept)) {
concept.map((value) => {
let conceptByLocale = intl.formatMessage({
let conceptByLocale = intl.formatMessage({
id: concept,
defaultMessage: concept,
});
return Array.isArray(concept)
? concept.map((value) => {
conceptByLocale = intl.formatMessage({
id: value,
defaultMessage: value,
});
return `obsConcepts=${conceptByLocale}`;
});
} else {
let conceptByLocale = intl.formatMessage({
id: concept,
defaultMessage: concept,
});
return `obsConcepts=${conceptByLocale}`;
}
})
: `obsConcepts=${conceptByLocale}`;
});
const conceptParams = queryParams.join("&");
try {
Expand Down

0 comments on commit 531425f

Please sign in to comment.