Skip to content

Commit

Permalink
Release latest bahmni appointments as OWA (#7)
Browse files Browse the repository at this point in the history
* Override appointment status handler for creator as participant scenario

* Include latest bahmni appointment release
  • Loading branch information
mddubey authored and rrameshbtech-tw committed Dec 6, 2019
1 parent 98562d2 commit 66f7c4b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion bintray.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
},

"version": {
"name": "1.0.0-beta",
"name": "1.0.0",
"released": "2019-11-05"
},

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "openmrs-owa-bahmni-appointments",
"version": "1.0.0-beta",
"version": "1.0.0",
"description": "Packages UI of bahmni appointments module as openmrs OWA",
"main": "index.js",
"scripts": {
"clean": "rimraf ./dependencies ./appointments",
"download": "download https://github.com/Bahmni/openmrs-module-appointments-frontend/releases/download/0.0.1/openmrs-module-appointments-frontend.zip -o dependencies",
"download": "download https://github.com/Bahmni/openmrs-module-appointments-frontend/releases/download/openmrs-refapp-support-0.0.2/openmrs-module-appointments-frontend.zip -o dependencies",
"unzip": "extract-zip ./dependencies/openmrs-module-appointments-frontend.zip && rm -f ./dependencies/openmrs-module-appointments-frontend.zip",
"copy": "cp -r ./src/* ./dist/",
"zip": "mv dist appointments && cd appointments && bestzip ../appointments-${npm_package_version}.zip *",
Expand Down
11 changes: 4 additions & 7 deletions src/appointmentStatusHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,7 @@ Bahmni.Appointments.AppointmentStatusHandler = (function () {

clone.status = getStatusForAppointment(appointment);
clone.providers = _.map(clone.providers, function (provider) {
const response = (provider.uuid === currentProviderUuid) ?
providerResponses().ACCEPTED : provider.response;
return {uuid: provider.uuid, response: response};
return {uuid: provider.uuid, response: providerResponses().ACCEPTED};
});
return clone;
};
Expand All @@ -62,10 +60,9 @@ Bahmni.Appointments.AppointmentStatusHandler = (function () {

clone.status = isCurrentProviderInAppointment ? appointmentStatuses().Scheduled :
appointmentStatuses().Requested;
const responseForEveryProvider = isCurrentProviderInAppointment ? providerResponses().ACCEPTED : providerResponses().AWAITING;
clone.providers = _.map(clone.providers, function (provider) {
const response = (provider.uuid === currentProviderUuid) ?
providerResponses().ACCEPTED : providerResponses().AWAITING;
return {uuid: provider.uuid, response: response};
return {uuid: provider.uuid, response: responseForEveryProvider};
});
return clone;
};
Expand Down Expand Up @@ -116,7 +113,7 @@ Bahmni.Appointments.AppointmentStatusHandler = (function () {
return statusAndResponseForScheduledServices(appointment);
}
if (_.isEmpty(appointment.providers)) {
return {status: getStatusForAppointment(appointment), providers:[]};
return {status: getStatusForAppointment(appointment), providers: []};
}
let statusAndProviderResponse = statusAndResponseForRequestedServices(appointment, existingProvidersUuids);

Expand Down

0 comments on commit 66f7c4b

Please sign in to comment.