---
title: "Creating Test results"
canonical: "https://wiki.patientsknowbest.com/space/api/5299208244/Creating%20Test%20results"
format: markdown
---
> Macro (toc)

> Macro (excerpt)
> 
> # How
> 
> 1. When you send the [Observation resource](https://hl7.org/fhir/R4/observation.html), you will assign it a **[logical id](https://wiki.hub.patientsknowbest.com/wiki/spaces/api/pages/5003673621)****.**
> 2. Reference the logical ID of a previously created Patient resource in the **subject** field of the Observation.
> 3. A status must be included.  See the FHIR R4 spec for the [status value set](https://hl7.org/fhir/R4/valueset-medication-statement-status.html).
> 4. A category must be included. For test results, this category should be ‘laboratory'.
> 5. Include any other information in the Observation, using coding when possible. Test results should have LOINC codes and appropriate units.
> 6. POST https://<client><u>.fhir-api.sandbox.patientsknowbest.com/fhir/Observation</u>

> Macro (excerpt)
> 
> Very basic Observation resource example (with no coding):
> 
> ```
> {
>   "resourceType": "Observation",
>   "status": "final",
>   "id": "<Client assigned resource ID>", 
>   "category": [
>     {
>       "coding": [
>         {
>           "system": "http://terminology.hl7.org/CodeSystem/observation-category",
>           "code": "laboratory",
>           "display": "Laboratory"
>         }
>       ],
>       "text": "Laboratory"
>     }
>   ],
>   "code": {
>     "coding": [
>       {
>         "display": "C reactive protein"
>       }
>     ]
>   },
>   "subject": {
>     "reference": "Patient/<Client assigned Patient resource ID>"
>   },
>   "effectiveDateTime": "2026-05-03",
>   "valueQuantity": {
>     "unit": "mg/L",
>     "value": 3.3
>   },
>   "interpretation": [
>     {
>       "text": "Normal"
>     }
>   ],
>   "referenceRange": [
>     {
>       "low": {
>         "value": 3
>       },
>       "high": {
>         "value": 5
>       },
>       "text": "3.0-5.0"
>     }
>   ]
> }
> ```
> 
> 
> Very basic Observation resource example (with local coding):
> 
> ```
> {
>   "resourceType": "Observation",
>   "status": "final",
>   "id": "<Client assigned resource ID>", 
>   "category": [
>     {
>       "coding": [
>         {
>           "system": "http://terminology.hl7.org/CodeSystem/observation-category",
>           "code": "laboratory",
>           "display": "Laboratory"
>         }
>       ],
>       "text": "Laboratory"
>     }
>   ],
>   "code": {
>     "coding": [
>       {
>         "system": "<my-local-code-system>",
>         "code": "54563",
>         "display": "C reactive protein"
>       }
>     ]
>   },
>   "subject": {
>     "reference": "Patient/<Client assigned Patient resource ID>"
>   },
>   "effectiveDateTime": "2026-05-03",
>   "valueQuantity": {
>     "unit": "mg/L",
>     "value": 3.3
>   },
>   "interpretation": [
>     {
>       "text": "Normal"
>     }
>   ],
>   "referenceRange": [
>     {
>       "low": {
>         "value": 3
>       },
>       "high": {
>         "value": 5
>       },
>       "text": "3.0-5.0"
>     }
>   ]
> }
> ```
> 
> Very basic Observation resource example (with LOINC coding):
> 
> ```
> {
>   "resourceType": "Observation",
>   "id": "<Client assigned logical id>", 
>   "status": "final",
>   "category": [
>     {
>       "coding": [
>         {
>           "system": "http://terminology.hl7.org/CodeSystem/observation-category",
>           "code": "laboratory",
>           "display": "Laboratory"
>         }
>       ],
>       "text": "Laboratory"
>     }
>   ],
>   "code": {
>     "coding": [
>       {
>         "system": "http://loinc.org",
>         "code": "1988-5",
>         "display": "C reactive protein [Mass/volume] in Serum or Plasma"
>       }
>     ]
>   },
>   "subject": {
>     "reference": "Patient/<Client assigned Patient resource logical ID>
>   },
>   "effectiveDateTime": "2026-05-03",
>   "valueQuantity": {
>     "unit": "mg/L",
>     "value": 3.3
>   },
>   "interpretation": [
>     {
>       "text": "Normal"
>     }
>   ],
>   "referenceRange": [
>     {
>       "low": {
>         "value": 3
>       },
>       "high": {
>         "value": 5
>       },
>       "text": "3.0-5.0"
>     }
>   ]
> }
> ```