├── .eslintrc ├── .gitignore ├── .travis.yml ├── LICENSE ├── README.md ├── bin ├── nodengine-hl7.js └── usage.txt ├── doc └── api │ ├── message.md │ └── utils.md ├── index.js ├── lib ├── index.js ├── message.js ├── segment.js ├── segments │ ├── add.js │ ├── al1.js │ ├── bhs.js │ ├── blg.js │ ├── bts.js │ ├── db1.js │ ├── dg1.js │ ├── drg.js │ ├── dsc.js │ ├── dsp.js │ ├── eql.js │ ├── erq.js │ ├── err.js │ ├── evn.js │ ├── fhs.js │ ├── ft1.js │ ├── fts.js │ ├── gt1.js │ ├── in1.js │ ├── in2.js │ ├── mrg.js │ ├── msa.js │ ├── msh.js │ ├── nk1.js │ ├── npu.js │ ├── nte.js │ ├── obr.js │ ├── obx.js │ ├── ods.js │ ├── odt.js │ ├── orc.js │ ├── pd1.js │ ├── pid.js │ ├── pr1.js │ ├── pv1.js │ ├── pv2.js │ ├── qak.js │ ├── qrd.js │ ├── rdf.js │ ├── rdt.js │ ├── rol.js │ ├── rq1.js │ ├── rqd.js │ ├── rxg.js │ ├── rxr.js │ ├── spr.js │ ├── stf.js │ ├── tq1.js │ ├── txa.js │ ├── urd.js │ ├── urs.js │ └── vtq.js └── utils.js ├── package.json ├── scripts ├── fixsegments.js ├── segmentdef.js └── segments │ ├── DG1 │ ├── DRG │ ├── FT1 │ ├── GT1 │ ├── IN1 │ ├── IN2 │ ├── OBX │ ├── ORC │ ├── PR1 │ └── TXA └── test ├── fixtures ├── invalid.hl7 ├── out.hl7 ├── pcc_adt_A03.hl7 ├── pv1_variant.js ├── test.hl7 ├── test2.hl7 └── zev_variant.js ├── message.js ├── parser.js ├── segment.js ├── streams.js └── utils.js /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "node": true, 4 | "browser": true, 5 | "commonjs": true, 6 | "es6": true 7 | }, 8 | "ecmaFeatures": { 9 | "arrowFunctions": true, 10 | "blockBindings": true, 11 | "forOf": true, 12 | "objectLiteralComputedProperties": true, 13 | "objectLiteralShorthandProperties": true, 14 | "templateStrings": true, 15 | "globalReturn": true 16 | }, 17 | "rules": { 18 | "quotes": [2, "single"], 19 | "semi": [2, "never"], 20 | "comma-style": [2, "first"], 21 | "object-shorthand": [2, "always"], 22 | "no-unused-vars": [2, { "vars": "all", "args": "none" }], 23 | "comma-dangle": [2, "never"], 24 | "dot-notation": [2], 25 | "eqeqeq": [2, "allow-null"], 26 | "strict": [2, "global"], 27 | "handle-callback-err": [2, "^(err|er)$"], 28 | "eol-last": [2], 29 | "quotes": [2, "single"], 30 | "space-after-keywords": [2, "always"], 31 | "space-before-blocks": [2, "always"], 32 | "space-before-function-paren": [2, "never"], 33 | "space-before-keywords": [2, "always"], 34 | "space-in-parens": [2, "never"], 35 | "arrow-body-style": [2, "always"], 36 | "arrow-parens": [2, "always"], 37 | "arrow-spacing": [2] 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | lib-cov 2 | coverage.html 3 | coverage/ 4 | .nyc_output 5 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "0.10" 4 | - "0.12" 5 | - "4" 6 | - "iojs" 7 | - "iojs-v1" 8 | - "iojs-v2" 9 | sudo: false 10 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014-2015 Evan Lucas 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # nodengine-hl7 2 | 3 | [![Build Status](https://travis-ci.org/evanlucas/nodengine-hl7.png?branch=master)](https://travis-ci.org/evanlucas/nodengine-hl7) 4 | [![Coverage Status](https://coveralls.io/repos/evanlucas/nodengine-hl7/badge.svg?branch=master&service=github)](https://coveralls.io/github/evanlucas/nodengine-hl7?branch=master) 5 | 6 | A hl7 parser 7 | 8 | ## Installation 9 | ```sh 10 | $ npm install --save nodengine-hl7 11 | ``` 12 | 13 | or install globally for the CLI tool 14 | 15 | ```bash 16 | $ npm install -g nodengine-hl7 17 | $ ne-hl7 --help 18 | ne-hl7 - a streaming parser for hl7 messages 19 | 20 | usage: ne-hl7 [options] 21 | 22 | options: 23 | 24 | -h, --help show help and usage 25 | -l, --loglevel set log level 26 | -f, --file parse file 27 | -s, --segments only show segment types 28 | -c, --count print message count 29 | -j, --json output in json 30 | -v, --version show version 31 | ``` 32 | 33 | ## Unit Tests 34 | 35 | To run tests: 36 | 37 | ```bash 38 | $ npm test 39 | ``` 40 | 41 | **NOTE: All hl7 test fixtures are samples taken from various places on the internet** 42 | 43 | ## API 44 | 45 | ### Parser 46 | 47 | Constructor 48 | 49 | *** 50 | 51 | ### Message 52 | 53 | Constructor 54 | 55 | ##### Params 56 | | Name | Type(s) | Description | 57 | | ---- | ------- | ----------- | 58 | | segments | Array, Segment | A single Segment or an array of Segments | 59 | 60 | 61 | *** 62 | 63 | ### Message.hasSegments() 64 | 65 | Does this message have any segments? 66 | 67 | 68 | 69 | *** 70 | 71 | ### Message.addSegment() 72 | 73 | Adds the given _segment_ to the message 74 | 75 | ##### Params 76 | | Name | Type(s) | Description | 77 | | ---- | ------- | ----------- | 78 | | segment | Segment | The Segment to add to the message | 79 | 80 | 81 | *** 82 | 83 | ### Message.getHeader() 84 | 85 | Gets the header Segment of the Message 86 | 87 | 88 | 89 | *** 90 | 91 | ### Message.delimiters() 92 | 93 | Gets the delimiters for the given message. These are taken from the MSH 94 | 95 | 96 | 97 | *** 98 | 99 | ### Segment 100 | 101 | Constructor 102 | 103 | *** 104 | 105 | ### Segment.parse() 106 | 107 | Parses _data_ as a hl7 segment 108 | 109 | ##### Params 110 | | Name | Type(s) | Description | 111 | | ---- | ------- | ----------- | 112 | | data | Buffer, String | The segment | 113 | 114 | 115 | *** 116 | 117 | ### utils.segmentIsHeader() 118 | 119 | Is the given _segment_ a header segment? 120 | 121 | ##### Params 122 | | Name | Type(s) | Description | 123 | | ---- | ------- | ----------- | 124 | | segment | Segment | A Segment object | 125 | 126 | 127 | *** 128 | 129 | ### utils.segmentTypeIsHeader() 130 | 131 | Is the given segment _type_ a header segment? 132 | 133 | ##### Params 134 | | Name | Type(s) | Description | 135 | | ---- | ------- | ----------- | 136 | | type | String | The segment type | 137 | 138 | ## License 139 | 140 | MIT (See `LICENSE` for more info) 141 | -------------------------------------------------------------------------------- /bin/nodengine-hl7.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | 'use strict' 4 | 5 | var nopt = require('nopt') 6 | , log = require('npmlog') 7 | , path = require('path') 8 | , pkg = require('../package') 9 | , split = require('split') 10 | , help = require('help')() 11 | , fs = require('fs') 12 | , Parser = require('../').Parser 13 | , knownOpts = { loglevel: ['verbose', 'info', 'error', 'warn', 'silent'] 14 | , file: path 15 | , help: Boolean 16 | , version: Boolean 17 | , segments: Boolean 18 | , count: Boolean 19 | , json: Boolean 20 | } 21 | , shortHand = { verbose: ['--loglevel', 'verbose'] 22 | , quiet: ['--loglevel', 'silent'] 23 | , f: ['--file'] 24 | , v: ['--version'] 25 | , h: ['--help'] 26 | , H: ['--help'] 27 | , s: ['--segments'] 28 | , c: ['--count'] 29 | , j: ['--json'] 30 | } 31 | , parsed = nopt(knownOpts, shortHand) 32 | 33 | log.heading = 'nodengine-hl7' 34 | 35 | if (parsed.loglevel) log.level = parsed.loglevel 36 | 37 | if (parsed.json) parsed.loglevel = 'silent' 38 | 39 | if (parsed.help) { 40 | return help() 41 | } 42 | 43 | if (parsed.version) { 44 | console.log('ne-hl7', 'v'+pkg.version) 45 | process.exit() 46 | } 47 | 48 | var parser = new Parser() 49 | , stream 50 | process.stdin.setEncoding('utf8') 51 | 52 | if (parsed.file) { 53 | stream = fs.createReadStream(parsed.file) 54 | } else { 55 | // expect stdin 56 | stream = process.stdin 57 | } 58 | stream 59 | .pipe(split(/\r/)) 60 | .pipe(parser) 61 | 62 | var mCount = 0 63 | , out = [] 64 | parser.on('message', function(message) { 65 | mCount++ 66 | if (parsed.json) { 67 | var m = message.segments.map(function(s) { 68 | return s.parsed 69 | }) 70 | out.push(m) 71 | } else 72 | if (parsed.segments) { 73 | log.info('message', mCount) 74 | for (var i=0, len=message.segmentTypes.length; i set log level 9 | -f, --file parse file 10 | -s, --segments only show segment types 11 | -c, --count print message count 12 | -j, --json output in json 13 | -v, --version show version 14 | -------------------------------------------------------------------------------- /doc/api/message.md: -------------------------------------------------------------------------------- 1 | ## nodengine-hl7 2 | 3 | ### Message 4 | 5 | #### Message.prototype.hasSegments() 6 | 7 | Does this message have any segments? 8 | 9 | *** 10 | 11 | #### Message.prototype.addSegment() 12 | 13 | Adds the given _segment_ to the message 14 | 15 | ##### Params 16 | 17 | | Name | Type(s) | Description | 18 | | ---- | ------- | ----------- | 19 | | segment | [Segment](segment.md) | The Segment to add to the message | 20 | 21 | *** 22 | 23 | #### Message.prototype.getHeader() 24 | 25 | Gets the header Segment of the Message 26 | 27 | *** 28 | 29 | #### Message.prototype.delimiters() 30 | 31 | Gets the delimiters for the given message. These are taken from the MSH. -------------------------------------------------------------------------------- /doc/api/utils.md: -------------------------------------------------------------------------------- 1 | ## nodengine-hl7 2 | 3 | ### utils 4 | 5 | #### utils.segmentIsHeader() 6 | 7 | Is the given _segment_ a header segment? 8 | 9 | ##### Params 10 | 11 | | Name | Type(s) | Description | 12 | | ---- | ------- | ----------- | 13 | | segment | [Segment](segment.md) | A Segment object | 14 | 15 | *** 16 | 17 | #### utils.segmentTypeIsHeader() 18 | 19 | Is the given segment _type_ a header segment? 20 | 21 | ##### Params 22 | 23 | | Name | Type(s) | Description | 24 | | ---- | ------- | ----------- | 25 | | type | String | The segment type | 26 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | module.exports = require('./lib') 4 | -------------------------------------------------------------------------------- /lib/index.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | var Transform = require('stream').Transform 4 | , util = require('util') 5 | , Segment = require('./segment') 6 | , Message = require('./message') 7 | , utils = require('./utils') 8 | 9 | // MLP end frames 10 | var FS = String.fromCharCode(0x1c) 11 | , CR = String.fromCharCode(0x0d) 12 | 13 | exports.Message = Message 14 | exports.Segment = Segment 15 | exports.Parser = Parser 16 | exports.utils = utils 17 | 18 | /** 19 | * Constructor 20 | */ 21 | function Parser() { 22 | var opts = { objectMode: true } 23 | if (!(this instanceof Parser)) 24 | return new Parser(opts) 25 | 26 | Transform.call(this, opts) 27 | 28 | this._messages = [] 29 | this.current = null 30 | } 31 | 32 | util.inherits(Parser, Transform) 33 | 34 | Parser.prototype._tryParseSegment = function _tryParseSegment(data, delims) { 35 | var self = this 36 | try { 37 | return new Segment(data, delims) 38 | } catch (err) { 39 | self.emit('error', err) 40 | return null 41 | } 42 | } 43 | 44 | /** 45 | * Transform for parser 46 | * 47 | * **NOTE: The stream should have been pipe through `split()` already** 48 | * 49 | * @param {Buffer} data The segment as a buffer 50 | * @param {String} encoding The encoding of the buffer 51 | * @param {Function} cb function(err, res) 52 | * @api private 53 | */ 54 | Parser.prototype._transform = function(data, encoding, done) { 55 | var delims = this.current 56 | ? this.current.delimiters() 57 | : null 58 | var segment = this._tryParseSegment(data, delims) 59 | 60 | if (!segment) return 61 | 62 | if (segment && segment.parsed) { 63 | var isHeader = utils.segmentIsHeader(segment) 64 | if (isHeader && this.current) { 65 | this.emit('message', this.current) 66 | var message = new Message() 67 | message.addSegment(segment) 68 | this._messages.push(message) 69 | this.current = message 70 | } else if (isHeader && !this.current) { 71 | this.current = new Message() 72 | this.current.addSegment(segment) 73 | } else { 74 | this.current.addSegment(segment) 75 | } 76 | 77 | /* 78 | If the message ended with FS+CR, this indicates the end of the message 79 | and it should be pushed over the transform stream now. 80 | http://www.hl7standards.com/blog/2007/05/02/hl7-mlp-minimum-layer-protocol-defined/ 81 | */ 82 | if (data.indexOf(FS + CR) !== -1) { 83 | this.emit('message', this.current) 84 | this.current = null 85 | } 86 | } 87 | done() 88 | } 89 | 90 | Parser.prototype._flush = function(done) { 91 | if (this.current && this.current.segments.length) { 92 | this.emit('message', this.current) 93 | this._messages.push(this.current) 94 | this.current = null 95 | } 96 | this.emit('messages', this._messages) 97 | done() 98 | } 99 | -------------------------------------------------------------------------------- /lib/message.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | var utils = require('./utils') 4 | , Segment = require('./segment') 5 | 6 | // Expose exports 7 | module.exports = Message 8 | 9 | /** 10 | * Constructor 11 | * 12 | * @param {Array|Segment} segments A single Segment or an array of Segments 13 | * @api public 14 | */ 15 | function Message(segments) { 16 | if (!(this instanceof Message)) 17 | return new Message(segments) 18 | 19 | this.header = null 20 | if (segments && Array.isArray(segments)) { 21 | var self = this 22 | this.segments = segments 23 | if (segments.length) { 24 | this.segmentTypes = segments.reduce(function(set, item) { 25 | if (utils.segmentIsHeader(item)) 26 | self.header = item 27 | 28 | var t = item.parsed && item.parsed.SegmentType 29 | if (t && !~set.indexOf(t)) 30 | set.push(t) 31 | return set 32 | }, []) 33 | } else { 34 | this.segmentTypes = [] 35 | } 36 | } else if (segments instanceof Segment) { 37 | this.segments = [segments] 38 | if (utils.segmentIsHeader(segments)) { 39 | this.header = segments 40 | } 41 | this.segmentTypes = [segments.parsed.SegmentType] 42 | } else { 43 | this.segments = [] 44 | this.segmentTypes = [] 45 | } 46 | } 47 | 48 | /** 49 | * Does this message have any segments? 50 | * 51 | * @api public 52 | * @returns Boolean 53 | */ 54 | Message.prototype.hasSegments = function() { 55 | return this.segments.length !== 0 56 | } 57 | 58 | /** 59 | * Adds the given _segment_ to the message 60 | * 61 | * @param {Segment} segment The Segment to add to the message 62 | * @api public 63 | */ 64 | Message.prototype.addSegment = function(segment) { 65 | this.segments.push(segment) 66 | var t = segment.parsed.SegmentType 67 | if (!(~this.segmentTypes.indexOf(t))) { 68 | this.segmentTypes.push(t) 69 | } 70 | if (utils.segmentTypeIsHeader(t)) { 71 | this.header = segment 72 | } 73 | } 74 | 75 | Message.prototype.toString = function() { 76 | var delims = this.delimiters() 77 | return this.segments.join(delims.segment) + delims.segment 78 | } 79 | 80 | /** 81 | * Gets the header Segment of the Message 82 | * 83 | * @api public 84 | * @returns Segment 85 | */ 86 | Message.prototype.getHeader = function() { 87 | return this.header 88 | } 89 | 90 | /** 91 | * Gets the delimiters for the given message. These are taken from the MSH 92 | * 93 | * @api public 94 | * @returns Object 95 | */ 96 | Message.prototype.delimiters = function() { 97 | if (!this.header) { 98 | return { 99 | segment: '\r' 100 | , field: '|' 101 | , component: '^' 102 | , subcomponent: '&' 103 | , repetition: '~' 104 | , escape: '\\' 105 | } 106 | } 107 | 108 | var chars = this.header.parsed.EncodingCharacters 109 | return { 110 | segment: '\r' 111 | , field: chars[0] || '|' 112 | , component: chars[1] || '^' 113 | , subcomponent: chars[2] || '&' 114 | , repetition: chars[3] || '~' 115 | , escape: chars[4] || '\\' 116 | } 117 | } 118 | -------------------------------------------------------------------------------- /lib/segment.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | var path = require('path') 4 | , fs = require('fs') 5 | , segmentsDir = path.join(__dirname, 'segments') 6 | , utils = require('./utils') 7 | , types = {} 8 | 9 | /*! 10 | * Load our segment types 11 | */ 12 | fs.readdirSync(segmentsDir) 13 | .forEach(function(file) { 14 | if (path.extname(file) === '.js') { 15 | var segType = path.basename(file).replace('.js', '').toUpperCase() 16 | types[segType] = require(path.join(__dirname, 'segments', file)).fields 17 | } 18 | }) 19 | 20 | module.exports = Segment 21 | 22 | /** 23 | * Constructor 24 | */ 25 | function Segment(data, delimiters) { 26 | if (!(this instanceof Segment)) 27 | return new Segment(data, delimiters) 28 | 29 | if (delimiters) { 30 | this.delimiters = delimiters 31 | } else { 32 | this.delimiters = { 33 | segment: '\r' 34 | , field: '|' 35 | , component: '^' 36 | , subcomponent: '&' 37 | , repetition: '~' 38 | , escape: '\\' 39 | } 40 | } 41 | 42 | this.parsed = this.parse(data) 43 | } 44 | 45 | /** 46 | * Registers a new variant 47 | * 48 | * Required Keys: 49 | * 50 | * - `name` {String} The variant name 51 | * - `fields` {Array} The fields this variant exposes 52 | * 53 | * @param {Object} variant The variant to register 54 | * @api public 55 | */ 56 | Segment.registerVariant = function(variant) { 57 | if (variant === null || typeof variant !== 'object') 58 | throw new TypeError('Variant must be an object') 59 | 60 | if (!variant.hasOwnProperty('name')) 61 | throw new Error('Variant must have a name') 62 | 63 | if (!variant.hasOwnProperty('fields')) 64 | throw new Error('Variant must have fields') 65 | 66 | var name = variant.name.toUpperCase() 67 | if (types.hasOwnProperty(name)) { 68 | types[name+'_'] = types[name] 69 | } 70 | types[name] = variant.fields 71 | } 72 | 73 | /** 74 | * Parses _data_ as a hl7 segment 75 | * 76 | * @param {Buffer|String} data The segment 77 | * @api public 78 | */ 79 | Segment.prototype.parse = function(data) { 80 | if (data && data.length > 1) { // account for trailing \r 81 | data = data.replace(/\u000b/g, '') 82 | .replace(/\u001c/g, '') 83 | this._raw = data 84 | var s = data.slice(0, 3) 85 | if (s === 'MSH' || s === 'BHS' || s === 'FHS') { 86 | var delims = data.slice(3, 7) 87 | this.delimiters.segment = data.slice(-1) 88 | this.delimiters.field = delims[0] 89 | this.delimiters.repetition = delims[1] 90 | this.delimiters.escape = delims[2] 91 | this.delimiters.subcomponent = delims[3] 92 | } 93 | if (types.hasOwnProperty(s)) { 94 | var seg = this._parseSegment(s, data) 95 | return seg 96 | } else { 97 | /** 98 | * TODO Remove this and add a default segment parser 99 | * This is mainly in place so we can see what default 100 | * segments we are missing 101 | */ 102 | var e = new Error('Invalid segment type: '+s) 103 | e.code = 'EINVSEGTYPE' 104 | e.raw = data 105 | throw e 106 | } 107 | } 108 | return false 109 | } 110 | 111 | Segment.prototype.toArray = function() { 112 | var type = this.segmentType() 113 | if (!type) return [] 114 | var out = [] 115 | var keys = Object.keys(this.parsed) 116 | var len = keys.length 117 | for (var i = 0; i < len; i++) { 118 | var key = keys[i] 119 | var idx = types[type].indexOf(key) 120 | if (idx === -1) continue 121 | out[idx] = this.parsed[key] 122 | } 123 | return out 124 | } 125 | 126 | Segment.prototype.isHeader = function() { 127 | return utils.segmentIsHeader(this) 128 | } 129 | 130 | Segment.prototype.segmentType = function() { 131 | if (this.parsed && this.parsed.SegmentType) 132 | return this.parsed.SegmentType 133 | return null 134 | } 135 | 136 | Segment.prototype.toString = function() { 137 | return this._raw 138 | } 139 | 140 | Segment.prototype.types = types 141 | 142 | Segment.prototype._parseSegment = function(segmentType, data) { 143 | var self = this 144 | , fieldDelim = self.delimiters.field 145 | data = String(data) 146 | var out = {} 147 | var comps = data.split(fieldDelim) 148 | var fieldsLen = types[segmentType].length 149 | for (var i = 0; i < fieldsLen; i++) { 150 | var fieldName = types[segmentType][i] 151 | if (fieldName === 'EncodingCharacters') { 152 | out[fieldName] = fieldDelim+comps[i] 153 | } else { 154 | out[fieldName] = comps[i] || '' 155 | } 156 | } 157 | return out 158 | } 159 | -------------------------------------------------------------------------------- /lib/segments/add.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | exports.name = 'ADD' 4 | 5 | exports.fields = [ 6 | 'SegmentType' 7 | , 'AddendumContinuationPointer' 8 | ] 9 | -------------------------------------------------------------------------------- /lib/segments/al1.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | exports.name = 'AL1' 4 | 5 | exports.fields = [ 6 | 'SegmentType' 7 | , 'SetID' 8 | , 'AllergyType' 9 | , 'AllergyCodeMnemonicDescription' 10 | , 'AllergySeverity' 11 | , 'AllergyReaction' 12 | , 'IdentificationDate' 13 | ] 14 | -------------------------------------------------------------------------------- /lib/segments/bhs.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | exports.name = 'BHS' 4 | 5 | exports.fields = [ 6 | 'SegmentType' 7 | , 'FieldSeparator' 8 | , 'EncodingCharacters' 9 | , 'SendingApplication' 10 | , 'SendingFacility' 11 | , 'ReceivingApplication' 12 | , 'ReceivingFacility' 13 | , 'CreationDateTime' 14 | , 'Security' 15 | , 'NameIDType' 16 | , 'Comment' 17 | , 'ControlID' 18 | , 'ReferenceBatchControlID' 19 | ] 20 | -------------------------------------------------------------------------------- /lib/segments/blg.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | exports.name = 'BLG' 4 | 5 | exports.fields = [ 6 | 'SegmentType' 7 | , 'WhenToCharge' 8 | , 'ChargeType' 9 | , 'AccountID' 10 | ] 11 | -------------------------------------------------------------------------------- /lib/segments/bts.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | exports.name = 'BTS' 4 | 5 | exports.fields = [ 6 | 'SegmentType' 7 | , 'MessageCount' 8 | , 'Totals' 9 | ] 10 | -------------------------------------------------------------------------------- /lib/segments/db1.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | exports.name = 'DB1' 4 | 5 | exports.fields = [ 6 | 'SegmentType' 7 | , 'SetID' 8 | , 'DisabledPersonCode' 9 | , 'DisabledPersonIdentifier' 10 | , 'DisabledIndicator' 11 | , 'DisabledStartDate' 12 | , 'DisabledEndDate' 13 | , 'DisabledReturnToWorkDate' 14 | , 'DisabledUnableToWorkDate' 15 | ] 16 | -------------------------------------------------------------------------------- /lib/segments/dg1.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | exports.name = 'DG1' 4 | 5 | exports.fields = [ 6 | 'SegmentType' 7 | , 'SetID' 8 | , 'DiagnosisCodingMethod' 9 | , 'DiagnosisCode' 10 | , 'DiagnosisDescription' 11 | , 'DiagnosisDateTime' 12 | , 'DiagnosisType' 13 | , 'MajorDiagnosticCategory' 14 | , 'DiagnosticRelatedGroup' 15 | , 'DRGApprovalIndicator' 16 | , 'DRGGrouperReviewCode' 17 | , 'OutlierType' 18 | , 'OutlierDays' 19 | , 'OutlierCost' 20 | , 'GrouperVersionAndType' 21 | , 'DiagnosisPriority' 22 | , 'DiagnosingClinician' 23 | , 'DiagnosisClassification' 24 | , 'ConfidentialIndicator' 25 | , 'AttestationDateTime' 26 | ] 27 | -------------------------------------------------------------------------------- /lib/segments/drg.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | exports.name = 'DRG' 4 | 5 | exports.fields = [ 6 | 'SegmentType' 7 | , 'DiagnosticRelatedGroup' 8 | , 'DRGAssignedDateTime' 9 | , 'DRGApprovalIndicator' 10 | , 'DRGGrouperReviewCode' 11 | , 'OutlierType' 12 | , 'OutlierDays' 13 | , 'OutlierCost' 14 | , 'DRGPayor' 15 | , 'OutlierReimbursement' 16 | , 'ConfidentialIndicator' 17 | ] 18 | -------------------------------------------------------------------------------- /lib/segments/dsc.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | exports.name = 'DSC' 4 | 5 | exports.fields = [ 6 | 'SegmentType' 7 | , 'ContinuationPointer' 8 | ] 9 | -------------------------------------------------------------------------------- /lib/segments/dsp.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | exports.name = 'DSP' 4 | 5 | exports.fields = [ 6 | 'SegmentType' 7 | , 'SetID' 8 | , 'DisplayLevel' 9 | , 'DataLine' 10 | , 'LogicalBreakPoint' 11 | , 'ResultID' 12 | ] 13 | 14 | -------------------------------------------------------------------------------- /lib/segments/eql.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | exports.name = 'EQL' 4 | 5 | exports.fields = [ 6 | 'SegmentType' 7 | , 'Tag' 8 | , 'ResponseFormatCode' 9 | , 'Name' 10 | , 'Statement' 11 | ] 12 | 13 | -------------------------------------------------------------------------------- /lib/segments/erq.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | exports.name = 'ERQ' 4 | 5 | exports.fields = [ 6 | 'SegmentType' 7 | , 'Tag' 8 | , 'ID' 9 | , 'InputParameterList' 10 | ] 11 | 12 | -------------------------------------------------------------------------------- /lib/segments/err.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | exports.name = 'ERR' 4 | 5 | exports.fields = [ 6 | 'SegmentType' 7 | , 'ErrorCode' 8 | ] 9 | 10 | -------------------------------------------------------------------------------- /lib/segments/evn.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | exports.name = 'EVN' 4 | 5 | exports.fields = [ 6 | 'SegmentType' 7 | , 'TypeCode' 8 | , 'RecordedDateTime' 9 | , 'DateTimePlannedEvent' 10 | , 'EventReasonCode' 11 | , 'OperatorID' 12 | , 'EventOccurred' 13 | ] 14 | 15 | -------------------------------------------------------------------------------- /lib/segments/fhs.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | exports.name = 'FHS' 4 | 5 | exports.fields = [ 6 | 'SegmentType' 7 | , 'FieldSeparator' 8 | , 'EncodingCharacters' 9 | , 'SendingApplication' 10 | , 'SendingFacility' 11 | , 'ReceivingApplication' 12 | , 'ReceivingFacility' 13 | , 'CreationDateTime' 14 | , 'Security' 15 | , 'NameID' 16 | , 'HeaderComment' 17 | , 'ControlID' 18 | , 'ReferenceFileControlID' 19 | ] 20 | 21 | -------------------------------------------------------------------------------- /lib/segments/ft1.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | exports.name = 'FT1' 4 | 5 | exports.fields = [ 6 | 'SegmentType' 7 | , 'SetIDFT1' 8 | , 'TransactionID' 9 | , 'TransactionBatchID' 10 | , 'TransactionDate' 11 | , 'TransactionPostingDate' 12 | , 'TransactionType' 13 | , 'TransactionCode' 14 | , 'TransactionDescription' 15 | , 'TransactionDescriptionAlt' 16 | , 'TransactionQuantity' 17 | , 'TransactionAmountExtended' 18 | , 'TransactionAmountUnit' 19 | , 'DepartmentCode' 20 | , 'InsurancePlanID' 21 | , 'InsuranceAmount' 22 | , 'AssignedPatientLocation' 23 | , 'FeeSchedule' 24 | , 'PatientType' 25 | , 'DiagnosisCodeFT1' 26 | , 'PerformedByCode' 27 | , 'OrderedByCode' 28 | , 'UnitCost' 29 | , 'FillerOrderNumber' 30 | , 'EnteredByCode' 31 | , 'ProcedureCode' 32 | , 'ProcedureCodeModifier' 33 | ] 34 | -------------------------------------------------------------------------------- /lib/segments/fts.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | exports.name = 'FTS' 4 | 5 | exports.fields = [ 6 | 'SegmentType' 7 | , 'BatchCount' 8 | , 'TrailerComment' 9 | ] 10 | 11 | -------------------------------------------------------------------------------- /lib/segments/gt1.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | exports.name = 'GT1' 4 | 5 | exports.fields = [ 6 | 'SegmentType' 7 | , 'SetID' 8 | , 'GuarantorNumber' 9 | , 'GuarantorName' 10 | , 'GuarantorSpouseName' 11 | , 'GuarantorAddress' 12 | , 'GuarantorPhoneHome' 13 | , 'GuarantorPhoneBusiness' 14 | , 'GuarantorBirthDate' 15 | , 'GuarantorSex' 16 | , 'GuarantorType' 17 | , 'GuarantorRelationship' 18 | , 'GuarantorSSN' 19 | , 'GuarantorDateBegin' 20 | , 'GuarantorDateEnd' 21 | , 'GuarantorPriority' 22 | , 'GuarantorEmployerName' 23 | , 'GuarantorEmployerAddress' 24 | , 'GuarantorEmployerPhoneNumber' 25 | , 'GuarantorEmployeeIDNumber' 26 | , 'GuarantorEmploymentStatus' 27 | , 'GuarantorOrganizationName' 28 | , 'GuarantorBillingHoldFlag' 29 | , 'GuarantorCreditRatingCode' 30 | , 'GuarantorDeathDateTime' 31 | , 'GuarantorDeathFlag' 32 | , 'GuarantorChargeAdjustmentCode' 33 | , 'GuarantorHouseholdAnnualIncome' 34 | , 'GuarantorHouseholdSize' 35 | , 'GuarantorEmployerIDNumber' 36 | , 'GuarantorMaritalStatusCode' 37 | , 'GuarantorHireEffectiveDate' 38 | , 'EmploymentStopDate' 39 | , 'LivingDependency' 40 | , 'AmbulatoryStatus' 41 | , 'Citizenship' 42 | , 'PrimaryLanguage' 43 | , 'LivingArrangement' 44 | , 'PublicityCode' 45 | , 'ProtectionIndicator' 46 | , 'StudentIndicator' 47 | , 'Religion' 48 | , 'MothersMaidenName' 49 | , 'Nationality' 50 | , 'EthnicGroup' 51 | , 'ContactPersonsName' 52 | , 'ContactPersonsTelephoneNumber' 53 | , 'ContactReason' 54 | , 'ContactRelationship' 55 | , 'JobTitle' 56 | , 'JobCodeClass' 57 | , 'GuarantorEmployersOrganizationName' 58 | , 'Handicap' 59 | , 'JobStatus' 60 | , 'GuarantorFinancialClass' 61 | , 'GuarantorRace' 62 | ] 63 | -------------------------------------------------------------------------------- /lib/segments/in1.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | exports.name = 'IN1' 4 | 5 | exports.fields = [ 6 | 'SegmentType' 7 | , 'SetID' 8 | , 'InsurancePlanID' 9 | , 'InsuranceCompanyID' 10 | , 'InsuranceCompanyName' 11 | , 'InsuranceCompanyAddress' 12 | , 'InsuranceCoContactPerson' 13 | , 'InsuranceCoPhoneNumber' 14 | , 'GroupNumber' 15 | , 'GroupName' 16 | , 'InsuredsGroupEmpID' 17 | , 'InsuredsGroupEmpName' 18 | , 'PlanEffectiveDate' 19 | , 'PlanExpirationDate' 20 | , 'AuthorizationInformation' 21 | , 'PlanType' 22 | , 'NameOfInsured' 23 | , 'InsuredsRelationshipToPatient' 24 | , 'InsuredsDateOfBirth' 25 | , 'InsuredsAddress' 26 | , 'AssignmentOfBenefits' 27 | , 'CoordinationOfBenefits' 28 | , 'CoordOfBenPriority' 29 | , 'NoticeOfAdmissionFlag' 30 | , 'NoticeOfAdmissionDate' 31 | , 'ReportOfEligibilityFlag' 32 | , 'ReportOfEligibilityDate' 33 | , 'ReleaseInformationCode' 34 | , 'PreAdmitCert' 35 | , 'VerificationDateTime' 36 | , 'VerificationBy' 37 | , 'TypeOfAgreementCode' 38 | , 'BillingStatus' 39 | , 'LifetimeReserveDays' 40 | , 'DelayBeforeLRDay' 41 | , 'CompanyPlanCode' 42 | , 'PolicyNumber' 43 | , 'PolicyDeductible' 44 | , 'PolicyLimitAmount' 45 | , 'PolicyLimitDays' 46 | , 'RoomRateSemiPrivate' 47 | , 'RoomRatePrivate' 48 | , 'InsuredsEmploymentStatus' 49 | , 'InsuredsSex' 50 | , 'InsuredsEmployersAddress' 51 | , 'VerificationStatus' 52 | , 'PriorInsurancePlanID' 53 | , 'CoverageType' 54 | , 'Handicap' 55 | , 'InsuredsIDNumber' 56 | ] 57 | -------------------------------------------------------------------------------- /lib/segments/in2.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | exports.name = 'IN2' 4 | 5 | exports.fields = [ 6 | 'SegmentType' 7 | , 'InsuredsEmployeeID' 8 | , 'InsuredsSocialSecurityNumber' 9 | , 'InsuredsEmployersNameandID' 10 | , 'EmployerInformationData' 11 | , 'MailClaimParty' 12 | , 'MedicareHealthInsCardNumber' 13 | , 'MedicaidCaseName' 14 | , 'MedicaidCaseNumber' 15 | , 'MilitarySponsorName' 16 | , 'MilitaryIDNumber' 17 | , 'DependentOfMilitaryRecipient' 18 | , 'MilitaryOrganization' 19 | , 'MilitaryStation' 20 | , 'MilitaryService' 21 | , 'MilitaryRankGrade' 22 | , 'MilitaryStatus' 23 | , 'MilitaryRetireDate' 24 | , 'MilitaryNonAvailCertOnFile' 25 | , 'BabyCoverage' 26 | , 'CombineBabyBill' 27 | , 'BloodDeductible' 28 | , 'SpecialCoverageApprovalName' 29 | , 'SpecialCoverageApprovalTitle' 30 | , 'NonCoveredInsuranceCode' 31 | , 'PayorID' 32 | , 'PayorSubscriberID' 33 | , 'EligibilitySource' 34 | , 'RoomCoverageTypeAmount' 35 | , 'PolicyTypeAmount' 36 | , 'DailyDeductible' 37 | , 'LivingDependency' 38 | , 'AmbulatoryStatus' 39 | , 'Citizenship' 40 | , 'PrimaryLanguage' 41 | , 'LivingArrangement' 42 | , 'PublicityCode' 43 | , 'ProtectionIndicator' 44 | , 'StudentIndicator' 45 | , 'Religion' 46 | , 'MothersMaidenName' 47 | , 'Nationality' 48 | , 'EthnicGroup' 49 | , 'MaritalStatus' 50 | , 'InsuredsEmploymentStartDate' 51 | , 'EmploymentStopDate' 52 | , 'JobTitle' 53 | , 'JobCodeClass' 54 | , 'JobStatus' 55 | , 'EmployerContactPersonName' 56 | , 'EmployerContactPersonPhoneNumber' 57 | , 'EmployerContactReason' 58 | , 'InsuredsContactPersonsName' 59 | , 'InsuredsContactPersonPhoneNumber' 60 | , 'InsuredsContactPersonReason' 61 | , 'RelationshipToThePatientStartDate' 62 | , 'RelationshipToThePatientStopDate' 63 | , 'InsuranceCoContactReason' 64 | , 'InsuranceCoContactPhoneNumber' 65 | , 'PolicyScope' 66 | , 'PolicySource' 67 | , 'PatientMemberNumber' 68 | , 'GuarantorsRelationshipToInsured' 69 | , 'InsuredsPhoneNumberHome' 70 | , 'InsuredsEmployerPhoneNumber' 71 | , 'MilitaryHandicappedProgram' 72 | , 'SuspendFlag' 73 | , 'CopayLimitFlag' 74 | , 'StoplossLimitFlag' 75 | , 'InsuredOrganizationNameAndID' 76 | , 'InsuredEmployerOrganizationNameAndID' 77 | , 'Race' 78 | , 'HCFAPatientsRelationshiptoInsured' 79 | ] 80 | -------------------------------------------------------------------------------- /lib/segments/mrg.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | exports.name = 'MRG' 4 | 5 | exports.fields = [ 6 | 'SegmentType' 7 | , 'PriorPatientIdentifierList' 8 | , 'PriorAlternatePatientID' 9 | , 'PriorPatientAccountNumber' 10 | , 'PriorPatientID' 11 | , 'PriorVisitNumber' 12 | , 'PriorAlternateVisitID' 13 | , 'PriorPatientName' 14 | ] 15 | 16 | -------------------------------------------------------------------------------- /lib/segments/msa.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | exports.name = 'MSA' 4 | 5 | exports.fields = [ 6 | 'SegmentType' 7 | , 'AcknowledgementCode' 8 | , 'ControlID' 9 | , 'TextMessage' 10 | , 'ExpectedSequenceNumber' 11 | , 'DelayedAcknowledgementType' 12 | , 'ErrorCondition' 13 | ] 14 | 15 | -------------------------------------------------------------------------------- /lib/segments/msh.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | exports.name = 'MSH' 4 | 5 | exports.fields = [ 6 | 'SegmentType' 7 | , 'EncodingCharacters' 8 | , 'SendingApplication' 9 | , 'SendingFacility' 10 | , 'ReceivingApplication' 11 | , 'ReceivingFacility' 12 | , 'DateTime' 13 | , 'Security' 14 | , 'MessageType' 15 | , 'MessageControlID' 16 | , 'ProcessingID' 17 | , 'VersionID' 18 | , 'SequenceNumber' 19 | , 'ContinuationPointer' 20 | , 'AcceptAcknowledgementType' 21 | , 'ApplicationAcknowledgementType' 22 | , 'CountryCode' 23 | , 'CharacterSet' 24 | , 'PrincipalLanguage' 25 | , 'AlternateCharacterSetHandlingScheme' 26 | ] 27 | 28 | -------------------------------------------------------------------------------- /lib/segments/nk1.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | exports.name = 'NK1' 4 | 5 | exports.fields = [ 6 | 'SegmentType' 7 | , 'SetID' 8 | , 'Name' 9 | , 'Relationship' 10 | , 'Address' 11 | , 'PhoneNumber' 12 | , 'BusinessPhoneNumber' 13 | , 'ContactRole' 14 | , 'StartDate' 15 | , 'EndDate' 16 | , 'NextOfKinJobTitle' 17 | , 'NextOfKinJobCodeClass' 18 | , 'NextOfKinEmployeeNumber' 19 | , 'OrganizationName' 20 | , 'MaritalStatus' 21 | , 'Sex' 22 | , 'BirthDate' 23 | , 'LivingDependency' 24 | , 'AmbulatoryStatus' 25 | , 'Citizenship' 26 | , 'PrimaryLanguage' 27 | , 'LivingArrangement' 28 | , 'PublicityCode' 29 | , 'ProtectionIndicator' 30 | , 'StudentIndicator' 31 | , 'Religion' 32 | , 'MotherMaidenName' 33 | , 'Nationality' 34 | , 'EthnicGroup' 35 | , 'ContactReason' 36 | , 'ContactPersonName' 37 | , 'ContactPersonPhoneNumber' 38 | , 'ContactPersonAddress' 39 | , 'NextOfKinIdentifiers' 40 | , 'JobStatus' 41 | , 'Race' 42 | , 'Handicap' 43 | , 'ContactPersonSSN' 44 | ] 45 | 46 | -------------------------------------------------------------------------------- /lib/segments/npu.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | exports.name = 'NPU' 4 | 5 | exports.fields = [ 6 | 'SegmentType' 7 | , 'BedLocation' 8 | , 'BedStatus' 9 | ] 10 | 11 | -------------------------------------------------------------------------------- /lib/segments/nte.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | exports.name = 'NTE' 4 | 5 | exports.fields = [ 6 | 'SegmentType' 7 | , 'SetID' 8 | , 'SourceOfComment' 9 | , 'Comment' 10 | , 'CommentType' 11 | ] 12 | 13 | -------------------------------------------------------------------------------- /lib/segments/obr.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | exports.name = 'OBR' 4 | 5 | exports.fields = [ 6 | 'SegmentType' 7 | , 'SetID' 8 | , 'PlacerOrderNumber' 9 | , 'FillerOrderNumber' 10 | , 'UniversalServiceID' 11 | , 'Priority' 12 | , 'RequestedDateTime' 13 | , 'ObservationDateTime' 14 | , 'ObservationEndDateTime' 15 | , 'CollectionVolume' 16 | , 'CollectorIdentifier' 17 | , 'SpecimenActionCode' 18 | , 'DangerCode' 19 | , 'RelevantClinicalInfo.' 20 | , 'SpecimenReceivedDateTime' 21 | , 'SpecimenSource' 22 | , 'OrderingProvider' 23 | , 'OrderCallbackPhoneNumber' 24 | , 'PlacerField1' 25 | , 'PlacerField2' 26 | , 'FillerField1' 27 | , 'FillerField2' 28 | , 'ResultsRptStatusChngDateTime' 29 | , 'ChargeToPractice' 30 | , 'DiagnosticServSectID' 31 | , 'ResultStatus' 32 | , 'ParentResult' 33 | , 'QuantityTiming' 34 | , 'ResultCopiesTo' 35 | , 'Parent' 36 | , 'TransportationMode' 37 | , 'ReasonForStudy' 38 | , 'PrincipalResultInterpreter' 39 | , 'AssistantResultInterpreter' 40 | , 'Technician' 41 | , 'Transcriptionist' 42 | , 'ScheduledDateTime' 43 | , 'NumberofSampleContainers' 44 | , 'TransportLogisticsOfCollectedSample' 45 | , 'CollectorsComment' 46 | , 'TransportArrangementResponsibility' 47 | , 'TransportArranged' 48 | , 'EscortRequired' 49 | , 'PlannedPatientTransportComment' 50 | , 'ProcedureCode' 51 | , 'ProcedureCodeModifier' 52 | ] 53 | 54 | -------------------------------------------------------------------------------- /lib/segments/obx.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | exports.name = 'OBX' 4 | 5 | exports.fields = [ 6 | 'SegmentType' 7 | , 'SetID' 8 | , 'ValueType' 9 | , 'ObservationIdentifier' 10 | , 'ObservationSubID' 11 | , 'ObservationValue' 12 | , 'Units' 13 | , 'ReferencesRange' 14 | , 'AbnormalFlags' 15 | , 'Probability' 16 | , 'NatureofAbnormalTest' 17 | , 'ObservationResultStatus' 18 | , 'EffectiveDateofReferenceRange' 19 | , 'UserDefinedAccessChecks' 20 | , 'DateTimeoftheObservation' 21 | , 'ProducersID' 22 | , 'ResponsibleObserver' 23 | , 'ObservationMethod' 24 | , 'EquipmentInstanceIdentifier' 25 | , 'DateTimeoftheAnalysis' 26 | , 'ObservationSite' 27 | , 'ObservationInstanceIdentifier' 28 | , 'MoodCode' 29 | , 'PerformingOrganizationName' 30 | , 'PerformingOrganizationAddress' 31 | , 'PerformingOrganizationMedicalDirector' 32 | ] 33 | -------------------------------------------------------------------------------- /lib/segments/ods.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | exports.name = 'ODS' 4 | 5 | exports.fields = [ 6 | 'SegmentType' 7 | , 'Type' 8 | , 'ServicePeriod' 9 | , 'DietSupplementOrPreferenceCode' 10 | , 'TextInstruction' 11 | ] 12 | 13 | -------------------------------------------------------------------------------- /lib/segments/odt.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | exports.name = 'ODT' 4 | 5 | exports.fields = [ 6 | 'SegmentType' 7 | , 'TrayType' 8 | , 'ServicePeriod' 9 | , 'InputParameterList' 10 | ] 11 | 12 | -------------------------------------------------------------------------------- /lib/segments/orc.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | exports.name = 'ORC' 4 | 5 | exports.fields = [ 6 | 'SegmentType' 7 | , 'OrderControl' 8 | , 'PlacerOrderNumber' 9 | , 'FillerOrderNumber' 10 | , 'PlacerGroupNumber' 11 | , 'OrderStatus' 12 | , 'ResponseFlag' 13 | , 'QuantityTiming' 14 | , 'Parent' 15 | , 'DateTimeofTransaction' 16 | , 'EnteredBy' 17 | , 'VerifiedBy' 18 | , 'OrderingProvider' 19 | , 'EnterersLocation' 20 | , 'CallBackPhoneNumber' 21 | , 'OrderEffectiveDateTime' 22 | , 'OrderControlCodeReason' 23 | , 'EnteringOrganization' 24 | , 'EnteringDevice' 25 | , 'ActionBy' 26 | , 'AdvancedBeneficiaryNoticeCode' 27 | , 'OrderingFacilityName' 28 | , 'OrderingFacilityAddress' 29 | , 'OrderingFacilityPhoneNumber' 30 | , 'OrderingProviderAddress' 31 | , 'OrderStatusModifier' 32 | , 'AdvancedBeneficiaryNoticeOverrideReason' 33 | , 'FillersExpectedAvailabilityDateTime' 34 | , 'ConfidentialityCode' 35 | , 'OrderType' 36 | , 'EntererAuthorizationMode' 37 | , 'ParentUniversalServiceIdentifier' 38 | ] 39 | 40 | -------------------------------------------------------------------------------- /lib/segments/pd1.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | exports.name = 'PD1' 4 | 5 | exports.fields = [ 6 | 'SegmentType' 7 | , 'LivinDependency' 8 | , 'LivingArrangement' 9 | , 'PatientPrimaryFacility' 10 | , 'PatientPrimaryCareProviderNameID' 11 | , 'StudentIndicator' 12 | , 'Handicap' 13 | , 'LivingWill' 14 | , 'OrganDonor' 15 | , 'SeparateBill' 16 | , 'DuplicatePatient' 17 | , 'PublicityCode' 18 | , 'ProtectionIndicator' 19 | ] 20 | 21 | -------------------------------------------------------------------------------- /lib/segments/pid.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | exports.name = 'PID' 4 | 5 | exports.fields = [ 6 | 'SegmentType' 7 | , 'SetID' 8 | , 'PatientID' 9 | , 'PatientIdentifierList' 10 | , 'AlternatePatientID' 11 | , 'PatientName' 12 | , 'MothersMaidenName' 13 | , 'DateTimeofBirth' 14 | , 'AdministrativeSex' 15 | , 'PatientAlias' 16 | , 'Race' 17 | , 'PatientAddress' 18 | , 'CountyCode' 19 | , 'PhoneNumberHome' 20 | , 'PhoneNumberBusiness' 21 | , 'PrimaryLanguage' 22 | , 'MaritalStatus' 23 | , 'Religion' 24 | , 'PatientAccountNumber' 25 | , 'SSNNumberPatient' 26 | , 'DriversLicenseNumberPatient' 27 | , 'MothersIdentifier' 28 | , 'EthnicGroup' 29 | , 'BirthPlace' 30 | , 'MultipleBirthIndicator' 31 | , 'BirthOrder' 32 | , 'Citizenship' 33 | , 'VeteransMilitaryStatus' 34 | , 'Nationality' 35 | , 'PatientDeathDateandTime' 36 | , 'PatientDeathIndicator' 37 | , 'IdentityUnknownIndicator' 38 | , 'IdentityReliabilityCode' 39 | , 'LastUpdateDateTime' 40 | , 'LastUpdateFacility' 41 | , 'SpeciesCode' 42 | , 'BreedCode' 43 | , 'Strain' 44 | , 'ProductionClassCode' 45 | , 'TribalCitizenship' 46 | ] 47 | 48 | -------------------------------------------------------------------------------- /lib/segments/pr1.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | exports.name = 'PR1' 4 | 5 | exports.fields = [ 6 | 'SegmentType' 7 | , 'SetID' 8 | , 'ProcedureCodingMethod' 9 | , 'ProcedureCode' 10 | , 'ProcedureDescription' 11 | , 'ProcedureDateTime' 12 | , 'ProcedureFunctionalType' 13 | , 'ProcedureMinutes' 14 | , 'Anesthesiologist' 15 | , 'AnesthesiaCode' 16 | , 'AnesthesiaMinutes' 17 | , 'Surgeon' 18 | , 'ProcedurePractitioner' 19 | , 'ConsentCode' 20 | , 'ProcedurePriority' 21 | , 'AssociatedDiagnosisCode' 22 | , 'ProcedureCodeModifier' 23 | ] 24 | -------------------------------------------------------------------------------- /lib/segments/pv1.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | exports.name = 'PV1' 4 | 5 | exports.fields = [ 6 | 'SegmentType' 7 | , 'SetID' 8 | , 'PatientClass' 9 | , 'AssignedPatientLocation' 10 | , 'AdmissionType' 11 | , 'PreadmitNumber' 12 | , 'PriorPatientLocation' 13 | , 'AttendingDoctor' 14 | , 'ReferringDoctor' 15 | , 'ConsultingDoctor' 16 | , 'HospitalService' 17 | , 'TemporaryLocation' 18 | , 'PreadmitTestIndicator' 19 | , 'ReadmissionIndicator' 20 | , 'AdmitSource' 21 | , 'AmbulatoryStatus' 22 | , 'VIPIndicator' 23 | , 'AdmittingDoctor' 24 | , 'PatientType' 25 | , 'VisitNumber' 26 | , 'FinancialClass' 27 | , 'ChargePriceIndicator' 28 | , 'CourtesyCode' 29 | , 'CreditRating' 30 | , 'ContractCode' 31 | , 'ContractEffectiveDate' 32 | , 'ContractAmount' 33 | , 'ContactPeriod' 34 | , 'InterestCode' 35 | , 'TransferToBadDebtCode' 36 | , 'TransferToBadDebtDate' 37 | , 'BadDebtAgencyCode' 38 | , 'BadDebtTransferAmount' 39 | , 'BadDebtRecoveryAmount' 40 | , 'DeleteAccountIndicator' 41 | , 'DeleteAccountDate' 42 | , 'DischargeDisposition' 43 | , 'DischargedToLocation' 44 | , 'DietType' 45 | , 'ServicingFacility' 46 | , 'BedStatus' 47 | , 'AccountStatus' 48 | , 'PendingLocation' 49 | , 'PriorTemporaryLocation' 50 | , 'AdmitDateTime' 51 | , 'DischargeDateTime' 52 | , 'CurrentPatientBalance' 53 | , 'TotalCharges' 54 | , 'TotalAdjustments' 55 | , 'TotalPayments' 56 | , 'AlternateVisitID' 57 | , 'VisitIndicator' 58 | , 'OtherHealthcareProvider' 59 | ] 60 | 61 | -------------------------------------------------------------------------------- /lib/segments/pv2.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | exports.name = 'PV2' 4 | 5 | exports.fields = [ 6 | 'SegmentType' 7 | , 'PriorPendingLocation' 8 | , 'AccommdationCode' 9 | , 'AdmitReason' 10 | , 'TransferReason' 11 | , 'PatientValuables' 12 | , 'PatientValuablesLocation' 13 | , 'VisitUserCode' 14 | , 'ExpectedAdmitDateTime' 15 | , 'ExpectedDischargeDateTime' 16 | , 'EstimatedLengthOfInpatientStay' 17 | , 'ActualLengthOfInpatientStay' 18 | , 'VisitDescription' 19 | , 'ReferralSourceCode' 20 | , 'PreviousServiceDate' 21 | , 'EmploymentIllnessRelatedIndicator' 22 | , 'PurgeStatusCode' 23 | , 'PurgeStatusDate' 24 | , 'SpecialProgramCode' 25 | , 'RetentionIndicator' 26 | , 'ExpectedNumberOfInsurancePlans' 27 | , 'VisitPublicityCode' 28 | , 'VisitProtectionIndicator' 29 | , 'ClinicOrganizationName' 30 | , 'PatientStatusCode' 31 | , 'VisitPriorityCode' 32 | , 'PreviousTreatmentDate' 33 | , 'ExpectedDischargeDisposition' 34 | , 'SignatureOnFileDate' 35 | , 'FirstSimilarIllnessDate' 36 | , 'PatientChargeAdjustmentCode' 37 | , 'RecurringServiceCode' 38 | , 'BillingMediaCode' 39 | , 'ExpectedSurgeryDateTime' 40 | , 'MilitaryPartnershipCode' 41 | , 'MilitaryNonAvailabilityCode' 42 | , 'NewbornBabyIndicator' 43 | , 'BabyDetainedIndicator' 44 | ] 45 | 46 | -------------------------------------------------------------------------------- /lib/segments/qak.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | exports.name = 'QAK' 4 | 5 | exports.fields = [ 6 | 'SegmentType' 7 | , 'Tag' 8 | , 'ResponseStatus' 9 | ] 10 | 11 | -------------------------------------------------------------------------------- /lib/segments/qrd.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | exports.name = 'QRD' 4 | 5 | exports.fields = [ 6 | 'SegmentType' 7 | , 'DateTime' 8 | , 'FormatCode' 9 | , 'Priority' 10 | , 'ID' 11 | , 'DeferredResponseType' 12 | , 'DeferredResponseDateTime' 13 | , 'QuantityLimitedRequest' 14 | , 'WhoSubjectFilter' 15 | , 'WhatSubjectFilter' 16 | , 'WhatDepartmentDataCode' 17 | , 'WhatDataCodeValueQual' 18 | , 'ResultsLevel' 19 | ] 20 | 21 | -------------------------------------------------------------------------------- /lib/segments/rdf.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | exports.name = 'RDF' 4 | 5 | exports.fields = [ 6 | 'SegmentType' 7 | , 'ColumnsPerRow' 8 | , 'Description' 9 | ] 10 | 11 | -------------------------------------------------------------------------------- /lib/segments/rdt.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | exports.name = 'RDT' 4 | 5 | exports.fields = [ 6 | 'SegmentType' 7 | , 'Value' 8 | ] 9 | 10 | -------------------------------------------------------------------------------- /lib/segments/rol.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | exports.name = 'ROL' 4 | 5 | exports.fields = [ 6 | 'SegmentType' 7 | , 'RoleInstanceID' 8 | , 'ActionCode' 9 | , 'RoleROL' 10 | , 'RolePerson' 11 | , 'RoleBeginDateTime' 12 | , 'RoleEndDateTime' 13 | , 'RoleDuration' 14 | , 'RoleActionReason' 15 | ] 16 | -------------------------------------------------------------------------------- /lib/segments/rq1.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | exports.name = 'RQ1' 4 | 5 | exports.fields = [ 6 | 'SegmentType' 7 | , 'AnticipatedPrice' 8 | , 'ManufacturerID' 9 | , 'ManufacturerCatalog' 10 | , 'VendorID' 11 | , 'VendorCatalog' 12 | , 'Taxable' 13 | , 'SubstituteAllowed' 14 | ] 15 | 16 | -------------------------------------------------------------------------------- /lib/segments/rqd.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | exports.name = 'RQD' 4 | 5 | exports.fields = [ 6 | 'SegmentType' 7 | , 'RequisitionLineNumber' 8 | , 'ItemCodeInternal' 9 | , 'ItemCodeExternal' 10 | , 'HospitalItemCode' 11 | , 'RequisitionQuantity' 12 | , 'RequisitionUnitOfMeasure' 13 | , 'DeptCostCenter' 14 | , 'ItemNaturalAccountCode' 15 | , 'DeliverToID' 16 | , 'DateNeeded' 17 | ] 18 | 19 | -------------------------------------------------------------------------------- /lib/segments/rxg.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | exports.name = 'RXG' 4 | 5 | exports.fields = [ 6 | 'SegmentType' 7 | , 'GiveSubIDCounter' 8 | , 'DispenseSubIDCounter' 9 | , 'QuantityTiming' 10 | , 'GiveCode' 11 | , 'GiveAmountMinimum' 12 | , 'GiveAmountMaximum' 13 | , 'GiveUnits' 14 | , 'GiveDosageForm' 15 | , 'AdministrationNotes' 16 | , 'SubstitutionStatus' 17 | , 'DispenseToLocation' 18 | , 'NeedsHumanReview' 19 | , 'PharmacyTreatmentSpecialAdministraionInstructions' 20 | , 'GivePerTimeUnit' 21 | , 'GiveRateAmount' 22 | , 'GiveRateUnits' 23 | , 'GiveStrength' 24 | , 'GiveStrengthUnits' 25 | , 'SubstanceLotNumber' 26 | , 'SubstanceExpirationDate' 27 | , 'SubstanceManufacturerName' 28 | , 'Indication' 29 | , 'GiveDrugStrengthVolume' 30 | , 'GiveDrugStrengthVolumeUnits' 31 | , 'GiveBardcodeIdentifier' 32 | , 'PharmacyOrderType' 33 | , 'DispenseToPharmacy' 34 | , 'DispenseToPharmacyAddress' 35 | , 'DeliverToPatientLocation' 36 | , 'DeliverToAddress' 37 | ] 38 | -------------------------------------------------------------------------------- /lib/segments/rxr.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | exports.name = 'RXR' 4 | 5 | exports.fields = [ 6 | 'SegmentType' 7 | , 'Route' 8 | , 'AdministrationSite' 9 | , 'AdministrationDevice' 10 | , 'AdministrationMethod' 11 | , 'RoutingInstruction' 12 | , 'AdministrationSiteModifier' 13 | ] 14 | 15 | -------------------------------------------------------------------------------- /lib/segments/spr.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | exports.name = 'SPR' 4 | 5 | exports.fields = [ 6 | 'SegmentType' 7 | , 'Tag' 8 | , 'ResponseFormatCode' 9 | , 'Name' 10 | , 'InputParameterList' 11 | ] 12 | 13 | -------------------------------------------------------------------------------- /lib/segments/stf.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | exports.name = 'STF' 4 | 5 | exports.fields = [ 6 | 'SegmentType' 7 | , 'PrimaryKeyValue' 8 | , 'StaffIDCode' 9 | , 'StaffName' 10 | , 'StaffType' 11 | , 'Sex' 12 | , 'DateOfBirth' 13 | , 'ActiveInactive' 14 | , 'Department' 15 | , 'Service' 16 | , 'Phone' 17 | , 'OfficeHomeAddress' 18 | , 'ActivationDate' 19 | , 'InactivationDate' 20 | , 'BackupPersonId' 21 | , 'EmailAddress' 22 | , 'PreferredMethodOfContact' 23 | , 'MartialStatus' 24 | , 'JobTitle' 25 | , 'JobCodeClass' 26 | , 'EmploymentStatus' 27 | , 'AdditionalInsuredOnAuto' 28 | , 'DriversLicenceNumber' 29 | , 'CopyAutoIns' 30 | , 'AutoInsExpires' 31 | , 'DateLastDMVReview' 32 | , 'DateNextDMVReview' 33 | , 'Race' 34 | , 'EthnicGroup' 35 | , 'Citizenship' 36 | , 'DeathDateAndTime' 37 | , 'DeathIndicator' 38 | , 'InstitutionRelationshipTypeCode' 39 | , 'InstitutionRelationshipPeriod' 40 | , 'ExpectedReturnDate' 41 | , 'CostCenterCode' 42 | , 'GenericClassificationIndicator' 43 | , 'InactiveReasonCode' 44 | ] 45 | -------------------------------------------------------------------------------- /lib/segments/tq1.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | exports.name = 'TQ1' 4 | 5 | exports.fields = [ 6 | 'SegmentType' 7 | , 'SetID' 8 | , 'Quantity' 9 | , 'RepeatPattern' 10 | , 'ExplicitTime' 11 | , 'RelativeTimeAndUnits' 12 | , 'ServiceDuration' 13 | , 'StartDateTime' 14 | , 'EndDateTime' 15 | , 'Priority' 16 | , 'ConditionText' 17 | , 'TextInstruction' 18 | , 'Conjuction' 19 | , 'OccurrenceDuration' 20 | , 'TotalOccurrences' 21 | ] 22 | 23 | -------------------------------------------------------------------------------- /lib/segments/txa.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | exports.name = 'TXA' 4 | 5 | exports.fields = [ 6 | 'SegmentType' 7 | , 'SetID' 8 | , 'DocumentType' 9 | , 'DocumentContentPresentation' 10 | , 'ActivityDateTime' 11 | , 'PrimaryActivityProviderCodeName' 12 | , 'OriginationDateTime' 13 | , 'TranscriptionDateTime' 14 | , 'EditDateTime' 15 | , 'OriginatorCodeName' 16 | , 'AssignedDocumentAuthenticator' 17 | , 'TranscriptionistCodeName' 18 | , 'UniqueDocumentNumber' 19 | , 'ParentDocumentNumber' 20 | , 'PlacerOrderNumber' 21 | , 'FillerOrderNumber' 22 | , 'UniqueDocumentFileName' 23 | , 'DocumentCompletionStatus' 24 | , 'DocumentConfidentialityStatus' 25 | , 'DocumentAvailabilityStatus' 26 | , 'DocumentStorageStatus' 27 | , 'DocumentChangeReason' 28 | , 'AuthenticationPersonTimestamp' 29 | , 'DistributedCopies' 30 | ] 31 | -------------------------------------------------------------------------------- /lib/segments/urd.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | exports.name = 'URD' 4 | 5 | exports.fields = [ 6 | 'SegmentType' 7 | , 'DateTime' 8 | , 'Priority' 9 | , 'WhoSubjectDefinition' 10 | , 'WhatSubjectDefinition' 11 | , 'WhatDepartmentCode' 12 | , 'DisplayPrintLocations' 13 | , 'ResultsLevel' 14 | ] 15 | 16 | -------------------------------------------------------------------------------- /lib/segments/urs.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | exports.name = 'URS' 4 | 5 | exports.fields = [ 6 | 'SegmentType' 7 | , 'WhereSubjectDefinition' 8 | , 'WhenDataStartDateTime' 9 | , 'WhenDataEndDateTime' 10 | , 'WhatUserQualifier' 11 | , 'OtherResultsSubjectDefinition' 12 | , 'WhichDateTimeQualifier' 13 | , 'WhichDateTimeStatusQualifier' 14 | , 'DateTimeSelectionQualifier' 15 | , 'QuantityTimingQualifier' 16 | ] 17 | 18 | -------------------------------------------------------------------------------- /lib/segments/vtq.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | exports.name = 'VTQ' 4 | 5 | exports.fields = [ 6 | 'SegmentType' 7 | , 'Tag' 8 | , 'ResponseFormatCode' 9 | , 'QueryName' 10 | , 'TableName' 11 | , 'SelectionCriteria' 12 | ] 13 | 14 | -------------------------------------------------------------------------------- /lib/utils.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | var utils = exports 4 | 5 | /** 6 | * Is the given _segment_ a header segment? 7 | * 8 | * @param {Segment} segment A Segment object 9 | * @api public 10 | */ 11 | utils.segmentIsHeader = function(segment) { 12 | if (segment.segmentType) { 13 | return utils.segmentTypeIsHeader(segment.segmentType()) 14 | } 15 | return false 16 | } 17 | 18 | /** 19 | * Is the given segment _type_ a header segment? 20 | * 21 | * @param {String} type The segment type 22 | * @api public 23 | */ 24 | utils.segmentTypeIsHeader = function(type) { 25 | return !!~utils.headerSegmentTypes.indexOf(type) 26 | } 27 | 28 | /*! 29 | * Header types that define delimiters 30 | */ 31 | utils.headerSegmentTypes = [ 32 | 'MSH' 33 | , 'FHS' 34 | , 'BHS' 35 | ] 36 | 37 | /*! 38 | * Returns the supported HL7 versions 39 | */ 40 | utils.supportedVersions = [ 41 | '2.3.1' 42 | ] 43 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "nodengine-hl7", 3 | "version": "4.1.8", 4 | "description": "HL7 parser", 5 | "main": "index.js", 6 | "bin": { 7 | "ne-hl7": "./bin/nodengine-hl7.js" 8 | }, 9 | "dependencies": { 10 | "help": "~2.0.0", 11 | "nopt": "~2.1.2", 12 | "npmlog": "0.0.6", 13 | "split": "~0.3.0" 14 | }, 15 | "devDependencies": { 16 | "eslint": "~1.10.3", 17 | "tap": "~5.4.2", 18 | "through": "~2.3.4" 19 | }, 20 | "scripts": { 21 | "lint": "eslint *.js lib/**.js bin/**.js test/**.js", 22 | "test": "npm run lint && tap test/*.js --cov" 23 | }, 24 | "repository": { 25 | "type": "git", 26 | "url": "git://github.com/evanlucas/nodengine-hl7" 27 | }, 28 | "keywords": [ 29 | "hl7", 30 | "parser" 31 | ], 32 | "author": "Evan Lucas ", 33 | "license": "MIT", 34 | "bugs": { 35 | "url": "https://github.com/evanlucas/nodengine-hl7/issues" 36 | }, 37 | "homepage": "https://github.com/evanlucas/nodengine-hl7" 38 | } 39 | -------------------------------------------------------------------------------- /scripts/fixsegments.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | var log = require('npmlog') 4 | , fs = require('fs') 5 | , args = process.argv.splice(2) 6 | , path = require('path') 7 | 8 | if (!args.length) { 9 | log.error('invalid args') 10 | log.error('usage', 'fixsegments ') 11 | process.exit(1) 12 | } 13 | 14 | var dir = path.join(args[0]) 15 | 16 | fs.readdirSync(args[0]) 17 | .filter(function(file) { 18 | return path.extname(file) === '.js' 19 | }) 20 | .forEach(function(file) { 21 | fixFile(file) 22 | }) 23 | 24 | function fixFile(file) { 25 | var name = file.replace('.js', '').toUpperCase() 26 | var fp = path.join(dir, file) 27 | var contents = fs.readFileSync(fp, 'utf8') 28 | var nameFixed = false 29 | , exportsFixed = false 30 | 31 | if (~contents.indexOf('segment.name = ')) { 32 | nameFixed = true 33 | } 34 | 35 | if (~contents.indexOf('exports.fields')) { 36 | exportsFixed = true 37 | } 38 | if (nameFixed && exportsFixed) { 39 | log.info('skip', name, 'already fixed') 40 | return 41 | } 42 | var lines = contents.split('\n') 43 | var len = lines.length 44 | var found = -1 45 | var foundEnd = -1 46 | for (var i=0; i') 11 | process.exit(1) 12 | } 13 | 14 | var contents = fs.readFileSync(args[0], 'utf8') 15 | 16 | var lines = contents.split('\n') 17 | 18 | lines = lines.filter(function(line) { 19 | return (line && line !== '' && line !== '\n') 20 | }) 21 | 22 | lines = lines.map(function(line, idx) { 23 | if (matches = line.match(/SetID ?\- ?.../)) { 24 | line = 'SetID' 25 | } 26 | line = line.replace(/[\-\*\s\/\'\’\.\(\)\+\#]/g, '') 27 | return " , '"+line+"'" 28 | }) 29 | 30 | var name = path.basename(args[0]) 31 | var file = [ 32 | "exports.name = '"+name+"'" 33 | , '' 34 | , 'exports.fields = [' 35 | , " 'SegmentType'" 36 | ] 37 | 38 | file = file.concat(lines) 39 | file.push(']') 40 | console.log(file.join('\n')) 41 | -------------------------------------------------------------------------------- /scripts/segments/DG1: -------------------------------------------------------------------------------- 1 | Set ID 2 | Diagnosis Coding Method 3 | Diagnosis Code 4 | Diagnosis Description 5 | Diagnosis Date/Time 6 | Diagnosis Type 7 | Major Diagnostic Category 8 | Diagnostic Related Group 9 | DRG Approval Indicator 10 | DRG Grouper Review Code 11 | Outlier Type 12 | Outlier Days 13 | Outlier Cost 14 | Grouper Version And Type 15 | Diagnosis Priority 16 | Diagnosing Clinician 17 | Diagnosis Classification 18 | Confidential Indicator 19 | Attestation Date/Time 20 | -------------------------------------------------------------------------------- /scripts/segments/DRG: -------------------------------------------------------------------------------- 1 | Diagnostic Related Group 2 | DRG Assigned Date/Time 3 | DRG Approval Indicator 4 | DRG Grouper Review Code 5 | Outlier Type 6 | Outlier Days 7 | Outlier Cost 8 | DRG Payor 9 | Outlier Reimbursement 10 | Confidential Indicator 11 | -------------------------------------------------------------------------------- /scripts/segments/FT1: -------------------------------------------------------------------------------- 1 | Set ID - FT1 2 | Transaction ID 3 | Transaction Batch ID 4 | Transaction Date 5 | Transaction Posting Date 6 | Transaction Type 7 | Transaction Code 8 | Transaction Description 9 | Transaction Description - Alt 10 | Transaction Quantity 11 | Transaction Amount - Extended 12 | Transaction Amount - Unit 13 | Department Code 14 | Insurance Plan ID 15 | Insurance Amount 16 | Assigned Patient Location 17 | Fee Schedule 18 | Patient Type 19 | Diagnosis Code - FT1 20 | Performed By Code 21 | Ordered By Code 22 | Unit Cost 23 | Filler Order Number 24 | Entered By Code 25 | Procedure Code 26 | Procedure Code Modifier 27 | -------------------------------------------------------------------------------- /scripts/segments/GT1: -------------------------------------------------------------------------------- 1 | SetID 2 | Guarantor Number 3 | Guarantor Name 4 | Guarantor Spouse Name 5 | Guarantor Address 6 | Guarantor Phone Home 7 | Guarantor Phone Business 8 | Guarantor BirthDate 9 | Guarantor Sex 10 | Guarantor Type 11 | Guarantor Relationship 12 | Guarantor SSN 13 | Guarantor Date - Begin 14 | Guarantor Date - End 15 | Guarantor Priority 16 | Guarantor Employer Name 17 | Guarantor Employer Address 18 | Guarantor Employer Phone Number 19 | Guarantor Employee ID Number 20 | Guarantor Employment Status 21 | Guarantor Organization Name 22 | Guarantor Billing Hold Flag 23 | Guarantor Credit Rating Code 24 | Guarantor Death Date Time 25 | Guarantor Death Flag 26 | Guarantor Charge Adjustment Code 27 | Guarantor Household Annual Income 28 | Guarantor Household Size 29 | Guarantor Employer ID Number 30 | Guarantor Marital Status Code 31 | Guarantor Hire Effective Date 32 | Employment Stop Date 33 | Living Dependency 34 | Ambulatory Status 35 | Citizenship 36 | Primary Language 37 | Living Arrangement 38 | Publicity Code 39 | Protection Indicator 40 | Student Indicator 41 | Religion 42 | Mother’s Maiden Name 43 | Nationality 44 | Ethnic Group 45 | Contact Person’s Name 46 | Contact Person’s Telephone Number 47 | Contact Reason 48 | Contact Relationship 49 | Job Title 50 | Job Code/Class 51 | Guarantor Employer’s Organization Name 52 | Handicap 53 | Job Status 54 | Guarantor Financial Class 55 | Guarantor Race 56 | -------------------------------------------------------------------------------- /scripts/segments/IN1: -------------------------------------------------------------------------------- 1 | SetID 2 | Insurance Plan ID 3 | Insurance Company ID 4 | Insurance Company Name 5 | Insurance Company Address 6 | Insurance Co Contact Person 7 | Insurance Co Phone Number 8 | Group Number 9 | Group Name 10 | Insured’s Group Emp ID 11 | Insured’s Group Emp Name 12 | Plan Effective Date 13 | Plan Expiration Date 14 | Authorization Information 15 | Plan Type 16 | Name Of Insured 17 | Insured’s Relationship To Patient 18 | Insured’s Date Of Birth 19 | Insured’s Address 20 | Assignment Of Benefits 21 | Coordination Of Benefits 22 | Coord Of Ben. Priority 23 | Notice Of Admission Flag 24 | Notice Of Admission Date 25 | Report Of Eligibility Flag 26 | Report Of Eligibility Date 27 | Release Information Code 28 | Pre-Admit Cert 29 | Verification Date/Time 30 | Verification By 31 | Type Of Agreement Code 32 | Billing Status 33 | Lifetime Reserve Days 34 | Delay Before L.R. Day 35 | Company Plan Code 36 | Policy Number 37 | Policy Deductible 38 | Policy Limit - Amount 39 | Policy Limit - Days 40 | Room Rate - Semi-Private 41 | Room Rate - Private 42 | Insured’s Employment Status 43 | Insured’s Sex 44 | Insured’s Employer’s Address 45 | Verification Status 46 | Prior Insurance Plan ID 47 | Coverage Type 48 | Handicap 49 | Insured’s ID Number 50 | -------------------------------------------------------------------------------- /scripts/segments/IN2: -------------------------------------------------------------------------------- 1 | Insured’s Employee ID 2 | Insured’s Social Security Number 3 | Insured’s Employer’s Name and ID 4 | Employer Information Data 5 | Mail Claim Party 6 | Medicare Health Ins Card Number 7 | Medicaid Case Name 8 | Medicaid Case Number 9 | Military Sponsor Name 10 | Military ID Number 11 | Dependent Of Military Recipient 12 | Military Organization 13 | Military Station 14 | Military Service 15 | Military Rank/Grade 16 | Military Status 17 | Military Retire Date 18 | Military Non-Avail Cert On File 19 | Baby Coverage 20 | Combine Baby Bill 21 | Blood Deductible 22 | Special Coverage Approval Name 23 | Special Coverage Approval Title 24 | Non-Covered Insurance Code 25 | Payor ID 26 | Payor Subscriber ID 27 | Eligibility Source 28 | Room Coverage Type/Amount 29 | Policy Type/Amount 30 | Daily Deductible 31 | Living Dependency 32 | Ambulatory Status 33 | Citizenship 34 | Primary Language 35 | Living Arrangement 36 | Publicity Code 37 | Protection Indicator 38 | Student Indicator 39 | Religion 40 | Mother’s Maiden Name 41 | Nationality 42 | Ethnic Group 43 | Marital Status 44 | Insured’s Employment Start Date 45 | Employment Stop Date 46 | Job Title 47 | Job Code/Class 48 | Job Status 49 | Employer Contact Person Name 50 | Employer Contact Person Phone Number 51 | Employer Contact Reason 52 | Insured’s Contact Person’s Name 53 | Insured’s Contact Person Phone Number 54 | Insured’s Contact Person Reason 55 | Relationship To The Patient Start Date 56 | Relationship To The Patient Stop Date 57 | Insurance Co. Contact Reason 58 | Insurance Co Contact Phone Number 59 | Policy Scope 60 | Policy Source 61 | Patient Member Number 62 | Guarantor’s Relationship To Insured 63 | Insured’s Phone Number - Home 64 | Insured’s Employer Phone Number 65 | Military Handicapped Program 66 | Suspend Flag 67 | Copay Limit Flag 68 | Stoploss Limit Flag 69 | Insured Organization Name And ID 70 | Insured Employer Organization Name And ID 71 | Race 72 | HCFA Patient’s Relationship to Insured 73 | -------------------------------------------------------------------------------- /scripts/segments/OBX: -------------------------------------------------------------------------------- 1 | Set ID - OBX 2 | Value Type 3 | Observation Identifier 4 | Observation Sub-ID 5 | Observation Value 6 | Units 7 | References Range 8 | Abnormal Flags 9 | Probability 10 | Nature of Abnormal Test 11 | Observation Result Status 12 | Date Last Obs Normal Values 13 | User Defined Access Checks 14 | Date/Time of the Observation 15 | Producer's ID 16 | Responsible Observer 17 | Observation Method 18 | -------------------------------------------------------------------------------- /scripts/segments/ORC: -------------------------------------------------------------------------------- 1 | Order Control 2 | Placer Order Number 3 | Filler Order Number 4 | Placer Group Number 5 | Order Status 6 | Response Flag 7 | Quantity/Timing 8 | Parent 9 | Date/Time of Transaction 10 | Entered By 11 | Verified By 12 | Ordering Provider 13 | Enterer’s Location 14 | Call Back Phone Number 15 | Order Effective Date/Time 16 | Order Control Code Reason Entering Organization 17 | Entering Device 18 | Action By 19 | Advanced Beneficiary Notice Code Ordering Facility Name 20 | Ordering Facility Address 21 | Ordering Facility Phone Number Ordering Provider Address 22 | -------------------------------------------------------------------------------- /scripts/segments/PR1: -------------------------------------------------------------------------------- 1 | Set ID 2 | Procedure Coding Method 3 | Procedure Code 4 | Procedure Description 5 | Procedure Date/Time 6 | Procedure Functional Type 7 | Procedure Minutes 8 | Anesthesiologist 9 | Anesthesia Code 10 | Anesthesia Minutes 11 | Surgeon 12 | Procedure Practitioner 13 | Consent Code 14 | Procedure Priority 15 | Associated Diagnosis Code 16 | Procedure Code Modifier 17 | -------------------------------------------------------------------------------- /scripts/segments/TXA: -------------------------------------------------------------------------------- 1 | Set ID 2 | Document Type 3 | Document Content Presentation 4 | Activity Date/Time 5 | Primary Activity Provider Code/Name 6 | Origination Date/Time 7 | Transcription Date/Time 8 | Edit Date/Time 9 | Originator Code/Name 10 | Assigned Document Authenticator 11 | Transcriptionist Code/Name 12 | Unique Document Number 13 | Parent Document Number 14 | Placer Order Number 15 | Filler Order Number 16 | Unique Document File Name 17 | Document Completion Status 18 | Document Confidentiality Status 19 | Document Availability Status 20 | Document Storage Status 21 | Document Change Reason 22 | Authentication Person, Time Stamp 23 | Distributed Copies 24 | -------------------------------------------------------------------------------- /test/fixtures/invalid.hl7: -------------------------------------------------------------------------------- 1 | this is an invalid message 2 | 3 | 4 | it is blah blah -------------------------------------------------------------------------------- /test/fixtures/out.hl7: -------------------------------------------------------------------------------- 1 | MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19285|T|2.2|||||||| EVN|A31|200401300419|||| PID||1|1||CRIST^BARBRA^MANUEL||19770310|F|||8762 STONERIDGE CT^^FAIR HAVEN^NY^13064||(555)988-6177|(888)555-4496|||||081776300||||||||||| PV1|||^^^MAIN ST (HUB)||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9|V762|SCREENING FOR MALIGNANT NEOPLASMS OF THE CERVIX||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||ECHOLS^HILMA|(888)555-1241||||||||| IN1||21^BCBS-NY: EMPIRE BCBS HEALTHCHOICE|21^BCBS-NY: EMPIRE BCBS HEALTHCHOICE|BCBS-NY: EMPIRE BCBS HEALTHCHOICE|PO BOX 1407^CHURCH STREET STATION^NEW YORK^NY^10008-1407|^|(800)801-4304|1029||||19990101||||CRIST^BARBRA^MANUEL|Self|19770310||||1||||||||||||||123456789|||||||F|||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19287|T|2.2|||||||| EVN|A31|200401300419|||| PID||4|4||DOCTOR^LASHELL^||19680506|F|||8762 STONERIDGE CT^^EATON^NY^13334||(555)229-1875|(888)555-1968|||||848650222||||||||||| PV1|||^^^MAIN ST (HUB)||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9||no current diagnosis||||||||||||||| GT1|||DOCTOR^LASHELL^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||STRAWSER^EARLIE|(888)555-1241||||||||| IN1||1907^BCBS-NY: EMPIRE BLUE CROSS BLUE SHIELD (AHP)|1907^BCBS-NY: EMPIRE BLUE CROSS BLUE SHIELD (AHP)|BCBS-NY: EMPIRE BLUE CROSS BLUE SHIELD (AHP)|PO BOX 5020^^MIDDLETOWN^NY^10940-9020|^|(800)772-2875|||||||||DOCTOR^LASHELL^|Self|19680506||||1||||||||||||||123456789|||||||F|||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19289|T|2.2|||||||| EVN|A31|200401300419|||| PID||147401|147401||AMICK^DEB^||19741014|F|||8762 STONERIDGE CT^^WAMPSVILLE^NY^13163||(555)962-4123|(888)555-5156|||||177354484||||||||||| PV1|||^^^MAIN ST (HUB)||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9|V762|SCREENING FOR MALIGNANT NEOPLASMS OF THE CERVIX||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||BRAMAN^LANELLE|(888)555-1241||||||||| IN1||2994^AMERICHOICE-MHS NY (MEDICAID HMO)|2994^AMERICHOICE-MHS NY (MEDICAID HMO)|AMERICHOICE-MHS NY (MEDICAID HMO)|PO BOX 7720^^PHOENIX^AZ^85011-7720|^|(888)336-4845|1029||||||||AMICK^DEB^|Self|19741014||||1||||||||||||||123456789|||||||F|||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19291|T|2.2|||||||| EVN|A31|200401300419|||| PID||188201|188201||GILBREATH^MARTHA^||19781004|F|||8762 STONERIDGE CT^^PULTNEYVILLE^NY^14538||(555)809-9155|(888)555-7126|||||784173211||||||||||| PV1|||^^^||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9||no current diagnosis||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||VATH^JOELLE|(888)555-1241||||||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19293|T|2.2|||||||| EVN|A31|200401300419|||| PID||342101|342101||HACKER^AMBER^||19800506|F|||8762 STONERIDGE CT^^DUNDEE^NY^14837||(555)812-6129|(888)555-4628|||||744115340||||||||||| PV1|||^^^||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9||no current diagnosis||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||MCNUTT^NIKI|(888)555-1241||||||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19295|T|2.2|||||||| EVN|A31|200401300419|||| PID||240901|240901||TALARICO^KATHRINE^||19270716|F|||8762 STONERIDGE CT^^BOHEMIA^NY^11716||(555)038-2638|(888)555-5402|||||736081534||||||||||| PV1|||^^^||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9||no current diagnosis||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||SHUGART^LASHONDA|(888)555-1241||||||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19297|T|2.2|||||||| EVN|A31|200401300419|||| PID||153801|153801||BARIL^ARLETTE^||19771111|F|||8762 STONERIDGE CT^^OTISVILLE^NY^10963||(555)357-0132|(888)555-1125|||||756174007||||||||||| PV1|||^^^||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9||no current diagnosis||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||ALTMAN^DOMINGO|(888)555-1241||||||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19299|T|2.2|||||||| EVN|A31|200401300419|||| PID||290501|290501||HUSTON^YAHAIRA^||19830619|F|||8762 STONERIDGE CT^^NEW YORK^NY^10036||(555)375-7817|(888)555-6054|||||211818807||||||||||| PV1|||^^^||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9||no current diagnosis||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||GITTENS^JALISA|(888)555-1241||||||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19301|T|2.2|||||||| EVN|A31|200401300419|||| PID||27201|27201||NIMMO^CAROLIN^||19680223|F|||8762 STONERIDGE CT^^NEW YORK^NY^10016||(555)422-5824|(888)555-8177|||||742669358||||||||||| PV1|||^^^||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9||no current diagnosis||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||PALMATEER^SALLY|(888)555-1241||||||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19303|T|2.2|||||||| EVN|A31|200401300419|||| PID||218101|218101||ROYALL^CARA^||19790326|F|||8762 STONERIDGE CT^^RAYMONDVILLE^NY^13678||(555)754-5725|(888)555-0215|||||059920093||||||||||| PV1|||^^^||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9||no current diagnosis||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||MAURIN^DARCIE|(888)555-1241||||||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19305|T|2.2|||||||| EVN|A31|200401300419|||| PID||121801|121801||BLEA^SILVA^||19570621||||8762 STONERIDGE CT^^CARBONDALE^PA^18407||(555)550-1998|(888)555-5945|||||787180015||||||||||| PV1|||^^^||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9||no current diagnosis||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||FURTADO^MACY|(888)555-1241||||||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19307|T|2.2|||||||| EVN|A31|200401300419|||| PID||33601|33601||NALLY^EARTHA^||19650116|F|||8762 STONERIDGE CT^^AKRON^NY^14001||(555)640-6571|(888)555-1176|||||864834666||||||||||| PV1|||^^^||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9||no current diagnosis||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||DICK^CHERY|(888)555-1241||||||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19309|T|2.2|||||||| EVN|A31|200401300419|||| PID||304501|304501||NOLASCO^JULIETA^||19610921|F|||8762 STONERIDGE CT^^SAINT JAMES^NY^11780||(555)293-0745|(888)555-8157|||||059043990||||||||||| PV1|||^^^MAIN ST (HUB)||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9|V723|GYNECOLOGICAL EXAMINATION||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||ABBOTT^KATI|(888)555-1241||||||||| IN1||21^BCBS-NY: EMPIRE BCBS HEALTHCHOICE|21^BCBS-NY: EMPIRE BCBS HEALTHCHOICE|BCBS-NY: EMPIRE BCBS HEALTHCHOICE|PO BOX 1407^CHURCH STREET STATION^NEW YORK^NY^10008-1407|^|(800)801-4304|||||||||NOLASCO^JULIETA^|Self|19610921||||1||||||||||||||123456789|||||||F|||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19311|T|2.2|||||||| EVN|A31|200401300419|||| PID||282401|282401||MIRELES^MARIANNA^||19790718|F|||8762 STONERIDGE CT^^EASTPORT^NY^11941||(555)840-8169|(888)555-4167|||||467135757||||||||||| PV1|||^^^||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9||no current diagnosis||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||MERRY^KEVEN|(888)555-1241||||||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19313|T|2.2|||||||| EVN|A31|200401300419|||| PID||123801|123801||ROHE^ALMEDA^||19760203|F|||8762 STONERIDGE CT^^FLUSHING^NY^11381||(555)913-5447|(888)555-2089|||||626036669||||||||||| PV1|||^^^||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9||no current diagnosis||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||CRAIN^HERB|(888)555-1241||||||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19315|T|2.2|||||||| EVN|A31|200401300419|||| PID||53301|53301||MULLANE^LARHONDA^||19631122|F|||8762 STONERIDGE CT^^WAWARSING^NY^12489||(555)183-8585|(888)555-8123|||||209994155||||||||||| PV1|||^^^||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9||no current diagnosis||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||VALLONE^SUSAN|(888)555-1241||||||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19317|T|2.2|||||||| EVN|A31|200401300419|||| PID||172101|172101||DUCKETT^ELVIA^||19770205|F|||8762 STONERIDGE CT^^NEW YORK^NY^10197||(555)839-0991|(888)555-9430|||||833150473||||||||||| PV1|||^^^||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9||no current diagnosis||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||BIG^COY|(888)555-1241||||||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19319|T|2.2|||||||| EVN|A31|200401300419|||| PID||322001|322001||SCHULER^CATHERN^||19791112|F|||8762 STONERIDGE CT^^MARLBORO^NY^12542||(555)418-3807|(888)555-7848|||||515346671||||||||||| PV1|||^^^||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9||no current diagnosis||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||BRAWN^NOEL|(888)555-1241||||||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19321|T|2.2|||||||| EVN|A31|200401300419|||| PID||287101|287101||ORDUNA^MANY^||19780418|F|||8762 STONERIDGE CT^^NEW YORK^NY^10256||(555)459-5037|(888)555-5986|||||659615100||||||||||| PV1|||^^^||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9||no current diagnosis||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||BASNIGHT^GAYNELL|(888)555-1241||||||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19323|T|2.2|||||||| EVN|A31|200401300419|||| PID||181301|181301||KAPP^CRISTIN^||19750827|F|||8762 STONERIDGE CT^^MONTROSE^NY^10548||(555)204-0355|(888)555-8867|||||860929783||||||||||| PV1|||^^^||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9||no current diagnosis||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||COMER^JEREMY|(888)555-1241||||||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19325|T|2.2|||||||| EVN|A31|200401300419|||| PID||128201|128201||LIU^LAVERNA^||19760615|F|||8762 STONERIDGE CT^^NEW YORK^NY^10173||(555)221-1154|(888)555-9832|||||182715188||||||||||| PV1|||^^^||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9||no current diagnosis||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||WINNIE^HERSHEL|(888)555-1241||||||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19327|T|2.2|||||||| EVN|A31|200401300419|||| PID||337701|337701||PERKINSON^REYNA^||19580420|F|||8762 STONERIDGE CT^^SHELTER ISLAND HEIGHTS^NY^11965||(555)150-4006|(888)555-3890|||||545242166||||||||||| PV1|||^^^||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9||no current diagnosis||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||LAXSON^SIMONE|(888)555-1241||||||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19329|T|2.2|||||||| EVN|A31|200401300419|||| PID||95901|95901||BOWKER^ALLISON^||19470902||||8762 STONERIDGE CT^^PLATTSBURGH^NY^12901||(555)810-3931|(888)555-3471|||||429702969||||||||||| PV1|||^^^||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9||no current diagnosis||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||ANAYA^LASHANDA|(888)555-1241||||||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19331|T|2.2|||||||| EVN|A31|200401300419|||| PID||296501|296501||EGGLESTON^MIA^||19690116|F|||8762 STONERIDGE CT^^HICKSVILLE^NY^11819||(555)185-2552|(888)555-0065|||||302685716||||||||||| PV1|||^^^||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9||no current diagnosis||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||BAUER^CARLITA|(888)555-1241||||||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19333|T|2.2|||||||| EVN|A31|200401300419|||| PID||158801|158801||RIEDEL^ALECIA^||19750320|F|||8762 STONERIDGE CT^^JASPER^NY^14855||(555)631-1686|(888)555-6178|||||820849321||||||||||| PV1|||^^^||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9||no current diagnosis||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||JANIS^DAYLE|(888)555-1241||||||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19335|T|2.2|||||||| EVN|A31|200401300419|||| PID||89601|89601||GREENFIELD^OSSIE^||19750109|F|||8762 STONERIDGE CT^^CENTRAL ISLIP^NY^11722||(555)348-1854|(888)555-2756|||||559764162||||||||||| PV1|||^^^||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9||no current diagnosis||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||OKANE^DIA|(888)555-1241||||||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19337|T|2.2|||||||| EVN|A31|200401300419|||| PID||265501|265501||MULVIHILL^CREOLA^||19720124|F|||8762 STONERIDGE CT^^EARLTON^NY^12058||(555)409-5728|(888)555-4928|||||322325889||||||||||| PV1|||^^^||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9||no current diagnosis||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||HARPOLE^BRIANA|(888)555-1241||||||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19339|T|2.2|||||||| EVN|A31|200401300419|||| PID||239001|239001||PEREYRA^LAYNE^||19771109||||8762 STONERIDGE CT^^ALBANY^NY^12241||(555)998-9970|(888)555-3026|||||065949029||||||||||| PV1|||^^^||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9||no current diagnosis||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||CULVER^BUDDY|(888)555-1241||||||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19341|T|2.2|||||||| EVN|A31|200401300419|||| PID||201|201||SQUIRE^STEPHANIA^KARL||19691127|F|||8762 STONERIDGE CT^^NEW YORK^NY^10028||(555)898-4002|(888)555-8680|||||320985403||||||||||| PV1|||^^^||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9||no current diagnosis||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||LESNIAK^MERI|(888)555-1241||||||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19343|T|2.2|||||||| EVN|A31|200401300419|||| PID||312901|312901||HRUSKA^KAYLEIGH^||19750318|F|||8762 STONERIDGE CT^^ISLANDIA^NY^11760||(555)857-1047|(888)555-3067|||||049512751||||||||||| PV1|||^^^||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9||no current diagnosis||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||SHEEDY^JENEE|(888)555-1241||||||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19345|T|2.2|||||||| EVN|A31|200401300419|||| PID||32801|32801||CASTIGLIA^KIMBERY^||19560523|F|||8762 STONERIDGE CT^^HAILESBORO^NY^13645||(555)294-4361|(888)555-8713|||||542438182||||||||||| PV1|||^^^||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9||no current diagnosis||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||GUITERREZ^JAVIER|(888)555-1241||||||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19347|T|2.2|||||||| EVN|A31|200401300419|||| PID||349101|349101||HOSEA^CORRIE^||19800620|F|||8762 STONERIDGE CT^^ALBANY^NY^12210||(555)601-7170|(888)555-8779|||||592233342||||||||||| PV1|||^^^MAIN ST (HUB)||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9|6264|IRREGULAR MENSTRUAL CYCLE IRREGULAR: BLEEDING NOS, MENSTRUATION, PERIODS||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||NATALE^JACKELINE|(888)555-1241||||||||| IN1||11425^AMERICHOICE-MHS NY (MEDICAID HMO)|11425^AMERICHOICE-MHS NY (MEDICAID HMO)|AMERICHOICE-MHS NY (MEDICAID HMO)|PO BOX 7720^^PHOENIX^AZ^85011-7720|^|888-336-4845|||||||||HOSEA^CORRIE^|Self|19800620||||1||||||||||||||123456789|||||||F|||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19349|T|2.2|||||||| EVN|A31|200401300419|||| PID||339701|339701||LEO^FAUSTINA^||19810127|F|||8762 STONERIDGE CT^^STEPHENTOWN^NY^12169||(555)618-6125|(888)555-4106|||||816849266||||||||||| PV1|||^^^||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9||no current diagnosis||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||HESLIN^REINALDO|(888)555-1241||||||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19351|T|2.2|||||||| EVN|A31|200401300419|||| PID||293602|293602||CARUSO^PING^||19640501|F|||8762 STONERIDGE CT^^ROSE^NY^14542||(555)324-4132|(888)555-5364|||||708223810||||||||||| PV1|||^^^||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9||no current diagnosis||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||BIONDI^BRITTNI|(888)555-1241||||||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19353|T|2.2|||||||| EVN|A31|200401300419|||| PID||349901|349901||STYLES^CELINE^||19750814|F|||8762 STONERIDGE CT^^WATERPORT^NY^14571||(555)029-2242|(888)555-4215|||||362652642||||||||||| PV1|||^^^MAIN ST (HUB)||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9|632|MISSED ABORTION EARLY FETAL DEATH BEFORE COMPLETION OF 22 WEEKS' GESTATION WITH RETENTION OF DEAD FETUS; RETAINED PRODUCTS OF CONCEPTION, NOT FOLLOWING SPONTANEOUS OR INDUCED ABORTION OR DELIVERY||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||KREUTZER^COLTON|(888)555-1241||||||||| IN1||994^HEALTH INSURANCE PLAN OF GREATER NY (HIP) - ATTN PROFESSIONAL CLAIMS|994^HEALTH INSURANCE PLAN OF GREATER NY (HIP) - ATTN PROFESSIONAL CLAIMS|HEALTH INSURANCE PLAN OF GREATER NY (HIP) - ATTN PROFESSIONAL CLAIMS|7 WEST 34TH STREET^SIXTH FLOOR CLAIMS^NEW YORK^NY^10001-8190|^|(800)447-8275|||||||||STYLES^CELINE^|Self|19750814||||1||||||||||||||123456789|||||||F|||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19355|T|2.2|||||||| EVN|A31|200401300419|||| PID||267701|267701||FORTIER^CARLENA^||19790909|F|||8762 STONERIDGE CT^^STONE RIDGE^NY^12484||(555)453-8075|(888)555-7205|||||561075745||||||||||| PV1|||^^^||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9||no current diagnosis||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||DUNMIRE^LEENA|(888)555-1241||||||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19357|T|2.2|||||||| EVN|A31|200401300419|||| PID||211201|211201||ALSUP^CARLYN^||19770218|F|||8762 STONERIDGE CT^^HEMPSTEAD^NY^11550||(555)105-1387|(888)555-9829|||||193191449||||||||||| PV1|||^^^||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9||no current diagnosis||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||NUNES^ERNEST|(888)555-1241||||||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19359|T|2.2|||||||| EVN|A31|200401300419|||| PID||18701|18701||SHEPERD^CINDI^||19730404|F|||8762 STONERIDGE CT^^GREENWOOD LAKE^NY^10925||(555)447-4490|(888)555-0276|||||688540345||||||||||| PV1|||^^^||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9||no current diagnosis||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||ROWELL^MISS|(888)555-1241||||||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19361|T|2.2|||||||| EVN|A31|200401300419|||| PID||16001|16001||DEEDS^XIAO^||19580111|F|||8762 STONERIDGE CT^^CASTLE POINT^NY^12511||(555)284-3821|(888)555-5270|||||764813204||||||||||| PV1|||^^^||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9||no current diagnosis||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||DALKE^BERNETTA|(888)555-1241||||||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19363|T|2.2|||||||| EVN|A31|200401300419|||| PID||283101|283101||RAGSDALE^TAMI^||19791103|F|||8762 STONERIDGE CT^^ESPERANCE^NY^12066||(555)446-4263|(888)555-6735|||||161570356||||||||||| PV1|||^^^||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9||no current diagnosis||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||BERNARDI^CHRISTY|(888)555-1241||||||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19365|T|2.2|||||||| EVN|A31|200401300419|||| PID||90401|90401||VANSANT^PARTHENIA^||19580320|F|||8762 STONERIDGE CT^^RICHLAND^NY^13144||(555)261-9586|(888)555-7959|||||339252857||||||||||| PV1|||^^^||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9||no current diagnosis||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||GILLIGAN^SHAROLYN|(888)555-1241||||||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19367|T|2.2|||||||| EVN|A31|200401300419|||| PID||138301|138301||MCCAY^CHERRYL^||19770216|F|||8762 STONERIDGE CT^^NEW YORK^NY^10172||(555)772-1369|(888)555-6824|||||215264543||||||||||| PV1|||^^^||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9||no current diagnosis||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||WELDY^BOB|(888)555-1241||||||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19369|T|2.2|||||||| EVN|A31|200401300419|||| PID||22701|22701||BRADY^ERINN^||19720308|F|||8762 STONERIDGE CT^^EARLTON^NY^12058||(555)786-1229|(888)555-1519|||||939825115||||||||||| PV1|||^^^||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9||no current diagnosis||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||LISKA^ONITA|(888)555-1241||||||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19371|T|2.2|||||||| EVN|A31|200401300419|||| PID||108901|108901||MELVIN^MIKE^||19621016|M|||8762 STONERIDGE CT^^MANTUA^NJ^08051||(555)303-7410|(888)555-3358|||||039158237||||||||||| PV1|||^^^||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9||no current diagnosis||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||FAUST^JESSIE|(888)555-1241||||||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19373|T|2.2|||||||| EVN|A31|200401300419|||| PID||63401|63401||MOLYNEUX^AZALEE^||19640425|F|||8762 STONERIDGE CT^^ALBANY^NY^12211||(555)034-8480|(888)555-6906|||||429533960||||||||||| PV1|||^^^MAIN ST (HUB)||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9|65641|INTRAUTERINE DEATH, AFFECTING MANAGEMENT OF MOTHER, DELIVERED FETAL DEATH: NOS, AFTER COMPLETION OF 22 WEEKS' GESTATION, LATE; MISSED DELIVERY||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||COOP^MINDI|(888)555-1241||||||||| IN1||16^GHI-MULTIPLAN NJ (PPO) (IN-NETWORK CLAIMS)|16^GHI-MULTIPLAN NJ (PPO) (IN-NETWORK CLAIMS)|GHI-MULTIPLAN NJ (PPO) (IN-NETWORK CLAIMS)|PO BOX 2832^^NEW YORK^NY^10116-2832|^|(212)501-4444|||||20010901||||MOLYNEUX^AZALEE^|Spouse|19640425||||1||||||||||||||123456789|||||||M|||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19375|T|2.2|||||||| EVN|A31|200401300419|||| PID||238001|238001||HEIGHT^OK^||19701127|F|||8762 STONERIDGE CT^^CLARKSVILLE^NY^12041||(555)473-9678|(888)555-6579|||||031488026||||||||||| PV1|||^^^MAIN ST (HUB)||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9|6264|IRREGULAR MENSTRUAL CYCLE IRREGULAR: BLEEDING NOS, MENSTRUATION, PERIODS||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||BUCHOLTZ^MARCELLE|(888)555-1241||||||||| IN1||16^GHI-MULTIPLAN NJ (PPO) (IN-NETWORK CLAIMS)|16^GHI-MULTIPLAN NJ (PPO) (IN-NETWORK CLAIMS)|GHI-MULTIPLAN NJ (PPO) (IN-NETWORK CLAIMS)|PO BOX 2832^^NEW YORK^NY^10116-2832|^|(212)501-4444|||||||||HEIGHT^OK^|Self|19701127||||1||||||||||||||123456789|||||||F|||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19377|T|2.2|||||||| EVN|A31|200401300419|||| PID||177601|177601||CHOWDHURY^CECILLE^||19781022|F|||8762 STONERIDGE CT^^NEW BRUNSWICK^NJ^08906||(555)455-4264|(888)555-0416|||||055388203||||||||||| PV1|||^^^||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9||no current diagnosis||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||BRITTAIN^ROSELIA|(888)555-1241||||||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19379|T|2.2|||||||| EVN|A31|200401300419|||| PID||289201|289201||CLOW^KARIMA^||19800622|F|||8762 STONERIDGE CT^^ACRA^NY^12405||(555)355-9874|(888)555-5777|||||416052979||||||||||| PV1|||^^^||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9||no current diagnosis||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||PRASAD^MIQUEL|(888)555-1241||||||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19381|T|2.2|||||||| EVN|A31|200401300419|||| PID||201301|201301||HARRIS^SHELLIE^||19770112|F|||8762 STONERIDGE CT^^ROCHESTER^NY^14600||(555)637-6792|(888)555-0839|||||029602155||||||||||| PV1|||^^^||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9||no current diagnosis||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||DAULTON^FREDERICA|(888)555-1241||||||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19383|T|2.2|||||||| EVN|A31|200401300419|||| PID||345801|345801||RIOJAS^KIRA^||19820704|F|||8762 STONERIDGE CT^^PARKSVILLE^NY^12768||(555)103-5720|(888)555-7795|||||914003189||||||||||| PV1|||^^^MAIN ST (HUB)||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9|V242|ROUTINE POSTPARTUM FOLLOW-UP||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||SALAZAR^SHIN|(888)555-1241||||||||| IN1||2994^AMERICHOICE-MHS NY (MEDICAID HMO)|2994^AMERICHOICE-MHS NY (MEDICAID HMO)|AMERICHOICE-MHS NY (MEDICAID HMO)|PO BOX 7720^^PHOENIX^AZ^85011-7720|^|(888)336-4845|1029||||20010801||||RIOJAS^KIRA^|Self|19820704||||1||||||||||||||123456789|||||||F|||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19385|T|2.2|||||||| EVN|A31|200401300419|||| PID||121501|121501||CLAIR^MOZELL^||19710616|F|||8762 STONERIDGE CT^^EATONTOWN^NJ^07724||(555)394-5903|(888)555-4496|||||108299461||||||||||| PV1|||^^^MAIN ST (HUB)||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9|V762|SCREENING FOR MALIGNANT NEOPLASMS OF THE CERVIX||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||MURO^ALEXANDER|(888)555-1241||||||||| IN1||3300^HEALTH NET OF NE|3300^HEALTH NET OF NE|HEALTH NET OF NE|C/O ACS^PO BOX 14700^LEXINGTON^KY^40512|^|(800)438-7886|||||||||CLAIR^MOZELL^|Self|19710616||||1||||||||||||||123456789|||||||F|||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19387|T|2.2|||||||| EVN|A31|200401300419|||| PID||271501|271501||HIATT^CLEOTILDE^||19300227|F|||8762 STONERIDGE CT^^ALBANY^NY^12235||(555)231-3007|(888)555-9504|||||735246090||||||||||| PV1|||^^^||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9||no current diagnosis||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||KEE^ERNESTO|(888)555-1241||||||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19389|T|2.2|||||||| EVN|A31|200401300419|||| PID||333701|333701||BIBBINS^KENDRA^||19810618|F|||8762 STONERIDGE CT^^BROOKLYN^NY^11218||(555)295-4050|(888)555-8330|||||291004332||||||||||| PV1|||^^^||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9||no current diagnosis||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||BRESHEARS^MILAGROS|(888)555-1241||||||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19391|T|2.2|||||||| EVN|A31|200401300419|||| PID||47701|47701||ACRES^LEILANI^||19631127|F|||8762 STONERIDGE CT^^NEW YORK^NY^10109||(555)526-8047|(888)555-4382|||||922590842||||||||||| PV1|||^^^||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9||no current diagnosis||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||KOTT^JENEVA|(888)555-1241||||||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19393|T|2.2|||||||| EVN|A31|200401300419|||| PID||35001|35001||TONER^SHAYLA^||19551002|F|||8762 STONERIDGE CT^^BROOKLYN^NY^11236||(555)908-2030|(888)555-1708|||||617025974||||||||||| PV1|||^^^MAIN ST (HUB)||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9|78930|ABDOMINAL OR PELVIC SWELLING, MASS OR LUMP, UNSPECIFIED SITE DIFFUSE OR GENERALIZED SWELLING OR MASS: ABDOMINAL NOS, UMBILICAL||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||HORNYAK^SHELA|(888)555-1241||||||||| IN1||3815^UNITED HEALTHCARE-EMPIRE NEW YORK GOVERNMENT EMPLOYEE|3815^UNITED HEALTHCARE-EMPIRE NEW YORK GOVERNMENT EMPLOYEE|UNITED HEALTHCARE-EMPIRE NEW YORK GOVERNMENT EMPLOYEE|PO BOX 1600^^KINGSTON^NY^12401-1600|^|(800)942-4640|||||||||TONER^SHAYLA^|Spouse|19551002||||1||||||||||||||123456789|||||||M|||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19395|T|2.2|||||||| EVN|A31|200401300419|||| PID||252001|252001||KOBER^TAMIE^||19791113|F|||8762 STONERIDGE CT^^CLIFTON PARK^NY^12065||(555)552-7900|(888)555-8898|||||064666036||||||||||| PV1|||^^^||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9||no current diagnosis||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||SHARON^KANDICE|(888)555-1241||||||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19397|T|2.2|||||||| EVN|A31|200401300419|||| PID||29201|29201||VOLPE^CARLI^||19530915|F|||8762 STONERIDGE CT^^OZONE PARK^NY^11416||(555)315-9426|(888)555-3380|||||510945478||||||||||| PV1|||^^^||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9||no current diagnosis||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||MONIER^WENONA|(888)555-1241||||||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19399|T|2.2|||||||| EVN|A31|200401300419|||| PID||273501|273501||STOLP^VERONA^||19790614|F|||8762 STONERIDGE CT^^PLEASANT VALLEY^NY^12569||(555)884-0947|(888)555-4259|||||334216481||||||||||| PV1|||^^^||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9||no current diagnosis||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||ANNIS^MAE|(888)555-1241||||||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19401|T|2.2|||||||| EVN|A31|200401300419|||| PID||72901|72901||GIBBON^VIVAN^||19730404|F|||8762 STONERIDGE CT^^FISHERS ISLAND^NY^06390||(555)295-1048|(888)555-9477|||||919766641||||||||||| PV1|||^^^MAIN ST (HUB)||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9|6264|IRREGULAR MENSTRUAL CYCLE IRREGULAR: BLEEDING NOS, MENSTRUATION, PERIODS||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||KOEHLER^CHRISTIANE|(888)555-1241||||||||| IN1||5300^OXFORD HEALTH PLAN FREEDOM|5300^OXFORD HEALTH PLAN FREEDOM|OXFORD HEALTH PLAN FREEDOM|PO BOX 7082^^BRIDGEPORT^CT^06601|^|(800)666-1353|||||19990315||||GIBBON^VIVAN^|Spouse|19730404||||1||||||||||||||123456789|||||||M|||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19403|T|2.2|||||||| EVN|A31|200401300419|||| PID||253201|253201||BEAUVAIS^ROZELLA^||19790420|F|||8762 STONERIDGE CT^^ALBANY^NY^12223||(555)572-8271|(888)555-1869|||||665342404||||||||||| PV1|||^^^||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9||no current diagnosis||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||RANDOLPH^JADA|(888)555-1241||||||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19405|T|2.2|||||||| EVN|A31|200401300419|||| PID||182501|182501||EOFF^TANIA^||19770406|F|||8762 STONERIDGE CT^^DOWNSVILLE^NY^13755||(555)675-5238|(888)555-2421|||||379557326||||||||||| PV1|||^^^||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9||no current diagnosis||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||GONYEA^CELESTA|(888)555-1241||||||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19407|T|2.2|||||||| EVN|A31|200401300419|||| PID||122901|122901||HEREFORD^MARGARETE^||19760910|F|||8762 STONERIDGE CT^^EAST ROCHESTER^NY^14445||(555)008-7036|(888)555-8944|||||885072548||||||||||| PV1|||^^^||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9||no current diagnosis||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||LINSEY^FELICE|(888)555-1241||||||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19409|T|2.2|||||||| EVN|A31|200401300419|||| PID||72801|72801||MELNICK^LATIA^||19720612|F|||8762 STONERIDGE CT^^CHICHESTER^NY^12416||(555)127-8729|(888)555-7280|||||249668882||||||||||| PV1|||^^^||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9||no current diagnosis||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||FASON^ERLINE|(888)555-1241||||||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19411|T|2.2|||||||| EVN|A31|200401300419|||| PID||134101|134101||LOSOYA^JETTIE^||19740402|F|||8762 STONERIDGE CT^^BAKERS MILLS^NY^12811||(555)298-9615|(888)555-7922|||||054838711||||||||||| PV1|||^^^||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9||no current diagnosis||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||CUEVAS^MIRA|(888)555-1241||||||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19413|T|2.2|||||||| EVN|A31|200401300419|||| PID||149201|149201||NATALE^FREDERICA^||19770601|F|||8762 STONERIDGE CT^^MOUNT VERNON^NY^10551||(555)065-4401|(888)555-0665|||||131234147||||||||||| PV1|||^^^||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9||no current diagnosis||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||NEY^DESIRAE|(888)555-1241||||||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19415|T|2.2|||||||| EVN|A31|200401300419|||| PID||330301|330301||SPRADLEY^ARIE^||19810305|F|||8762 STONERIDGE CT^^SUNNYSIDE^NY^11104||(555)633-1168|(888)555-0854|||||194217346||||||||||| PV1|||^^^||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9||no current diagnosis||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||BOYSEN^SELENE|(888)555-1241||||||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19417|T|2.2|||||||| EVN|A31|200401300419|||| PID||22401|22401||BECKLEY^AMY^||19570414|F|||8762 STONERIDGE CT^^NEW HYDE PARK^NY^11044||(555)002-5644|(888)555-7728|||||593457851||||||||||| PV1|||^^^MAIN ST (HUB)||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9|6264|IRREGULAR MENSTRUAL CYCLE IRREGULAR: BLEEDING NOS, MENSTRUATION, PERIODS||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||JETT^TISHA|(888)555-1241||||||||| IN1||2994^AMERICHOICE-MHS NY (MEDICAID HMO)|2994^AMERICHOICE-MHS NY (MEDICAID HMO)|AMERICHOICE-MHS NY (MEDICAID HMO)|PO BOX 7720^^PHOENIX^AZ^85011-7720|^|(888)336-4845|||||||||BECKLEY^AMY^|Self|19570414||||1||||||||||||||123456789|||||||F|||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19419|T|2.2|||||||| EVN|A31|200401300419|||| PID||2401|2401||STEPHENS^PATRICA^||19730127|F|||8762 STONERIDGE CT^^CAMBRIA HEIGHTS^NY^11411||(555)434-2886|(888)555-7376|||||867402038||||||||||| PV1|||^^^||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9||no current diagnosis||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||GIRARDI^BLAKE|(888)555-1241||||||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19421|T|2.2|||||||| EVN|A31|200401300419|||| PID||156901|156901||SEYMORE^JANITA^||19761001|F|||8762 STONERIDGE CT^^BROOKLYN^NY^11225||(555)713-1055|(888)555-4809|||||374239112||||||||||| PV1|||^^^||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9||no current diagnosis||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||HADLEY^QUINCY|(888)555-1241||||||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19423|T|2.2|||||||| EVN|A31|200401300419|||| PID||52801|52801||UPSHAW^MAYE^||19701009|F|||8762 STONERIDGE CT^^COMSTOCK^NY^12821||(555)425-2460|(888)555-0564|||||280835487||||||||||| PV1|||^^^MAIN ST (HUB)||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9|V780|SCREENING FOR IRON DEFICIENCY ANEMIA||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||CRUTCHER^SHERLYN|(888)555-1241||||||||| IN1||2994^AMERICHOICE-MHS NY (MEDICAID HMO)|2994^AMERICHOICE-MHS NY (MEDICAID HMO)|AMERICHOICE-MHS NY (MEDICAID HMO)|PO BOX 7720^^PHOENIX^AZ^85011-7720|^|(888)336-4845|1029||||||||UPSHAW^MAYE^|Self|19701009||||1||||||||||||||123456789|||||||F|||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19425|T|2.2|||||||| EVN|A31|200401300419|||| PID||49601|49601||RIEHLE^PATTIE^||19731115|F|||8762 STONERIDGE CT^^LE ROY^NY^14482||(555)807-2969|(888)555-5290|||||977956080||||||||||| PV1|||^^^MAIN ST (HUB)||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9|V762|SCREENING FOR MALIGNANT NEOPLASMS OF THE CERVIX||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||RAKESTRAW^HEIDY|(888)555-1241||||||||| IN1||2994^AMERICHOICE-MHS NY (MEDICAID HMO)|2994^AMERICHOICE-MHS NY (MEDICAID HMO)|AMERICHOICE-MHS NY (MEDICAID HMO)|PO BOX 7720^^PHOENIX^AZ^85011-7720|^|(888)336-4845|||||||||RIEHLE^PATTIE^|Self|19731115||||1||||||||||||||123456789|||||||F|||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19427|T|2.2|||||||| EVN|A31|200401300419|||| PID||35201|35201||HAYDEN^SEASON^||19670918|F|||8762 STONERIDGE CT^^KIAMESHA LAKE^NY^12751||(555)199-8578|(888)555-6945|||||424788613||||||||||| PV1|||^^^MAIN ST (HUB)||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9|V2509|OTHER GENERAL COUNSELING AND ADVICE ON CONTRACEPTIVE MANAGEMENT||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||GUMP^MADELENE|(888)555-1241||||||||| IN1||11425^AMERICHOICE-MHS NY (MEDICAID HMO)|11425^AMERICHOICE-MHS NY (MEDICAID HMO)|AMERICHOICE-MHS NY (MEDICAID HMO)|PO BOX 7720^^PHOENIX^AZ^85011-7720|^|888-336-4845|||||||||HAYDEN^SEASON^|Self|19670918||||1||||||||||||||123456789|||||||F|||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19429|T|2.2|||||||| EVN|A31|200401300419|||| PID||117101|117101||BERES^JOSETTE^||19480324|F|||8762 STONERIDGE CT^^CHENANGO FORKS^NY^13746||(555)834-2071|(888)555-2791|||||509387868||||||||||| PV1|||^^^||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9||no current diagnosis||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||HOOPS^LUCRECIA|(888)555-1241||||||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19431|T|2.2|||||||| EVN|A31|200401300419|||| PID||209301|209301||WAXMAN^GIDGET^||19780411|F|||8762 STONERIDGE CT^^BARKER^NY^14012||(555)253-8356|(888)555-7362|||||552536871||||||||||| PV1|||^^^||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9||no current diagnosis||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||NORTHRUP^CHARLYN|(888)555-1241||||||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19433|T|2.2|||||||| EVN|A31|200401300419|||| PID||279101|279101||KINYON^KAM^||19810411|F|||8762 STONERIDGE CT^^NEW YORK^NY^10008||(555)211-8235|(888)555-7182|||||507998014||||||||||| PV1|||^^^||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9||no current diagnosis||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||LEYBA^ARMAND|(888)555-1241||||||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19435|T|2.2|||||||| EVN|A31|200401300419|||| PID||223001|223001||JUAREZ^JEANELLE^||19781008|F|||8762 STONERIDGE CT^^IRVINGTON^NY^10533||(555)331-9858|(888)555-5521|||||106620957||||||||||| PV1|||^^^||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9||no current diagnosis||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||OSORIO^GARNET|(888)555-1241||||||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19437|T|2.2|||||||| EVN|A31|200401300419|||| PID||275301|275301||BIEKER^KRISTLE^||19570317|F|||8762 STONERIDGE CT^^RYE^NY^10581||(555)221-7145|(888)555-3995|||||516711446||||||||||| PV1|||^^^||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9||no current diagnosis||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||MIDKIFF^VINITA|(888)555-1241||||||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19439|T|2.2|||||||| EVN|A31|200401300419|||| PID||2901|2901||SILBERMAN^RACQUEL^||19610413|F|||8762 STONERIDGE CT^^NEW YORK^NY^10011||(555)067-2368|(888)555-4796|||||336715507||||||||||| PV1|||^^^MAIN ST (HUB)||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9|64000|THREATENED ABORTION, UNSPECIFIED AS TO EPISODE OF CARE||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||WHITTY^MALLORY|(888)555-1241||||||||| IN1||2994^AMERICHOICE-MHS NY (MEDICAID HMO)|2994^AMERICHOICE-MHS NY (MEDICAID HMO)|AMERICHOICE-MHS NY (MEDICAID HMO)|PO BOX 7720^^PHOENIX^AZ^85011-7720|^|(888)336-4845|||||||||SILBERMAN^RACQUEL^|Self|19610413||||1||||||||||||||123456789|||||||F|||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19441|T|2.2|||||||| EVN|A31|200401300419|||| PID||312501|312501||HARPSTER^SHAYLA^||19821112|F|||8762 STONERIDGE CT^^INDUSTRY^NY^14474||(555)750-7958|(888)555-8269|||||347909551||||||||||| PV1|||^^^||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9||no current diagnosis||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||LAURY^JINNY|(888)555-1241||||||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19443|T|2.2|||||||| EVN|A31|200401300419|||| PID||40101|40101||PAULEY^LORETTA^||19720703|F|||8762 STONERIDGE CT^^MC GRAW^NY^13101||(555)085-4163|(888)555-2347|||||433665030||||||||||| PV1|||^^^||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9||no current diagnosis||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||BERRIER^LAKEISHA|(888)555-1241||||||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19445|T|2.2|||||||| EVN|A31|200401300419|||| PID||255501|255501||MCCARRON^JACKELINE^||19790620|F|||8762 STONERIDGE CT^^BROOKLYN^NY^11206||(555)492-7372|(888)555-1807|||||987536975||||||||||| PV1|||^^^||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9||no current diagnosis||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||GARNICA^JANAE|(888)555-1241||||||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19447|T|2.2|||||||| EVN|A31|200401300419|||| PID||80201|80201||CARBIN^MAISHA^||19580704|F|||8762 STONERIDGE CT^^GARNERVILLE^NY^10923||(555)030-7324|(888)555-9008|||||472934878||||||||||| PV1|||^^^MAIN ST (HUB)||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9|V242|ROUTINE POSTPARTUM FOLLOW-UP||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||MARCUM^BERNITA|(888)555-1241||||||||| IN1||2994^AMERICHOICE-MHS NY (MEDICAID HMO)|2994^AMERICHOICE-MHS NY (MEDICAID HMO)|AMERICHOICE-MHS NY (MEDICAID HMO)|PO BOX 7720^^PHOENIX^AZ^85011-7720|^|(888)336-4845|1029||||||||CARBIN^MAISHA^|Self|19580704||||1||||||||||||||123456789|||||||F|||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19449|T|2.2|||||||| EVN|A31|200401300419|||| PID||158201|158201||NAPIER^JAQUELINE^||19770609|F|||8762 STONERIDGE CT^^HILLSDALE^NY^12529||(555)279-3166|(888)555-2974|||||662460266||||||||||| PV1|||^^^||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9||no current diagnosis||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||PUTT^TAMIKO|(888)555-1241||||||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19451|T|2.2|||||||| EVN|A31|200401300419|||| PID||187601|187601||GERBER^GENIE^||19771007|F|||8762 STONERIDGE CT^^MOHEGAN LAKE^NY^10547||(555)815-7342|(888)555-3720|||||061177876||||||||||| PV1|||^^^||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9||no current diagnosis||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||ALAMEDA^ED|(888)555-1241||||||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19453|T|2.2|||||||| EVN|A31|200401300419|||| PID||288901|288901||FARROW^AILENE^||19790421|F|||8762 STONERIDGE CT^^NEW YORK^NY^10154||(555)088-7086|(888)555-3688|||||134554858||||||||||| PV1|||^^^||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9||no current diagnosis||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||KWON^CORALEE|(888)555-1241||||||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19455|T|2.2|||||||| EVN|A31|200401300419|||| PID||302001|302001||FORTENBERRY^CARMA^ERWIN||19770917|F|||8762 STONERIDGE CT^^STONY BROOK^NY^11794||(555)347-5058|(888)555-0760|||||730667708||||||||||| PV1|||^^^MAIN ST (HUB)||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9|650|NORMAL DELIVERY DELIVERY REQUIRING MINIMAL OR NO ASSISTANCE, WITH OR WITHOUT EPISIOTOMY, WITHOUT FETAL MINIPULATION [E.G.,ROTATION VERSION] OR INSTRUMENTATION [FORCEPS] OF SPONTANEOUS, CEPHALIC, VA||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||SHAH^TAINA|(888)555-1241||||||||| IN1||5300^OXFORD HEALTH PLAN FREEDOM|5300^OXFORD HEALTH PLAN FREEDOM|OXFORD HEALTH PLAN FREEDOM|PO BOX 7082^^BRIDGEPORT^CT^06601|^|(800)666-1353|||||19991001||||FORTENBERRY^CARMA^ERWIN|Self|19770917||||1||||||||||||||123456789|||||||F|||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19457|T|2.2|||||||| EVN|A31|200401300419|||| PID||237701|237701||SMITH^SEPTEMBER^||19480511|F|||8762 STONERIDGE CT^^MOUNT VISION^NY^13810||(555)472-4835|(888)555-9862|||||029305516||||||||||| PV1|||^^^MAIN ST (HUB)||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9|631|OTHER ABNORMAL PRODUCT OF CONCEPTION BLIGHTED OVUM; MOLE: NOS, CARNEOUS, FLESHY, STONE||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||TOLIVER^JAZMIN|(888)555-1241||||||||| IN1||2545^OXFORD HEALTH PLAN|2545^OXFORD HEALTH PLAN|OXFORD HEALTH PLAN|PO BOX 7082^^BRIDGEPORT^CT^06601|^|(800)666-1353|||||20020607||||SMITH^SEPTEMBER^|Self|19480511||||1||||||||||||||123456789|||||||F|||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19459|T|2.2|||||||| EVN|A31|200401300419|||| PID||30101|30101||BORLAND^NAKESHA^||19571022|F|||8762 STONERIDGE CT^^REMSEN^NY^13438||(555)358-4010|(888)555-3776|||||982302341||||||||||| PV1|||^^^||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9||no current diagnosis||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||HIXON^FELISA|(888)555-1241||||||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19461|T|2.2|||||||| EVN|A31|200401300419|||| PID||125301|125301||PRINTZ^CYNDI^||19770613|F|||8762 STONERIDGE CT^^HIGHLAND MILLS^NY^10930||(555)765-7260|(888)555-5313|||||231539250||||||||||| PV1|||^^^||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9||no current diagnosis||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||DEWITT^HARRIETT|(888)555-1241||||||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19463|T|2.2|||||||| EVN|A31|200401300419|||| PID||88101|88101||BRESNAHAN^AKILAH^||19701002|F|||8762 STONERIDGE CT^^ALLEGANY^NY^14706||(555)338-0715|(888)555-6391|||||370873935||||||||||| PV1|||^^^||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9||no current diagnosis||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||OXFORD^EULALIA|(888)555-1241||||||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19465|T|2.2|||||||| EVN|A31|200401300419|||| PID||320001|320001||BIRD^ALVIN^||19580821|M|||8762 STONERIDGE CT^^TULLY^NY^13159||(555)959-0544|(888)555-2639|||||003069783||||||||||| PV1|||^^^||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9||no current diagnosis||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||BAPTIST^SKYE|(888)555-1241||||||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19467|T|2.2|||||||| EVN|A31|200401300419|||| PID||305501|305501||SPELLMAN^TESS^||19580102|F|||8762 STONERIDGE CT^^TICONDEROGA^NY^12883||(555)759-7767|(888)555-4897|||||868555371||||||||||| PV1|||^^^||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9||no current diagnosis||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||RAFFERTY^BELIA|(888)555-1241||||||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19469|T|2.2|||||||| EVN|A31|200401300419|||| PID||89101|89101||PORCHE^LATONIA^||19681015|F|||8762 STONERIDGE CT^^HORTONVILLE^NY^12745||(555)299-9155|(888)555-4134|||||729449023||||||||||| PV1|||^^^MAIN ST (HUB)||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9|V242|ROUTINE POSTPARTUM FOLLOW-UP||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||TALLY^ALLIE|(888)555-1241||||||||| IN1||10887^HEALTH INSURANCE PLAN OF GREATER NY (HIP)|10887^HEALTH INSURANCE PLAN OF GREATER NY (HIP)|HEALTH INSURANCE PLAN OF GREATER NY (HIP)|PO BOX 2845^^NEW YORK^NY^10116|^|(800)447-8255|||||20020201||||PORCHE^LATONIA^|Self|19681015||||1||||||||||||||123456789|||||||F|||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19471|T|2.2|||||||| EVN|A31|200401300419|||| PID||117201|117201||GOODNIGHT^JACINDA^||19740521|F|||8762 STONERIDGE CT^^SCHUYLERVILLE^NY^12871||(555)323-2326|(888)555-4078|||||922442797||||||||||| PV1|||^^^||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9||no current diagnosis||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||HOUGHTALING^DOMINIQUE|(888)555-1241||||||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19473|T|2.2|||||||| EVN|A31|200401300419|||| PID||267601|267601||THAI^KETURAH^||19801109|F|||8762 STONERIDGE CT^^NEW LEBANON^NY^12125||(555)793-1620|(888)555-9718|||||069871797||||||||||| PV1|||^^^||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9||no current diagnosis||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||WIGGINS^MEGAN|(888)555-1241||||||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19475|T|2.2|||||||| EVN|A31|200401300419|||| PID||37501|37501||WYRICK^PHEBE^||19670709|F|||8762 STONERIDGE CT^^CROMPOND^NY^10517||(555)746-6866|(888)555-4408|||||326400528||||||||||| PV1|||^^^||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9||no current diagnosis||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||HATLEY^FRANCINE|(888)555-1241||||||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19477|T|2.2|||||||| EVN|A31|200401300419|||| PID||316001|316001||SNAPP^BERTA^||19800601|F|||8762 STONERIDGE CT^^ROSLYN HEIGHTS^NY^11577||(555)302-5069|(888)555-7382|||||648022224||||||||||| PV1|||^^^||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9||no current diagnosis||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||CAUSEY^SILVA|(888)555-1241||||||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19479|T|2.2|||||||| EVN|A31|200401300419|||| PID||286201|286201||MCCORD^RENNA^||19630508|F|||8762 STONERIDGE CT^^ALBANY^NY^12207||(555)327-6185|(888)555-2460|||||703104231||||||||||| PV1|||^^^||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9||no current diagnosis||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||BONNETT^WALLY|(888)555-1241||||||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19481|T|2.2|||||||| EVN|A31|200401300419|||| PID||182801|182801||RADKE^ALEJANDRA^||19761007|F|||8762 STONERIDGE CT^^EAST MORICHES^NY^11940||(555)728-9048|(888)555-0411|||||154413718||||||||||| PV1|||^^^MAIN ST (HUB)||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9|6264|IRREGULAR MENSTRUAL CYCLE IRREGULAR: BLEEDING NOS, MENSTRUATION, PERIODS||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||CIPRIANO^ANNABELLE|(888)555-1241||||||||| IN1||2994^AMERICHOICE-MHS NY (MEDICAID HMO)|2994^AMERICHOICE-MHS NY (MEDICAID HMO)|AMERICHOICE-MHS NY (MEDICAID HMO)|PO BOX 7720^^PHOENIX^AZ^85011-7720|^|(888)336-4845|||||||||RADKE^ALEJANDRA^|Self|19761007||||1||||||||||||||123456789|||||||F|||||| MSH|^~\&|ATHENANET|49^TESTPRACTICE|ATHENA||200401300539||ADT^A31|19483|T|2.2|||||||| EVN|A31|200401300419|||| PID||326701|326701||MCELLIGOTT^GLENNA^||19810218|F|||8762 STONERIDGE CT^^CROTON ON HUDSON^NY^10521||(555)826-3387|(888)555-7795|||||997726995||||||||||| PV1|||^^^||||^||||||||||^||||||||||||||||||||||||||||||||||| DG1||ICD9||no current diagnosis||||||||||||||| GT1|||^^||8762 STONERIDGE CT^^^^||||||||||||||||||||||||||||||||||||||||COTTEN^THAD|(888)555-1241||||||||| -------------------------------------------------------------------------------- /test/fixtures/pcc_adt_A03.hl7: -------------------------------------------------------------------------------- 1 | MSH|^~\&|SNDAPPL|snd_fac|RECAPPL|rec_fac|20070208165451.447- 0500||ADT^A03|110A35A09B785|P|2.5 EVN|A03|200702080406|||PointClickCare|200702080406 PID|1||99269^^^^FI~123321^^^^PI||Berk^Ailsa||19400503|F|||579 5 PointClickCare Street^^Lakeview^OH^90210||^PRN^PH^^^^^^^^^(937) 8432794|||||04254|275-32-9550 PV1|1|N|100^104^A^ABC2PREV0021^^N^100^1||||G45670 ^Haenel^Mary- Ann|||||||||||0||||||||||||||||||||||||||20070207 0403-0500|200702080406-0500 ZEV|2001|200702080406|PointClickCare -------------------------------------------------------------------------------- /test/fixtures/pv1_variant.js: -------------------------------------------------------------------------------- 1 | exports.name = 'PV1' 2 | 3 | exports.fields = [ 4 | 'SegmentType' 5 | , 'SetIDFORPV1' 6 | , 'AssignedPatientLocation' 7 | , 'AdmissionType' 8 | , 'PreadmitNumber' 9 | , 'PriorPatientLocation' 10 | , 'AttendingDoctor' 11 | , 'ReferringDoctor' 12 | , 'ConsultingDoctor' 13 | , 'HospitalService' 14 | , 'TemporaryLocation' 15 | , 'PreadmitTestIndicator' 16 | , 'ReadmissionIndicator' 17 | , 'AdmitSource' 18 | , 'AmbulatoryStatus' 19 | , 'VIPIndicator' 20 | , 'AdmittingDoctor' 21 | , 'PatientType' 22 | , 'VisitNumber' 23 | , 'FinancialClass' 24 | , 'ChargePriceIndicator' 25 | , 'CourtesyCode' 26 | , 'CreditRating' 27 | , 'ContractCode' 28 | , 'ContractEffectiveDate' 29 | , 'ContractAmount' 30 | , 'ContactPeriod' 31 | , 'InterestCode' 32 | , 'TransferToBadDebtCode' 33 | , 'TransferToBadDebtDate' 34 | , 'BadDebtAgencyCode' 35 | , 'BadDebtTransferAmount' 36 | , 'BadDebtRecoveryAmount' 37 | , 'DeleteAccountIndicator' 38 | , 'DeleteAccountDate' 39 | , 'DischargeDisposition' 40 | , 'DischargedToLocation' 41 | , 'DietType' 42 | , 'ServicingFacility' 43 | , 'BedStatus' 44 | , 'AccountStatus' 45 | , 'PendingLocation' 46 | , 'PriorTemporaryLocation' 47 | , 'AdmitDateTime' 48 | , 'DischargeDateTime' 49 | , 'CurrentPatientBalance' 50 | , 'TotalCharges' 51 | , 'TotalAdjustments' 52 | , 'TotalPayments' 53 | , 'AlternateVisitID' 54 | , 'VisitIndicator' 55 | , 'OtherHealthcareProvider' 56 | ] 57 | 58 | -------------------------------------------------------------------------------- /test/fixtures/test.hl7: -------------------------------------------------------------------------------- 1 | MSH|^~\&|EPIC|EPICADT|SMS|SMSADT|199912271408|CHARRIS|ADT^A04|1817457|D|2.5| PID||0493575^^^2^ID 1|454721||DOE^JOHN^^^^|DOE^JOHN^^^^|19480203|M||B|254 MYSTREET AVE^^MYTOWN^OH^44123^USA||(216)123-4567|||M|NON|400003403~1129086| NK1||ROE^MARIE^^^^|SPO||(216)123-4567||EC||||||||||||||||||||||||||| PV1||O|168 ~219~C~PMA^^^^^^^^^||||277^ALLEN MYLASTNAME^BONNIE^^^^|||||||||| ||2688684|||||||||||||||||||||||||199912271408||||||002376853 MSH|^~\&|EPIC|EPICADT|SMS|SMSADT|199912271408|CHARRIS|ADT^A04|1817457|D|2.5| PID||0493575^^^2^ID 1|454721||DOE^JOHN^^^^|DOE^JOHN^^^^|19480203|M||B|254 MYSTREET AVE^^MYTOWN^OH^44123^USA||(216)123-4567|||M|NON|400003403~1129086| NK1||ROE^MARIE^^^^|SPO||(216)123-4567||EC||||||||||||||||||||||||||| PV1||O|168 ~219~C~PMA^^^^^^^^^||||277^ALLEN MYLASTNAME^BONNIE^^^^|||||||||| ||2688684|||||||||||||||||||||||||199912271408||||||002376853 2 | -------------------------------------------------------------------------------- /test/fixtures/test2.hl7: -------------------------------------------------------------------------------- 1 | MSH|^~\&|EPIC|EPICADT|SMS|SMSADT|199912271408|CHARRIS|ADT^A04|1817457|D|2.5| PID||0493575^^^2^ID 1|454721||DOE^JOHN^^^^|DOE^JOHN^^^^|19480203|M||B|254 MYSTREET AVE^^MYTOWN^OH^44123^USA||(216)123-4567|||M|NON|400003403~1129086| NK1||ROE^MARIE^^^^|SPO||(216)123-4567||EC||||||||||||||||||||||||||| PV1||O|168 ~219~C~PMA^^^^^^^^^||||277^ALLEN MYLASTNAME^BONNIE^^^^|||||||||| ||2688684|||||||||||||||||||||||||199912271408||||||002376853 2 | -------------------------------------------------------------------------------- /test/fixtures/zev_variant.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | exports.name = 'ZEV' 4 | 5 | exports.fields = [ 6 | 'SegmentType' 7 | , 'EventTypeCode' 8 | , 'RecordedTimestamp' 9 | , 'OperatorID' 10 | ] 11 | 12 | -------------------------------------------------------------------------------- /test/message.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | var test = require('tap').test 4 | , Message = require('../').Message 5 | , Segment = require('../').Segment 6 | , fs = require('fs') 7 | , path = require('path') 8 | , Parser = require('../').Parser 9 | , split = require('split') 10 | 11 | test('message constructor', function(t) { 12 | t.plan(2) 13 | var m = new Message() 14 | t.type(m, Message) 15 | m = Message() 16 | t.type(m, Message) 17 | }) 18 | 19 | test('message header', function(t) { 20 | t.plan(2) 21 | var m = new Message() 22 | t.equal(m.getHeader(), null) 23 | var m = new Message([]) 24 | t.equal(m.getHeader(), null) 25 | }) 26 | 27 | test('arguments', function(t) { 28 | var d1 = 'MSH|^~\\&' 29 | var s1 = new Segment(d1) 30 | var d2 = 'OBR|||||||' 31 | var s2 = new Segment(d2) 32 | var m = new Message([s1, s2]) 33 | t.type(m, Message) 34 | t.equal(m.hasOwnProperty('segments'), true) 35 | for (var i = 0, len = m.segments.length; i < len; i++) { 36 | t.type(m.segments[i], Segment) 37 | } 38 | t.deepEqual(m.segmentTypes, ['MSH', 'OBR']) 39 | 40 | var d = 'MSH|^~\\&' 41 | var s = new Segment(d) 42 | var m = new Message(s) 43 | t.type(m, Message) 44 | t.end() 45 | }) 46 | 47 | test('segments', function(t) { 48 | t.plan(2) 49 | var m = new Message() 50 | t.equal(m.hasSegments(), false) 51 | var d = 'MSH|^~\\&' 52 | var s = new Segment(d) 53 | var m = new Message(s) 54 | t.equal(m.hasSegments(), true) 55 | }) 56 | 57 | test('delimiters', function(t) { 58 | t.plan(1) 59 | var m = new Message() 60 | t.deepEqual(m.delimiters(), { 61 | segment: '\r' 62 | , field: '|' 63 | , component: '^' 64 | , subcomponent: '&' 65 | , repetition: '~' 66 | , escape: '\\' 67 | }, 'default delimiters are correct') 68 | }) 69 | 70 | test('toString()', function(t) { 71 | t.plan(3) 72 | var parser = new Parser() 73 | var test = path.join(__dirname, 'fixtures', 'test2.hl7') 74 | var contents = fs.readFileSync(test, 'utf8') 75 | fs.createReadStream(test) 76 | .pipe(split(/\r/)) 77 | .pipe(parser) 78 | 79 | parser.on('error', t.fail) 80 | 81 | parser.on('message', function(msg) { 82 | t.type(msg, Message) 83 | var o = msg.toString() + '\n' 84 | t.equal(o, contents) 85 | }) 86 | 87 | parser.on('finish', function() { 88 | t.ok('got finish event') 89 | }) 90 | }) 91 | -------------------------------------------------------------------------------- /test/parser.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | var fs = require('fs') 4 | , Parser = require('../').Parser 5 | , path = require('path') 6 | , split = require('split') 7 | , Message = require('../').Message 8 | , Segment = require('../').Segment 9 | , test = require('tap').test 10 | 11 | test('constructor', function(t) { 12 | t.plan(2) 13 | var parser = new Parser() 14 | t.type(parser, Parser) 15 | 16 | parser = Parser() 17 | t.type(parser, Parser) 18 | }) 19 | 20 | test('parse from file', function(t) { 21 | t.plan(1) 22 | var parser = new Parser() 23 | var test = path.join(__dirname, 'fixtures', 'test.hl7') 24 | fs.createReadStream(test) 25 | .pipe(split(/\r/)) 26 | .pipe(parser) 27 | parser.on('finish', function() { 28 | t.ok('got finish event') 29 | }) 30 | }) 31 | 32 | test('parse file with multiple messages', function(t) { 33 | t.plan(101) 34 | var parser = new Parser() 35 | var test = path.join(__dirname, 'fixtures', 'out.hl7') 36 | fs.createReadStream(test) 37 | .pipe(split(/\r/)) 38 | .pipe(parser) 39 | parser.on('message', function(m) { 40 | t.ok('got message') 41 | }) 42 | parser.on('finish', function() { 43 | t.ok('got finish event') 44 | }) 45 | }) 46 | 47 | test('parse invalid file', function(t) { 48 | t.plan(2) 49 | var parser = new Parser() 50 | var test = path.join(__dirname, 'fixtures', 'invalid.hl7') 51 | fs.createReadStream(test) 52 | .pipe(split(/\r/)) 53 | .pipe(parser) 54 | 55 | parser.on('error', function(err) { 56 | t.ok('got error event') 57 | t.equal(err.message, 'Invalid segment type: thi') 58 | }) 59 | 60 | parser.on('finish', t.fail) 61 | }) 62 | 63 | test('multiple messages', function(t) { 64 | t.plan(5) 65 | var parser = new Parser() 66 | var test = path.join(__dirname, 'fixtures', 'test.hl7') 67 | fs.createReadStream(test) 68 | .pipe(split(/\r/)) 69 | .pipe(parser) 70 | 71 | parser.on('error', t.fail) 72 | 73 | parser.on('message', function(msg) { 74 | t.type(msg, Message) 75 | t.type(msg.getHeader(), Segment) 76 | }) 77 | 78 | parser.on('finish', function() { 79 | t.ok('got finish event') 80 | }) 81 | }) 82 | 83 | test('parse PointClickCare ADT message using ZEV variant', function(t) { 84 | t.plan(3) 85 | 86 | var variant = require('./fixtures/zev_variant') 87 | Segment.registerVariant(variant) 88 | 89 | var parser = new Parser() 90 | var test = path.join(__dirname, 'fixtures', 'pcc_adt_A03.hl7') 91 | fs.createReadStream(test) 92 | .pipe(split(/\r/)) 93 | .pipe(parser) 94 | parser.on('error', t.fail) 95 | 96 | parser.on('message', function(msg) { 97 | t.type(msg, Message) 98 | t.deepEqual(msg.segmentTypes, ['MSH', 'EVN', 'PID', 'PV1', 'ZEV']) 99 | }) 100 | 101 | parser.on('finish', function() { 102 | t.ok('got finish event') 103 | }) 104 | }) 105 | -------------------------------------------------------------------------------- /test/segment.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | var test = require('tap').test 4 | , fs = require('fs') 5 | , path = require('path') 6 | , Segment = require('../').Segment 7 | 8 | test('constructor', function(t) { 9 | t.plan(2) 10 | var s = new Segment() 11 | t.type(s, Segment) 12 | 13 | s = Segment() 14 | t.type(s, Segment) 15 | }) 16 | 17 | test('segmentType', function(t) { 18 | t.plan(1) 19 | var s = new Segment() 20 | t.equal(s.segmentType(), null) 21 | }) 22 | 23 | test('headers', function(t) { 24 | t.plan(2) 25 | var d = 'MSH|^~\\&' 26 | var s = new Segment(d) 27 | t.equal(s.isHeader(), true) 28 | d = 'ORC|fadfasdf|' 29 | s = new Segment(d) 30 | t.equal(s.isHeader(), false) 31 | }) 32 | 33 | test('types', function(t) { 34 | var s = new Segment() 35 | var keys = Object.keys(s.types) 36 | for (var i = 0, len = keys.length; i < len; i++) { 37 | var key = keys[i] 38 | t.notEqual(s.types[key].indexOf('SegmentType'), -1) 39 | } 40 | t.end() 41 | }) 42 | 43 | test('registering variant', function(t) { 44 | t.plan(2) 45 | var variant = require('./fixtures/pv1_variant') 46 | Segment.registerVariant(variant) 47 | var s = new Segment() 48 | var types = s.types 49 | t.ok(types.hasOwnProperty(variant.name)) 50 | t.equal(types[variant.name][1], 'SetIDFORPV1') 51 | }) 52 | 53 | test('invalid variants', function(t) { 54 | t.plan(3) 55 | t.throws(function() { 56 | Segment.registerVariant() 57 | }, /Variant must be an object/) 58 | 59 | t.throws(function() { 60 | Segment.registerVariant({}) 61 | }, /Variant must have a name/) 62 | 63 | t.throws(function() { 64 | Segment.registerVariant({ name: 'Test' }) 65 | }, /Variant must have fields/) 66 | }) 67 | 68 | test('toArray()', function(t) { 69 | var p = path.join(__dirname, 'fixtures', 'test.hl7') 70 | var f = fs.readFileSync(p, 'utf8') 71 | var lines = f.split('\r') 72 | 73 | // MSH 74 | var mshdata = lines[0] 75 | var seg = new Segment(mshdata) 76 | t.equal(seg.parsed.SegmentType, 'MSH') 77 | var out = seg.toArray() 78 | var fields = seg.types[seg.segmentType()] 79 | var len = fields.length 80 | for (var i = 0; i < len; i++) { 81 | t.equal(seg.parsed[fields[i]], out[i]) 82 | } 83 | 84 | // PID 85 | var mshdata = lines[1] 86 | var seg = new Segment(mshdata) 87 | t.equal(seg.parsed.SegmentType, 'PID') 88 | var out = seg.toArray() 89 | var fields = seg.types[seg.segmentType()] 90 | var len = fields.length 91 | for (var i = 0; i < len; i++) { 92 | t.equal(seg.parsed[fields[i]], out[i]) 93 | } 94 | 95 | // NK1 96 | var mshdata = lines[2] 97 | var seg = new Segment(mshdata) 98 | t.equal(seg.parsed.SegmentType, 'NK1') 99 | var out = seg.toArray() 100 | var fields = seg.types[seg.segmentType()] 101 | var len = fields.length 102 | for (var i = 0; i < len; i++) { 103 | t.equal(seg.parsed[fields[i]], out[i]) 104 | } 105 | 106 | // PV1 107 | var mshdata = lines[3] 108 | var seg = new Segment(mshdata) 109 | t.equal(seg.parsed.SegmentType, 'PV1') 110 | var out = seg.toArray() 111 | var fields = seg.types[seg.segmentType()] 112 | var len = fields.length 113 | for (var i = 0; i < len; i++) { 114 | t.equal(seg.parsed[fields[i]], out[i]) 115 | } 116 | 117 | t.end() 118 | }) 119 | 120 | test('toString()', function(t) { 121 | t.plan(2) 122 | var p = path.join(__dirname, 'fixtures', 'test.hl7') 123 | var f = fs.readFileSync(p, 'utf8') 124 | var lines = f.split('\r') 125 | var mshdata = lines[0] 126 | var seg = new Segment(mshdata) 127 | t.equal(seg.parsed.SegmentType, 'MSH') 128 | var out = seg.toString() 129 | t.equal(out, mshdata) 130 | }) 131 | -------------------------------------------------------------------------------- /test/streams.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | var test = require('tap').test 4 | , Parser = require('../').Parser 5 | , path = require('path') 6 | , fs = require('fs') 7 | 8 | test('emit 1 msg if 1 is written to parser', function(t) { 9 | var p = new Parser() 10 | 11 | p.on('message', function(msg) { 12 | var segs = msg.segmentTypes 13 | t.deepEqual(segs, ['MSH', 'PID', 'NK1', 'PV1']) 14 | t.end() 15 | }) 16 | 17 | var test = path.join(__dirname, 'fixtures', 'test.hl7') 18 | var contents = fs.readFileSync(test, 'utf8').split('\r') 19 | for (var i = 0, len = contents.length; i < len; i++) { 20 | p.write(contents[i]) 21 | } 22 | }) 23 | 24 | test('emit 2 msgs if 2 are written to parser', function(t) { 25 | t.plan(4) 26 | var test = path.join(__dirname, 'fixtures', 'test.hl7') 27 | var test2 = path.join(__dirname, 'fixtures', 'test2.hl7') 28 | 29 | var contents = fs.readFileSync(test, 'utf8').split('\r') 30 | var contents2 = fs.readFileSync(test2, 'utf8').split('\r') 31 | 32 | contents = contents.concat(contents2) 33 | 34 | var p = new Parser() 35 | p.on('message', function(msg) { 36 | t.ok('got message event') 37 | var segs = msg.segmentTypes 38 | t.deepEqual(segs, ['MSH', 'PID', 'NK1', 'PV1']) 39 | }) 40 | 41 | for (var i = 0, len = contents.length; i < len; i++) { 42 | p.write(contents[i]) 43 | } 44 | }) 45 | -------------------------------------------------------------------------------- /test/utils.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | var test = require('tap').test 4 | , utils = require('../').utils 5 | , Segment = require('../').Segment 6 | 7 | test('segmentIsHeader', function(t) { 8 | t.plan(3) 9 | var d = 'MSH|^~\\&|||||||||||' 10 | var s = new Segment(d) 11 | t.equal(true, utils.segmentIsHeader(s), 'segment is header') 12 | d = 'ORC|fadfasdf|' 13 | s = new Segment(d) 14 | t.equal(false, utils.segmentIsHeader(s), 'segment is not header') 15 | t.equal(false, utils.segmentIsHeader('12345'), 'segment is not header') 16 | }) 17 | --------------------------------------------------------------------------------