R4B fixes

This commit is contained in:
Grahame Grieve 2021-03-10 21:44:42 +11:00
parent 455cc5cf7f
commit 67d3ab72e3
4 changed files with 10 additions and 6 deletions

View File

@ -6568,7 +6568,7 @@ The primary difference between a medicationusage and a medicationadministration
*/ */
NULL; NULL;
public static final FHIRVersion R4B = FHIRVersion._4_0_1; public static final FHIRVersion R4B = FHIRVersion._4_1_0;
public static FHIRVersion fromCode(String codeString) throws FHIRException { public static FHIRVersion fromCode(String codeString) throws FHIRException {
if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString))
@ -6826,7 +6826,7 @@ public String toCode(int len) {
} }
public boolean isR4B() { public boolean isR4B() {
return toCode().startsWith("4.0"); return toCode().startsWith("4.1");
} }
// end addition // end addition
} }

View File

@ -67,10 +67,12 @@ public class GraphQLSchemaGenerator {
private static final String INNER_TYPE_NAME = "gql.type.name"; private static final String INNER_TYPE_NAME = "gql.type.name";
IWorkerContext context; IWorkerContext context;
private ProfileUtilities profileUtilities; private ProfileUtilities profileUtilities;
private String version;
public GraphQLSchemaGenerator(IWorkerContext context) { public GraphQLSchemaGenerator(IWorkerContext context, String version) {
super(); super();
this.context = context; this.context = context;
this.version = version;
profileUtilities = new ProfileUtilities(context, null, null); profileUtilities = new ProfileUtilities(context, null, null);
} }
@ -87,7 +89,7 @@ public class GraphQLSchemaGenerator {
tl.put(sd.getName(), sd); tl.put(sd.getName(), sd);
} }
} }
writer.write("# FHIR GraphQL Schema. Version "+Constants.VERSION+"\r\n\r\n"); writer.write("# FHIR GraphQL Schema. Version "+version+"\r\n\r\n");
writer.write("# FHIR Defined Primitive types\r\n"); writer.write("# FHIR Defined Primitive types\r\n");
for (String n : sorted(pl.keySet())) for (String n : sorted(pl.keySet()))
generatePrimitive(writer, pl.get(n)); generatePrimitive(writer, pl.get(n));
@ -107,7 +109,7 @@ public class GraphQLSchemaGenerator {
public void generateResource(OutputStream stream, StructureDefinition sd, List<SearchParameter> parameters, EnumSet<FHIROperationType> operations) throws IOException, FHIRException { public void generateResource(OutputStream stream, StructureDefinition sd, List<SearchParameter> parameters, EnumSet<FHIROperationType> operations) throws IOException, FHIRException {
BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(stream)); BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(stream));
writer.write("# FHIR GraphQL Schema. Version "+Constants.VERSION+"\r\n\r\n"); writer.write("# FHIR GraphQL Schema. Version "+version+"\r\n\r\n");
writer.write("# import the types from 'types.graphql'\r\n\r\n"); writer.write("# import the types from 'types.graphql'\r\n\r\n");
generateType(writer, sd); generateType(writer, sd);
if (operations.contains(FHIROperationType.READ)) if (operations.contains(FHIROperationType.READ))

View File

@ -276,6 +276,8 @@ public class NPMPackageGenerator {
return "hl7.fhir.r3.core"; return "hl7.fhir.r3.core";
if (v.startsWith("4.0")) if (v.startsWith("4.0"))
return "hl7.fhir.r4.core"; return "hl7.fhir.r4.core";
if (v.startsWith("4.1"))
return "hl7.fhir.r4b.core";
return null; return null;
} }

View File

@ -111,7 +111,7 @@ public class TypesUtilities {
res.add(new WildcardInformation("id", TypeClassification.PRIMITIVE)); res.add(new WildcardInformation("id", TypeClassification.PRIMITIVE));
res.add(new WildcardInformation("instant", TypeClassification.PRIMITIVE)); res.add(new WildcardInformation("instant", TypeClassification.PRIMITIVE));
res.add(new WildcardInformation("integer", TypeClassification.PRIMITIVE)); res.add(new WildcardInformation("integer", TypeClassification.PRIMITIVE));
if (!version.startsWith("4.0")) { if (!version.startsWith("4.1")) {
res.add(new WildcardInformation("integer64", TypeClassification.PRIMITIVE)); res.add(new WildcardInformation("integer64", TypeClassification.PRIMITIVE));
} }
res.add(new WildcardInformation("markdown", TypeClassification.PRIMITIVE)); res.add(new WildcardInformation("markdown", TypeClassification.PRIMITIVE));