diff --git a/micro-frontends/src/next-ui/Components/ViewAllergiesAndReactions/ViewAllergiesAndReactions.jsx b/micro-frontends/src/next-ui/Components/ViewAllergiesAndReactions/ViewAllergiesAndReactions.jsx index 19b2b6de0e..655a8c6fe0 100644 --- a/micro-frontends/src/next-ui/Components/ViewAllergiesAndReactions/ViewAllergiesAndReactions.jsx +++ b/micro-frontends/src/next-ui/Components/ViewAllergiesAndReactions/ViewAllergiesAndReactions.jsx @@ -16,7 +16,8 @@ export const ViewAllergiesAndReactions = (props) => {
{allergies.map((allergy, index) => { const title =
+ className={` allergies-row ${showTextAsAbnormal ? "allergies-red-text" + : allergy.severity === "severe" ? "allergies-red-text": ""}`}>
{allergy.allergen}
{allergy.reactions.join(", ")}
{allergy.severity}
diff --git a/micro-frontends/src/next-ui/Components/ViewAllergiesAndReactions/ViewAllergiesAndReactions.scss b/micro-frontends/src/next-ui/Components/ViewAllergiesAndReactions/ViewAllergiesAndReactions.scss index 73086c1630..3a5b1bf6dd 100644 --- a/micro-frontends/src/next-ui/Components/ViewAllergiesAndReactions/ViewAllergiesAndReactions.scss +++ b/micro-frontends/src/next-ui/Components/ViewAllergiesAndReactions/ViewAllergiesAndReactions.scss @@ -21,6 +21,9 @@ min-width: 20px; } } +.allergies-red-text{ + color: red +} .bx--accordion__content{ padding: 0; } diff --git a/micro-frontends/src/next-ui/Components/ViewAllergiesAndReactions/__snapshots__/ViewAllergiesAndReactions.spec.jsx.snap b/micro-frontends/src/next-ui/Components/ViewAllergiesAndReactions/__snapshots__/ViewAllergiesAndReactions.spec.jsx.snap index 973f729af7..243c41cdb3 100644 --- a/micro-frontends/src/next-ui/Components/ViewAllergiesAndReactions/__snapshots__/ViewAllergiesAndReactions.spec.jsx.snap +++ b/micro-frontends/src/next-ui/Components/ViewAllergiesAndReactions/__snapshots__/ViewAllergiesAndReactions.spec.jsx.snap @@ -51,7 +51,7 @@ exports[`ViewAllergiesAndReactions should render ViewAllergiesAndReactions compo dir="auto" >
Bee diff --git a/ui/app/i18n/ot/locale_en.json b/ui/app/i18n/ot/locale_en.json index 22d8a98c53..0584cf085c 100644 --- a/ui/app/i18n/ot/locale_en.json +++ b/ui/app/i18n/ot/locale_en.json @@ -103,7 +103,8 @@ "PATIENT_ATTRIBUTE_PATIENT_NAME": "Patient Name", "PERSON_ATTRIBUTE_PATIENT_AGE":"Patient Age", "OT_SURGICAL_BLOCK_START_TIME":"Start Time", - "OT_SURGICAL_APPOINTMENT_EST_TIME":"Est Time", + "OT_SURGICAL_APPOINTMENT_PATIENT_WEIGHT":"Weight (Kg)", + "OT_SURGICAL_APPOINTMENT_PRIMARY_DIAGNOSIS":"Primary Diagnosis", "OT_SURGICAL_BLOCK_LOCATION_NAME": "OT#", "OT_PROVIDER_SURGEON": "Surgeon", "OT_SURGICAL_APPOINTMENT_STATUS_CHANGE_NOTES": "Status Change Notes", diff --git a/ui/app/ot/directives/onHorizontalScroll.js b/ui/app/ot/directives/onHorizontalScroll.js new file mode 100644 index 0000000000..2983de5f22 --- /dev/null +++ b/ui/app/ot/directives/onHorizontalScroll.js @@ -0,0 +1,15 @@ +'use strict'; + +angular.module("bahmni.ot") + .directive("onHorizontalScroll", [function () { + var link = function (scope, element, attrs) { + var divTag = document.getElementsByClassName(attrs.onHorizontalScroll)[0]; + element.on('scroll', function () { + divTag.scrollLeft = element[0].scrollLeft; + }); + }; + return { + restrict: "A", + link: link + }; + }]); diff --git a/ui/app/ot/directives/otCalendarSurgicalAppointment.js b/ui/app/ot/directives/otCalendarSurgicalAppointment.js index 7d2676f805..e9bc4f95d6 100644 --- a/ui/app/ot/directives/otCalendarSurgicalAppointment.js +++ b/ui/app/ot/directives/otCalendarSurgicalAppointment.js @@ -1,9 +1,15 @@ 'use strict'; angular.module('bahmni.ot') - .directive('otCalendarSurgicalAppointment', ['surgicalAppointmentHelper', function (surgicalAppointmentHelper) { + .directive('otCalendarSurgicalAppointment', ['surgicalAppointmentHelper', 'appService', '$window', function (surgicalAppointmentHelper, appService, $window) { var link = function ($scope) { $scope.attributes = surgicalAppointmentHelper.getSurgicalAttributes($scope.surgicalAppointment); + var patientUrls = appService.getAppDescriptor().getConfigValue("patientDashboardUrl"); + $scope.patientDashboardUrl = patientUrls && patientUrls.link && appService.getAppDescriptor().formatUrl(patientUrls.link, {'patientUuid': $scope.surgicalAppointment.patient.uuid}); + $scope.goToForwardUrl = function ($event) { + $window.open($scope.patientDashboardUrl); + $event.stopPropagation(); + }; var hasAppointmentStatusInFilteredStatusList = function () { if (_.isEmpty($scope.filterParams.statusList)) { diff --git a/ui/app/ot/directives/otCalendarSurgicalBlock.js b/ui/app/ot/directives/otCalendarSurgicalBlock.js index 6ff43a9a96..a7ba46e726 100644 --- a/ui/app/ot/directives/otCalendarSurgicalBlock.js +++ b/ui/app/ot/directives/otCalendarSurgicalBlock.js @@ -96,6 +96,8 @@ angular.module('bahmni.ot') getCalendarEndDateTime($scope.viewDate) < surgicalAppointment.derivedAttributes.expectedEndDatetime ? getCalendarEndDateTime($scope.viewDate) : surgicalAppointment.derivedAttributes.expectedEndDatetime ); + surgicalAppointment.primaryDiagnosis = new Bahmni.OT.SurgicalBlockMapper().mapPrimaryDiagnoses(surgicalAppointment.patientObservations); + nextAppointmentStartDatetime = surgicalAppointment.derivedAttributes.expectedEndDatetime; return surgicalAppointment; }); diff --git a/ui/app/ot/helpers/surgicalAppointmentHelper.js b/ui/app/ot/helpers/surgicalAppointmentHelper.js index b442ca8788..df003ca199 100644 --- a/ui/app/ot/helpers/surgicalAppointmentHelper.js +++ b/ui/app/ot/helpers/surgicalAppointmentHelper.js @@ -91,7 +91,7 @@ angular.module('bahmni.ot') ['notes', "OT_SURGICAL_APPOINTMENT_NOTES"], ['Status', "OT_SURGICAL_APPOINTMENT_STATUS"], ['Day', "OT_SURGICAL_BLOCK_START_DAY"], ['Date', "OT_SURGICAL_BLOCK_START_DATE"], ['Identifier', "PATIENT_ATTRIBUTE_IDENTIFIER"], ['Patient Name', "PATIENT_ATTRIBUTE_PATIENT_NAME"], ['Patient Age', "PERSON_ATTRIBUTE_PATIENT_AGE"], - ['Start Time', "OT_SURGICAL_BLOCK_START_TIME"], ['Est Time', "OT_SURGICAL_APPOINTMENT_EST_TIME"], + ['Start Time', "OT_SURGICAL_BLOCK_START_TIME"], ['Est Time', "OT_SURGICAL_APPOINTMENT_ESTIMATED_TIME"], ['Actual Time', "OT_SURGICAL_APPOINTMENT_ACTUAL_TIME"], ['OT#', "OT_SURGICAL_BLOCK_LOCATION_NAME"], ['Surgeon', "OT_PROVIDER_SURGEON"], ['Status Change Notes', "OT_SURGICAL_APPOINTMENT_STATUS_CHANGE_NOTES"], ['Bed Location', "OT_SURGICAL_APPOINTMENT_BED_LOCATION"], diff --git a/ui/app/ot/index.html b/ui/app/ot/index.html index 3e8a671805..31706643a6 100644 --- a/ui/app/ot/index.html +++ b/ui/app/ot/index.html @@ -266,6 +266,7 @@ + diff --git a/ui/app/ot/mappers/SurgicalBlockMapper.js b/ui/app/ot/mappers/SurgicalBlockMapper.js index 1a7f3e2c13..d1b116ac61 100644 --- a/ui/app/ot/mappers/SurgicalBlockMapper.js +++ b/ui/app/ot/mappers/SurgicalBlockMapper.js @@ -156,4 +156,6 @@ Bahmni.OT.SurgicalBlockMapper = function () { }); return attributes; }; + + this.mapPrimaryDiagnoses = mapPrimaryDiagnoses; }; diff --git a/ui/app/ot/views/calendarSurgicalAppointment.html b/ui/app/ot/views/calendarSurgicalAppointment.html index af442c7c3f..f0814a145d 100644 --- a/ui/app/ot/views/calendarSurgicalAppointment.html +++ b/ui/app/ot/views/calendarSurgicalAppointment.html @@ -2,15 +2,17 @@ ng-style="{ height: height + 'px', background : backgroundColor.color, borderColor : backgroundColor.borderColor }" tabindex="1" ng-click="selectSurgicalAppointment($event)" class="surgical-block-appointment" title=" {{'OT_PATIENT' | translate}}: {{patient}}
{{'OT_SURGICAL_BLOCK_DIALOG_LOCATION' | translate}}: {{operationTheatre}}
{{'OT_SURGICAL_BLOCK_DIALOG_SURGEON' | translate}}: {{$parent.surgicalBlock.provider.person.display}}"> -
-

{{patient}}

-

Est Time: {{surgicalAppointment.derivedAttributes.expectedStartDatetime | bahmniTime}} - {{surgicalAppointment.derivedAttributes.expectedEndDatetime | bahmniTime}}

-

Procedure - {{attributes.procedure}}

-

Anaesthetist - {{attributes.anaesthetist}}

-

Notes - {{attributes.notes}}

-


Actual Time: {{surgicalAppointment.actualStartDatetime | bahmniTime}} - {{surgicalAppointment.actualEndDatetime | bahmniTime}}

+
+

{{patient}}

+

{{'OT_SURGICAL_APPOINTMENT_PATIENT_WEIGHT' | translate}} - {{attributes.patientWeight}}

+

{{ 'OT_SURGICAL_APPOINTMENT_ESTIMATED_TIME'| translate}} - {{attributes.estTimeHours || 0 }} hrs(s): {{attributes.estTimeMinutes || 0}} min(s)

+

{{ 'OT_SURGICAL_APPOINTMENT_PRIMARY_DIAGNOSIS' | translate}} - {{surgicalAppointment.primaryDiagnosis}}

+

{{ 'OT_SURGICAL_APPOINTMENT_PROCEDURE' | translate}} - {{attributes.procedure}}

+

{{ 'OT_SURGICAL_APPOINTMENT_ANAESTHETIST'| translate}} - {{attributes.anaesthetist}}

+

{{ 'OT_SURGICAL_APPOINTMENT_NOTES'| translate}} - {{attributes.notes}}

+


{{'OT_SURGICAL_APPOINTMENT_ACTUAL_TIME' | translate}} - {{surgicalAppointment.actualStartDatetime | bahmniTime}} - {{surgicalAppointment.actualEndDatetime | bahmniTime}}

-
+

{{patient}}

{{operationTheatre}}

diff --git a/ui/app/ot/views/home.html b/ui/app/ot/views/home.html index 1f34629d52..4bceff9432 100644 --- a/ui/app/ot/views/home.html +++ b/ui/app/ot/views/home.html @@ -71,7 +71,7 @@

{{'OT_APPOINTMENT_STATUS' | translate}}

-

+

diff --git a/ui/app/ot/views/otCalendar.html b/ui/app/ot/views/otCalendar.html index 9e7e6fc418..c5e9fb7e01 100644 --- a/ui/app/ot/views/otCalendar.html +++ b/ui/app/ot/views/otCalendar.html @@ -11,8 +11,7 @@

-
-
+

{{location.name}}

@@ -24,13 +23,13 @@
-
+
{{::row.date | bahmniTime}}
-
+
diff --git a/ui/app/ot/views/surgicalAppointment.html b/ui/app/ot/views/surgicalAppointment.html index 97bbeb44b3..2fe50d729e 100644 --- a/ui/app/ot/views/surgicalAppointment.html +++ b/ui/app/ot/views/surgicalAppointment.html @@ -55,6 +55,14 @@

{{'EDIT_SU

+

+ + +

+

+ + +

diff --git a/ui/app/styles/ot/_ot.scss b/ui/app/styles/ot/_ot.scss index 73252a57d7..1fa8b2e3d1 100644 --- a/ui/app/styles/ot/_ot.scss +++ b/ui/app/styles/ot/_ot.scss @@ -150,6 +150,7 @@ div[ng-app="ot"] { padding: 10px; border-radius: 3px; position: relative; + margin-bottom: 2px; } > i { right: 85px; @@ -160,6 +161,7 @@ div[ng-app="ot"] { select { height: 35px; width: 273px; + margin-bottom: 2px; } } @@ -182,6 +184,7 @@ div[ng-app="ot"] { padding: 10px; box-sizing: border-box; min-height: 80px; + margin-bottom: 2px; .text-section { overflow: auto !important; } diff --git a/ui/app/styles/ot/_otCalendar.scss b/ui/app/styles/ot/_otCalendar.scss index 5d31a6c031..ffb53d54ea 100644 --- a/ui/app/styles/ot/_otCalendar.scss +++ b/ui/app/styles/ot/_otCalendar.scss @@ -25,9 +25,13 @@ box-sizing: border-box; text-align: center; float: left; - padding: 10px 0; + padding: 12px 0; border-bottom: 1px solid #ddd; - font-family: OpenSansSemiBold; + border-top: 1px solid #ddd; + font-family: OpenSansSemiBold, serif; + } + hr{ + margin-bottom: 0; } } .day-heading{ @@ -58,6 +62,13 @@ background-color: #EDF5FF; } } + .provider-location-name{ + display: grid; + grid-auto-flow: column; + grid-auto-columns: max-content; + margin-top: 15px; + overflow-x: scroll; + } .notes-text{ background-color: #FCF4D6; width: calc(100% - 10px); @@ -101,7 +112,8 @@ position: absolute; display: flex; left: 80px; - overflow: auto; + overflow-x: scroll; + overflow-y: auto; padding-bottom: 5px; top: 95px; width: calc(100% - 90px); @@ -120,7 +132,6 @@ float: left; position: relative; padding-bottom: 20px; - overflow: hidden; border-right: 0.5px solid lightgrey; .surgical-block { width: calc(100% - 10px); @@ -289,14 +300,17 @@ } .surgicalblock-patientname { font-weight: 600; - color: #000; + color: #5394fc; font-size: 14px; padding: 0 10px 3px 1px; + cursor: pointer; } - p { - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; + .ot-day-text{ + p { + overflow: hidden; + text-overflow: ellipsis; + padding: 2px 0; + } } } .surgicalblock-surgeon-name { diff --git a/ui/app/styles/ot/_otSurgical.scss b/ui/app/styles/ot/_otSurgical.scss index 73a9288a4a..d2d4d295ab 100644 --- a/ui/app/styles/ot/_otSurgical.scss +++ b/ui/app/styles/ot/_otSurgical.scss @@ -64,7 +64,7 @@ height: 35px; display: inline-block; border-color: #929699; - + margin-bottom: 2px; } .start-time { display: block; diff --git a/ui/app/styles/ot/_otWeeklyCalendar.scss b/ui/app/styles/ot/_otWeeklyCalendar.scss index 52a216d21e..8333c38150 100644 --- a/ui/app/styles/ot/_otWeeklyCalendar.scss +++ b/ui/app/styles/ot/_otWeeklyCalendar.scss @@ -177,6 +177,11 @@ padding-right: 20px; margin: 2% 0; } + .ot-text { + p{ + white-space: nowrap; + } + } } .surgicalblock-surgeon-name { word-break: break-word; diff --git a/ui/test/unit/ot/directives/otCalendarSurgicalAppointment.spec.js b/ui/test/unit/ot/directives/otCalendarSurgicalAppointment.spec.js index 654c69cf8c..bd8f5a46dc 100644 --- a/ui/test/unit/ot/directives/otCalendarSurgicalAppointment.spec.js +++ b/ui/test/unit/ot/directives/otCalendarSurgicalAppointment.spec.js @@ -3,15 +3,29 @@ describe("otCalendarSurgicalAppointment", function () { var simpleHtml = ''; - var $compile, element, mockBackend, scope, surgicalAppointment; + + var $compile, window, element, mockBackend, scope, surgicalAppointment, provide, mockAppDescriptor, mockAppService; beforeEach(module('ngHtml2JsPreprocessor')); beforeEach(module('bahmni.ot')); - beforeEach(inject(function (_$compile_, $rootScope, $httpBackend) { + beforeEach(module('bahmni.ot', function ($provide) { + mockAppDescriptor = jasmine.createSpyObj('appDescriptor', ['getConfig','getConfigValue', 'formatUrl']); + mockAppDescriptor.getConfigValue.and.returnValue({ + link: "/bahmni/clinical/#/default/patient/{{patientUuid}}/dashboard" + }); + mockAppDescriptor.formatUrl.and.returnValue("formattedUrl"); + mockAppService = jasmine.createSpyObj('appService', ['getAppDescriptor']); + mockAppService.getAppDescriptor.and.returnValue(mockAppDescriptor); + provide = $provide; + $provide.value('appService', mockAppService); + })); + beforeEach(inject(function (_$compile_, $rootScope, $httpBackend, $window) { scope = $rootScope.$new(); $compile = _$compile_; mockBackend = $httpBackend; + window = $window })); + beforeEach(function () { surgicalAppointment = { "patient": {uuid: "168eed46-dabe-4b7b-a0d6-a8e4ccc02510", display: "IQ100032 - Sri Rama"}, @@ -69,7 +83,6 @@ describe("otCalendarSurgicalAppointment", function () { }; }); - it("should set the attributes of the surgical appointment", function () { scope.surgicalAppointment = surgicalAppointment; scope.backgroundColor = "#FFFFF"; diff --git a/ui/test/unit/ot/mappers/SurgicalBlockMapper.spec.js b/ui/test/unit/ot/mappers/SurgicalBlockMapper.spec.js index aaa9c68b90..4757205c9a 100644 --- a/ui/test/unit/ot/mappers/SurgicalBlockMapper.spec.js +++ b/ui/test/unit/ot/mappers/SurgicalBlockMapper.spec.js @@ -584,5 +584,89 @@ describe("SurgicalBlockMapper", function () { expect(mappedAttributes.notes.value).toBe(""); expect(mappedAttributes.notes.surgicalAppointmentAttributeType.name).toBe("notes"); }); + + it('should map primary Diagnosis', function () { + const diagnosisObs =[ + { + "uuid": "3936e653-aa98-4f55-a6d8-1fe20834f9bf", + "display": "Coded Diagnosis: Hemarthrosis hand", + "concept": { + "uuid": "81c7149b-3f10-11e4-adec-0800271c1b75", + "display": "Coded Diagnosis", + }, + "obsDatetime": "2023-10-17T01:27:03.000+0530", + "accessionNumber": null, + "obsGroup": { + "uuid": "0e8b32d7-59ab-4950-b4e8-fb85e2bab5f1", + "display": "Visit Diagnoses: Confirmed, Primary, Hemarthrosis hand, 0e8b32d7-59ab-4950-b4e8-fb85e2bab5f1, false", + }, + "valueCodedName": null, + "groupMembers": null, + "comment": null, + "location": { + "uuid": "0fbbeaf4-f3ea-11ed-a05b-0242ac120002", + "display": "CURE Ethiopia", + }, + "order": null, + "encounter": { + "uuid": "c463dfa2-b957-48a4-b48b-f581bcabb47b", + "display": "Consultation 10/17/2023", + }, + "voided": false, + "value": { + "uuid": "742f0998-243c-4c86-94f7-0b176b0daf93", + "display": "Hemarthrosis hand", + "name": { + "display": "Hemarthrosis hand", + "uuid": "1cf38f1c-6fd3-4ef5-8728-880bbb1b4deb", + "name": "Hemarthrosis hand", + "locale": "en", + "localePreferred": true, + "conceptNameType": "FULLY_SPECIFIED", + "resourceVersion": "1.9" + }, + "datatype": { + "uuid": "8d4a4c94-c2cc-11de-8d13-0010c6dffd0f", + "display": "N/A" + }, + "conceptClass": { + "uuid": "8d4918b0-c2cc-11de-8d13-0010c6dffd0f", + "display": "Diagnosis", + }, + "set": false, + "version": null, + "retired": false, + "names": [ + { + "uuid": "1cf38f1c-6fd3-4ef5-8728-880bbb1b4deb", + "display": "Hemarthrosis hand", + } + ], + "descriptions": [ + { + "uuid": "cfe4b845-5acd-4152-a29d-b77a42b92023", + "display": "Hemarthrosis hand", + } + ], + "mappings": [ + { + "uuid": "c08ee0bc-8fed-4b49-8690-b6594e24e37d", + "display": "ICD 10 - WHO: M25.049 (Hemarthrosis hand)", + } + ], + "answers": [], + "setMembers": [], + "attributes": [], + "resourceVersion": "2.0" + }, + "valueModifier": null, + "formFieldPath": null, + "formFieldNamespace": null, + "resourceVersion": "1.11" + } + ] + var diagnosisInfo = surgicalBlockMapper.mapPrimaryDiagnoses(diagnosisObs); + expect(diagnosisInfo).toEqual('Hemarthrosis hand'); + }) });