Skip to content

Commit

Permalink
"Sreelekha,Sri Laxmi | BAH-4105 | Form name/number to not be displaye…
Browse files Browse the repository at this point in the history
…d on patient dashboard display control"
  • Loading branch information
SreelekhaDarsi committed Nov 7, 2024
1 parent 4b5507e commit 360533c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@ angular.module('bahmni.common.displaycontrol.observation')
obs.value = self.preProcessMultiSelectObs(obs.value);
});

formService.getAllForms().then(function (response) {
var formBuildForms = response.data;
var obs = self.createObsGroupForForm(bahmniObservations, formBuildForms);
if (!hasNoHierarchy) {
updateObservationsWithFormDefinition(obs, formBuildForms);
}
});
if (!hasNoHierarchy) {
formService.getAllForms().then(function (response) {
var formBuildFroms = response.data;
// This block builds hierarchy for the passed bahmniObservations
var obs = self.createObsGroupForForm(bahmniObservations, formBuildFroms);
updateObservationsWithFormDefinition(obs, formBuildFroms);
});
}
};

self.createMultiSelectObservation = function (observations) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3238,12 +3238,11 @@ describe("FormRecordTreeBuildService", function () {

let multiSelectObservation = observations[0].value[0];

expect(multiSelectObservation.concept.shortName).toBe("CodedForm");
expect(multiSelectObservation.groupMembers.length).toBe(1);
expect(multiSelectObservation.groupMembers[0].groupMembers.length).toBe(2);
expect(multiSelectObservation.groupMembers[0].type).toBe("multiSelect");
expect(multiSelectObservation.groupMembers[0].groupMembers[0].valueAsString).toBe("Susceptible");
expect(multiSelectObservation.groupMembers[0].groupMembers[1].valueAsString).toBe("Resistant");
expect(multiSelectObservation.concept.shortName).toBe("MD, Medical History");
expect(multiSelectObservation.groupMembers.length).toBe(2);
expect(multiSelectObservation.type).toBe("multiSelect");
expect(multiSelectObservation.groupMembers[0].valueAsString).toBe("Susceptible");
expect(multiSelectObservation.groupMembers[1].valueAsString).toBe("Resistant");
});

it('should return observations with out hierarchy when hasNoHierarchy is true', function () {
Expand Down Expand Up @@ -3357,9 +3356,10 @@ describe("FormRecordTreeBuildService", function () {
formDetailDeferred.resolve(formDetails);
$scope.$apply();

expect(observations[0].value[0].groupMembers.length, 2);
const observationOne = observations[0].value[0].groupMembers[0];
const observationTwo = observations[0].value[0].groupMembers[1];
expect(observations[0].value.length).toBe(2);

const observationOne = observations[0].value[0];
const observationTwo = observations[0].value[1];

expect(observationOne.concept.shortName).toBe("MD, Medical History");
expect(observationOne.formFieldPath).toBe("CodedForm.1/5-0");
Expand Down

0 comments on commit 360533c

Please sign in to comment.