Skip to content

Instantly share code, notes, and snippets.

View freshehr's full-sized avatar

Ian McNicoll freshehr

View GitHub Profile
@freshehr
freshehr / canonical term-mappings.json
Created April 9, 2024 13:14
Example of openEHR term mappings
{
"archetype_node_id": "at0011",
"_type": "ELEMENT",
"name": {
"_type": "DV_TEXT",
"value": "Phenotype",
"mappings": [
{
"_type": "TERM_MAPPING",
"match": "=",
@freshehr
freshehr / gist:940e1eb64af0f3c1af16660866429715
Created November 23, 2021 08:52
Full composition Weight Web template
{
"templateId" : "test",
"semVer" : "0.1.0",
"version" : "2.3",
"defaultLanguage" : "en",
"languages" : [ "en" ],
"tree" : {
"id" : "test",
"name" : "test",
"localizedName" : "test",
@freshehr
freshehr / gist:4e31a004b6e5b6a09dd2f648c1c93bfb
Created November 23, 2021 08:47
Weight archetype in Web template json
{
"id" : "body_weight",
"name" : "Body weight",
"localizedName" : "Body weight",
"rmType" : "OBSERVATION",
"nodeId" : "openEHR-EHR-OBSERVATION.body_weight.v2",
"min" : 0,
"max" : 1,
"localizedNames" : {
"en" : "Body weight"
@freshehr
freshehr / gist:730289e785524aad293ac4678f169a3e
Last active October 15, 2021 12:49
Example web template based on Problem diagnosis archetype
{
"templateId" : "GW - Problem template",
"version" : "2.3",
"defaultLanguage" : "en",
"languages" : [ "en" ],
"tree" : {
"id" : "gw_-_problem_template",
"name" : "GW - Problem template",
"localizedName" : "GW - Problem template",
"rmType" : "COMPOSITION",
{
"_type": "COMPOSITION",
"name": {
"_type": "DV_TEXT",
"value": "Hospitalisation"
},
"archetype_details": {
"_type": "ARCHETYPED",
"archetype_id": {
"_type": "ARCHETYPE_ID",
{
"resourceType": "Patient",
"name": [
{
"family": "Chalmers",
"use": "official",
"given": [
"Peter",
"James"
],
## POST
```
POST /rest/v1/composition?ehrId=7bbc1ebe-12a3-4f99-827e-86aa013e1349& templateId=RESPECT_NSS-v0& committerName=Dr Franke& format=FLAT HTTP/1.1
Host: ethercis1.3-test.ripple.foundation:8080
Ehr-Session: sessionId:127.0.0.1-guest-1554203965063-410850060-79
Content-Type: application/json
{
"ctx/language": "en",
"ctx/territory": "GB",
"nss_respect_form/language|code": "en",
curl -X POST \
http://178.62.71.220:8080/rest/v1/template/ \
-H 'Authorization: Basic Z3Vlc3Q6Z3Vlc3Q=' \
-H 'Content-Type: application/xml' \
-H 'Ehr-Session: sessionId:127.0.0.1-guest-1548250494478-1031674849-11061' \
-d '<?xml version="1.0" encoding="utf-8"?>
<!--Operational template XML automatically generated by Ocean Template Designer Version 2.8.94Beta-->
<template xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.openehr.org/v1">
<language>
<terminology_id>
@freshehr
freshehr / gist:7a9b45b35aed84ccda5e7ab22b4a822a
Last active January 11, 2019 22:40
Corrected SASurfer xml
<v1:composition archetype_node_id="openEHR-EHR-COMPOSITION.hospitalisation.v1" xmlns:v1="http://schemas.openehr.org/v1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<v1:name>
<v1:value>Hospitalisation</v1:value>
</v1:name>
<v1:archetype_details>
<v1:archetype_id>
<v1:value>openEHR-EHR-COMPOSITION.hospitalisation.v1</v1:value>
</v1:archetype_id>
<v1:template_id>
<v1:value>hospitalization_oceanehr</v1:value>
@freshehr
freshehr / gist:ed4064e3af8a8c03a7be92e558cf63dd
Created December 6, 2018 11:02
Getting authenticated openEHR Ehrscape - Marand Think/EHR and Ethercis
# 2. Getting connected to the CDR
In this section we will just ensure that we can connect to an openEHR CDR, retreive a session token, and run a simple call to retreive a list of the loaded templates, to check that we are all setup correctly.
## A. General setup
We now need access to an openEHR CDR, currently Marand Think!Ehr or Ripple Ethercis are supported, and the following information...
1. baseUrl of the CDR
2. Username and Password of the CDR (Ethercis) or CDR Domain (Operino /Project on Code4Health Platform)