Skip to content

Instantly share code, notes, and snippets.

Install OpenVPN. Must be Community version (otherwise get "TAP not supported" error). Service not required.
Import ovpn profile.
Find NEMS Party Key (not required uses the Spine party key: found here:https://digital.nhs.uk/services/path-to-live-environments/spine-core-common-issues-in-the-path-to-live-environments)
ldapsearch -x -H ldap://192.168.128.11 -b "ou=services, o=nhs" "(&(nhsIDCode=YES) (nhsAsSvcIA=urn:nhs:names:services:clinicals-sync:SubscriptionsApiPost))" uniqueIdentifier nhsMhsPartyKey
Lookup Message handling endpoint for Subscription Post:
ldapsearch -x -H ldap://192.168.128.11 -b "ou=services, o=nhs" "(&(nhsMhsPartyKey=[PARTY KEY GOES HERE]) (objectClass=nhsMhs) (nhsMhsSvcIA=urn:nhs:names:services:clinicals-sync:SubscriptionsApiPost))" nhsMhsEndPoint
Lookup Message handling endpoint for Subscription Read:
@elementechemlyn
elementechemlyn / fhirvalidate.py
Last active March 29, 2019 12:49
Reads a set of FHIR resources from a folder, validates them against a server and dynamically builds a set of unittest cases Currently - put each JSON resource into the RESOURCE_FOLDER as a .json file (1 file per resource). #TODO Allow reading of XML resources and GETing a resource from a url.
import unittest
import os
import os.path
import json
import requests
"""
Reads a set of FHIR resources from a folder, validates them against a server
and dynamically builds a set of unittest cases
Currently - put each JSON resource into the RESOURCE_FOLDER as a .json file (1 file per resource).
@elementechemlyn
elementechemlyn / nginx.conf
Created December 27, 2018 18:28
OpenResty config to proxy a request into a SMART on FHIR launch request
location /foo {
set $target '';
access_by_lua_block {
local b64 = require("ngx.base64")
local b64_args = b64.encode_base64url(ngx.var.args)
ngx.var.args = "launch=" .. b64_args
}
proxy_pass 'http://localhost:8080';
}
import requests
with open("ccgcodes.txt") as f,open("ccgname.txt","w") as w : [w.write("%s,%s\n" % (ccg.strip(),requests.get("https://directory.spineservices.nhs.uk/STU3/Organization/%s" % ccg.strip()).json()["name"])) for ccg in f.readlines()]

Keybase proof

I hereby claim:

  • I am elementechemlyn on github.
  • I am emlynj (https://keybase.io/emlynj) on keybase.
  • I have a public key ASBzM-HIM3GvHdzcT5hQH7QiQxJXDzytOTU-X1IhQRHMoAo

To claim this, I am signing this object: