Get structures all added, not current building

This commit is contained in:
James Agnew 2014-12-19 17:56:41 -05:00
parent 4ca405a8fc
commit 9f67bbb9c7
11 changed files with 128 additions and 108 deletions

View File

@ -29,14 +29,8 @@
</dependency>
<!-- Testing -->
<!--
<dependency>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-structures-dstu</artifactId>
<version>0.8</version>
<scope>test</scope>
</dependency>
-->
<!-- <dependency> <groupId>ca.uhn.hapi.fhir</groupId> <artifactId>hapi-fhir-structures-dstu</artifactId>
<version>0.8</version> <scope>test</scope> </dependency> -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
@ -175,26 +169,12 @@
<version>${guava_version}</version>
<scope>test</scope>
</dependency>
<!--
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-web</artifactId>
<version>${spring_security_version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId>
<version>${spring_security_version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-jwt</artifactId>
<version>1.0.2.RELEASE</version>
<scope>test</scope>
</dependency>
-->
<!-- <dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-web</artifactId>
<version>${spring_security_version}</version> <scope>test</scope> </dependency>
<dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-config</artifactId>
<version>${spring_security_version}</version> <scope>test</scope> </dependency>
<dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-jwt</artifactId>
<version>1.0.2.RELEASE</version> <scope>test</scope> </dependency> -->
</dependencies>
@ -215,19 +195,25 @@
<package>ca.uhn.fhir.model.dev</package>
<version>dev</version>
<baseResourceNames>
<baseResourceName>account</baseResourceName>
<baseResourceName>adversereaction</baseResourceName>
<baseResourceName>adversereactionrisk</baseResourceName>
<baseResourceName>alert</baseResourceName>
<baseResourceName>allergyintolerance</baseResourceName>
<baseResourceName>appointment</baseResourceName>
<baseResourceName>appointmentresponse</baseResourceName>
<baseResourceName>availability</baseResourceName>
<!--<baseResourceName>assessmentdefinition</baseResourceName>-->
<baseResourceName>basic</baseResourceName>
<!--<baseResourceName>binary</baseResourceName>-->
<!--<baseResourceName>bundle</baseResourceName>-->
<!--<baseResourceName>careactivity</baseResourceName>-->
<baseResourceName>careplan</baseResourceName>
<!--
Doesn't seem to work yet
<baseResourceName>careplan2</baseResourceName>
<baseResourceName>claim</baseResourceName>
-->
<baseResourceName>claimresponse</baseResourceName>
<baseResourceName>clinicalassessment</baseResourceName>
<!--<baseResourceName>commondataelement</baseResourceName>-->
<baseResourceName>communication</baseResourceName>
<baseResourceName>communicationrequest</baseResourceName>
<baseResourceName>composition</baseResourceName>
<baseResourceName>conceptmap</baseResourceName>
<baseResourceName>condition</baseResourceName>
@ -235,21 +221,45 @@
<baseResourceName>contract</baseResourceName>
<baseResourceName>contraindication</baseResourceName>
<baseResourceName>coverage</baseResourceName>
<baseResourceName>dataelement</baseResourceName>
<baseResourceName>device</baseResourceName>
<baseResourceName>devicecomponent</baseResourceName>
<baseResourceName>devicemetric</baseResourceName>
<baseResourceName>deviceobservationreport</baseResourceName>
<baseResourceName>deviceuserequest</baseResourceName>
<baseResourceName>deviceusestatement</baseResourceName>
<baseResourceName>diagnosticorder</baseResourceName>
<baseResourceName>diagnosticreport</baseResourceName>
<!--<baseResourceName>document</baseResourceName>-->
<!--<baseResourceName>documentation</baseResourceName>-->
<baseResourceName>documentmanifest</baseResourceName>
<baseResourceName>documentreference</baseResourceName>
<!--<baseResourceName>eligibility</baseResourceName>-->
<baseResourceName>eligibilityrequest</baseResourceName>
<baseResourceName>eligibilityresponse</baseResourceName>
<baseResourceName>encounter</baseResourceName>
<!--<baseResourceName>enrollment</baseResourceName>-->
<baseResourceName>enrollmentrequest</baseResourceName>
<baseResourceName>enrollmentresponse</baseResourceName>
<baseResourceName>episodeofcare</baseResourceName>
<baseResourceName>explanationofbenefit</baseResourceName>
<baseResourceName>extensiondefinition</baseResourceName>
<baseResourceName>familyhistory</baseResourceName>
<baseResourceName>geneexpression</baseResourceName>
<baseResourceName>geneticanalysis</baseResourceName>
<baseResourceName>goal</baseResourceName>
<!--<baseResourceName>goalrequest</baseResourceName>-->
<baseResourceName>group</baseResourceName>
<baseResourceName>gvfmeta</baseResourceName>
<baseResourceName>gvfvariant</baseResourceName>
<baseResourceName>healthcareservice</baseResourceName>
<baseResourceName>imagingobjectselection</baseResourceName>
<baseResourceName>imagingstudy</baseResourceName>
<baseResourceName>immunization</baseResourceName>
<!--<baseResourceName>immunizationprofile</baseResourceName>-->
<baseResourceName>immunizationrecommendation</baseResourceName>
<baseResourceName>institutionalclaim</baseResourceName>
<!--<baseResourceName>interestofcare</baseResourceName>-->
<baseResourceName>list</baseResourceName>
<baseResourceName>location</baseResourceName>
<baseResourceName>media</baseResourceName>
@ -258,54 +268,71 @@
<baseResourceName>medicationdispense</baseResourceName>
<baseResourceName>medicationprescription</baseResourceName>
<baseResourceName>medicationstatement</baseResourceName>
<!--<baseResourceName>message</baseResourceName>-->
<baseResourceName>messageheader</baseResourceName>
<baseResourceName>microarray</baseResourceName>
<baseResourceName>namespace</baseResourceName>
<!--<baseResourceName>microarray</baseResourceName>-->
<!--<baseResourceName>namespace</baseResourceName>-->
<baseResourceName>namingsystem</baseResourceName>
<!--<baseResourceName>newbundle</baseResourceName>-->
<baseResourceName>nutritionorder</baseResourceName>
<baseResourceName>observation</baseResourceName>
<baseResourceName>operationdefinition</baseResourceName>
<baseResourceName>operationoutcome</baseResourceName>
<baseResourceName>oralhealthclaim</baseResourceName>
<baseResourceName>order</baseResourceName>
<baseResourceName>orderresponse</baseResourceName>
<baseResourceName>organization</baseResourceName>
<baseResourceName>other</baseResourceName>
<baseResourceName>patient</baseResourceName>
<!--
<baseResourceName>paymentnotice</baseResourceName>
<baseResourceName>paymentreconciliation</baseResourceName>
<baseResourceName>pendedrequest</baseResourceName>
<baseResourceName>person</baseResourceName>
-->
<baseResourceName>pharmacyclaim</baseResourceName>
<!--<baseResourceName>picture</baseResourceName>-->
<baseResourceName>practitioner</baseResourceName>
<!--<baseResourceName>problem</baseResourceName>-->
<baseResourceName>procedure</baseResourceName>
<baseResourceName>procedurerequest</baseResourceName>
<baseResourceName>professionalclaim</baseResourceName>
<baseResourceName>profile</baseResourceName>
<!--
Depends on "ActivityDefinition", which doesn't exist..
<baseResourceName>protocol</baseResourceName>
-->
<!--<baseResourceName>protocol</baseResourceName>-->
<baseResourceName>provenance</baseResourceName>
<baseResourceName>query</baseResourceName>
<baseResourceName>questionnaire</baseResourceName>
<baseResourceName>questionnaireanswers</baseResourceName>
<baseResourceName>readjudicate</baseResourceName>
<baseResourceName>referralrequest</baseResourceName>
<baseResourceName>relatedperson</baseResourceName>
<baseResourceName>remittance</baseResourceName>
<baseResourceName>reversal</baseResourceName>
<baseResourceName>riskassessment</baseResourceName>
<baseResourceName>schedule</baseResourceName>
<baseResourceName>searchparameter</baseResourceName>
<baseResourceName>securityclaim</baseResourceName>
<baseResourceName>securityevent</baseResourceName>
<baseResourceName>securitygroup</baseResourceName>
<baseResourceName>securityprincipal</baseResourceName>
<!--
What is this?
<baseResourceName>sequence</baseResourceName>
-->
<baseResourceName>sequencinganalysis</baseResourceName>
<baseResourceName>sequencinglab</baseResourceName>
<baseResourceName>slot</baseResourceName>
<baseResourceName>specimen</baseResourceName>
<baseResourceName>statusrequest</baseResourceName>
<baseResourceName>statusresponse</baseResourceName>
<!--<baseResourceName>study</baseResourceName>-->
<baseResourceName>subscription</baseResourceName>
<baseResourceName>substance</baseResourceName>
<baseResourceName>supply</baseResourceName>
<baseResourceName>supportingdocumentation</baseResourceName>
<!--<baseResourceName>test</baseResourceName>-->
<baseResourceName>user</baseResourceName>
<baseResourceName>valueset</baseResourceName>
<baseResourceName>vcfmeta</baseResourceName>
<baseResourceName>vcfvariant</baseResourceName>
<baseResourceName>visionclaim</baseResourceName>
<baseResourceName>visionprescription</baseResourceName>
<!--<baseResourceName>visit</baseResourceName>-->
</baseResourceNames>
<buildDatatypes>true</buildDatatypes>
</configuration>
@ -313,7 +340,8 @@
</plugins>
<pluginManagement>
<plugins>
<!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
<!--This plugin's configuration is used to store Eclipse m2e settings
only. It has no influence on the Maven build itself. -->
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>

View File

@ -220,8 +220,8 @@ public class TinderStructuresMojo extends AbstractMojo {
String dtOutputDir = "target/generated-sources/tinder/ca/uhn/fhir/model/dev/composite";
ResourceGeneratorUsingSpreadsheet rp = new ResourceGeneratorUsingSpreadsheet("dev", ".");
rp.setBaseResourceNames(Arrays.asList("contract", "valueset", "organization", "location"
ResourceGeneratorUsingSpreadsheet rp = new ResourceGeneratorUsingSpreadsheet("dstu", ".");
rp.setBaseResourceNames(Arrays.asList("securityevent" // , "contract", "valueset", "organization", "location"
// , "observation", "conformance", "referralrequest", "patient","practitioner","encounter",
// "organization","location","relatedperson","appointment","slot","order","availability","device", "valueset"
));

View File

@ -12,11 +12,6 @@ public class AnyChild extends Child {
return getReferenceType();
}
@Override
public String getTypeSuffix() {
return "";
}
@Override
public boolean isSingleChildInstantiable() {
return false;

View File

@ -145,8 +145,6 @@ public abstract class BaseElement {
return myType;
}
public abstract String getTypeSuffix();
public String getV2Mapping() {
return myV2Mapping;
}
@ -230,18 +228,28 @@ public abstract class BaseElement {
}
String typeString = theType;
typeString = typeString.replace("Reference (", "Reference(");
typeString = typeString.replace("Resource (", "Reference(");
typeString = typeString.replace("Resource(", "Reference(").trim();
if (typeString.toLowerCase().startsWith("resource(")) {
typeString = typeString.substring("Resource(".length(), typeString.length() - 1);
myResourceRef = true;
} else if (typeString.toLowerCase().startsWith("reference(")) {
typeString = typeString.substring("Reference(".length(), typeString.length() - 1);
myResourceRef = true;
} else if (typeString.startsWith("@")) {
// if (typeString.toLowerCase().startsWith("resource(")) {
// typeString = typeString.substring("Resource(".length(), typeString.length());
// myResourceRef = true;
// } else if (typeString.toLowerCase().startsWith("reference(")) {
// typeString = typeString.substring("Reference(".length(), typeString.length());
// myResourceRef = true;
// } else
boolean datatype = true;
if (typeString.startsWith("@")) {
typeString = typeString.substring(1);
typeString = ResourceBlock.convertFhirPathNameToClassName(typeString);
datatype = false;
// } else if (typeString.equals("Reference(Any)")) {
// typeString = "Reference(IResource)";
// datatype = false;
} else if (typeString.equals("*")) {
typeString = "IDatatype";
datatype = false;
}
if (StringUtils.isNotBlank(typeString)) {
@ -252,6 +260,14 @@ public abstract class BaseElement {
typeString = typeString.substring(0,idx) + typeString.substring(idx, endIdx).replace("|", ",") + typeString.substring(endIdx);
}
if (idx == 0 && typeString.endsWith(")")) {
myResourceRef = true;
}
if (typeString.startsWith("=")) {
datatype = false;
}
String[] types = typeString.replace("=", "").split("\\|");
for (String nextType : types) {
nextType = nextType.trim();
@ -266,7 +282,9 @@ public abstract class BaseElement {
nextType = nextType.substring(0, 1).toUpperCase() + nextType.substring(1);
} else {
nextType = nextType.substring(0, 1).toUpperCase() + nextType.substring(1);
nextType = nextType + getTypeSuffix();
if (datatype) {
nextType = nextType + "Dt";
}
}
for (String next : nextType.split(",")) {
@ -303,4 +321,9 @@ public abstract class BaseElement {
return myExtensionUrl;
}
public static void main(String[] args) {
SimpleChild child = new SimpleChild();
child.setTypeFromString("CodeableConcept | Resource(Any)");
}
}

View File

@ -38,11 +38,6 @@ public abstract class BaseRootType extends BaseElement {
return retVal;
}
@Override
public String getTypeSuffix() {
return "";
}
public void setId(String theId) {
myId = theId;
}

View File

@ -132,13 +132,6 @@ public abstract class Child extends BaseElement {
return retVal;
}
public String getTypeSuffix() {
if (isResourceRef()) {
return "";
}
return "Dt";
}
public String getVariableName() {
String elementName = getMethodName();
return "my" + elementName;

View File

@ -63,11 +63,6 @@ public class ResourceBlock extends Child {
return true;
}
@Override
public String getTypeSuffix() {
return "";
}
public void setForcedClassName(String theClassName) {
myForcedClassName =theClassName;
}

View File

@ -2,9 +2,5 @@ package ca.uhn.fhir.tinder.model;
public class ResourceBlockCopy extends Child {
@Override
public String getTypeSuffix() {
return "";
}
}

View File

@ -24,11 +24,6 @@ public class UndeclaredExtensionChild extends Child {
return ExtensionDt.class.getSimpleName();
}
@Override
public String getTypeSuffix() {
return "";
}
@Override
public boolean isSingleChildInstantiable() {
return true;

View File

@ -355,7 +355,7 @@
<Row ss:AutoFitHeight="0">
<Cell><Data ss:Type="String">GeneticAnalysis.geneticAnalysisDiscreteResult.dnaAnalysisDiscreteSequenceVariation</Data></Cell>
<Cell><Data ss:Type="String">0..*</Data></Cell>
<Cell ss:Index="6"><Data ss:Type="String">string</Data></Cell>
<Cell ss:Index="6"><Data ss:Type="String"></Data></Cell>
<Cell ss:Index="8"><Data ss:Type="String">DNA analysis discrete sequence variation</Data></Cell>
<Cell><Data ss:Type="String">DNA analysis discrete sequence variation</Data></Cell>
<Cell ss:Index="17"><Data ss:Type="String">55208-3</Data></Cell>

View File

@ -366,7 +366,7 @@
<Cell ss:StyleID="s66"><NamedCell ss:Name="_FilterDatabase"/></Cell>
<Cell ss:StyleID="s66"><Data ss:Type="String">0;20</Data><NamedCell
ss:Name="_FilterDatabase"/></Cell>
<Cell><Data ss:Type="String">code</Data><NamedCell ss:Name="_FilterDatabase"/></Cell>
<Cell><Data ss:Type="String"></Data><NamedCell ss:Name="_FilterDatabase"/></Cell>
<Cell ss:StyleID="s66"><NamedCell ss:Name="_FilterDatabase"/></Cell>
<Cell><Data ss:Type="String">Details about packaged medications</Data><NamedCell
ss:Name="_FilterDatabase"/></Cell>