Skip to content

Commit

Permalink
BS-91 | Merging SNOMED master to Bahmni master (#582)
Browse files Browse the repository at this point in the history
* BS-39 | Siva,Vijay | Publish openmrs-module-bahmniapps with SNOMED image tags (#499)

Co-authored-by: Siva Reddy <[email protected]>

* BS-48 | Patrick | display a toast message if terminology server is unavailable

* BS-75 | Patrick | Prefix diagnosis Coded Answer UUID with conceptSystem when available

* BS-75 | Patrick | Update diagnosis Coded Answer UUID delimiter

* Siva Reddy | BS-42 | Auto deployment to SNOMED Dev Environment (#534)

* BS-48 | Patrick | Fix error message poput timeout

* BS-48 | Patrick | Update condition to use shorthand syntax

* BS-48 | Patrick | Display generic diagnosis TS error message

* BS-48 | Patrick | Remove null error messages

* BS-48 | Patrick | add error handler for diagnosis search

* BS-48 | Patrick | update messaging key on diagnosis controller

* BS-103 | Patrick | Create FHIR Bundle resource when drug name is selected

* BS-102 | made changes to send only draft conditiion/diagnosis/medications and updated druglist api to include   drugReferenceMaps as part of the response

* BS-103 | Patrick | display CDSS alert for drug interactions when drug is selected

* BS-103 | replaced arrow function with normal function

* BS-103 | Patrick | Modify test cases for drug selection

* BS-103 | removed patient resources from fhir bundle

* BS-103 | updated the interaction type

* BS-103 | make cdss call only when cdss enabled is true

* BS-103 | fixed eslint issues

* BS-103 | updated test file with mock to fix the build issue

* BS-103 | resolve the concept source using drug id and storing it in local storage and use

* BS-103 | Patrick | add cdss alerts for drug-diagnosis

* BS-103 | Patrick | Limit audit eventType length

* BS-103 | Patrick | Add label do CDSS critical dismissal options

* BS-103 | Patrick | Remove extra div from alert

* BS-103 | Patrick | Update audit order and dismissal label

* BS-103 | Patrick | Update unit tests

* BS-103 | Patrick | Add cdss alert source

* BS-103 | Patrick | Refactor: rename variables and classes for clarity

* BS-103 | Patrick | Added dynamic update of conditions

* BS-103 | Patrick | Clear CDSS alerts when drugs form is cleared

* Siva Reddy | Triggering Deployment in new repo for SNOMED

* BS-103 | added condition concept system resolve logic and correspondi… (#565)

* BS-103 | added condition concept system resolve logic and corresponding cdss logic

* BS-103 | fixed ts lint issues

* BS-103 | Patrick | Updated unit tests

* BS-103 | patrick | Dismiss alerts when drug name input is cleared

* BS-103 | Patrick | Add test for medication FHIR bundle

* BS-103 | Patrick | Update CDSS alert dismissal options config name

---------

Co-authored-by: Patrick Nyatindo <[email protected]>

* BS-translations-fix | Patrick | Remove added translations to other languages other that English

* Reverting SNOMED Specific Changes

* Add wiki link in readme (#581)

* BS-113 | Patrick | Add wiki link in readme

* BS-113 | Patrick | Update SNOMED support in README

* BS-48-fix | Patrick | Remove custom TS server error message (#583)

* BS-148 | Adding support for multiple prefix search in drug order (#598)

---------

Co-authored-by: vijayanandtwks <[email protected]>
Co-authored-by: Patrick Nyatindo <[email protected]>
Co-authored-by: manimaarans <[email protected]>
  • Loading branch information
4 people authored Jul 12, 2023
1 parent de864db commit c4a3fc4
Show file tree
Hide file tree
Showing 16 changed files with 637 additions and 92 deletions.
22 changes: 18 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,28 +65,42 @@ Resources to build the following docker images can be found in the [package](/pa

## Prevent Search Engines from Indexing the homepage


>⚠️ : Search Engines are able to index the Bahmni App homepage.
This behaviour can be prevented by:

1. **Adding a “noindex” metatag:**
1. **Adding a “noindex” metatag:**

The following tag should be inserted in the `<head>` section of the homepage's HTML markup:

```
<meta name=”robots” content=”noindex”>
```

Additionally, in order to both _de-index_ the homepage and not follow the links, use the `noindex` with the `nofollow` metatag:

```
<meta name=”robots” content=”noindex,nofollow”>
```
> The same is already done [here](https://github.com/Bahmni/openmrs-module-bahmniapps/blob/master/package/docker/index.html#L5)

> The same is already done [here](https://github.com/Bahmni/openmrs-module-bahmniapps/blob/master/package/docker/index.html#L5)
>
2. **Using an X-ROBOTS-TAG HTTP HEADER:**

An `X-Robots-Tag` can be added to the HTTP response header. It has basically the same effect as a `noindex` tag, but with the additional options to specify conditions for different search engines. For more information, please see Google’s guide [here](https://developers.google.com/search/docs/advanced/robots/robots_meta_tag). Here are examples of X-Robots-Tag for specific functions:

- To de-index a web page:

```
Header set X-Robots-Tag "noindex, nofollow"
```

> The same is already done [here](https://github.com/Bahmni/openmrs-module-bahmniapps/blob/master/package/docker/httpd.conf#L32)
>
### SNOMED Integration Support

openmrs-module-bahmniapps also integrates with SNOMED for terminology lookup and CDSS. More details can be found in [this](https://bahmni.atlassian.net/wiki/spaces/BAH/pages/3132686337/SNOMED+FHIR+Terminology+Server+Integration+with+Bahmni) Wiki link
=======
> The same is already done [here](https://github.com/Bahmni/openmrs-module-bahmniapps/blob/master/package/docker/httpd.conf#L32)
1 change: 1 addition & 0 deletions ui/app/clinical/common/models/drugOrderViewModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -707,6 +707,7 @@ Bahmni.Clinical.DrugOrderViewModel.createFromContract = function (drugOrderRespo
};
}
viewModel.instructions = administrationInstructions.instructions;
viewModel.audit = drugOrderResponse.audit;
viewModel.additionalInstructions = administrationInstructions.additionalInstructions;
viewModel.quantity = drugOrderResponse.dosingInstructions.quantity;
viewModel.quantityUnit = drugOrderResponse.dosingInstructions.quantityUnits;
Expand Down
236 changes: 224 additions & 12 deletions ui/app/clinical/consultation/controllers/addTreatmentController.js

Large diffs are not rendered by default.

12 changes: 8 additions & 4 deletions ui/app/clinical/consultation/controllers/diagnosisController.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,13 @@ angular.module('bahmni.clinical')
value: concept.matchedName || concept.conceptName,
concept: {
name: concept.conceptName,
uuid: concept.conceptUuid
uuid: concept.conceptUuid,
conceptSystem: concept.conceptSystem
},
lookup: {
name: concept.matchedName || concept.conceptName,
uuid: concept.conceptUuid
uuid: concept.conceptUuid,
conceptSystem: concept.conceptSystem
}
};

Expand All @@ -163,6 +165,8 @@ angular.module('bahmni.clinical')

$scope.getAddConditionMethod = function () {
return function (item) {
var conceptSystem = item.lookup.conceptSystem ? item.lookup.conceptSystem + "/" : "";
item.lookup.uuid = conceptSystem + item.lookup.uuid;
$scope.consultation.condition.concept.uuid = item.lookup.uuid;
item.value = $scope.consultation.condition.concept.name = item.lookup.name;
};
Expand Down Expand Up @@ -270,9 +274,9 @@ angular.module('bahmni.clinical')
};

$scope.cleanOutDiagnosisList = function (allDiagnoses) {
return allDiagnoses.filter(function (diagnosis) {
return allDiagnoses ? allDiagnoses.filter(function (diagnosis) {
return !alreadyAddedToDiagnosis(diagnosis);
});
}) : [];
};

var alreadyAddedToDiagnosis = function (diagnosis) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,9 @@ Bahmni.Clinical.EncounterTransactionMapper = function () {

if (consultation.newlyAddedDiagnoses && consultation.newlyAddedDiagnoses.length > 0) {
encounterData.bahmniDiagnoses = consultation.newlyAddedDiagnoses.map(function (diagnosis) {
var conceptSystem = diagnosis.codedAnswer.conceptSystem ? diagnosis.codedAnswer.conceptSystem + "/" : "";
return {
codedAnswer: { uuid: !diagnosis.isNonCodedAnswer ? diagnosis.codedAnswer.uuid : undefined},
codedAnswer: { uuid: !diagnosis.isNonCodedAnswer ? conceptSystem + diagnosis.codedAnswer.uuid : undefined},
freeTextAnswer: diagnosis.isNonCodedAnswer ? diagnosis.codedAnswer.name : undefined,
order: diagnosis.order,
certainty: diagnosis.certainty,
Expand Down
4 changes: 3 additions & 1 deletion ui/app/clinical/consultation/models/drugSearchResult.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ Bahmni.Clinical.DrugSearchResult = (function () {
var getMatcher = function (searchString) {
return function (value) {
// return value.search(new RegExp(searchString, "i")) !== -1
return _.includes(value.toLowerCase(), searchString.toLowerCase());
return _.every(searchString.split(" "), function (word) {
return _.includes(value.toLowerCase(), word.toLowerCase());
});
};
};
var getSynonymCreator = function (drug) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,9 +259,54 @@ <h3 class="orderSet-additional-info" ng-show="treatmentConfig.showAdditionalInfo
</div>
</article>

<h3 ng-show="cdssaAlerts && cdssaAlerts.length > 0" class="cdss-alerts">
{{"CDSS_" + cdssaAlerts[0].indicator.toUpperCase() | translate}}
</h3>

<div ng-repeat="cdssAlert in cdssaAlerts" class="cdss-alert" ng-class="{'alert-danger': cdssAlert.indicator == 'critical', 'alert-warning': cdssAlert.indicator == 'warning', 'alert-info': cdssAlert.indicator == 'info'}" ng-show="cdssAlert">
<button ng-disabled="cdssAlert.indicator == 'critical'" type="button" class="cdss-alert-close" ng-click="closeAlert($index)">&times;</button>
<i class="fa" aria-hidden="true"
ng-class="{'fa-exclamation-triangle': cdssAlert.indicator == 'critical' || cdssAlert.indicator == 'warning', 'fa-info-circle': cdssAlert.indicator == 'info'}"
></i>
<div>
<div ng-click="toggleAlertDetails($index)" class="cdss-alert-summary">
<span>{{cdssAlert.summary}}</span>
<i class="fa" ng-class="{'fa-angle-up': cdssAlert.showDetails, 'fa-angle-down': !cdssAlert.showDetails}"></i>
</div>
<div class="cdss-alert-details" ng-show="cdssAlert.showDetails">
<span>{{cdssAlert.detail}}</span>
<a href="{{cdssAlert.source.url}}" target="_blank" ng-show="cdssAlert.source.url">
<i class="fa fa-question-circle"></i>
</a>
<div ng-show="cdssAlert.indicator == 'critical'">
<div class="field-value">
<select id="cdss-audit" class="form-field cdss-alert-close-reason"
ng-options="item as (item | translate) for item in auditOptions()"
ng-model="treatment.audit"
>
<option disabled value="">{{"CDSS_ALERT_DISMISSAL_REASON" | translate}}</option>
</select>
</div>

<div class="operations fr clearfix" ng-show="cdssAlert.indicator == 'critical'">
<button
ng-click="submitAudit($index)"
ng-disabled="!treatment.audit"
type="button" class="icon-button secondary-button" tabindex="1" title="Dismiss">
{{'CDSS_ALERT_DISMISS' | translate}}
</button>
</div>
</div>

</div>

</div>
</div>


<div class="operations fr clearfix">
<button class="add-drug-btn secondary-button fl" type="submit" accesskey="{{ ::treatmentConfig.translate('addAccessKey', 'MEDICATION_ADD_ACCESS_KEY') }}"
ng-disabled="!treatment.drug.uuid && !treatment.concept.uuid && treatment.drugNameDisplay && !treatment.isNonCodedDrug">
ng-disabled="!treatment.drug.uuid && !treatment.concept.uuid && treatment.drugNameDisplay && !treatment.isNonCodedDrug || (cdssaAlerts && cdssaAlerts[0].indicator == 'critical')">
<span ng-bind-html="::treatmentConfig.translate('add', 'MEDICATION_ADD_BUTTON_LABEL')">
</span>
</button>
Expand Down
4 changes: 4 additions & 0 deletions ui/app/common/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Bahmni.Common = Bahmni.Common || {};
var BASE_URL = hostUrl + "/bahmni_config/openmrs/apps/";
var CUSTOM_URL = hostUrl + "/implementation_config/openmrs/apps/";
var IE_APPS_API = RESTWS_V1 + "/bahmniie";
var FHIR_BASE_URL = hostUrl + "/openmrs/ws/fhir2/R4";

var serverErrorMessages = [
{
Expand Down Expand Up @@ -75,11 +76,14 @@ Bahmni.Common = Bahmni.Common || {};
diseaseTemplateUrl: BAHMNI_CORE + "/diseaseTemplates",
AllDiseaseTemplateUrl: BAHMNI_CORE + "/diseaseTemplate",
emrapiConceptUrl: EMRAPI + "/concept",
bahmniapiConceptUrl: BAHMNI_COMMONS + "/terminologies/concepts",
encounterConfigurationUrl: BAHMNI_CORE + "/config/bahmniencounter",
patientConfigurationUrl: BAHMNI_CORE + "/config/patient",
drugOrderConfigurationUrl: BAHMNI_CORE + "/config/drugOrders",
emrEncounterUrl: EMRAPI + "/encounter",
encounterUrl: RESTWS_V1 + "/encounter",
cdssUrl: RESTWS_V1 + "/cdss",
fhirMedicationsUrl: FHIR_BASE_URL + "/Medication",
locationUrl: RESTWS_V1 + "/location",
bahmniVisitLocationUrl: BAHMNI_CORE + "/visitLocation",
bahmniFacilityLocationUrl: BAHMNI_CORE + "/facilityLocation",
Expand Down
6 changes: 5 additions & 1 deletion ui/app/common/domain/services/diagnosisService.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ angular.module('bahmni.common.domain')
.service('diagnosisService', ['$http', '$rootScope', function ($http, $rootScope) {
var self = this;
this.getAllFor = function (searchTerm, locale) {
var url = Bahmni.Common.Constants.emrapiConceptUrl;
var url = Bahmni.Common.Constants.bahmniapiConceptUrl;
var parameters = {term: searchTerm, limit: Bahmni.Common.Constants.emrapiDiagnosisLimit};
if (locale) {
parameters.locale = locale;
Expand All @@ -25,6 +25,10 @@ angular.module('bahmni.common.domain')
var url = Bahmni.Common.Constants.bahmniDeleteDiagnosisUrl;
return $http.get(url, {
params: {obsUuid: obsUuid}
}, function (response) {
return response;
}, function (error) {
return error;
});
};

Expand Down
47 changes: 45 additions & 2 deletions ui/app/common/services/drugService.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';
angular.module('bahmni.common.services')
.factory('drugService', ['$http', function ($http) {
var v = 'custom:(uuid,strength,name,dosageForm,concept:(uuid,name,names:(name)))';
var v = 'custom:(uuid,strength,drugReferenceMaps,name,dosageForm,concept:(uuid,name,names:(name)))';
var search = function (drugName, conceptUuid) {
var params = {
v: v,
Expand Down Expand Up @@ -46,9 +46,52 @@ angular.module('bahmni.common.services')
});
};

var sendDiagnosisDrugBundle = function (bundle) {
return $http.post(Bahmni.Common.Constants.cdssUrl, bundle, {
withCredentials: true,
params: { service: 'medication-order-select' }
});
};

var cdssAudit = function (patientUuid, eventType, message, module) {
var alertData = {
patientUuid: patientUuid,
eventType: eventType,
message: message,
module: module
};
return $http.post(Bahmni.Common.Constants.auditLogUrl, alertData, {
withCredentials: true
});
};

var getDrugConceptSourceMapping = function (drugUuid) {
var params = {
_id: drugUuid
};

return $http.get(Bahmni.Common.Constants.fhirMedicationsUrl, {
params: params,
withCredentials: true
});
};
var getCdssEnabled = function () {
return $http.get(Bahmni.Common.Constants.globalPropertyUrl, {
method: "GET",
params: {
property: 'cdss.enable'
},
withCredentials: true
});
};

return {
search: search,
getRegimen: getRegimen,
getSetMembersOfConcept: getSetMembersOfConcept
getSetMembersOfConcept: getSetMembersOfConcept,
sendDiagnosisDrugBundle: sendDiagnosisDrugBundle,
getDrugConceptSourceMapping: getDrugConceptSourceMapping,
getCdssEnabled: getCdssEnabled,
cdssAudit: cdssAudit
};
}]);
9 changes: 7 additions & 2 deletions ui/app/common/ui-helper/services/messagingService.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@ angular.module('bahmni.common.uiHelper')

this.showMessage = function (level, message, errorEvent) {
var messageObject = {'value': '', 'isServerError': false};
messageObject.value = message;
messageObject.value = message.replace(/\[|\]|null/g, '');
if (errorEvent) {
messageObject.isServerError = true;
if (!self.messages[level].length) {
this.createTimeout('error', 6000);
}
} else if (level == 'info') {
this.createTimeout('info', 4000);
}
Expand All @@ -25,7 +28,9 @@ angular.module('bahmni.common.uiHelper')
if (index >= 0) {
this.messages[level].splice(index, 1);
}
this.messages[level].push(messageObject);
if (messageObject.value) {
this.messages[level].push(messageObject);
}
};

this.createTimeout = function (level, time) {
Expand Down
15 changes: 14 additions & 1 deletion ui/app/i18n/clinical/locale_en.json
Original file line number Diff line number Diff line change
Expand Up @@ -371,5 +371,18 @@
"SHARE_PRESCRIPTION_MAIL_CONTENT": "Hi #recipientName,\nThanks for visiting #locationName on #visitDate. Your prescription is attached with this email. Wish you a speedy recovery.\nThanks.\n#locationName\n#locationAddress",
"CHIEF_COMPLAINT_CODED_KEY": "Chief Complaint Coded",
"SIGN_SYMPTOM_DURATION_KEY": "Sign/symptom duration",
"CHIEF_COMPLAINT_DURATION_UNIT_KEY": "Chief Complaint Duration"
"CHIEF_COMPLAINT_DURATION_UNIT_KEY": "Chief Complaint Duration",
"FALSE_POSITIVE_ALERT": "The alert triggered, but it was a false positive and no action is needed.",
"NOT_APPLICABLE_TO_THE_PATIENT": "The alert does not apply to the patient in question.",
"ALREADY_RESOLVED_BY_MEDICATION_ADJUSTMENT": "The alert was previously resolved by adjusting the patient's medication.",
"ALREADY_MANAGED_BY_OTHER_MEANS": "The alert was previously managed by other means, and no further action is needed.",
"PATIENT_DECLINED_RECOMMENDED_ACTION": "The patient declined the recommended action despite the alert.",
"CLINICIAN_JUDGMENT_OVERRODE_RECOMMENDATION": "The clinician used their judgment to override the recommendation generated by the alert.",
"ALERT_TRIGGERED_IN_ERROR": "The alert triggered in error, and no action is needed.",
"INSUFFICIENT_INFORMATION_TO_ACT_ON_ALERT": "There is not enough information available to act on the alert.",
"CDSS_WARNING" :"Warning",
"CDSS_CRITICAL" :"Critical",
"CDSS_ALERT_DISMISSAL_REASON" :"Select reason for dismissal",
"CDSS_INFO" :"Info",
"CDSS_ALERT_DISMISS": "Dismiss"
}
Loading

0 comments on commit c4a3fc4

Please sign in to comment.