Announcement

Collapse
No announcement yet.

Mirth 1.3 - Problem checking for null

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

  • Mirth 1.3 - Problem checking for null

    =================
    Environment:

    Mirth 1.3, JRE 1.5 Update 9, Windows Server 2000 SP4 w/ current updates, SQL Server 2000 SP3

    Channel: File Reader to database

    ==================

    Problem: With Mirth 1.1 if there's no data for the segment, check for null worked fine.

    For e.g., If there's no data for Attending Doctor (Scheduling messages S12, S13, etc.) Check for != null would evaluate to false

    But with Mirth 1.3 this check evaluates to true and happens inconsistently.


    // Schedule events S12, S13...

    var pivSegment;

    pivSegment = msg['SIU_S12.PATIENT']['PV1'];

    ========== With Mirth v1.1 this check worked fine if there was no data for the attending doctor

    // Attending doctor
    if (pivSegment['PV1.7'] != null) {
    ...

    }

    ========== With Mirth 1.3, had to make an additional check, string length > 0, for it to work right always

    // Attending doctor
    if (pivSegment['PV1.7'] != null) {

    // Check if the attending doctor's last name string length is > 0
    var checkLastName = pivSegment['PV1.7']['XCN.2'].toString();
    if (checkLastName.length > 0) {
    ...
    }
    }

  • #2
    Re: Mirth 1.3 - Problem checking for null

    This is not a bug, it is due to the improved parsing in Hapi 0.5.
    Chris Lang

    Comment

    Working...
    X