# FHIR OBSERVATION for Image Finding
###### Background:

<center>Figure 3. Image annotation</center>
`Situation:`
> Doctors sometimes diagnose and treat diseases based on the patient's medical imaging.
> The Radiologist is the doctor who supervises these exams, reads, interprets the images, and writes a report to the main doctor.
> When a radiologist wants to make a report of a medical image (CT, MRI, X-Ray, etc). Doctor need to display medical imaging,
then annotate the abnormality occurence on the image, once there is an annotation, the doctor can write a image finding report based on the annotation.
> * ==From the perspective of FHIR Resource==, FHIR ImagingStudy must be established before FHIR Observation for record anotation be established, and FHIR Observation for image finding can be established only after FHIR Observation for annotation is established
> * FHIR Observation (annotation) will refer to FHIR ImagingStudy and FHIR Observation (image finding) will refer to FHIR Observation (annotation) ([Figure 1.](https://hackmd.io/zd9YYcQuTfSm3-HX9WF0ug?both#Background))
`You need to know...`

## :memo: FHIR OBSERVATION INTRODUCTION
### What is FHIR Observation?
* A resource used for ==capturing measurements== and subjective point-in-time assessments which can support <ins>diagnosis and monitor progress</ins>
* ==FHIR Observation== can be use to record:
+ Vital signs such as body weight, blood pressure, and temperature
+ Laboratory Data like blood glucose, or an estimated GFR
+ Imaging results like bone density or fetal measurements
+ Clinical Findings* such as abdominal tenderness
+ Device measurements such as EKG data or Pulse Oximetry data
+ Clinical assessment tools such as APGAR or a Glasgow Coma Score
+ Personal characteristics: such as eye-color
+ Social history like tobacco use, family support, or cognitive status
+ Core characteristics like pregnancy status, or a death assertion
* FHIR Observation is ==XML/JSON formated==
* FHIR Observation is ==not intended== to be used for those specific contexts and use cases already covered by other FHIR resources, such as patient allergies ([AllergyIntolerance](https://www.hl7.org/fhir/allergyintolerance.html)), patient medications ([MedicationStatement](https://www.hl7.org/fhir/medicationstatement.html)), patient's family history ([FamilyMemberHistory](https://build.fhir.org/familymemberhistory.html)), procedure ([Procedure](https://www.hl7.org/fhir/procedure.html)), set of answers to a set of questions([QuestionnaireResponse](https://www.hl7.org/fhir/questionnaireresponse.html)), patient condition ([Condition](https://www.hl7.org/fhir/condition.html))
* FHIR Observation is ==often referenced== by the ([Condition](https://www.hl7.org/fhir/condition.html)) and [DiagnosticReport](https://www.hl7.org/fhir/diagnosticreport.html) resource for record specific subjective and objective data to support its assertions
[FHIR Observation 參考](https://www.hl7.org/fhir/observation.html)
### When do we use FHIR Document?
* When you want to ==collect information== from a ==measurement or observation==
Example: body weight, blood pressure
## :memo: Other Resources and Element used by FHIR Observation (for Image Finding Report)
### [FHIR Observation](https://www.hl7.org/fhir/observation.html) Main Element (for image finding report)
| Element Name | Definition | Value | Necessary |
|:------------------------------------------------------ | ------------------------------------------------------------------------------------------- |:----------------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
| resourceType | Resource type | Observation | R |
| [identifier](https://hackmd.io/@w7Qw2wVXT6-Smrvv3RWxEQ/S1YbQmwzY?both#Bundle-required-to-have-identifier-contain-system-amp-value) | digital certificate number | Measurement ID number| R |
| identifier[0].system | Before the government decide to unified and standardized, it is recommended to obtain the website of the institute who create the observation | http://127.0.0.1:5500/MedicalImagingExamWorkflow-main/findingReport/MammoMass.html | R |
| identifier[0].value | Global ==unique identification code==, suggestion: Indonesia.MedicalInstitutionCode. IssueDate.Year.Month.Day.Hour.Minute.Second.Millisecond.SerialNumber, or custom unique identification code | IDN.0617060018.20210722143000888.001, mass | R |
| status | The status of the result value | registered, preliminary, final, amended + | R |
| code | Type of observation (code / type) | | R |
| code.coding[0].system | Website url of the code system that identify the code | http://hl7.org/fhir/STU3/valueset-observation-codes.html | R |
| code.coding[0].code | The code of observation type | RID39055 | R |
| code.coding[0].display | The display name of the observation type | Physical findings of Breasts Narrative | R |
| subject | The subject of the observation | Other resources : Group, Patient, Devive, Location (Ex: Patient/7405) | R |
| derivedFrom[0].reference | Related annotation the observation report is made from | Observation/7411 | R |
| component | To record multi measurment result | | O |
#### FHIR Observation additional element for **Mammo Mass** Image Finding report

| Element Name | Definition | Value | Necessary |
|:------------------------------------------------------ | ------------------------------------------------------------------------------------------- |:----------------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
|... (Observation for image finding report) | | | |
| component[0].code.coding[0].system | Website url of codesystem/valueset used to define Bodysite literality value | http://hl7.org/fhir/valueset-bodysite-laterality.html | R |
| component[0].code.coding[0].code | Bodysite literality code value | MB | R |
| component[0].code.coding[0].display | The display name of the bodysite laterality value | Bilateral | R |
| component[1].code.fhir_comments | Fhir comment used to describe the component | Location | R |
| component[1].code.coding[0].system | Website url of codesystem/valueset used to define Location value | http://203.64.84.218/mammoDicomWebviewer/newCodeSystem/LocationCS.html | R |
| component[1].code.coding[0].code | Location code value | breast.left.uoq | R |
| component[1].code.coding[0].display | The display name of the location value | Upper outer quadrant of left breast | R |
| component[2].code.coding[1].fhir_coments | Fhir comment used to describe the component | One view Only | R |
| component[2].code.coding[1].system | Website url of codesystem/valueset used to define location value | HemisphereCS | R |
| component[2].code.coding[1].code | Hemisphere code value | UH | R |
| component[2].code.coding[1].display | The display name of the hemisphere value | Upper_hemisphere | R |
| component[3].code.coding[0].system | Website url of codesystem/valueset used to define size value | SizeCS | R |
| component[3].code.coding[0].code | Size code value | 3-4 cm | R |
| component[3].code.coding[0].display | The display name of the size value | 3-4 cm | R |
| component[4].code.coding[0].system | Website url of codesystem/valueset used to define shape value | http://hl7.org/fhir/us/breast-radiology/2019Sep/ValueSet-breastrad-ShapeVS.html | R |
| component[4].code.coding[0].code | Shape code value | IrregularShape | R |
| component[4].code.coding[0].display | The display name of the shape value | Neither round nor oval | R |
| component[5].code.coding[0].system | Website url of codesystem/valueset used to define margin value | http://hl7.org/fhir/us/breast-radiology/2019Sep/ValueSet-breastrad-MarginVS.html | R |
| component[5].code.coding[0].code | Margin code value | ObscuredMargin | R |
| component[5].code.coding[0].display | The display name of the margin value | ObscuredMargin | R |
| component[6].code.coding[0].system | Website url of codesystem/valueset used to define density value | http://hl7.org/fhir/us/breast-radiology/2019Sep/ValueSet-breastrad-AbnormalityDensityVS.html | R |
| component[6].code.coding[0].code | Density code value | FatContaining | R |
| component[6].code.coding[0].display | The display name of the density value | Includes all masses containing fat, such as oil cyst, lipoma, or galactocele as well as mixeddensity lesions such as hamartoma. | R |
Click here to look up [FHIR Observation (Image Finding Report) example](http://203.64.84.213:8080/fhir//Observation/7412).
### [FHIR Observation](https://www.hl7.org/fhir/observation.html) Main Element (for annotation)

| Element Name | Definition | Value | Necessary |
|:------------------------------------------------------ | ------------------------------------------------------------------------------------------- |:----------------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
| resourceType | Resource type | Observation | R |
| [identifier](https://hackmd.io/@w7Qw2wVXT6-Smrvv3RWxEQ/S1YbQmwzY?both#Bundle-required-to-have-identifier-contain-system-amp-value) | digital certificate number | Measurement ID number| R |
| identifier[0].system | Before the government decide to unified and standardized, it is recommended to obtain the website of the institute who create the observation | http://127.0.0.1:5500/MedicalImagingExamWorkflow/systemA.html | R |
| identifier[0].value | Global ==unique identification code==, suggestion: Indonesia.MedicalInstitutionCode. IssueDate.Year.Month.Day.Hour.Minute.Second.Millisecond.SerialNumber, or custom unique identification code | IDN.0617060018.20210722143000888.001, 1.3.6.1.4.1.5962.99.1.392793638.85272995.1542286085670.3.0 | R |
| basedOn | The reason for doing measurement (fulfills plan, proposal or order) | Other resources : CarePlan, MedicalRequest, DeviceRequest, etc | R |
| status | The status of the result value | registered, preliminary, final, amended + | R |
| category | Classification of type of observation | https://www.hl7.org/fhir/valueset-observation-category.html | R |
| category[0].coding[0].system | Website url of the code system that identify the code | https://www.dicom.org.tw/cs/imaging | R |
| category[0].coding[0].code | The code of observation type | imaging | R |
| code | Type of observation (code / type) | | R |
| code.coding[0].system | Website url of the code system that identify the code | https://www.dicom.org.tw/cs/imaging | R |
| code.coding[0].code | The code of observation type | MR | R |
| subject | The subject of the observation | Other resources : Group, Patient, Devive, Location (Ex: Patient/7405) | R |
| derivedFrom[0].reference | Related annotation the observation report is made from | ImagingStudy/757 | R |
| component | To record multi measurment result | | O |
#### FHIR Observation additional element for **Annotation**
| Element Name | Definition | Value | Necessary |
|:------------------------------------------------------ | ------------------------------------------------------------------------------------------- |:----------------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
|... (Observation for annotation) | | | |
| component[0].code.coding[0].system | Website url of codesystem/valueset used to define SVG value | https://www.dicom.org.tw/SVG | R |
| component[0].code.coding[0].code | SVG code value | SVG.Annotation | R |
| component[0].code.coding[0].display | The display name of the SVG value | SVG Annotation | R |
| component[0].valueString | SVG string value | PHN2ZyB3aWR0aD0iMTkxNCIgaGVpZ2h0PSI2MDAiPjxsaW5lIHgxPSIxMjE3IiB5MT0iNzc5IiB4Mj0iMTQxNiIgeTI9IjEzODQiIHN0cm9rZT0iYmxhY2siIHN0cm9rZS13aWR0aD0iMiIgZmlsbD0ibm9uZSIvPjwvc3ZnPg== | R |
| component[1].code.coding[0].system | Website url of codesystem/valueset used to define columns value | https://www.dicom.org.tw/Columns | R |
| component[1].code.coding[0].code | Columns code value | Columns | R |
| component[1].code.coding[0].display | The display name of the columns value | viewPort.sx | R |
| component[1].valueString | Viewport.sx string value | 1914 | R |
| component[2].code.coding[1].system | Website url of codesystem/valueset used to define rows value | https://www.dicom.org.tw/Rows | R |
| component[2].code.coding[1].code | Rows code value | Rows | R |
| component[2].code.coding[1].display | The display name of the rows value | viewPort.sy | R |
| component[2].valueString | Viewport.sy string value | 2294 | R |
| component[3].code.coding[0].system | Website url of codesystem/valueset used to define window level value | https://www.dicom.org.tw/WindowLevel | R |
| component[3].code.coding[0].code | Window level code value | WindowCenter | R |
| component[3].code.coding[0].display | The display name of the window level value | WindowCenter | R |
| component[3].valueString | Window center string value | 2587 | R |
| component[4].code.coding[0].system | Website url of codesystem/valueset used to define window level value | https://www.dicom.org.tw/WindowLevel | R |
| component[4].code.coding[0].code | Window level code value | WindowWidth | R |
| component[4].code.coding[0].display | The display name of the window level value | WindowWidth | R |
| component[4].valueString | Window width string value | 900 | R |
| component[5].code.coding[0].system | Website url of codesystem/valueset used to define OffsetOfPixelData value | "https://www.dicom.org.tw/OffsetOfPixelData | R |
| component[5].code.coding[0].code | OffsetOfPixelData code value | OffsetOfPixelData | R |
| component[5].valueString | OffsetOfPixelData string value | 29247 | R |
| component[6].code.coding[0].system | Website url of codesystem/valueset used to define Dicom file value | https://www.dicom.org.tw/DCM_File | R |
| component[6].code.coding[0].code | Dicom file code value | DCM File | R |
| component[6].code.coding[0].display | The display name of the Dicom file value | DCM File | R |
| component[6].valueString | Dicom file string value | http://203.64.84.218:8080/orthanc/dicom-web/studies/1.3.6.1.4.1.5962.99.1.392793638.85272995.1542286085670.4.0/series/1.3.6.1.4.1.5962.99.1.392793638.85272995.1542286085670.5.0/instances/1.3.6.1.4.1.5962.99.1.392793638.85272995.1542286085670.3.0 | R |
Click here to look up [FHIR Observation for annotation example](http://203.64.84.213:8080/fhir//Observation/7411).
### [FHIR ImagingStudy](https://www.hl7.org/fhir/imagingstudy.html) Main Element
| Element Name | Definition| Value | Necessary |
|:------------------------------------------------------ | ------------------------------------------------------------------------------------------- |:----------------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
| resourceType | Resource type | ImagingStudy | R |
| [identifier](https://hackmd.io/@w7Qw2wVXT6-Smrvv3RWxEQ/S1YbQmwzY?both#Bundle-required-to-have-identifier-contain-system-amp-value) | Identifiers for the whole study | Dicom study UID| R |
| identifier[0].system | Before the government decide to unified and standardized, it is recommended to obtain the website of the institute who create the Dicom UID | urn:dicom:uid | R |
| identifier[0].value | Dicom UID value| urn:oid:1.3.6.1.4.1.5962.99.1.392793638.85272995.1542286085670.4.0 | R |
| status | The [status](https://www.hl7.org/fhir/valueset-imagingstudy-status.html) of the imaging study | registered, available, cancelled, entered-in-error, unknown | R |
| subject | The subject of the observation | Other resources : Group, Patient, Devive (Ex: Patient/TCUMI106.2714178950844984) | R |
| started | 疫苗名稱 | Ex: AZD1222, BNT162b2, mRNA-1273, MVC-COV1901 | R |
| numberOfSeries | 製造商 | display=AstraZeneca, Pfizer BioNTech, Moderna Biotech, Medigen | R |
| numberOfInstances | 劑別 | 2 | R |
| series | 完整劑數 | 2 | R |
Click here to look up [FHIR Observation fo Annotation example](http://203.64.84.213:8080/fhir//Observation/7409).
### [FHIR PATIENT](https://www.hl7.org/fhir/patient.html) 主要欄位
| 欄位 | 定義 | 資料值 |採用必要 |
|:-------------------------------------------------- | -------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
| resourceType | Resource 種類 | Patient | R |
| name[0] | Name | Currently in Taiwan, Chinese name is used. Family, given name (when able to distinguish), text for full name | R |
| name[1] | English name | 若出國使用需求由民眾提供護照姓名 | O |
| identifier[0] | Domestic identification ID | Temporarily use MI-TW or ID card number | R |
| identifier[1] | Foreign identification ID | Temporarily use MI-TW, or Passport | O |
| gender | gender | male, female, other, unknown | R |
| address.country | 國籍 | TW (ISO 3166) 暫時先簡化實作 | R |
| birthDate | 出生年月日 | 2000-09-09 | R |
Click here to look up [FHIR PATIENT example](http://203.64.84.213:8080/fhir//Patient/7405).
### [FHIR ORGANIZATION](https://www.hl7.org/fhir/organization.html) 主要欄位
| 欄位 | 定義 | 資料值 |採用必要 |
|:-------------------------------------------------- | -------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
| resourceType | Resource 種類 | Organization | R |
| identifier[0].system |機構代碼系統 | https://ma.mohw.gov.tw | R |
| identifier[0].value | 機構代碼值 | 醫事機構代碼 | R |
| identifier[0] | 國內身分識別ID | 暫用MI-TW | R |
| name | 機構名稱 | 建議中英文名稱都放此 | R |
| alias | 機構別稱 | 有需要切換中英文或簡稱時使用 |
| address.country | 機構國籍 | TW (ISO 3166) | R |
Click here to look up [FHIR ORGANIZATION example](http://203.64.84.213:8080/fhir/Organization/3698).
### FHIR Document structure
[FHIR Document JSON format example](http://203.64.84.213:8080/fhir/Bundle/3702)
#### A **Bundle** of resources of ==type "document"==
```json=17
"type": "document",
```
#### Has a **Composition resource** as the ==first resource in the bundle entry==
```json=18
"entry": [
{
"fullUrl": "urn:uuid:b1995ae1-0c52-48cb-b019-afbfc6f92881",
"resource": {
"resourceType": "Composition",
...
```
* **Composition resource** contain ==reference to series of other FHIR resources==
```json=43
"section": [
{
"entry": [
{
"reference": "urn:uuid:e2326984-eabb-11eb-9a03-0242ac130003"
},
{
"reference": "urn:uuid:c6371c72-eac3-11eb-9a03-0242ac130003"
},
{
"reference": "urn:uuid:45a5c5b1-4ec1-4d60-b4b2-ff5a84a41fd"
}
]
}
]
```
#### Series of other resources contain in followed bundle entry
```json=59
...
{
"fullUrl": "urn:uuid:45a5c5b1-4ec1-4d60-b4b2-ff5a84a41fd",
"resource": {
"resourceType": "Organization",
...
```
```json=77
...
{
"fullUrl": "urn:uuid:e2326984-eabb-11eb-9a03-0242ac130003",
"resource": {
"resourceType": "Patient",
...
```
```json=118
...
{
{
"fullUrl": "urn:uuid:c6371c72-eac3-11eb-9a03-0242ac130003",
"resource": {
"resourceType": "Immunization",
...
```
#### Bundle required to have **identifier** (contain ==system & value==)
```json=9
"identifier": {
"system": "https://www.vghtc.gov.tw",
"value": "TW.0617060018.20210722143000888.001",
...
```
* Once a FHIR Document is created, the content **cannot be changed**
If you want to change the content, you need to ==create a new FHIR Document==
## :memo: 疫苗證書Resource關聯性
- 1-2-3-4 代表建立資料(Resources)的循序
==FHIR Organization Resources== used to store hospital information are created first, then ==FHIR Patient Resource== is created secondly to store patient data, after that, ==FHIR Immunization Resource== is established to store immunization information carried out by patients of a hospital.
Once the FHIR Immunization Resource created, the ==FHIR Composition Resource== can be generate to store the set of healthcare-related information (Imunization-Patient-Organization information) that is assembled together for content necessary for a FHIR Document resource.
- This article describes the establishment of the ==FHIR Resource Document for Immunization certificates==. However, FHIR Documents can also be used to create ==a set information of an observation==. With ==Organization, Patient, and Observation Resource== as the composition of the FHIR Composition Resource.

- FHIR DOCUMENT display

- 範例連結
- Organization: http://203.64.84.213:8080/fhir/Organization/45a5c5b1-4ec1-4d60-b4b2-ff5a84a41fd7
- Patient: http://203.64.84.213:8080/fhir/Patient/e2326984-eabb-11eb-9a03-0242ac130003
- Immunization: http://203.64.84.213:8080/fhir/Immunization/c6371c72-eac3-11eb-9a03-0242ac130003
- Composition: http://203.64.84.213:8080/fhir/Composition/b1995ae1-0c52-48cb-b019-afbfc6f92881
- Bundle Document: http://203.64.84.213:8080/fhir/Bundle/MI-TW-bundle-document-sample
## :memo: FHIR DOCUMENT REST API
FHIR DOCUMENT search parameter,[this](https://www.hl7.org/fhir/bundle.html)。
| Http Operation | <font color="blue">Service Base</font><font color="green">/Resource</font><font color="orange">/ID</font> | <font color="purple">Method</font> |
|:-------------------------------------------------- | -------------------- | --------------------------------------------------------------------------------------------------------------- |
| Post | <font color="blue">http://fhir.base.root</font><font color="green">/Bundle</font> | <font color="red">C</font><font color="purple">reate</font> |
| Get |<font color="blue">http://fhir.base.root</font><font color="green">/Bundle</font><font color="orange">/ID</font>, <font color="blue">http://fhir.base.root</font><font color="green">/Bundle</font><font color="orange">?condition=parameter</font>| <font color="red">R</font><font color="purple">ead</font> |
## :memo: DEMO & 練習
- Please click on the link, [this](https://hackmd.io/@w7Qw2wVXT6-Smrvv3RWxEQ/r1ghIOr4F).