Skip to content

Commit

Permalink
CDI-50 Add new component type for relationship concrete values file
Browse files Browse the repository at this point in the history
  • Loading branch information
CoderMChu committed Nov 2, 2020
1 parent 558e232 commit 2b04cda
Show file tree
Hide file tree
Showing 5 changed files with 360 additions and 304 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ bin/
*.json
*.txt
*.zip
*.iml
20 changes: 12 additions & 8 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
Expand Down Expand Up @@ -138,26 +138,30 @@
</profile>
</profiles>



<repositories>
<repository>
<id>ihtsdo-public-nexus</id>
<id>ihtsdo-releases</id>
<name>IHTSDO Public Nexus Releases</name>
<url>https://maven.ihtsdotools.org/content/repositories/releases</url>
<url>https://nexus3.ihtsdotools.org/repository/maven-releases/</url>
</repository>
<repository>
<id>ihtsdo-snapshots</id>
<name>IHTSDO Public Nexus Snapshots</name>
<url>https://nexus3.ihtsdotools.org/repository/maven-snapshots/</url>
</repository>
</repositories>


<distributionManagement>
<repository>
<id>ihtsdo-public-nexus</id>
<name>IHTSDO Public Nexus Releases</name>
<url>https://maven.ihtsdotools.org/content/repositories/releases/</url>
<url>https://nexus3.ihtsdotools.org/repository/maven-releases/</url>
</repository>
<snapshotRepository>
<id>ihtsdo-public-nexus</id>
<name>IHTSDO Public Nexus Snapshots</name>
<url>https://maven.ihtsdotools.org/content/repositories/snapshots/</url>
<url>https://nexus3.ihtsdotools.org/repository/maven-snapshots/</url>
</snapshotRepository>
</distributionManagement>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@

public enum ComponentType {

CONCEPT("Concept"), DESCRIPTION("Description"), TEXT_DEFINITION("TextDefinition"), STATED_RELATIONSHIP("StatedRelationship"), RELATIONSHIP("Relationship"), IDENTIFIER("Identifier"), REFSET("Refset");
CONCEPT("Concept"),
DESCRIPTION("Description"),
TEXT_DEFINITION("TextDefinition"),
STATED_RELATIONSHIP("StatedRelationship"),
RELATIONSHIP("Relationship"),
RELATIONSHIP_CONCRETE_VALUES("RelationshipConcreteValues"),
IDENTIFIER("Identifier"),
REFSET("Refset");

private String name;

Expand Down Expand Up @@ -32,6 +39,8 @@ public static ComponentType lookup(String contentTypeString) {
type = ComponentType.STATED_RELATIONSHIP;
} else if (contentTypeString.equals(ComponentType.RELATIONSHIP.toString())) {
type = ComponentType.RELATIONSHIP;
} else if (contentTypeString.equals(ComponentType.RELATIONSHIP_CONCRETE_VALUES.toString())) {
type = ComponentType.RELATIONSHIP_CONCRETE_VALUES;
} else if (contentTypeString.equals(ComponentType.IDENTIFIER.toString())) {
type = ComponentType.IDENTIFIER;
} else if (contentTypeString.endsWith(ComponentType.REFSET.toString())) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,15 +117,20 @@ public TableSchema createSchemaBean(String filename) throws FileRecognitionExcep
.field("term", DataType.STRING)
.field("caseSignificanceId", sctidType);

} else if (componentType == ComponentType.STATED_RELATIONSHIP || componentType == ComponentType.RELATIONSHIP) {
} else if (componentType == ComponentType.STATED_RELATIONSHIP || componentType == ComponentType.RELATIONSHIP
|| componentType == ComponentType.RELATIONSHIP_CONCRETE_VALUES) {
schema = new TableSchema(componentType, filenameNoExtension)
.field("id", sctidType)
.field("effectiveTime", DataType.TIME, effectiveTimeMandatory)
.field("active", DataType.BOOLEAN)
.field("moduleId", sctidType)
.field("sourceId", sctidType)
.field("destinationId", sctidType)
.field("relationshipGroup", DataType.INTEGER)
.field("sourceId", sctidType);
if (componentType == ComponentType.RELATIONSHIP_CONCRETE_VALUES) {
schema.field("value", DataType.STRING);
} else {
schema.field("destinationId", sctidType);
}
schema.field("relationshipGroup", DataType.INTEGER)
.field("typeId", sctidType)
.field("characteristicTypeId", sctidType)
.field("modifierId", sctidType);
Expand Down
Loading

0 comments on commit 2b04cda

Please sign in to comment.