Announcement

Collapse
No announcement yet.

Error messages for FHIR resource builders

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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.

  • #2
    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.

    Comment


    • #3
      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.

      Comment


      • #4
        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.

        Comment

        Working...
        X