Add path variable in openHIM channel

Hello good people,

I’m new with OpenHIM, I’m facing a problem on how to add dynamic path variable on Request Matching as well as Route from openHIM console. Can any one of you help me with this?

Thanks

1 Like

@technical_committee

@ryan @chris
Please see this OpenHIM question.

Suppose I want to fetch information for a patient, to do this I need to provide the patient ID on the get request. I want to accept this id on channel and then use this ID to the appropriate path in routes tab. I want to accept the patientID from request matching URL and then pass this patientID on Route Path. Can you please help me how to do this this?

Hi

Is this a feature that is available in OpenHIM?

If not, what is the recommended way to achieve it?

Hi @yassin and @emon.swe.sust! Thanks for your questions on OpenHIM and it’s features, please allow me to tag community member, @ryan to see if he can help provide some responses!

Hi, yes this is possible. The channel path accepts a regex so you could do something like: Patient/.* to accept a patient with an id in the path. Then on the route you can use the route transform option to turn it into what ever you like. It uses a sed expression E.g. ‘s/Patient/my/new/path/’ Otherwise you can keep the path the same by leaving all path options blank.

It’s working now.

Thanks @kaalcumm and @ryan.

1 Like