Creating Observation FHIR Json using hourly data - hl7-fhir

I have a data in the following format csv format
where HR is heart rate, O2Sat is Oxygen Saturation, Temp is temperaute, ICULOS as ICU Length of Stay(showing hour number ranges from 1 to 100).
Now, i am trying to convert this to FHIR format. Since All these things come under observation, i am creating an observation template. For each column i am able to find a sample json where i can feed in the value.
I am not really sure how to interpret hourly data in FHIR. EffectiveTime, EffectivePeriod keys are not taking integer values and eventually failing in FHIR validation.
{
"resourceType": "Observation",
"id": "heart-rate",
"meta": {
"profile": [
"http://hl7.org/fhir/StructureDefinition/vitalsigns"
]
},
"status": "registered",
"category": [
{
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/observation-category",
"code": "vital-signs",
"display": "Vital Signs"
}
],
"text": "Vital Signs"
}
],
"code": {
"coding": [
{
"system": "http://loinc.org",
"code": "8867-4",
"display": "Heart rate"
}
],
"text": "Heart rate"
},
"subject": {
"reference": "Patient/example"
},
"effectiveDateTime": "1999-07-02",
"valueQuantity": {
"value": 0,
"unit": "beats/minute",
"system": "http://unitsofmeasure.org",
"code": "/min"
}
}
Can someone help me with the format to include hourly data and also how the json would be nested with multiple columns present in the figure ?
NOTE: ICULOS - has entry upto 100 hours.. For each hour values are denoted.

You would have a separate Observation for each measurement for each hour (with an appropirate effectiveDateTime indicating the specific time of each measurement). For example, you might have an effectiveDateTime of "1999-07-02T03:57:15" for the first and "1999-07-02T05:01:22" for the next. If you have no clue what time the measurements were made at and just have an hourly list, then simply go with "1999-07-02T00:00:00", "1999-07-02T01:00:00", etc.

Related

FHIR to OMOP Mapping Question: Blood pressure systolic and diastolic with unmapped, not valid code (55284-4)

There is a LOINC concept 55284-4 that appears in some FHIR resources, for example:
https://syntheticmass.mitre.org/v1/fhir/Patient/0000aa42-c235-4447-8389-8a2640f44466/$everything
This code is for "Blood pressure systolic and diastolic" and is in the OMOP concept table as shown below.
This concept is not a standard concept, is not a valid concept (from OMOP's perspective) and does not have a mapping to any standard concept in OMOP.
This concept appears in the FHIR resource in the snippet shown below (from the synthmass url shown above).
What records should be created in OMOP to represent the snippet shown below?
"resource": {
"category": [
{
"coding": [
{
"code": "vital-signs",
"display": "vital-signs",
"system": http://hl7.org/fhir/observation-category
}
]
}
],
"code": {
"coding": [
{
"code": "55284-4",
"display": "Blood Pressure",
"system": http://loinc.org
}
],
"text": "Blood Pressure"
},
"component": [
{
"code": {
"coding": [
{
"code": "8462-4",
"display": "Diastolic Blood Pressure",
"system": http://loinc.org
}
],
"text": "Diastolic Blood Pressure"
},
"valueQuantity": {
"code": "mmHg",
"system": http://unitsofmeasure.org,
"unit": "mmHg",
"value": 84.88290301982099
}
},
{
"code": {
"coding": [
{
"code": "8480-6",
"display": "Systolic Blood Pressure",
"system": http://loinc.org
}
],
"text": "Systolic Blood Pressure"
},
"valueQuantity": {
"code": "mmHg",
"system": http://unitsofmeasure.org,
"unit": "mmHg",
"value": 117.69213707496547
}
}
],
"context": {
"reference": "Encounter/52430cb1-a0d3-4d1e-926c-c878c218502e"
},
"effectiveDateTime": "2018-05-06T04:07:24-04:00",
"id": "186e8672-f9ac-4419-8c5d-1e824bf6e536",
"issued": "2018-05-06T04:07:24.278-04:00",
"meta": {
"lastUpdated": "2019-04-09T08:36:08.363897+00:00",
"versionId": "MTU1NDc5ODk2ODM2Mzg5NzAwMA"
},
"resourceType": "Observation",
"status": "final",
"subject": {
"reference": "Patient/0000aa42-c235-4447-8389-8a2640f44466"
}
}
EDIT: ADDITIONAL INFORMATION
It looks like these are probably commonly used concepts for blood pressure in OMOP
select
*
from
concept
where 1=1
and (
lower(concept_name) = 'systolic blood pressure' or
lower(concept_name) = 'diastolic blood pressure')
and domain_id = 'Measurement'
and standard_concept = 'S';
And there are lots of other potential candidates (about 380 of them):
select
*
from
concept
where 1=1
and lower(concept_name) like '%blood pressure%'
and domain_id = 'Measurement'
and standard_concept = 'S';
I would map it the same as if it was LOINC code 85354-9. However, you should file an issue with Synthea because using the code 55284-4 without also having a translation of 85354-9 is non-conformant. (All FHIR conformant systems conveying a combined 'blood pressure' Observation are required to adhere to this profile, which mandates the 85354-9 code.)

FHIR CodableConcept - All elements must be from ValueSet - Writing Profile Differential

I want to create a profile from base Observation, in that all code elements must be from the ValueSet. For example:
{
"resourceType": "Observation",
"id": "example",
"meta": {
"profile": ["http://my.own.profile/StructureDefinition/custom-observation-profile"]
}
...
"code": {
"coding": [
{
"system": "http://loinc.org",
"code": "8867-4",
"display": "Body Weight"
},
{
"system": "http://loinc.org",
"code": "9843-4",
"display": "Body Weight"
}
]
},
...
All the elements from code.coding should be from a valueset, lets say http://my.value.set
In the differential, I have the following:
{
"id": "Observation.code",
"path": "Observation.code",
"short": "Body Weight",
"type": [
{
"code": "CodeableConcept"
}
],
"binding": {
"strength": "required",
"description": "All LOINC values whose SCALE is DOC in the LOINC database and the HL7 v3 Code System NullFlavor concept 'unknown'",
"valueSet": "http://my.value.set"
}
},
But this one is validating only the first element in the list. It does not validate the other ones. It ignores even if they are invalid.
The list can be 1..*, and I want all of them should be from the valueSet.
How do I write differential for this one?
The expectation when there's a required binding on a CodeableConcept is that one of the CodeableConcept.coding repetitions must come from the binding. There's no requirement that the others must - and the primary use for additional codings is that you don't want them to be from the same value set. The purpose of additional codings is to convey other codes from other code systems that also convey the same meaning (so that other recipients of the instance who might not necessarily recognize the code preferred by your profile can still find a code they recognize - and also so that the 'original' coding can be retained in cases where that isn't from the bound value set).
If you truly want to force all CodeableConcept.coding repetitions to be from a single value set (strongly discouraged and likely to impede interoperability), you could declare a binding on Observation.code.coding.

Inserting multiple observation values in single resource - FHIR

I have hourly information for the patients heart rate like this
PID Hour HR
1 1 97
1 2 89
1 3 90
1 4 100
.....
.....
1 100 93
for each hour data i created json like this
# For Hour 1
{
"resourceType": "Observation",
"id": "heart-rate",
"meta": {
"profile": [
"http://hl7.org/fhir/StructureDefinition/vitalsigns"
]
},
"status": "final",
"category": [
{
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/observation-category",
"code": "vital-signs",
"display": "Vital Signs"
}
],
"text": "Vital Signs"
}
],
"code": {
"coding": [
{
"system": "http://loinc.org",
"code": "8867-4",
"display": "Heart rate"
}
],
"text": "Heart rate"
},
"subject": {
"reference": "Patient/example"
},
"effectiveDateTime": "2020-04-21T00:00:00+05:30",
"valueQuantity": {
"value": 97,
"unit": "beats/minute",
"system": "http://unitsofmeasure.org",
"code": "/min"
}
}
# Hour 2
{
"resourceType": "Observation",
"id": "heart-rate",
"meta": {
"profile": [
"http://hl7.org/fhir/StructureDefinition/vitalsigns"
]
},
"status": "final",
"category": [
{
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/observation-category",
"code": "vital-signs",
"display": "Vital Signs"
}
],
"text": "Vital Signs"
}
],
"code": {
"coding": [
{
"system": "http://loinc.org",
"code": "8867-4",
"display": "Heart rate"
}
],
"text": "Heart rate"
},
"subject": {
"reference": "Patient/example"
},
"effectiveDateTime": "2020-04-21T01:00:00+05:30",
"valueQuantity": {
"value": 89,
"unit": "beats/minute",
"system": "http://unitsofmeasure.org",
"code": "/min"
}
}
I created a resource bundle with 100 jsons nested inside entry and i am able to push it inside fhir-server.
{"resourceType": "Bundle", "type": "batch", "entry": [
The example given above is for one patient and one observation resource (heart-rate). I have more than 20000 patients with 50 different observation resource types.
Instead of creating 100 different json entries , is there any way to have one json representing 100 values. in value quantity if there is any way to have array of values mapped with timestamp. It would save lot of time.
For a single observation type and a single subject, if the observations are being made on a regular periodic basis, you can use the SampledData data type as the Observation.value. Typically that's for things like EKGs, fetal heart rate monitors, etc. which are sampling on a frequent basis, but nothing stops you from having a sampling period of an hour. However, if you don't have regular sampling, you must capture each as a distinct Observation. The reason is that we need to be able to extract the data however the user chooses to query it. The data needs to come in with the same sort of fine-grained organization that it might later need to go out. You might look at the Bulk Data API which uses LD-JSON to allow more efficient processing of large volumes of data.

Why Google Cloud Speech API doesn't transcript the whole audio file?

I'm trying to transcript a short interview audio file with Google Cloud Speech API (asynchronously) but it only transcribes the first half minute of the recording. I had several attempts with recordings longer than one minute and the results were the same. My question is, how can I achieve the full audio transcription for a given file?
You can find one of my use-cases here:
Upload the audio file:
POST https://speech.googleapis.com/v1beta1/speech:asyncrecognize?key={YOUR_API_KEY}
{
"config": {
"encoding": "LINEAR16",
"sampleRate": 16000,
},
"audio": {
"uri": "gs://protean-blend-146812.appspot.com/record__2017_02_02_12_02_17_greg_16000.wav",
}
}
Got the operation number in the response:
{
"name": "8977932499808116064"
}
Make a request with the operation number:
GET https://speech.googleapis.com/v1beta1/operations/8977932499808116064?key={YOUR_API_KEY}
Got the result:
{
"name": "8977932499808116064",
"metadata": {
"#type": "type.googleapis.com/google.cloud.speech.v1beta1.AsyncRecognizeMetadata",
"progressPercent": 100,
"startTime": "2017-02-02T11:21:41.346784Z",
"lastUpdateTime": "2017-02-02T11:23:03.150491Z"
},
"done": true,
"response": {
"#type": "type.googleapis.com/google.cloud.speech.v1beta1.AsyncRecognizeResponse",
"results": [
{
"alternatives": [
{
"transcript": "McGregor you have any stories about being lost that you have all the good advice well let me know in the Golden Triangle drug trafficking across the border",
"confidence": 0.8535113
}
]
},
{
"alternatives": [
{
"transcript": "we came across this Village very very poor Village People and some of the people there were really unfriendly they just started throwing rocks and my friend and we couldn't talk so we backed away went back quickly up the hill",
"confidence": 0.9027881
}
]
},
{
"alternatives": [
{
"transcript": "and we are wondering you know where to go and luckily I can see in the distance there in one tree",
"confidence": 0.8931573
}
]
}
]
}
}
The links, where I made the requests (at 'Try it!' section):
Upload: https://cloud.google.com/speech/reference/rest/v1beta1/speech/asyncrecognize
Operation response: https://cloud.google.com/speech/reference/rest/v1beta1/operations/get

Use a many to many relation in Elasticsearch

Currently we have a problem to perform a query (or more precisely to design a mapping) in elasticsearch, which help us to perform a query over a relational problem, that we didn't get solved with our non-document orientated thinking from sql.
We want to create a many-to-many relation between different Elasticsearch entries. We need this to edit an entry once and keep all using’s updated to this.
To describe the problem, we'll use the following simple data model:
Broadcast Content
------------ ---------
Id Id
Day Title
Contents [] Description
So we have two different types to index, broadcasts and contents.
A broadcast can have many contents and single contents could also be part of different broadcasts (e.g. repetition).
JSON like:
index/broadcasts
{
"Id": "B1",
"Day": "2014-10-15",
"Contents": [
"C1",
"C2"
]
}
{
"Id": "B2",
"Day": "2014-10-16",
"Contents": [
"C1",
"C3"
]
}
index/contents
{
"Id": "C1",
"Title": "Wake up",
"Description": "Morning show with Jeff Bridges"
}
{
"Id": "C2",
"Title": "Have a break!",
"Description": "Everything about Android"
}
{
"Id": "C3",
"Title": "Late Night Disaster",
"Description": "Comedy show"
}
Now we want to rename the "Late Night Disaster" into something more precisely and keep all references up to date.
How could we approach this? Are there fourther options in ES, like includes in RavenDB?
Nested objects or child-parent relations didn't helped us so far.
What about denormalizing? seems difficult if we come from the SQL mindset, but give you a try, even with millions of documents, LUCENE indexing can help, and renaming will be a batch job.
[
{
"Id": "B1",
"Day": "2014-10-15",
"Contents": [
{
"Title": "Wake up",
"Description": "Morning show with Jeff Bridges"
},
{
"Title": "Have a break!",
"Description": "Everything about Android"
}
]
},
{
"Id": "B2",
"Day": "2014-10-16",
"Contents": [
{
"Title": "Wake up",
"Description": "Morning show with Jeff Bridges"
},
{
"Title": "Late Night Disaster",
"Description": "Comedy show"
}
]
}
]

Resources