SFTP provider test

I have setup a sftp provider in OpenEMR v7.0.0. While creating orders from an Encounter, OpenEMR successfully creates a orders hl7 file (in txt extension) in my sftp orders folder. I want to test the return result by importing it in the OpenEMR from my sftp results folder, what should my result file look like (the contents, extension and name of the file) so that it can be imported in the electronic reports section in Procedures tab ?

@saurav_dh the results file should look like this. This is not a real patient. This is a test file sent by the lab company to test our inbound receiving of lab results. No PHI is in this file.

FFC_{D0345D84-90B1-4135-98DF-DC999A2E91C2}.txt (4.0 KB)

Also, the lab results file is going to vary depending on the order type and the result set that is being sent back.

1 Like

Thanks @juggernautsei for replying, I created a procedure order for one of my dummy patients in OpenEMR. The order file was placed in my SFTP orders folder as Haven Health-0055.txt and it looks something like this (I have renamed some names for privacy reasons):

MSH|^~\&|Sender Name|Haven Health|VendorName|VendorLabName|20230419052607||ORM^O01|Haven Health-0055|P|2.3
PID|1|12|12||Conroy74^Timothy142||20101226|M|||233 Bosco Alley^^Oxford^Massachusetts^||(555)214-2778|||||57|999-15-9496|||
NTE|1|L|medications NONE
PV1|1||||||^Dhungana^Saurav||||||||||||57|||||||||||||
IN1|1||||||||||||||||||||||||||||||||||||||||||||||P
GT1|1||Conroy74^Timothy142||233 Bosco Alley^^Oxford^Massachusetts^|(555)214-2778||20101226|M||self|999-15-9496
ORC|NW|Haven Health-0055|||||||20230419052607|||^Dhungana^Saurav||||||||2

I asked chatgpt to create a corresponding result file for this and it created:

MSH|^~\&|LabName|1||Haven Health|1||ORU^R01|1|P|2.3|
PID|1||12||Conroy74^Timothy142||20101226|M|||
OBR|1|Haven Health-0055|||20230419052607|||1|||||||||||||||||||
OBX|1||NM|GLU^Glucose||80|mg/dL||||F|||20230419052707|
OBX|2||NM|BUN^Blood Urea Nitrogen||15|mg/dL||||F|||20230419052707|
OBX|3||NM|CRE^Creatinine||1.0|mg/dL||||F|||20230419052707|
OBX|4||NM|NA^Sodium||140|mEq/L||||F|||20230419052707|
OBX|5||NM|K^Potassium||4.0|mEq/L||||F|||20230419052707|
OBX|6||NM|CL^Chloride||100|mEq/L||||F|||20230419052707|
OBX|7||NM|CO2^Carbon Dioxide||25|mEq/L||||F|||20230419052707|
OBX|8||NM|CA^Calcium||9.0|mg/dL||||F|||20230419052707|
OBX|9||NM|PRO^Protein, Total||6.0|g/dL||||F|||20230419052707|
OBX|10||NM|ALB^Albumin||4.0|g/dL||||F|||20230419052707|
OBX|11||NM|AST^AST||20|IU/L||||F|||20230419052707|
OBX|12||NM|ALT^ALT||25|IU/L||||F|||20230419052707|
OBX|13||NM|ALP^Alkaline Phosphatase||70|IU/L||||F|||20230419052707|
OBX|14||NM|BILI^Bilirubin, Total||0.5|mg/dL||||F|||20230419052707|
OBX|15||NM|GGT^GGT||15|IU/L||||F|||20230419052707|

I placed this file by naming it Haven Health-0055.hl7 in my results folder. Then when I went to the
electronic reports section of OpenEMR and tried to import this file it shows the file but with an error Procedure order not found: 0 .

Am I missing something here or maybe I did something wrong ? Also when I click the resolve orphans button, OpenEMR deletes the result file from the SFTP and new order is created order 56 when it should have been 55.

I am not sure what you are seeking in the way of information from this conversation. You have done everything to prove your first question about results being brought into the system. You only miss the fields that identify the order number, patient and encounter. Those are the three pieces of information missing from the results file you created.

@juggernautsei

So what I am trying to achieve is partially success right ? To get rid of that error message and successfully import results file into OpenEMR I must make some changes in my results file,

Can you tell me what segments and field will hold those information (that identify the order number, patient and encounter) ? Is it the ORC segment ? What would my result file look like if all those info are present?

@saurav_dh
This is the segment that holds the patient information.

PID|1||H001478118||FLOREZ VASQUEZ^ROSMERY||19950427|||||||||||H44847312866|059-35-2028

Unfortunately without jumping into the code to look for the segments. I can’t tell you which segment the encounter number goes in. But if you look in interface/orders/ and look for the results file. You can find the segments the code is looking for that information and count it up.
As you can see in the line I posted. The patient’s name comes first then the DOB is next.

The last system I worked on the lab did not accept the patient ID or encounter number from the lab order requests so we could not get that information back. We had to come up with a system for orphan file matching.

Best!