{ "cells": [ { "cell_type": "code", "execution_count": 23, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "PosixPath('/Users/ehaas/Documents/FHIR/davinci-ecdx/CDEX-Signatures/in_files/test_bundle.json')" ] }, "execution_count": 23, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from json import loads, dumps, dump\n", "from pathlib import Path\n", "from jcs import canonicalize\n", "from yaml import dump as dumpy\n", "from IPython.display import display, Markdown\n", "\n", "out_file = 'canonical-fhir-document.json'\n", "in_file = '/Users/ehaas/Documents/FHIR/davinci-ecdx/CDEX-Signatures/in_files/test_bundle.json'\n", "path = Path() / in_file\n", "path" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Get Document" ] }, { "cell_type": "code", "execution_count": 24, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'resourceType': 'Bundle',\n", " 'id': '12521',\n", " 'meta': {'versionId': '1', 'lastUpdated': '2022-02-15T15:53:19.296Z'},\n", " 'identifier': {'system': 'urn:ietf:rfc:3986',\n", " 'value': 'urn:uuid:0c3151bd-1cbf-4d64-b04d-cd9187a4c6e0'},\n", " 'type': 'document',\n", " 'timestamp': '2013-05-28T22:12:21Z',\n", " 'entry': [{'fullUrl': 'urn:uuid:541a72a8-df75-4484-ac89-ac4923f03b81',\n", " 'resource': {'resourceType': 'Observation',\n", " 'referenceRange': [{'text': 'this is my markdown file line 1 \\nstill line 1 \\nline2\\n\\nline3\\n- bullet 1 \\n- bullet 1.\\n\\n code \"block\"\\n'}],\n", " 'meta': {'lastUpdated': '2013-05-05T16:13:03Z'},\n", " 'text': {'status': 'additional',\n", " 'div': '