diff --git a/bunsen/bunsen-avro/src/main/java/com/cerner/bunsen/avro/converters/DefinitionToAvroVisitor.java b/bunsen/bunsen-avro/src/main/java/com/cerner/bunsen/avro/converters/DefinitionToAvroVisitor.java index 9a72f05a2..a9fc9356d 100644 --- a/bunsen/bunsen-avro/src/main/java/com/cerner/bunsen/avro/converters/DefinitionToAvroVisitor.java +++ b/bunsen/bunsen-avro/src/main/java/com/cerner/bunsen/avro/converters/DefinitionToAvroVisitor.java @@ -102,7 +102,7 @@ public Schema getDataType() { // FHIR (Double and BigDecimal are not assignable to each other hence explicit conversions). // Note with this approach we are loosing some precision! private static final HapiConverter DOUBLE_CONVERTER = - new PrimitiveConverter("Double") { + new PrimitiveConverter("Decimal") { @Override public void toHapi(Object input, IPrimitiveType primitive) { Preconditions.checkArgument((input instanceof BigDecimal) || (input instanceof Double)); diff --git a/bunsen/bunsen-avro/src/test/java/com/cerner/bunsen/avro/R4AvroConverterUsCoreTest.java b/bunsen/bunsen-avro/src/test/java/com/cerner/bunsen/avro/R4AvroConverterUsCoreTest.java index ca8ff5739..8379f81ff 100644 --- a/bunsen/bunsen-avro/src/test/java/com/cerner/bunsen/avro/R4AvroConverterUsCoreTest.java +++ b/bunsen/bunsen-avro/src/test/java/com/cerner/bunsen/avro/R4AvroConverterUsCoreTest.java @@ -37,6 +37,7 @@ import org.hl7.fhir.r4.model.Patient; import org.hl7.fhir.r4.model.Provenance; import org.hl7.fhir.r4.model.Quantity; +import org.hl7.fhir.r4.model.QuestionnaireResponse; import org.hl7.fhir.r4.model.Task; import org.junit.Assert; import org.junit.BeforeClass; @@ -101,6 +102,13 @@ public class R4AvroConverterUsCoreTest { private static Encounter testEncounterDecoded; + private static QuestionnaireResponse testQuestionnaireResponse = + TestData.newQuestionnaireResponse(); + + private static Record avroQuestionnaireResponse; + + private static QuestionnaireResponse testQuestionnaireResponseDecoded; + private static FhirContext fhirContext; /** Initialize test data. */ @@ -175,6 +183,15 @@ public static void convertTestData() throws ProfileException { AvroConverter.forResources(fhirContext, R4UsCoreProfileData.US_CORE_ENCOUNTER_PROFILES, 1); avroEncounter = (Record) encounterConverter.resourceToAvro(testEncounter); testEncounterDecoded = (Encounter) encounterConverter.avroToResource(avroEncounter); + + AvroConverter questionnaireResponseConverter = + AvroConverter.forResources( + fhirContext, R4UsCoreProfileData.US_CORE_QUESTIONNAIRE_RESPONSE_PROFILES, 1); + avroQuestionnaireResponse = + (Record) questionnaireResponseConverter.resourceToAvro(testQuestionnaireResponse); + testQuestionnaireResponseDecoded = + (QuestionnaireResponse) + questionnaireResponseConverter.avroToResource(avroQuestionnaireResponse); } @Test @@ -588,4 +605,9 @@ public void testEncounterConversions() { Assert.assertEquals( testEncounter.getParticipant().size(), testEncounterDecoded.getParticipant().size()); } + + @Test + public void setTestQuestionnaireResponseConversions() { + Assert.assertTrue(testQuestionnaireResponse.equalsDeep(testQuestionnaireResponseDecoded)); + } } diff --git a/bunsen/bunsen-avro/src/test/resources/r4-custom-schemas/bunsen-test-patient-schema.json b/bunsen/bunsen-avro/src/test/resources/r4-custom-schemas/bunsen-test-patient-schema.json index 34087b8a3..9ac105b94 100644 --- a/bunsen/bunsen-avro/src/test/resources/r4-custom-schemas/bunsen-test-patient-schema.json +++ b/bunsen/bunsen-avro/src/test/resources/r4-custom-schemas/bunsen-test-patient-schema.json @@ -522,9 +522,8 @@ "null", { "type": "record", - "name": "assignerReference", - "namespace": "Identifier", - "doc": "Structure for FHIR type Identifier.assignerReference", + "name": "PatientIdentifierAssignerReference", + "doc": "Structure for FHIR type PatientIdentifierAssignerReference", "fields": [ { "name": "organizationId", @@ -562,6 +561,228 @@ "doc": "Reference field", "default": null }, + { + "name": "identifier", + "type": [ + "null", + { + "type": "record", + "name": "PatientIdentifierReferenceIdentifier", + "doc": "Structure for FHIR type Identifier", + "fields": [ + { + "name": "use", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property use", + "default": null + }, + { + "name": "type", + "type": [ + "null", + { + "type": "record", + "name": "PatientIdentifierReferenceIdentifierCodeableConcept", + "doc": "Structure for FHIR type CodeableConcept", + "fields": [ + { + "name": "coding", + "type": [ + "null", + { + "type": "array", + "items": { + "type": "record", + "name": "PatientIdentifierReferenceIdentifierCodeableConceptCoding", + "doc": "Structure for FHIR type Coding", + "fields": [ + { + "name": "system", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property system", + "default": null + }, + { + "name": "version", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property version", + "default": null + }, + { + "name": "code", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property code", + "default": null + }, + { + "name": "display", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property display", + "default": null + }, + { + "name": "userSelected", + "type": [ + "null", + "boolean" + ], + "doc": "Field for FHIR property userSelected", + "default": null + } + ] + } + } + ], + "doc": "Field for FHIR property coding", + "default": null + }, + { + "name": "text", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property text", + "default": null + } + ] + } + ], + "doc": "Field for FHIR property type", + "default": null + }, + { + "name": "system", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property system", + "default": null + }, + { + "name": "value", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property value", + "default": null + }, + { + "name": "period", + "type": [ + "null", + { + "type": "record", + "name": "PatientIdentifierReferenceIdentifierPeriod", + "doc": "Structure for FHIR type Period", + "fields": [ + { + "name": "start", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property start", + "default": null + }, + { + "name": "end", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property end", + "default": null + } + ] + } + ], + "doc": "Field for FHIR property period", + "default": null + }, + { + "name": "assigner", + "type": [ + "null", + { + "type": "record", + "name": "PatientIdentifierReferenceIdentifierAssignerReference", + "doc": "Structure for FHIR type PatientIdentifierReferenceIdentifierAssignerReference", + "fields": [ + { + "name": "organizationId", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "id", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "reference", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "type", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "display", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + } + ] + } + ], + "doc": "Field for FHIR property assigner", + "default": null + } + ] + } + ], + "doc": "Reference field", + "default": null + }, { "name": "display", "type": [ @@ -1645,9 +1866,8 @@ "null", { "type": "record", - "name": "organizationReference", - "namespace": "Patient.contact", - "doc": "Structure for FHIR type Patient.contact.organizationReference", + "name": "PatientContactOrganizationReference", + "doc": "Structure for FHIR type PatientContactOrganizationReference", "fields": [ { "name": "organizationId", @@ -1692,7 +1912,6 @@ { "type": "record", "name": "PatientContactReferenceIdentifier", - "namespace": "com.cerner.bunsen.r4.avro", "doc": "Structure for FHIR type Identifier", "fields": [ { @@ -1846,7 +2065,244 @@ "name": "assigner", "type": [ "null", - "Identifier.assignerReference" + { + "type": "record", + "name": "PatientContactReferenceIdentifierAssignerReference", + "doc": "Structure for FHIR type PatientContactReferenceIdentifierAssignerReference", + "fields": [ + { + "name": "organizationId", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "id", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "reference", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "type", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "identifier", + "type": [ + "null", + { + "type": "record", + "name": "PatientContactReferenceIdentifierReferenceIdentifier", + "doc": "Structure for FHIR type Identifier", + "fields": [ + { + "name": "use", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property use", + "default": null + }, + { + "name": "type", + "type": [ + "null", + { + "type": "record", + "name": "PatientContactReferenceIdentifierReferenceIdentifierCodeableConcept", + "doc": "Structure for FHIR type CodeableConcept", + "fields": [ + { + "name": "coding", + "type": [ + "null", + { + "type": "array", + "items": { + "type": "record", + "name": "PatientContactReferenceIdentifierReferenceIdentifierCodeableConceptCoding", + "doc": "Structure for FHIR type Coding", + "fields": [ + { + "name": "system", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property system", + "default": null + }, + { + "name": "version", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property version", + "default": null + }, + { + "name": "code", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property code", + "default": null + }, + { + "name": "display", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property display", + "default": null + }, + { + "name": "userSelected", + "type": [ + "null", + "boolean" + ], + "doc": "Field for FHIR property userSelected", + "default": null + } + ] + } + } + ], + "doc": "Field for FHIR property coding", + "default": null + }, + { + "name": "text", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property text", + "default": null + } + ] + } + ], + "doc": "Field for FHIR property type", + "default": null + }, + { + "name": "system", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property system", + "default": null + }, + { + "name": "value", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property value", + "default": null + }, + { + "name": "period", + "type": [ + "null", + { + "type": "record", + "name": "PatientContactReferenceIdentifierReferenceIdentifierPeriod", + "doc": "Structure for FHIR type Period", + "fields": [ + { + "name": "start", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property start", + "default": null + }, + { + "name": "end", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property end", + "default": null + } + ] + } + ], + "doc": "Field for FHIR property period", + "default": null + }, + { + "name": "assigner", + "type": [ + "null", + { + "type": "record", + "name": "PatientContactReferenceIdentifierReferenceIdentifierAssignerReference", + "doc": "Structure for FHIR type PatientContactReferenceIdentifierReferenceIdentifierAssignerReference", + "fields": [ + { + "name": "organizationId", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + } + ] + } + ], + "doc": "Field for FHIR property assigner", + "default": null + } + ] + } + ], + "doc": "Reference field", + "default": null + }, + { + "name": "display", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + } + ] + } ], "doc": "Field for FHIR property assigner", "default": null @@ -2043,9 +2499,8 @@ "type": "array", "items": { "type": "record", - "name": "generalPractitionerReference", - "namespace": "Patient", - "doc": "Structure for FHIR type Patient.generalPractitionerReference", + "name": "PatientGeneralPractitionerReference", + "doc": "Structure for FHIR type PatientGeneralPractitionerReference", "fields": [ { "name": "organizationId", @@ -2108,7 +2563,6 @@ { "type": "record", "name": "PatientReferenceIdentifier", - "namespace": "com.cerner.bunsen.r4.avro", "doc": "Structure for FHIR type Identifier", "fields": [ { @@ -2262,7 +2716,244 @@ "name": "assigner", "type": [ "null", - "Identifier.assignerReference" + { + "type": "record", + "name": "PatientReferenceIdentifierAssignerReference", + "doc": "Structure for FHIR type PatientReferenceIdentifierAssignerReference", + "fields": [ + { + "name": "organizationId", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "id", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "reference", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "type", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "identifier", + "type": [ + "null", + { + "type": "record", + "name": "PatientReferenceIdentifierReferenceIdentifier", + "doc": "Structure for FHIR type Identifier", + "fields": [ + { + "name": "use", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property use", + "default": null + }, + { + "name": "type", + "type": [ + "null", + { + "type": "record", + "name": "PatientReferenceIdentifierReferenceIdentifierCodeableConcept", + "doc": "Structure for FHIR type CodeableConcept", + "fields": [ + { + "name": "coding", + "type": [ + "null", + { + "type": "array", + "items": { + "type": "record", + "name": "PatientReferenceIdentifierReferenceIdentifierCodeableConceptCoding", + "doc": "Structure for FHIR type Coding", + "fields": [ + { + "name": "system", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property system", + "default": null + }, + { + "name": "version", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property version", + "default": null + }, + { + "name": "code", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property code", + "default": null + }, + { + "name": "display", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property display", + "default": null + }, + { + "name": "userSelected", + "type": [ + "null", + "boolean" + ], + "doc": "Field for FHIR property userSelected", + "default": null + } + ] + } + } + ], + "doc": "Field for FHIR property coding", + "default": null + }, + { + "name": "text", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property text", + "default": null + } + ] + } + ], + "doc": "Field for FHIR property type", + "default": null + }, + { + "name": "system", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property system", + "default": null + }, + { + "name": "value", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property value", + "default": null + }, + { + "name": "period", + "type": [ + "null", + { + "type": "record", + "name": "PatientReferenceIdentifierReferenceIdentifierPeriod", + "doc": "Structure for FHIR type Period", + "fields": [ + { + "name": "start", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property start", + "default": null + }, + { + "name": "end", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property end", + "default": null + } + ] + } + ], + "doc": "Field for FHIR property period", + "default": null + }, + { + "name": "assigner", + "type": [ + "null", + { + "type": "record", + "name": "PatientReferenceIdentifierReferenceIdentifierAssignerReference", + "doc": "Structure for FHIR type PatientReferenceIdentifierReferenceIdentifierAssignerReference", + "fields": [ + { + "name": "organizationId", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + } + ] + } + ], + "doc": "Field for FHIR property assigner", + "default": null + } + ] + } + ], + "doc": "Reference field", + "default": null + }, + { + "name": "display", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + } + ] + } ], "doc": "Field for FHIR property assigner", "default": null @@ -2295,9 +2986,8 @@ "null", { "type": "record", - "name": "managingOrganizationReference", - "namespace": "Patient", - "doc": "Structure for FHIR type Patient.managingOrganizationReference", + "name": "PatientManagingOrganizationReference", + "doc": "Structure for FHIR type PatientManagingOrganizationReference", "fields": [ { "name": "organizationId", @@ -2339,7 +3029,7 @@ "name": "identifier", "type": [ "null", - "com.cerner.bunsen.r4.avro.PatientReferenceIdentifier" + "PatientReferenceIdentifier" ], "doc": "Reference field", "default": null @@ -2385,9 +3075,8 @@ "null", { "type": "record", - "name": "otherReference", - "namespace": "Patient.link", - "doc": "Structure for FHIR type Patient.link.otherReference", + "name": "PatientLinkOtherReference", + "doc": "Structure for FHIR type PatientLinkOtherReference", "fields": [ { "name": "patientId", @@ -2441,7 +3130,6 @@ { "type": "record", "name": "PatientLinkReferenceIdentifier", - "namespace": "com.cerner.bunsen.r4.avro", "doc": "Structure for FHIR type Identifier", "fields": [ { @@ -2595,7 +3283,244 @@ "name": "assigner", "type": [ "null", - "Identifier.assignerReference" + { + "type": "record", + "name": "PatientLinkReferenceIdentifierAssignerReference", + "doc": "Structure for FHIR type PatientLinkReferenceIdentifierAssignerReference", + "fields": [ + { + "name": "organizationId", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "id", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "reference", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "type", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "identifier", + "type": [ + "null", + { + "type": "record", + "name": "PatientLinkReferenceIdentifierReferenceIdentifier", + "doc": "Structure for FHIR type Identifier", + "fields": [ + { + "name": "use", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property use", + "default": null + }, + { + "name": "type", + "type": [ + "null", + { + "type": "record", + "name": "PatientLinkReferenceIdentifierReferenceIdentifierCodeableConcept", + "doc": "Structure for FHIR type CodeableConcept", + "fields": [ + { + "name": "coding", + "type": [ + "null", + { + "type": "array", + "items": { + "type": "record", + "name": "PatientLinkReferenceIdentifierReferenceIdentifierCodeableConceptCoding", + "doc": "Structure for FHIR type Coding", + "fields": [ + { + "name": "system", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property system", + "default": null + }, + { + "name": "version", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property version", + "default": null + }, + { + "name": "code", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property code", + "default": null + }, + { + "name": "display", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property display", + "default": null + }, + { + "name": "userSelected", + "type": [ + "null", + "boolean" + ], + "doc": "Field for FHIR property userSelected", + "default": null + } + ] + } + } + ], + "doc": "Field for FHIR property coding", + "default": null + }, + { + "name": "text", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property text", + "default": null + } + ] + } + ], + "doc": "Field for FHIR property type", + "default": null + }, + { + "name": "system", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property system", + "default": null + }, + { + "name": "value", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property value", + "default": null + }, + { + "name": "period", + "type": [ + "null", + { + "type": "record", + "name": "PatientLinkReferenceIdentifierReferenceIdentifierPeriod", + "doc": "Structure for FHIR type Period", + "fields": [ + { + "name": "start", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property start", + "default": null + }, + { + "name": "end", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property end", + "default": null + } + ] + } + ], + "doc": "Field for FHIR property period", + "default": null + }, + { + "name": "assigner", + "type": [ + "null", + { + "type": "record", + "name": "PatientLinkReferenceIdentifierReferenceIdentifierAssignerReference", + "doc": "Structure for FHIR type PatientLinkReferenceIdentifierReferenceIdentifierAssignerReference", + "fields": [ + { + "name": "organizationId", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + } + ] + } + ], + "doc": "Field for FHIR property assigner", + "default": null + } + ] + } + ], + "doc": "Reference field", + "default": null + }, + { + "name": "display", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + } + ] + } ], "doc": "Field for FHIR property assigner", "default": null diff --git a/bunsen/bunsen-avro/src/test/resources/r4-us-core-schemas/us-core-condition-schema.json b/bunsen/bunsen-avro/src/test/resources/r4-us-core-schemas/us-core-condition-schema.json index ffca93751..a028c4fdd 100644 --- a/bunsen/bunsen-avro/src/test/resources/r4-us-core-schemas/us-core-condition-schema.json +++ b/bunsen/bunsen-avro/src/test/resources/r4-us-core-schemas/us-core-condition-schema.json @@ -522,9 +522,8 @@ "null", { "type": "record", - "name": "assignerReference", - "namespace": "Identifier", - "doc": "Structure for FHIR type Identifier.assignerReference", + "name": "ConditionIdentifierAssignerReference", + "doc": "Structure for FHIR type ConditionIdentifierAssignerReference", "fields": [ { "name": "organizationId", @@ -562,6 +561,228 @@ "doc": "Reference field", "default": null }, + { + "name": "identifier", + "type": [ + "null", + { + "type": "record", + "name": "ConditionIdentifierReferenceIdentifier", + "doc": "Structure for FHIR type Identifier", + "fields": [ + { + "name": "use", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property use", + "default": null + }, + { + "name": "type", + "type": [ + "null", + { + "type": "record", + "name": "ConditionIdentifierReferenceIdentifierCodeableConcept", + "doc": "Structure for FHIR type CodeableConcept", + "fields": [ + { + "name": "coding", + "type": [ + "null", + { + "type": "array", + "items": { + "type": "record", + "name": "ConditionIdentifierReferenceIdentifierCodeableConceptCoding", + "doc": "Structure for FHIR type Coding", + "fields": [ + { + "name": "system", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property system", + "default": null + }, + { + "name": "version", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property version", + "default": null + }, + { + "name": "code", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property code", + "default": null + }, + { + "name": "display", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property display", + "default": null + }, + { + "name": "userSelected", + "type": [ + "null", + "boolean" + ], + "doc": "Field for FHIR property userSelected", + "default": null + } + ] + } + } + ], + "doc": "Field for FHIR property coding", + "default": null + }, + { + "name": "text", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property text", + "default": null + } + ] + } + ], + "doc": "Field for FHIR property type", + "default": null + }, + { + "name": "system", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property system", + "default": null + }, + { + "name": "value", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property value", + "default": null + }, + { + "name": "period", + "type": [ + "null", + { + "type": "record", + "name": "ConditionIdentifierReferenceIdentifierPeriod", + "doc": "Structure for FHIR type Period", + "fields": [ + { + "name": "start", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property start", + "default": null + }, + { + "name": "end", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property end", + "default": null + } + ] + } + ], + "doc": "Field for FHIR property period", + "default": null + }, + { + "name": "assigner", + "type": [ + "null", + { + "type": "record", + "name": "ConditionIdentifierReferenceIdentifierAssignerReference", + "doc": "Structure for FHIR type ConditionIdentifierReferenceIdentifierAssignerReference", + "fields": [ + { + "name": "organizationId", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "id", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "reference", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "type", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "display", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + } + ] + } + ], + "doc": "Field for FHIR property assigner", + "default": null + } + ] + } + ], + "doc": "Reference field", + "default": null + }, { "name": "display", "type": [ @@ -728,9 +949,8 @@ "null", { "type": "record", - "name": "subjectReference", - "namespace": "Condition", - "doc": "Structure for FHIR type Condition.subjectReference", + "name": "ConditionSubjectReference", + "doc": "Structure for FHIR type ConditionSubjectReference", "fields": [ { "name": "groupId", @@ -784,7 +1004,6 @@ { "type": "record", "name": "ConditionReferenceIdentifier", - "namespace": "com.cerner.bunsen.r4.avro", "doc": "Structure for FHIR type Identifier", "fields": [ { @@ -938,7 +1157,244 @@ "name": "assigner", "type": [ "null", - "Identifier.assignerReference" + { + "type": "record", + "name": "ConditionReferenceIdentifierAssignerReference", + "doc": "Structure for FHIR type ConditionReferenceIdentifierAssignerReference", + "fields": [ + { + "name": "organizationId", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "id", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "reference", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "type", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "identifier", + "type": [ + "null", + { + "type": "record", + "name": "ConditionReferenceIdentifierReferenceIdentifier", + "doc": "Structure for FHIR type Identifier", + "fields": [ + { + "name": "use", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property use", + "default": null + }, + { + "name": "type", + "type": [ + "null", + { + "type": "record", + "name": "ConditionReferenceIdentifierReferenceIdentifierCodeableConcept", + "doc": "Structure for FHIR type CodeableConcept", + "fields": [ + { + "name": "coding", + "type": [ + "null", + { + "type": "array", + "items": { + "type": "record", + "name": "ConditionReferenceIdentifierReferenceIdentifierCodeableConceptCoding", + "doc": "Structure for FHIR type Coding", + "fields": [ + { + "name": "system", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property system", + "default": null + }, + { + "name": "version", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property version", + "default": null + }, + { + "name": "code", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property code", + "default": null + }, + { + "name": "display", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property display", + "default": null + }, + { + "name": "userSelected", + "type": [ + "null", + "boolean" + ], + "doc": "Field for FHIR property userSelected", + "default": null + } + ] + } + } + ], + "doc": "Field for FHIR property coding", + "default": null + }, + { + "name": "text", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property text", + "default": null + } + ] + } + ], + "doc": "Field for FHIR property type", + "default": null + }, + { + "name": "system", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property system", + "default": null + }, + { + "name": "value", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property value", + "default": null + }, + { + "name": "period", + "type": [ + "null", + { + "type": "record", + "name": "ConditionReferenceIdentifierReferenceIdentifierPeriod", + "doc": "Structure for FHIR type Period", + "fields": [ + { + "name": "start", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property start", + "default": null + }, + { + "name": "end", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property end", + "default": null + } + ] + } + ], + "doc": "Field for FHIR property period", + "default": null + }, + { + "name": "assigner", + "type": [ + "null", + { + "type": "record", + "name": "ConditionReferenceIdentifierReferenceIdentifierAssignerReference", + "doc": "Structure for FHIR type ConditionReferenceIdentifierReferenceIdentifierAssignerReference", + "fields": [ + { + "name": "organizationId", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + } + ] + } + ], + "doc": "Field for FHIR property assigner", + "default": null + } + ] + } + ], + "doc": "Reference field", + "default": null + }, + { + "name": "display", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + } + ] + } ], "doc": "Field for FHIR property assigner", "default": null @@ -970,9 +1426,8 @@ "null", { "type": "record", - "name": "encounterReference", - "namespace": "Condition", - "doc": "Structure for FHIR type Condition.encounterReference", + "name": "ConditionEncounterReference", + "doc": "Structure for FHIR type ConditionEncounterReference", "fields": [ { "name": "encounterId", @@ -1014,7 +1469,7 @@ "name": "identifier", "type": [ "null", - "com.cerner.bunsen.r4.avro.ConditionReferenceIdentifier" + "ConditionReferenceIdentifier" ], "doc": "Reference field", "default": null @@ -1268,9 +1723,8 @@ "null", { "type": "record", - "name": "recorderReference", - "namespace": "Condition", - "doc": "Structure for FHIR type Condition.recorderReference", + "name": "ConditionRecorderReference", + "doc": "Structure for FHIR type ConditionRecorderReference", "fields": [ { "name": "patientId", @@ -1339,7 +1793,7 @@ "name": "identifier", "type": [ "null", - "com.cerner.bunsen.r4.avro.ConditionReferenceIdentifier" + "ConditionReferenceIdentifier" ], "doc": "Reference field", "default": null @@ -1365,9 +1819,8 @@ "null", { "type": "record", - "name": "asserterReference", - "namespace": "Condition", - "doc": "Structure for FHIR type Condition.asserterReference", + "name": "ConditionAsserterReference", + "doc": "Structure for FHIR type ConditionAsserterReference", "fields": [ { "name": "patientId", @@ -1436,7 +1889,7 @@ "name": "identifier", "type": [ "null", - "com.cerner.bunsen.r4.avro.ConditionReferenceIdentifier" + "ConditionReferenceIdentifier" ], "doc": "Reference field", "default": null @@ -1571,9 +2024,8 @@ "type": "array", "items": { "type": "record", - "name": "assessmentReference", - "namespace": "Condition.stage", - "doc": "Structure for FHIR type Condition.stage.assessmentReference", + "name": "ConditionStageAssessmentReference", + "doc": "Structure for FHIR type ConditionStageAssessmentReference", "fields": [ { "name": "clinicalImpressionId", @@ -1636,7 +2088,6 @@ { "type": "record", "name": "ConditionStageReferenceIdentifier", - "namespace": "com.cerner.bunsen.r4.avro", "doc": "Structure for FHIR type Identifier", "fields": [ { @@ -1790,7 +2241,244 @@ "name": "assigner", "type": [ "null", - "Identifier.assignerReference" + { + "type": "record", + "name": "ConditionStageReferenceIdentifierAssignerReference", + "doc": "Structure for FHIR type ConditionStageReferenceIdentifierAssignerReference", + "fields": [ + { + "name": "organizationId", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "id", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "reference", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "type", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "identifier", + "type": [ + "null", + { + "type": "record", + "name": "ConditionStageReferenceIdentifierReferenceIdentifier", + "doc": "Structure for FHIR type Identifier", + "fields": [ + { + "name": "use", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property use", + "default": null + }, + { + "name": "type", + "type": [ + "null", + { + "type": "record", + "name": "ConditionStageReferenceIdentifierReferenceIdentifierCodeableConcept", + "doc": "Structure for FHIR type CodeableConcept", + "fields": [ + { + "name": "coding", + "type": [ + "null", + { + "type": "array", + "items": { + "type": "record", + "name": "ConditionStageReferenceIdentifierReferenceIdentifierCodeableConceptCoding", + "doc": "Structure for FHIR type Coding", + "fields": [ + { + "name": "system", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property system", + "default": null + }, + { + "name": "version", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property version", + "default": null + }, + { + "name": "code", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property code", + "default": null + }, + { + "name": "display", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property display", + "default": null + }, + { + "name": "userSelected", + "type": [ + "null", + "boolean" + ], + "doc": "Field for FHIR property userSelected", + "default": null + } + ] + } + } + ], + "doc": "Field for FHIR property coding", + "default": null + }, + { + "name": "text", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property text", + "default": null + } + ] + } + ], + "doc": "Field for FHIR property type", + "default": null + }, + { + "name": "system", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property system", + "default": null + }, + { + "name": "value", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property value", + "default": null + }, + { + "name": "period", + "type": [ + "null", + { + "type": "record", + "name": "ConditionStageReferenceIdentifierReferenceIdentifierPeriod", + "doc": "Structure for FHIR type Period", + "fields": [ + { + "name": "start", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property start", + "default": null + }, + { + "name": "end", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property end", + "default": null + } + ] + } + ], + "doc": "Field for FHIR property period", + "default": null + }, + { + "name": "assigner", + "type": [ + "null", + { + "type": "record", + "name": "ConditionStageReferenceIdentifierReferenceIdentifierAssignerReference", + "doc": "Structure for FHIR type ConditionStageReferenceIdentifierReferenceIdentifierAssignerReference", + "fields": [ + { + "name": "organizationId", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + } + ] + } + ], + "doc": "Field for FHIR property assigner", + "default": null + } + ] + } + ], + "doc": "Reference field", + "default": null + }, + { + "name": "display", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + } + ] + } ], "doc": "Field for FHIR property assigner", "default": null @@ -1951,9 +2639,8 @@ "type": "array", "items": { "type": "record", - "name": "detailReference", - "namespace": "Condition.evidence", - "doc": "Structure for FHIR type Condition.evidence.detailReference", + "name": "ConditionEvidenceDetailReference", + "doc": "Structure for FHIR type ConditionEvidenceDetailReference", "fields": [ { "name": "resourceId", @@ -1998,7 +2685,6 @@ { "type": "record", "name": "ConditionEvidenceReferenceIdentifier", - "namespace": "com.cerner.bunsen.r4.avro", "doc": "Structure for FHIR type Identifier", "fields": [ { @@ -2152,7 +2838,244 @@ "name": "assigner", "type": [ "null", - "Identifier.assignerReference" + { + "type": "record", + "name": "ConditionEvidenceReferenceIdentifierAssignerReference", + "doc": "Structure for FHIR type ConditionEvidenceReferenceIdentifierAssignerReference", + "fields": [ + { + "name": "organizationId", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "id", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "reference", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "type", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "identifier", + "type": [ + "null", + { + "type": "record", + "name": "ConditionEvidenceReferenceIdentifierReferenceIdentifier", + "doc": "Structure for FHIR type Identifier", + "fields": [ + { + "name": "use", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property use", + "default": null + }, + { + "name": "type", + "type": [ + "null", + { + "type": "record", + "name": "ConditionEvidenceReferenceIdentifierReferenceIdentifierCodeableConcept", + "doc": "Structure for FHIR type CodeableConcept", + "fields": [ + { + "name": "coding", + "type": [ + "null", + { + "type": "array", + "items": { + "type": "record", + "name": "ConditionEvidenceReferenceIdentifierReferenceIdentifierCodeableConceptCoding", + "doc": "Structure for FHIR type Coding", + "fields": [ + { + "name": "system", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property system", + "default": null + }, + { + "name": "version", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property version", + "default": null + }, + { + "name": "code", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property code", + "default": null + }, + { + "name": "display", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property display", + "default": null + }, + { + "name": "userSelected", + "type": [ + "null", + "boolean" + ], + "doc": "Field for FHIR property userSelected", + "default": null + } + ] + } + } + ], + "doc": "Field for FHIR property coding", + "default": null + }, + { + "name": "text", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property text", + "default": null + } + ] + } + ], + "doc": "Field for FHIR property type", + "default": null + }, + { + "name": "system", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property system", + "default": null + }, + { + "name": "value", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property value", + "default": null + }, + { + "name": "period", + "type": [ + "null", + { + "type": "record", + "name": "ConditionEvidenceReferenceIdentifierReferenceIdentifierPeriod", + "doc": "Structure for FHIR type Period", + "fields": [ + { + "name": "start", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property start", + "default": null + }, + { + "name": "end", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property end", + "default": null + } + ] + } + ], + "doc": "Field for FHIR property period", + "default": null + }, + { + "name": "assigner", + "type": [ + "null", + { + "type": "record", + "name": "ConditionEvidenceReferenceIdentifierReferenceIdentifierAssignerReference", + "doc": "Structure for FHIR type ConditionEvidenceReferenceIdentifierReferenceIdentifierAssignerReference", + "fields": [ + { + "name": "organizationId", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + } + ] + } + ], + "doc": "Field for FHIR property assigner", + "default": null + } + ] + } + ], + "doc": "Reference field", + "default": null + }, + { + "name": "display", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + } + ] + } ], "doc": "Field for FHIR property assigner", "default": null @@ -2212,9 +3135,8 @@ "null", { "type": "record", - "name": "authorReference", - "namespace": "Annotation", - "doc": "Structure for FHIR type Annotation.authorReference", + "name": "AuthorReference", + "doc": "Structure for FHIR type AuthorReference", "fields": [ { "name": "organizationId", @@ -2286,7 +3208,6 @@ { "type": "record", "name": "ReferenceIdentifier", - "namespace": "com.cerner.bunsen.r4.avro", "doc": "Structure for FHIR type Identifier", "fields": [ { @@ -2440,7 +3361,244 @@ "name": "assigner", "type": [ "null", - "Identifier.assignerReference" + { + "type": "record", + "name": "ReferenceIdentifierAssignerReference", + "doc": "Structure for FHIR type ReferenceIdentifierAssignerReference", + "fields": [ + { + "name": "organizationId", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "id", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "reference", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "type", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "identifier", + "type": [ + "null", + { + "type": "record", + "name": "ReferenceIdentifierReferenceIdentifier", + "doc": "Structure for FHIR type Identifier", + "fields": [ + { + "name": "use", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property use", + "default": null + }, + { + "name": "type", + "type": [ + "null", + { + "type": "record", + "name": "ReferenceIdentifierReferenceIdentifierCodeableConcept", + "doc": "Structure for FHIR type CodeableConcept", + "fields": [ + { + "name": "coding", + "type": [ + "null", + { + "type": "array", + "items": { + "type": "record", + "name": "ReferenceIdentifierReferenceIdentifierCodeableConceptCoding", + "doc": "Structure for FHIR type Coding", + "fields": [ + { + "name": "system", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property system", + "default": null + }, + { + "name": "version", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property version", + "default": null + }, + { + "name": "code", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property code", + "default": null + }, + { + "name": "display", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property display", + "default": null + }, + { + "name": "userSelected", + "type": [ + "null", + "boolean" + ], + "doc": "Field for FHIR property userSelected", + "default": null + } + ] + } + } + ], + "doc": "Field for FHIR property coding", + "default": null + }, + { + "name": "text", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property text", + "default": null + } + ] + } + ], + "doc": "Field for FHIR property type", + "default": null + }, + { + "name": "system", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property system", + "default": null + }, + { + "name": "value", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property value", + "default": null + }, + { + "name": "period", + "type": [ + "null", + { + "type": "record", + "name": "ReferenceIdentifierReferenceIdentifierPeriod", + "doc": "Structure for FHIR type Period", + "fields": [ + { + "name": "start", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property start", + "default": null + }, + { + "name": "end", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property end", + "default": null + } + ] + } + ], + "doc": "Field for FHIR property period", + "default": null + }, + { + "name": "assigner", + "type": [ + "null", + { + "type": "record", + "name": "ReferenceIdentifierReferenceIdentifierAssignerReference", + "doc": "Structure for FHIR type ReferenceIdentifierReferenceIdentifierAssignerReference", + "fields": [ + { + "name": "organizationId", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + } + ] + } + ], + "doc": "Field for FHIR property assigner", + "default": null + } + ] + } + ], + "doc": "Reference field", + "default": null + }, + { + "name": "display", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + } + ] + } ], "doc": "Field for FHIR property assigner", "default": null diff --git a/bunsen/bunsen-avro/src/test/resources/r4-us-core-schemas/us-core-observation-schema.json b/bunsen/bunsen-avro/src/test/resources/r4-us-core-schemas/us-core-observation-schema.json index 1ea040ac8..b9b2cb8d3 100644 --- a/bunsen/bunsen-avro/src/test/resources/r4-us-core-schemas/us-core-observation-schema.json +++ b/bunsen/bunsen-avro/src/test/resources/r4-us-core-schemas/us-core-observation-schema.json @@ -522,9 +522,8 @@ "null", { "type": "record", - "name": "assignerReference", - "namespace": "Identifier", - "doc": "Structure for FHIR type Identifier.assignerReference", + "name": "ObservationIdentifierAssignerReference", + "doc": "Structure for FHIR type ObservationIdentifierAssignerReference", "fields": [ { "name": "organizationId", @@ -562,6 +561,228 @@ "doc": "Reference field", "default": null }, + { + "name": "identifier", + "type": [ + "null", + { + "type": "record", + "name": "ObservationIdentifierReferenceIdentifier", + "doc": "Structure for FHIR type Identifier", + "fields": [ + { + "name": "use", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property use", + "default": null + }, + { + "name": "type", + "type": [ + "null", + { + "type": "record", + "name": "ObservationIdentifierReferenceIdentifierCodeableConcept", + "doc": "Structure for FHIR type CodeableConcept", + "fields": [ + { + "name": "coding", + "type": [ + "null", + { + "type": "array", + "items": { + "type": "record", + "name": "ObservationIdentifierReferenceIdentifierCodeableConceptCoding", + "doc": "Structure for FHIR type Coding", + "fields": [ + { + "name": "system", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property system", + "default": null + }, + { + "name": "version", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property version", + "default": null + }, + { + "name": "code", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property code", + "default": null + }, + { + "name": "display", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property display", + "default": null + }, + { + "name": "userSelected", + "type": [ + "null", + "boolean" + ], + "doc": "Field for FHIR property userSelected", + "default": null + } + ] + } + } + ], + "doc": "Field for FHIR property coding", + "default": null + }, + { + "name": "text", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property text", + "default": null + } + ] + } + ], + "doc": "Field for FHIR property type", + "default": null + }, + { + "name": "system", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property system", + "default": null + }, + { + "name": "value", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property value", + "default": null + }, + { + "name": "period", + "type": [ + "null", + { + "type": "record", + "name": "ObservationIdentifierReferenceIdentifierPeriod", + "doc": "Structure for FHIR type Period", + "fields": [ + { + "name": "start", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property start", + "default": null + }, + { + "name": "end", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property end", + "default": null + } + ] + } + ], + "doc": "Field for FHIR property period", + "default": null + }, + { + "name": "assigner", + "type": [ + "null", + { + "type": "record", + "name": "ObservationIdentifierReferenceIdentifierAssignerReference", + "doc": "Structure for FHIR type ObservationIdentifierReferenceIdentifierAssignerReference", + "fields": [ + { + "name": "organizationId", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "id", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "reference", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "type", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "display", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + } + ] + } + ], + "doc": "Field for FHIR property assigner", + "default": null + } + ] + } + ], + "doc": "Reference field", + "default": null + }, { "name": "display", "type": [ @@ -592,9 +813,8 @@ "type": "array", "items": { "type": "record", - "name": "basedOnReference", - "namespace": "Observation", - "doc": "Structure for FHIR type Observation.basedOnReference", + "name": "ObservationBasedOnReference", + "doc": "Structure for FHIR type ObservationBasedOnReference", "fields": [ { "name": "carePlanId", @@ -684,7 +904,6 @@ { "type": "record", "name": "ObservationReferenceIdentifier", - "namespace": "com.cerner.bunsen.r4.avro", "doc": "Structure for FHIR type Identifier", "fields": [ { @@ -838,7 +1057,244 @@ "name": "assigner", "type": [ "null", - "Identifier.assignerReference" + { + "type": "record", + "name": "ObservationReferenceIdentifierAssignerReference", + "doc": "Structure for FHIR type ObservationReferenceIdentifierAssignerReference", + "fields": [ + { + "name": "organizationId", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "id", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "reference", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "type", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "identifier", + "type": [ + "null", + { + "type": "record", + "name": "ObservationReferenceIdentifierReferenceIdentifier", + "doc": "Structure for FHIR type Identifier", + "fields": [ + { + "name": "use", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property use", + "default": null + }, + { + "name": "type", + "type": [ + "null", + { + "type": "record", + "name": "ObservationReferenceIdentifierReferenceIdentifierCodeableConcept", + "doc": "Structure for FHIR type CodeableConcept", + "fields": [ + { + "name": "coding", + "type": [ + "null", + { + "type": "array", + "items": { + "type": "record", + "name": "ObservationReferenceIdentifierReferenceIdentifierCodeableConceptCoding", + "doc": "Structure for FHIR type Coding", + "fields": [ + { + "name": "system", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property system", + "default": null + }, + { + "name": "version", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property version", + "default": null + }, + { + "name": "code", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property code", + "default": null + }, + { + "name": "display", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property display", + "default": null + }, + { + "name": "userSelected", + "type": [ + "null", + "boolean" + ], + "doc": "Field for FHIR property userSelected", + "default": null + } + ] + } + } + ], + "doc": "Field for FHIR property coding", + "default": null + }, + { + "name": "text", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property text", + "default": null + } + ] + } + ], + "doc": "Field for FHIR property type", + "default": null + }, + { + "name": "system", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property system", + "default": null + }, + { + "name": "value", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property value", + "default": null + }, + { + "name": "period", + "type": [ + "null", + { + "type": "record", + "name": "ObservationReferenceIdentifierReferenceIdentifierPeriod", + "doc": "Structure for FHIR type Period", + "fields": [ + { + "name": "start", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property start", + "default": null + }, + { + "name": "end", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property end", + "default": null + } + ] + } + ], + "doc": "Field for FHIR property period", + "default": null + }, + { + "name": "assigner", + "type": [ + "null", + { + "type": "record", + "name": "ObservationReferenceIdentifierReferenceIdentifierAssignerReference", + "doc": "Structure for FHIR type ObservationReferenceIdentifierReferenceIdentifierAssignerReference", + "fields": [ + { + "name": "organizationId", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + } + ] + } + ], + "doc": "Field for FHIR property assigner", + "default": null + } + ] + } + ], + "doc": "Reference field", + "default": null + }, + { + "name": "display", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + } + ] + } ], "doc": "Field for FHIR property assigner", "default": null @@ -873,9 +1329,8 @@ "type": "array", "items": { "type": "record", - "name": "partOfReference", - "namespace": "Observation", - "doc": "Structure for FHIR type Observation.partOfReference", + "name": "ObservationPartOfReference", + "doc": "Structure for FHIR type ObservationPartOfReference", "fields": [ { "name": "imagingStudyId", @@ -962,7 +1417,7 @@ "name": "identifier", "type": [ "null", - "com.cerner.bunsen.r4.avro.ObservationReferenceIdentifier" + "ObservationReferenceIdentifier" ], "doc": "Reference field", "default": null @@ -1097,9 +1552,8 @@ "null", { "type": "record", - "name": "subjectReference", - "namespace": "Observation", - "doc": "Structure for FHIR type Observation.subjectReference", + "name": "ObservationSubjectReference", + "doc": "Structure for FHIR type ObservationSubjectReference", "fields": [ { "name": "deviceId", @@ -1168,7 +1622,7 @@ "name": "identifier", "type": [ "null", - "com.cerner.bunsen.r4.avro.ObservationReferenceIdentifier" + "ObservationReferenceIdentifier" ], "doc": "Reference field", "default": null @@ -1196,9 +1650,8 @@ "type": "array", "items": { "type": "record", - "name": "focusReference", - "namespace": "Observation", - "doc": "Structure for FHIR type Observation.focusReference", + "name": "ObservationFocusReference", + "doc": "Structure for FHIR type ObservationFocusReference", "fields": [ { "name": "resourceId", @@ -1240,7 +1693,7 @@ "name": "identifier", "type": [ "null", - "com.cerner.bunsen.r4.avro.ObservationReferenceIdentifier" + "ObservationReferenceIdentifier" ], "doc": "Reference field", "default": null @@ -1267,9 +1720,8 @@ "null", { "type": "record", - "name": "encounterReference", - "namespace": "Observation", - "doc": "Structure for FHIR type Observation.encounterReference", + "name": "ObservationEncounterReference", + "doc": "Structure for FHIR type ObservationEncounterReference", "fields": [ { "name": "encounterId", @@ -1311,7 +1763,7 @@ "name": "identifier", "type": [ "null", - "com.cerner.bunsen.r4.avro.ObservationReferenceIdentifier" + "ObservationReferenceIdentifier" ], "doc": "Reference field", "default": null @@ -1855,9 +2307,8 @@ "type": "array", "items": { "type": "record", - "name": "performerReference", - "namespace": "Observation", - "doc": "Structure for FHIR type Observation.performerReference", + "name": "ObservationPerformerReference", + "doc": "Structure for FHIR type ObservationPerformerReference", "fields": [ { "name": "careTeamId", @@ -1944,7 +2395,7 @@ "name": "identifier", "type": [ "null", - "com.cerner.bunsen.r4.avro.ObservationReferenceIdentifier" + "ObservationReferenceIdentifier" ], "doc": "Reference field", "default": null @@ -2450,9 +2901,8 @@ "null", { "type": "record", - "name": "authorReference", - "namespace": "Annotation", - "doc": "Structure for FHIR type Annotation.authorReference", + "name": "AuthorReference", + "doc": "Structure for FHIR type AuthorReference", "fields": [ { "name": "organizationId", @@ -2524,7 +2974,6 @@ { "type": "record", "name": "ReferenceIdentifier", - "namespace": "com.cerner.bunsen.r4.avro", "doc": "Structure for FHIR type Identifier", "fields": [ { @@ -2678,7 +3127,244 @@ "name": "assigner", "type": [ "null", - "Identifier.assignerReference" + { + "type": "record", + "name": "ReferenceIdentifierAssignerReference", + "doc": "Structure for FHIR type ReferenceIdentifierAssignerReference", + "fields": [ + { + "name": "organizationId", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "id", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "reference", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "type", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "identifier", + "type": [ + "null", + { + "type": "record", + "name": "ReferenceIdentifierReferenceIdentifier", + "doc": "Structure for FHIR type Identifier", + "fields": [ + { + "name": "use", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property use", + "default": null + }, + { + "name": "type", + "type": [ + "null", + { + "type": "record", + "name": "ReferenceIdentifierReferenceIdentifierCodeableConcept", + "doc": "Structure for FHIR type CodeableConcept", + "fields": [ + { + "name": "coding", + "type": [ + "null", + { + "type": "array", + "items": { + "type": "record", + "name": "ReferenceIdentifierReferenceIdentifierCodeableConceptCoding", + "doc": "Structure for FHIR type Coding", + "fields": [ + { + "name": "system", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property system", + "default": null + }, + { + "name": "version", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property version", + "default": null + }, + { + "name": "code", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property code", + "default": null + }, + { + "name": "display", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property display", + "default": null + }, + { + "name": "userSelected", + "type": [ + "null", + "boolean" + ], + "doc": "Field for FHIR property userSelected", + "default": null + } + ] + } + } + ], + "doc": "Field for FHIR property coding", + "default": null + }, + { + "name": "text", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property text", + "default": null + } + ] + } + ], + "doc": "Field for FHIR property type", + "default": null + }, + { + "name": "system", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property system", + "default": null + }, + { + "name": "value", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property value", + "default": null + }, + { + "name": "period", + "type": [ + "null", + { + "type": "record", + "name": "ReferenceIdentifierReferenceIdentifierPeriod", + "doc": "Structure for FHIR type Period", + "fields": [ + { + "name": "start", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property start", + "default": null + }, + { + "name": "end", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property end", + "default": null + } + ] + } + ], + "doc": "Field for FHIR property period", + "default": null + }, + { + "name": "assigner", + "type": [ + "null", + { + "type": "record", + "name": "ReferenceIdentifierReferenceIdentifierAssignerReference", + "doc": "Structure for FHIR type ReferenceIdentifierReferenceIdentifierAssignerReference", + "fields": [ + { + "name": "organizationId", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + } + ] + } + ], + "doc": "Field for FHIR property assigner", + "default": null + } + ] + } + ], + "doc": "Reference field", + "default": null + }, + { + "name": "display", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + } + ] + } ], "doc": "Field for FHIR property assigner", "default": null @@ -2768,9 +3454,8 @@ "null", { "type": "record", - "name": "specimenReference", - "namespace": "Observation", - "doc": "Structure for FHIR type Observation.specimenReference", + "name": "ObservationSpecimenReference", + "doc": "Structure for FHIR type ObservationSpecimenReference", "fields": [ { "name": "specimenId", @@ -2812,7 +3497,7 @@ "name": "identifier", "type": [ "null", - "com.cerner.bunsen.r4.avro.ObservationReferenceIdentifier" + "ObservationReferenceIdentifier" ], "doc": "Reference field", "default": null @@ -2838,9 +3523,8 @@ "null", { "type": "record", - "name": "deviceReference", - "namespace": "Observation", - "doc": "Structure for FHIR type Observation.deviceReference", + "name": "ObservationDeviceReference", + "doc": "Structure for FHIR type ObservationDeviceReference", "fields": [ { "name": "deviceId", @@ -2891,7 +3575,7 @@ "name": "identifier", "type": [ "null", - "com.cerner.bunsen.r4.avro.ObservationReferenceIdentifier" + "ObservationReferenceIdentifier" ], "doc": "Reference field", "default": null @@ -3207,9 +3891,8 @@ "type": "array", "items": { "type": "record", - "name": "hasMemberReference", - "namespace": "Observation", - "doc": "Structure for FHIR type Observation.hasMemberReference", + "name": "ObservationHasMemberReference", + "doc": "Structure for FHIR type ObservationHasMemberReference", "fields": [ { "name": "molecularSequenceId", @@ -3269,7 +3952,7 @@ "name": "identifier", "type": [ "null", - "com.cerner.bunsen.r4.avro.ObservationReferenceIdentifier" + "ObservationReferenceIdentifier" ], "doc": "Reference field", "default": null @@ -3298,9 +3981,8 @@ "type": "array", "items": { "type": "record", - "name": "derivedFromReference", - "namespace": "Observation", - "doc": "Structure for FHIR type Observation.derivedFromReference", + "name": "ObservationDerivedFromReference", + "doc": "Structure for FHIR type ObservationDerivedFromReference", "fields": [ { "name": "documentReferenceId", @@ -3387,7 +4069,7 @@ "name": "identifier", "type": [ "null", - "com.cerner.bunsen.r4.avro.ObservationReferenceIdentifier" + "ObservationReferenceIdentifier" ], "doc": "Reference field", "default": null diff --git a/bunsen/bunsen-avro/src/test/resources/r4-us-core-schemas/us-core-patient-schema.json b/bunsen/bunsen-avro/src/test/resources/r4-us-core-schemas/us-core-patient-schema.json index 2345ada68..495779fe9 100644 --- a/bunsen/bunsen-avro/src/test/resources/r4-us-core-schemas/us-core-patient-schema.json +++ b/bunsen/bunsen-avro/src/test/resources/r4-us-core-schemas/us-core-patient-schema.json @@ -522,9 +522,8 @@ "null", { "type": "record", - "name": "assignerReference", - "namespace": "Identifier", - "doc": "Structure for FHIR type Identifier.assignerReference", + "name": "PatientIdentifierAssignerReference", + "doc": "Structure for FHIR type PatientIdentifierAssignerReference", "fields": [ { "name": "organizationId", @@ -562,6 +561,228 @@ "doc": "Reference field", "default": null }, + { + "name": "identifier", + "type": [ + "null", + { + "type": "record", + "name": "PatientIdentifierReferenceIdentifier", + "doc": "Structure for FHIR type Identifier", + "fields": [ + { + "name": "use", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property use", + "default": null + }, + { + "name": "type", + "type": [ + "null", + { + "type": "record", + "name": "PatientIdentifierReferenceIdentifierCodeableConcept", + "doc": "Structure for FHIR type CodeableConcept", + "fields": [ + { + "name": "coding", + "type": [ + "null", + { + "type": "array", + "items": { + "type": "record", + "name": "PatientIdentifierReferenceIdentifierCodeableConceptCoding", + "doc": "Structure for FHIR type Coding", + "fields": [ + { + "name": "system", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property system", + "default": null + }, + { + "name": "version", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property version", + "default": null + }, + { + "name": "code", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property code", + "default": null + }, + { + "name": "display", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property display", + "default": null + }, + { + "name": "userSelected", + "type": [ + "null", + "boolean" + ], + "doc": "Field for FHIR property userSelected", + "default": null + } + ] + } + } + ], + "doc": "Field for FHIR property coding", + "default": null + }, + { + "name": "text", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property text", + "default": null + } + ] + } + ], + "doc": "Field for FHIR property type", + "default": null + }, + { + "name": "system", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property system", + "default": null + }, + { + "name": "value", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property value", + "default": null + }, + { + "name": "period", + "type": [ + "null", + { + "type": "record", + "name": "PatientIdentifierReferenceIdentifierPeriod", + "doc": "Structure for FHIR type Period", + "fields": [ + { + "name": "start", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property start", + "default": null + }, + { + "name": "end", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property end", + "default": null + } + ] + } + ], + "doc": "Field for FHIR property period", + "default": null + }, + { + "name": "assigner", + "type": [ + "null", + { + "type": "record", + "name": "PatientIdentifierReferenceIdentifierAssignerReference", + "doc": "Structure for FHIR type PatientIdentifierReferenceIdentifierAssignerReference", + "fields": [ + { + "name": "organizationId", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "id", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "reference", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "type", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "display", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + } + ] + } + ], + "doc": "Field for FHIR property assigner", + "default": null + } + ] + } + ], + "doc": "Reference field", + "default": null + }, { "name": "display", "type": [ @@ -1645,9 +1866,8 @@ "null", { "type": "record", - "name": "organizationReference", - "namespace": "Patient.contact", - "doc": "Structure for FHIR type Patient.contact.organizationReference", + "name": "PatientContactOrganizationReference", + "doc": "Structure for FHIR type PatientContactOrganizationReference", "fields": [ { "name": "organizationId", @@ -1692,7 +1912,6 @@ { "type": "record", "name": "PatientContactReferenceIdentifier", - "namespace": "com.cerner.bunsen.r4.avro", "doc": "Structure for FHIR type Identifier", "fields": [ { @@ -1846,7 +2065,244 @@ "name": "assigner", "type": [ "null", - "Identifier.assignerReference" + { + "type": "record", + "name": "PatientContactReferenceIdentifierAssignerReference", + "doc": "Structure for FHIR type PatientContactReferenceIdentifierAssignerReference", + "fields": [ + { + "name": "organizationId", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "id", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "reference", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "type", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "identifier", + "type": [ + "null", + { + "type": "record", + "name": "PatientContactReferenceIdentifierReferenceIdentifier", + "doc": "Structure for FHIR type Identifier", + "fields": [ + { + "name": "use", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property use", + "default": null + }, + { + "name": "type", + "type": [ + "null", + { + "type": "record", + "name": "PatientContactReferenceIdentifierReferenceIdentifierCodeableConcept", + "doc": "Structure for FHIR type CodeableConcept", + "fields": [ + { + "name": "coding", + "type": [ + "null", + { + "type": "array", + "items": { + "type": "record", + "name": "PatientContactReferenceIdentifierReferenceIdentifierCodeableConceptCoding", + "doc": "Structure for FHIR type Coding", + "fields": [ + { + "name": "system", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property system", + "default": null + }, + { + "name": "version", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property version", + "default": null + }, + { + "name": "code", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property code", + "default": null + }, + { + "name": "display", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property display", + "default": null + }, + { + "name": "userSelected", + "type": [ + "null", + "boolean" + ], + "doc": "Field for FHIR property userSelected", + "default": null + } + ] + } + } + ], + "doc": "Field for FHIR property coding", + "default": null + }, + { + "name": "text", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property text", + "default": null + } + ] + } + ], + "doc": "Field for FHIR property type", + "default": null + }, + { + "name": "system", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property system", + "default": null + }, + { + "name": "value", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property value", + "default": null + }, + { + "name": "period", + "type": [ + "null", + { + "type": "record", + "name": "PatientContactReferenceIdentifierReferenceIdentifierPeriod", + "doc": "Structure for FHIR type Period", + "fields": [ + { + "name": "start", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property start", + "default": null + }, + { + "name": "end", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property end", + "default": null + } + ] + } + ], + "doc": "Field for FHIR property period", + "default": null + }, + { + "name": "assigner", + "type": [ + "null", + { + "type": "record", + "name": "PatientContactReferenceIdentifierReferenceIdentifierAssignerReference", + "doc": "Structure for FHIR type PatientContactReferenceIdentifierReferenceIdentifierAssignerReference", + "fields": [ + { + "name": "organizationId", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + } + ] + } + ], + "doc": "Field for FHIR property assigner", + "default": null + } + ] + } + ], + "doc": "Reference field", + "default": null + }, + { + "name": "display", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + } + ] + } ], "doc": "Field for FHIR property assigner", "default": null @@ -2043,9 +2499,8 @@ "type": "array", "items": { "type": "record", - "name": "generalPractitionerReference", - "namespace": "Patient", - "doc": "Structure for FHIR type Patient.generalPractitionerReference", + "name": "PatientGeneralPractitionerReference", + "doc": "Structure for FHIR type PatientGeneralPractitionerReference", "fields": [ { "name": "organizationId", @@ -2108,7 +2563,6 @@ { "type": "record", "name": "PatientReferenceIdentifier", - "namespace": "com.cerner.bunsen.r4.avro", "doc": "Structure for FHIR type Identifier", "fields": [ { @@ -2262,7 +2716,244 @@ "name": "assigner", "type": [ "null", - "Identifier.assignerReference" + { + "type": "record", + "name": "PatientReferenceIdentifierAssignerReference", + "doc": "Structure for FHIR type PatientReferenceIdentifierAssignerReference", + "fields": [ + { + "name": "organizationId", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "id", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "reference", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "type", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "identifier", + "type": [ + "null", + { + "type": "record", + "name": "PatientReferenceIdentifierReferenceIdentifier", + "doc": "Structure for FHIR type Identifier", + "fields": [ + { + "name": "use", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property use", + "default": null + }, + { + "name": "type", + "type": [ + "null", + { + "type": "record", + "name": "PatientReferenceIdentifierReferenceIdentifierCodeableConcept", + "doc": "Structure for FHIR type CodeableConcept", + "fields": [ + { + "name": "coding", + "type": [ + "null", + { + "type": "array", + "items": { + "type": "record", + "name": "PatientReferenceIdentifierReferenceIdentifierCodeableConceptCoding", + "doc": "Structure for FHIR type Coding", + "fields": [ + { + "name": "system", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property system", + "default": null + }, + { + "name": "version", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property version", + "default": null + }, + { + "name": "code", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property code", + "default": null + }, + { + "name": "display", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property display", + "default": null + }, + { + "name": "userSelected", + "type": [ + "null", + "boolean" + ], + "doc": "Field for FHIR property userSelected", + "default": null + } + ] + } + } + ], + "doc": "Field for FHIR property coding", + "default": null + }, + { + "name": "text", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property text", + "default": null + } + ] + } + ], + "doc": "Field for FHIR property type", + "default": null + }, + { + "name": "system", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property system", + "default": null + }, + { + "name": "value", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property value", + "default": null + }, + { + "name": "period", + "type": [ + "null", + { + "type": "record", + "name": "PatientReferenceIdentifierReferenceIdentifierPeriod", + "doc": "Structure for FHIR type Period", + "fields": [ + { + "name": "start", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property start", + "default": null + }, + { + "name": "end", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property end", + "default": null + } + ] + } + ], + "doc": "Field for FHIR property period", + "default": null + }, + { + "name": "assigner", + "type": [ + "null", + { + "type": "record", + "name": "PatientReferenceIdentifierReferenceIdentifierAssignerReference", + "doc": "Structure for FHIR type PatientReferenceIdentifierReferenceIdentifierAssignerReference", + "fields": [ + { + "name": "organizationId", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + } + ] + } + ], + "doc": "Field for FHIR property assigner", + "default": null + } + ] + } + ], + "doc": "Reference field", + "default": null + }, + { + "name": "display", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + } + ] + } ], "doc": "Field for FHIR property assigner", "default": null @@ -2295,9 +2986,8 @@ "null", { "type": "record", - "name": "managingOrganizationReference", - "namespace": "Patient", - "doc": "Structure for FHIR type Patient.managingOrganizationReference", + "name": "PatientManagingOrganizationReference", + "doc": "Structure for FHIR type PatientManagingOrganizationReference", "fields": [ { "name": "organizationId", @@ -2339,7 +3029,7 @@ "name": "identifier", "type": [ "null", - "com.cerner.bunsen.r4.avro.PatientReferenceIdentifier" + "PatientReferenceIdentifier" ], "doc": "Reference field", "default": null @@ -2385,9 +3075,8 @@ "null", { "type": "record", - "name": "otherReference", - "namespace": "Patient.link", - "doc": "Structure for FHIR type Patient.link.otherReference", + "name": "PatientLinkOtherReference", + "doc": "Structure for FHIR type PatientLinkOtherReference", "fields": [ { "name": "patientId", @@ -2441,7 +3130,6 @@ { "type": "record", "name": "PatientLinkReferenceIdentifier", - "namespace": "com.cerner.bunsen.r4.avro", "doc": "Structure for FHIR type Identifier", "fields": [ { @@ -2595,7 +3283,244 @@ "name": "assigner", "type": [ "null", - "Identifier.assignerReference" + { + "type": "record", + "name": "PatientLinkReferenceIdentifierAssignerReference", + "doc": "Structure for FHIR type PatientLinkReferenceIdentifierAssignerReference", + "fields": [ + { + "name": "organizationId", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "id", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "reference", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "type", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "identifier", + "type": [ + "null", + { + "type": "record", + "name": "PatientLinkReferenceIdentifierReferenceIdentifier", + "doc": "Structure for FHIR type Identifier", + "fields": [ + { + "name": "use", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property use", + "default": null + }, + { + "name": "type", + "type": [ + "null", + { + "type": "record", + "name": "PatientLinkReferenceIdentifierReferenceIdentifierCodeableConcept", + "doc": "Structure for FHIR type CodeableConcept", + "fields": [ + { + "name": "coding", + "type": [ + "null", + { + "type": "array", + "items": { + "type": "record", + "name": "PatientLinkReferenceIdentifierReferenceIdentifierCodeableConceptCoding", + "doc": "Structure for FHIR type Coding", + "fields": [ + { + "name": "system", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property system", + "default": null + }, + { + "name": "version", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property version", + "default": null + }, + { + "name": "code", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property code", + "default": null + }, + { + "name": "display", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property display", + "default": null + }, + { + "name": "userSelected", + "type": [ + "null", + "boolean" + ], + "doc": "Field for FHIR property userSelected", + "default": null + } + ] + } + } + ], + "doc": "Field for FHIR property coding", + "default": null + }, + { + "name": "text", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property text", + "default": null + } + ] + } + ], + "doc": "Field for FHIR property type", + "default": null + }, + { + "name": "system", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property system", + "default": null + }, + { + "name": "value", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property value", + "default": null + }, + { + "name": "period", + "type": [ + "null", + { + "type": "record", + "name": "PatientLinkReferenceIdentifierReferenceIdentifierPeriod", + "doc": "Structure for FHIR type Period", + "fields": [ + { + "name": "start", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property start", + "default": null + }, + { + "name": "end", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property end", + "default": null + } + ] + } + ], + "doc": "Field for FHIR property period", + "default": null + }, + { + "name": "assigner", + "type": [ + "null", + { + "type": "record", + "name": "PatientLinkReferenceIdentifierReferenceIdentifierAssignerReference", + "doc": "Structure for FHIR type PatientLinkReferenceIdentifierReferenceIdentifierAssignerReference", + "fields": [ + { + "name": "organizationId", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + } + ] + } + ], + "doc": "Field for FHIR property assigner", + "default": null + } + ] + } + ], + "doc": "Reference field", + "default": null + }, + { + "name": "display", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + } + ] + } ], "doc": "Field for FHIR property assigner", "default": null diff --git a/bunsen/bunsen-avro/src/test/resources/stu3-custom-schemas/bunsen-test-patient-schema.json b/bunsen/bunsen-avro/src/test/resources/stu3-custom-schemas/bunsen-test-patient-schema.json index 084ed1202..41d7db6ba 100644 --- a/bunsen/bunsen-avro/src/test/resources/stu3-custom-schemas/bunsen-test-patient-schema.json +++ b/bunsen/bunsen-avro/src/test/resources/stu3-custom-schemas/bunsen-test-patient-schema.json @@ -504,9 +504,8 @@ "null", { "type": "record", - "name": "assignerReference", - "namespace": "Identifier", - "doc": "Structure for FHIR type Identifier.assignerReference", + "name": "PatientIdentifierAssignerReference", + "doc": "Structure for FHIR type PatientIdentifierAssignerReference", "fields": [ { "name": "organizationId", @@ -535,6 +534,219 @@ "doc": "Reference field", "default": null }, + { + "name": "identifier", + "type": [ + "null", + { + "type": "record", + "name": "PatientIdentifierReferenceIdentifier", + "doc": "Structure for FHIR type Identifier", + "fields": [ + { + "name": "use", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property use", + "default": null + }, + { + "name": "type", + "type": [ + "null", + { + "type": "record", + "name": "PatientIdentifierReferenceIdentifierCodeableConcept", + "doc": "Structure for FHIR type CodeableConcept", + "fields": [ + { + "name": "coding", + "type": [ + "null", + { + "type": "array", + "items": { + "type": "record", + "name": "PatientIdentifierReferenceIdentifierCodeableConceptCoding", + "doc": "Structure for FHIR type Coding", + "fields": [ + { + "name": "system", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property system", + "default": null + }, + { + "name": "version", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property version", + "default": null + }, + { + "name": "code", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property code", + "default": null + }, + { + "name": "display", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property display", + "default": null + }, + { + "name": "userSelected", + "type": [ + "null", + "boolean" + ], + "doc": "Field for FHIR property userSelected", + "default": null + } + ] + } + } + ], + "doc": "Field for FHIR property coding", + "default": null + }, + { + "name": "text", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property text", + "default": null + } + ] + } + ], + "doc": "Field for FHIR property type", + "default": null + }, + { + "name": "system", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property system", + "default": null + }, + { + "name": "value", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property value", + "default": null + }, + { + "name": "period", + "type": [ + "null", + { + "type": "record", + "name": "PatientIdentifierReferenceIdentifierPeriod", + "doc": "Structure for FHIR type Period", + "fields": [ + { + "name": "start", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property start", + "default": null + }, + { + "name": "end", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property end", + "default": null + } + ] + } + ], + "doc": "Field for FHIR property period", + "default": null + }, + { + "name": "assigner", + "type": [ + "null", + { + "type": "record", + "name": "PatientIdentifierReferenceIdentifierAssignerReference", + "doc": "Structure for FHIR type PatientIdentifierReferenceIdentifierAssignerReference", + "fields": [ + { + "name": "organizationId", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "id", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "reference", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "display", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + } + ] + } + ], + "doc": "Field for FHIR property assigner", + "default": null + } + ] + } + ], + "doc": "Reference field", + "default": null + }, { "name": "display", "type": [ @@ -1618,9 +1830,8 @@ "null", { "type": "record", - "name": "organizationReference", - "namespace": "Patient.contact", - "doc": "Structure for FHIR type Patient.contact.organizationReference", + "name": "PatientContactOrganizationReference", + "doc": "Structure for FHIR type PatientContactOrganizationReference", "fields": [ { "name": "organizationId", @@ -1656,7 +1867,6 @@ { "type": "record", "name": "PatientContactReferenceIdentifier", - "namespace": "com.cerner.bunsen.stu3.avro", "doc": "Structure for FHIR type Identifier", "fields": [ { @@ -1810,7 +2020,235 @@ "name": "assigner", "type": [ "null", - "Identifier.assignerReference" + { + "type": "record", + "name": "PatientContactReferenceIdentifierAssignerReference", + "doc": "Structure for FHIR type PatientContactReferenceIdentifierAssignerReference", + "fields": [ + { + "name": "organizationId", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "id", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "reference", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "identifier", + "type": [ + "null", + { + "type": "record", + "name": "PatientContactReferenceIdentifierReferenceIdentifier", + "doc": "Structure for FHIR type Identifier", + "fields": [ + { + "name": "use", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property use", + "default": null + }, + { + "name": "type", + "type": [ + "null", + { + "type": "record", + "name": "PatientContactReferenceIdentifierReferenceIdentifierCodeableConcept", + "doc": "Structure for FHIR type CodeableConcept", + "fields": [ + { + "name": "coding", + "type": [ + "null", + { + "type": "array", + "items": { + "type": "record", + "name": "PatientContactReferenceIdentifierReferenceIdentifierCodeableConceptCoding", + "doc": "Structure for FHIR type Coding", + "fields": [ + { + "name": "system", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property system", + "default": null + }, + { + "name": "version", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property version", + "default": null + }, + { + "name": "code", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property code", + "default": null + }, + { + "name": "display", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property display", + "default": null + }, + { + "name": "userSelected", + "type": [ + "null", + "boolean" + ], + "doc": "Field for FHIR property userSelected", + "default": null + } + ] + } + } + ], + "doc": "Field for FHIR property coding", + "default": null + }, + { + "name": "text", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property text", + "default": null + } + ] + } + ], + "doc": "Field for FHIR property type", + "default": null + }, + { + "name": "system", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property system", + "default": null + }, + { + "name": "value", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property value", + "default": null + }, + { + "name": "period", + "type": [ + "null", + { + "type": "record", + "name": "PatientContactReferenceIdentifierReferenceIdentifierPeriod", + "doc": "Structure for FHIR type Period", + "fields": [ + { + "name": "start", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property start", + "default": null + }, + { + "name": "end", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property end", + "default": null + } + ] + } + ], + "doc": "Field for FHIR property period", + "default": null + }, + { + "name": "assigner", + "type": [ + "null", + { + "type": "record", + "name": "PatientContactReferenceIdentifierReferenceIdentifierAssignerReference", + "doc": "Structure for FHIR type PatientContactReferenceIdentifierReferenceIdentifierAssignerReference", + "fields": [ + { + "name": "organizationId", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + } + ] + } + ], + "doc": "Field for FHIR property assigner", + "default": null + } + ] + } + ], + "doc": "Reference field", + "default": null + }, + { + "name": "display", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + } + ] + } ], "doc": "Field for FHIR property assigner", "default": null @@ -2136,9 +2574,8 @@ "type": "array", "items": { "type": "record", - "name": "generalPractitionerReference", - "namespace": "Patient", - "doc": "Structure for FHIR type Patient.generalPractitionerReference", + "name": "PatientGeneralPractitionerReference", + "doc": "Structure for FHIR type PatientGeneralPractitionerReference", "fields": [ { "name": "organizationId", @@ -2183,7 +2620,6 @@ { "type": "record", "name": "PatientReferenceIdentifier", - "namespace": "com.cerner.bunsen.stu3.avro", "doc": "Structure for FHIR type Identifier", "fields": [ { @@ -2337,7 +2773,235 @@ "name": "assigner", "type": [ "null", - "Identifier.assignerReference" + { + "type": "record", + "name": "PatientReferenceIdentifierAssignerReference", + "doc": "Structure for FHIR type PatientReferenceIdentifierAssignerReference", + "fields": [ + { + "name": "organizationId", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "id", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "reference", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "identifier", + "type": [ + "null", + { + "type": "record", + "name": "PatientReferenceIdentifierReferenceIdentifier", + "doc": "Structure for FHIR type Identifier", + "fields": [ + { + "name": "use", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property use", + "default": null + }, + { + "name": "type", + "type": [ + "null", + { + "type": "record", + "name": "PatientReferenceIdentifierReferenceIdentifierCodeableConcept", + "doc": "Structure for FHIR type CodeableConcept", + "fields": [ + { + "name": "coding", + "type": [ + "null", + { + "type": "array", + "items": { + "type": "record", + "name": "PatientReferenceIdentifierReferenceIdentifierCodeableConceptCoding", + "doc": "Structure for FHIR type Coding", + "fields": [ + { + "name": "system", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property system", + "default": null + }, + { + "name": "version", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property version", + "default": null + }, + { + "name": "code", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property code", + "default": null + }, + { + "name": "display", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property display", + "default": null + }, + { + "name": "userSelected", + "type": [ + "null", + "boolean" + ], + "doc": "Field for FHIR property userSelected", + "default": null + } + ] + } + } + ], + "doc": "Field for FHIR property coding", + "default": null + }, + { + "name": "text", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property text", + "default": null + } + ] + } + ], + "doc": "Field for FHIR property type", + "default": null + }, + { + "name": "system", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property system", + "default": null + }, + { + "name": "value", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property value", + "default": null + }, + { + "name": "period", + "type": [ + "null", + { + "type": "record", + "name": "PatientReferenceIdentifierReferenceIdentifierPeriod", + "doc": "Structure for FHIR type Period", + "fields": [ + { + "name": "start", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property start", + "default": null + }, + { + "name": "end", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property end", + "default": null + } + ] + } + ], + "doc": "Field for FHIR property period", + "default": null + }, + { + "name": "assigner", + "type": [ + "null", + { + "type": "record", + "name": "PatientReferenceIdentifierReferenceIdentifierAssignerReference", + "doc": "Structure for FHIR type PatientReferenceIdentifierReferenceIdentifierAssignerReference", + "fields": [ + { + "name": "organizationId", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + } + ] + } + ], + "doc": "Field for FHIR property assigner", + "default": null + } + ] + } + ], + "doc": "Reference field", + "default": null + }, + { + "name": "display", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + } + ] + } ], "doc": "Field for FHIR property assigner", "default": null @@ -2370,9 +3034,8 @@ "null", { "type": "record", - "name": "managingOrganizationReference", - "namespace": "Patient", - "doc": "Structure for FHIR type Patient.managingOrganizationReference", + "name": "PatientManagingOrganizationReference", + "doc": "Structure for FHIR type PatientManagingOrganizationReference", "fields": [ { "name": "organizationId", @@ -2405,7 +3068,7 @@ "name": "identifier", "type": [ "null", - "com.cerner.bunsen.stu3.avro.PatientReferenceIdentifier" + "PatientReferenceIdentifier" ], "doc": "Reference field", "default": null @@ -2451,9 +3114,8 @@ "null", { "type": "record", - "name": "otherReference", - "namespace": "Patient.link", - "doc": "Structure for FHIR type Patient.link.otherReference", + "name": "PatientLinkOtherReference", + "doc": "Structure for FHIR type PatientLinkOtherReference", "fields": [ { "name": "patientId", @@ -2498,7 +3160,6 @@ { "type": "record", "name": "PatientLinkReferenceIdentifier", - "namespace": "com.cerner.bunsen.stu3.avro", "doc": "Structure for FHIR type Identifier", "fields": [ { @@ -2652,7 +3313,235 @@ "name": "assigner", "type": [ "null", - "Identifier.assignerReference" + { + "type": "record", + "name": "PatientLinkReferenceIdentifierAssignerReference", + "doc": "Structure for FHIR type PatientLinkReferenceIdentifierAssignerReference", + "fields": [ + { + "name": "organizationId", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "id", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "reference", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "identifier", + "type": [ + "null", + { + "type": "record", + "name": "PatientLinkReferenceIdentifierReferenceIdentifier", + "doc": "Structure for FHIR type Identifier", + "fields": [ + { + "name": "use", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property use", + "default": null + }, + { + "name": "type", + "type": [ + "null", + { + "type": "record", + "name": "PatientLinkReferenceIdentifierReferenceIdentifierCodeableConcept", + "doc": "Structure for FHIR type CodeableConcept", + "fields": [ + { + "name": "coding", + "type": [ + "null", + { + "type": "array", + "items": { + "type": "record", + "name": "PatientLinkReferenceIdentifierReferenceIdentifierCodeableConceptCoding", + "doc": "Structure for FHIR type Coding", + "fields": [ + { + "name": "system", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property system", + "default": null + }, + { + "name": "version", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property version", + "default": null + }, + { + "name": "code", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property code", + "default": null + }, + { + "name": "display", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property display", + "default": null + }, + { + "name": "userSelected", + "type": [ + "null", + "boolean" + ], + "doc": "Field for FHIR property userSelected", + "default": null + } + ] + } + } + ], + "doc": "Field for FHIR property coding", + "default": null + }, + { + "name": "text", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property text", + "default": null + } + ] + } + ], + "doc": "Field for FHIR property type", + "default": null + }, + { + "name": "system", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property system", + "default": null + }, + { + "name": "value", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property value", + "default": null + }, + { + "name": "period", + "type": [ + "null", + { + "type": "record", + "name": "PatientLinkReferenceIdentifierReferenceIdentifierPeriod", + "doc": "Structure for FHIR type Period", + "fields": [ + { + "name": "start", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property start", + "default": null + }, + { + "name": "end", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property end", + "default": null + } + ] + } + ], + "doc": "Field for FHIR property period", + "default": null + }, + { + "name": "assigner", + "type": [ + "null", + { + "type": "record", + "name": "PatientLinkReferenceIdentifierReferenceIdentifierAssignerReference", + "doc": "Structure for FHIR type PatientLinkReferenceIdentifierReferenceIdentifierAssignerReference", + "fields": [ + { + "name": "organizationId", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + } + ] + } + ], + "doc": "Field for FHIR property assigner", + "default": null + } + ] + } + ], + "doc": "Reference field", + "default": null + }, + { + "name": "display", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + } + ] + } ], "doc": "Field for FHIR property assigner", "default": null diff --git a/bunsen/bunsen-avro/src/test/resources/stu3-us-core-schemas/us-core-observation-schema.json b/bunsen/bunsen-avro/src/test/resources/stu3-us-core-schemas/us-core-observation-schema.json index affc3f44e..5dc33abbe 100644 --- a/bunsen/bunsen-avro/src/test/resources/stu3-us-core-schemas/us-core-observation-schema.json +++ b/bunsen/bunsen-avro/src/test/resources/stu3-us-core-schemas/us-core-observation-schema.json @@ -504,9 +504,8 @@ "null", { "type": "record", - "name": "assignerReference", - "namespace": "Identifier", - "doc": "Structure for FHIR type Identifier.assignerReference", + "name": "ObservationIdentifierAssignerReference", + "doc": "Structure for FHIR type ObservationIdentifierAssignerReference", "fields": [ { "name": "organizationId", @@ -535,6 +534,219 @@ "doc": "Reference field", "default": null }, + { + "name": "identifier", + "type": [ + "null", + { + "type": "record", + "name": "ObservationIdentifierReferenceIdentifier", + "doc": "Structure for FHIR type Identifier", + "fields": [ + { + "name": "use", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property use", + "default": null + }, + { + "name": "type", + "type": [ + "null", + { + "type": "record", + "name": "ObservationIdentifierReferenceIdentifierCodeableConcept", + "doc": "Structure for FHIR type CodeableConcept", + "fields": [ + { + "name": "coding", + "type": [ + "null", + { + "type": "array", + "items": { + "type": "record", + "name": "ObservationIdentifierReferenceIdentifierCodeableConceptCoding", + "doc": "Structure for FHIR type Coding", + "fields": [ + { + "name": "system", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property system", + "default": null + }, + { + "name": "version", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property version", + "default": null + }, + { + "name": "code", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property code", + "default": null + }, + { + "name": "display", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property display", + "default": null + }, + { + "name": "userSelected", + "type": [ + "null", + "boolean" + ], + "doc": "Field for FHIR property userSelected", + "default": null + } + ] + } + } + ], + "doc": "Field for FHIR property coding", + "default": null + }, + { + "name": "text", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property text", + "default": null + } + ] + } + ], + "doc": "Field for FHIR property type", + "default": null + }, + { + "name": "system", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property system", + "default": null + }, + { + "name": "value", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property value", + "default": null + }, + { + "name": "period", + "type": [ + "null", + { + "type": "record", + "name": "ObservationIdentifierReferenceIdentifierPeriod", + "doc": "Structure for FHIR type Period", + "fields": [ + { + "name": "start", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property start", + "default": null + }, + { + "name": "end", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property end", + "default": null + } + ] + } + ], + "doc": "Field for FHIR property period", + "default": null + }, + { + "name": "assigner", + "type": [ + "null", + { + "type": "record", + "name": "ObservationIdentifierReferenceIdentifierAssignerReference", + "doc": "Structure for FHIR type ObservationIdentifierReferenceIdentifierAssignerReference", + "fields": [ + { + "name": "organizationId", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "id", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "reference", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "display", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + } + ] + } + ], + "doc": "Field for FHIR property assigner", + "default": null + } + ] + } + ], + "doc": "Reference field", + "default": null + }, { "name": "display", "type": [ @@ -565,9 +777,8 @@ "type": "array", "items": { "type": "record", - "name": "basedOnReference", - "namespace": "Observation", - "doc": "Structure for FHIR type Observation.basedOnReference", + "name": "ObservationBasedOnReference", + "doc": "Structure for FHIR type ObservationBasedOnReference", "fields": [ { "name": "carePlanId", @@ -657,7 +868,6 @@ { "type": "record", "name": "ObservationReferenceIdentifier", - "namespace": "com.cerner.bunsen.stu3.avro", "doc": "Structure for FHIR type Identifier", "fields": [ { @@ -811,7 +1021,235 @@ "name": "assigner", "type": [ "null", - "Identifier.assignerReference" + { + "type": "record", + "name": "ObservationReferenceIdentifierAssignerReference", + "doc": "Structure for FHIR type ObservationReferenceIdentifierAssignerReference", + "fields": [ + { + "name": "organizationId", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "id", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "reference", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "identifier", + "type": [ + "null", + { + "type": "record", + "name": "ObservationReferenceIdentifierReferenceIdentifier", + "doc": "Structure for FHIR type Identifier", + "fields": [ + { + "name": "use", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property use", + "default": null + }, + { + "name": "type", + "type": [ + "null", + { + "type": "record", + "name": "ObservationReferenceIdentifierReferenceIdentifierCodeableConcept", + "doc": "Structure for FHIR type CodeableConcept", + "fields": [ + { + "name": "coding", + "type": [ + "null", + { + "type": "array", + "items": { + "type": "record", + "name": "ObservationReferenceIdentifierReferenceIdentifierCodeableConceptCoding", + "doc": "Structure for FHIR type Coding", + "fields": [ + { + "name": "system", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property system", + "default": null + }, + { + "name": "version", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property version", + "default": null + }, + { + "name": "code", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property code", + "default": null + }, + { + "name": "display", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property display", + "default": null + }, + { + "name": "userSelected", + "type": [ + "null", + "boolean" + ], + "doc": "Field for FHIR property userSelected", + "default": null + } + ] + } + } + ], + "doc": "Field for FHIR property coding", + "default": null + }, + { + "name": "text", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property text", + "default": null + } + ] + } + ], + "doc": "Field for FHIR property type", + "default": null + }, + { + "name": "system", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property system", + "default": null + }, + { + "name": "value", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property value", + "default": null + }, + { + "name": "period", + "type": [ + "null", + { + "type": "record", + "name": "ObservationReferenceIdentifierReferenceIdentifierPeriod", + "doc": "Structure for FHIR type Period", + "fields": [ + { + "name": "start", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property start", + "default": null + }, + { + "name": "end", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property end", + "default": null + } + ] + } + ], + "doc": "Field for FHIR property period", + "default": null + }, + { + "name": "assigner", + "type": [ + "null", + { + "type": "record", + "name": "ObservationReferenceIdentifierReferenceIdentifierAssignerReference", + "doc": "Structure for FHIR type ObservationReferenceIdentifierReferenceIdentifierAssignerReference", + "fields": [ + { + "name": "organizationId", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + } + ] + } + ], + "doc": "Field for FHIR property assigner", + "default": null + } + ] + } + ], + "doc": "Reference field", + "default": null + }, + { + "name": "display", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + } + ] + } ], "doc": "Field for FHIR property assigner", "default": null @@ -952,9 +1390,8 @@ "null", { "type": "record", - "name": "subjectReference", - "namespace": "Observation", - "doc": "Structure for FHIR type Observation.subjectReference", + "name": "ObservationSubjectReference", + "doc": "Structure for FHIR type ObservationSubjectReference", "fields": [ { "name": "deviceId", @@ -1014,7 +1451,7 @@ "name": "identifier", "type": [ "null", - "com.cerner.bunsen.stu3.avro.ObservationReferenceIdentifier" + "ObservationReferenceIdentifier" ], "doc": "Reference field", "default": null @@ -1040,9 +1477,8 @@ "null", { "type": "record", - "name": "contextReference", - "namespace": "Observation", - "doc": "Structure for FHIR type Observation.contextReference", + "name": "ObservationContextReference", + "doc": "Structure for FHIR type ObservationContextReference", "fields": [ { "name": "encounterId", @@ -1084,7 +1520,7 @@ "name": "identifier", "type": [ "null", - "com.cerner.bunsen.stu3.avro.ObservationReferenceIdentifier" + "ObservationReferenceIdentifier" ], "doc": "Reference field", "default": null @@ -1178,9 +1614,8 @@ "type": "array", "items": { "type": "record", - "name": "performerReference", - "namespace": "Observation", - "doc": "Structure for FHIR type Observation.performerReference", + "name": "ObservationPerformerReference", + "doc": "Structure for FHIR type ObservationPerformerReference", "fields": [ { "name": "organizationId", @@ -1240,7 +1675,7 @@ "name": "identifier", "type": [ "null", - "com.cerner.bunsen.stu3.avro.ObservationReferenceIdentifier" + "ObservationReferenceIdentifier" ], "doc": "Reference field", "default": null @@ -1903,9 +2338,8 @@ "null", { "type": "record", - "name": "specimenReference", - "namespace": "Observation", - "doc": "Structure for FHIR type Observation.specimenReference", + "name": "ObservationSpecimenReference", + "doc": "Structure for FHIR type ObservationSpecimenReference", "fields": [ { "name": "specimenId", @@ -1938,7 +2372,7 @@ "name": "identifier", "type": [ "null", - "com.cerner.bunsen.stu3.avro.ObservationReferenceIdentifier" + "ObservationReferenceIdentifier" ], "doc": "Reference field", "default": null @@ -1964,9 +2398,8 @@ "null", { "type": "record", - "name": "deviceReference", - "namespace": "Observation", - "doc": "Structure for FHIR type Observation.deviceReference", + "name": "ObservationDeviceReference", + "doc": "Structure for FHIR type ObservationDeviceReference", "fields": [ { "name": "deviceId", @@ -2008,7 +2441,7 @@ "name": "identifier", "type": [ "null", - "com.cerner.bunsen.stu3.avro.ObservationReferenceIdentifier" + "ObservationReferenceIdentifier" ], "doc": "Reference field", "default": null @@ -2351,9 +2784,8 @@ "null", { "type": "record", - "name": "targetReference", - "namespace": "Observation.related", - "doc": "Structure for FHIR type Observation.related.targetReference", + "name": "ObservationRelatedTargetReference", + "doc": "Structure for FHIR type ObservationRelatedTargetReference", "fields": [ { "name": "observationId", @@ -2407,7 +2839,6 @@ { "type": "record", "name": "ObservationRelatedReferenceIdentifier", - "namespace": "com.cerner.bunsen.stu3.avro", "doc": "Structure for FHIR type Identifier", "fields": [ { @@ -2561,7 +2992,235 @@ "name": "assigner", "type": [ "null", - "Identifier.assignerReference" + { + "type": "record", + "name": "ObservationRelatedReferenceIdentifierAssignerReference", + "doc": "Structure for FHIR type ObservationRelatedReferenceIdentifierAssignerReference", + "fields": [ + { + "name": "organizationId", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "id", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "reference", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "identifier", + "type": [ + "null", + { + "type": "record", + "name": "ObservationRelatedReferenceIdentifierReferenceIdentifier", + "doc": "Structure for FHIR type Identifier", + "fields": [ + { + "name": "use", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property use", + "default": null + }, + { + "name": "type", + "type": [ + "null", + { + "type": "record", + "name": "ObservationRelatedReferenceIdentifierReferenceIdentifierCodeableConcept", + "doc": "Structure for FHIR type CodeableConcept", + "fields": [ + { + "name": "coding", + "type": [ + "null", + { + "type": "array", + "items": { + "type": "record", + "name": "ObservationRelatedReferenceIdentifierReferenceIdentifierCodeableConceptCoding", + "doc": "Structure for FHIR type Coding", + "fields": [ + { + "name": "system", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property system", + "default": null + }, + { + "name": "version", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property version", + "default": null + }, + { + "name": "code", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property code", + "default": null + }, + { + "name": "display", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property display", + "default": null + }, + { + "name": "userSelected", + "type": [ + "null", + "boolean" + ], + "doc": "Field for FHIR property userSelected", + "default": null + } + ] + } + } + ], + "doc": "Field for FHIR property coding", + "default": null + }, + { + "name": "text", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property text", + "default": null + } + ] + } + ], + "doc": "Field for FHIR property type", + "default": null + }, + { + "name": "system", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property system", + "default": null + }, + { + "name": "value", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property value", + "default": null + }, + { + "name": "period", + "type": [ + "null", + { + "type": "record", + "name": "ObservationRelatedReferenceIdentifierReferenceIdentifierPeriod", + "doc": "Structure for FHIR type Period", + "fields": [ + { + "name": "start", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property start", + "default": null + }, + { + "name": "end", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property end", + "default": null + } + ] + } + ], + "doc": "Field for FHIR property period", + "default": null + }, + { + "name": "assigner", + "type": [ + "null", + { + "type": "record", + "name": "ObservationRelatedReferenceIdentifierReferenceIdentifierAssignerReference", + "doc": "Structure for FHIR type ObservationRelatedReferenceIdentifierReferenceIdentifierAssignerReference", + "fields": [ + { + "name": "organizationId", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + } + ] + } + ], + "doc": "Field for FHIR property assigner", + "default": null + } + ] + } + ], + "doc": "Reference field", + "default": null + }, + { + "name": "display", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + } + ] + } ], "doc": "Field for FHIR property assigner", "default": null diff --git a/bunsen/bunsen-avro/src/test/resources/stu3-us-core-schemas/us-core-patient-schema.json b/bunsen/bunsen-avro/src/test/resources/stu3-us-core-schemas/us-core-patient-schema.json index d969da4dd..7eb868519 100644 --- a/bunsen/bunsen-avro/src/test/resources/stu3-us-core-schemas/us-core-patient-schema.json +++ b/bunsen/bunsen-avro/src/test/resources/stu3-us-core-schemas/us-core-patient-schema.json @@ -504,9 +504,8 @@ "null", { "type": "record", - "name": "assignerReference", - "namespace": "Identifier", - "doc": "Structure for FHIR type Identifier.assignerReference", + "name": "PatientIdentifierAssignerReference", + "doc": "Structure for FHIR type PatientIdentifierAssignerReference", "fields": [ { "name": "organizationId", @@ -535,6 +534,219 @@ "doc": "Reference field", "default": null }, + { + "name": "identifier", + "type": [ + "null", + { + "type": "record", + "name": "PatientIdentifierReferenceIdentifier", + "doc": "Structure for FHIR type Identifier", + "fields": [ + { + "name": "use", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property use", + "default": null + }, + { + "name": "type", + "type": [ + "null", + { + "type": "record", + "name": "PatientIdentifierReferenceIdentifierCodeableConcept", + "doc": "Structure for FHIR type CodeableConcept", + "fields": [ + { + "name": "coding", + "type": [ + "null", + { + "type": "array", + "items": { + "type": "record", + "name": "PatientIdentifierReferenceIdentifierCodeableConceptCoding", + "doc": "Structure for FHIR type Coding", + "fields": [ + { + "name": "system", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property system", + "default": null + }, + { + "name": "version", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property version", + "default": null + }, + { + "name": "code", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property code", + "default": null + }, + { + "name": "display", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property display", + "default": null + }, + { + "name": "userSelected", + "type": [ + "null", + "boolean" + ], + "doc": "Field for FHIR property userSelected", + "default": null + } + ] + } + } + ], + "doc": "Field for FHIR property coding", + "default": null + }, + { + "name": "text", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property text", + "default": null + } + ] + } + ], + "doc": "Field for FHIR property type", + "default": null + }, + { + "name": "system", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property system", + "default": null + }, + { + "name": "value", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property value", + "default": null + }, + { + "name": "period", + "type": [ + "null", + { + "type": "record", + "name": "PatientIdentifierReferenceIdentifierPeriod", + "doc": "Structure for FHIR type Period", + "fields": [ + { + "name": "start", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property start", + "default": null + }, + { + "name": "end", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property end", + "default": null + } + ] + } + ], + "doc": "Field for FHIR property period", + "default": null + }, + { + "name": "assigner", + "type": [ + "null", + { + "type": "record", + "name": "PatientIdentifierReferenceIdentifierAssignerReference", + "doc": "Structure for FHIR type PatientIdentifierReferenceIdentifierAssignerReference", + "fields": [ + { + "name": "organizationId", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "id", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "reference", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "display", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + } + ] + } + ], + "doc": "Field for FHIR property assigner", + "default": null + } + ] + } + ], + "doc": "Reference field", + "default": null + }, { "name": "display", "type": [ @@ -1618,9 +1830,8 @@ "null", { "type": "record", - "name": "organizationReference", - "namespace": "Patient.contact", - "doc": "Structure for FHIR type Patient.contact.organizationReference", + "name": "PatientContactOrganizationReference", + "doc": "Structure for FHIR type PatientContactOrganizationReference", "fields": [ { "name": "organizationId", @@ -1656,7 +1867,6 @@ { "type": "record", "name": "PatientContactReferenceIdentifier", - "namespace": "com.cerner.bunsen.stu3.avro", "doc": "Structure for FHIR type Identifier", "fields": [ { @@ -1810,7 +2020,235 @@ "name": "assigner", "type": [ "null", - "Identifier.assignerReference" + { + "type": "record", + "name": "PatientContactReferenceIdentifierAssignerReference", + "doc": "Structure for FHIR type PatientContactReferenceIdentifierAssignerReference", + "fields": [ + { + "name": "organizationId", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "id", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "reference", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "identifier", + "type": [ + "null", + { + "type": "record", + "name": "PatientContactReferenceIdentifierReferenceIdentifier", + "doc": "Structure for FHIR type Identifier", + "fields": [ + { + "name": "use", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property use", + "default": null + }, + { + "name": "type", + "type": [ + "null", + { + "type": "record", + "name": "PatientContactReferenceIdentifierReferenceIdentifierCodeableConcept", + "doc": "Structure for FHIR type CodeableConcept", + "fields": [ + { + "name": "coding", + "type": [ + "null", + { + "type": "array", + "items": { + "type": "record", + "name": "PatientContactReferenceIdentifierReferenceIdentifierCodeableConceptCoding", + "doc": "Structure for FHIR type Coding", + "fields": [ + { + "name": "system", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property system", + "default": null + }, + { + "name": "version", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property version", + "default": null + }, + { + "name": "code", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property code", + "default": null + }, + { + "name": "display", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property display", + "default": null + }, + { + "name": "userSelected", + "type": [ + "null", + "boolean" + ], + "doc": "Field for FHIR property userSelected", + "default": null + } + ] + } + } + ], + "doc": "Field for FHIR property coding", + "default": null + }, + { + "name": "text", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property text", + "default": null + } + ] + } + ], + "doc": "Field for FHIR property type", + "default": null + }, + { + "name": "system", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property system", + "default": null + }, + { + "name": "value", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property value", + "default": null + }, + { + "name": "period", + "type": [ + "null", + { + "type": "record", + "name": "PatientContactReferenceIdentifierReferenceIdentifierPeriod", + "doc": "Structure for FHIR type Period", + "fields": [ + { + "name": "start", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property start", + "default": null + }, + { + "name": "end", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property end", + "default": null + } + ] + } + ], + "doc": "Field for FHIR property period", + "default": null + }, + { + "name": "assigner", + "type": [ + "null", + { + "type": "record", + "name": "PatientContactReferenceIdentifierReferenceIdentifierAssignerReference", + "doc": "Structure for FHIR type PatientContactReferenceIdentifierReferenceIdentifierAssignerReference", + "fields": [ + { + "name": "organizationId", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + } + ] + } + ], + "doc": "Field for FHIR property assigner", + "default": null + } + ] + } + ], + "doc": "Reference field", + "default": null + }, + { + "name": "display", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + } + ] + } ], "doc": "Field for FHIR property assigner", "default": null @@ -2136,9 +2574,8 @@ "type": "array", "items": { "type": "record", - "name": "generalPractitionerReference", - "namespace": "Patient", - "doc": "Structure for FHIR type Patient.generalPractitionerReference", + "name": "PatientGeneralPractitionerReference", + "doc": "Structure for FHIR type PatientGeneralPractitionerReference", "fields": [ { "name": "organizationId", @@ -2183,7 +2620,6 @@ { "type": "record", "name": "PatientReferenceIdentifier", - "namespace": "com.cerner.bunsen.stu3.avro", "doc": "Structure for FHIR type Identifier", "fields": [ { @@ -2337,7 +2773,235 @@ "name": "assigner", "type": [ "null", - "Identifier.assignerReference" + { + "type": "record", + "name": "PatientReferenceIdentifierAssignerReference", + "doc": "Structure for FHIR type PatientReferenceIdentifierAssignerReference", + "fields": [ + { + "name": "organizationId", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "id", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "reference", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "identifier", + "type": [ + "null", + { + "type": "record", + "name": "PatientReferenceIdentifierReferenceIdentifier", + "doc": "Structure for FHIR type Identifier", + "fields": [ + { + "name": "use", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property use", + "default": null + }, + { + "name": "type", + "type": [ + "null", + { + "type": "record", + "name": "PatientReferenceIdentifierReferenceIdentifierCodeableConcept", + "doc": "Structure for FHIR type CodeableConcept", + "fields": [ + { + "name": "coding", + "type": [ + "null", + { + "type": "array", + "items": { + "type": "record", + "name": "PatientReferenceIdentifierReferenceIdentifierCodeableConceptCoding", + "doc": "Structure for FHIR type Coding", + "fields": [ + { + "name": "system", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property system", + "default": null + }, + { + "name": "version", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property version", + "default": null + }, + { + "name": "code", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property code", + "default": null + }, + { + "name": "display", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property display", + "default": null + }, + { + "name": "userSelected", + "type": [ + "null", + "boolean" + ], + "doc": "Field for FHIR property userSelected", + "default": null + } + ] + } + } + ], + "doc": "Field for FHIR property coding", + "default": null + }, + { + "name": "text", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property text", + "default": null + } + ] + } + ], + "doc": "Field for FHIR property type", + "default": null + }, + { + "name": "system", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property system", + "default": null + }, + { + "name": "value", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property value", + "default": null + }, + { + "name": "period", + "type": [ + "null", + { + "type": "record", + "name": "PatientReferenceIdentifierReferenceIdentifierPeriod", + "doc": "Structure for FHIR type Period", + "fields": [ + { + "name": "start", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property start", + "default": null + }, + { + "name": "end", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property end", + "default": null + } + ] + } + ], + "doc": "Field for FHIR property period", + "default": null + }, + { + "name": "assigner", + "type": [ + "null", + { + "type": "record", + "name": "PatientReferenceIdentifierReferenceIdentifierAssignerReference", + "doc": "Structure for FHIR type PatientReferenceIdentifierReferenceIdentifierAssignerReference", + "fields": [ + { + "name": "organizationId", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + } + ] + } + ], + "doc": "Field for FHIR property assigner", + "default": null + } + ] + } + ], + "doc": "Reference field", + "default": null + }, + { + "name": "display", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + } + ] + } ], "doc": "Field for FHIR property assigner", "default": null @@ -2370,9 +3034,8 @@ "null", { "type": "record", - "name": "managingOrganizationReference", - "namespace": "Patient", - "doc": "Structure for FHIR type Patient.managingOrganizationReference", + "name": "PatientManagingOrganizationReference", + "doc": "Structure for FHIR type PatientManagingOrganizationReference", "fields": [ { "name": "organizationId", @@ -2405,7 +3068,7 @@ "name": "identifier", "type": [ "null", - "com.cerner.bunsen.stu3.avro.PatientReferenceIdentifier" + "PatientReferenceIdentifier" ], "doc": "Reference field", "default": null @@ -2451,9 +3114,8 @@ "null", { "type": "record", - "name": "otherReference", - "namespace": "Patient.link", - "doc": "Structure for FHIR type Patient.link.otherReference", + "name": "PatientLinkOtherReference", + "doc": "Structure for FHIR type PatientLinkOtherReference", "fields": [ { "name": "patientId", @@ -2498,7 +3160,6 @@ { "type": "record", "name": "PatientLinkReferenceIdentifier", - "namespace": "com.cerner.bunsen.stu3.avro", "doc": "Structure for FHIR type Identifier", "fields": [ { @@ -2652,7 +3313,235 @@ "name": "assigner", "type": [ "null", - "Identifier.assignerReference" + { + "type": "record", + "name": "PatientLinkReferenceIdentifierAssignerReference", + "doc": "Structure for FHIR type PatientLinkReferenceIdentifierAssignerReference", + "fields": [ + { + "name": "organizationId", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "id", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "reference", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + }, + { + "name": "identifier", + "type": [ + "null", + { + "type": "record", + "name": "PatientLinkReferenceIdentifierReferenceIdentifier", + "doc": "Structure for FHIR type Identifier", + "fields": [ + { + "name": "use", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property use", + "default": null + }, + { + "name": "type", + "type": [ + "null", + { + "type": "record", + "name": "PatientLinkReferenceIdentifierReferenceIdentifierCodeableConcept", + "doc": "Structure for FHIR type CodeableConcept", + "fields": [ + { + "name": "coding", + "type": [ + "null", + { + "type": "array", + "items": { + "type": "record", + "name": "PatientLinkReferenceIdentifierReferenceIdentifierCodeableConceptCoding", + "doc": "Structure for FHIR type Coding", + "fields": [ + { + "name": "system", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property system", + "default": null + }, + { + "name": "version", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property version", + "default": null + }, + { + "name": "code", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property code", + "default": null + }, + { + "name": "display", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property display", + "default": null + }, + { + "name": "userSelected", + "type": [ + "null", + "boolean" + ], + "doc": "Field for FHIR property userSelected", + "default": null + } + ] + } + } + ], + "doc": "Field for FHIR property coding", + "default": null + }, + { + "name": "text", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property text", + "default": null + } + ] + } + ], + "doc": "Field for FHIR property type", + "default": null + }, + { + "name": "system", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property system", + "default": null + }, + { + "name": "value", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property value", + "default": null + }, + { + "name": "period", + "type": [ + "null", + { + "type": "record", + "name": "PatientLinkReferenceIdentifierReferenceIdentifierPeriod", + "doc": "Structure for FHIR type Period", + "fields": [ + { + "name": "start", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property start", + "default": null + }, + { + "name": "end", + "type": [ + "null", + "string" + ], + "doc": "Field for FHIR property end", + "default": null + } + ] + } + ], + "doc": "Field for FHIR property period", + "default": null + }, + { + "name": "assigner", + "type": [ + "null", + { + "type": "record", + "name": "PatientLinkReferenceIdentifierReferenceIdentifierAssignerReference", + "doc": "Structure for FHIR type PatientLinkReferenceIdentifierReferenceIdentifierAssignerReference", + "fields": [ + { + "name": "organizationId", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + } + ] + } + ], + "doc": "Field for FHIR property assigner", + "default": null + } + ] + } + ], + "doc": "Reference field", + "default": null + }, + { + "name": "display", + "type": [ + "null", + "string" + ], + "doc": "Reference field", + "default": null + } + ] + } ], "doc": "Field for FHIR property assigner", "default": null diff --git a/bunsen/bunsen-core-r4/src/main/java/com/cerner/bunsen/definitions/r4/R4StructureDefinitions.java b/bunsen/bunsen-core-r4/src/main/java/com/cerner/bunsen/definitions/r4/R4StructureDefinitions.java index c3b7a450d..9ce993e2b 100644 --- a/bunsen/bunsen-core-r4/src/main/java/com/cerner/bunsen/definitions/r4/R4StructureDefinitions.java +++ b/bunsen/bunsen-core-r4/src/main/java/com/cerner/bunsen/definitions/r4/R4StructureDefinitions.java @@ -8,6 +8,8 @@ import java.util.Collection; import java.util.List; import java.util.stream.Collectors; +import javax.annotation.Nonnull; +import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.r4.model.CanonicalType; import org.hl7.fhir.r4.model.ElementDefinition; import org.hl7.fhir.r4.model.StructureDefinition; @@ -37,9 +39,16 @@ public FhirConversionSupport conversionSupport() { } @Override - protected IStructureDefinition getStructureDefinition(String resourceUrl) { - return new StructureDefinitionWrapper( - (StructureDefinition) context.getValidationSupport().fetchStructureDefinition(resourceUrl)); + @Nonnull + protected IStructureDefinition getStructureDefinition(String resourceUrl) + throws IllegalArgumentException { + IBaseResource baseResource = + context.getValidationSupport().fetchStructureDefinition(resourceUrl); + if (baseResource == null) { + throw new IllegalArgumentException( + String.format("Unable to find definition for %s", resourceUrl)); + } + return new StructureDefinitionWrapper((StructureDefinition) baseResource); } // FHIR version specific interface implementations diff --git a/bunsen/bunsen-core-r4/src/test/java/com/cerner/bunsen/r4/TestData.java b/bunsen/bunsen-core-r4/src/test/java/com/cerner/bunsen/r4/TestData.java index 72d8b4589..c5b7e254e 100644 --- a/bunsen/bunsen-core-r4/src/test/java/com/cerner/bunsen/r4/TestData.java +++ b/bunsen/bunsen-core-r4/src/test/java/com/cerner/bunsen/r4/TestData.java @@ -32,6 +32,10 @@ import org.hl7.fhir.r4.model.Period; import org.hl7.fhir.r4.model.Provenance; import org.hl7.fhir.r4.model.Quantity; +import org.hl7.fhir.r4.model.QuestionnaireResponse; +import org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent; +import org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseItemComponent; +import org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseStatus; import org.hl7.fhir.r4.model.Reference; import org.hl7.fhir.r4.model.StringType; import org.hl7.fhir.r4.model.Task; @@ -438,6 +442,26 @@ public static Provenance newProvenance() { return provenance; } + /** + * Returns a new QuestionnaireResponse for testing. + * + * @return a FHIR QuestionnaireResponse for testing. + */ + public static QuestionnaireResponse newQuestionnaireResponse() { + QuestionnaireResponse response = new QuestionnaireResponse(); + response.setId("test-questionnaire-response-id"); + response.setStatus(QuestionnaireResponseStatus.COMPLETED); + response.setSubject(new Reference("Patient/12345").setDisplay("Here is a display for you.")); + QuestionnaireResponseItemComponent component = new QuestionnaireResponseItemComponent(); + component.setText("What is your Gender?"); + QuestionnaireResponseItemAnswerComponent answerComponent = + new QuestionnaireResponseItemAnswerComponent(); + answerComponent.setValue(new StringType("Male")); + component.addAnswer(answerComponent); + response.addItem(component); + return response; + } + /** * Returns a new Patient from Bunsen Test profile for testing. * diff --git a/bunsen/bunsen-core-stu3/src/main/java/com/cerner/bunsen/definitions/stu3/Stu3StructureDefinitions.java b/bunsen/bunsen-core-stu3/src/main/java/com/cerner/bunsen/definitions/stu3/Stu3StructureDefinitions.java index 5c9d30e6f..0a45ad880 100644 --- a/bunsen/bunsen-core-stu3/src/main/java/com/cerner/bunsen/definitions/stu3/Stu3StructureDefinitions.java +++ b/bunsen/bunsen-core-stu3/src/main/java/com/cerner/bunsen/definitions/stu3/Stu3StructureDefinitions.java @@ -7,8 +7,10 @@ import com.cerner.bunsen.definitions.StructureDefinitions; import java.util.List; import java.util.stream.Collectors; +import javax.annotation.Nonnull; import org.hl7.fhir.dstu3.model.ElementDefinition; import org.hl7.fhir.dstu3.model.StructureDefinition; +import org.hl7.fhir.instance.model.api.IBaseResource; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -31,9 +33,16 @@ public FhirConversionSupport conversionSupport() { } @Override - protected IStructureDefinition getStructureDefinition(String resourceUrl) { - return new StructureDefinitionWrapper( - (StructureDefinition) context.getValidationSupport().fetchStructureDefinition(resourceUrl)); + @Nonnull + protected IStructureDefinition getStructureDefinition(String resourceUrl) + throws IllegalArgumentException { + IBaseResource baseResource = + context.getValidationSupport().fetchStructureDefinition(resourceUrl); + if (baseResource == null) { + throw new IllegalArgumentException( + String.format("Unable to find definition for %s", resourceUrl)); + } + return new StructureDefinitionWrapper((StructureDefinition) baseResource); } // FHIR version specific interface implementations diff --git a/bunsen/bunsen-core/src/main/java/com/cerner/bunsen/definitions/HapiConverter.java b/bunsen/bunsen-core/src/main/java/com/cerner/bunsen/definitions/HapiConverter.java index e0038ed24..7725fc773 100644 --- a/bunsen/bunsen-core/src/main/java/com/cerner/bunsen/definitions/HapiConverter.java +++ b/bunsen/bunsen-core/src/main/java/com/cerner/bunsen/definitions/HapiConverter.java @@ -76,7 +76,7 @@ public String extensionUrl() { /** * The FHIR type of the element to be converted, or null if there is no FHIR type, such as within - * a FHIR backbone element. + * a FHIR backbone element. The return value should be a valid FHIR type. * * @return FHIR type of the element to be converted. */ diff --git a/bunsen/bunsen-core/src/main/java/com/cerner/bunsen/definitions/StructureDefinitions.java b/bunsen/bunsen-core/src/main/java/com/cerner/bunsen/definitions/StructureDefinitions.java index bd7acaa73..ad4ec2f4f 100644 --- a/bunsen/bunsen-core/src/main/java/com/cerner/bunsen/definitions/StructureDefinitions.java +++ b/bunsen/bunsen-core/src/main/java/com/cerner/bunsen/definitions/StructureDefinitions.java @@ -16,6 +16,7 @@ import java.util.Optional; import java.util.Set; import java.util.stream.Collectors; +import javax.annotation.Nonnull; import javax.annotation.Nullable; /** Abstract base class to visit FHIR structure definitions. */ @@ -494,24 +495,9 @@ public T transform( IStructureDefinition definition = getStructureDefinition(resourceTypeUrl); - if (definition == null) { - throw new IllegalArgumentException("Unable to find definition for " + resourceTypeUrl); - } - List containedDefinitions = containedResourceTypeUrls.stream() - .map( - containedResourceTypeUrl -> { - IStructureDefinition containedDefinition = - getStructureDefinition(containedResourceTypeUrl); - - if (containedDefinition == null) { - throw new IllegalArgumentException( - "Unable to find definition for " + containedResourceTypeUrl); - } - - return containedDefinition; - }) + .map(containedResourceTypeUrl -> getStructureDefinition(containedResourceTypeUrl)) .collect(Collectors.toList()); return transformRoot(visitor, definition, containedDefinitions); @@ -550,7 +536,11 @@ private T transform( // Retrieve only the unique reference types .distinct() .collect(Collectors.toList()); - return visitor.visitReference(parentElement.toString(), referenceTypes, childElements); + + String elementName = DefinitionVisitorsUtil.elementName(parentElement.getPath()); + String elementFullPath = DefinitionVisitorsUtil.pathFromStack(elementName, stack); + return visitor.visitReference( + DefinitionVisitorsUtil.recordNameFor(elementFullPath), referenceTypes, childElements); } else { String rootName = DefinitionVisitorsUtil.elementName(root.getPath()); @@ -600,12 +590,16 @@ private T transformRoot( } /** - * Returns the structure definition interface corresponding to the given URL. + * Returns the structure definition interface corresponding to the given resourceUrl. * * @param resourceUrl it can be a resource type like `Patient` or a profile URL. - * @return the {@link IStructureDefinition} corresponding to the `resourceUrl`. + * @return the {@link IStructureDefinition} corresponding to the `resourceUrl` + * @throws IllegalArgumentException if the structure definition cannot be found for the given + * resourceUrl. */ - protected abstract IStructureDefinition getStructureDefinition(String resourceUrl); + @Nonnull + protected abstract IStructureDefinition getStructureDefinition(String resourceUrl) + throws IllegalArgumentException; /** * Returns the structure definition interface corresponding to the given element. diff --git a/bunsen/extension-structure-definitions/src/main/java/com/cerner/bunsen/common/R4UsCoreProfileData.java b/bunsen/extension-structure-definitions/src/main/java/com/cerner/bunsen/common/R4UsCoreProfileData.java index 1e2e30b04..5096f5009 100644 --- a/bunsen/extension-structure-definitions/src/main/java/com/cerner/bunsen/common/R4UsCoreProfileData.java +++ b/bunsen/extension-structure-definitions/src/main/java/com/cerner/bunsen/common/R4UsCoreProfileData.java @@ -50,4 +50,9 @@ public class R4UsCoreProfileData { Arrays.asList( "http://hl7.org/fhir/StructureDefinition/Medication", "http://hl7.org/fhir/us/core/StructureDefinition/us-core-medication"); + + public static final List US_CORE_QUESTIONNAIRE_RESPONSE_PROFILES = + Arrays.asList( + "http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse", + "http://hl7.org/fhir/us/core/StructureDefinition/us-core-questionnaireresponse"); } diff --git a/bunsen/extension-structure-definitions/src/main/resources/r4-us-core-definitions/StructureDefinition-sdc-questionnaire-itemAnswerMedia.json b/bunsen/extension-structure-definitions/src/main/resources/r4-us-core-definitions/StructureDefinition-sdc-questionnaire-itemAnswerMedia.json new file mode 100644 index 000000000..94ac73cc8 --- /dev/null +++ b/bunsen/extension-structure-definitions/src/main/resources/r4-us-core-definitions/StructureDefinition-sdc-questionnaire-itemAnswerMedia.json @@ -0,0 +1,301 @@ +{ + "resourceType": "StructureDefinition", + "id": "sdc-questionnaire-itemAnswerMedia", + "text": { + "status": "extensions", + "div": "
\r\n\r\n\r\n
NameFlagsCard.TypeDescription & Constraints\"doco\"
\".\"\".\" Extension 0..1ExtensionAnswer Media to display
\".\"\".\"\".\" url 1..1uri"http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-itemAnswerMedia"
\".\"\".\"\".\" value[x] 0..1AttachmentValue of extension

\"doco\" Documentation for this format
" + }, + "extension": [ + { + "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status", + "valueCode": "draft" + }, + { + "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm", + "valueInteger": 0 + } + ], + "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-itemAnswerMedia", + "version": "3.0.0", + "name": "ItemAnswerMedia", + "title": "Item Answer Media", + "status": "draft", + "date": "2022-03-08T18:33:14+00:00", + "publisher": "HL7 International - FHIR Infrastructure Work Group", + "contact": [ + { + "telecom": [ + { + "system": "url", + "value": "http://hl7.org/Special/committees/fiwg" + } + ] + } + ], + "description": "Media to render/make available as an accompaniment to a specific answer option, for example - an image, video or audio clip. This does not replace the need for answer.value[x]. The attachment.text SHOULD be present as the alternative/accessibility text for systems unable to expose the media and users unable to consume it. Media.contentType SHALL be present. When included in a QuestionnaireResponse it SHALL be the same as the media for the corresponding answerOption in the Questionnaire.", + "jurisdiction": [ + { + "coding": [ + { + "system": "http://unstats.un.org/unsd/methods/m49/m49.htm", + "code": "001" + } + ] + } + ], + "purpose": "Need to be able to provide a visual representation of the response to the question being asked.", + "fhirVersion": "4.0.1", + "mapping": [ + { + "identity": "rim", + "uri": "http://hl7.org/v3", + "name": "RIM Mapping" + } + ], + "kind": "complex-type", + "abstract": false, + "context": [ + { + "type": "element", + "expression": "Questionnaire.item.answerOption" + }, + { + "type": "element", + "expression": "QuestionnaireResponse.item.answer" + } + ], + "type": "Extension", + "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Extension", + "derivation": "constraint", + "snapshot": { + "element": [ + { + "id": "Extension", + "path": "Extension", + "short": "Answer Media to display", + "definition": "Media to render/make available as an accompaniment to a specific answer option", + "min": 0, + "max": "1", + "base": { + "path": "Extension", + "min": 0, + "max": "*" + }, + "condition": [ + "ele-1" + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "xpath": "@value|f:*|h:div", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + }, + { + "key": "ext-1", + "severity": "error", + "human": "Must have either extensions or value[x], not both", + "expression": "extension.exists() != value.exists()", + "xpath": "exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])", + "source": "http://hl7.org/fhir/StructureDefinition/Extension" + } + ], + "isModifier": false + }, + { + "id": "Extension.id", + "path": "Extension.id", + "representation": [ + "xmlAttr" + ], + "short": "Unique id for inter-element referencing", + "definition": "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.", + "min": 0, + "max": "1", + "base": { + "path": "Element.id", + "min": 0, + "max": "1" + }, + "type": [ + { + "extension": [ + { + "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type", + "valueUrl": "string" + } + ], + "code": "http://hl7.org/fhirpath/System.String" + } + ], + "isModifier": false, + "isSummary": false, + "mapping": [ + { + "identity": "rim", + "map": "n/a" + } + ] + }, + { + "id": "Extension.extension", + "path": "Extension.extension", + "slicing": { + "discriminator": [ + { + "type": "value", + "path": "url" + } + ], + "description": "Extensions are always sliced by (at least) url", + "rules": "open" + }, + "short": "Additional content defined by implementations", + "definition": "May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.", + "comment": "There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.", + "alias": [ + "extensions", + "user content" + ], + "min": 0, + "max": "*", + "base": { + "path": "Element.extension", + "min": 0, + "max": "*" + }, + "type": [ + { + "code": "Extension" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "xpath": "@value|f:*|h:div", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + }, + { + "key": "ext-1", + "severity": "error", + "human": "Must have either extensions or value[x], not both", + "expression": "extension.exists() != value.exists()", + "xpath": "exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])", + "source": "http://hl7.org/fhir/StructureDefinition/Extension" + } + ], + "isModifier": false, + "isSummary": false, + "mapping": [ + { + "identity": "rim", + "map": "n/a" + } + ] + }, + { + "id": "Extension.url", + "path": "Extension.url", + "representation": [ + "xmlAttr" + ], + "short": "identifies the meaning of the extension", + "definition": "Source of the definition for the extension code - a logical name or a URL.", + "comment": "The definition may point directly to a computable or human-readable definition of the extensibility codes, or it may be a logical URI as declared in some other specification. The definition SHALL be a URI for the Structure Definition defining the extension.", + "min": 1, + "max": "1", + "base": { + "path": "Extension.url", + "min": 1, + "max": "1" + }, + "type": [ + { + "code": "uri" + } + ], + "fixedUri": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-itemAnswerMedia", + "isModifier": false, + "isSummary": false, + "mapping": [ + { + "identity": "rim", + "map": "N/A" + } + ] + }, + { + "id": "Extension.value[x]", + "path": "Extension.value[x]", + "short": "Value of extension", + "definition": "Value of extension - must be one of a constrained set of the data types (see [Extensibility](http://hl7.org/fhir/R4/extensibility.html) for a list).", + "min": 0, + "max": "1", + "base": { + "path": "Extension.value[x]", + "min": 0, + "max": "1" + }, + "type": [ + { + "code": "Attachment" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "xpath": "@value|f:*|h:div", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "isModifier": false, + "isSummary": false, + "mapping": [ + { + "identity": "rim", + "map": "N/A" + } + ] + } + ] + }, + "differential": { + "element": [ + { + "id": "Extension", + "path": "Extension", + "short": "Answer Media to display", + "definition": "Media to render/make available as an accompaniment to a specific answer option", + "min": 0, + "max": "1" + }, + { + "id": "Extension.url", + "path": "Extension.url", + "type": [ + { + "code": "uri" + } + ], + "fixedUri": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-itemAnswerMedia" + }, + { + "id": "Extension.value[x]", + "path": "Extension.value[x]", + "type": [ + { + "code": "Attachment" + } + ] + } + ] + } +} \ No newline at end of file diff --git a/bunsen/extension-structure-definitions/src/main/resources/r4-us-core-definitions/StructureDefinition-sdc-questionnaire-itemMedia.json b/bunsen/extension-structure-definitions/src/main/resources/r4-us-core-definitions/StructureDefinition-sdc-questionnaire-itemMedia.json new file mode 100644 index 000000000..c74080f27 --- /dev/null +++ b/bunsen/extension-structure-definitions/src/main/resources/r4-us-core-definitions/StructureDefinition-sdc-questionnaire-itemMedia.json @@ -0,0 +1,305 @@ +{ + "resourceType": "StructureDefinition", + "id": "sdc-questionnaire-itemMedia", + "text": { + "status": "extensions", + "div": "
\r\n\r\n\r\n
NameFlagsCard.TypeDescription & Constraints\"doco\"
\".\"\".\" Extension 0..1ExtensionMedia to display
\".\"\".\"\".\" url 1..1uri"http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-itemMedia"
\".\"\".\"\".\" value[x] 0..1AttachmentValue of extension

\"doco\" Documentation for this format
" + }, + "extension": [ + { + "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status", + "valueCode": "draft" + }, + { + "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm", + "valueInteger": 0 + } + ], + "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-itemMedia", + "version": "3.0.0", + "name": "ItemMedia", + "title": "Item Media", + "status": "draft", + "date": "2022-03-08T18:33:14+00:00", + "publisher": "HL7 International - FHIR Infrastructure Work Group", + "contact": [ + { + "telecom": [ + { + "system": "url", + "value": "http://hl7.org/Special/committees/fiwg" + } + ] + } + ], + "description": "Media to render/make available as an accompaniment to the question being asked, for example - an image, video or audio clip. This does not replace the need for item.text. The attachment.text SHOULD be present as the alternative/accessibility text for systems unable to expose the media and users unable to consume it. Media.contentType SHALL be present. When included in a QuestionnaireResponse it SHALL be the same as the media for the same item in the Questionnaire.", + "jurisdiction": [ + { + "coding": [ + { + "system": "http://unstats.un.org/unsd/methods/m49/m49.htm", + "code": "001" + } + ] + } + ], + "purpose": "Need to be able to provide a visual representation of the question being asked.", + "fhirVersion": "4.0.1", + "mapping": [ + { + "identity": "rim", + "uri": "http://hl7.org/v3", + "name": "RIM Mapping" + } + ], + "kind": "complex-type", + "abstract": false, + "context": [ + { + "type": "element", + "expression": "Questionnaire.item" + }, + { + "type": "element", + "expression": "QuestionnaireResponse.item" + }, + { + "type": "element", + "expression": "ElementDefinition" + } + ], + "type": "Extension", + "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Extension", + "derivation": "constraint", + "snapshot": { + "element": [ + { + "id": "Extension", + "path": "Extension", + "short": "Media to display", + "definition": "Media to render/make available as an accompaniment to the question being asked", + "min": 0, + "max": "1", + "base": { + "path": "Extension", + "min": 0, + "max": "*" + }, + "condition": [ + "ele-1" + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "xpath": "@value|f:*|h:div", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + }, + { + "key": "ext-1", + "severity": "error", + "human": "Must have either extensions or value[x], not both", + "expression": "extension.exists() != value.exists()", + "xpath": "exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])", + "source": "http://hl7.org/fhir/StructureDefinition/Extension" + } + ], + "isModifier": false + }, + { + "id": "Extension.id", + "path": "Extension.id", + "representation": [ + "xmlAttr" + ], + "short": "Unique id for inter-element referencing", + "definition": "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.", + "min": 0, + "max": "1", + "base": { + "path": "Element.id", + "min": 0, + "max": "1" + }, + "type": [ + { + "extension": [ + { + "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type", + "valueUrl": "string" + } + ], + "code": "http://hl7.org/fhirpath/System.String" + } + ], + "isModifier": false, + "isSummary": false, + "mapping": [ + { + "identity": "rim", + "map": "n/a" + } + ] + }, + { + "id": "Extension.extension", + "path": "Extension.extension", + "slicing": { + "discriminator": [ + { + "type": "value", + "path": "url" + } + ], + "description": "Extensions are always sliced by (at least) url", + "rules": "open" + }, + "short": "Additional content defined by implementations", + "definition": "May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.", + "comment": "There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.", + "alias": [ + "extensions", + "user content" + ], + "min": 0, + "max": "*", + "base": { + "path": "Element.extension", + "min": 0, + "max": "*" + }, + "type": [ + { + "code": "Extension" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "xpath": "@value|f:*|h:div", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + }, + { + "key": "ext-1", + "severity": "error", + "human": "Must have either extensions or value[x], not both", + "expression": "extension.exists() != value.exists()", + "xpath": "exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])", + "source": "http://hl7.org/fhir/StructureDefinition/Extension" + } + ], + "isModifier": false, + "isSummary": false, + "mapping": [ + { + "identity": "rim", + "map": "n/a" + } + ] + }, + { + "id": "Extension.url", + "path": "Extension.url", + "representation": [ + "xmlAttr" + ], + "short": "identifies the meaning of the extension", + "definition": "Source of the definition for the extension code - a logical name or a URL.", + "comment": "The definition may point directly to a computable or human-readable definition of the extensibility codes, or it may be a logical URI as declared in some other specification. The definition SHALL be a URI for the Structure Definition defining the extension.", + "min": 1, + "max": "1", + "base": { + "path": "Extension.url", + "min": 1, + "max": "1" + }, + "type": [ + { + "code": "uri" + } + ], + "fixedUri": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-itemMedia", + "isModifier": false, + "isSummary": false, + "mapping": [ + { + "identity": "rim", + "map": "N/A" + } + ] + }, + { + "id": "Extension.value[x]", + "path": "Extension.value[x]", + "short": "Value of extension", + "definition": "Value of extension - must be one of a constrained set of the data types (see [Extensibility](http://hl7.org/fhir/R4/extensibility.html) for a list).", + "min": 0, + "max": "1", + "base": { + "path": "Extension.value[x]", + "min": 0, + "max": "1" + }, + "type": [ + { + "code": "Attachment" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "xpath": "@value|f:*|h:div", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "isModifier": false, + "isSummary": false, + "mapping": [ + { + "identity": "rim", + "map": "N/A" + } + ] + } + ] + }, + "differential": { + "element": [ + { + "id": "Extension", + "path": "Extension", + "short": "Media to display", + "definition": "Media to render/make available as an accompaniment to the question being asked", + "min": 0, + "max": "1" + }, + { + "id": "Extension.url", + "path": "Extension.url", + "type": [ + { + "code": "uri" + } + ], + "fixedUri": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-itemMedia" + }, + { + "id": "Extension.value[x]", + "path": "Extension.value[x]", + "type": [ + { + "code": "Attachment" + } + ] + } + ] + } +} \ No newline at end of file diff --git a/e2e-tests/controller-spark/controller_spark_sql_validation.sh b/e2e-tests/controller-spark/controller_spark_sql_validation.sh index f12d1a55a..376e6c7ed 100755 --- a/e2e-tests/controller-spark/controller_spark_sql_validation.sh +++ b/e2e-tests/controller-spark/controller_spark_sql_validation.sh @@ -182,11 +182,12 @@ function check_parquet() { # check whether output directory has started receiving parquet files. if [[ "$(ls -A $output)" ]] then - local total_patients=$(java -jar ./parquet-tools-1.11.1.jar rowcount "${output}/*/Patient/" | awk '{print $3}') - local total_encounters=$(java -jar ./parquet-tools-1.11.1.jar rowcount "${output}/*/Encounter/" \ - | awk '{print $3}') - local total_observations=$(java -jar ./parquet-tools-1.11.1.jar rowcount "${output}/*/Observation/" \ - | awk '{print $3}') + local total_patients=$(java -Xms16g -Xmx16g -jar ./parquet-tools-1.11.1.jar rowcount \ + "${output}/*/Patient/" | awk '{print $3}') + local total_encounters=$(java -Xms16g -Xmx16g -jar ./parquet-tools-1.11.1.jar rowcount \ + "${output}/*/Encounter/" | awk '{print $3}') + local total_observations=$(java -Xms16g -Xmx16g -jar ./parquet-tools-1.11.1.jar rowcount \ + "${output}/*/Observation/" | awk '{print $3}') print_message "Total patients: $total_patients" print_message "Total encounters: $total_encounters" @@ -355,7 +356,9 @@ clear add_resource update_resource -sleep 10 +# Provide enough buffer time before triggering the incremental run so that the previous full run +# completes fully (including creation of hive tables) +sleep 60 # Incremental run. run_pipeline "INCREMENTAL" check_parquet true diff --git a/e2e-tests/pipeline_validation.sh b/e2e-tests/pipeline_validation.sh index 3311b0f39..362f92518 100755 --- a/e2e-tests/pipeline_validation.sh +++ b/e2e-tests/pipeline_validation.sh @@ -196,16 +196,18 @@ function fhir_source_query() { ################################################# function test_parquet_sink() { print_message "Counting number of patients, encounters and obs sinked to parquet files" - local total_patients_streamed=$(java -jar ./controller-spark/parquet-tools-1.11.1.jar rowcount \ - "${HOME_PATH}/${PARQUET_SUBDIR}/Patient/" | awk '{print $3}') + local total_patients_streamed=$(java -Xms16g -Xmx16g -jar \ + ./controller-spark/parquet-tools-1.11.1.jar rowcount "${HOME_PATH}/${PARQUET_SUBDIR}/Patient/" | \ + awk '{print $3}') print_message "Total patients synced to parquet ---> ${total_patients_streamed}" - local total_encounters_streamed=$(java -jar ./controller-spark/parquet-tools-1.11.1.jar rowcount \ - "${HOME_PATH}/${PARQUET_SUBDIR}/Encounter/" | awk '{print $3}') + local total_encounters_streamed=$(java -Xms16g -Xmx16g -jar \ + ./controller-spark/parquet-tools-1.11.1.jar rowcount "${HOME_PATH}/${PARQUET_SUBDIR}/Encounter/" \ + | awk '{print $3}') print_message "Total encounters synced to parquet ---> ${total_encounters_streamed}" - local total_obs_streamed=$(java -jar ./controller-spark/parquet-tools-1.11.1.jar rowcount \ - "${HOME_PATH}/${PARQUET_SUBDIR}/Observation/" | awk '{print $3}') + local total_obs_streamed=$(java -Xms16g -Xmx16g -jar ./controller-spark/parquet-tools-1.11.1.jar \ + rowcount "${HOME_PATH}/${PARQUET_SUBDIR}/Observation/" | awk '{print $3}') print_message "Total obs synced to parquet ---> ${total_obs_streamed}" if [[ "${total_patients_streamed}" == "${TOTAL_TEST_PATIENTS}" && "${total_encounters_streamed}" \ diff --git a/pipelines/common/src/test/java/com/google/fhir/analytics/ParquetUtilTest.java b/pipelines/common/src/test/java/com/google/fhir/analytics/ParquetUtilTest.java index dad1bb6bb..2ff59bda7 100644 --- a/pipelines/common/src/test/java/com/google/fhir/analytics/ParquetUtilTest.java +++ b/pipelines/common/src/test/java/com/google/fhir/analytics/ParquetUtilTest.java @@ -33,6 +33,7 @@ import org.apache.beam.sdk.io.fs.ResourceId; import org.hl7.fhir.r4.model.Bundle; import org.hl7.fhir.r4.model.Observation; +import org.hl7.fhir.r4.model.QuestionnaireResponse; import org.junit.Before; import org.junit.Rule; import org.junit.Test; @@ -235,4 +236,32 @@ public void writeObservationBundleWithMultipleProfiles() throws IOException, Pro parquetUtil.closeAllWriters(); } + + @Test + public void writeQuestionnaireResponse() throws IOException, ProfileException { + rootPath = Files.createTempDirectory("PARQUET_TEST"); + AvroConversionUtil.deRegisterMappingsFor(FhirVersionEnum.R4); + avroConversionUtil = + AvroConversionUtil.getInstance(FhirVersionEnum.R4, "classpath:/r4-us-core-definitions", 1); + parquetUtil = + new ParquetUtil( + FhirVersionEnum.R4, + "classpath:/r4-us-core-definitions", + rootPath.toString(), + 0, + 0, + "", + 1); + + String questionnaireResponseStr = + Resources.toString( + Resources.getResource("questionnaire_response.json"), StandardCharsets.UTF_8); + IParser parser = avroConversionUtil.getFhirContext().newJsonParser(); + QuestionnaireResponse questionnaireResponse = + parser.parseResource(QuestionnaireResponse.class, questionnaireResponseStr); + parquetUtil.write(questionnaireResponse); + + parquetUtil.closeAllWriters(); + AvroConversionUtil.deRegisterMappingsFor(FhirVersionEnum.R4); + } } diff --git a/pipelines/common/src/test/resources/questionnaire_response.json b/pipelines/common/src/test/resources/questionnaire_response.json new file mode 100644 index 000000000..4a1761689 --- /dev/null +++ b/pipelines/common/src/test/resources/questionnaire_response.json @@ -0,0 +1,60 @@ +{ + "resourceType": "QuestionnaireResponse", + "id": "glascow-coma-score", + "meta": { + "profile": [ + "http://hl7.org/fhir/us/core/StructureDefinition/us-core-questionnaireresponse" + ] + }, + "text": { + "status": "generated", + "div": "
" + }, + "_questionnaire": { + "extension": [ + { + "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-extension-questionnaire-uri", + "valueUri": "https://www.cdc.gov/masstrauma/resources/gcs.pdf" + } + ] + }, + "status": "completed", + "subject": { + "reference": "Patient/example", + "display": "Amy V. Shaw" + }, + "authored": "2014-12-11T04:44:16Z", + "author": { + "reference": "Practitioner/practitioner-1", + "display": "Ronald Bone" + }, + "item": [ + { + "linkId": "1", + "text": "Eye Opening Response", + "answer": [ + { + "valueDecimal": 4 + } + ] + }, + { + "linkId": "2", + "text": "Verbal Response", + "answer": [ + { + "valueDecimal": 4 + } + ] + }, + { + "linkId": "3", + "text": "Motor Response", + "answer": [ + { + "valueDecimal": 4 + } + ] + } + ] +} \ No newline at end of file