Bugs5382 / node-hl7-client

A pure Node.js HL7 Client that allows for communication to a HL7 Broker/Server that can send properly formatted HL7 messages with ease.It can also parse and then you can extract message segments out.
MIT License
15 stars 4 forks source link

unit: 3 unit tests failing #14

Open Bugs5382 opened 10 months ago

Bugs5382 commented 10 months ago

Unit test: hl7.build.test.ts

    test.skip('...can chain component setters', async () => {
      message.set("PV1.7").set(0).set("PV1.7.2", "Jones").set("PV1.7.3", "John");
      message.set("PV1.7").set(1).set("PV1.7.2", "Smith").set("PV1.7.3", "Bob");
      expect(message.toString()).toContain("PV1|||||||^Jones^John~^Smith^Bob");
    });
   test.skip('...should be able to set repeating fields', async () => {
      message.set('PID.3').set(0).set('PID.3.1', 'abc');
      message.set('PID.3').set(0).set('PID.3.5', 'MRN');
      message.set('PID.3').set(1).set('PID.3.1', 123);
      message.set('PID.3').set(1).set('PID.3.5', 'ID');
      expect(message.toString()).toContain("PID|||abc^^^^MRN~123^^^^ID");
    });
    test.skip('... add segment EVN field - using full path', async () => {
      const segment = message.addSegment('EVN')
      segment.set('EVN.2.1', '20081231')
      expect(message.toString()).toBe("MSH|^~\\&|||||20081231||ADT^A01^ADT_A01|12345||2.7\rEVN||20081231")
    })

I been troubleshooting the issue for a while and can't nail it down. Limits functionally and also not 1:1 of the way it's supposed to work

Bugs5382 commented 3 months ago

Related Issue: #33