<commit_before><%@ page import="com.cabolabs.ehrserver.query.EhrQuery" %>

<div class="form-group ${hasErrors(bean: ehrQueryInstance, field: 'name', 'error')} required">
  <label for="name" class="control-label">
    <g:message code="ehrquery.attr.name" default="Name" />
    <span class="required-indicator">*</span>
  </label>
  <g:textField name="name" required="" value="${ehrQueryInstance?.name}" class="form-control"/>
</div>

<div class="form-group ${hasErrors(bean: ehrQueryInstance, field: 'description', 'error')} ">
  <label for="description" class="control-label">
    <g:message code="ehrquery.attr.description" default="Description" />
  </label>
  <g:textArea name="description" rows="3" value="${ehrQueryInstance?.description}" class="form-control"/>
</div>

<div class="form-group ${hasErrors(bean: ehrQueryInstance, field: 'queries', 'error')} ">
  <label for="queries" class="control-label">
    <g:message code="ehrquery.attr.queries" default="Queries" />
  </label>
  <g:set var="queries" value="${com.cabolabs.ehrserver.query.Query.findAllByType('composition')}" />
  <g:select name="queries"
            from="${queries}"
            multiple="multiple"
            optionKey="id" size="5"
            value="${ehrQueryInstance?.queries*.id}"
            optionValue="${{it.name +' ('+ it.uid +')'}}"
            class="form-control"/>
  <g:if test="${queries.size() == 0}">
    <span class="help-block"><g:message code="ehrquery.create.noCompoQueries" /></span>
  </g:if>
</div>


<commit_msg>closes #1024<commit_after><%@ page import="com.cabolabs.ehrserver.query.EhrQuery" %>

<div class="form-group ${hasErrors(bean: ehrQueryInstance, field: 'name', 'error')} required">
  <label for="name" class="control-label">
    <g:message code="ehrquery.attr.name" default="Name" />
    <span class="required-indicator">*</span>
  </label>
  <g:textField name="name" required="" value="${ehrQueryInstance?.name}" class="form-control"/>
</div>

<div class="form-group ${hasErrors(bean: ehrQueryInstance, field: 'description', 'error')} ">
  <label for="description" class="control-label">
    <g:message code="ehrquery.attr.description" default="Description" />
  </label>
  <g:textArea name="description" rows="3" value="${ehrQueryInstance?.description}" class="form-control"/>
</div>

<div class="form-group ${hasErrors(bean: ehrQueryInstance, field: 'queries', 'error')} ">
  <label for="queries" class="control-label">
    <g:message code="ehrquery.attr.queries" default="Queries" />
  </label>
  <g:set var="queries" value="${com.cabolabs.ehrserver.query.Query.findAllByTypeAndOrganizationUid('composition', session.organization.uid)}" />
  <g:select name="queries"
            from="${queries}"
            multiple="multiple"
            optionKey="id" size="5"
            value="${ehrQueryInstance?.queries*.id}"
            optionValue="${{it.name +' ('+ it.uid +')'}}"
            class="form-control"/>
  <g:if test="${queries.size() == 0}">
    <span class="help-block"><g:message code="ehrquery.create.noCompoQueries" /></span>
  </g:if>
</div>
{'fraction_non_alphanumeric': 0.20949902407286922, 'fraction_numerical': 0.0032530904359141183, 'mean_word_length': 4.758426966292135, 'pattern_counts': {'":': 0, '<': 57, '<?xml version=': 0, '>': 57, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6594837', 'n_tokens_mistral': 1030, 'n_tokens_neox': 1013, 'n_words': 166}