/*
* PatientView
*
* Copyright (c) Worth Solutions Limited 2004-2013
*
* This file is part of PatientView.
*
* PatientView is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3 of the License,
* or (at your option) any later version.
* PatientView is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License along with PatientView in a file
* titled COPYING. If not, see <http://www.gnu.org/licenses/>.
*
* @package PatientView
* @link http://www.patientview.org
* @author PatientView <info@patientview.org>
* @copyright Copyright (c) 2004-2013, Worth Solutions Limited
* @license http://www.gnu.org/licenses/gpl-3.0.html The GNU General Public License V3.0
*/
package org.patientview.radar.web.panels.firstvisit;
import org.apache.wicket.extensions.markup.html.form.DateTextField;
import org.apache.wicket.markup.html.form.TextField;
import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.PropertyModel;
import org.apache.wicket.spring.injection.annot.SpringBean;
import org.patientview.radar.service.DiagnosisManager;
import org.patientview.radar.service.PatientManager;
import org.patientview.radar.web.RadarApplication;
import org.patientview.radar.web.models.RadarModelFactory;
import org.patientview.radar.web.panels.FirstVisitPanel;
import org.patientview.radar.web.panels.subtabs.LaboratoryResultsPanel;
public class FirstVisitLaboratoryResultsPanel extends Panel {
@SpringBean
private DiagnosisManager diagnosisManager;
@SpringBean
private PatientManager patientManager;
public FirstVisitLaboratoryResultsPanel(String id, IModel<Long> radarNumberModel) {
super(id);
setOutputMarkupId(true);
setOutputMarkupPlaceholderTag(true);
// General details
TextField<Long> radarNumber = new TextField<Long>("radarNumber", radarNumberModel);
radarNumber.setEnabled(false);
add(radarNumber);
add(new TextField("hospitalNumber", RadarModelFactory.getHospitalNumberModel(radarNumberModel,
patientManager)));
add(new TextField("diagnosis", new PropertyModel(RadarModelFactory.getDiagnosisCodeModel(radarNumberModel,
diagnosisManager), "abbreviation")));
add(new TextField("firstName", RadarModelFactory.getFirstNameModel(radarNumberModel, patientManager)));
add(new TextField("surname", RadarModelFactory.getSurnameModel(radarNumberModel, patientManager)));
add(new DateTextField("dob", RadarModelFactory.getDobModel(radarNumberModel, patientManager),
RadarApplication.DATE_PATTERN));
add(new LaboratoryResultsPanel("formContainer", radarNumberModel, true, null, null));
}
@Override
public boolean isVisible() {
return ((FirstVisitPanel) getParent()).getCurrentTab().equals(FirstVisitPanel.CurrentTab.LABORATORY_RESULTS);
}
}