---
title: FHIR EHR
tags: fhir-project
---
<font color="red">FHIR</font> Electronic Health Record (EHR)
===
###### tags: `fhir-project` `ehr`
## Table of Contents
[TOC]
## Introduction
In the EHR scenario, each healthcare organization's will have their own EMR system where the patient's medical record **cannot** be shared with other healthcare organization. For example, patient's record in **Oxford Hospital** EMR system cannot be integrate accessed by **Harvard Hospital** practitioner. The patient’s record might still need to be printed out and delivered by mail to the Harvard Hospital.
Therefore, EMR provides a RESTful API that only allows practitioner of their own organization to access the patient's medical record under the organization.
:::info
:bulb: **Q&A**
Q: Is it possible to share patient's record across different hospital's EMR system digitally?
A: Absolutely YES! Check the [**Patient Portal**](https://hackmd.io/@victoriatjia/patientportal) page
:::
## Features
In this scenario, the EHR provider:
- Provides the practitioner with a login that identifies them
- Authenticates the practitioner using an appropriate OAuth server for the login and restricts the practitioner to viewing records associated with the specific patient
- Allow the practitioner to generate patient's medical record
## Required FHIR Resources
The EHR exposes a FHIR server that supports the CRUD (Create, Read, Update, Delete) operations on the following resources:
- Organization
- Person
- Practitioner + PractitionerRole
- **Patient**: In order to provide demographics to the client. When a client searches patients with no search criteria, they get a list of all patients they have access to
- Observation, Immunization, DiagnosticReport: Clinical data
- AuditEvent
- Composition
- **Bundle**: for the purpose of general patient report documents in the form of PDFs etc. (PDFs are preferred)
## System Description
1. Login System
<center>*Example of user module diagram in Radiotherapy EHR System*</center>
We're going to use below scenario for the detailed example.
**Scenario #1** Oxford Hospital is going to develop an EHR system, with practitioner listed below:
| No. | Department | Role | Name|
| -------- | -------- | -------- |-------- |
| 1| General Medicine| General physician |Dr. Elon Musk |
<!--| 2| IT| IT Admin |Victoria| -->
### **Step-by-step**:
1. Create Organization for Oxford Hospital:
:::spoiler [Organization/2863475](https://hapi.fhir.org/baseR4/Organization/2863475)
```gherkin=
{
"resourceType": "Organization",
"active": true,
"type": [ {
"coding": [ {
"system": "http://terminology.hl7.org/CodeSystem/organization-type",
"code": "prov",
"display": "Healthcare Provider"
} ]
} ],
"name": "Oxford Hospital",
"telecom": [ {
"system": "phone",
"value": "911"
} ],
"address": [ {
"text": "21, Washington Street"
} ],
"contact": [ {
"name": {
"text": "Victoria"
},
"telecom": [ {
"system": "email",
"value": "victoriatjiaa@gmail.com"
}, {
"system": "phone",
"value": "0812345678"
} ]
} ]
}
```
:::
2. Create Organization for General Medicine Department
:::spoiler [Organization/2916249](https://hapi.fhir.org/baseR4/Organization/2916249)
```gherkin=
{
"resourceType": "Organization",
"active": true,
"type": [ {
"coding": [ {
"system": "http://terminology.hl7.org/CodeSystem/organization-type",
"code": "dept",
"display": "Hospital Department"
} ]
} ],
"name": "General Medicine",
"partOf": {
"reference": "Organization/2863475"
}
}
```
:::
<!-- 4. Create Organization for IT Department: [Organization/2916250](https://hapi.fhir.org/baseR4/Organization/2916250) -->
3. Create Person for Dr. Albert Einstein's account username and password
:::spoiler [Person/2865781](https://hapi.fhir.org/baseR4/Person/2865781)
```gherkin=
{
"resourceType": "Person",
"active": true,
"identifier": [ {
"system": "UserID",
"value": "elonmusk@gmail.com"
}, {
"system": "Password",
"value": "NThjYzgzZjViODBjYjUzY2U1Mzg1YWY5NTY0NThmYTllYWVkODk4MjVhZmY3NmE4MjQ5MTAzYzEwZGVlODY3ZQ=="
}, {
"system": "HighestEduDegree",
"value": "Master"
}, {
"system": "Institution",
"value": "Oxford University"
} ],
"name": [ {
"text": "Elon Musk"
} ],
"telecom": [ {
"system": "email",
"value": "elonmusk@gmail.com"
} ]
}
```
:::
<br>
5. Create Practitioner for Dr. Albert Einstein as a healthcare professional in Oxford Hospital
:::spoiler [Practitioner/2865782](https://hapi.fhir.org/baseR4/Practitioner/2865782)
```gherkin=
{
"resourceType": "Practitioner",
"active": true,
"name": [
{
"text": [
"Elon Musk"
]
}
]
}
```
:::
<br>
6. Create PractitionerRole for Dr. Albert Einstein role as General physician in Oxford Hospital
:::spoiler [PractitionerRole/2865783](https://hapi.fhir.org/baseR4/PractitionerRole/2865783)
```gherkin=
{
"resourceType": "PractitionerRole",
"identifier": [ {
"system": "PractitionerID",
"value": "P0002"
} ],
"active": true,
"code": [ {
"coding": [ {
"system": "http://hl7.org/fhir/R4/valueset-practitioner-role.html",
"code": "doctor",
"display": "Doctor"
} ]
} ],
"practitioner": {
"reference": "Practitioner/2863581",
"display": "Elon Musk"
},
"organization": {
"reference": "Organization/2916249",
"display": "General Medicine-Oxford Hospital"
},
"telecom": [ {
"system": "email",
"value": "elonmusk@oxfuni.com",
"use": "work"
} ]
}
```
:::
<br>
7. Update FHIR Person to link the Person resource with Practitioner resource
:::spoiler [Person/2865781](https://203.64.84.213:52883/binus/fhir/Person/2865781)
```gherkin=
"link": [ {
"target": {
"reference": "Practitioner/2865782"
}
} ]
```
:::
<br>