1.0.4 • Published 8 years ago

sam-utility v1.0.4

Weekly downloads
3
License
ISC
Repository
github
Last release
8 years ago

Sam's utilities

HL7 parser

Usage: How to parse a HL7 message

var hl7 = require('sam-utility').hl7;
var objMsg = new hl7.Message(strMsg);

objMsg has a number of properties like:

  • messageType
  • triggerEvent
  • version
  • length (the number of segments)

It also has methods to find segments:

  • findSegment(:segmentName)
  • findAllSegments(:segmentName)
  • filterSegment(:callback) (callback = function(currentSegment, currentIndex) => bool)

How to parse a segment

var segment = new hl7.Segment(str);

segment has the following properties:

  • name
  • length (the number of fields)

It also supports get and set methods:

How to parse a field

var field = new hl7.Field(str);

field also supports get and set methods:

How to parse a component

var component = new hl7.Component(str);

component also supports get and set methods:

sub-component is plain string

Please refer to test/test_hl7.js for more details

Maven cleaner

Usage:

var samUtility = require('sam-utility');
// target-folder, [test or delete], [file-size (1M by default)]
samUtility.DiskCleaner.cleanMaven(process.argv[2], process.argv[3], process.argv[4]);
1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago