Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PipeParser.Encode produces duplicate values for some fields #31

Open
Hardrada opened this issue Jul 31, 2015 · 0 comments
Open

PipeParser.Encode produces duplicate values for some fields #31

Hardrada opened this issue Jul 31, 2015 · 0 comments

Comments

@Hardrada
Copy link

private void CreateOBX(ORU_R01_ORDER_OBSERVATION orderObservation)
{

        var obr = orderObservation.OBR;
        obr.SetIDOBR.Value = "1";
        obr.PlacerOrderNumber.UniversalID.Value = [SOME VALUE];
        obr.UniversalServiceID.Text.Value = "Document";
        obr.ObservationEndDateTime.TimeOfAnEvent.SetLongDate(DateTime.Now);
        obr.ResultStatus.Value = "F";
        obr.PlacerOrderNumber.EntityIdentifier.Value = [SOME VALUE];

        for (var i = 0; i < chunks.Count(); i++)
        {
            var idx = i + 1;
            var ob = orderObservation.GetOBSERVATION(i);
            var obx = ob.OBX;

            obx.SetIDOBX.Value = idx.ToString();
            obx.ValueType.Value = "ED"; //this assumes base64 encoding and mime type is read from obx5.2 and obx 5.3
            obx.ObservationIdentifier.Identifier.Value = "PDFReport";
            obx.ObservationIdentifier.Text.Value = "PDFReport";
            obx.ObservationSubID.Value = idx.ToString();
            Terser.Set(obx, 5, 0, 1, 1, "");
            Terser.Set(obx, 5, 0, 2, 1, "PDF");
            Terser.Set(obx, 5, 0, 3, 1, "PDF");
            Terser.Set(obx, 5, 0, 4, 1, "Base64");
            Terser.Set(obx, 5, 0, 5, 1, [SOME B64 ENCODED STRING VALUE];
        }
    }

When you look at the data in that field using Terser.Get(obx,5,0,5,1), the value what is what it should be, but when you try to generate an HL7 file, the data in that field is duplicated starting with ^PDF^PDF^Base64 which exists twice as part of the duplication.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant