Skip to content

Instantly share code, notes, and snippets.

@elementechemlyn
elementechemlyn / species_list.txt
Created August 30, 2023 16:14
Custom BirdNet-Analyzer species list for birds of Wales
Acanthis cabaret_Lesser Redpoll
Accipiter gentilis_Northern Goshawk
Accipiter nisus_Eurasian Sparrowhawk
Acrocephalus schoenobaenus_Sedge Warbler
Acrocephalus scirpaceus_Eurasian Reed Warbler
Actitis hypoleucos_Common Sandpiper
Aegithalos caudatus_Long-tailed Tit
Aix galericulata_Mandarin Duck
Alauda arvensis_Eurasian Skylark
Alca torda_Razorbill

Fake PDS

Fake PDS is a copy of the NHS DIgitial PDS sandpit with data adjusted to suit the Maternity Hack. It contains two records:

Name Actor NHS Number Date of Birth
Alice Smith Mother 5400506275 2000-10-22
Emma Smith Baby 5815309540 2021-07-12

To Retrieve Alice's (the Mother) Fake PDS record:

{
"resourceType": "Bundle",
"id": "3",
"meta": {
"versionId": "1",
"lastUpdated": "2021-07-08T15:45:11.974+00:00",
"source": "#BVurnbOFH97DS1W0",
"profile": [ "http://hl7.org/fhir/STU3/StructureDefinition/Bundle" ]
},
"type": "message",
@elementechemlyn
elementechemlyn / PDS FHIR Sandbox pip
Created June 11, 2021 10:45
Python requirements to run the NHS PDS FHIR API Sandbox locally
appdirs==1.4.4
CacheControl==0.12.6
cachy==0.3.0
certifi==2021.5.30
cffi==1.14.5
chardet==4.0.0
cleo==0.8.1
clikit==0.6.2
crashtest==0.3.1
cryptography==3.4.7

Pointer Resolution Notes

A set of examples of retrieving the contents of a fully contained NEMS message from a pointer passed in a lightweight NEMS message. These examples all use search functionality as described in the base HL7 FHIR spec:

https://www.hl7.org/fhir/STU3/search.html

Examples Setup

To setup these examples, the transactional bundle found here:

<Bundle xmlns="http://hl7.org/fhir">
<id value="6e824ff8-9b0a-11e8-9eb6-529269fb1459"/>
<meta>
<profile value="http://hl7.org/fhir/STU3/StructureDefinition/Bundle"/>
</meta>
<type value="transaction"/>
<entry>
<fullUrl value="urn:uuid:076db265-8799-4dda-9418-e2a4d6d1c0d0"/>
<resource>
<Immunization>
@elementechemlyn
elementechemlyn / meshapi.py
Last active September 10, 2020 16:11
Quick Python script to demo calling the NHS MESH API
import requests
import uuid
import datetime
import hmac
import hashlib
import logging
#This is the set of headers required for an authenticate request.
MESH_HEADERS = {
"Authorization":"",
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
function meshAuthorisationToken (mailboxId, mailboxPassword, secretKey) {
// GS 2016-12-13
// construct MESH authorisation token
var d = new Date();
var ts = '' + d.getFullYear()
+ (d.getMonth() < 9 ? '0' + (d.getMonth()+1) : (d.getMonth()+1))
+ (d.getDate() < 9 ? '0' + (d.getDate()) : (d.getDate()))
+ (d.getHours() < 10 ? '0' + d.getHours() : d.getHours())
+ (d.getMinutes() < 10 ? '0' + d.getMinutes() : d.getMinutes());
@elementechemlyn
elementechemlyn / NEMS Event MESH Workflow ID.md
Last active March 20, 2020 12:33
Table of MESH workflow IDs for NEMS event types
NEMS Event FHIR Event code MESH Workflow ID
Blood Spot Test Outcome blood-spot-test-outcome-1 BLOODSPOTTESTOUTCOME_1
Newborn Hearing newborn-hearing-1 NEWBORNHEARING_1
NIPE Outcome nipe-outcome-1 NIPEOUTCOME_1
PDS Birth Notification pds-birth-notification-1 BIRTHNOTIFICATION_1
PDS Change of Address pds-change-of-address-1 CHANGEOFADDRESS_1
PDS Change of GP pds-change-of-gp-1 CHANGEOFGP_1
PDS Death Notification pds-death-notification-1 DEATHNOTIFICATION_1
Professional Contacts professional-contacts-1 PROFESSIONACONTACTS_1