From 7b74deb84380c9b24a967141ebb7ac4c0f4741a8 Mon Sep 17 00:00:00 2001 From: Miles Mason Winther <42948872+mmwinther@users.noreply.github.com> Date: Wed, 6 Dec 2023 10:35:22 +0100 Subject: [PATCH] Add data_element_pattern field (#27) * Add data_element_pattern field * [GENERATE] Java classes from JSON Schema * [GENERATE] Pydantic models from JSON Schema --------- Co-authored-by: dapla-bot[bot] <143391972+dapla-bot[bot]@users.noreply.github.com> --- .../no/ssb/dapla/metadata/PseudoVariable.java | 303 ++++++++++++------ .../datadoc_model/datadoc_model/model.py | 11 +- .../pseudonymization-json-schema.json | 10 +- 3 files changed, 224 insertions(+), 100 deletions(-) diff --git a/generated/java/datadoc-model/src/no/ssb/dapla/metadata/PseudoVariable.java b/generated/java/datadoc-model/src/no/ssb/dapla/metadata/PseudoVariable.java index 6cc31b3d..6bf01a45 100644 --- a/generated/java/datadoc-model/src/no/ssb/dapla/metadata/PseudoVariable.java +++ b/generated/java/datadoc-model/src/no/ssb/dapla/metadata/PseudoVariable.java @@ -20,33 +20,34 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonValue; - /** * A pseudonymized variable in the dataset. - * + * */ @JsonInclude(JsonInclude.Include.NON_NULL) @JsonPropertyOrder({ - "short_name", - "data_element_path", - "stable_identifier_type", - "stable_identifier_version", - "encryption_algorithm", - "encryption_key_reference", - "encryption_algorithm_parameters", - "source_variable", - "source_variable_datatype" + "short_name", + "data_element_path", + "data_element_pattern", + "stable_identifier_type", + "stable_identifier_version", + "encryption_algorithm", + "encryption_key_reference", + "encryption_algorithm_parameters", + "source_variable", + "source_variable_datatype" }) @Generated("jsonschema2pojo") -public class PseudoVariable implements Serializable -{ +public class PseudoVariable implements Serializable { /** * Short name *

- * Physical name of the variable in the dataset. Should match the recommended short name. Alphanumeric. Limited to a-z, A-Z, 0-9, - (hyphen) and _ (underscore) + * Physical name of the variable in the dataset. Should match the recommended + * short name. Alphanumeric. Limited to a-z, A-Z, 0-9, - (hyphen) and _ + * (underscore) * (Required) - * + * */ @JsonProperty("short_name") @JsonPropertyDescription("Physical name of the variable in the dataset. Should match the recommended short name.") @@ -55,17 +56,30 @@ public class PseudoVariable implements Serializable /** * Data element path *

- * Path to one or multiple data element(s) in the dataset.Only for use in heirarchical datasets. Use JsonPath dot-notation to specify the path. - * + * Path to a single, concrete data element in the dataset.Only for use in + * heirarchical datasets. Use JsonPath dot-notation to specify the path. + * */ @JsonProperty("data_element_path") - @JsonPropertyDescription("Path to one or multiple data element(s) in the dataset.") + @JsonPropertyDescription("Path to a single, concrete data element in the dataset.") private String dataElementPath; + /** + * Data element pattern + *

+ * Pattern which matched this variable (if a pattern was used).Typically a glob + * pattern. + * + */ + @JsonProperty("data_element_pattern") + @JsonPropertyDescription("Pattern which matched this variable (if a pattern was used).") + private String dataElementPattern; /** * Stable identifier type *

- * Type of stable identifier the variable was mapped to prior to pseudonymization.Only relevant when the variable is mapped to a stable identifier. - * + * Type of stable identifier the variable was mapped to prior to + * pseudonymization.Only relevant when the variable is mapped to a stable + * identifier. + * */ @JsonProperty("stable_identifier_type") @JsonPropertyDescription("Type of stable identifier the variable was mapped to prior to pseudonymization.") @@ -73,8 +87,10 @@ public class PseudoVariable implements Serializable /** * Stable identifier version *

- * Version of stable identifier the variable was mapped to prior to pseudonymization.Only relevant when the variable is mapped to a stable identifier. - * + * Version of stable identifier the variable was mapped to prior to + * pseudonymization.Only relevant when the variable is mapped to a stable + * identifier. + * */ @JsonProperty("stable_identifier_version") @JsonPropertyDescription("Version of stable identifier the variable was mapped to prior to pseudonymization.") @@ -84,7 +100,7 @@ public class PseudoVariable implements Serializable *

* The encryption algorithm used to pseudonymize the variable. * (Required) - * + * */ @JsonProperty("encryption_algorithm") @JsonPropertyDescription("The encryption algorithm used to pseudonymize the variable.") @@ -95,7 +111,7 @@ public class PseudoVariable implements Serializable *

* Name of or reference to the encryption key used to pseudonymize the variable. * (Required) - * + * */ @JsonProperty("encryption_key_reference") @JsonPropertyDescription("Name of or reference to the encryption key used to pseudonymize the variable.") @@ -105,7 +121,7 @@ public class PseudoVariable implements Serializable * Encryption algorithm parameters *

* Parameters supplied to the encryption algorithm. - * + * */ @JsonProperty("encryption_algorithm_parameters") @JsonPropertyDescription("Parameters supplied to the encryption algorithm.") @@ -114,8 +130,9 @@ public class PseudoVariable implements Serializable /** * Source variable *

- * Short name of the source variable Only relevant when this differs from the short name of the variable. - * + * Short name of the source variable Only relevant when this differs from the + * short name of the variable. + * */ @JsonProperty("source_variable") @JsonPropertyDescription("Short name of the source variable") @@ -124,7 +141,7 @@ public class PseudoVariable implements Serializable * Source variable data type *

* Data type of the variable prior to pseudonymization. - * + * */ @JsonProperty("source_variable_datatype") @JsonPropertyDescription("Data type of the variable prior to pseudonymization.") @@ -136,36 +153,59 @@ public class PseudoVariable implements Serializable /** * No args constructor for use in serialization - * + * */ public PseudoVariable() { } /** - * + * * @param stableIdentifierType - * Stable identifier type. Type of stable identifier the variable was mapped to prior to pseudonymization. + * Stable identifier type. Type of stable + * identifier the variable was mapped to + * prior to pseudonymization. * @param encryptionKeyReference - * Encryption key reference. Name of or reference to the encryption key used to pseudonymize the variable. + * Encryption key reference. Name of or + * reference to the encryption key used to + * pseudonymize the variable. * @param dataElementPath - * Data element path. Path to one or multiple data element(s) in the dataset. + * Data element path. Path to a single, + * concrete data element in the dataset. * @param sourceVariable - * Source variable. Short name of the source variable. + * Source variable. Short name of the + * source variable. * @param sourceVariableDatatype - * Source variable data type. Data type of the variable prior to pseudonymization. + * Source variable data type. Data type of + * the variable prior to pseudonymization. * @param encryptionAlgorithmParameters - * Encryption algorithm parameters. Parameters supplied to the encryption algorithm. + * Encryption algorithm parameters. + * Parameters supplied to the encryption + * algorithm. + * @param dataElementPattern + * Data element pattern. Pattern which + * matched this variable (if a pattern was + * used). * @param stableIdentifierVersion - * Stable identifier version. Version of stable identifier the variable was mapped to prior to pseudonymization. + * Stable identifier version. Version of + * stable identifier the variable was + * mapped to prior to pseudonymization. * @param shortName - * Short name. Physical name of the variable in the dataset. Should match the recommended short name. + * Short name. Physical name of the + * variable in the dataset. Should match + * the recommended short name. * @param encryptionAlgorithm - * Encryption algorithm. The encryption algorithm used to pseudonymize the variable. + * Encryption algorithm. The encryption + * algorithm used to pseudonymize the + * variable. */ - public PseudoVariable(String shortName, String dataElementPath, String stableIdentifierType, String stableIdentifierVersion, String encryptionAlgorithm, String encryptionKeyReference, List encryptionAlgorithmParameters, String sourceVariable, PseudoVariable.SourceVariableDataType sourceVariableDatatype) { + public PseudoVariable(String shortName, String dataElementPath, String dataElementPattern, + String stableIdentifierType, String stableIdentifierVersion, String encryptionAlgorithm, + String encryptionKeyReference, List encryptionAlgorithmParameters, + String sourceVariable, PseudoVariable.SourceVariableDatatype sourceVariableDatatype) { super(); this.shortName = shortName; this.dataElementPath = dataElementPath; + this.dataElementPattern = dataElementPattern; this.stableIdentifierType = stableIdentifierType; this.stableIdentifierVersion = stableIdentifierVersion; this.encryptionAlgorithm = encryptionAlgorithm; @@ -178,9 +218,11 @@ public PseudoVariable(String shortName, String dataElementPath, String stableIde /** * Short name *

- * Physical name of the variable in the dataset. Should match the recommended short name. Alphanumeric. Limited to a-z, A-Z, 0-9, - (hyphen) and _ (underscore) + * Physical name of the variable in the dataset. Should match the recommended + * short name. Alphanumeric. Limited to a-z, A-Z, 0-9, - (hyphen) and _ + * (underscore) * (Required) - * + * */ @JsonProperty("short_name") public String getShortName() { @@ -190,9 +232,11 @@ public String getShortName() { /** * Short name *

- * Physical name of the variable in the dataset. Should match the recommended short name. Alphanumeric. Limited to a-z, A-Z, 0-9, - (hyphen) and _ (underscore) + * Physical name of the variable in the dataset. Should match the recommended + * short name. Alphanumeric. Limited to a-z, A-Z, 0-9, - (hyphen) and _ + * (underscore) * (Required) - * + * */ @JsonProperty("short_name") public void setShortName(String shortName) { @@ -202,8 +246,9 @@ public void setShortName(String shortName) { /** * Data element path *

- * Path to one or multiple data element(s) in the dataset.Only for use in heirarchical datasets. Use JsonPath dot-notation to specify the path. - * + * Path to a single, concrete data element in the dataset.Only for use in + * heirarchical datasets. Use JsonPath dot-notation to specify the path. + * */ @JsonProperty("data_element_path") public String getDataElementPath() { @@ -213,19 +258,46 @@ public String getDataElementPath() { /** * Data element path *

- * Path to one or multiple data element(s) in the dataset.Only for use in heirarchical datasets. Use JsonPath dot-notation to specify the path. - * + * Path to a single, concrete data element in the dataset.Only for use in + * heirarchical datasets. Use JsonPath dot-notation to specify the path. + * */ @JsonProperty("data_element_path") public void setDataElementPath(String dataElementPath) { this.dataElementPath = dataElementPath; } + /** + * Data element pattern + *

+ * Pattern which matched this variable (if a pattern was used).Typically a glob + * pattern. + * + */ + @JsonProperty("data_element_pattern") + public String getDataElementPattern() { + return dataElementPattern; + } + + /** + * Data element pattern + *

+ * Pattern which matched this variable (if a pattern was used).Typically a glob + * pattern. + * + */ + @JsonProperty("data_element_pattern") + public void setDataElementPattern(String dataElementPattern) { + this.dataElementPattern = dataElementPattern; + } + /** * Stable identifier type *

- * Type of stable identifier the variable was mapped to prior to pseudonymization.Only relevant when the variable is mapped to a stable identifier. - * + * Type of stable identifier the variable was mapped to prior to + * pseudonymization.Only relevant when the variable is mapped to a stable + * identifier. + * */ @JsonProperty("stable_identifier_type") public String getStableIdentifierType() { @@ -235,8 +307,10 @@ public String getStableIdentifierType() { /** * Stable identifier type *

- * Type of stable identifier the variable was mapped to prior to pseudonymization.Only relevant when the variable is mapped to a stable identifier. - * + * Type of stable identifier the variable was mapped to prior to + * pseudonymization.Only relevant when the variable is mapped to a stable + * identifier. + * */ @JsonProperty("stable_identifier_type") public void setStableIdentifierType(String stableIdentifierType) { @@ -246,8 +320,10 @@ public void setStableIdentifierType(String stableIdentifierType) { /** * Stable identifier version *

- * Version of stable identifier the variable was mapped to prior to pseudonymization.Only relevant when the variable is mapped to a stable identifier. - * + * Version of stable identifier the variable was mapped to prior to + * pseudonymization.Only relevant when the variable is mapped to a stable + * identifier. + * */ @JsonProperty("stable_identifier_version") public String getStableIdentifierVersion() { @@ -257,8 +333,10 @@ public String getStableIdentifierVersion() { /** * Stable identifier version *

- * Version of stable identifier the variable was mapped to prior to pseudonymization.Only relevant when the variable is mapped to a stable identifier. - * + * Version of stable identifier the variable was mapped to prior to + * pseudonymization.Only relevant when the variable is mapped to a stable + * identifier. + * */ @JsonProperty("stable_identifier_version") public void setStableIdentifierVersion(String stableIdentifierVersion) { @@ -270,7 +348,7 @@ public void setStableIdentifierVersion(String stableIdentifierVersion) { *

* The encryption algorithm used to pseudonymize the variable. * (Required) - * + * */ @JsonProperty("encryption_algorithm") public String getEncryptionAlgorithm() { @@ -282,7 +360,7 @@ public String getEncryptionAlgorithm() { *

* The encryption algorithm used to pseudonymize the variable. * (Required) - * + * */ @JsonProperty("encryption_algorithm") public void setEncryptionAlgorithm(String encryptionAlgorithm) { @@ -294,7 +372,7 @@ public void setEncryptionAlgorithm(String encryptionAlgorithm) { *

* Name of or reference to the encryption key used to pseudonymize the variable. * (Required) - * + * */ @JsonProperty("encryption_key_reference") public String getEncryptionKeyReference() { @@ -306,7 +384,7 @@ public String getEncryptionKeyReference() { *

* Name of or reference to the encryption key used to pseudonymize the variable. * (Required) - * + * */ @JsonProperty("encryption_key_reference") public void setEncryptionKeyReference(String encryptionKeyReference) { @@ -317,7 +395,7 @@ public void setEncryptionKeyReference(String encryptionKeyReference) { * Encryption algorithm parameters *

* Parameters supplied to the encryption algorithm. - * + * */ @JsonProperty("encryption_algorithm_parameters") public List getEncryptionAlgorithmParameters() { @@ -328,7 +406,7 @@ public List getEncryptionAlgorithmParameters() { * Encryption algorithm parameters *

* Parameters supplied to the encryption algorithm. - * + * */ @JsonProperty("encryption_algorithm_parameters") public void setEncryptionAlgorithmParameters(List encryptionAlgorithmParameters) { @@ -338,8 +416,9 @@ public void setEncryptionAlgorithmParameters(List /** * Source variable *

- * Short name of the source variable Only relevant when this differs from the short name of the variable. - * + * Short name of the source variable Only relevant when this differs from the + * short name of the variable. + * */ @JsonProperty("source_variable") public String getSourceVariable() { @@ -349,8 +428,9 @@ public String getSourceVariable() { /** * Source variable *

- * Short name of the source variable Only relevant when this differs from the short name of the variable. - * + * Short name of the source variable Only relevant when this differs from the + * short name of the variable. + * */ @JsonProperty("source_variable") public void setSourceVariable(String sourceVariable) { @@ -361,7 +441,7 @@ public void setSourceVariable(String sourceVariable) { * Source variable data type *

* Data type of the variable prior to pseudonymization. - * + * */ @JsonProperty("source_variable_datatype") public PseudoVariable.SourceVariableDataType getSourceVariableDatatype() { @@ -372,7 +452,7 @@ public PseudoVariable.SourceVariableDataType getSourceVariableDatatype() { * Source variable data type *

* Data type of the variable prior to pseudonymization. - * + * */ @JsonProperty("source_variable_datatype") public void setSourceVariableDatatype(PseudoVariable.SourceVariableDataType sourceVariableDatatype) { @@ -392,49 +472,54 @@ public void setAdditionalProperty(String name, Object value) { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append(PseudoVariable.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); + sb.append(PseudoVariable.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))) + .append('['); sb.append("shortName"); sb.append('='); - sb.append(((this.shortName == null)?"":this.shortName)); + sb.append(((this.shortName == null) ? "" : this.shortName)); sb.append(','); sb.append("dataElementPath"); sb.append('='); - sb.append(((this.dataElementPath == null)?"":this.dataElementPath)); + sb.append(((this.dataElementPath == null) ? "" : this.dataElementPath)); + sb.append(','); + sb.append("dataElementPattern"); + sb.append('='); + sb.append(((this.dataElementPattern == null) ? "" : this.dataElementPattern)); sb.append(','); sb.append("stableIdentifierType"); sb.append('='); - sb.append(((this.stableIdentifierType == null)?"":this.stableIdentifierType)); + sb.append(((this.stableIdentifierType == null) ? "" : this.stableIdentifierType)); sb.append(','); sb.append("stableIdentifierVersion"); sb.append('='); - sb.append(((this.stableIdentifierVersion == null)?"":this.stableIdentifierVersion)); + sb.append(((this.stableIdentifierVersion == null) ? "" : this.stableIdentifierVersion)); sb.append(','); sb.append("encryptionAlgorithm"); sb.append('='); - sb.append(((this.encryptionAlgorithm == null)?"":this.encryptionAlgorithm)); + sb.append(((this.encryptionAlgorithm == null) ? "" : this.encryptionAlgorithm)); sb.append(','); sb.append("encryptionKeyReference"); sb.append('='); - sb.append(((this.encryptionKeyReference == null)?"":this.encryptionKeyReference)); + sb.append(((this.encryptionKeyReference == null) ? "" : this.encryptionKeyReference)); sb.append(','); sb.append("encryptionAlgorithmParameters"); sb.append('='); - sb.append(((this.encryptionAlgorithmParameters == null)?"":this.encryptionAlgorithmParameters)); + sb.append(((this.encryptionAlgorithmParameters == null) ? "" : this.encryptionAlgorithmParameters)); sb.append(','); sb.append("sourceVariable"); sb.append('='); - sb.append(((this.sourceVariable == null)?"":this.sourceVariable)); + sb.append(((this.sourceVariable == null) ? "" : this.sourceVariable)); sb.append(','); sb.append("sourceVariableDatatype"); sb.append('='); - sb.append(((this.sourceVariableDatatype == null)?"":this.sourceVariableDatatype)); + sb.append(((this.sourceVariableDatatype == null) ? "" : this.sourceVariableDatatype)); sb.append(','); sb.append("additionalProperties"); sb.append('='); - sb.append(((this.additionalProperties == null)?"":this.additionalProperties)); + sb.append(((this.additionalProperties == null) ? "" : this.additionalProperties)); sb.append(','); - if (sb.charAt((sb.length()- 1)) == ',') { - sb.setCharAt((sb.length()- 1), ']'); + if (sb.charAt((sb.length() - 1)) == ',') { + sb.setCharAt((sb.length() - 1), ']'); } else { sb.append(']'); } @@ -444,16 +529,19 @@ public String toString() { @Override public int hashCode() { int result = 1; - result = ((result* 31)+((this.stableIdentifierType == null)? 0 :this.stableIdentifierType.hashCode())); - result = ((result* 31)+((this.encryptionKeyReference == null)? 0 :this.encryptionKeyReference.hashCode())); - result = ((result* 31)+((this.dataElementPath == null)? 0 :this.dataElementPath.hashCode())); - result = ((result* 31)+((this.sourceVariable == null)? 0 :this.sourceVariable.hashCode())); - result = ((result* 31)+((this.sourceVariableDatatype == null)? 0 :this.sourceVariableDatatype.hashCode())); - result = ((result* 31)+((this.encryptionAlgorithmParameters == null)? 0 :this.encryptionAlgorithmParameters.hashCode())); - result = ((result* 31)+((this.stableIdentifierVersion == null)? 0 :this.stableIdentifierVersion.hashCode())); - result = ((result* 31)+((this.additionalProperties == null)? 0 :this.additionalProperties.hashCode())); - result = ((result* 31)+((this.shortName == null)? 0 :this.shortName.hashCode())); - result = ((result* 31)+((this.encryptionAlgorithm == null)? 0 :this.encryptionAlgorithm.hashCode())); + result = ((result * 31) + ((this.stableIdentifierType == null) ? 0 : this.stableIdentifierType.hashCode())); + result = ((result * 31) + ((this.encryptionKeyReference == null) ? 0 : this.encryptionKeyReference.hashCode())); + result = ((result * 31) + ((this.dataElementPath == null) ? 0 : this.dataElementPath.hashCode())); + result = ((result * 31) + ((this.sourceVariable == null) ? 0 : this.sourceVariable.hashCode())); + result = ((result * 31) + ((this.sourceVariableDatatype == null) ? 0 : this.sourceVariableDatatype.hashCode())); + result = ((result * 31) + + ((this.encryptionAlgorithmParameters == null) ? 0 : this.encryptionAlgorithmParameters.hashCode())); + result = ((result * 31) + ((this.dataElementPattern == null) ? 0 : this.dataElementPattern.hashCode())); + result = ((result * 31) + + ((this.stableIdentifierVersion == null) ? 0 : this.stableIdentifierVersion.hashCode())); + result = ((result * 31) + ((this.additionalProperties == null) ? 0 : this.additionalProperties.hashCode())); + result = ((result * 31) + ((this.shortName == null) ? 0 : this.shortName.hashCode())); + result = ((result * 31) + ((this.encryptionAlgorithm == null) ? 0 : this.encryptionAlgorithm.hashCode())); return result; } @@ -466,15 +554,39 @@ public boolean equals(Object other) { return false; } PseudoVariable rhs = ((PseudoVariable) other); - return (((((((((((this.stableIdentifierType == rhs.stableIdentifierType)||((this.stableIdentifierType!= null)&&this.stableIdentifierType.equals(rhs.stableIdentifierType)))&&((this.encryptionKeyReference == rhs.encryptionKeyReference)||((this.encryptionKeyReference!= null)&&this.encryptionKeyReference.equals(rhs.encryptionKeyReference))))&&((this.dataElementPath == rhs.dataElementPath)||((this.dataElementPath!= null)&&this.dataElementPath.equals(rhs.dataElementPath))))&&((this.sourceVariable == rhs.sourceVariable)||((this.sourceVariable!= null)&&this.sourceVariable.equals(rhs.sourceVariable))))&&((this.sourceVariableDatatype == rhs.sourceVariableDatatype)||((this.sourceVariableDatatype!= null)&&this.sourceVariableDatatype.equals(rhs.sourceVariableDatatype))))&&((this.encryptionAlgorithmParameters == rhs.encryptionAlgorithmParameters)||((this.encryptionAlgorithmParameters!= null)&&this.encryptionAlgorithmParameters.equals(rhs.encryptionAlgorithmParameters))))&&((this.stableIdentifierVersion == rhs.stableIdentifierVersion)||((this.stableIdentifierVersion!= null)&&this.stableIdentifierVersion.equals(rhs.stableIdentifierVersion))))&&((this.additionalProperties == rhs.additionalProperties)||((this.additionalProperties!= null)&&this.additionalProperties.equals(rhs.additionalProperties))))&&((this.shortName == rhs.shortName)||((this.shortName!= null)&&this.shortName.equals(rhs.shortName))))&&((this.encryptionAlgorithm == rhs.encryptionAlgorithm)||((this.encryptionAlgorithm!= null)&&this.encryptionAlgorithm.equals(rhs.encryptionAlgorithm)))); + return ((((((((((((this.stableIdentifierType == rhs.stableIdentifierType) + || ((this.stableIdentifierType != null) && this.stableIdentifierType.equals(rhs.stableIdentifierType))) + && ((this.encryptionKeyReference == rhs.encryptionKeyReference) + || ((this.encryptionKeyReference != null) + && this.encryptionKeyReference.equals(rhs.encryptionKeyReference)))) + && ((this.dataElementPath == rhs.dataElementPath) + || ((this.dataElementPath != null) && this.dataElementPath.equals(rhs.dataElementPath)))) + && ((this.sourceVariable == rhs.sourceVariable) + || ((this.sourceVariable != null) && this.sourceVariable.equals(rhs.sourceVariable)))) + && ((this.sourceVariableDatatype == rhs.sourceVariableDatatype) + || ((this.sourceVariableDatatype != null) + && this.sourceVariableDatatype.equals(rhs.sourceVariableDatatype)))) + && ((this.encryptionAlgorithmParameters == rhs.encryptionAlgorithmParameters) + || ((this.encryptionAlgorithmParameters != null) + && this.encryptionAlgorithmParameters.equals(rhs.encryptionAlgorithmParameters)))) + && ((this.dataElementPattern == rhs.dataElementPattern) || ((this.dataElementPattern != null) + && this.dataElementPattern.equals(rhs.dataElementPattern)))) + && ((this.stableIdentifierVersion == rhs.stableIdentifierVersion) + || ((this.stableIdentifierVersion != null) + && this.stableIdentifierVersion.equals(rhs.stableIdentifierVersion)))) + && ((this.additionalProperties == rhs.additionalProperties) || ((this.additionalProperties != null) + && this.additionalProperties.equals(rhs.additionalProperties)))) + && ((this.shortName == rhs.shortName) + || ((this.shortName != null) && this.shortName.equals(rhs.shortName)))) + && ((this.encryptionAlgorithm == rhs.encryptionAlgorithm) || ((this.encryptionAlgorithm != null) + && this.encryptionAlgorithm.equals(rhs.encryptionAlgorithm)))); } - /** * Source variable data type *

* Data type of the variable prior to pseudonymization. - * + * */ @Generated("jsonschema2pojo") public enum SourceVariableDataType { @@ -483,11 +595,12 @@ public enum SourceVariableDataType { INTEGER("INTEGER"), FLOAT("FLOAT"), DATETIME("DATETIME"); + private final String value; private final static Map CONSTANTS = new HashMap(); static { - for (PseudoVariable.SourceVariableDataType c: values()) { + for (PseudoVariable.SourceVariableDataType c : values()) { CONSTANTS.put(c.value, c); } } diff --git a/generated/python/datadoc_model/datadoc_model/model.py b/generated/python/datadoc_model/datadoc_model/model.py index 56a49ccd..2d9e367b 100644 --- a/generated/python/datadoc_model/datadoc_model/model.py +++ b/generated/python/datadoc_model/datadoc_model/model.py @@ -1,6 +1,6 @@ # generated by datamodel-codegen: # filename: metadata-container-json-schema.json -# timestamp: 2023-11-22T13:01:43+00:00 +# timestamp: 2023-12-05T13:27:31+00:00 from __future__ import annotations @@ -113,9 +113,14 @@ class PseudoVariable(BaseModel): ) data_element_path: Optional[str] = Field( None, - description='Path to one or multiple data element(s) in the dataset.', + description='Path to a single, concrete data element in the dataset.', title='Data element path', ) + data_element_pattern: Optional[str] = Field( + None, + description='Pattern which matched this variable (if a pattern was used).', + title='Data element pattern', + ) stable_identifier_type: Optional[str] = Field( None, description='Type of stable identifier the variable was mapped to prior to pseudonymization.', @@ -152,7 +157,7 @@ class PseudoVariable(BaseModel): class PseudonymizationJsonSchema(BaseModel): - document_version: Literal['0.0.1'] = '0.0.1' + document_version: Literal['0.1.0'] = '0.1.0' pseudo_dataset: PseudoDataset pseudo_variables: list[PseudoVariable] diff --git a/src/pseudonymization/pseudonymization-json-schema.json b/src/pseudonymization/pseudonymization-json-schema.json index 3aa1d921..1c4505d0 100644 --- a/src/pseudonymization/pseudonymization-json-schema.json +++ b/src/pseudonymization/pseudonymization-json-schema.json @@ -6,7 +6,7 @@ "properties": { "document_version": { "$comment": "Version of this Json Schema", - "const": "0.0.1" + "const": "0.1.0" }, "pseudo_dataset": { "properties": { @@ -41,9 +41,15 @@ "data_element_path": { "type": "string", "title": "Data element path", - "description": "Path to one or multiple data element(s) in the dataset.", + "description": "Path to a single, concrete data element in the dataset.", "$comment": "Only for use in heirarchical datasets. Use JsonPath dot-notation to specify the path." }, + "data_element_pattern": { + "type": "string", + "title": "Data element pattern", + "description": "Pattern which matched this variable (if a pattern was used).", + "$comment": "Typically a glob pattern." + }, "stable_identifier_type": { "type": "string", "title": "Stable identifier type",