web stats
Error messages for FHIR resource builders - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 02-22-2019, 08:34 AM
ppazos ppazos is offline
OBX.2 Kenobi
 
Join Date: May 2008
Posts: 75
ppazos
Default Error messages for FHIR resource builders

Hi,

I have been using resource builders quite often in the last couple of months.

Noticed some issues:

1. If there is a missing subject on, for instance, Procedure or MedicationAdministration, the error when trying to go back to the channel is: error on line 177, then a UUID.

I would suggest to make those errors less obscure, like "missing mandatory subject on {transformer_step_name}"

2. When selecting Map Variable to put the final object on the channel map, the code automatically does JSON.stringify(resource).

The issue is if we want to use the resource after, need to JSON.parse it again, considering that we where building a JSON already, we are doing 2 extra unneeded steps. I would suggest to leave the option to the user on what to do, if they want to map.put(JSON.stringify(resource)) or just map.put(resource).

This is a great extension, and this is my 2 cents to make it more usable.
Thanks.
Reply With Quote
  #2  
Old 02-22-2019, 08:42 AM
narupley's Avatar
narupley narupley is online now
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,111
narupley is on a distinguished road
Default

If you need to use the resource in a later transformer step, why not use the Local Variable option instead? That's the default option.

For example if you're building a Patient resource, and in a previous step you build a HumanName object, there's no need to store that HumanName in the channel map. Just keep it as a local variable, then later on in the Patient builder you can reference that variable directly in the corresponding property field.
__________________
Step 1: JAVA CACHE...DID YOU CLEAR ...wait, ding dong the witch is dead?

Nicholas Rupley
Work: 949-237-6069
Always include what Mirth Connect version you're working with. Also include (if applicable) the code you're using and full stacktraces for errors (use CODE tags). Posting your entire channel is helpful as well; make sure to scrub any PHI/passwords first.


- How do I foo?
- You just bar.
Reply With Quote
  #3  
Old 02-23-2019, 08:31 AM
ppazos ppazos is offline
OBX.2 Kenobi
 
Join Date: May 2008
Posts: 75
ppazos
Default

I don't think local variable works when building a resource in a source transformer step and using it from a destination transformer or filter or on a destination connector. I'm referring to those use cases that will need to parse the json back from the string.

Another related thing that is not so clear is when using a variable on part of a FHIR resource, if the value of the var should be string of json. That is another difficulty I found using the extension.

I already found workarounds for everything, not asking how to do things, just giving feedback on what could be improved.

Hope that helps.
Reply With Quote
  #4  
Old 02-25-2019, 07:21 AM
narupley's Avatar
narupley narupley is online now
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,111
narupley is on a distinguished road
Default

That's true, a local variable would only be accessible within that same transformer.

But if you put the object into the channel map, at some point it needs to be serialized and written to the database. So that's why we automatically convert it to JSON. Otherwise it would just take the toString() value which is just "[object Object]".
__________________
Step 1: JAVA CACHE...DID YOU CLEAR ...wait, ding dong the witch is dead?

Nicholas Rupley
Work: 949-237-6069
Always include what Mirth Connect version you're working with. Also include (if applicable) the code you're using and full stacktraces for errors (use CODE tags). Posting your entire channel is helpful as well; make sure to scrub any PHI/passwords first.


- How do I foo?
- You just bar.
Reply With Quote
Reply

Tags
fhir

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 01:02 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Mirth Corporation