Giter Club home page Giter Club logo

hl7's Introduction

Build Status Coverage Status GoDoc

Overview

HL7v2 stands for "Health Level 7: Version 2" - a specification for shuttling clinical data around and between medical institutions. While working on Medtasker with Nimblic, I've written this library for reading the protocol and querying the messages it contains.

I have a blog post on my website if you'd like to hear a bit more of the story.

Install

$ go get github.com/nwehr/hl7

New Features

This fork adds the ability to Unpack() a Message or Segment into a struct using tags

package main

import (
	"fmt"
	"github.com/nwehr/hl7"
	"strings"
	"time"
)

var testMessage = strings.Replace(`MSH|^~\&||GA0000||VAERS PROCESSOR|20010331605||ORU^R01|20010422GA03|T|2.3.1|||AL|
PID|||1234^^^^SR~1234-12^^^^LR~00725^^^^MR||Doe^John^Fitzgerald^JR^^^L||20001007|M||2106-3^White^HL70005|||(678) 555-1212^^PRN|
NK1|1|Jones^Jane^Lee^^RN|VAB^Vaccine administered by (Name)^HL70063|
NK1|2|Jones^Jane^Lee^^RN|FVP^Form completed by (Name)-Vaccine provider^HL70063|||(404) 554-9097^^WPN|
ORC|CN|||||||||||1234567^Welby^Marcus^J^Jr^Dr.^MD^L|||||||||Peachtree Clinic||(404) 554-9097^^WPN||
OBR|1|||^CDC VAERS-1 (FDA) Report|||20010316|
OBX|1|NM|21612-7^Reported Patient Age^LN||05|mo^month^ANSI|
`, "\n", "\r", -1)

func main() {
	m, _, _ := hl7.ParseMessage([]byte(testMessage))

	patient := struct {
		First  string    `hl7:"PID-5-2"`
		Last   string    `hl7:"PID-5-1"`
		Middle string    `hl7:"PID-5-3"`
		DOB    time.Time `hl7:"PID-7"`
		Gender string    `hl7:"PID-8"`
	}{}

	m.Unpack(&patient)

	fmt.Printf("%+v", patient)
}

License

3-clause BSD. A copy is included with the source.

hl7's People

Contributors

arebgun avatar deoxxa avatar levinalex-samedi avatar nwehr avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.