Skip to content

Commit

Permalink
edited partner apis
Browse files Browse the repository at this point in the history
  • Loading branch information
CynthiaKamau committed Mar 1, 2021
1 parent c15f342 commit 44d3127
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/Http/Controllers/API/ExposureController.php
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ public function facility_covid_exposures($id)

public function partner_covid_exposures($id)
{
$hcws = PartnerUser::where('partner_id',$id)->pluck('user_id');
$hcws = PartnerUser::where('partner_id',$id)->pluck('user_id')->first();;

Log::info("HCWs:". $hcws);

Expand Down
6 changes: 4 additions & 2 deletions app/Http/Controllers/API/ImmunizationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function facility_immunizations($id)

public function partner_immunizations($id)
{
$hcws = PartnerUser::where('partner_id',$id)->pluck('user_id');
$hcws = PartnerUser::where('partner_id',$id)->pluck('user_id')->first();;

Log::info("hcws ", json_decode($hcws));

Expand All @@ -60,12 +60,14 @@ public function partner_immunizations($id)
public function facility_immunizations_by_disease($id, $disease_id)
{
$hcws = HealthCareWorker::where('facility_id',$id)->pluck('user_id');

return new GenericCollection(Immunization::where('disease_id', $disease_id)->orderBy('id','desc')->whereIn('user_id',$hcws)->paginate(100));
}

public function partner_immunizations_by_disease($id, $disease_id)
{
$hcws = PartnerUser::where('partner_id',$id)->pluck('user_id');
$hcws = PartnerUser::where('partner_id',$id)->pluck('user_id')->first();
;
return new GenericCollection(Immunization::where('disease_id', $disease_id)->orderBy('id','desc')->whereIn('user_id',$hcws)->paginate(100));
}

Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/API/ResourcesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ public function delete_facility_protocol($id){

public function get_partner_protocols($id)
{
$hcws = PartnerFacility::where('partner_id',$id)->pluck('facility_id');
$hcws = PartnerFacility::where('partner_id',$id)->pluck('facility_id')->first();;

Log::info("HCWs:". $hcws);

Expand Down

0 comments on commit 44d3127

Please sign in to comment.