Skip to content

Instantly share code, notes, and snippets.

View simonmd's full-sized avatar

Simon Rascovsky MD, M.Sc simonmd

View GitHub Profile
@simonmd
simonmd / ec2-gateway-reset.sh
Created November 26, 2022 04:00
Reset Alara Gateway EC2
#!/bin/bash
docker kill $(docker container ls -q)
docker system prune -af
rm -rf alara* .alara
echo "Host has been reset."
@simonmd
simonmd / machine.js
Last active November 6, 2020 21:18
Generated by XState Viz: https://xstate.js.org/viz
const workOrderMachine = Machine({
id: 'workOrder',
initial: 'created',
context: {
userId: '',
userRole: '',
work_order_id: 1,
reportCreated: false,
previousState: "here goes the previous state"
},
@simonmd
simonmd / Readme.md
Last active May 26, 2020 16:33
DICOM Widget for Dashing

Description

Simple Dashing widget (and associated files) to display DICOM server checks.

##Dependencies

dicom

Add it to dashing's gemfile:

@simonmd
simonmd / pulling_changes fork
Created April 11, 2012 19:10
Pulling changes into a Github fork from the original repository
Pulling changes into a Github fork from the original repository
If you maintain your own ongoing fork of a project on Github, you will inevitably want to pull in changes from the originator’s repository. Here’s how I usually go about it.
First add the other guy’s repository to your list of remotes:
cd my-fork
git remote add other-guy https://github.com/other-guy/other-guys-repo.git
If you were to then list your remotes, you would have something like:
@simonmd
simonmd / ps_template_parser.rb
Created March 27, 2012 19:04 — forked from elskwid/ps_template_parser.rb
Powerscribe templates XML parsing
#!/usr/bin/env ruby
require 'rexml/document'
include REXML
#open the XML file exported from Powerscribe
# Ruby lets us open the file in a block (thereby closing it when it's done)
File.open("Voice.xml") do |file|
# The "block" is that do ... end syntax and |file| is a reference to the file we've opened
doc = Document.new(file)
{
"_id": "_design/stats_peso",
"_rev": "2-eb08db50d60f5b02385c88908a0974df",
"language": "javascript",
"views": {
"stats_peso": {
"map": "function(doc) {\n if (doc.t00101030 != void 0) {\n emit(\"Peso_stats\", parseInt(doc.t00101030));\n }\n}",
"reduce": "_stats"
}
}
{
"_id": "_design/patient_id",
"_rev": "1-17546bcc3050ddc486f9daf875bdeef5",
"language": "javascript",
"views": {
"patient_id": {
"map": "function(doc) {\n emit(doc.t00100020,{Nombre:doc.t00100010,\"StudyDescription\":doc.t00400254, \"StudyDate\":doc.t00080020, \"StudyIUID\":doc.t0020000D});\n}\n",
"reduce": "function(keys, values) {\nfor(var k=0;k<1;k++) return values[k];\n}\n"
}
}
{
"_id": "_design/study_desc",
"_rev": "1-f220f2722880f8cb7fac3286828e4612",
"language": "javascript",
"views": {
"study_desc": {
"map": "function(doc) {\n emit({\"StudyDesc\":doc.t00400254,\"SerieDesc\":doc.t0008103E},1);\n}",
"reduce": "function(keys, values, rereduce) {\nreturn sum(values);\n}\n"
}
}
{
"_id": "_design/patient_name",
"_rev": "2-5bd74fcede5b67023f8d80d5b1360e9a",
"language": "javascript",
"views": {
"patient_name": {
"map": "function(doc) {\n emit(doc.t00100010,{\"pat_id\":doc.t00100020,\"StudyDescription\":doc.t00400254, \"BirthDate\":doc.t00100030, \"Accession\":doc.t00080050, \"Modality\":doc.t00080060, \"StudyDate\":doc.t00080020, \"Institution\":doc.t00080080});\n}\n",
"reduce": "function(keys, values) {\nfor(var k=0;k<1;k++) return values[k];\n}"
}
}
@simonmd
simonmd / gist:ca82d7920dba829d28ed
Created December 24, 2014 17:02
Coerce para corregir el encoding DICOM cuando no vienen con SpecificCharacterSet
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml" indent="no"/>
<xsl:template match="/dataset">
<dataset>
<attr tag="00080005" vr="CS">ISO_IR 100</attr>
</dataset>
</xsl:template>
</xsl:stylesheet>