Skip to content

Commit

Permalink
BAH-3473 | Locale Issue while uploading the patient visit document. (#…
Browse files Browse the repository at this point in the history
…248)

* Add method to get concept by name and locale and refactor occurance.

* Refactor import statement.

* Add locale import statement.

* Refactor Imports.

* Add Locale Imports.
  • Loading branch information
poojadeshpande01 authored Jan 22, 2024
1 parent 09a996c commit 18478da
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
import java.util.HashSet;
import java.util.List;
import java.util.Set;
//comment

import java.util.Locale;
@Service
public class VisitDocumentServiceImpl implements VisitDocumentService {

Expand Down Expand Up @@ -87,8 +88,13 @@ private void linkDocumentAndImpressionObs(VisitDocumentRequest visitDocumentRequ
}
}

private Concept getConceptsByNameAndLocale(String name, Locale locale) {
List<Concept> conceptList = conceptService.getConceptsByName(name, locale, false);
return conceptList.isEmpty() ? null : conceptList.get(0);
}

private void updateEncounter(Encounter encounter, Date encounterDateTime, List<Document> documents) {
Concept imageConcept = conceptService.getConceptByName(DOCUMENT_OBS_GROUP_CONCEPT_NAME);
Concept imageConcept = getConceptsByNameAndLocale(DOCUMENT_OBS_GROUP_CONCEPT_NAME, Locale.ENGLISH);

for (Document document : documents) {
Concept testConcept = conceptService.getConceptByUuid(document.getTestUuid());
Expand Down

0 comments on commit 18478da

Please sign in to comment.