Looping through S3 reports

 4 Replies
 0 Subscribed to this topic
 52 Subscribed to this forum
Sort:
Author
Messages
Bob Canham
Veteran Member
Posts: 217
Veteran Member

    I am looking at ways to loop through the content from an S3 report such as BN101 and then to perform an action on each record.  One way is to use bldxffiles to turn it into a pipe-delimited csv and then iterate through that.  While that will work, I want to see if anyone has instead converted a report to XML and then used the For Each to iterate through the nodes successfully.  I attempted it earlier today, and ran into issues first because there aren't any published schemas for the report xml (that I could find).  Then ran into an issue getting the value of the employee ID because the node had both a value as well as a drill node under it.

    If anyone has done this the XML route, I would love to hear how you did it.

    alexrs
    Basic Member
    Posts: 16
    Basic Member
      You can covert the output from xml into json. It will allow you to easily parse the output once converted. No need for schemas. If you need further details, please let me know.
      Bob Canham
      Veteran Member
      Posts: 217
      Veteran Member
        I haven't tried json before, so if you have more information on that method, I would love to hear about it.
        kflores01
        Veteran Member
        Posts: 43
        Veteran Member
          Instead of using the resulting report rows, why not determine which key table you are interested in and query it within IPA?
          Bob Canham
          Veteran Member
          Posts: 217
          Veteran Member
            In this case, I felt it easier to let the report do the computational work. We're writing something to automate our health plan waive, so we just use the BN101 to determine who is eligible for it, check to see if they're over the enrollment period and don't have any pending benefit enrollments, and then enroll them. I could figure out who is eligible, but since the report does it already, figured I didn't need to recreate the wheel.