Release new version
This commit is contained in:
parent
4726b6d37c
commit
3e9262afe8
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>org.hl7.fhir.core</artifactId>
|
||||
<version>3.7.20-SNAPSHOT</version>
|
||||
<version>3.7.21-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>org.hl7.fhir.core</artifactId>
|
||||
<version>3.7.20-SNAPSHOT</version>
|
||||
<version>3.7.21-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>org.hl7.fhir.core</artifactId>
|
||||
<version>3.7.20-SNAPSHOT</version>
|
||||
<version>3.7.21-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>org.hl7.fhir.core</artifactId>
|
||||
<version>3.7.20-SNAPSHOT</version>
|
||||
<version>3.7.21-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>org.hl7.fhir.core</artifactId>
|
||||
<version>3.7.20-SNAPSHOT</version>
|
||||
<version>3.7.21-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>org.hl7.fhir.core</artifactId>
|
||||
<version>3.7.20-SNAPSHOT</version>
|
||||
<version>3.7.21-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ public class BaseWriter {
|
|||
}
|
||||
|
||||
protected JsonArray forceArray(String arrayName) {
|
||||
JsonArray arr = object.get(arrayName).getAsJsonArray();
|
||||
JsonArray arr = object.getAsJsonArray(arrayName);
|
||||
if (arr == null) {
|
||||
arr = new JsonArray();
|
||||
object.add(arrayName, arr);
|
||||
|
|
|
@ -116,14 +116,14 @@ public class GraphQLSchemaGenerator {
|
|||
private void generateCreate(BufferedWriter writer, String name) throws IOException {
|
||||
writer.write("type "+name+"CreateType {\r\n");
|
||||
writer.write(" "+name+"Create(");
|
||||
param(writer, "resource", name, false, false);
|
||||
writer.write(") : "+name+"Creation\r\n");
|
||||
param(writer, "resource", name+"Input", false, false);
|
||||
writer.write("): "+name+"Creation\r\n");
|
||||
writer.write("}\r\n");
|
||||
writer.write("\r\n");
|
||||
writer.write("type "+name+"Creation {\r\n");
|
||||
writer.write(" location : String\r\n");
|
||||
writer.write(" resource : "+name+"\r\n");
|
||||
writer.write(" information : OperationOutcome\r\n");
|
||||
writer.write(" location: String\r\n");
|
||||
writer.write(" resource: "+name+"\r\n");
|
||||
writer.write(" information: OperationOutcome\r\n");
|
||||
writer.write("}\r\n");
|
||||
writer.write("\r\n");
|
||||
}
|
||||
|
@ -132,13 +132,14 @@ public class GraphQLSchemaGenerator {
|
|||
writer.write("type "+name+"UpdateType {\r\n");
|
||||
writer.write(" "+name+"Update(");
|
||||
param(writer, "id", "ID", false, false);
|
||||
param(writer, "resource", name, false, false);
|
||||
writer.write(") : "+name+"Update\r\n");
|
||||
writer.write(", ");
|
||||
param(writer, "resource", name+"Input", false, false);
|
||||
writer.write("): "+name+"Update\r\n");
|
||||
writer.write("}\r\n");
|
||||
writer.write("\r\n");
|
||||
writer.write("type "+name+"Update {\r\n");
|
||||
writer.write(" resource : "+name+"\r\n");
|
||||
writer.write(" information : OperationOutcome\r\n");
|
||||
writer.write(" resource: "+name+"\r\n");
|
||||
writer.write(" information: OperationOutcome\r\n");
|
||||
writer.write("}\r\n");
|
||||
writer.write("\r\n");
|
||||
}
|
||||
|
@ -147,11 +148,11 @@ public class GraphQLSchemaGenerator {
|
|||
writer.write("type "+name+"DeleteType {\r\n");
|
||||
writer.write(" "+name+"Delete(");
|
||||
param(writer, "id", "ID", false, false);
|
||||
writer.write(") : "+name+"Delete\r\n");
|
||||
writer.write("): "+name+"Delete\r\n");
|
||||
writer.write("}\r\n");
|
||||
writer.write("\r\n");
|
||||
writer.write("type "+name+"Delete {\r\n");
|
||||
writer.write(" information : OperationOutcome\r\n");
|
||||
writer.write(" information: OperationOutcome\r\n");
|
||||
writer.write("}\r\n");
|
||||
writer.write("\r\n");
|
||||
}
|
||||
|
@ -165,7 +166,7 @@ public class GraphQLSchemaGenerator {
|
|||
param(writer, "_sort", "String", false, true);
|
||||
param(writer, "_count", "Int", false, true);
|
||||
param(writer, "_cursor", "String", false, true);
|
||||
writer.write(") : ["+name+"]\r\n");
|
||||
writer.write("): ["+name+"]\r\n");
|
||||
writer.write("}\r\n");
|
||||
writer.write("\r\n");
|
||||
}
|
||||
|
@ -174,7 +175,7 @@ public class GraphQLSchemaGenerator {
|
|||
if (line)
|
||||
writer.write("\r\n ");
|
||||
writer.write(name);
|
||||
writer.write(" : ");
|
||||
writer.write(": ");
|
||||
if (list)
|
||||
writer.write("[");
|
||||
writer.write(type);
|
||||
|
@ -191,24 +192,24 @@ public class GraphQLSchemaGenerator {
|
|||
param(writer, "_sort", "String", false, true);
|
||||
param(writer, "_count", "Int", false, true);
|
||||
param(writer, "_cursor", "String", false, true);
|
||||
writer.write(") : "+name+"Connection\r\n");
|
||||
writer.write("): "+name+"Connection\r\n");
|
||||
writer.write("}\r\n");
|
||||
writer.write("\r\n");
|
||||
writer.write("type "+name+"Connection {\r\n");
|
||||
writer.write(" count : Int\r\n");
|
||||
writer.write(" offset : Int\r\n");
|
||||
writer.write(" pagesize : Int\r\n");
|
||||
writer.write(" first : ID\r\n");
|
||||
writer.write(" previous : ID\r\n");
|
||||
writer.write(" next : ID\r\n");
|
||||
writer.write(" last : ID\r\n");
|
||||
writer.write(" edges : ["+name+"Edge]\r\n");
|
||||
writer.write(" count: Int\r\n");
|
||||
writer.write(" offset: Int\r\n");
|
||||
writer.write(" pagesize: Int\r\n");
|
||||
writer.write(" first: ID\r\n");
|
||||
writer.write(" previous: ID\r\n");
|
||||
writer.write(" next: ID\r\n");
|
||||
writer.write(" last: ID\r\n");
|
||||
writer.write(" edges: ["+name+"Edge]\r\n");
|
||||
writer.write("}\r\n");
|
||||
writer.write("\r\n");
|
||||
writer.write("type "+name+"Edge {\r\n");
|
||||
writer.write(" mode : String\r\n");
|
||||
writer.write(" score : Float\r\n");
|
||||
writer.write(" resource : "+name+"\r\n");
|
||||
writer.write(" mode: String\r\n");
|
||||
writer.write(" score: Float\r\n");
|
||||
writer.write(" resource: "+name+"\r\n");
|
||||
writer.write("}\r\n");
|
||||
writer.write("\r\n");
|
||||
}
|
||||
|
@ -216,15 +217,15 @@ public class GraphQLSchemaGenerator {
|
|||
|
||||
private void generateIdAccess(BufferedWriter writer, String name) throws IOException {
|
||||
writer.write("type "+name+"ReadType {\r\n");
|
||||
writer.write(" "+name+"(id : ID!) : "+name+"\r\n");
|
||||
writer.write(" "+name+"(id: ID!): "+name+"\r\n");
|
||||
writer.write("}\r\n");
|
||||
writer.write("\r\n");
|
||||
}
|
||||
|
||||
private void generateElementBase(BufferedWriter writer) throws IOException {
|
||||
writer.write("type ElementBase {\r\n");
|
||||
writer.write(" id : ID\r\n");
|
||||
writer.write(" extension : [Extension]{\r\n");
|
||||
writer.write(" id: ID\r\n");
|
||||
writer.write(" extension: [Extension]\r\n");
|
||||
writer.write("}\r\n");
|
||||
writer.write("\r\n");
|
||||
|
||||
|
@ -241,7 +242,7 @@ public class GraphQLSchemaGenerator {
|
|||
b.append(sd.getName());
|
||||
b.append(" {\r\n");
|
||||
ElementDefinition ed = sd.getSnapshot().getElementFirstRep();
|
||||
generateProperties(list, b, sd.getName(), sd, ed, "type");
|
||||
generateProperties(list, b, sd.getName(), sd, ed, "type", "");
|
||||
b.append("}");
|
||||
b.append("\r\n");
|
||||
b.append("\r\n");
|
||||
|
@ -252,9 +253,9 @@ public class GraphQLSchemaGenerator {
|
|||
list.add(b);
|
||||
b.append("input ");
|
||||
b.append(sd.getName());
|
||||
b.append(" {\r\n");
|
||||
b.append("Input {\r\n");
|
||||
ed = sd.getSnapshot().getElementFirstRep();
|
||||
generateProperties(list, b, sd.getName(), sd, ed, "input");
|
||||
generateProperties(list, b, sd.getName(), sd, ed, "input", "Input");
|
||||
b.append("}");
|
||||
b.append("\r\n");
|
||||
b.append("\r\n");
|
||||
|
@ -262,22 +263,22 @@ public class GraphQLSchemaGenerator {
|
|||
writer.write(bs.toString());
|
||||
}
|
||||
|
||||
private void generateProperties(List<StringBuilder> list, StringBuilder b, String typeName, StructureDefinition sd, ElementDefinition ed, String mode) throws IOException {
|
||||
private void generateProperties(List<StringBuilder> list, StringBuilder b, String typeName, StructureDefinition sd, ElementDefinition ed, String mode, String suffix) throws IOException {
|
||||
List<ElementDefinition> children = ProfileUtilities.getChildList(sd, ed);
|
||||
for (ElementDefinition child : children) {
|
||||
if (child.hasContentReference()) {
|
||||
ElementDefinition ref = resolveContentReference(sd, child.getContentReference());
|
||||
generateProperty(list, b, typeName, sd, child, ref.getType().get(0), false, ref, mode);
|
||||
generateProperty(list, b, typeName, sd, child, ref.getType().get(0), false, ref, mode, suffix);
|
||||
} else if (child.getType().size() == 1) {
|
||||
generateProperty(list, b, typeName, sd, child, child.getType().get(0), false, null, mode);
|
||||
generateProperty(list, b, typeName, sd, child, child.getType().get(0), false, null, mode, suffix);
|
||||
} else {
|
||||
boolean ref = false;
|
||||
for (TypeRefComponent t : child.getType()) {
|
||||
if (!t.hasTarget())
|
||||
generateProperty(list, b, typeName, sd, child, t, true, null, mode);
|
||||
generateProperty(list, b, typeName, sd, child, t, true, null, mode, suffix);
|
||||
else if (!ref) {
|
||||
ref = true;
|
||||
generateProperty(list, b, typeName, sd, child, t, true, null, mode);
|
||||
generateProperty(list, b, typeName, sd, child, t, true, null, mode, suffix);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -293,7 +294,7 @@ public class GraphQLSchemaGenerator {
|
|||
throw new Error("Unable to find "+id);
|
||||
}
|
||||
|
||||
private void generateProperty(List<StringBuilder> list, StringBuilder b, String typeName, StructureDefinition sd, ElementDefinition child, TypeRefComponent typeDetails, boolean suffix, ElementDefinition cr, String mode) throws IOException {
|
||||
private void generateProperty(List<StringBuilder> list, StringBuilder b, String typeName, StructureDefinition sd, ElementDefinition child, TypeRefComponent typeDetails, boolean suffix, ElementDefinition cr, String mode, String suffixS) throws IOException {
|
||||
if (isPrimitive(typeDetails)) {
|
||||
String n = getGqlname(typeDetails.getCode());
|
||||
b.append(" ");
|
||||
|
@ -323,11 +324,11 @@ public class GraphQLSchemaGenerator {
|
|||
b.append("[");
|
||||
String type = typeDetails.getCode();
|
||||
if (cr != null)
|
||||
b.append(generateInnerType(list, sd, typeName, cr, mode));
|
||||
b.append(generateInnerType(list, sd, typeName, cr, mode, suffixS));
|
||||
else if (Utilities.existsInList(type, "Element", "BackboneElement"))
|
||||
b.append(generateInnerType(list, sd, typeName, child, mode));
|
||||
b.append(generateInnerType(list, sd, typeName, child, mode, suffixS));
|
||||
else
|
||||
b.append(type);
|
||||
b.append(type+suffixS);
|
||||
if (!child.getMax().equals("1"))
|
||||
b.append("]");
|
||||
if (child.getMin() != 0 && !suffix)
|
||||
|
@ -336,7 +337,7 @@ public class GraphQLSchemaGenerator {
|
|||
}
|
||||
}
|
||||
|
||||
private String generateInnerType(List<StringBuilder> list, StructureDefinition sd, String name, ElementDefinition child, String mode) throws IOException {
|
||||
private String generateInnerType(List<StringBuilder> list, StructureDefinition sd, String name, ElementDefinition child, String mode, String suffix) throws IOException {
|
||||
if (child.hasUserData(INNER_TYPE_NAME+"."+mode))
|
||||
return child.getUserString(INNER_TYPE_NAME+"."+mode);
|
||||
|
||||
|
@ -347,12 +348,13 @@ public class GraphQLSchemaGenerator {
|
|||
b.append(mode);
|
||||
b.append(" ");
|
||||
b.append(typeName);
|
||||
b.append(suffix);
|
||||
b.append(" {\r\n");
|
||||
generateProperties(list, b, typeName, sd, child, mode);
|
||||
generateProperties(list, b, typeName, sd, child, mode, suffix);
|
||||
b.append("}");
|
||||
b.append("\r\n");
|
||||
b.append("\r\n");
|
||||
return typeName;
|
||||
return typeName+suffix;
|
||||
}
|
||||
|
||||
private String tail(String path, boolean suffix) {
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package org.hl7.fhir.r5.utils.formats;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
/*-
|
||||
* #%L
|
||||
* org.hl7.fhir.r5
|
||||
|
@ -22,10 +24,12 @@ package org.hl7.fhir.r5.utils.formats;
|
|||
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Map;
|
||||
import java.util.Stack;
|
||||
|
||||
import org.hl7.fhir.utilities.TextFile;
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
|
||||
import com.google.gson.JsonArray;
|
||||
|
@ -333,6 +337,26 @@ public class JsonTrackingParser {
|
|||
private String itemName;
|
||||
private String itemValue;
|
||||
|
||||
public static JsonObject parseJson(String source) throws IOException {
|
||||
return parse(source, null);
|
||||
}
|
||||
|
||||
public static JsonObject parseJson(InputStream stream) throws IOException {
|
||||
return parse(TextFile.streamToString(stream), null);
|
||||
}
|
||||
|
||||
public static JsonObject parseJson(byte[] stream) throws IOException {
|
||||
return parse(TextFile.bytesToString(stream), null);
|
||||
}
|
||||
|
||||
public static JsonObject parseJson(File source) throws IOException {
|
||||
return parse(TextFile.fileToString(source), null);
|
||||
}
|
||||
|
||||
public static JsonObject parseJsonFile(String source) throws IOException {
|
||||
return parse(TextFile.fileToString(source), null);
|
||||
}
|
||||
|
||||
public static JsonObject parse(String source, Map<JsonElement, LocationData> map) throws IOException {
|
||||
JsonTrackingParser self = new JsonTrackingParser();
|
||||
self.map = map;
|
||||
|
@ -404,7 +428,8 @@ public class JsonTrackingParser {
|
|||
loc = lexer.location.copy();
|
||||
obj.add(itemName, arr);
|
||||
next();
|
||||
readArray(arr, false);
|
||||
if (!readArray(arr, false))
|
||||
next(true);
|
||||
if (map != null)
|
||||
map.put(arr, loc);
|
||||
break;
|
||||
|
@ -418,8 +443,10 @@ public class JsonTrackingParser {
|
|||
}
|
||||
}
|
||||
|
||||
private void readArray(JsonArray arr, boolean root) throws IOException {
|
||||
private boolean readArray(JsonArray arr, boolean root) throws IOException {
|
||||
boolean res = false;
|
||||
while (!((itemType == ItemType.End) || (root && (itemType == ItemType.Eof)))) {
|
||||
res = true;
|
||||
switch (itemType) {
|
||||
case Object:
|
||||
JsonObject obj = new JsonObject(); // (arr.path+'['+inttostr(i)+']');
|
||||
|
@ -466,9 +493,14 @@ public class JsonTrackingParser {
|
|||
}
|
||||
next();
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
private void next() throws IOException {
|
||||
private void next() throws IOException {
|
||||
next(false);
|
||||
}
|
||||
|
||||
private void next(boolean noPop) throws IOException {
|
||||
switch (itemType) {
|
||||
case Object :
|
||||
lexer.consume(TokenType.Open);
|
||||
|
@ -484,7 +516,7 @@ public class JsonTrackingParser {
|
|||
case Number:
|
||||
case End:
|
||||
case Boolean :
|
||||
if (itemType == ItemType.End)
|
||||
if (itemType == ItemType.End && !noPop)
|
||||
lexer.states.pop();
|
||||
if (lexer.getType() == TokenType.Comma) {
|
||||
lexer.next();
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>org.hl7.fhir.core</artifactId>
|
||||
<version>3.7.20-SNAPSHOT</version>
|
||||
<version>3.7.21-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>org.hl7.fhir.core</artifactId>
|
||||
<version>3.7.20-SNAPSHOT</version>
|
||||
<version>3.7.21-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>org.hl7.fhir.core</artifactId>
|
||||
<version>3.7.20-SNAPSHOT</version>
|
||||
<version>3.7.21-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -151,7 +151,6 @@ import ca.uhn.fhir.util.ObjectUtil;
|
|||
|
||||
public class InstanceValidator extends BaseValidator implements IResourceValidator {
|
||||
|
||||
|
||||
private class ValidatorHostContext {
|
||||
private Object appContext;
|
||||
private Element container; // bundle, or parameters
|
||||
|
|
2
pom.xml
2
pom.xml
|
@ -13,7 +13,7 @@
|
|||
each other. It is fine to bump the point version of this POM without affecting
|
||||
HAPI FHIR.
|
||||
-->
|
||||
<version>3.7.20-SNAPSHOT</version>
|
||||
<version>3.7.21-SNAPSHOT</version>
|
||||
|
||||
<properties>
|
||||
<hapi_fhir_version>3.7.0-SNAPSHOT</hapi_fhir_version>
|
||||
|
|
|
@ -4,11 +4,11 @@ REM make sure you are committed
|
|||
echo
|
||||
|
||||
echo ===============================================================
|
||||
echo upgrade and release fhir.core from 3.7.19-SNAPSHOT to 3.7.20-SNAPSHOT
|
||||
echo upgrade and release fhir.core from 3.7.20-SNAPSHOT to 3.7.21-SNAPSHOT
|
||||
echo ===============================================================
|
||||
pause
|
||||
|
||||
call mvn versions:set -DnewVersion=3.7.20-SNAPSHOT
|
||||
call mvn versions:set -DnewVersion=3.7.21-SNAPSHOT
|
||||
|
||||
echo ===============================================================
|
||||
echo upgraded version number using maven
|
||||
|
@ -25,8 +25,8 @@ echo next: replace references in java code + ivy
|
|||
echo ===============================================================
|
||||
pause
|
||||
|
||||
call "C:\tools\fnr.exe" --cl --dir "C:\work\org.hl7.fhir\build" --fileMask "*.java" --excludeFileMask "*.dll, *.exe" --includeSubDirectories --find "3.7.19-SNAPSHOT" --replace "3.7.20-SNAPSHOT"
|
||||
call "C:\tools\fnr.exe" --cl --dir "C:\work\org.hl7.fhir\build" --fileMask "*.xml" --excludeFileMask "*.dll, *.exe" --find "3.7.19-SNAPSHOT" --replace "3.7.20-SNAPSHOT"
|
||||
call "C:\tools\fnr.exe" --cl --dir "C:\work\org.hl7.fhir\build" --fileMask "*.java" --excludeFileMask "*.dll, *.exe" --includeSubDirectories --find "3.7.20-SNAPSHOT" --replace "3.7.21-SNAPSHOT"
|
||||
call "C:\tools\fnr.exe" --cl --dir "C:\work\org.hl7.fhir\build" --fileMask "*.xml" --excludeFileMask "*.dll, *.exe" --find "3.7.20-SNAPSHOT" --replace "3.7.21-SNAPSHOT"
|
||||
|
||||
echo ===============================================================
|
||||
echo done replacing references
|
||||
|
|
Loading…
Reference in New Issue