Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions src/native/common.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use chrono::{DateTime, Utc};
use serde::Deserialize;
use serde::{Deserialize, Serialize};

#[cfg(feature = "python")]
use pyo3::{prelude::*, types::PyDateTime};
Expand All @@ -13,7 +13,7 @@ use crate::native::deserializers::{
use crate::native::deserializers::{to_py_datetime, to_py_datetime_option};

#[cfg(not(feature = "python"))]
#[derive(Debug, Deserialize, PartialEq)]
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct Value {
pub by: String,
Expand All @@ -31,7 +31,7 @@ pub struct Value {
}

#[cfg(feature = "python")]
#[derive(Clone, Debug, Deserialize, PartialEq)]
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
#[serde(rename_all = "camelCase")]
#[pyclass]
pub struct Value {
Expand Down Expand Up @@ -79,7 +79,7 @@ impl Value {
}

#[cfg(not(feature = "python"))]
#[derive(Debug, Deserialize, PartialEq)]
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct Reason {
pub by: String,
Expand All @@ -98,7 +98,7 @@ pub struct Reason {
}

#[cfg(feature = "python")]
#[derive(Clone, Debug, Deserialize, PartialEq)]
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
#[serde(rename_all = "camelCase")]
#[pyclass]
pub struct Reason {
Expand Down Expand Up @@ -147,7 +147,7 @@ impl Reason {
}

#[cfg(not(feature = "python"))]
#[derive(Debug, Deserialize, PartialEq)]
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct Entry {
#[serde(alias = "id")]
Expand All @@ -157,7 +157,7 @@ pub struct Entry {
}

#[cfg(feature = "python")]
#[derive(Clone, Debug, Deserialize, PartialEq)]
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
#[serde(rename_all = "camelCase")]
#[pyclass(get_all)]
pub struct Entry {
Expand All @@ -168,7 +168,7 @@ pub struct Entry {
}

#[cfg(not(feature = "python"))]
#[derive(Debug, Deserialize, PartialEq)]
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct Field {
pub name: String,
Expand All @@ -190,7 +190,7 @@ pub struct Field {
}

#[cfg(feature = "python")]
#[derive(Clone, Debug, Deserialize, PartialEq)]
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
#[serde(rename_all = "camelCase")]
#[pyclass]
pub struct Field {
Expand Down Expand Up @@ -253,7 +253,7 @@ impl Field {
}

#[cfg(not(feature = "python"))]
#[derive(Debug, Deserialize, PartialEq)]
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct Category {
pub name: String,
Expand All @@ -268,7 +268,7 @@ pub struct Category {
}

#[cfg(feature = "python")]
#[derive(Clone, Debug, Deserialize, PartialEq)]
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
#[serde(rename_all = "camelCase")]
#[pyclass(get_all)]
pub struct Category {
Expand All @@ -284,7 +284,7 @@ pub struct Category {
}

#[cfg(not(feature = "python"))]
#[derive(Debug, Deserialize, PartialEq)]
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct State {
pub value: String,
Expand All @@ -299,7 +299,7 @@ pub struct State {
}

#[cfg(feature = "python")]
#[derive(Clone, Debug, Deserialize, PartialEq)]
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
#[serde(rename_all = "camelCase")]
#[pyclass]
pub struct State {
Expand Down Expand Up @@ -339,7 +339,7 @@ impl State {
}

#[cfg(not(feature = "python"))]
#[derive(Debug, Deserialize, PartialEq)]
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct Form {
pub name: String,
Expand Down Expand Up @@ -398,7 +398,7 @@ pub struct Form {
}

#[cfg(feature = "python")]
#[derive(Clone, Debug, Deserialize, PartialEq)]
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
#[serde(rename_all = "camelCase")]
#[pyclass]
pub struct Form {
Expand Down
10 changes: 5 additions & 5 deletions src/native/site_native.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use chrono::{DateTime, Utc};
#[cfg(feature = "python")]
use pyo3::{prelude::*, types::PyDateTime};

use serde::Deserialize;
use serde::{Deserialize, Serialize};

pub use crate::native::{
common::{Category, Entry, Field, Form, Reason, State, Value},
Expand All @@ -17,7 +17,7 @@ pub use crate::native::{
use crate::native::deserializers::to_py_datetime;

#[cfg(not(feature = "python"))]
#[derive(Debug, Deserialize, PartialEq)]
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct Site {
pub name: String,
Expand All @@ -33,7 +33,7 @@ pub struct Site {
}

#[cfg(feature = "python")]
#[derive(Clone, Debug, Deserialize, PartialEq)]
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
#[serde(rename_all = "camelCase")]
#[pyclass]
pub struct Site {
Expand Down Expand Up @@ -95,7 +95,7 @@ impl Site {

#[cfg(not(feature = "python"))]
/// Contains the information from the Prelude native site XML.
#[derive(Debug, Deserialize, PartialEq)]
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct SiteNative {
#[serde(rename = "site", default)]
Expand All @@ -104,7 +104,7 @@ pub struct SiteNative {

#[cfg(feature = "python")]
/// Contains the information from the Prelude native site XML.
#[derive(Debug, Deserialize, PartialEq)]
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
#[serde(rename_all = "camelCase")]
#[pyclass(get_all)]
pub struct SiteNative {
Expand Down
10 changes: 5 additions & 5 deletions src/native/subject_native.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use pyo3::{prelude::*, types::PyDateTime};
#[cfg(feature = "python")]
use crate::native::deserializers::to_py_datetime;

use serde::Deserialize;
use serde::{Deserialize, Serialize};

pub use crate::native::{
common::{Category, Entry, Field, Form, Reason, State, Value},
Expand All @@ -17,7 +17,7 @@ pub use crate::native::{
};

#[cfg(not(feature = "python"))]
#[derive(Debug, Deserialize, PartialEq)]
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct Patient {
pub patient_id: String,
Expand All @@ -40,7 +40,7 @@ pub struct Patient {
}

#[cfg(feature = "python")]
#[derive(Clone, Debug, Deserialize, PartialEq)]
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
#[serde(rename_all = "camelCase")]
#[pyclass]
pub struct Patient {
Expand Down Expand Up @@ -114,7 +114,7 @@ impl Patient {

#[cfg(not(feature = "python"))]
/// Contains the information from the Prelude native subject XML.
#[derive(Debug, Deserialize, PartialEq)]
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct SubjectNative {
#[serde(rename = "patient", default)]
Expand All @@ -123,7 +123,7 @@ pub struct SubjectNative {

#[cfg(feature = "python")]
/// Contains the information from the Prelude native subject XML.
#[derive(Debug, Deserialize, PartialEq)]
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
#[serde(rename_all = "camelCase")]
#[pyclass(get_all)]
pub struct SubjectNative {
Expand Down
10 changes: 5 additions & 5 deletions src/native/user_native.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use serde::Deserialize;
use serde::{Deserialize, Serialize};

#[cfg(feature = "python")]
use pyo3::prelude::*;
Expand All @@ -12,7 +12,7 @@ pub use crate::native::{
};

#[cfg(not(feature = "python"))]
#[derive(Debug, Deserialize, PartialEq)]
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct User {
pub unique_id: String,
Expand All @@ -30,7 +30,7 @@ pub struct User {
}

#[cfg(feature = "python")]
#[derive(Clone, Debug, Deserialize, PartialEq)]
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
#[serde(rename_all = "camelCase")]
#[pyclass(get_all)]
pub struct User {
Expand All @@ -50,7 +50,7 @@ pub struct User {

#[cfg(not(feature = "python"))]
/// Contains the information from the Prelude native user XML.
#[derive(Debug, Deserialize, PartialEq)]
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct UserNative {
#[serde(rename = "user", default)]
Expand All @@ -59,7 +59,7 @@ pub struct UserNative {

#[cfg(feature = "python")]
/// Contains the information from the Prelude native user XML.
#[derive(Debug, Deserialize, PartialEq)]
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
#[serde(rename_all = "camelCase")]
#[pyclass(get_all)]
pub struct UserNative {
Expand Down