예제 #1
0
  @Override
  protected void createFieldGroups(
      AeInputFieldCreator creator, ExpeditedAdverseEventInputCommand command) {
    String baseProp = "responseDescription";

    InputField desc =
        createTextArea(
            baseProp + ".eventDescription",
            "Description & treatment of event(s)",
            new TextSizeValidator(4000));
    InputFieldAttributes.setColumns(desc, 70);
    InputFieldAttributes.setRows(desc, 8);

    Map<Object, Object> postEventStatusOpts = new LinkedHashMap<Object, Object>();
    postEventStatusOpts.put("", "Please select");
    postEventStatusOpts.putAll(
        WebUtils.collectOptions(
            Arrays.asList(PostAdverseEventStatus.values()), null, "displayName"));

    Map<Object, Object> eventStatusOpts = new LinkedHashMap<Object, Object>();
    eventStatusOpts.put("", "Please select");
    eventStatusOpts.putAll(
        WebUtils.collectOptions(Arrays.asList(EventStatus.values()), null, "displayName"));

    InputField removedDateField =
        createPastDateField(
            baseProp + ".dateRemovedFromProtocol", "Date removed from protocol", false);
    InputField treatmentTimeField =
        createTimeField(
            baseProp + ".primaryTreatmentApproximateTime", "Event treatment, approximate time");
    treatmentTimeField
        .getAttributes()
        .put(
            InputField.HELP,
            "ae.treatment.aeReport.treatmentInformation.primaryTreatmentApproximateTime");
    creator.createFieldGroup(
        "desc",
        desc,
        treatmentTimeField,
        createSelectField(
            baseProp + ".presentStatus", "Present status", false, postEventStatusOpts),
        createPastDateField(baseProp + ".recoveryDate", "Date of recovery or death", false),
        createBooleanSelectField(
            baseProp + ".retreated", "Has the participant been re-treated?", false),
        removedDateField);

    InputField reducedDose =
        InputFieldFactory.createTextField(
            baseProp + ".reducedDose", "If reduced, specify: New dose", false);

    creator.createFieldGroup(
        "DCP_INFO",
        createSelectField(
            baseProp + ".blindBroken",
            "Was blind broken due to event?",
            false,
            createBooleanOptions()),
        createSelectField(
            baseProp + ".studyDrugInterrupted",
            "Was study agent stopped/interrupted/reduced in response to event?",
            false,
            createBooleanOptions()),
        reducedDose,
        createPastDateField(baseProp + ".reducedDate", "Date dose reduced", false),
        InputFieldFactory.createTextField(
            baseProp + ".daysNotGiven",
            "If interrupted, specify total number of days not given",
            false),
        InputFieldFactory.createCheckboxField(baseProp + ".autopsyPerformed", "Autopsy performed?"),
        InputFieldFactory.createTextField(baseProp + ".causeOfDeath", "Cause of death"),
        createSelectField(
            baseProp + ".eventAbate",
            "Did event abate after study drug was stopped or dose reduced?",
            false,
            eventStatusOpts),
        createSelectField(
            baseProp + ".eventReappear",
            "Did event reappear after study drug was reintroduced?",
            false,
            eventStatusOpts));
  }
예제 #2
0
  @Override
  public Map<String, InputFieldGroup> createFieldGroups(final T command) {

    InputFieldGroup participantFieldGroup;
    Map<Object, Object> options = null;

    participantFieldGroup = new DefaultInputFieldGroup(PARTICIPANT_FIELD_GROUP);

    FieldValidator fv = FieldValidator.ALPHANUMERIC_VALIDATOR;
    if (!command.isUnidentifiedMode()) {
      participantFieldGroup
          .getFields()
          .add(
              InputFieldFactory.createTextField(
                  "participant.firstName", "First Name", FieldValidator.NOT_NULL_VALIDATOR, fv));
      participantFieldGroup
          .getFields()
          .add(
              InputFieldFactory.createTextField(
                  "participant.lastName", "Last Name", FieldValidator.NOT_NULL_VALIDATOR, fv));
      participantFieldGroup
          .getFields()
          .add(InputFieldFactory.createTextField("participant.maidenName", "Maiden Name", fv));
      participantFieldGroup
          .getFields()
          .add(InputFieldFactory.createTextField("participant.middleName", "Middle Name", fv));
    }

    InputField dobYear = InputFieldFactory.createTextField("yearString", "Year", true);
    InputFieldAttributes.setSize(dobYear, 4);
    InputField dobMonth = InputFieldFactory.createTextField("monthString", "Month", true);
    InputFieldAttributes.setSize(dobMonth, 2);
    InputField dobDay = InputFieldFactory.createTextField("dayString", "Day");
    InputFieldAttributes.setSize(dobDay, 2);

    CompositeField dobField;
    if (command.isUnidentifiedMode())
      dobField =
          new CompositeField(
              "participant.dateOfBirth",
              new DefaultInputFieldGroup(null, "Date of birth")
                  .addField(dobYear)
                  .addField(dobMonth));
    else
      dobField =
          new CompositeField(
              "participant.dateOfBirth",
              new DefaultInputFieldGroup(null, "Date of birth")
                  .addField(dobYear)
                  .addField(dobMonth)
                  .addField(dobDay));

    dobField.setRequired(true);
    dobField
        .getAttributes()
        .put(InputField.HELP, "par.par_create_participant.participant.dateOfBirth");

    participantFieldGroup.getFields().add(dobField);
    participantFieldGroup
        .getFields()
        .add(
            InputFieldFactory.createSelectField(
                "participant.gender",
                "Gender",
                true,
                collectOptions(listValues.getParticipantGender())));
    participantFieldGroup
        .getFields()
        .add(
            InputFieldFactory.createSelectField(
                "participant.ethnicity",
                "Ethnicity",
                true,
                collectOptions(listValues.getParticipantEthnicity())));

    participantFieldGroup
        .getFields()
        .add(
            InputFieldFactory.createSelectField(
                "participant.race", "Race", true, collectOptions(listValues.getParticipantRace())));
    /*
            repeatingFieldGroupFactory = new RepeatingFieldGroupFactory("main", "participant.identifiers");
            repeatingFieldGroupFactory.addField(InputFieldFactory.createTextField("value", "Identifier", true));
    */

    options = new LinkedHashMap<Object, Object>();
    List<Lov> list = configurationProperty.getMap().get("participantIdentifiersType");
    options.put("", "Please select");
    options.putAll(WebUtils.collectOptions(list, "code", "desc"));

    InputFieldGroupMap map = new InputFieldGroupMap();

    if (!command.isUnidentifiedMode()) {
      byte i = 0;
      byte j = 0;

      InputFieldGroup idtFieldGroupOrg;
      InputFieldGroup idtFieldGroupSys;

      for (Identifier idt : command.participant.getIdentifiers()) {

        if (idt instanceof SystemAssignedIdentifier) {
          String s = "participant.systemAssignedIdentifiers[" + i + "].";
          idtFieldGroupSys = new DefaultInputFieldGroup("mainSys" + i);

          idtFieldGroupSys
              .getFields()
              .add(
                  InputFieldFactory.createTextField(
                      s + "value",
                      "Identifier",
                      FieldValidator.NOT_NULL_VALIDATOR,
                      FieldValidator.IDENTIFIER_VALIDATOR));
          idtFieldGroupSys
              .getFields()
              .add(
                  InputFieldFactory.createSelectField(
                      s + "type", "Identifier Type", true, options));
          idtFieldGroupSys
              .getFields()
              .add(InputFieldFactory.createTextField(s + "systemName", "System Name", true));
          map.addInputFieldGroup(idtFieldGroupSys);

          i++;

        } else {
          String s = "participant.organizationIdentifiers[" + j + "].";
          idtFieldGroupOrg = new DefaultInputFieldGroup("mainOrg" + j);

          idtFieldGroupOrg
              .getFields()
              .add(
                  InputFieldFactory.createTextField(
                      s + "value",
                      "Identifier",
                      FieldValidator.NOT_NULL_VALIDATOR,
                      FieldValidator.IDENTIFIER_VALIDATOR));
          idtFieldGroupOrg
              .getFields()
              .add(
                  InputFieldFactory.createSelectField(
                      s + "type", "Identifier Type", true, options));
          idtFieldGroupOrg
              .getFields()
              .add(
                  InputFieldFactory.createAutocompleterField(
                      s + "organization", "Organization", true));
          map.addInputFieldGroup(idtFieldGroupOrg);

          j++;
        }
      }
    }

    map.addInputFieldGroup(participantFieldGroup);

    return map;
  }