This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package definevalidate; | |
import java.io.File; | |
import java.io.IOException; | |
import java.util.HashMap; | |
import javax.xml.XMLConstants; | |
import javax.xml.parsers.DocumentBuilder; | |
import javax.xml.parsers.DocumentBuilderFactory; | |
import javax.xml.parsers.ParserConfigurationException; | |
import javax.xml.transform.dom.DOMSource; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
freq_dist.py prints frequency distributions for 3 variables H1DA2, H1FS11, H1FS15 | |
@author: swhume | |
last_updated 2020-03-18 | |
""" | |
import pandas | |
import os | |
# set path and filename for the data file and load the dataset |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import odmlib.odm_1_3_2.model as ODM | |
import datetime | |
ODM_XML_FILE = "./data/simple_create.xml" | |
ODM_JSON_FILE = "./data/simple_create.json" | |
current_datetime = datetime.datetime.utcnow().replace(tzinfo=datetime.timezone.utc).isoformat() | |
root = ODM.ODM(FileOID="ODM.DEMO.001", Granularity="Metadata", AsOfDateTime=current_datetime, | |
CreationDateTime=current_datetime, ODMVersion="1.3.2", FileType="Snapshot", | |
Originator="swhume", SourceSystem="odmlib", SourceSystemVersion="0.1") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import json | |
USERNAME = "username" | |
PWD = "password" | |
URL = "http://68.183.158.128:5000/odm" | |
codelist = { | |
"_use": "collection", | |
"OID": "CL.Test.02", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from fhirclient import client | |
import fhirclient.models.observation as ob | |
settings = { | |
'app_id': 'rof_adapter', | |
'api_base': 'https://api-v5-stu3.hspconsortium.org/rofphir/open' | |
} | |
def get_observations(patient_id, loinc_code): | |
smart = client.FHIRClient(settings=settings) | |
search_obs = ob.Observation.where(struct=dict(patient=patient_id, code=loinc_code)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import json | |
USERNAME = "username" | |
PWD = "password" | |
URL = "http://68.183.158.128:5000/odm" | |
# create ItemDef | |
itemdef = { | |
"_use": "collection", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package json2xml; | |
import java.io.IOException; | |
import java.nio.file.Files; | |
import java.nio.file.Paths; | |
import org.json.JSONException; | |
import org.json.JSONObject; | |
import org.json.XML; | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import os | |
import json | |
import logging | |
import argparse | |
class LinkCrawler: | |
""" SHARE v2.0 link crawler for testing HATEOAS content in API responses """ | |
def __init__(self, base_url, start_resource, log_file="link_log.txt", log_path=None, username=None, password=None): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from fhirclient import client | |
import fhirclient.models.patient as p | |
settings = { | |
'app_id': 'rof_adapter', | |
'api_base': 'https://api-v5-stu3.hspconsortium.org/rofphir/open' | |
} | |
smart = client.FHIRClient(settings=settings) | |
patient = p.Patient.read('SMART-1288992', smart.server) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# scrape XML from a spec grabber generated wiki page | |
from bs4 import BeautifulSoup | |
import os | |
import sys | |
import getopt | |
# get the command-line arguments - page id is required | |
scrape_xml_file = "scrape.xml" | |
path = "" | |
page_id = None |
OlderNewer