Skip to content

Instantly share code, notes, and snippets.

View molsches's full-sized avatar

Mark Olschesky molsches

View GitHub Profile
@molsches
molsches / gist:32fcec2499e95b5b23bc268800e22780
Last active November 28, 2018 15:55
Sample Note for AWS Comprehend Medical
ROS (10 systems)
In addition to that documented in the HPI above, the additional ROS was obtained:
Constitutional: Denies fevers or chills
Eyes: Denies vision changes
ENMT: Denies sore throat
CV: Denies chest pain
Resp: Denies SOB
GI: Denies vomiting or diarrhea
GU: Denies painful urination
MSK: Denies recent trauma
//This is a javascript writer segment
// File to send
var file = new Packages.java.io.File.createTempFile("s3-hl7", ".json");
var bw = new Packages.java.io.BufferedWriter(new Packages.java.io.FileWriter(file));
//'object' is just whatever you have in the channelMap that you want to push to S3. Might be just the raw message or the transformed message.
bw.write($('object'));
bw.close();
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="CDA.xsl"?>
<!--
Title: US_Realm_Header_Template
Revision History:
01/31/2011 bam created
07/29/2011 RWM modified
11/26/2011 RWM modified
08/12/2012 RWM modified
{
"ClinicalDocument": {
"-xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance",
"-xmlns": "urn:hl7-org:v3",
"-xmlns:cda": "urn:hl7-org:v3",
"-xmlns:sdtc": "urn:hl7-org:sdtc",
"-xsi:schemaLocation": "urn:hl7-org:v3 ../../../CDA%20R2/cda-schemas-and-samples/infrastructure/cda/CDA.xsd",
"realmCode": { "-code": "US" },
"typeId": {
"-root": "2.16.840.1.113883.1.3",
@molsches
molsches / gist:d4ec0c18794a069b1811
Created February 26, 2015 21:26
Building Node from source on Ubuntu
//Make a directory to hold the node
mkdir node-install-dir
cd node-install-dir
//Curl and unzip latest node
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
//Install gcc and g++
sudo apt-get update
sudo apt-get install make gcc g++ apache2
data.rfv = msg['PV2']['PV2.3']['PV2.3.1'].toString();
data.patientAddress = msg['PID']['PID.11']['PID.11.1'].toString() + (msg['PID']['PID.11']['PID.11.2'].length >= 1 ? (", " + msg['PID']['PID.11']['PID.11.2'].toString()) : "") + ", " + msg['PID']['PID.11']['PID.11.3'].toString() + ", " + msg['PID']['PID.11']['PID.11.4'].toString() + " " + msg['PID']['PID.11']['PID.11.5'].toString();
data.givenName = msg['PID']['PID.5']['PID.5.2'].toString();
data.familyName = msg['PID']['PID.5']['PID.5.1'].toString();
data.middleInitialOrName = msg['PID']['PID.5']['PID.5.3'].toString();
data.dob = new String(DateUtil.convertDate("yyyyMMdd","MM/dd/yyyy HH:mm:ss", msg['PID']['PID.7']['PID.7.1'].toString()));
data.sex = msg['PID']['PID.8']['PID.8.1'].toString();
data.phoneNumber = msg['PID']['PID.13']['PID.13.1'].toString();
data.eventTime = new String(DateUtil.convertDate("yyyyMMddHHmm","MM/dd/yyyy HH:mm:ss",msg['EVN']['EVN.2']['EVN.2.1'].toString()));
var in1 = [];
var dg1 = [];
var pr1 = [];
msh = {
"sendingFacility" : msg['MSH']['MSH.4']['MSH.4.1'].toString(),
"dateTime" : msg['MSH']['MSH.7']['MSH.7.1'].toString(),
"messageType" : msg['MSH']['MSH.9']['MSH.9.1'].toString(),
"messageEvent" : msg['MSH']['MSH.9']['MSH.9.2'].toString()
};
  1. Have Python 2.7 installed

  2. Install pip.

  3. Extract hl7python into a directory

  4. pip install virtualenv will install virtualenv

  5. cd into the hl7python directory

var json = JSON.parse(connectorMessage.getRawData());
var currentDate = DateUtil.getCurrentDate("yyyyMMddHHmmss");
//OK, duplicate for each field
channelMap.put("tmp", tmp);
//TODO: Placeholder for MRN/Zipnosis Patient ID
tmp['PID']['PID.2']['PID.2.1'];

NextGen Connect (formerly known as Mirth Connect) Server Setup

Create a VM running Ubuntu. Use a modern version.

Great thanks for the original guide: https://gist.github.com/jgautsch/9157402

# Update Ubuntu
sudo apt-get update

# Upgrade Ubuntu
sudo aptitude upgrade