Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/davealdon/hl7-javascript-parsing
Making HL7 look pretty and more organized using jQuery and nothing else.
https://github.com/davealdon/hl7-javascript-parsing
hl7 hl7-parser hl7-parsing javascript jquery
Last synced: 4 days ago
JSON representation
Making HL7 look pretty and more organized using jQuery and nothing else.
- Host: GitHub
- URL: https://github.com/davealdon/hl7-javascript-parsing
- Owner: DaveAldon
- License: mit
- Created: 2018-05-07T13:18:33.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-02-18T16:40:40.000Z (almost 5 years ago)
- Last Synced: 2025-01-05T14:52:36.070Z (11 days ago)
- Topics: hl7, hl7-parser, hl7-parsing, javascript, jquery
- Language: JavaScript
- Homepage: https://davealdon.github.io/HL7-Javascript-Parsing/
- Size: 24.4 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# HL7-Javascript-Parsing
Making HL7 look pretty and more organized using jQuery and nothing else.## Instructions
Place the js file in your directory and link to it:
```HTML```
Then add your table somewhere and make sure it has an id:
```HTML```
Then once you have your raw HL7, pass the string and the element id you want the result placed inside to the function like this:
```javascript
var hl7 = "MSH|^~\&|SENDING_APPLICATION|SENDING_FACILITY|RECEIVING_APPLICATION|RECEIVING_FACILITY|20110613061611||SIU^S12|24916560|P|2.3||||||"parseHL7(hl7, '#content')
```And you'll have a table that breaks down your HL7 into something human readable.
## Limitations
Many common HL7 categories are supported, but some are not. They will be added as the need arises.## Development
You can do some cool things once the HL7 is parsed out. For example, the demo included in this repo demonstrates how to make the table collapsible according to each HL7 header by adding this to your javascript:
```Javascript
$('#content').on('click', 'tr.header', function (e) {
$(this).nextUntil('tr.header').css('display', function(i,v) {
return this.style.display === 'table-row' ? 'none' : 'table-row';
});
});
```You're responsible for the styling of the resulting table, and for the HL7 being properly formatted. HL7 is just a pattern, so if anything is off slightly it simply won't be predictable.