I want to know If there is any way to iteratively build a JSON object based on the number of HL7 segments i.e. build a JSON object for each IN1 repeated segment (IN1|1|, IN1|2|, IN1|3|) = Obj1.1, Obj1.2, Obj1.3
Iterating over the group only populates the JSON object with the last instance of IN1 (IN1|3|) = Obj1; it does not build additional objects for each segment.
Additionally; is there a way to suppress or hide a JSON object if the requisite HL7 data that populates the object is blank/NULL? (including removing brackets from the OB “{}”)