{"id":18743277,"url":"https://github.com/rimiti/hl7-object-parser","last_synced_at":"2025-09-12T23:34:49.853Z","repository":{"id":57264544,"uuid":"94451717","full_name":"rimiti/hl7-object-parser","owner":"rimiti","description":":wrench: Convert hl7 messages to javascript object.","archived":false,"fork":false,"pushed_at":"2019-02-15T16:26:47.000Z","size":256,"stargazers_count":30,"open_issues_count":4,"forks_count":7,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-26T15:48:09.590Z","etag":null,"topics":["hl7","javascript","json","node","parser"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rimiti.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-06-15T15:12:17.000Z","updated_at":"2025-03-10T13:02:51.000Z","dependencies_parsed_at":"2022-08-25T02:52:12.949Z","dependency_job_id":null,"html_url":"https://github.com/rimiti/hl7-object-parser","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rimiti%2Fhl7-object-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rimiti%2Fhl7-object-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rimiti%2Fhl7-object-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rimiti%2Fhl7-object-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rimiti","download_url":"https://codeload.github.com/rimiti/hl7-object-parser/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248635959,"owners_count":21137342,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hl7","javascript","json","node","parser"],"created_at":"2024-11-07T16:10:52.949Z","updated_at":"2025-04-12T21:32:15.498Z","avatar_url":"https://github.com/rimiti.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hl7-object-parser\n\n[![Build Status](https://travis-ci.org/rimiti/hl7-object-parser.svg?branch=master)](https://travis-ci.org/rimiti/hl7-object-parser) [![codecov](https://codecov.io/gh/rimiti/hl7-object-parser/branch/master/graph/badge.svg)](https://codecov.io/gh/rimiti/hl7-object-parser)  [![Issue Count](https://codeclimate.com/github/rimiti/hl7-object-parser/badges/issue_count.svg)](https://codeclimate.com/github/rimiti/hl7-object-parser)  [![Dependency Status](https://david-dm.org/rimiti/hl7-object-parser/status.svg)](https://david-dm.org/rimiti/hl7-object-parser) [![NPM version](https://badge.fury.io/js/%40rimiti%2Fhl7-object-parser.svg)](https://badge.fury.io/js/%40rimiti%2Fhl7-object-parser)\n\n\nConvert your HL7 message to an object.\n\n# Install\n```\n$ yarn add @rimiti/hl7-object-parser\n```\n\n\n## HL7 parsed messages:\nAdt:\n```\n- A04 - Patient registration\n- A08 - Patient information update\n- A40 - Merge patient\n```\n\nSiu:\n```\n- S12 - Notification of new appointment booking\n- S13 - Notification of appointment rescheduling\n- S14 - Notification of appointment modification\n- S15 - Notification of appointment cancellation\n- S17 - Notification of appointment deletion\n- S26 - Notification that patient did not show up for scheduled appointment\n```\n\n\n## How to use it ?\n\nCreate your hl7 mapping file like that:\n\n```json\n// s12.json\n{\n  \"format\": \"hl7-2.4\",\n  \"adapter\": \"default\",\n  \"mapping\": {\n    \"msh\": {\n      \"values\": [\n        { \"field\": \"msh.message_datetime\", \"component\": [5,1] },\n        { \"field\": \"msh.message_type\", \"component\": [7,1] },\n        { \"field\": \"msh.message_type_ref\", \"component\": [7,2] },\n        { \"field\": \"msh.message_control_id\", \"component\": [8,1] },\n        { \"field\": \"msh.principal_language_of_message\", \"component\": [15,1] },\n        { \"field\": \"msh.character_set\", \"component\": [16,1] }\n      ]\n    },\n    \"pid\": {\n      \"values\": [\n        { \"field\": \"pid.id\", \"component\": [3,1] },\n        { \"field\": \"pid.origin\", \"component\": [3,4] },\n        { \"field\": \"pid.first_name\", \"component\": [5,2] },\n        { \"field\": \"pid.last_name\", \"component\": [5,1] },\n        { \"field\": \"pid.birthdate\", \"component\": [7,1] },\n        { \"field\": \"pid.gender\", \"component\": [8,1] },\n        { \"field\": \"pid.street_name\", \"component\": [11,1] },\n        { \"field\": \"pid.city\", \"component\": [11,3] },\n        { \"field\": \"pid.zip_code\", \"component\": [11,5] },\n        { \"field\": \"pid.phone\", \"component\": [13,1] },\n        { \"field\": \"pid.email\", \"component\": [13,4] }\n      ]\n    },\n    \"sch\": {\n      \"values\": [\n        { \"field\": \"sch.id\", \"component\": [2,1] },\n        { \"field\": \"sch.origin\", \"component\": [2,2] },\n        { \"field\": \"sch.length\", \"component\": [6,1] },\n        { \"field\": \"sch.minutes\", \"component\": [11,3] },\n        { \"field\": \"sch.datetime\", \"component\": [11,4] },\n        { \"field\": \"sch.datetime\", \"component\": [16,1] },\n        { \"field\": \"sch.last_name\", \"component\": [16,2] },\n        { \"field\": \"sch.first_name\", \"component\": [16,3] },\n        { \"field\": \"sch.source\", \"component\": [20,1] },\n        { \"field\": \"sch.status\", \"component\": [25,1] }\n      ]\n    },\n    \"rgs\": {\n      \"values\": [\n        { \"field\": \"rgs.id\", \"component\": [1,1] }\n      ]\n    },\n    \"aig\": {\n      \"values\": [\n        { \"field\": \"aig.id\", \"component\": [1,1] },\n        { \"field\": \"aig.rpps_finess\", \"component\": [4,1] }\n      ]\n    },\n    \"nte\": {\n      \"values\": [\n        { \"field\": \"nte.comment\", \"component\": [3,1] }\n      ]\n    }\n  }\n}\n\n```\n\nImport your parser and use it !\n\n- From CommonJS **require**:\n\n```js\nconst parser = require('@rimiti/hl7-object-parser')\nconst s12 = `MSH|^~\\\\\u0026|mllp_http_proxy|proxy00-prodaz|mllp_http_proxypartenaire|proxy00-prodpartenaire|20160923155836||SIU^S12|154779|P|2.5.1|||||FRA|UTF-8|\\rSCH||49849903800^DimSolution||||100|||||^^30^20161231110000|||||10101041431^KAYSSIEH^BASSEL||||ODS|||||Booked|\\rPID|||123456^^^ODS^^PI||DO BAIRRO^Dimitri^^^^^L||19920506|M|Nom usuel||Avenue des Champs-Élysées^^Paris^^75000^^^^^||0100000000^^^dimitri.dobairro@dimsolution.com^^^^~0200000000^^^^^^^|\\rRGS|1\\rAIG|1|||10101041431@750057689\\rNTE|||My comment`\nconst obj = parser.decode(s12, s12Mapping)\nconsole.log(obj)\n```\n\n- From Babel **import**:\n\n```js\nimport {decode} from '@rimiti/hl7-object-parser'\nimport s12Mapping from './s12.json'\n\nconst s12 = `MSH|^~\\\\\u0026|mllp_http_proxy|proxy00-prodaz|mllp_http_proxypartenaire|proxy00-prodpartenaire|20160923155836||SIU^S12|154779|P|2.5.1|||||FRA|UTF-8|\\rSCH||49849903800^DimSolution||||100|||||^^30^20161231110000|||||10101041431^KAYSSIEH^BASSEL||||ODS|||||Booked|\\rPID|||123456^^^ODS^^PI||DO BAIRRO^Dimitri^^^^^L||19920506|M|Nom usuel||Avenue des Champs-Élysées^^Paris^^75000^^^^^||0100000000^^^dimitri.dobairro@dimsolution.com^^^^~0200000000^^^^^^^|\\rRGS|1\\rAIG|1|||10101041431@750057689\\rNTE|||My comment`\nconst obj = decode(s12, s12Mapping)\nconsole.log(obj)\n```\n\nOutput:\n\n```js\n{ msh:\n   { message_datetime: '20160923155836',\n     message_type: 'SIU',\n     message_type_ref: 'S12',\n     message_control_id: '154779',\n     principal_language_of_message: 'FRA',\n     character_set: 'UTF-8' },\n  pid:\n   { id: '123456',\n     origin: 'ODS',\n     first_name: 'Dimitri',\n     last_name: 'DO BAIRRO',\n     birthdate: '19920506',\n     gender: 'M',\n     street_name: 'Avenue des Champs-Élysées',\n     city: 'Paris',\n     zip_code: '75000',\n     phone: [ '0100000000', '0200000000' ],\n     email: [ 'dimitri.dobairro@dimsolution.com', '' ] },\n  sch:\n   { id: '49849903800',\n     origin: 'DimSolution',\n     length: '100',\n     minutes: '30',\n     datetime: '10101041431',\n     last_name: 'KAYSSIEH',\n     first_name: 'BASSEL',\n     source: 'ODS',\n     status: 'Booked' },\n  rgs: { id: '1' },\n  aig: { id: '1', rpps_finess: '10101041431@750057689' },\n  nte: { comment: 'My comment' } }\n```\n\n## Tests\n```js\n// Run tests\nyarn test\n```\n\n## Related packages\nConvert your object into HL7 message. ([object-hl7-parser](https://github.com/rimiti/object-hl7-parser)).\n\n\n## License\nMIT © [Dimitri DO BAIRRO](https://dimsolution.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frimiti%2Fhl7-object-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frimiti%2Fhl7-object-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frimiti%2Fhl7-object-parser/lists"}