
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
@healthcare-interoperability/hl7v2-core
Advanced tools
Core module for HL7v2 message generation and parsing library
This npm package provides utilities and classes for handling HL7v2 messaging. It includes classes for primitive data types, complex data types, segments, and trigger events.
To install the package, use npm:
npm install @healthcare-interoperability/hl7v2-core
import { PrimitiveType } from '@healthcare-interoperability/hl7v2-core';
const primitiveValue = new PrimitiveType('Hello');
console.log(primitiveValue.toString()); // Output: 'Hello'
console.log(primitiveValue.toJSON()); // Output: 'Hello'
import { PrimitiveDataType } from '@healthcare-interoperability/hl7v2-core';
const primitiveData = new PrimitiveDataType('World');
console.log(primitiveData.toString()); // Output: 'World'
console.log(primitiveData.toJSON()); // Output: 'World'
import { ComplexType } from '@healthcare-interoperability/hl7v2-core';
const complexValues = ['Value1', 'Value2'];
const complexInstance = new ComplexType(complexValues);
console.log(complexInstance.toString()); // Output: 'Value1^Value2'
console.log(complexInstance.toJSON()); // Output: ['Value1', 'Value2']
import { ComplexDataType } from '@healthcare-interoperability/hl7v2-core';
const complexDataValues = ['Data1', 'Data2'];
const complexDataInstance = new ComplexDataType(complexDataValues);
console.log(complexDataInstance.toString()); // Output: 'Data1^Data2'
console.log(complexDataInstance.toJSON()); // Output: ['Data1', 'Data2']
import { Segment } from '@healthcare-interoperability/hl7v2-core';
const segmentValues = 'PID|1|John Doe|...';
const segmentInstance = new Segment(segmentValues);
console.log(segmentInstance.toString()); // Output: 'PID|1|John Doe|...'
console.log(segmentInstance.toJSON()); // Output: { PID: { ... } }
import { TriggerEvent } from '@healthcare-interoperability/hl7v2-core';
const hl7Message = 'MSH|^~\\&|...';
const triggerEventInstance = new TriggerEvent(hl7Message);
console.log(triggerEventInstance.toJSON()); // Output: Parsed JSON representation of the HL7 message
toString()
: Returns the string representation of the primitive value.toJSON()
: Returns the JSON representation of the primitive value.PrimitiveType
.setValues(values)
: Sets values based on array, object, or primitive data.toString()
: Returns a string representation of the complex type.toJSON()
: Returns a JSON representation of the complex type.ComplexType
.toString()
: Returns a string representation of the segment.toJSON()
: Returns a JSON representation of the segment.toJSON(mode, flag)
: Returns a JSON representation of the parsed HL7 message.setCustomSegments(segmentId, segmentInstance)
: Sets custom segments to the TriggerEvent instance.HL7®, FHIR® and the FHIR are the registered trademarks of Health Level Seven International and their use does not constitute endorsement by HL7.
FAQs
Core module for HL7v2 message generation and parsing library
We found that @healthcare-interoperability/hl7v2-core demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.