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
# Copyright 2022 Sam Hume. Licensed under the MIT-0 license https://opensource.org/licenses/MIT-0 | |
import odmlib.define_2_1.model as DEFINE | |
import datetime | |
""" | |
This is the code presented at the PHUSE US Connect 2022 and described in paper PAP_OS01. | |
The purpose of this code is to demonstrate using odmlib to create and process a very simple Define-XML v2.1 file. | |
NOTE: In places where paths are referenced, you will need to update them to reflect your system. | |
""" |
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 lxml.etree as ET | |
import argparse | |
import os | |
""" | |
Example Cmd-line Args: | |
example: -x ./data/some.xml -o ./data/some.html -s ./data/transform.xslt | |
""" | |
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 sys | |
import xml.etree.ElementTree as ET | |
""" Simple program snippet to demonstrate parsing the CXL XML CMAP export format """ | |
ET.register_namespace('', "http://cmap.ihmc.us/xml/cmap/") | |
# get the CXL file to parse from the command-line | |
if len(sys.argv) > 1: | |
cxl_file = sys.argv[1] | |
else: |
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 |
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
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
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 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
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" | |
codelist = { | |
"_use": "collection", | |
"OID": "CL.Test.02", |
NewerOlder