From 8ce139d361d83066659356f60ba2d553651e8894 Mon Sep 17 00:00:00 2001 From: Arjun-Go Date: Thu, 1 Jun 2023 17:39:30 +0530 Subject: [PATCH 01/12] add. popup window for adding new person --- .../directives/patientRelationship.js | 10 +++ .../views/patientRelationships.html | 12 +++- ui/app/styles/registration/_relationship.scss | 61 +++++++++++++++++++ 3 files changed, 82 insertions(+), 1 deletion(-) diff --git a/ui/app/registration/directives/patientRelationship.js b/ui/app/registration/directives/patientRelationship.js index cb27ead0d8..95375a9729 100644 --- a/ui/app/registration/directives/patientRelationship.js +++ b/ui/app/registration/directives/patientRelationship.js @@ -73,6 +73,15 @@ angular.module('bahmni.registration') return personRelatedTo ? personRelatedTo.display : ""; }; + $scope.closeAddPersonModal = function () { + $scope.showIFrame = false; + return $scope.showIFrame; + }; + + $scope.openAddPersonModal = function () { + $scope.showIFrame = true; + }; + var getName = function (patient) { return patient.givenName + (patient.middleName ? " " + patient.middleName : "") + (patient.familyName ? " " + patient.familyName : ""); @@ -276,6 +285,7 @@ angular.module('bahmni.registration') var init = function () { $scope.relationshipTypes = $rootScope.relationshipTypes; $scope.patient.relationships = $scope.patient.relationships || []; + $scope.showIFrame = false; }; init(); diff --git a/ui/app/registration/views/patientRelationships.html b/ui/app/registration/views/patientRelationships.html index 57c8a770d0..ce4729b4aa 100644 --- a/ui/app/registration/views/patientRelationships.html +++ b/ui/app/registration/views/patientRelationships.html @@ -67,6 +67,11 @@ {{newRelationship.content}} {{ ::'REGISTRATION_LABEL_RELATIONSHIP_EXISTS' | translate}} +
+ +
{{ ::'REGISTRATION_LABEL_TILL' | translate}}
@@ -83,5 +88,10 @@
- +
+
+ × + +
+
diff --git a/ui/app/styles/registration/_relationship.scss b/ui/app/styles/registration/_relationship.scss index 8efb75aca4..7fb5a6c69d 100644 --- a/ui/app/styles/registration/_relationship.scss +++ b/ui/app/styles/registration/_relationship.scss @@ -228,4 +228,65 @@ font-weight: normal; } } +} + +.extension-btn { + margin-left: 5px; + margin-top: 4px; + display: inline-block; + + @media (max-width : 768px) { + display: block; + margin-left: 0; + margin-top: 5px; + } + + button { + margin-right: 5px; + margin-left: 5px; + } +} + +.add-person-ui { + position: fixed; + z-index: 1; + padding-top: 2%; + width: 100%; + height: 100%; + left: 0; + top: 0; + overflow: auto; + background-color: rgba(0, 0, 0, 0.6); + + .add-person-iframe { + background-color: #fefefe; + margin: auto; + padding: 20px; + border: 1px solid #888; + width: 70%; + height: 80%; + + @media screen and (max-width: 540px) { + width: 90%; + } + + @media screen and (min-width: 541px) and (max-width: 1024px) { + width: 80%; + } + } + + .close { + color: #aaaaaa; + float: right; + font-size: 28px; + font-weight: bold; + margin-bottom: 10px; + } + + .close:hover, + .close:focus { + color: #000; + text-decoration: none; + cursor: pointer; + } } \ No newline at end of file From 5ef74b7b82ee849ce1c921bfff5dcf90e55fbafc Mon Sep 17 00:00:00 2001 From: Arjun-Go Date: Tue, 6 Jun 2023 11:54:30 +0530 Subject: [PATCH 02/12] add. add person as relationship --- ui/app/i18n/registration/locale_en.json | 1 + ui/app/registration/constants.js | 3 +- .../directives/patientRelationship.js | 37 ++++++++++++++----- .../views/patientRelationships.html | 8 ++-- 4 files changed, 34 insertions(+), 15 deletions(-) diff --git a/ui/app/i18n/registration/locale_en.json b/ui/app/i18n/registration/locale_en.json index 182c025b09..427970f08a 100644 --- a/ui/app/i18n/registration/locale_en.json +++ b/ui/app/i18n/registration/locale_en.json @@ -46,6 +46,7 @@ "REGISTRATION_LABEL_DATE_DEATH":"Date of death", "REGISTRATION_LABEL_TILL":"Till", "REGISTRATION_LABEL_SELECT_RELATIONSHIP_TYPE":"Select Relationship Type", + "REGISTRATION_LABEL_ADD_PERSON":"Add Person", "REGISTRATION_LABEL_ENTER_NAME_ID":"Enter Name or ID", "REGISTRATION_LABEL_VALID_PATIENT_IDENTIFIER":"Please enter a valid patient identifier", "REGISTRATION_LABEL_PROVIDER_AUTOCOMPLETE_LIST":"Please select a provider from the autocomplete list", diff --git a/ui/app/registration/constants.js b/ui/app/registration/constants.js index 97d2831e00..cc3b27afb0 100644 --- a/ui/app/registration/constants.js +++ b/ui/app/registration/constants.js @@ -23,7 +23,8 @@ Bahmni.Registration.Constants = { enableWhatsAppButton: false, enableDashboardRedirect: false, dashboardUrl: "/bahmni/clinical/index.html#/default/patient/{{patientUuid}}/dashboard", - certificateHeader: "Print Header" + certificateHeader: "Print Header", + personManagementURL: "/person-management" }; Bahmni.Registration.Constants.Errors = { diff --git a/ui/app/registration/directives/patientRelationship.js b/ui/app/registration/directives/patientRelationship.js index 95375a9729..ed761b5cf2 100644 --- a/ui/app/registration/directives/patientRelationship.js +++ b/ui/app/registration/directives/patientRelationship.js @@ -11,8 +11,8 @@ angular.module('bahmni.registration') } }; }) - .controller('PatientRelationshipController', ['$window', '$scope', '$rootScope', 'spinner', 'patientService', 'providerService', 'appService', '$q', - function ($window, $scope, $rootScope, spinner, patientService, providerService, appService, $q) { + .controller('PatientRelationshipController', ['$window', '$scope', '$rootScope', 'spinner', 'patientService', 'providerService', 'appService', '$q', '$document', + function ($window, $scope, $rootScope, spinner, patientService, providerService, appService, $q, $document) { $scope.addPlaceholderRelationship = function () { $scope.patient.newlyAddedRelationships.push({}); }; @@ -73,13 +73,30 @@ angular.module('bahmni.registration') return personRelatedTo ? personRelatedTo.display : ""; }; - $scope.closeAddPersonModal = function () { - $scope.showIFrame = false; - return $scope.showIFrame; - }; - - $scope.openAddPersonModal = function () { - $scope.showIFrame = true; + $scope.closePopupWindow = function () { + $scope.showPopupWindow = false; + }; + + $scope.openPopupWindow = function (relationship) { + var iframe = $document[0].getElementById("relationship-extension-popup"); + iframe.src = Bahmni.Registration.Constants.personManagementURL; + $scope.showPopupWindow = true; + $window.addEventListener("message", function (popupWindowData) { + if (!_.isUndefined(popupWindowData.data.uuid)) { + _.each($scope.patient.newlyAddedRelationships, function (newlyAddedRelationship) { + if (newlyAddedRelationship.hasOwnProperty("relationshipType") && + newlyAddedRelationship.relationshipType.uuid === relationship.relationshipType.uuid) { + if ($scope.isPatientRelationship(newlyAddedRelationship)) { + newlyAddedRelationship.patientIdentifier = popupWindowData.data.display; + } + else if ($scope.isProviderRelationship(newlyAddedRelationship)) { + newlyAddedRelationship.providerName = popupWindowData.data.display; + } + newlyAddedRelationship.personB = getPersonB(popupWindowData.data.display, popupWindowData.data.uuid); + } + }); + } + }, false); }; var getName = function (patient) { @@ -285,7 +302,7 @@ angular.module('bahmni.registration') var init = function () { $scope.relationshipTypes = $rootScope.relationshipTypes; $scope.patient.relationships = $scope.patient.relationships || []; - $scope.showIFrame = false; + $scope.showPopupWindow = false; }; init(); diff --git a/ui/app/registration/views/patientRelationships.html b/ui/app/registration/views/patientRelationships.html index ce4729b4aa..7cec894e39 100644 --- a/ui/app/registration/views/patientRelationships.html +++ b/ui/app/registration/views/patientRelationships.html @@ -68,8 +68,8 @@ {{ ::'REGISTRATION_LABEL_RELATIONSHIP_EXISTS' | translate}}
-
@@ -88,9 +88,9 @@
-
+
- × + ×
From 58b0fae5c32b5bcd588f4901faf2928a644c78b6 Mon Sep 17 00:00:00 2001 From: Arjun-Go Date: Tue, 6 Jun 2023 23:18:07 +0530 Subject: [PATCH 03/12] update. responsiveness of relationship tile --- ui/app/i18n/registration/locale_en.json | 2 +- .../views/patientRelationships.html | 10 ++-- ui/app/styles/registration/_relationship.scss | 50 ++++++++++++++++--- 3 files changed, 50 insertions(+), 12 deletions(-) diff --git a/ui/app/i18n/registration/locale_en.json b/ui/app/i18n/registration/locale_en.json index 427970f08a..19399a940a 100644 --- a/ui/app/i18n/registration/locale_en.json +++ b/ui/app/i18n/registration/locale_en.json @@ -46,7 +46,7 @@ "REGISTRATION_LABEL_DATE_DEATH":"Date of death", "REGISTRATION_LABEL_TILL":"Till", "REGISTRATION_LABEL_SELECT_RELATIONSHIP_TYPE":"Select Relationship Type", - "REGISTRATION_LABEL_ADD_PERSON":"Add Person", + "REGISTRATION_LABEL_SELECT_PERSON":"Select Person", "REGISTRATION_LABEL_ENTER_NAME_ID":"Enter Name or ID", "REGISTRATION_LABEL_VALID_PATIENT_IDENTIFIER":"Please enter a valid patient identifier", "REGISTRATION_LABEL_PROVIDER_AUTOCOMPLETE_LIST":"Please select a provider from the autocomplete list", diff --git a/ui/app/registration/views/patientRelationships.html b/ui/app/registration/views/patientRelationships.html index 7cec894e39..5503e96143 100644 --- a/ui/app/registration/views/patientRelationships.html +++ b/ui/app/registration/views/patientRelationships.html @@ -36,6 +36,11 @@
* +
+ +
-
- -
{{ ::'REGISTRATION_LABEL_TILL' | translate}}
diff --git a/ui/app/styles/registration/_relationship.scss b/ui/app/styles/registration/_relationship.scss index 7fb5a6c69d..bd06a4244c 100644 --- a/ui/app/styles/registration/_relationship.scss +++ b/ui/app/styles/registration/_relationship.scss @@ -7,6 +7,8 @@ } .row { + display: flex; + flex-wrap: wrap; float: left; width: 100%; @@ -22,25 +24,37 @@ font-size: 12px; } - width: 30%; + width: 25%; float: left; + + @media (max-width : 1024px) { + width: 25%; + } + + @media (max-width : 990px) { + width: 35%; + } @media (max-width : 768px) { width: 100%; } + + .field-value { + margin-left: 0.2rem; + } } .col2 { - width: 38%; + width: 25%; float: left; text-align: left; @media (max-width : 1024px) { - width: 36%; + width: 25%; } @media (max-width : 990px) { - width: 31%; + width: 35%; } @media (max-width : 768px) { @@ -48,8 +62,32 @@ } } + .relationship-extension-btn { + width: 15%; + float: left; + + @media (max-width : 1024px) { + width: 15%; + } + + @media (max-width : 990px) { + width: 30%; + } + + @media (max-width : 768px) { + display: flex; + justify-content: center; + width: 100%; + padding: 1% 0 0 0; + } + + .add-person-btn { + margin: 0.2rem 0 0.2rem 0; + } + } + .col3 { - width: 25%; + width: 28%; float: left; text-align: right; @@ -58,7 +96,7 @@ } @media (max-width : 990px) { - width: 36%; + width: 82%; } @media (max-width : 768px) { From 0a521fac000f77cafb4932f47cbcbd1d2679915a Mon Sep 17 00:00:00 2001 From: Arjun-Go Date: Wed, 7 Jun 2023 17:14:41 +0530 Subject: [PATCH 04/12] modify. Dockerfile to bundle person-management-app build --- package/docker/Dockerfile | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/package/docker/Dockerfile b/package/docker/Dockerfile index 2f0acd8e75..ac887784e9 100644 --- a/package/docker/Dockerfile +++ b/package/docker/Dockerfile @@ -1,5 +1,7 @@ FROM httpd:2.4-alpine +RUN apk add -y --no-cache wget curl unzip + EXPOSE 8091 COPY package/docker/httpd.conf /usr/local/apache2/conf COPY package/docker/systemdate.sh /usr/local/apache2/cgi-bin/systemdate @@ -11,3 +13,16 @@ COPY package/docker/style.css /usr/local/apache2/htdocs/ # Copy BahmniApps COPY ui/dist/. /usr/local/apache2/htdocs/bahmni/ + +# Download Person Management App +RUN < Date: Fri, 9 Jun 2023 17:31:44 +0530 Subject: [PATCH 05/12] fix. Dockerfile for building bahmniapps image with person-management app --- package/docker/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/docker/Dockerfile b/package/docker/Dockerfile index ac887784e9..f7227c10ca 100644 --- a/package/docker/Dockerfile +++ b/package/docker/Dockerfile @@ -16,7 +16,7 @@ COPY ui/dist/. /usr/local/apache2/htdocs/bahmni/ # Download Person Management App RUN < Date: Wed, 21 Jun 2023 19:21:40 +0530 Subject: [PATCH 06/12] [Arjun/Ashish] | BAH-3057 | Ability to edit a person in person management app (#608) * modify existing relationships view in registration page * update. httpd conf to serve static files for person management app * update. view of patient relationship section * update UI according to new mockups * update. css to fix alignment issues --- package/docker/httpd.conf | 9 +- ui/app/i18n/registration/locale_en.json | 5 +- ui/app/registration/constants.js | 3 +- .../directives/patientRelationship.js | 15 ++- .../views/patientRelationships.html | 56 ++++------ ui/app/styles/registration/_relationship.scss | 103 ++++++++++++------ 6 files changed, 115 insertions(+), 76 deletions(-) diff --git a/package/docker/httpd.conf b/package/docker/httpd.conf index 5f4dda3761..ec28f35d6c 100644 --- a/package/docker/httpd.conf +++ b/package/docker/httpd.conf @@ -197,7 +197,7 @@ LoadModule dir_module modules/mod_dir.so #LoadModule speling_module modules/mod_speling.so #LoadModule userdir_module modules/mod_userdir.so LoadModule alias_module modules/mod_alias.so -#LoadModule rewrite_module modules/mod_rewrite.so +LoadModule rewrite_module modules/mod_rewrite.so # @@ -292,6 +292,13 @@ DocumentRoot "/usr/local/apache2/htdocs" Require all granted + + RewriteEngine On + RewriteCond %{REQUEST_FILENAME} !-f + RewriteCond %{REQUEST_FILENAME} !-d + RewriteRule ^(.*)$ /person-management/index.html [L] + + # # DirectoryIndex: sets the file that Apache will serve if a directory # is requested. diff --git a/ui/app/i18n/registration/locale_en.json b/ui/app/i18n/registration/locale_en.json index 19399a940a..351fe4053e 100644 --- a/ui/app/i18n/registration/locale_en.json +++ b/ui/app/i18n/registration/locale_en.json @@ -44,8 +44,11 @@ "REGISTRATION_LABEL_CHOOSE_VALUE":"Choose value", "REGISTRATION_LABEL_IS_DEAD":"Is Dead", "REGISTRATION_LABEL_DATE_DEATH":"Date of death", - "REGISTRATION_LABEL_TILL":"Till", + "REGISTRATION_LABEL_TILL":"Valid Until", "REGISTRATION_LABEL_SELECT_RELATIONSHIP_TYPE":"Select Relationship Type", + "REGISTRATION_HEADER_RELATIONSHIP_LABEL":"Relationship", + "REGISTRATION_HEADER_NAME_LABEL":"Name", + "REGISTRATION_HEADER_VALIDITY_DATE_LABEL":"Valid Until", "REGISTRATION_LABEL_SELECT_PERSON":"Select Person", "REGISTRATION_LABEL_ENTER_NAME_ID":"Enter Name or ID", "REGISTRATION_LABEL_VALID_PATIENT_IDENTIFIER":"Please enter a valid patient identifier", diff --git a/ui/app/registration/constants.js b/ui/app/registration/constants.js index cc3b27afb0..358be2f3a9 100644 --- a/ui/app/registration/constants.js +++ b/ui/app/registration/constants.js @@ -24,7 +24,8 @@ Bahmni.Registration.Constants = { enableDashboardRedirect: false, dashboardUrl: "/bahmni/clinical/index.html#/default/patient/{{patientUuid}}/dashboard", certificateHeader: "Print Header", - personManagementURL: "/person-management" + personManagementURL: "/person-management", + personManagementEditPersonURL: "/person-management/edit" }; Bahmni.Registration.Constants.Errors = { diff --git a/ui/app/registration/directives/patientRelationship.js b/ui/app/registration/directives/patientRelationship.js index ed761b5cf2..0621a8b754 100644 --- a/ui/app/registration/directives/patientRelationship.js +++ b/ui/app/registration/directives/patientRelationship.js @@ -96,6 +96,8 @@ angular.module('bahmni.registration') } }); } + $scope.showPopupWindow = false; + $scope.$apply(); }, false); }; @@ -155,12 +157,13 @@ angular.module('bahmni.registration') }; $scope.openPatientDashboardInNewTab = function (relationship) { - var personRelatedTo = getPersonRelatedTo(relationship); - $window.open(getPatientRegistrationUrl(personRelatedTo.uuid), '_blank'); - }; - - var getPatientRegistrationUrl = function (patientUuid) { - return '#/patient/' + patientUuid; + var iframe = $document[0].getElementById("relationship-extension-popup"); + iframe.src = Bahmni.Registration.Constants.personManagementEditPersonURL + "/" + relationship.personB.uuid; + $scope.showPopupWindow = true; + $window.addEventListener("message", function () { + $scope.showPopupWindow = false; + $scope.$apply(); + }, false); }; $scope.getProviderList = function () { diff --git a/ui/app/registration/views/patientRelationships.html b/ui/app/registration/views/patientRelationships.html index 5503e96143..8a08b8d406 100644 --- a/ui/app/registration/views/patientRelationships.html +++ b/ui/app/registration/views/patientRelationships.html @@ -1,15 +1,24 @@
+
+
+ {{ 'REGISTRATION_HEADER_RELATIONSHIP_LABEL'|translate }} +
+
+ {{ 'REGISTRATION_HEADER_NAME_LABEL'|translate }} +
+
+ {{ 'REGISTRATION_HEADER_VALIDITY_DATE_LABEL'|translate }} +
+
{{getRelationshipTypeForDisplay(relationship)}}
- {{getRelatedToPersonForDisplay(relationship)}} - + {{getRelatedToPersonForDisplay(relationship)}}
- {{ ::'REGISTRATION_LABEL_TILL' | translate}} {{relationship.endDate | bahmniDate}}
@@ -35,41 +44,18 @@
* -
-
- +
+ +
-
- + -
- - - - - - - -
- * - {{ ::'REGISTRATION_LABEL_PERSON_NOT_FOUND' | translate}} - {{newRelationship.content}} {{ ::'REGISTRATION_LABEL_RELATIONSHIP_EXISTS' | translate}}
diff --git a/ui/app/styles/registration/_relationship.scss b/ui/app/styles/registration/_relationship.scss index bd06a4244c..fd97f39956 100644 --- a/ui/app/styles/registration/_relationship.scss +++ b/ui/app/styles/registration/_relationship.scss @@ -18,15 +18,15 @@ .col1 { margin-top: 0; + display: flex; + width: 33%; + float: left; label.add-new { margin-top: 10px; font-size: 12px; } - width: 25%; - float: left; - @media (max-width : 1024px) { width: 25%; } @@ -40,7 +40,31 @@ } .field-value { - margin-left: 0.2rem; + margin: 0 0.2rem 0 0.2rem; + } + + .relationship-extension-btn { + float: left; + padding-left: 1.25rem; + + @media (max-width : 1024px) { + width: 15%; + } + + @media (max-width : 990px) { + width: 30%; + } + + @media (max-width : 768px) { + display: flex; + justify-content: center; + width: 100%; + padding: 1% 0 0 0; + } + + .add-person-btn { + margin: 0.2rem 0 0.2rem 0; + } } } @@ -62,32 +86,8 @@ } } - .relationship-extension-btn { - width: 15%; - float: left; - - @media (max-width : 1024px) { - width: 15%; - } - - @media (max-width : 990px) { - width: 30%; - } - - @media (max-width : 768px) { - display: flex; - justify-content: center; - width: 100%; - padding: 1% 0 0 0; - } - - .add-person-btn { - margin: 0.2rem 0 0.2rem 0; - } - } - .col3 { - width: 28%; + width: 30%; float: left; text-align: right; @@ -141,12 +141,30 @@ span { &.no-person { + padding: 0 0 0 0.625rem; color: red; } } .row { + .col1 { + .field-value { + select { + min-width: 200px; + } + } + } + .col2 { + text-align: left; + margin: auto; + margin-left: 0px; + + @media (max-width : 1024px) { + width: 20%; + } + } .col4 { + margin-right: 0.5%; button { margin-top: 4px; @@ -156,6 +174,15 @@ right: 3px; } } + + .row-remover { + border: none; + background: none; + + span { + color: black; + } + } } @media (max-width : 768px) { @@ -178,6 +205,9 @@ overflow: hidden; .row { + display: flex; + flex-direction: row; + flex-wrap: nowrap; position: relative; &:nth-child(odd) { background-color: #EFEFEF; @@ -205,7 +235,7 @@ line-height: 30px; .col1 { - width: 34%; + width: 32%; @media (max-width : 768px) { width: calc(100% - 60px); @@ -213,7 +243,7 @@ } .col2 { - width: 33.3%; + width: 30.5%; text-align: left; @media (max-width : 1024px) { @@ -222,7 +252,7 @@ } .col3 { - width: 26.4%; + width: 31.3%; text-align: left; .till-text { @@ -241,6 +271,15 @@ .col4 { margin-left: .5%; + .row-remover { + border: none; + background: none; + + span { + color: black; + } + } + button { margin-top: 2px; } From b0ed8738d296f0d4941ff99cf28fa1f73963bb6e Mon Sep 17 00:00:00 2001 From: Arjun G <91885483+Arjun-Go@users.noreply.github.com> Date: Thu, 29 Jun 2023 15:25:02 +0530 Subject: [PATCH 07/12] Arjun | BAH-3057 | Adding more than one relationship for a patient replaces all the previous relationships (#627) --- .../directives/patientRelationship.js | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/ui/app/registration/directives/patientRelationship.js b/ui/app/registration/directives/patientRelationship.js index 0621a8b754..832a81bffe 100644 --- a/ui/app/registration/directives/patientRelationship.js +++ b/ui/app/registration/directives/patientRelationship.js @@ -81,24 +81,21 @@ angular.module('bahmni.registration') var iframe = $document[0].getElementById("relationship-extension-popup"); iframe.src = Bahmni.Registration.Constants.personManagementURL; $scope.showPopupWindow = true; - $window.addEventListener("message", function (popupWindowData) { + var popupEventListener = function (popupWindowData) { if (!_.isUndefined(popupWindowData.data.uuid)) { _.each($scope.patient.newlyAddedRelationships, function (newlyAddedRelationship) { if (newlyAddedRelationship.hasOwnProperty("relationshipType") && - newlyAddedRelationship.relationshipType.uuid === relationship.relationshipType.uuid) { - if ($scope.isPatientRelationship(newlyAddedRelationship)) { - newlyAddedRelationship.patientIdentifier = popupWindowData.data.display; - } - else if ($scope.isProviderRelationship(newlyAddedRelationship)) { - newlyAddedRelationship.providerName = popupWindowData.data.display; - } - newlyAddedRelationship.personB = getPersonB(popupWindowData.data.display, popupWindowData.data.uuid); + newlyAddedRelationship.relationshipType.uuid === relationship.relationshipType.uuid && + newlyAddedRelationship.uuid === relationship.uuid) { + relationship.personB = getPersonB(popupWindowData.data.display, popupWindowData.data.uuid); } }); } $scope.showPopupWindow = false; $scope.$apply(); - }, false); + $window.removeEventListener("message", popupEventListener); + }; + $window.addEventListener("message", popupEventListener, false); }; var getName = function (patient) { From ec3f789c2e05066ed0f0bd50722681338965f5d8 Mon Sep 17 00:00:00 2001 From: binduak Date: Thu, 25 Jan 2024 04:59:01 +0530 Subject: [PATCH 08/12] Bindu | Add product default behaviour if the relationship type is provider --- .../views/patientRelationships.html | 38 ++++++++++++++++--- 1 file changed, 33 insertions(+), 5 deletions(-) diff --git a/ui/app/registration/views/patientRelationships.html b/ui/app/registration/views/patientRelationships.html index 8a08b8d406..b9c8920cb5 100644 --- a/ui/app/registration/views/patientRelationships.html +++ b/ui/app/registration/views/patientRelationships.html @@ -44,11 +44,11 @@
* -
- -
+ + + + +
+
+
+ +
+ + + + + + + + + + + + +
+ * + {{ ::'REGISTRATION_LABEL_PERSON_NOT_FOUND' | translate}} + {{newRelationship.content}} {{ ::'REGISTRATION_LABEL_RELATIONSHIP_EXISTS' | translate}}
From fb5fe60b2eda4228c94c1eb2b4643925455163b5 Mon Sep 17 00:00:00 2001 From: Arjun-Go Date: Sun, 4 Feb 2024 15:55:39 +0530 Subject: [PATCH 09/12] add. css changes for person added as relationship --- .../views/patientRelationships.html | 2 +- ui/app/styles/registration/_relationship.scss | 18 +++++++++++++----- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/ui/app/registration/views/patientRelationships.html b/ui/app/registration/views/patientRelationships.html index b9c8920cb5..27a8927f65 100644 --- a/ui/app/registration/views/patientRelationships.html +++ b/ui/app/registration/views/patientRelationships.html @@ -51,7 +51,7 @@
-
+
{{newRelationship.personB.display}} diff --git a/ui/app/styles/registration/_relationship.scss b/ui/app/styles/registration/_relationship.scss index fd97f39956..a1e834b02f 100644 --- a/ui/app/styles/registration/_relationship.scss +++ b/ui/app/styles/registration/_relationship.scss @@ -46,7 +46,7 @@ .relationship-extension-btn { float: left; padding-left: 1.25rem; - + @media (max-width : 1024px) { width: 15%; } @@ -61,10 +61,6 @@ width: 100%; padding: 1% 0 0 0; } - - .add-person-btn { - margin: 0.2rem 0 0.2rem 0; - } } } @@ -72,6 +68,11 @@ width: 25%; float: left; text-align: left; + display: flex; + + .add-person-btn { + margin: 0.2rem 0 0.2rem 0; + } @media (max-width : 1024px) { width: 25%; @@ -159,6 +160,13 @@ margin: auto; margin-left: 0px; + .field-value-patient { + display: flex; + align-items: center; + margin-right: 10px; + } + + @media (max-width : 1024px) { width: 20%; } From 9b47d182fc06908fa3a28cf41f840364b036c407 Mon Sep 17 00:00:00 2001 From: Arjun-Go Date: Sun, 4 Feb 2024 16:04:54 +0530 Subject: [PATCH 10/12] update. person management app release tag --- package/docker/Dockerfile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/package/docker/Dockerfile b/package/docker/Dockerfile index f7227c10ca..3624e0cf7e 100644 --- a/package/docker/Dockerfile +++ b/package/docker/Dockerfile @@ -16,9 +16,10 @@ COPY ui/dist/. /usr/local/apache2/htdocs/bahmni/ # Download Person Management App RUN < Date: Mon, 5 Feb 2024 12:46:36 +0530 Subject: [PATCH 11/12] adjust position of patient name --- ui/app/registration/views/patientRelationships.html | 10 +++++----- ui/app/styles/registration/_relationship.scss | 3 +-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/ui/app/registration/views/patientRelationships.html b/ui/app/registration/views/patientRelationships.html index 27a8927f65..27bceb2228 100644 --- a/ui/app/registration/views/patientRelationships.html +++ b/ui/app/registration/views/patientRelationships.html @@ -51,11 +51,6 @@
-
{{ ::'REGISTRATION_LABEL_TILL' | translate}} diff --git a/ui/app/styles/registration/_relationship.scss b/ui/app/styles/registration/_relationship.scss index a1e834b02f..9eac33efea 100644 --- a/ui/app/styles/registration/_relationship.scss +++ b/ui/app/styles/registration/_relationship.scss @@ -163,10 +163,9 @@ .field-value-patient { display: flex; align-items: center; - margin-right: 10px; + padding-left: 20px; } - @media (max-width : 1024px) { width: 20%; } From bbc4af50f9ec590a760a01c4750e865ea3cd7345 Mon Sep 17 00:00:00 2001 From: binduak Date: Sat, 2 Mar 2024 17:46:04 +0530 Subject: [PATCH 12/12] Bindu | BAH-3034 | Accommodate feedback comments as part of PR review --- .../directives/patientRelationship.js | 20 +++++++++- ui/app/registration/initialization.js | 7 +++- .../views/patientRelationships.html | 40 ++++++++++--------- 3 files changed, 45 insertions(+), 22 deletions(-) diff --git a/ui/app/registration/directives/patientRelationship.js b/ui/app/registration/directives/patientRelationship.js index 832a81bffe..56a79a5093 100644 --- a/ui/app/registration/directives/patientRelationship.js +++ b/ui/app/registration/directives/patientRelationship.js @@ -28,7 +28,12 @@ angular.module('bahmni.registration') $scope.isPatientRelationship = function (relationship) { var relationshipType = getRelationshipType(relationship); - return relationshipType && (_.isUndefined(relationshipType.searchType) || relationshipType.searchType === "patient"); + return relationshipType && relationshipType.searchType === "patient"; + }; + + $scope.isPersonRelationship = function (relationship) { + var relationshipType = getRelationshipType(relationship); + return relationshipType && relationshipType.searchType === "person"; }; var getRelationshipType = function (relationship) { @@ -43,6 +48,8 @@ angular.module('bahmni.registration') return "patient"; } else if ($scope.isProviderRelationship(relation)) { return "provider"; + } else if ($scope.isPersonRelationship(relation)) { + return "person"; } }; @@ -153,7 +160,7 @@ angular.module('bahmni.registration') return relationship.personA && relationship.personA.uuid === $scope.patient.uuid ? relationship.personB : relationship.personA; }; - $scope.openPatientDashboardInNewTab = function (relationship) { + $scope.openPersonDashboardInNewTab = function (relationship) { var iframe = $document[0].getElementById("relationship-extension-popup"); iframe.src = Bahmni.Registration.Constants.personManagementEditPersonURL + "/" + relationship.personB.uuid; $scope.showPopupWindow = true; @@ -163,6 +170,15 @@ angular.module('bahmni.registration') }, false); }; + $scope.openPatientDashboardInNewTab = function (relationship) { + var personRelatedTo = getPersonRelatedTo(relationship); + $window.open(getPatientRegistrationUrl(personRelatedTo.uuid), '_blank'); + }; + + var getPatientRegistrationUrl = function (patientUuid) { + return '#/patient/' + patientUuid; + }; + $scope.getProviderList = function () { return function (searchAttrs) { return providerService.search(searchAttrs.term); diff --git a/ui/app/registration/initialization.js b/ui/app/registration/initialization.js index c134dbbe82..295646f215 100644 --- a/ui/app/registration/initialization.js +++ b/ui/app/registration/initialization.js @@ -48,10 +48,13 @@ angular.module('bahmni.registration').factory('initialization', var mapRelationsTypeWithSearch = function () { var relationshipTypeMap = $rootScope.relationshipTypeMap || {}; if (!relationshipTypeMap.provider) { - return "patient"; + if (!relationshipTypeMap.patient) { + return "person"; + } } $rootScope.relationshipTypes.forEach(function (relationshipType) { - relationshipType.searchType = (relationshipTypeMap.provider.indexOf(relationshipType.aIsToB) > -1) ? "provider" : "patient"; + relationshipType.searchType = (relationshipTypeMap.provider.indexOf(relationshipType.aIsToB) > -1) ? "provider" : + (relationshipTypeMap.person.indexOf(relationshipType.aIsToB) > -1) ? "person" : "patient"; }); }; diff --git a/ui/app/registration/views/patientRelationships.html b/ui/app/registration/views/patientRelationships.html index 27bceb2228..9ed6b8539a 100644 --- a/ui/app/registration/views/patientRelationships.html +++ b/ui/app/registration/views/patientRelationships.html @@ -16,9 +16,12 @@ {{getRelationshipTypeForDisplay(relationship)}}
+ {{ ::'REGISTRATION_LABEL_TILL' | translate}} {{relationship.endDate | bahmniDate}}
@@ -44,25 +47,21 @@
* - - - - -
+
+ +
-
- -
- - - - - - + + +
+ +
@@ -80,7 +84,7 @@ {{ ::'REGISTRATION_LABEL_PERSON_NOT_FOUND' | translate}} {{newRelationship.content}} {{ ::'REGISTRATION_LABEL_RELATIONSHIP_EXISTS' | translate}} -