docs: private void addReferenceQuestions(QuestionnaireItemComponent group, ElementDefinition element, String path, List<CanonicalType> profileURL, List<QuestionnaireResponse.QuestionnaireResponseItemComponent> answerGroups) throws FHIRException {
        //  var
        //    rn : String;
        //    i : integer;
        //    q : TFhirQuestionnaireGroupQuestion;
        ToolingExtensions.addFhirType(group, "Reference");
  
        QuestionnaireItemComponent q = addQuestion(group, QuestionnaireItemType.REFERENCE, path, "value", group.getText(), answerGroups);
        group.setText(null);
        CommaSeparatedStringBuilder rn = new CommaSeparatedStringBuilder();
        for (UriType u : profileURL)
        if (u.getValue().startsWith("http://hl7.org/fhir/StructureDefinition/"))
          rn.append(u.getValue().substring(40));
        if (rn.length() == 0)
          ToolingExtensions.addReferenceFilter(q, "subject=$subj&patient=$subj&encounter=$encounter");
        else {
          ToolingExtensions.addAllowedResource(q, rn.toString());
          ToolingExtensions.addReferenceFilter(q, "subject=$subj&patient=$subj&encounter=$encounter");
        }
        for (QuestionnaireResponse.QuestionnaireResponseItemComponent ag : answerGroups)
          ag.setText(null);
      }