# Initial Patient Setup

**URL:** https://discourse.kitware.com/t/initial-patient-setup/1228
**Category:** Pulse Physiology Engine
**Created:** [February 27, 2024, 6:33am UTC](https://discourse.kitware.com/t/initial-patient-setup/1228 "2024-02-27T06:33:17Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![NucleusDev](https://discourse.kitware.com/letter_avatar_proxy/v4/letter/n/ba8739/32.png) [@NucleusDev](https://discourse.kitware.com/u/NucleusDev)
#### Post date: [February 27, 2024, 6:33am UTC](https://discourse.kitware.com/t/initial-patient-setup/1228/1 "2024-02-27T06:33:17Z")

</div>

So im trying to setup the patient programmatically in the UE5 plugin version of pulse.

1. IM not able to access the parameters provided in the JSON file
2. I need to set the conditions before i start the simulation but need to do it from CPP. Im not able to get a reference to the Condition. Please Advice

---

<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: [February 27, 2024, 1:51pm UTC](https://discourse.kitware.com/t/initial-patient-setup/1228/2 "2024-02-27T13:51:24Z")

</div>

We designed the Unreal Plugin to be initialized via state files that already have the conditions applied.

We do have these [UPulsePhysiologyEngine::InitializeFrom\*](https://gitlab.kitware.com/physiology/unreal/-/blob/main/PulsePhysiologyEngine/Source/PulseEngine/Private/PulsePhysiologyEngine.cpp?ref_type=heads#L289) methods. I would suggest creating a new method that would take in some representation of the conditions you want to apply and follow the [logic here](https://gitlab.kitware.com/physiology/engine/-/blob/stable/src/cpp/howto/HowTo-CreateAPatient.cpp) to properly initializing Pulse with those coditions. Pulse will look for the [directories and files it needs to initialize](https://gitlab.kitware.com/physiology/unreal/-/blob/main/PulsePhysiologyEngine/Source/PulseEngine/Private/PulsePhysiologyEngine.cpp?ref_type=heads#L289) in the application working directory. If you want to place those directories somewhere else, please call `pc.SetDataRoot` to tell Pulse the data directory to use before you call the `InitializeEngine` method.

I would probably look to replicate the [scenario engine driver](https://gitlab.kitware.com/physiology/unity/-/blob/main/Scripts/PulseEngineScenarioDriver.cs?ref_type=heads#L59) in our Unity plugin in our Unreal plugin.
