From 98a99ec6307d664126a89043a02560d02e3d0458 Mon Sep 17 00:00:00 2001 From: Lukas Schmierer Date: Mon, 4 Oct 2021 13:21:29 +0200 Subject: [PATCH] fix duplicate scalar "date" --- .../org/hl7/fhir/r4/utils/GraphQLSchemaGenerator.java | 8 ++++++-- .../org/hl7/fhir/r5/utils/GraphQLSchemaGenerator.java | 6 +++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/utils/GraphQLSchemaGenerator.java b/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/utils/GraphQLSchemaGenerator.java index f48f5f25a..b65f6781d 100644 --- a/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/utils/GraphQLSchemaGenerator.java +++ b/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/utils/GraphQLSchemaGenerator.java @@ -415,11 +415,15 @@ public class GraphQLSchemaGenerator { private void generateSearchParamType(BufferedWriter writer, String name) throws IOException, FHIRException { String gqlName = getGqlname(name); - if (gqlName.equals(name)) { + if (gqlName.equals("date")) { + writer.write("# Search Param "); + writer.write(name); + writer.write(": already defined as Primitive with JSON Format: string "); + } else if (gqlName.equals(name)) { writer.write("scalar "); writer.write(name); writer.write(" # JSON Format: string"); - } else { + } else { writer.write("# Search Param "); writer.write(name); writer.write(": use GraphQL Scalar type "); diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/GraphQLSchemaGenerator.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/GraphQLSchemaGenerator.java index 8338c78bd..5851ead3a 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/GraphQLSchemaGenerator.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/GraphQLSchemaGenerator.java @@ -418,7 +418,11 @@ public class GraphQLSchemaGenerator { private void generateSearchParamType(BufferedWriter writer, String name) throws IOException, FHIRException { String gqlName = getGqlname(name); - if (gqlName.equals(name)) { + if (gqlName.equals("date")) { + writer.write("# Search Param "); + writer.write(name); + writer.write(": already defined as Primitive with JSON Format: string "); + } else if (gqlName.equals(name)) { writer.write("scalar "); writer.write(name); writer.write(" # JSON Format: string");