Skip to content

Instantly share code, notes, and snippets.

View alexanderkiel's full-sized avatar

Alexander Kiel alexanderkiel

View GitHub Profile
@alexanderkiel
alexanderkiel / bundle.json
Created August 6, 2021 19:28
FHIR Bundle with fullUrl References
{
"resourceType": "Bundle",
"id": "Example-HIVSimple",
"type": "transaction",
"entry": [
{
"fullUrl": "https://intrahealth.github.io/simple-hiv-ig/Patient/Patient-HIVSimple",
"resource": {
"resourceType": "Patient",
"id": "Patient-HIVSimple",
@alexanderkiel
alexanderkiel / contact.json
Created October 29, 2020 11:42
Corona Contact Form
{
"resourceType": "bundle",
"entry": [
{
"fullUrl": "urn:uuid:38f5cc57-a667-4c44-b9a9-8e8ce1bd86a8",
"resource": {
"resourceType": "Patient",
"name": {
"family": "___________________________",
"given": [
import timeit
from array import array
def c_add(c1, c2):
r1, i1 = c1
r2, i2 = c2
return (r1 + r2, i1 + i2)
def c_square(c):
r, i = c
library Retrieve
using FHIR version '4.0.0'
include FHIRHelpers version '4.0.0'
codesystem gender: 'http://hl7.org/fhir/administrative-gender'
context Patient
define InInitialPopulation:
Patient.gender ~ Code 'male' from gender
proxy_cache_path /tmp/nginx keys_zone=FHIR:10m;
# our origin server with added Cache-Control headers since HAPI has none
server {
listen 8080;
location / {
proxy_pass http://hapi.fhir.org/;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
add_header Cache-Control "public, must-revalidate, max-age=1";
{
"name": "gba-broker-ui-ng",
"version": "0.1.0",
"description": "",
"private": true,
"dependencies": {
"@material/button": "^0.40.0",
"@material/card": "^0.40.0",
"@material/checkbox": "^0.40.0",
"@material/dialog": "^0.40.0",
@alexanderkiel
alexanderkiel / phrase-map-01.cljs
Created January 17, 2018 15:01
Example of Phrase for Map Validation
#!/usr/bin/env planck -D phrase:0.3-alpha2
(require '[clojure.spec.alpha :as s])
(require '[phrase.alpha :refer [defphraser phrase]])
(s/def ::required-string (s/and string? not-empty))
(s/def ::name ::required-string)
(s/def ::phone (s/and string? #(re-matches #"(\+47)?\d+" %)))
(s/def ::email (s/and string? #(re-matches #".+@.+" %)))
(s/def ::first-name ::name)

Keybase proof

I hereby claim:

  • I am alexanderkiel on github.
  • I am akiel (https://keybase.io/akiel) on keybase.
  • I have a public key ASCIVnTDEAOcjWvpyBBiQt1ijn6hiurmS9uajUMpuHswywo

To claim this, I am signing this object:

;; I have the following specs
(s/def ::product-id int?)
(s/def ::amount int?)
(s/def ::price bigdec?)
(s/def ::line-item
(s/keys :req [::product-id ::amount ::price]))
(s/def ::line-items
(s/coll-of ::line-item))
@alexanderkiel
alexanderkiel / ring-spec.clj
Last active April 8, 2018 20:06
An attempt to write a ring spec in clojure.spec.
(ns ring.spec
(:require [clojure.java.io :as io]
[clojure.spec :as s]
[clojure.spec.gen :as gen]
[clojure.string :as str])
(:import [java.io File InputStream]))
;; ---- Internal Primitives ---------------------------------------------------
(def ^:private token-pattern #"[\!#$%&'*+-.^_`|0-9A-Za-z]+")