Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Be able to provide available slots to API client #3

Closed
kchapple opened this issue Jul 29, 2016 · 10 comments
Closed

Be able to provide available slots to API client #3

kchapple opened this issue Jul 29, 2016 · 10 comments
Labels

Comments

@kchapple
Copy link
Collaborator

kchapple commented Jul 29, 2016

A client should be able to query available slots for a particular practice using the Appointment Slot resource, which needs to be implemented to close this issue.

Unit test required.

See https://www.hl7.org/fhir/appointment.html#5.27.1.1

@kchapple kchapple added the Story label Jul 29, 2016
@kchapple kchapple added this to the v1.0 milestone Jul 29, 2016
@Leo24
Copy link
Contributor

Leo24 commented Aug 1, 2016

fhir is a Laravel package for talking to a LibreEHR database via FHIR API
How fhir communicates LibreEHR?

What methods implements fhir?

What kind of architecture should have fhir?

@Leo24
Copy link
Contributor

Leo24 commented Aug 1, 2016

Now in this repository LibreEHR/LibreEHR the source code of the website OpenEMR. fhir will be communicating with this website? Or OpenEMR will be rewritten in laravel?

@kchapple
Copy link
Collaborator Author

kchapple commented Aug 1, 2016

There is a core package in the LibreEHR github, which the fhir package depends on. The core package contains the beginnings of a backend API for communicating to the EMR.

The core package contains a set of interfaces in core/src/Contracts which are the interfaces used by the fhir package.

The implementations of those interfaces are in the core/src/Emr directory. For example, src/Emr/Repositories/PatientRepository.php implements the create, and find operations for patients.

The REST controllers and mapping of FHIR models to LibreEHR interfaces and back are located in fhir/src/Http/Controllers and fhir/src/Adapters.

To create a new FHIR Resource endpoint, for Appointment for example, you would

  1. Create an adapter called FHIRAppointmentAdapter that implements BaseAdapterInterface in fhir/src/Adapters with stub methods for
    public function retrieve( $id );
    public function store( Request $request );
    public function collectionToOutput();
  1. Create an Appointment controller in fhir/src/Http/Controllers that extends AbstractController. Look at PatientController for example. The FHIRAppointmentAdapter can be type-hinted by the controllers constructor and automatically injected into the object.
  2. Create a resource route for [base-url]/fhir/Appointment(s) in fhir/src/Http/routes.php that routes the Appointment endpoint to the controller you created.
  3. finish implementing the FHIRAppointmentAdapter by mapping data that comes in through a json request into a libre-ehr/core model and into the database. You will utlize the FHIR models contained in fhir/src/PHPFHIRGenerated, which are automatically generated PHP models of the FHIR API. See fhir/src/Adapters/FHIRPatientAdapter.php to see how the request data is parsed into the PHP models in the method jsonToInterface( $data ){ ... };

The fhir package will communicate with the database in the LibreEHR/LibreEHR. So, if enhancements need to be made for the FHIR API, they will also need to be made to LibreEHR.

fhir api stack

@Leo24
Copy link
Contributor

Leo24 commented Aug 9, 2016

I have a some questions on the implementation of the resource Slot and the Schedule.
On the website of the openemr doctor can schedule an appointment with patient in the time interval from 8:00 to 6:00 the next day. Any day of the week even on Sunday. It was conceived because only the doctor can add calendar entries.
FHIR API allows the patient to enter data in the calendar of the doctor. All the time which is not occupied by other appointments, will be considered free and may be scheduled to appointment (the selected Slot) even at night and on weekends. Also API will ignore that the doctor can have your schedule when he can appointment patients.
So we need the ability to restrict the time interval. Otherwise, how can I implement the resources the Schedule and Slot?

@kchapple
Copy link
Collaborator Author

kchapple commented Aug 9, 2016

Slots are basically availability. Free times and busy time. In OpenEMR the provider sets his in and out of office times, and appointments. The Slot API would use the provider's in-office times and his existing appointments to provide the iPhone app available slots and unavailable slots. It is my understanding that you first query the Schedule resource for a given provider by provider ID and a time frame, then from that get the slots.

Ken

On Aug 9, 2016, at 9:19 AM, Leonid notifications@github.com wrote:

I have a some questions on the implementation of the resource Slot and the Schedule.
On the website of the openemr doctor can schedule an appointment with patient in the time interval from 8:00 to 6:00 the next day. Any day of the week even on Sunday. It was conceived because only the doctor can add calendar entries.
FHIR API allows the patient to enter data in the calendar of the doctor. All the time which is not occupied by other appointments, will be considered free and may be scheduled to appointment (the selected Slot) even at night and on weekends. Also API will ignore that the doctor can have your schedule when he can appointment patients.
So we need the ability to restrict the time interval. Otherwise, how can I implement the resources the Schedule and Slot?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.

@Leo24
Copy link
Contributor

Leo24 commented Aug 9, 2016

The resource Schedule needs to return the time frame size one day or several days?

@kchapple
Copy link
Collaborator Author

kchapple commented Aug 9, 2016

The search would be done by providing the API a Practitioner ID and period identified by a start and end time. See the Schedule FHIR documentation under search parameters. https://www.hl7.org/fhir/schedule.html#search

I would start with a Core API (in core package) that pulls schedule for a given provider ID in between two dates, then we can hook up the FHIR endpoint from there.

Ken

On Aug 9, 2016, at 10:35 AM, Leonid notifications@github.com wrote:

The resource Schedule needs to return the time frame size one day or several days?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.

@Leo24
Copy link
Contributor

Leo24 commented Aug 9, 2016

What is the size of the slot should be? Should it be static or variable?

@kchapple
Copy link
Collaborator Author

kchapple commented Aug 9, 2016

Good question. Use the slot times that are illustrated on the wire frames for now. We can make them configurable later if necessary.

Ken

On Aug 9, 2016, at 10:51 AM, Leonid notifications@github.com wrote:

What is the size of the slot should be? Should it be static or variable?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.

@tmccormi
Copy link

tmccormi commented Aug 9, 2016

OpenEMR allows the slot times to be configured by appointment type. This
information is in the calendar. The UI to access it is
Adminstration->Other->Calendar:Duration field

Table is openemr_postcalendar_categories

Tony McCormick, CTO
www.mi-squared.com
Support: 866-735-0897, Direct: 713-574-6709
My Calendar: http://bit.ly/XznvDo
"Genuinely evolved interfaces are transparent, so transparent as to be
invisible" - William Gibson

On Tue, Aug 9, 2016 at 7:53 AM, Ken notifications@github.com wrote:

Good question. Use the slot times that are illustrated on the wire frames
for now. We can make them configurable later if necessary.

Ken

On Aug 9, 2016, at 10:51 AM, Leonid notifications@github.com wrote:

What is the size of the slot should be? Should it be static or variable?


You are receiving this because you authored the thread.

Reply to this email directly, view it on GitHub, or mute the thread.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#3 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AARciwGgZfuugQFMgbpYYOYv18PvQgr5ks5qeJSAgaJpZM4JYdSO
.

Please be aware that e-mail communication can be intercepted in
transmission or misdirected. Please consider communicating any sensitive
information by telephone. The information contained in this message may be
privileged and confidential. If you are NOT the intended recipient, please
notify the sender immediately with a copy to hipaa-security@mrsb-ltd.com and
destroy this message.

kchapple added a commit that referenced this issue Aug 23, 2016
Patients By Appointment, Slots and Update Appointment [#11] [#3] [#12]
@kchapple kchapple closed this as completed Oct 6, 2016
kchapple added a commit that referenced this issue Jan 5, 2017
Patients By Appointment, Slots and Update Appointment [#11] [#3] [#12]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants