Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ angular.module('bahmni.common.displaycontrol.bacteriologyresults')

var handleResponse = function (response) {
$scope.observations = response.data.results;
$scope.data = {};
if ($scope.observations && $scope.observations.length > 0) {
$scope.specimens = [];
var sampleSource = _.find($scope.bacteriologyTabData.setMembers, function (member) {
Expand All @@ -36,7 +37,12 @@ angular.module('bahmni.common.displaycontrol.bacteriologyresults')
var conceptsConfig = appService.getAppDescriptor().getConfigValue("conceptSetUI") || {};
var dontSortByObsDateTime = true;
_.forEach($scope.observations, function (observation) {
var oneDay = 24 * 60 * 60 * 1000; // hours*minutes*seconds*milliseconds
var firstDate = new Date(observation.dateCollected);
var secondDate = new Date();
$scope.specimens.push(specimenMapper.mapObservationToSpecimen(observation, $scope.allSamples, conceptsConfig, dontSortByObsDateTime));
$scope.data[observation.identifier] = Math.round(Math.abs((firstDate.getTime() - secondDate.getTime()) / (oneDay)));
$scope.diffDays = $scope.data;
});
}
};
Expand Down
14 changes: 13 additions & 1 deletion ui/app/common/displaycontrols/bacteriologyresults/views/bacteriologyResultsControl.html
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,19 @@ <h2 class="section-title">{{section | titleTranslate}}</h2>
<i class="fa fa-caret-right"></i>
<i class="fa fa-caret-down"></i>
{{getDisplayName(specimen)}} :
<span class="specimenId">{{specimen.specimenId}}</span>
<span ng-show="!hasResults(specimen.sampleResult)">
<span class="specimenId">{{specimen.specimenId}}</span>
</span>
<span ng-else="hasResults(specimen.sampleResult)">
<span ng-repeat="step in specimen.sampleResult.groupMembers[0]">
<div ng-if="diffDays[specimen.specimenId]>60 && step.shortName == 'Smear Microscopy Test Results'">
<span class="specimenIdIfHasNoCultureResult" title="Have smear results but no culture"><font color="red">{{specimen.specimenId}}</font></span>
</div>
<div ng-if="(step.shortName == 'Culture Results') || (step.shortName == 'Smear Microscopy Test Results' && diffDays[specimen.specimenId]<60)">
<span class="specimenIdIfHasCultureResult">{{specimen.specimenId}}</span>
</div>
</span>
</span>
</span>

<span class="specimenCollectionDate fr">
Expand Down
Empty file.
3 changes: 3 additions & 0 deletions ui/app/common/displaycontrols/dashboard/directives/dashboard.js
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ angular.module('bahmni.common.displaycontrol.dashboard')
$scope.dashboard = Bahmni.Common.DisplayControl.Dashboard.create($scope.config || {}, $filter);
};

var checkDisplayType = function (sections, typeToCheck, index) {
return sections[index] && sections[index]['displayType'] && sections[index]['displayType'] === typeToCheck;
};
var checkDisplayType = function (sections, typeToCheck, index) {
return sections[index] && sections[index]['displayType'] && sections[index]['displayType'] === typeToCheck;
};
Expand Down
7 changes: 4 additions & 3 deletions ui/app/common/displaycontrols/drugOrderDetails/directives/drugOrderDetails.js
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@ angular.module('bahmni.common.displaycontrol.drugOrderDetails')
$scope.columnHeaders = [
"DRUG_DETAILS_DRUG_NAME",
"DRUG_DETAILS_DOSE_INFO",
"DRUG_DETAILS_QUANTITY_TEXT",
"DRUG_DETAILS_ROUTE",
"DRUG_DETAILS_FREQUENCY",
"DRUG_DETAILS_START_DATE",
"DRUG_DETAILS_INSTRUCTIONS_TEXT",
"DRUG_DETAILS_ADDITIONAL_INSTRUCTIONS"
"DRUG_DETAILS_ADDITIONAL_INSTRUCTIONS",
"DRUG_DETAILS_QUANTITY_TEXT",
"DRUG_DETAILS_STOP_DATE",
"DRUG_DETAILS_ORDER_REASON_CODED"
];

$scope.showDetails = false;
Expand Down