//TODO Currently not handled: text, meta, references
public void generateMethods(FhirToHapiTypeConverter converter, List<Method> methods) {
        List<HapiType> types = converter.getHapiTypes();
        System.out.println("Attribute path:" + converter.getFullAttributePath());
        if ("Immunization.doseQuantity".equals(converter.getFullAttributePath())) {
            System.out.println("Start Debugging");
        }
        if (types == null || types.isEmpty() || converter.getCardinality() == Cardinality.CONSTRAINED_OUT) {
            return;
        } else {
            if(converter.isMultiType()) {
//                Method method = Method.constructNoArgMethod(Method.buildGetterName(converter.parseAttributeName()), "org.hl7.fhir.dstu3.model.Type");
//                method.setBody(getTemplate().getAdapterGetMethodDelegationWithTryCatchBody(converter.parseAttributeName()));
//                addMethod(methods, method);
                buildGetterMethod(methods, converter.parseAttributeName(), "org.hl7.fhir.dstu3.model.Type", null, false, null);
//                method = constructSetMethodSignature(converter.parseAttributeName(), "org.hl7.fhir.dstu3.model.Type", getParentType());
//                method.setBody(getTemplate().getAdapterSetMethodDelegationBody(converter.parseAttributeName()));
//                method.addImport("org.hl7.fhir.dstu3.model.Type");
//                addMethod(methods, method);
                buildSetterMethod(methods, converter.parseAttributeName(), "org.hl7.fhir.dstu3.model.Type", getParentType());
            }
            if(converter.isReferenceMultiType() && !converter.isMultipleCardinality() && !converter.isMultiType()) {
//                Method method = Method.constructNoArgMethod(Method.buildGetterName(converter.parseAttributeName()), "org.hl7.fhir.dstu3.model.Reference");
//                method.setBody(getTemplate().getAdapterGetMethodDelegationWithTryCatchBody(converter.parseAttributeName()));
//                addMethod(methods, method);
                buildGetterMethod(methods, converter.parseAttributeName(), "org.hl7.fhir.dstu3.model.Reference", null, false, null);
//                method = Method.constructNoArgMethod(Method.buildGetterName(converter.parseAttributeName() + "Target"), "org.hl7.fhir.dstu3.model.Resource");
//                method.setBody(getTemplate().getAdapterGetMethodDelegationWithTryCatchBody(converter.parseAttributeName() + "Target"));
//                addMethod(methods, method);
                buildGetterMethod(methods, converter.parseAttributeName() + "Target", "org.hl7.fhir.dstu3.model.Resource", null, false, null);
            }
            for (HapiType type : types) {
                if (type.getDatatype() == null && type.getGeneratedType() == null) {
                    System.out.println("Investigate : " + converter.getFullAttributePath());
                    //TODO Currently not handled: text, meta, references
                    continue;
                }
                if (type.isReference()) {
                    handleReferenceTypes(converter, type, methods);
                } else if (!type.isResource() && type.getGeneratedType() != null) {
                    handleExtendedDatatypes(converter, type, methods);
                } else if (type.isBackboneElement()) {
                    handleDatatypeMethods(converter, type, methods);
                } else if (type.isEnumerationType()) {
                    handleEnumTypeMethods(converter, type, methods);
                } else {
                    FhirDatatypeEnum datatype = FhirDatatypeEnum.getEnumeratedDatatype(type.getFhirType());
                    if (datatype != null && datatype.isPrimitiveDatatype()) {
                        handlePrimitiveTypeMethods(converter, type, methods);
                        //TODO Create methods that return the equivalent java type
                    } else {
                        handleDatatypeMethods(converter, type, methods);
                    }
                }
            }
            if (converter.isMultiType()) {
                //TODO Add org.hl7.fhir.dstu3.model.Type method
            }
        }
    }
if (type.getDatatype() == null && type.getGeneratedType() == null) {
System.out.println("Investigate : " + converter.getFullAttributePath());
//TODO Currently not handled: text, meta, references
continue;
}
// addMethod(methods, method);
buildGetterMethod(methods, converter.parseAttributeName(), "org.hl7.fhir.dstu3.model.Reference", null, false, null);
// method = Method.constructNoArgMethod(Method.buildGetterName(converter.parseAttributeName() + "Target"), "org.hl7.fhir.dstu3.model.Resource");
// method.setBody(getTemplate().getAdapterGetMethodDelegationWithTryCatchBody(converter.parseAttributeName() + "Target"));
// addMethod(methods, method);
buildGetterMethod(methods, converter.parseAttributeName() + "Target", "org.hl7.fhir.dstu3.model.Resource", null, false, null);
}
for (HapiType type : types) {
if (type.getDatatype() == null && type.getGeneratedType() == null) {
System.out.println("Investigate : " + converter.getFullAttributePath());
//TODO Currently not handled: text, meta, references
continue;
}
if (type.isReference()) {
handleReferenceTypes(converter, type, methods);
} else if (!type.isResource() && type.getGeneratedType() != null) {
handleExtendedDatatypes(converter, type, methods);
} else if (type.isBackboneElement()) {
handleDatatypeMethods(converter, type, methods);
} else if (type.isEnumerationType()) {
handleEnumTypeMethods(converter, type, methods);
buildGetterMethod(methods, converter.parseAttributeName(), "org.hl7.fhir.dstu3.model.Type", null, false, null);
// method = constructSetMethodSignature(converter.parseAttributeName(), "org.hl7.fhir.dstu3.model.Type", getParentType());
// method.setBody(getTemplate().getAdapterSetMethodDelegationBody(converter.parseAttributeName()));
// method.addImport("org.hl7.fhir.dstu3.model.Type");
// addMethod(methods, method);
buildSetterMethod(methods, converter.parseAttributeName(), "org.hl7.fhir.dstu3.model.Type", getParentType());
}
if(converter.isReferenceMultiType() && !converter.isMultipleCardinality() && !converter.isMultiType()) {
// Method method = Method.constructNoArgMethod(Method.buildGetterName(converter.parseAttributeName()), "org.hl7.fhir.dstu3.model.Reference");
// method.setBody(getTemplate().getAdapterGetMethodDelegationWithTryCatchBody(converter.parseAttributeName()));
// addMethod(methods, method);
buildGetterMethod(methods, converter.parseAttributeName(), "org.hl7.fhir.dstu3.model.Reference", null, false, null);
// method = Method.constructNoArgMethod(Method.buildGetterName(converter.parseAttributeName() + "Target"), "org.hl7.fhir.dstu3.model.Resource");
// method.setBody(getTemplate().getAdapterGetMethodDelegationWithTryCatchBody(converter.parseAttributeName() + "Target"));
// addMethod(methods, method);
buildGetterMethod(methods, converter.parseAttributeName() + "Target", "org.hl7.fhir.dstu3.model.Resource", null, false, null);
}
for (HapiType type : types) {
if (type.getDatatype() == null && type.getGeneratedType() == null) {
System.out.println("Investigate : " + converter.getFullAttributePath());
//TODO Currently not handled: text, meta, references
continue;
}
if (type.isReference()) {
handleReferenceTypes(converter, type, methods);
} else if (!type.isResource() && type.getGeneratedType() != null) {
handleExtendedDatatypes(converter, type, methods);
} else if (type.isBackboneElement()) {
handleDatatypeMethods(converter, type, methods);
} else if (type.isEnumerationType()) {
handleEnumTypeMethods(converter, type, methods);
} else {
FhirDatatypeEnum datatype = FhirDatatypeEnum.getEnumeratedDatatype(type.getFhirType());
if (datatype != null && datatype.isPrimitiveDatatype()) {
handlePrimitiveTypeMethods(converter, type, methods);
//TODO Create methods that return the equivalent java type
} else {
handleDatatypeMethods(converter, type, methods);
}
}
}