Skip to content

Instantly share code, notes, and snippets.

View jamesagnew's full-sized avatar

James Agnew jamesagnew

  • HAPI // Smile CDR // University Health Network
  • Toronto, Canada
View GitHub Profile
import ca.uhn.fhir.interceptor.api.Hook;
import ca.uhn.fhir.interceptor.api.Pointcut;
import ca.uhn.fhir.interceptor.api.Interceptor;
import ca.uhn.fhir.jpa.api.dao.DaoRegistry;
import ca.uhn.fhir.jpa.api.dao.IFhirResourceDao;
import ca.uhn.fhir.jpa.partition.SystemRequestDetails;
import ca.uhn.fhir.jpa.subscription.channel.subscription.ISubscriptionDeliveryChannelNamer;
import ca.uhn.fhir.jpa.subscription.channel.subscription.SubscriptionChannelRegistry;
import ca.uhn.fhir.jpa.subscription.model.CanonicalSubscription;
import ca.uhn.fhir.jpa.subscription.model.ResourceDeliveryJsonMessage;
{
"resourceType":"Patient",
"name":[
{
"family":[
"Simpson"
],
"given":[
"Homer",
"Jay"

Static Subscription Workflow

  • Client registers subscription
PUT /baseDstu2/Subscription HTTP/1.1
(subscription resource in body)
  • Client Connects to server and upgrades to Websocket
GET /websocket/dstu2 HTTP/1.1
@jamesagnew
jamesagnew / gist:38d52aae76e939c0bead
Created March 20, 2015 12:43
Example FHIR Patient Resource
{
"resourceType":"Patient",
"text":{
"status":"generated",
"div":"<div><div class=\"hapiHeaderText\"> Achim-Uwe <b>BERGMANNSBERG </b></div><table class=\"hapiPropertyTable\"><tbody><tr><td>Identifier</td><td>Pat-473</td></tr><tr><td>Address</td><td><span>Luebeck </span></td></tr><tr><td>Date of birth</td><td><span>04 June 1802</span></td></tr></tbody></table></div>"
},
"identifier":[
{
"system":"http://kh-hh.de/mio/patients",
"value":"Pat-473"
@jamesagnew
jamesagnew / NamesChanges.java
Last active August 29, 2015 14:05
Creating a list of FHIR parameter names and potential changes
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.junit.Test;
import ca.uhn.fhir.model.api.IResource;
import ca.uhn.fhir.model.dstu.resource.Patient;
import ca.uhn.fhir.model.dstu.valueset.SearchParamTypeEnum;