@rethinkhealth/hl7v2-lint-message-structure-missing
v0.4.2
Published
hl7v2-lint rule to warn when message structure (MSH-9.3) is missing
Maintainers
Readme
@rethinkhealth/hl7v2-lint-message-structure-missing
Lint rule that warns when the HL7v2 message structure component (
MSH-9.3) is missing.
Installation
pnpm add -D @rethinkhealth/hl7v2-lint-message-structure-missingUsage
import { unified } from "unified";
import { hl7v2Parser } from "@rethinkhealth/hl7v2-parser";
import hl7v2LintMessageStructure from "@rethinkhealth/hl7v2-lint-message-structure-missing";
const message = `MSH|^~\\&|SENDER|FAC|RCVR|FAC|20250101010101||ADT^A01|MSG00001|P|2.5`;
const processor = unified()
.use(hl7v2Parser)
.use(hl7v2LintMessageStructure);
await processor.process(message);Examples
- ✅ With message structure (valid)
MSH|^~\&|SENDER|FAC|RCVR|FAC|20250101010101||ADT^A01^ADT_A01|MSG00001|P|2.5- ❌ Missing message structure (warns)
MSH|^~\&|SENDER|FAC|RCVR|FAC|20250101010101||ADT^A01|MSG00001|P|2.5Presets
This rule is included in @rethinkhealth/hl7v2-lint-recommended.
Contributing
We welcome contributions! Please see our Contributing Guide for more details.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Code of Conduct
To ensure a welcoming and positive environment, we have a Code of Conduct that all contributors and participants are expected to adhere to.
License
Copyright 2025 Rethink Health, SUARL. All rights reserved.
This program is licensed to you under the terms of the MIT License. This program is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the LICENSE file for details.
