Skip to content

Instantly share code, notes, and snippets.

@eedrummer
eedrummer / freqs_of_matching_projs.js
Last active November 3, 2021 14:45
Queries for looking into MongoDB at the CODI Linkage Agent
db.getCollection('match_groups').aggregate([{
$group: {
_id:{$size:'$run_results'},
total: { $sum: 1 },
}
}])
@eedrummer
eedrummer / example.json
Last active October 28, 2021 17:08
Example Synthea Patient JSON Export
This file has been truncated, but you can view the full file.
{
"random": {
"seed": 45202092906816,
"nextNextGaussian": -0.2768758555544073,
"haveNextNextGaussian": true
},
"seed": -1284530909448198332,
"populationSeed": 1635262516394,
"lastUpdated": 1634914774356,
"currentModules": [
@eedrummer
eedrummer / linkidtopatid.py
Created February 22, 2021 18:18
Fix for LINK_ID translation
import csv
import argparse
from pathlib import Path
parser = argparse.ArgumentParser(description='Tool for translating LINK_IDs back into PATIDs')
parser.add_argument('--source', nargs=1, required=True, help='Source PII CSV file')
parser.add_argument('--links', nargs=1, required=True, help='LINK_ID CSV file')
args = parser.parse_args()
source_file = Path(args.source[0])
@eedrummer
eedrummer / generatesecret.py
Created May 5, 2020 14:10
De-identification secret generation for CODI
from secrets import token_hex
secret_bit_length = 128
deidentification_secret = token_hex(secret_bit_length)
with open('deidentification_secret.txt', 'w', newline='') as secret_file:
secret_file.write(deidentification_secret)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@eedrummer
eedrummer / ballot-comment.rb
Created March 22, 2019 16:38
HL7 GForge Comment Processor
require 'csv'
require 'erb'
comments = CSV.read('/Users/andrewg/Downloads/quickquery.csv', headers: true, quote_char: '|')
submitters = comments.map {|c| c['Real Submitter']}.uniq.sort
template = ERB.new <<-EOF
<html>
<head>
@eedrummer
eedrummer / request.json
Created August 8, 2018 20:34
CRD Request
{
"context":{
"patientId":"1288992",
"encounterId":"89284",
"orders":{
"resourceType":"Bundle",
"entry":[
{
"resource": {
"resourceType": "DeviceRequest",
@eedrummer
eedrummer / combined.json
Created August 3, 2018 14:50
Possible CRD responses with CDS Hooks
{
"cards": [
{
"summary": "Positive Airway Pressure (PAP) Devices: Complying with Documentation & Coverage Requirements",
"indicator": "info",
"source": {
"label": "CMS"
},
"links": [
{
{
"birthdate": 252478800,
"conditions": [
{
"anatomical_location": null,
"anatomical_target": null,
"causeOfDeath": null,
"codes": {
"ICD-10-CM": [
"I10"
{
"birthdate": 252478800,
"conditions": [
{
"anatomical_location": null,
"anatomical_target": null,
"causeOfDeath": null,
"codes": {
"ICD-10-CM": [
"E10.10"