--- title: Create FHIR DocumentReference to index document on Patient Portal tags: FHIR_SkinLesionImageManagement --- Create <font color="red">FHIR </font>DocumentReference to index document on Patient Portal === <div style="text-align:justify;">This chapter describes the scheme of how resource owners index documents to Patient Portal using the FHIR DocumentReference. FHIR Document Reference is used to index documents across resource servers with the aim of making it easier for documents to be accessed and granted in the health care ecosystem. **Examples:** Patient A has an electronic health record in a hospital, to allow the electronic health record to be accessed by many health institutions, the electronic health record needs to be indexed on a public server in the form of an "FHIR DocumentReference", that contain reference to the original document url. There are 2 scenarios in generating FHIR DocumentReference on Patient Portal: 1. The patient or physician manually performs the indexing document on the Patient Portal 2. FHIR EHR & PHR generates FHIR DocumentReference to Patient Portal each time user on client want to share a document. In this article, we will discuss scenario 1. </div> ## Table of Contents [TOC] ## 1. Scenario Once the a person has a document that he wants share it to someone else. Then the resource owner needs to index the document on the Patient Portal in the form of an FHIR DocumentReference, which contain a reference to the original document. ## 2. Purpose - Quick query access of document - Optimizing performance of resource server by minimizing document storage memory, and minimizing memory used in the querying process - Index documents across resource servers - Easier for documents to be accessed and shared in heathcare ecosystem ## 3. Block management on patient portal used The scheme of indexing document using FHIR DocumentReference on Portal will use portal block management: ![](https://i.imgur.com/tXUPx44.png) - Resource Management Act as resource registry or storage, which stores FHIR DocumentReference for indexing document use. - Personnel Management (Person, Institutional & Organizational) Provide list of personnel information yang berperan sebagai resource owner dan reader, including person, practitioner, institutional, and organizational. This information is used in setting the detailed information of the FHIR DocumentReference, includes subject, author, and other role elements. ## 4. FHIR Resource used - FHIR DocumentReference= the index of document to be shared, it is documents that contain reference to the original document - FHIR Document= the the original document ### 4.1 Resource relation ![](https://i.imgur.com/GHOvlza.png) FHIR DocumentReference is composed of various information regarding the document to be indexed, including information oh the resource owner, the author, custodian, and the original document url. ## 5. DocumentReference specification ### Prerequisite 1. [Personel management establishment](/rk3qR60Zo) 2. Document url to be index, can be any file url such as skin lesion image, image exam report, etc. #### Example ##### 1. DocumentReference input by patient Pasient Will Smith want to shared his skin lesion report, so his skin lesion report need to be indexed on Portal using FHIR DocumentReference. :::spoiler Patient/46179774-1a1e-4ae4-b626-9ff53fa080f4 [(example)](https://203.64.84.150:58443/portaltest1/fhir/Patient/46179774-1a1e-4ae4-b626-9ff53fa080f4) ```gherkin= { "resourceType": "Patient", "id": "46179774-1a1e-4ae4-b626-9ff53fa080f4", "meta": { "versionId": "1", "lastUpdated": "2022-08-30T16:45:53.199+08:00", "source": "#2E1dW1HdBAatV1og" }, "text": { "status": "generated", "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><div class=\"hapiHeaderText\"/><table class=\"hapiPropertyTable\"><tbody><tr><td>Identifier</td><td>111316001</td></tr></tbody></table></div>" }, "identifier": [ { "system": "username", "value": "111316001" } ], "active": true, "name": [ { "text": "Will Smith" } ], "managingOrganization": { "reference": "Organization/MIPatientPortal", "display": "MI Patient Portal" } } ``` ::: :::spoiler DocumentReference/misac.documentreference01[(example)](https://203.64.84.150:58443/portaltest1/fhir/DocumentReference/136) ```gherkin= { "resourceType": "DocumentReference", "id": "136", "meta": { "versionId": "1", "lastUpdated": "2022-12-28T15:28:49.556+08:00", "source": "#Zb6J03TcNu1iSxWr" }, "status": "current", "subject": { "reference": "Patient/88df8172-9f58-4a0f-bcca-bcdcd5ea6485", "display": "Will Smith" }, "date": "2022-10-05T12:24:39", "author": [ { "reference": "Patient/88df8172-9f58-4a0f-bcca-bcdcd5ea6485", "display": "Will Smith" } ], "custodian": { "reference": "Organization/98a6f5c5-af58-41b5-bd6f-d8ca996b5580", "display": "MI Patient Portal" }, "content": [ { "attachment": { "url": "https://tzfhir.ml:53443/SkinlesionManagement/Image/82/28ef0930-1d64-45d1-9e47-60083058e9b0.jpg" } } ] } ``` ::: ##### 2. DocumentReference input by physician Doctor Will Smith want to shared his patient's skin leison image. So, his patient skin lesion image firstly need to be indexed using FHIR DocumentReference. :::spoiler DocumentReference/misac.documentreference01[(example)](https://203.64.84.150:58443/r5/fhir/DocumentReference/135) ```gherkin= { "resourceType": "DocumentReference", "id": "135", "meta": { "versionId": "1", "lastUpdated": "2022-12-28T15:28:00.173+08:00", "source": "#iM75I4QF9Amcwtpx" }, "status": "current", "subject": { "reference": "Patient/88df8172-9f58-4a0f-bcca-bcdcd5ea6485", "display": "Will Smith" }, "date": "2022-10-05T12:24:39", "author": [ { "reference": "PractitionerRole/af055cb6-bd06-4ce4-9967-90d4e9f25044", "display": "Will Smith" } ], "custodian": { "reference": "Organization/98a6f5c5-af58-41b5-bd6f-d8ca996b5580", "display": "MI Patient Portal" }, "content": [ { "attachment": { "url": "https://tzfhir.ml:53443/SkinlesionManagement/Image/82/28ef0930-1d64-45d1-9e47-60083058e9b0.jpg" } } ] } ``` ::: ## 5. Reference - [Who have access to your medical record](https://www.verywellhealth.com/who-has-access-to-your-medical-records-2615502#:~:text=Your%20healthcare%20providers%20have%20a,your%20records%20with%20that%20specialist.) ## 6. Demo - [Demo website](https://jeshika106316155.github.io/FHIR_DocumentReference/) - Github: https://github.com/jeshika106316155/FHIR_DocumentReference.git ## 6. Question - Can practitioners index patient/other people's documents?