From c85040014650652da6ea684612d876a978d56d43 Mon Sep 17 00:00:00 2001 From: Ken Chapple Date: Tue, 20 Dec 2016 13:25:07 -0500 Subject: [PATCH] fixing database switching issues --- src/Adapters/FHIRAppointmentAdapter.php | 2 +- src/Adapters/FHIRSlotAdapter.php | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Adapters/FHIRAppointmentAdapter.php b/src/Adapters/FHIRAppointmentAdapter.php index 04658d4..7a0246a 100644 --- a/src/Adapters/FHIRAppointmentAdapter.php +++ b/src/Adapters/FHIRAppointmentAdapter.php @@ -421,7 +421,7 @@ public function interfaceToModel(AppointmentInterface $appointment) $value = new FHIRString(); $providerRepo = new ProviderRepository(); $user = Auth::user(); - $provider = $providerRepo->findByEmrIdfindByEmrIdAndConnection( $appointment->getProviderId(), $user->connection ); + $provider = $providerRepo->findByEmrIdAndConnection( $appointment->getProviderId(), $user->connection ); $authId = $provider->getId(); $value->setValue( $authId ); $valueProviderId->setValueString($value); diff --git a/src/Adapters/FHIRSlotAdapter.php b/src/Adapters/FHIRSlotAdapter.php index cac1baa..10149f8 100644 --- a/src/Adapters/FHIRSlotAdapter.php +++ b/src/Adapters/FHIRSlotAdapter.php @@ -57,6 +57,10 @@ public function getSlots(Request $request) if (!empty($request->server->get('QUERY_STRING'))) { $data = $this->parseUrl($request->server->get('QUERY_STRING')); + $authProviderId = $data['provider']; + $providerRepo = new ProviderRepository(); + $provider = $providerRepo->get( $authProviderId ); + $data['provider'] = $provider->getEmrId(); $collection = $this->repository->getSlots($data); } else { $data['startDate'] = date('Y-m-d');