Record Map Validation on Business Service
Had an issue on Friday where a vendor added an additional field in the middle of a row of one of our record maps. This threw the mapping off when I take the record and try to map it into HL7 and caused massive amounts of errors in our EMR because the data was wrong.
Is there a way that I can add validation on the Business Service to say if the fields are off to fail, stop, and alert on the Business Service?
Comments
The RecordMap services have options for handling errors:
.png)
I'm not sure whether they do actual datatype validation on fields in the RecordMap (wouldn't make much sense to let you specify datatypes without supporting validation though).
But if your extra field didn't trigger some sort of warning or error in the Event Log 🤷♂️
UPD: Never mind, that's the wrong answer as it's about HL7. Sorry about that.
There are two ways to do that:
- Use
EnsLib.MsgRouter.VDocRoutingEngine, it hasValidationsetting which is a string specifying types of validation to perform. Set to1to block documents that don't pass default validation. Default validation checks for DocType assignment and successful BuildMapStatus. This is equivalent to 'dm': 'd' - require DocType 'm' - require successful BuildMap status. Set to0to skip validation. In addition configureBad Message Handlersetting to handle messages which fail validation. I'm not sure it your messages would fail BuildMap validation, but that's the easiest option to implement. - Create a subclass of
EnsLib.MsgRouter.RoutingEngineand implementOnValidatemethod to provide custom validation. You'll also need to add Validation property to settings, same asEnsLib.MsgRouter.VDocRoutingEnginedoes. InOnValidatemethod you can perform any checks you like.