Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
e23c04f
First version of a working open API model generator
pieterbos May 13, 2020
9e0a3df
Many fixes to OpenAPI model generator, including name conventions. Ne…
pieterbos May 14, 2020
ef0df6a
Add the correct type mappings to the discriminator
pieterbos May 14, 2020
a35ce93
Fix mapping of openehr type name to target type name
pieterbos May 14, 2020
d92bcf6
Support hash, add experimental internal model to BMM generator
pieterbos May 17, 2020
86ab680
Tons of fixes and more implemented
pieterbos May 18, 2020
ba2458e
fix jsonignore, make AOM OpenAPI generation work
pieterbos May 18, 2020
485d5a6
In between two fixes. going to rewrite some things...
pieterbos May 19, 2020
0fd46dc
Refactor away processBmmClassesInOrder. It does not really work.
pieterbos May 19, 2020
f9a6924
Merge branch 'master' into openapi_model_generator
pieterbos Apr 19, 2021
0c3e4a4
Fix compile
pieterbos Apr 19, 2021
17978ac
Fix test
pieterbos Apr 19, 2021
4b194d9
Fix casing bug in openAPI output
pieterbos Apr 19, 2021
16d15e5
Merge branch 'master' into openapi_model_generator
pieterbos May 31, 2021
ce932ac
Merge branch 'json_schema_v2' into openapi_model_generator
pieterbos Jun 2, 2021
ee60c2d
Make the generation script work for OpenAPI RM. Next: AOM
pieterbos Jun 3, 2021
a1e7b57
Remove redefined properties from the OpenAPI generator - doesn't work…
pieterbos Jun 10, 2021
3b43548
Add the correct choices to openapi generation
pieterbos Jun 14, 2021
b2e30d6
Add Readme, plus a clean task
pieterbos Jun 14, 2021
7555d2e
Add oneOf support to openapi generation - this makes this work for Sw…
pieterbos Jun 16, 2021
85c742b
Merge branch 'master' into openapi_model_generator
pieterbos Nov 1, 2021
98251a2
Add @Nullable annotations to AOM
pieterbos Nov 1, 2021
6edefbd
Make namespace in ARCHETYPE_HRID in base 1.1.0 bmm non-mandatory
pieterbos Nov 1, 2021
0b17474
AOM -> BMM generation: some simplifications of the output
pieterbos Nov 1, 2021
3c5e244
Some fixes in the AOM to BMM converter
pieterbos Nov 1, 2021
ff72ac5
Add fixes to the AOM OpenAPI for swift
pieterbos Feb 9, 2022
a1bbb99
More AOM OpenAPI fixes
pieterbos Feb 9, 2022
35c582d
Add additionalProperties for Maps in openAPI
pieterbos May 31, 2022
b5e4c9c
Fix AOM to BMM conversion
pieterbos Jun 1, 2022
3babef2
Fix reference to additionalProperties in many cases
pieterbos Jun 1, 2022
03b6783
First step towards MultiplicityInterval generating correctly
pieterbos Jun 1, 2022
e3ac06b
Fix MultiplicityInterval in AOM OpenAPI generating correct type
pieterbos Jun 15, 2022
678bf0a
Fix missing TranslationDetails class in aom openapi
pieterbos Jun 15, 2022
3f570e1
Add the translations and originalLanguage fields in the aom info + BM…
pieterbos Jun 15, 2022
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
4 changes: 4 additions & 0 deletions aom/src/main/java/com/nedap/archie/aom/Archetype.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import com.nedap.archie.xml.adapters.ArchetypeTerminologyAdapter;
import com.nedap.archie.xml.adapters.RMOverlayXmlAdapter;

import javax.annotation.Nullable;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
Expand Down Expand Up @@ -55,6 +56,7 @@
public class Archetype extends AuthoredResource {

@XmlElement(name="parent_archetype_id")
@Nullable
private String parentArchetypeId;
@XmlAttribute(name="is_differential")
private boolean differential = false;
Expand All @@ -64,9 +66,11 @@ public class Archetype extends AuthoredResource {
private CComplexObject definition;
@XmlJavaTypeAdapter(ArchetypeTerminologyAdapter.class)
private ArchetypeTerminology terminology;
@Nullable
private RulesSection rules = null;

@XmlAttribute(name="adl_version")
@Nullable
private String adlVersion;
@XmlElement(name="build_uid")
private String buildUid;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.nedap.archie.paths.PathSegment;
import com.nedap.archie.paths.PathUtil;

import javax.annotation.Nullable;
import javax.xml.bind.annotation.XmlTransient;

import java.util.List;
Expand All @@ -14,7 +15,9 @@
public abstract class ArchetypeConstraint extends ArchetypeModelObject {

@JsonIgnore //ignore these field in popular object mappers
@Nullable
private transient ArchetypeConstraint parent;
@Nullable
@JsonIgnore //ignore these field in popular object mappers, otherwise we get infinite loops
private transient CSecondOrder<?> socParent;

Expand Down
2 changes: 2 additions & 0 deletions aom/src/main/java/com/nedap/archie/aom/ArchetypeHRID.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import com.nedap.archie.definitions.VersionStatus;
import com.nedap.archie.rminfo.RMPropertyIgnore;

import javax.annotation.Nullable;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
Expand All @@ -32,6 +33,7 @@
})
public class ArchetypeHRID extends ArchetypeModelObject {

@Nullable
private String namespace;
@XmlAttribute(name="rm_publisher")
private String rmPublisher;
Expand Down
3 changes: 3 additions & 0 deletions aom/src/main/java/com/nedap/archie/aom/ArchetypeSlot.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.nedap.archie.rules.Assertion;

import javax.annotation.Nullable;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
import java.util.ArrayList;
Expand All @@ -17,7 +18,9 @@
})
public class ArchetypeSlot extends CObject {

@Nullable
private List<Assertion> includes = new ArrayList<>();
@Nullable
private List<Assertion> excludes = new ArrayList<>();
@XmlElement(name="is_closed")
private boolean closed = false;
Expand Down
5 changes: 5 additions & 0 deletions aom/src/main/java/com/nedap/archie/aom/CAttribute.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import com.nedap.archie.paths.PathSegment;
import com.nedap.archie.query.APathQuery;

import javax.annotation.Nullable;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
Expand All @@ -35,14 +36,18 @@ public class CAttribute extends ArchetypeConstraint {

@XmlAttribute(name="rm_attribute_name")
private String rmAttributeName;
@Nullable
private MultiplicityInterval existence;
@XmlElement(name="differential_path")
@Nullable
private String differentialPath;
@XmlElement(name="is_multiple")
private boolean multiple;

@Nullable
private Cardinality cardinality;

@Nullable
private List<CObject> children = new ArrayList<>();

public CAttribute() {
Expand Down
2 changes: 2 additions & 0 deletions aom/src/main/java/com/nedap/archie/aom/CAttributeTuple.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.nedap.archie.rminfo.ModelInfoLookup;
import com.nedap.archie.rminfo.RMAttributeInfo;

import javax.annotation.Nullable;
import javax.xml.bind.annotation.XmlType;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
Expand All @@ -28,6 +29,7 @@ public class CAttributeTuple extends CSecondOrder<CAttribute> {
* The members List of CSecondOrder contains the attribute names.
*/

@Nullable
private List<CPrimitiveTuple> tuples = new ArrayList<>();

public List<CPrimitiveTuple> getTuples() {
Expand Down
3 changes: 3 additions & 0 deletions aom/src/main/java/com/nedap/archie/aom/CComplexObject.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.nedap.archie.base.OpenEHRBase;
import com.nedap.archie.query.AOMPathQuery;

import javax.annotation.Nullable;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
Expand All @@ -24,9 +25,11 @@
})
public class CComplexObject extends CDefinedObject<OpenEHRBase> {

@Nullable
private List<CAttribute> attributes = new ArrayList<>();

@XmlElement(name="attributeTuples")
@Nullable
private List<CAttributeTuple> attributeTuples = new ArrayList<>();

@JsonIgnore
Expand Down
2 changes: 2 additions & 0 deletions aom/src/main/java/com/nedap/archie/aom/CDefinedObject.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.nedap.archie.aom;

import javax.annotation.Nullable;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;

Expand All @@ -13,6 +14,7 @@
public abstract class CDefinedObject<T> extends CObject {

@XmlElement(name="default_value") //TODO: this will not deserialize, it needs possible classes
@Nullable
private T defaultValue;

public T getDefaultValue() {
Expand Down
4 changes: 4 additions & 0 deletions aom/src/main/java/com/nedap/archie/aom/CObject.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import com.nedap.archie.paths.PathSegment;
import org.openehr.utils.message.I18n;

import javax.annotation.Nullable;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
Expand Down Expand Up @@ -40,13 +41,16 @@ public abstract class CObject extends ArchetypeConstraint {
@XmlAttribute(name="rm_type_name")
private String rmTypeName;
@XmlElement(name="occurrences")
@Nullable
private MultiplicityInterval occurrences;
@XmlAttribute(name="node_id")
private String nodeId;
@XmlAttribute(name="is_deprecated")
@Nullable
private Boolean deprecated;

@XmlElement(name="sibling_order")
@Nullable
private SiblingOrder siblingOrder;


Expand Down
3 changes: 3 additions & 0 deletions aom/src/main/java/com/nedap/archie/aom/CPrimitiveObject.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import org.openehr.utils.message.I18n;


import javax.annotation.Nullable;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
Expand All @@ -26,8 +27,10 @@ public abstract class CPrimitiveObject<Constraint, ValueType> extends CDefinedOb

public static final String PRIMITIVE_NODE_ID_VALUE = "id9999";

@Nullable
private Boolean enumeratedTypeConstraint;

@Nullable
public abstract ValueType getAssumedValue();

public abstract void setAssumedValue(ValueType assumedValue);
Expand Down
2 changes: 2 additions & 0 deletions aom/src/main/java/com/nedap/archie/aom/CSecondOrder.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.nedap.archie.aom;

import javax.annotation.Nullable;
import javax.xml.bind.annotation.XmlType;
import java.util.ArrayList;
import java.util.List;
Expand All @@ -9,6 +10,7 @@
*/
@XmlType(name="C_SECOND_ORDER")
public class CSecondOrder<T extends ArchetypeConstraint> extends ArchetypeModelObject {
@Nullable
private List<T> members = new ArrayList<>();

public T getMember(int i) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
package com.nedap.archie.aom;

import javax.annotation.Nullable;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;

import com.esotericsoftware.kryo.kryo5.util.Null;
import com.nedap.archie.aom.terminology.ArchetypeTerm;
import com.nedap.archie.aom.terminology.ArchetypeTerminology;
import com.nedap.archie.aom.utils.AOMUtils;
Expand All @@ -27,8 +30,10 @@ public class OperationalTemplate extends AuthoredArchetype {
* terminology extracts from subarchetypes, for example snomed codes, multiple choice thingies, etc
*/
@XmlElement(name="terminology_extracts") //TODO: requires an adapter for JAXB to work
@Nullable
private Map<String, ArchetypeTerminology> terminologyExtracts = new ConcurrentHashMap<>();//TODO: is this correct?
@XmlElement(name="component_terminologies") //TODO: requires an adapter for JAXB to work
@Nullable
private Map<String, ArchetypeTerminology> componentTerminologies = new ConcurrentHashMap<>();


Expand Down
14 changes: 14 additions & 0 deletions aom/src/main/java/com/nedap/archie/aom/ResourceDescription.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.fasterxml.jackson.annotation.JsonAlias;
import com.nedap.archie.base.terminology.TerminologyCode;

import javax.annotation.Nullable;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
Expand All @@ -15,20 +16,33 @@
public class ResourceDescription extends ArchetypeModelObject {

private Map<String, String> originalAuthor = new ConcurrentHashMap<>();
@Nullable
private String originalNamespace;
@Nullable
private String originalPublisher;
@Nullable
private List<String> otherContributors = new ArrayList<>();
private TerminologyCode lifecycleState;
@Nullable
private String custodianNamespace;
@Nullable
private String custodianOrganisation;
@Nullable
private String copyright;
@Nullable
private String licence;
@Nullable
private Map<String, String> ipAcknowledgements = new ConcurrentHashMap<>();
@Nullable
private Map<String, String> references = new ConcurrentHashMap<>();
@Nullable
private String resourcePackageUri;
@Nullable
private Map<String, String> conversionDetails = new ConcurrentHashMap<>();
@Nullable
private Map<String, String> otherDetails = new ConcurrentHashMap<>();

@Nullable
private Map<String, ResourceDescriptionItem> details = new ConcurrentHashMap<>();

public Map<String, String> getOriginalAuthor() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.nedap.archie.base.terminology.TerminologyCode;

import javax.annotation.Nullable;
import java.net.URI;
import java.util.List;
import java.util.Map;
Expand All @@ -12,10 +13,15 @@
public class ResourceDescriptionItem extends ArchetypeModelObject {
private TerminologyCode language;
private String purpose;
@Nullable
private List<String> keywords;
@Nullable
private String use;
@Nullable
private String misuse;
@Nullable
private String copyright;
@Nullable
private Map<String, URI> originalResourceUri;
private Map<String, String> otherDetails;//TODO: string -> object?

Expand Down
5 changes: 5 additions & 0 deletions aom/src/main/java/com/nedap/archie/aom/Template.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package com.nedap.archie.aom;

import com.fasterxml.jackson.annotation.JsonAlias;

import javax.annotation.Nullable;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
Expand All @@ -15,8 +18,10 @@
@XmlRootElement(name="archetype")
public class Template extends AuthoredArchetype {

@Nullable
private List<TemplateOverlay> templateOverlays = new ArrayList<>();

@JsonAlias("overlays")
public List<TemplateOverlay> getTemplateOverlays() {
return templateOverlays;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
@XmlType(name="C_BOOLEAN")
public class CBoolean extends CPrimitiveObject<Boolean, Boolean> {
@XmlElement(name="assumed_value")
@Nullable
private Boolean assumedValue;
@Nullable
private List<Boolean> constraint = new ArrayList<>();
Expand Down
3 changes: 3 additions & 0 deletions aom/src/main/java/com/nedap/archie/aom/primitives/CDate.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.nedap.archie.xml.adapters.DateIntervalXmlAdapter;
import com.nedap.archie.xml.adapters.DateXmlAdapter;

import javax.annotation.Nullable;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
Expand All @@ -22,8 +23,10 @@ public class CDate extends CTemporal<Temporal> {

@XmlJavaTypeAdapter(DateXmlAdapter.class)
@XmlElement(name="assumed_value")
@Nullable
private Temporal assumedValue;
@XmlJavaTypeAdapter(DateIntervalXmlAdapter.class)
@Nullable
private List<Interval<Temporal>> constraint = new ArrayList<>();

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.nedap.archie.xml.adapters.DateTimeIntervalXmlAdapter;
import com.nedap.archie.xml.adapters.DateTimeXmlAdapter;

import javax.annotation.Nullable;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
Expand All @@ -22,8 +23,10 @@ public class CDateTime extends CTemporal<TemporalAccessor> {

@XmlJavaTypeAdapter(DateTimeXmlAdapter.class)
@XmlElement(name="assumed_value")
@Nullable
private TemporalAccessor assumedValue;
@XmlJavaTypeAdapter(DateTimeIntervalXmlAdapter.class)
@Nullable
private List<Interval<TemporalAccessor>> constraint = new ArrayList<>();

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.nedap.archie.xml.adapters.DurationIntervalXmlAdapter;
import com.nedap.archie.xml.adapters.DurationXmlAdapter;

import javax.annotation.Nullable;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
Expand All @@ -22,8 +23,10 @@ public class CDuration extends CTemporal<TemporalAmount> {

@XmlJavaTypeAdapter(DurationXmlAdapter.class)
@XmlElement(name="assumed_value")
@Nullable
private TemporalAmount assumedValue;
@XmlJavaTypeAdapter(DurationIntervalXmlAdapter.class)
@Nullable
private List<Interval<TemporalAmount>> constraint = new ArrayList<>();

@Override
Expand Down
Loading