Welcome to the Modifhir API! Learn how to easily transform your data into FHIR-compliant JSON using JSON or plain text inputs.
Note: Please include your API key in the request headers as x-api-key: YOUR_API_KEY
.
https://api.modifhir.com/api/fhir/[resourceType] (e.g., observation, patient, etc.)
/api/fhir/[resourceType] (e.g., observation, patient, etc.)
application/json
or text/plain
x-api-key: YOUR_API_KEY
{ "resourceType": "Observation", "status": "final", "code": { "coding": [ { "system": "http://loinc.org", "code": "718-7", "display": "Hemoglobin [Mass/volume] in Blood" } ] }, "valueQuantity": { "value": 13.2, "unit": "g/dL" } }
resourceType: Observation status: final code: coding: - system: http://loinc.org code: 718-7 display: Hemoglobin [Mass/volume] in Blood valueQuantity: value: 13.2 unit: g/dL
curl -X POST https://api.modifhir.com/api/fhir/observation \ -H "Content-Type: application/json" \ -H "x-api-key: YOUR_API_KEY" \ -d '{ "resourceType": "Observation", "status": "final", "code": { "coding": [ { "system": "http://loinc.org", "code": "718-7", "display": "Hemoglobin [Mass/volume] in Blood" } ] }, "valueQuantity": { "value": 13.2, "unit": "g/dL" } }'
const fetch = require('node-fetch'); const data = { "status": "final", "code": { "coding": [ { "system": "http://loinc.org", "code": "718-7", "display": "Hemoglobin [Mass/volume] in Blood" } ] }, "valueQuantity": { "value": 13.2, "unit": "g/dL" } }; fetch('https://api.modifhir.com/api/fhir/observation', { method: 'POST', headers: { 'Content-Type': 'application/json', 'x-api-key': 'YOUR_API_KEY', }, body: JSON.stringify(data), }) .then(response => response.json()) .then(responseData => { console.log('FHIR-compliant JSON:', responseData); }) .catch(error => { console.error('Error:', error); });
import requests url = 'https://api.modifhir.com/api/fhir/observation' headers = { 'Content-Type': 'application/json', 'x-api-key': 'YOUR_API_KEY', } data = { "status": "final", "code": { "coding": [ { "system": "http://loinc.org", "code": "718-7", "display": "Hemoglobin [Mass/volume] in Blood" } ] }, "valueQuantity": { "value": 13.2, "unit": "g/dL" } } response = requests.post(url, headers=headers, json=data) print('FHIR-compliant JSON:', response.json())
using System; using System.Net.Http; using System.Text; using System.Threading.Tasks; class Program { static async Task Main() { var client = new HttpClient(); var data = @"{ ""status"": ""final"", ""code"": { ""coding"": [ { ""system"": ""http://loinc.org"", ""code"": ""718-7"", ""display"": ""Hemoglobin [Mass/volume] in Blood"" } ] }, ""valueQuantity"": { ""value"": 13.2, ""unit"": ""g/dL"" } }"; var request = new HttpRequestMessage(HttpMethod.Post, "https://api.modifhir.com/api/fhir/observation"); request.Headers.Add("x-api-key", "YOUR_API_KEY"); request.Content = new StringContent(data, Encoding.UTF8, "application/json"); var response = await client.SendAsync(request); var responseBody = await response.Content.ReadAsStringAsync(); Console.WriteLine("FHIR-compliant JSON: " + responseBody); } }