Ask a Question

HL7 message validatiion and virtualization

SOLVED
swapnils
Occasional Contributor

HL7 message validatiion and virtualization

Hi Team,

 

We would like to know about how this Test Complete help Tester to HL7 message validation or other way how to validate HL7 message using any SmartBear tool.  There are many type of message :

Most commonly used HL7 message types include:

ACK – General acknowledgement
ADT – Admit, Discharge, Transfer
BAR – Add/change billing account
DFT – Detailed financial transaction
MDM – Medical document management
MFN – Master files notification
ORM – Order (Pharmacy/treatment)
ORU – Observation result (unsolicited)
QRY – Query, original mode
RAS – Pharmacy/treatment administration
RDE – Pharmacy/treatment encoded order
RGV – Pharmacy/treatment give
SIU – Scheduling information unsolicited

 

It would be grateful, if I get the response at the earliest; So that I can take the next steps accordingly.

 

Thanks,

Swapnil

9 REPLIES 9
nmrao
Community Hero

Quite an interesting use case.

If the idea is to simulate, and you can give it a try ServiceV. Never tried though.

https://support.smartbear.com/readyapi/docs/servicev/index.html

 



Regards,
Rao.
swapnils
Occasional Contributor

Hi Team,

 

Thanks for you quick reply.

 

Could you please explain in more detail how can we apply validations on HL7 messages  and is this tool support all expected validation on this HL7 messages as like APIs validation.

 

Thanks,

Swapnil

Hey @swapnils,

I had to do a bit of reading because id never heard of HL7 messages before, but after a bit of reading and then i saw an example and realised despite not knowing what an HL7 message was, i actually had a project on a contract for the british NHS about 3 years ago which passed these | delimited flat file HL7 messages (although the documentation didnt call them HL7) from one existing legacy system which was then transformed to json to be consumed by MS Dynamics CRM and then back again to the legacy system (that generates and consumes the HL7 messages).
The way i set this up in ReadyAPI! was to create csv's (1 for each test case) using Excel, which i then after creation opened the csv's in notepad++ and replaced each comma with a vertical bar delimiter then resaved the file as .dat.

I used the directory type datasource to provide the files for my payloads to my REST requests.

I need to highlight that the messaging used message queues so was asynchronous so in regards to validation we used a novel approach for the validation of my .dat files as the live system didnt provide responses to enable assertions.

We got the developers to create additional apis that hooked into the existing apis that provided responses after submitting either valid or invalid HL7 messages. I can explain further if you provide the technical architecture for your project. I.e. message flow (generation and consumption), how are the HL7 messages being consumed? Any transformation? Etc.?

Anyway. The short answer was that due to the lack of validators (like .json or .xml schema) and the asynchronicity, we needed the developers to create additional apis that provided responses against which we could assert against.

Hope this helps,

Rich
if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta
swapnils
Occasional Contributor

Hi Rich ,

 

Thanks for your reply. 

here is details  :    HL7 message validation for inbound and outbound. for e.g

 

Inbound Message :

MSH|^~\&|EPIC|EPICADT|SMS|SMSADT|199912271408|CHARRIS|ADT^A04|1817457|D|2.5|
PID||0493575^^^2^ID 1|454721||DOE^JOHN^^^^|DOE^JOHN^^^^|19480203|M||B|254 MYSTREET AVE^^MYTOWN^OH^44123^USA||(216)123-4567|||M|NON|400003403~1129086|
NK1||ROE^MARIE^^^^|SPO||(216)123-4567||EC|||||||||||||||||||||||||||
PV1||O|168 ~219~C~PMA^^^^^^^^^||||277^ALLEN MYLASTNAME^BONNIE^^^^|||||||||| ||2688684|||||||||||||||||||||||||199912271408||||||002376853

 

Outbound message :

MSH|^~\&|SMS|199912271408|EPIC|EPICADT|20200416191818||ACK|ACK20200416191818|P|2.3
MSA|AA|D

 

 

Need to validate both inbound and outbound message.

 

Could you please provide us the steps to validate inbound and outbound message with your recommended tool ?

 

Thanks,

Swapnil

Hey @swapnils,

Have you got code or do you intend to use Virts? Ive only played with Virts before now as they only really come into their own for automation not manual testing and by the time my tests have been created ive always had code to test against.

By definition if you have code to test against the AUT will include validators.

What is the mechanism for consumption of the HL7 messages? REST APIs?
Some ETL file load process like Oracle's sql loader?
How are the files built in the live system....what is the ETL process used to create the files?
Is there any transformation occurring AFTER the etl extraction process?
Is the message exchange pattern synchronous or asynchronous?

When you talk about validating your messages are you talking about validating the testdata files youve created BEFORE you start testing or are you talking about validating your messages during testing? Theoretically i disagree with adding schema validation assertions into soapui tests anyway if youre testing code rather than a Virt anyway cos if youre testing code your submissions are always validated by your endpoint anyway, so if the message returns a successful response, the request was valid. Im not saying here dont include tests for each valid and invalid scenario cos depending on the risk and prioritisation i always do, its just that if a message returns a successful response when hitting code, the request must be valid.

If you are testing against code rather than Virts, depending on the answers to my questions above the developers can create additional apis that hook into your genuine endpoints to provide you responses that allow you to test. If youre using Virts your developers code add in the validators to your Virts to verify your messages.
If youre testing code as i say above and its synchronous MEP (so you get a response to work with) and you get a successful response and your Post/Put/Patch (if RESTful) updates the database successfully then by definition your request must have been valid relative to your endpoint api schema and also conforms with your db constraints (null allowed/not allowed, datatypes and field length). Yes i appreciate a request may get through the endpoints validator but then get rejected when attempting to update the database (say if field length in validator is 10, but db field length is 8 or inconsistent datatypes or null not allowed issues, etc.), but prior to testiny id expect a deskcheck/static test of the endpoints validator against the dbs data dictionary to get the validator/db aligned.

You mention what 'tool' i used to validate my messages, but i verified the validation by successful and unsuccessful writes to the database by using ReadyAPI! to inject the messages. It was asynch, so i needed the additional test apis to hook into to provide my responses. If your project uses REST and is synch (so you get responses to assert against) you dont necessarily need to verify the validation, youll do it by successfully and unsuccessfully injecting messages known to be valid and invalid.

I know ive talked at length above, but its just that all the above considerations feed into my approach used whenever i test anything. I do testing but my principal job for the most part is defining the integration/api testing strategy that a company should adopt across the programme for each of its projects and so i needed to highlight that you need a lot more info before you can come up with a testing approach for the project youre working on.

Hope this helps,

Rich
if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta
swapnils
Occasional Contributor

Hi Rich ,

 

Thanks for your reply.

 

Here are details :  HL7 message validation for inbound and outbound. for e.g

 

Inbound Message :

 

MSH|^~\&|EPIC|EPICADT|SMS|SMSADT|199912271408|CHARRIS|ADT^A04|1817457|D|2.5|

PID||0493575^^^2^ID 1|454721||DOE^JOHN^^^^|DOE^JOHN^^^^|19480203|M||B|254 MYSTREET AVE^^MYTOWN^OH^44123^USA||(216)123-4567|||M|NON|400003403~1129086|

NK1||ROE^MARIE^^^^|SPO||(216)123-4567||EC|||||||||||||||||||||||||||

PV1||O|168 ~219~C~PMA^^^^^^^^^||||277^ALLEN MYLASTNAME^BONNIE^^^^|||||||||| ||2688684|||||||||||||||||||||||||199912271408||||||002376853

 

Outbound message :

 

MSH|^~\&|SMS|199912271408|EPIC|EPICADT|20200416191818||ACK|ACK20200416191818|P|2.3

MSA|AA|D

 

 

Most commonly used HL7 message types include:

  •          ACK – General acknowledgement
  •          ADT – Admit, Discharge, Transfer
  •          BAR – Add/change billing account
  •          DFT – Detailed financial transaction
  •          MDM – Medical document management
  •          MFN – Master files notification
  •          ORM – Order (Pharmacy/treatment)
  •          ORU – Observation result (unsolicited)
  •          QRY – Query, original mode
  •          RAS – Pharmacy/treatment administration
  •          RDE – Pharmacy/treatment encoded order
  •          RGV – Pharmacy/treatment give
  •          SIU – Scheduling information unsolicited

 

Connection details and Steps :

 

  1.        Create a message from a URI or file, or create a new message.
  2.        Select an MLLP (TCP/IP)connection from the Connection dropdown menu, or enter the endpoint manually.
  3.        The endpoint consists of the name or IP address of the host and the port separated by colon, e.g. 10.100.16.90:11000.

 

Need to validate both inbound and outbound message.

 

If possible could you please provide us the steps to validate inbound and outbound message with your recommended tool ?

 

Please assist us on this.

 

Thanks,

Swapnil

Hey @swapnils,

I'm sorry.....i don't mean to keep repeating myself, its just your answers to the questions im asking feed into the approach for your api testing....

Have you got code to test against or do you intend to use Virts until you have code to test?

Is there any transformation occurring AFTER the HL7 messages (either inbound or outbound) are created but before they are consumed by an endpoint api?

Is the message exchange pattern synchronous or asynchronous? I.e. from your last post it appears youve already indicated this is REST, so does the system generate a response when you publish a message to be consumed? (Incoming message)

What is the endpoint for the outgoing message....is this outgoing message still consumed via a REST api?


Regarding the following details you mention in your last post:

Connection details and Steps :



Create a message from a URI or file, or create a new message.
Select an MLLP (TCP/IP)connection from the Connection dropdown menu, or enter the endpoint manually.
The endpoint consists of the name or IP address of the host and the port separated by colon, e.g. 10.100.16.90:11000.

Is this how you generate messages and specify the endpoints im the system under test?

Cheers....as i said above, im sorry to keep repeating myself, but the questions are essential to helping to answer,

Rich
if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta
swapnils
Occasional Contributor

Hi Rich ,

I am sorry, if i am not able to convey my concern.

This is HL7 message validation this is part of CorePoint interface validation.

Protocol : TCP/IP , MLLP ( Minimal Lower Layer Protocal)

Inbound Message / Request :

MSH|^~\&|GHH LAB|ELAB-3|GHH OE|BLDG4|200202150930||ORU^R01|CNTRL-3456|P|2.4<cr>
PID|||555-44-4444||EVERYWOMAN^EVE^E^^^^L|JONES|19620320|F|||153 FERNWOOD DR.^^STATESVILLE^OH^35292||(206)3345232|(206)752-121||||AC555444444||67-A4335^OH^20030520<cr>
OBR|1|845439^GHH OE|1045813^GHH LAB|15545^GLUCOSE|||200202150730|||||||||555-55-5555^PRIMARY^PATRICIA P^^^^MD^^|||||||||F||||||444-44-4444^HIPPOCRATES^HOWARD H^^^^MD<cr>
OBX|1|SN|1554-5^GLUCOSE^POST 12H CFST:MCNC:PT:SER/PLAS:QN||^182|mg/dl|70_105|H|||F<cr>


OutBound Message / Responce :

MSH|^~\&|SMS|199912271408|EPIC|EPICADT|20200416191818||ACK|ACK20200416191818|P|2.3

MSA|AA|D


Rest of the things are same as Rest API validation e.g.

-Status Code
- Response time
- Expected Response and Actual response
- validation of Request or Inbound message

 

Please let me know is this proper information about Hl7 validation ( health Care / CorePoint )

 

Thanks,
Swapnil

TanyaYatskovska
SmartBear Alumni (Retired)

Hi @swapnils,

 

I see that you asked this question in the TestComplete community also. As far as I understand, your initial task is to compare HL7 messages. I'm not sure of any of SmartBear tools allow doing it out of the box. However, all of them provide rich scripting features that you can use. In ReadyAPI, you can treat HL7 message as a file and write a groovy script to compare the inbound and outbound files. You can prepare a similar script in TestComplete as well.

I suppose you will need to work with regular expressions.

 

If this isn't what you are looking for, could you please describe your task in detail?

 

---------
Tanya Yatskovskaya
SmartBear Community and Education Manager



cancel
Showing results for 
Search instead for 
Did you mean: