-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
3757: Split hospitalization indicators report by projects r=jeremielodi a=mbayopanda This PR : - Link service with project by adding a new column `project_id` in service - Split hospitalization indicators by projects in the indicators report Co-authored-by: mbayopanda <mbayopanda@gmail.com>
- Loading branch information
Showing
20 changed files
with
307 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,51 @@ | ||
angular.module('bhima.services') | ||
.service('ServiceService', ServiceService); | ||
.service('ServiceService', ServiceService); | ||
|
||
ServiceService.$inject = [ '$http', 'util' ]; | ||
ServiceService.$inject = ['$http', 'util']; | ||
|
||
function ServiceService ($http, util) { | ||
var service = this; | ||
var baseUrl = '/services/'; | ||
function ServiceService($http, util) { | ||
const service = this; | ||
const baseUrl = '/services/'; | ||
|
||
service.create = create; | ||
service.read = read; | ||
service.update = update; | ||
service.delete = del; | ||
service.count = count; | ||
|
||
function create(service) { | ||
return $http.post(baseUrl, service) | ||
.then(util.unwrapHttpResponse); | ||
function create(_service_) { | ||
return $http.post(baseUrl, _service_) | ||
.then(util.unwrapHttpResponse); | ||
} | ||
|
||
function read(id, params) { | ||
var url = baseUrl.concat(id || ''); | ||
return $http.get(url, { params : params }) | ||
.then(util.unwrapHttpResponse); | ||
const url = baseUrl.concat(id || ''); | ||
return $http.get(url, { params }) | ||
.then(util.unwrapHttpResponse); | ||
} | ||
|
||
function update(id, service) { | ||
delete service.abbr; | ||
delete service.enterprise_name; | ||
delete service.cc_id; | ||
delete service.pc_id; | ||
delete service.cost_center_name; | ||
delete service.profit_center_name; | ||
function count() { | ||
const url = baseUrl.concat('count'); | ||
return $http.get(url) | ||
.then(util.unwrapHttpResponse); | ||
} | ||
|
||
function update(id, _service_) { | ||
delete _service_.abbr; | ||
delete _service_.enterprise_name; | ||
delete _service_.cc_id; | ||
delete _service_.pc_id; | ||
delete _service_.cost_center_name; | ||
delete _service_.profit_center_name; | ||
|
||
return $http.put(baseUrl + id, service) | ||
.then(util.unwrapHttpResponse); | ||
return $http.put(baseUrl + id, _service_) | ||
.then(util.unwrapHttpResponse); | ||
} | ||
|
||
function del(id) { | ||
return $http.delete(baseUrl + id) | ||
.then(util.unwrapHttpResponse); | ||
.then(util.unwrapHttpResponse); | ||
} | ||
|
||
return service; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.