# Data Request value checks

**URL:** https://discourse.kitware.com/t/data-request-value-checks/1182
**Category:** Pulse Physiology Engine
**Created:** [January 2, 2024, 1:38pm UTC](https://discourse.kitware.com/t/data-request-value-checks/1182 "2024-01-02T13:38:44Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![NucleusDev1](https://discourse.kitware.com/letter_avatar_proxy/v4/letter/n/e68b1a/32.png) [@NucleusDev1](https://discourse.kitware.com/u/NucleusDev1)
#### Post date: [January 2, 2024, 1:38pm UTC](https://discourse.kitware.com/t/data-request-value-checks/1182/1 "2024-01-02T13:38:44Z")

</div>

I was working with Data Requests and Data Request Manager in unreal cpp, How exactly, are we supposed to get the values for lets say a data request created for HeartRate from SEDataRequest/SEDataRequestManager ? I see there’s a SEValidationTarget class too. Just need some clarity on how to efficiently use DataRequests.

Thanks in advance

---

<div class="post-metadata">

### Author: ![abray](https://discourse.kitware.com/user_avatar/discourse.kitware.com/abray/32/12_2.png) [@abray](https://discourse.kitware.com/u/abray)
#### Post date: [January 2, 2024, 2:24pm UTC](https://discourse.kitware.com/t/data-request-value-checks/1182/2 "2024-01-02T14:24:36Z")

</div>

Since you are using C++ via Unreal, you don’t need to use data requests unless you want Pulse to write out a csv file for you. Data requests are used as a “thunking” mechanism between the C++ API and the C, Java, C#, Python languages.

So you can use the C++ API directly to control the engine and access data.  
I will be posting the latest Unreal plugin this week, but you can get it [here from our repository](https://gitlab.kitware.com/physiology/unreal/-/tree/main?ref_type=heads)

The plugin also has a bit of example code for creating a Pulse module that demonstrates using the Pulse API. [In this method you can see how to pull data specific to our vitals monitor.](https://gitlab.kitware.com/physiology/unreal/-/blob/main/PulsePhysiologyEngine/Source/PulseEngine/Private/ExamplePulseComponent.cpp?ref_type=heads#L110). This repository also provides a super simple unreal project using this example Pulse module for various unreal versions.

We also have a folder of C++ files showing how to use the engine in various ways.  
[Start with this file](https://gitlab.kitware.com/physiology/engine/-/blob/stable/src/cpp/howto/HowTo-EngineUse.cpp?ref_type=heads), and you can look around that same folder for anything more specific you may want.

More documentaion can be [found here](https://pulse.kitware.com/_docs.html). The Common Data Model and Integration sections should give more details on using the API

---

<div class="post-metadata">

### Author: ![NucleusDev1](https://discourse.kitware.com/letter_avatar_proxy/v4/letter/n/e68b1a/32.png) [@NucleusDev1](https://discourse.kitware.com/u/NucleusDev1)
#### Post date: [January 3, 2024, 5:05am UTC](https://discourse.kitware.com/t/data-request-value-checks/1182/3 "2024-01-03T05:05:30Z")

</div>

Hi Abray, thanks for your response.

I am aware that we can directly use the relevant systems to retrieve whatever data we need from the engine. We are using standardmale.json file to initialize the patient and also looking for a generic way to retrieve patient data which we thought Data Request could give us since they require a string identifier to search. So I was wondering how do I get the value of a data request within cpp ?

---

<div class="post-metadata">

### Author: ![abray](https://discourse.kitware.com/user_avatar/discourse.kitware.com/abray/32/12_2.png) [@abray](https://discourse.kitware.com/u/abray)
#### Post date: [January 3, 2024, 4:55pm UTC](https://discourse.kitware.com/t/data-request-value-checks/1182/4 "2024-01-03T16:55:10Z")

</div>

I updated the HowTo-EngineUse.cpp to demonstrate this

The engine tracker uses the data request to pull data and write to the csv file.  
The tracker is mapping the memory address of the data request to the scalar class held on the systems and compartment.

So you should:

1. [Save off the data requests or (pointers to them) you create](https://gitlab.kitware.com/physiology/engine/-/blob/integration/src/cpp/howto/HowTo-EngineUse.cpp?ref_type=heads#L162)
2. [Get the value of that data request via the engine tracker](https://gitlab.kitware.com/physiology/engine/-/blob/integration/src/cpp/howto/HowTo-EngineUse.cpp?ref_type=heads#L272)

The engine tracker just grabs the SEScalar associated with that data request address and pulls the value from that scalar in the unity you specified. If you don’t specifiy a unit, it will be in the unit the engine uses… which you would have to figure out… I’d suggest looking at the `SEEngineTracker::GetScalar` method and look at what unit is on the returned `SEDataRequestScalar`

---

<div class="post-metadata">

### Author: ![NucleusDev1](https://discourse.kitware.com/letter_avatar_proxy/v4/letter/n/e68b1a/32.png) [@NucleusDev1](https://discourse.kitware.com/u/NucleusDev1)
#### Post date: [January 4, 2024, 12:31pm UTC](https://discourse.kitware.com/t/data-request-value-checks/1182/5 "2024-01-04T12:31:46Z")

</div>

Hey Aaron,(sorry for calling you abray)

Thanks for the help, that seemed to have done the trick. I am able to retrieve the value from those data requests!

---

<div class="post-metadata">

### Author: ![abray](https://discourse.kitware.com/user_avatar/discourse.kitware.com/abray/32/12_2.png) [@abray](https://discourse.kitware.com/u/abray)
#### Post date: [January 4, 2024, 1:31pm UTC](https://discourse.kitware.com/t/data-request-value-checks/1182/6 "2024-01-04T13:31:05Z")

</div>

Great!

abray is fine.

There are a lot of nooks and crannies to our API, so let us know if you have any more of these “is a way to get that from here”, there might be… And we can always make a new path!
