Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BAH-3336 | Patient Stage dropdown is empty in programs module [Env - Docker.standard] #797

Merged
merged 1 commit into from
Dec 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion ui/app/common/attributeTypes/views/attributeInformation.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@
<option value=""></option>
</select>
</div>
<div class="left" data-ng-switch-when="org.openmrs.customdatatype.datatype.ConceptDatatype">
<select id="{{::attribute.name}}" ng-model="targetModel[attribute.name]"
ng-options="a.conceptId as a.description for a in ::attribute.answers"
ng-disabled="::isReadOnly(attribute.name)" ng-required="{{::attribute.required}}" ng-blur="::handleUpdate(attribute.name)">
<option value=""></option>
</select>
</div>
<div class="left" data-ng-switch-when="org.openmrs.customdatatype.datatype.FreeTextDatatype">
<input
type="text" pattern-validate id="{{::attribute.name}}"
Expand Down Expand Up @@ -71,4 +78,4 @@
<input id="{{::attribute.name}}" type="text" pattern="{{::attribute.pattern}}" ng-model="targetModel[attribute.name]"
ng-disabled="::isReadOnly(attribute.name)" ng-required="{{::attribute.required}}" ng-blur="::handleUpdate(attribute.name)"/>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ angular.module('bahmni.common.displaycontrol.programs')
$scope.getAttributeValue = function (attribute) {
if (isDateFormat(attribute.attributeType.format)) {
return Bahmni.Common.Util.DateUtil.formatDateWithoutTime(attribute.value);
} else if (isCodedConceptFormat(attribute.attributeType.format)) {
} else if (isCodedConceptFormat(attribute.attributeType.format) || isOpenmrsConceptFormat(attribute.attributeType.format)) {
var mrsAnswer = attribute.value;
var displayName = mrsAnswer.display;
if (mrsAnswer.names && mrsAnswer.names.length == 2) {
Expand All @@ -55,6 +55,11 @@ angular.module('bahmni.common.displaycontrol.programs')
var isCodedConceptFormat = function (format) {
return format == "org.bahmni.module.bahmnicore.customdatatype.datatype.CodedConceptDatatype";
};

var isOpenmrsConceptFormat = function (format) {
return format == "org.openmrs.customdatatype.datatype.ConceptDatatype";
};

$scope.translateProgram = function (program) {
var translatedName = Bahmni.Common.Util.TranslationUtil.translateAttribute(program, Bahmni.Common.Constants.program, $translate);
return translatedName;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ angular.module('bahmni.common.uicontrols.programmanagment')
programAttributesMap[programAttributeType.name] = programAttribute.value && programAttribute.value.uuid;
} else if (isDateFormat(programAttributeType.format)) {
programAttributesMap[programAttributeType.name] = Bahmni.Common.Util.DateUtil.parseServerDateToDate(programAttributesMap[programAttributeType.name]);
} else if (isOpenmrsConceptFormat(programAttributeType.format)) {
programAttributesMap[programAttributeType.name] = programAttribute.value && programAttribute.value.uuid;
}
}
});
Expand All @@ -26,7 +28,7 @@ angular.module('bahmni.common.uicontrols.programmanagment')

if (isDateFormat(attributeType.format)) {
return programAttributesMap[attributeType.name] ? Bahmni.Common.Util.DateUtil.formatDateWithoutTime(programAttributesMap[attributeType.name]) : "";
} else if (isCodedConceptFormat(attributeType.format)) {
} else if (isCodedConceptFormat(attributeType.format) || isOpenmrsConceptFormat(attributeType.format)) {
var mrsAnswer = _.find(attributeType.answers, function (answer) {
return answer.conceptId == programAttributesMap[attributeType.name];
});
Expand Down Expand Up @@ -54,6 +56,10 @@ angular.module('bahmni.common.uicontrols.programmanagment')
return format == "org.bahmni.module.bahmnicore.customdatatype.datatype.CodedConceptDatatype";
};

var isOpenmrsConceptFormat = function (format) {
return format == "org.openmrs.customdatatype.datatype.ConceptDatatype";
};

$scope.patientProgram.patientProgramAttributes = $scope.getProgramAttributesMap();
}])
.directive('programAttributes', function () {
Expand Down
Loading