# Bidirectional lab results input from SFTP

**URL:** <https://community.open-emr.org/t/bidirectional-lab-results-input-from-sftp/22744>\
**Category:** Management and Administration\
**Created:** [June 5, 2024, 5:48pm UTC](https://community.open-emr.org/t/bidirectional-lab-results-input-from-sftp/22744 "2024-06-05T17:48:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bo\_Wang](https://community.open-emr.org/user_avatar/community.open-emr.org/bo_wang/32/17786_2.png) [@Bo\_Wang](https://community.open-emr.org/u/Bo_Wang)\
**Post date:** [June 5, 2024, 5:48pm UTC](https://community.open-emr.org/t/bidirectional-lab-results-input-from-sftp/22744/1 "2024-06-05T17:48:02Z")

</div>

Is there a setting to see/adjust how often OpenEMR would visit the SFTP website to fetch lab results back? Or is it only processed when one goes to Procedures\Electronics Report to process results? Thx…!

---

<div class="post-metadata">

**Author:** ![sjpadgett](https://community.open-emr.org/user_avatar/community.open-emr.org/sjpadgett/32/21623_2.png) [@sjpadgett](https://community.open-emr.org/u/sjpadgett)\
**Post date:** [June 5, 2024, 6:32pm UTC](https://community.open-emr.org/t/bidirectional-lab-results-input-from-sftp/22744/2 "2024-06-05T18:32:15Z")

</div>

> [@Bo\_Wang](#):
>
> Or is it only processed when one goes to Procedures\Electronics Report to process results?

True! You’d have to set up a cron job or create a background task script to schedule tasks.

---

<div class="post-metadata">

**Author:** ![Bo\_Wang](https://community.open-emr.org/user_avatar/community.open-emr.org/bo_wang/32/17786_2.png) [@Bo\_Wang](https://community.open-emr.org/u/Bo_Wang)\
**Post date:** [June 5, 2024, 6:49pm UTC](https://community.open-emr.org/t/bidirectional-lab-results-input-from-sftp/22744/3 "2024-06-05T18:49:48Z")

</div>

@sjpadgett Thank you Jerry for the advice!  
In that regard would it delete result files from SFTP server or leave them unchanged? Is there any document to elucidate the processes?

---

<div class="post-metadata">

**Author:** ![sjpadgett](https://community.open-emr.org/user_avatar/community.open-emr.org/sjpadgett/32/21623_2.png) [@sjpadgett](https://community.open-emr.org/u/sjpadgett)\
**Post date:** [June 5, 2024, 6:59pm UTC](https://community.open-emr.org/t/bidirectional-lab-results-input-from-sftp/22744/4 "2024-06-05T18:59:41Z")

</div>

Best I can do for now is just point you to some code which is pretty straight forward.  
`interface/orders/receive_hl7_results.inc.php` of interest may be this function `poll_hl7_results(&$info, $labs = 0)` at L-1533
