Transaction API

Hello,

I would like to do basic crud operations on transactions (specifically referrals) via an API. Checked the docs (well written) and didn’t see anything related to transactions there so I forked and started implementing it myself. Just curious what the usual turn around is for getting a PR completed.

Thanks!

Hi @JMoore , can be quite fast. @brady.miller reliably reviews the code magically overnight and by the next morning you’ll find something he left. Kind of like the :tooth: :fairy: :grinning_face_with_smiling_eyes:

2 Likes

@stephenwaite haha appreciate the speedy reply and thanks for the info!

@stephenwaite Hi, me again. Another quick question for you on this. So say i want to do this work on 5.0.2. What would you recommend as the best way to deploy this? Are there still official patches being created for this version that i could wait for? Or would i have to create this manually?

Haven’t been able to find much documentation on this so feel free to point me there if you know of any that answer this question.

thanks again!

hi @JMoore, would def add fixes to master and then port to current release of v6.

@JMoore
Where are you planning to implement endpoints, standard API or add to FHIR(say patient with search param)?

@sjpadgett Just a standard API

@stephenwaite Will ponder this, i was trying to go with an approach that didn’t involve updating to V6. With this in mind, the best place for me to do this would be in rel-502 right?

rel-502 is not maintained any longer

Well that’s good to know. So if i did the changes in master, and then ported them to V6 then i’d just have to wait until the next patch is created i guess.

Or you could create your own patch

How would a humble developer go about creating a patch? Are you referring to this project (GitHub - openemr/openemr-devops: OpenEMR administration and deployment tooling)? Or is there another way to do this?

can guide you once you get your PR going, there’s some git tips and tricks to make it easy and understandable

I’ll be holding you to that :slight_smile: . If i did take the lazy man approach and wait for a patch, is there a timeline on these things like every x months, or do patches just appear when the time is right?

usually every 2 to 3 months but more in the spirit of the time is right

Gotcha, thanks for all the info! you da bomb @stephenwaite

Hello All,

Question on adding a new user api route. I added a quick test in _rest_routes.inc.php

image

But when i call it from Post Man i’m getting a 401 error

Also noticed that if i change ‘GET /api/patient’ to ‘GET /api/patientTest’ and try to call that i get the same 401 error. Am i missing a spot to declare my new api?

Add your controller to the route. Also ensure you include with a use.

So I’m guessing you haven’t added the corresponding scope to the ScopeRepository.php::apiScopes() function. For your test it would be user/APITest.read and patient/APITest.read.

You’ll need to register a client with the APITest.read scope and request that with your access token. Otherwise you’ll get the 401 error you are seeing.

Something you may find helpful is how the module system extends the API. I wrote a skeleton module that shows how to extend the FHIR api in a module via the events. https://github.com/adunsulag/oe-module-custom-skeleton

Look specifically at the subscribeToAPIEvents function here: https://github.com/adunsulag/oe-module-custom-skeleton/blob/91828782a75dc7d990b19a83cc9a85027773807f/src/Bootstrap.php#L257

That’s what i was missing, thanks!

Also checked out the repo you sent (really cool), and it looks to be the route i want to go. I’d like to get my new api up and running in dev to get my feet wet with the code base, then transition it to a module.