XMap Getting Started Guide

XMap Getting Started Guide

Step 1. Create a Router Statement

Step 1. Create a Router Statement

Create a Router statement to check the phone numbers. Add Option statements that check if a phone number type is a mobile, work, or home phone number.
  1. In the
    XMap
    view, add a Repeating Group statement to the
    Patient_Claim
    XMap. To create a Repeating Group, in the XMap editor grid select the
    Doctor to Claims
    Repeating Group. Right-click and select
    New
    Repeating Group
    .
  2. To name the Repeating Group, double-click the
    Name
    field and type the name
    SortPhones
    .
  3. To evaluate the phone numbers in the input, drag the
    Phone
    node into the
    Input
    field of the Repeating Group.
    The following image shows the Repeating Group statement:
    "The mapping statements editor contains a filterPhones Repeating Group that iterates for each phone in a set of details for a specific doctor."
  4. To filter phone numbers by type for each doctor, create a Router. In the XMap editor grid, select the
    SortPhones
    Repeating Group, right-click and select
    New
    Router
    .
    The following image shows the XMap editor with the Router statement:
    "The mapping statements grid contains the PhoneType Router nested under the filterPhones Repeating Group. Each time there is a phone in the input for a doctor, the statements are iterated and the Router is checked."
  5. To name the Router statement, double-click the
    Name
    field and type the name
    PhoneType
    .
  6. To filter mobile numbers, create an Option. Right-click and select
    New
    Option
    .
  7. To name the Option statement, double-click the
    Name
    field and type the name
    Mobile
    .
  8. To make the
    Mobile
    statement check that the type of phone number is a mobile number, drag the mouse from the
    @type
    input schema node to the
    Condition
    field in the
    Mobile
    statement. To define the condition, perform the following steps:
    1. To open the XPath Expression editor, click the arrow to the right of the
      Condition
      field.
    2. Use the XPath Expression editor to edit the expression to the following syntax:
      @type="mobile"
      The following image shows the XMap editor with the Option statement:
      "The mapping statement grid contains a Mobile Option statement nested under the PhoneType Router statement. The Option statement checks if the input element for the phone is of type "mobile." The Option statement does not perform any further action. Nest a Map statement under the Option statement in order to perform any further action."
  9. Drag from the
    Phone
    input schema node to the
    MobilePhone
    output schema node.
    The XMap editor creates a Map statement named
    Phone to MobilePhone
    in the grid under the
    Mobile
    statement. The statement passes the first instance of the node to the output XML. The
    Input
    field contains the following expression:
    .[1]
    . We want to select the current node, not just the first instance. In the next step, we correct the expression in the
    Input
    field.
  10. To correct the
    Input
    field, use the XPath Expression editor to edit the expression to be a single period.
    The corrected statement passes the mobile phone number in the current node to the output XML.
    The following image shows the XMap editor with the completed Option statement and Map statement:
    "The mapping statement grid contains a Mobile Option statement with a Map statement underneath. The Map statement is performed when the Option statement contiditon is met. The Mobile Option statement checks if the phone is of type "mobile." If it is, the Map statement passes the phone to the MobilePhone element in the output."
  11. To filter work numbers, copy and paste the first Option statement to create another Option statement. Select the
    Mobile
    Option statement that you created, right-click and select
    Copy
    . Select the
    PhoneType
    Router statement, right-click and select
    Paste
    .
    A copy of the
    Mobile
    Option statement appears nested under the Router. The Option statement has a red highlight to indicate that you must correct the fields in order for the Option statement to work. For example, two Option statements cannot have the same condition expressions.
  12. To rename the copy of the Option statement, double-click the
    Name
    field and type the name
    Work
    .
  13. To make the
    Work
    statement check that the type of phone number is a work number, edit the
    Condition
    field. To define the condition, perform the following steps:
    1. To open the XPath Expression editor, click the arrow to the right of the
      Condition
      field.
    2. Use the XPath Expression editor to edit the expression to the following syntax:
      @type="work"
  14. Rename the copied
    Phone to MobilePhone
    Map statement nested in the grid under the
    Work
    Option statement. To rename the statement, double-click the
    Name
    field and type the name
    Phone to WorkPhone
    .
  15. To pass the phone number to the correct node in the output, drag the
    WorkPhone
    node to the
    Output
    field of the
    Phone to WorkPhone
    statement.
    This statement passes the work phone number to the output element for the work phone number. If you did not edit the statement, the transformation would pass the work phone number to the output element for the mobile phone number.
  16. To filter other telephone numbers, create a Default statement. Select the
    PhoneType
    Router statement, right-click and select
    New
    Default
    .
  17. To name the Default statement, double-click the
    Name
    field and type the name
    Other
    .
  18. To pass the phone number to the other phone node in the output, first copy and paste the previous Map statement to create another Map statement. Select the
    Phone to WorkPhone
    statement that you created, right-click and select
    Copy
    . Select the
    Other
    Default statement, right-click and select
    Paste
    .
    The XMap editor creates a Map statement named
    Phone to WorkPhone
    in the grid underneath the
    Other
    statement.
  19. Rename the copied
    Phone to WorkPhone
    Map statement. To rename the statement, double-click the
    Name
    field and type the name
    Phone to OtherPhone
    .
  20. To pass the phone number to the correct node in the output, drag the
    OtherPhone
    node to the
    Output
    field of the
    Phone to OtherPhone
    statement.
    This statement passes the other phone numbers, such as the home phone number, to the output XML.
    The following image shows the XMap editor with the completed Router, Option, Default, and Map statements:
    "The mapping statement eidtor contains a Router statement with three Option statements nested underneath it. The Option statements check if the phone is of type "mobile," "work," or "home." If the phone is of one of these types, the Map statement nested under each Option statement passes the phone to the appropriate output element."
  21. To save the transformation, in the Developer tool click
    File
    Save
    .

0 COMMENTS

We’d like to hear from you!