Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
ONYX-1753 Display repeated measures grouped by occurrence (instead of…
Browse files Browse the repository at this point in the history
… parameter code)
  • Loading branch information
ymarcon committed Feb 1, 2018
1 parent d1b8be2 commit b01064b
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,13 @@
package org.obiba.onyx.jade.core.wicket.run;

import java.text.DateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;

import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import org.apache.wicket.Component;
import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
import org.apache.wicket.markup.html.basic.Label;
Expand Down Expand Up @@ -197,6 +201,7 @@ private Component getKeyValueDataPanel(String id, IModel titleModel, List parame
add(kvPanel);

InstrumentRun run = (InstrumentRun) getDefaultModelObject();
Map<Integer, List<RepeatableParameterValue>> repeatableParameterMap = Maps.newHashMap();
for(Object parameter : parameters) {
InstrumentParameter param = (InstrumentParameter) parameter;

Expand All @@ -213,17 +218,39 @@ private Component getKeyValueDataPanel(String id, IModel titleModel, List parame
if(getMeasure() != null && !getMeasure().getId().equals(measure.getId())) continue;
for(InstrumentRunValue runValue : measure.getInstrumentRunValues()) {
if(runValue.getInstrumentParameter().equals(param.getCode())) {
addRow(kvPanel, param, runValue, pos);
// group params by position (measure occurrence)
if (!repeatableParameterMap.containsKey(pos)) {
repeatableParameterMap.put(pos, Lists.newArrayList());
}
repeatableParameterMap.get(pos).add(new RepeatableParameterValue(param, runValue));
}
}
if(pos != null) pos++;
}
}
}

if (!repeatableParameterMap.isEmpty()) {
repeatableParameterMap.keySet().stream().sorted().forEach(pos ->
repeatableParameterMap.get(pos).forEach(paramValue -> {
addRow(kvPanel, paramValue.param, paramValue.runValue, pos);
})
);
}

return kvPanel;
}

private class RepeatableParameterValue {
private final InstrumentParameter param;
private final InstrumentRunValue runValue;

private RepeatableParameterValue(InstrumentParameter param, InstrumentRunValue runValue) {
this.param = param;
this.runValue = runValue;
}
}

@SuppressWarnings("serial")
private void addRow(KeyValueDataPanel kvPanel, InstrumentParameter param, InstrumentRunValue runValue, final Integer measurePosition) {
Label label = new Label(KeyValueDataPanel.getRowKeyId(), new MessageSourceResolvableStringModel(param.getLabel()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ Administration=Administration
Help=Aide

Language=Langue
StageList=Liste des étapes
StageList=Liste des \u00E9tapes
Name=Nom
Description=Description
DependsOn=Dépend de
Completed=Complétée
StartEndTime=Début-Fin
Start=Début
DependsOn=D\u00E9pend de
Completed=Compl\u00E8t\u00E9e
StartEndTime=D\u00E9but-Fin
Start=D\u00E9but
End=Fin
Comments=Commentaires
Comment=Commentaire
Expand All @@ -27,24 +27,24 @@ Participant=Participant
ParticipantCode=ID Participant
AppointmentCode=ID Recrutement
Interview=Entrevue
Stages=Étapes
Stage=Étape
Stages=\u00C9tapes
Stage=\u00C9tape

FirstName=Prénom
FirstName=Pr\u00E9nom
LastName=Nom
Gender=Sexe
Gender.Null=
Gender.MALE=M
Gender.FEMALE=F
BirthDate=Date de naissance
EnrollmentId=ID d'enrôlement
EnrollmentId=ID d'enr\u00F4lement
Appointment=Rendez-vous
SiteNo=Assessment Center Id

##
## mandatory labels
##
FirstName*=Prénom *
FirstName*=Pr\u00E9nom *
LastName*=Nom *
Gender*=Sexe *
BirthDate*=Date de naissance ({0})*
Expand All @@ -55,49 +55,49 @@ City=Ville
Province=Province
Country=Pays
PostalCode=Code Postal
Phone=Téléphone
Phone=T\u00E9l\u00E9phone

StartDate=Date de début
StartDate=Date de d\u00E9but
EndDate=Date de fin
Status=État
Status=\u00C9tat
CancelInterview=Annuler entretien
ExplainCancelInterview=Expliquez s'il vous plaît pourquoi vous annulez cet entretien
ExplainCancelInterview=Expliquez s'il vous pla\u00EEt pourquoi vous annulez cet entretien

Cancel=Annuler
Start=Démarrer
Start=D\u00E9marrer
Skip=Passer
Comment=Commenter
Interrupt=Interrompre
Resume=Retourner
Stage.Completed=Complétée
Stage.Waiting=Pas prête
Stage.Ready=Prête
Stage.Completed=Compl\u00E8t\u00E9e
Stage.Waiting=Pas pr\u00EAte
Stage.Ready=Pr\u00EAte
Stage.InProgress=En cours
Stage.Skipped=Passée
Stage.Skipped=Pass\u00E9e

ExplainCancelInterview=Veuillez expliquer pourquoi vous annulez cet entrevue.

InterviewStatus.NOT_STARTED=Non commencée
InterviewStatus.NOT_STARTED=Non commenc\u00E9e
InterviewStatus.IN_PROGRESS=En cours
InterviewStatus.COMPLETED=Complétée
InterviewStatus.COMPLETED=Compl\u00E8t\u00E9e
InterviewStatus.INTERRUPTED=Interrompue
InterviewStatus.CANCELLED=Annulée
InterviewStatus.CLOSED=Fermée
InterviewStatus.CANCELLED=Annul\u00E9e
InterviewStatus.CLOSED=Ferm\u00E9e

Delete=Supprimer
Edit=Modifier
Email=Courriel
firstName=Prénom
firstName=Pr\u00E9nom
lastName=Nom
roles=Role(s)
Role(s)=Role(s)
Status.ACTIVE=Actif
Status.INACTIVE=Inactif
Role.SYSTEM_ADMINISTRATOR=Administrateur système
Role.SYSTEM_ADMINISTRATOR=Administrateur syst\u00E8me
Role.QUESTIONNAIRE_EDITOR=Editeur de questionnaire
Role.PARTICIPANT_MANAGER=Gestionnaire de participants
Role.PARTICIPANT_RECEPTIONIST=Réceptionniste de participants
Role.DATA_COLLECTION_OPERATOR=Opérateur de collecte de données
Role.PARTICIPANT_RECEPTIONIST=R\u00E9ceptionniste de participants
Role.DATA_COLLECTION_OPERATOR=Op\u00E9rateur de collecte de donn\u00E9es

ConfirmDeleteUser=Voulez-vous supprimer l\\''utilisateur {0} ?

Expand All @@ -112,7 +112,7 @@ Save=Sauvegarder
reset=Effacer
cancel=Annuler
Refresh=Rafraichir
EqualPasswordInputValidator=Mots de passe différents. Veuiller rentrer le même mot de passe pour les champs "${label0}" et "${label1}".
EqualPasswordInputValidator=Mots de passe diff\u00E9rents. Veuiller rentrer le m\u00EAme mot de passe pour les champs "${label0}" et "${label1}".
EmailAddressValidator=L'adresse de courriel "${input}" n'est pas valide.

profile=Profil
Expand All @@ -130,7 +130,7 @@ NA=ND
Edit=Modifier
Exit=Quitter

IConverter=La valeur spécifiée pour le champ '${label}' est invalide.
IConverter=La valeur sp\u00E9cifi\u00E9e pour le champ '${label}' est invalide.

PrintConsentForm=Imprimer consentement
PrintReport=Imprimer rapport
Expand All @@ -140,27 +140,27 @@ DestinationCertificate=Certificat de la destination
ExportDestinationCertificates=Certificat des destinations d''exportation
InvalidCertificate=Certificat invalide.

datatable.no-records-found=Aucun résultat trouvé
datatable.no-records-found=Aucun r\u00E9sultat trouv\u00E9

UnlockInterview=Entrevue verrouillée
UnlockInterview=Entrevue verrouill\u00E9e
ConfirmExport=Confirmer l'export

AnonymousComments=Afin de conserver l'anonymat du participant, veuillez vérifier que vos commentaires ne contiennent aucune référence identifiable.
AnonymousComments=Afin de conserver l'anonymat du participant, veuillez v\u00E9rifier que vos commentaires ne contiennent aucune r\u00E9f\u00E9rence identifiable.

# Error Messages
FileWrongType=Le fichier soumis n'est pas du bon type

RangeValidator=La valeur entrée pour le champ '${label}' doit se situer entre ${minimum} et ${maximum}.
MinimumValidator=La valeur minimale acceptée pour le champ '${label}' est ${minimum}.
MaximumValidator=La valeur maximale acceptée pour le champ '${label}' est ${maximum}.
RangeValidator=La valeur entr\u00E9e pour le champ '${label}' doit se situer entre ${minimum} et ${maximum}.
MinimumValidator=La valeur minimale accept\u00E9e pour le champ '${label}' est ${minimum}.
MaximumValidator=La valeur maximale accept\u00E9e pour le champ '${label}' est ${maximum}.

StringValidator.range=La longueur du texte entré pour le champ '${label}' doit se situer entre ${minimum} et ${maximum} caract\u00e8res.
StringValidator.minimum=La longueur minimale du texte accepté pour le champ '${label}' est de ${minimum} caract\u00e8res.
StringValidator.maximum=La longueur maximale du texte accepté pour le champ '${label}' est de ${maximum} caract\u00e8res.
StringValidator.range=La longueur du texte entr\u00E9 pour le champ '${label}' doit se situer entre ${minimum} et ${maximum} caract\u00e8res.
StringValidator.minimum=La longueur minimale du texte accept\u00E9 pour le champ '${label}' est de ${minimum} caract\u00e8res.
StringValidator.maximum=La longueur maximale du texte accept\u00E9 pour le champ '${label}' est de ${maximum} caract\u00e8res.

DateValidator.range=La date entrée pour le champ '${label}' doit se situer entre ${minimum} et ${maximum}.
DateValidator.minimum=La date minimale accepté pour le champ '${label}' est ${minimum}.
DateValidator.maximum=La date maximale accepté pour le champ '${label}' est ${maximum}.
DateValidator.range=La date entr\u00E9e pour le champ '${label}' doit se situer entre ${minimum} et ${maximum}.
DateValidator.minimum=La date minimale accept\u00E9 pour le champ '${label}' est ${minimum}.
DateValidator.maximum=La date maximale accept\u00E9 pour le champ '${label}' est ${maximum}.

PatternValidator='${input}' n'est pas une valeur valide pour le champ '${label}'.
PrintReport=Impression de Rapports

0 comments on commit b01064b

Please sign in to comment.