# Trouble loading a patient file

**URL:** https://discourse.kitware.com/t/trouble-loading-a-patient-file/614
**Category:** Pulse Physiology Engine
**Created:** [March 11, 2021, 11:31pm UTC](https://discourse.kitware.com/t/trouble-loading-a-patient-file/614 "2021-03-11T23:31:06Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![bob.marinier](https://discourse.kitware.com/letter_avatar_proxy/v4/letter/b/7ab992/32.png) [@bob.marinier](https://discourse.kitware.com/u/bob.marinier)
#### Post date: [March 11, 2021, 11:31pm UTC](https://discourse.kitware.com/t/trouble-loading-a-patient-file/614/1 "2021-03-11T23:31:06Z")

</div>

I’m trying to load a patient file (not a state file), but I cannot get it to actually work. I’m trying to run `HowTo_EngineUse`, modified to use the `PatientFile` case, and to provide the absolute path to a patient file in the `patient_configuration.setPatientFile` line, and it the engine initialization always returns false. There are no error messages to indicate what the problem is, and I have not been able to get visual studio to connect to the process with the symbols loaded, so I can’t step through it on the C++ side (which I’ve done before, so I’m not sure why it’s not working this time).

I’m on Windows 10 x64, building with VS2019. I’m using commit 4519dc8e76e5c533b269fdf399ffd5fe94d7eb64 from March 4.

Any ideas of what I should try?

Thanks!

---

<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: [March 11, 2021, 11:48pm UTC](https://discourse.kitware.com/t/trouble-loading-a-patient-file/614/2 "2021-03-11T23:48:59Z")

</div>

To create a new patient, you will need to ensure your [dataRootDir](https://gitlab.kitware.com/physiology/engine/-/blob/3.x/src/java/com/kitware/pulse/cdm/engine/SEPatientConfiguration.java#L19) is properly set to a directory where you have all [the folders full of json data files](https://gitlab.kitware.com/physiology/engine/-/wikis/how%20to%20connect%20to%20pulse#application-execution).

These directories should have been created in the install bin folder during the build

To get debug symbols, make sure you are loading the PulseJNId.dll by [telling Pulse to load the properly named dll](https://gitlab.kitware.com/physiology/engine/-/blob/3.x/src/java/com/kitware/pulse/utilities/JNIBridge.java#L16)

Let me know if you are still having trouble

---

<div class="post-metadata">

### Author: ![bob.marinier](https://discourse.kitware.com/letter_avatar_proxy/v4/letter/b/7ab992/32.png) [@bob.marinier](https://discourse.kitware.com/u/bob.marinier)
#### Post date: [March 12, 2021, 1:48pm UTC](https://discourse.kitware.com/t/trouble-loading-a-patient-file/614/3 "2021-03-12T13:48:53Z")

</div>

I’ve tried a few variants, none of which have worked:

```java
SEPatientConfiguration patient_configuration = new SEPatientConfiguration();
patient_configuration.setPatientFile("C:\\Users\\bob.marinier\\git\\isaac\\pulse-engine\\build\\install\\bin\\patients\\Bradycardic.json");
// Optionally add conditions to the patient_configuration

// Allocate an engine
pe.initializeEngine(patient_configuration, dataRequests);

```

```java
SEPatientConfiguration patient_configuration = new SEPatientConfiguration();
patient_configuration.setDataRootDir("C:\\Users\\bob.marinier\\git\\isaac\\pulse-engine\\build\\install\\bin\\patients\\");
patient_configuration.setPatientFile("Bradycardic.json");
// Optionally add conditions to the patient_configuration

// Allocate an engine
pe.initializeEngine(patient_configuration, dataRequests);

```

```java
SEPatientConfiguration patient_configuration = new SEPatientConfiguration();
patient_configuration.setDataRootDir("C:\\Users\\bob.marinier\\git\\isaac\\pulse-engine\\build\\install\\bin\\");
patient_configuration.setPatientFile("patients\\Bradycardic.json");
// Optionally add conditions to the patient_configuration

// Allocate an engine
pe.initializeEngine(patient_configuration, dataRequests);

```

I also tried it with forward slashes, with and without trailing slashes in the data root dir and leading slashes in the patient file.

---

<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: [March 12, 2021, 3:17pm UTC](https://discourse.kitware.com/t/trouble-loading-a-patient-file/614/4 "2021-03-12T15:17:44Z")

</div>

Try this:

```auto
SEPatientConfiguration patient_configuration = new SEPatientConfiguration();
patient_configuration.setDataRootDir("C:\\Users\\bob.marinier\\git\\isaac\\pulse-engine\\build\\install\\bin\\");
patient_configuration.setPatientFile("Bradycardic.json");

```

---

<div class="post-metadata">

### Author: ![bob.marinier](https://discourse.kitware.com/letter_avatar_proxy/v4/letter/b/7ab992/32.png) [@bob.marinier](https://discourse.kitware.com/u/bob.marinier)
#### Post date: [March 12, 2021, 3:26pm UTC](https://discourse.kitware.com/t/trouble-loading-a-patient-file/614/5 "2021-03-12T15:26:37Z")

</div>

That worked! Thanks!

---

<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: [March 12, 2021, 4:08pm UTC](https://discourse.kitware.com/t/trouble-loading-a-patient-file/614/6 "2021-03-12T16:08:38Z")

</div>

Great!

I obviously need to look at, clean up, and document the code to specify a file

---

<div class="post-metadata">

### Author: ![bob.marinier](https://discourse.kitware.com/letter_avatar_proxy/v4/letter/b/7ab992/32.png) [@bob.marinier](https://discourse.kitware.com/u/bob.marinier)
#### Post date: [March 12, 2021, 10:02pm UTC](https://discourse.kitware.com/t/trouble-loading-a-patient-file/614/7 "2021-03-12T22:02:56Z")

</div>

FWIW, it would be super helpful if the Java methods had Javadoc comments, because most IDEs will display those during autocomplete, which makes it easier to understand what a method does and what it’s arguments should be.
