use of de.symeda.sormas.app.backend.hospitalization.Hospitalization in project SORMAS-Project by hzi-braunschweig.
the class CaseDtoHelper method fillInnerFromAdo.
@Override
public void fillInnerFromAdo(CaseDataDto target, Case source) {
target.setClinicalConfirmation(source.getClinicalConfirmation());
target.setEpidemiologicalConfirmation(source.getEpidemiologicalConfirmation());
target.setLaboratoryDiagnosticConfirmation(source.getLaboratoryDiagnosticConfirmation());
target.setCaseClassification(source.getCaseClassification());
target.setCaseIdentificationSource(source.getCaseIdentificationSource());
target.setScreeningType(source.getScreeningType());
if (source.getClassificationUser() != null) {
User user = DatabaseHelper.getUserDao().queryForId(source.getClassificationUser().getId());
target.setClassificationUser(UserDtoHelper.toReferenceDto(user));
} else {
target.setClassificationUser(null);
}
target.setClassificationDate(source.getClassificationDate());
target.setClassificationComment(source.getClassificationComment());
target.setInvestigationStatus(source.getInvestigationStatus());
target.setDisease(source.getDisease());
target.setDiseaseVariant(source.getDiseaseVariant());
target.setDiseaseDetails(source.getDiseaseDetails());
target.setDiseaseVariantDetails(source.getDiseaseVariantDetails());
target.setPlagueType(source.getPlagueType());
target.setDengueFeverType(source.getDengueFeverType());
if (source.getHealthFacility() != null) {
Facility facility = DatabaseHelper.getFacilityDao().queryForId(source.getHealthFacility().getId());
target.setHealthFacility(FacilityDtoHelper.toReferenceDto(facility));
} else {
target.setHealthFacility(null);
}
target.setHealthFacilityDetails(source.getHealthFacilityDetails());
if (source.getPerson() != null) {
Person person = DatabaseHelper.getPersonDao().queryForId(source.getPerson().getId());
target.setPerson(PersonDtoHelper.toReferenceDto(person));
}
target.setInvestigatedDate(source.getInvestigatedDate());
target.setReportDate(source.getReportDate());
target.setDistrictLevelDate(source.getDistrictLevelDate());
if (source.getReportingUser() != null) {
User user = DatabaseHelper.getUserDao().queryForId(source.getReportingUser().getId());
target.setReportingUser(UserDtoHelper.toReferenceDto(user));
} else {
target.setReportingUser(null);
}
if (source.getSymptoms() != null) {
Symptoms symptoms = DatabaseHelper.getSymptomsDao().queryForId(source.getSymptoms().getId());
SymptomsDto symptomsDto = symptomsDtoHelper.adoToDto(symptoms);
target.setSymptoms(symptomsDto);
} else {
target.setSymptoms(null);
}
if (source.getResponsibleRegion() != null) {
Region region = DatabaseHelper.getRegionDao().queryForId(source.getResponsibleRegion().getId());
target.setResponsibleRegion(RegionDtoHelper.toReferenceDto(region));
} else {
target.setResponsibleRegion(null);
}
if (source.getResponsibleDistrict() != null) {
District district = DatabaseHelper.getDistrictDao().queryForId(source.getResponsibleDistrict().getId());
target.setResponsibleDistrict(DistrictDtoHelper.toReferenceDto(district));
} else {
target.setResponsibleDistrict(null);
}
if (source.getResponsibleCommunity() != null) {
Community community = DatabaseHelper.getCommunityDao().queryForId(source.getResponsibleCommunity().getId());
target.setResponsibleCommunity(CommunityDtoHelper.toReferenceDto(community));
} else {
target.setResponsibleCommunity(null);
}
if (source.getRegion() != null) {
Region region = DatabaseHelper.getRegionDao().queryForId(source.getRegion().getId());
target.setRegion(RegionDtoHelper.toReferenceDto(region));
} else {
target.setRegion(null);
}
if (source.getDistrict() != null) {
District district = DatabaseHelper.getDistrictDao().queryForId(source.getDistrict().getId());
target.setDistrict(DistrictDtoHelper.toReferenceDto(district));
} else {
target.setDistrict(null);
}
if (source.getCommunity() != null) {
Community community = DatabaseHelper.getCommunityDao().queryForId(source.getCommunity().getId());
target.setCommunity(CommunityDtoHelper.toReferenceDto(community));
} else {
target.setCommunity(null);
}
if (source.getPointOfEntry() != null) {
PointOfEntry pointOfEntry = DatabaseHelper.getPointOfEntryDao().queryForId(source.getPointOfEntry().getId());
target.setPointOfEntry(PointOfEntryDtoHelper.toReferenceDto(pointOfEntry));
} else {
target.setPointOfEntry(null);
}
target.setPointOfEntryDetails(source.getPointOfEntryDetails());
if (source.getSurveillanceOfficer() != null) {
User user = DatabaseHelper.getUserDao().queryForId(source.getSurveillanceOfficer().getId());
target.setSurveillanceOfficer(UserDtoHelper.toReferenceDto(user));
} else {
target.setSurveillanceOfficer(null);
}
if (source.getHospitalization() != null) {
Hospitalization hospitalization = DatabaseHelper.getHospitalizationDao().queryForId(source.getHospitalization().getId());
target.setHospitalization(hospitalizationDtoHelper.adoToDto(hospitalization));
} else {
target.setHospitalization(null);
}
if (source.getEpiData() != null) {
EpiData epiData = DatabaseHelper.getEpiDataDao().queryForId(source.getEpiData().getId());
target.setEpiData(epiDataDtoHelper.adoToDto(epiData));
} else {
target.setEpiData(null);
}
if (source.getTherapy() != null) {
Therapy therapy = DatabaseHelper.getTherapyDao().queryForId(source.getTherapy().getId());
target.setTherapy(therapyDtoHelper.adoToDto(therapy));
} else {
target.setTherapy(null);
}
if (source.getClinicalCourse() != null) {
ClinicalCourse clinicalCourse = DatabaseHelper.getClinicalCourseDao().queryForId(source.getClinicalCourse().getId());
target.setClinicalCourse(clinicalCourseDtoHelper.adoToDto(clinicalCourse));
} else {
target.setClinicalCourse(null);
}
if (source.getMaternalHistory() != null) {
target.setMaternalHistory(maternalHistoryDtoHelper.adoToDto(DatabaseHelper.getMaternalHistoryDao().queryForId(source.getMaternalHistory().getId())));
} else {
target.setMaternalHistory(null);
}
if (source.getPortHealthInfo() != null) {
target.setPortHealthInfo(portHealthInfoDtoHelper.adoToDto(DatabaseHelper.getPortHealthInfoDao().queryForId(source.getPortHealthInfo().getId())));
} else {
target.setPortHealthInfo(null);
}
target.setClinicianName(source.getClinicianName());
target.setClinicianPhone(source.getClinicianPhone());
target.setClinicianEmail(source.getClinicianEmail());
target.setPregnant(source.getPregnant());
target.setVaccinationStatus(source.getVaccinationStatus());
target.setSmallpoxVaccinationScar(source.getSmallpoxVaccinationScar());
target.setSmallpoxVaccinationReceived(source.getSmallpoxVaccinationReceived());
target.setSmallpoxLastVaccinationDate(source.getSmallpoxLastVaccinationDate());
target.setEpidNumber(source.getEpidNumber());
target.setCaseOrigin(source.getCaseOrigin());
target.setReportLat(source.getReportLat());
target.setReportLon(source.getReportLon());
target.setReportLatLonAccuracy(source.getReportLatLonAccuracy());
target.setOutcome(source.getOutcome());
target.setOutcomeDate(source.getOutcomeDate());
target.setSequelae(source.getSequelae());
target.setSequelaeDetails(source.getSequelaeDetails());
target.setNotifyingClinic(source.getNotifyingClinic());
target.setNotifyingClinicDetails(source.getNotifyingClinicDetails());
target.setRabiesType(source.getRabiesType());
target.setCreationVersion(source.getCreationVersion());
target.setAdditionalDetails(source.getAdditionalDetails());
target.setExternalID(source.getExternalID());
target.setExternalToken(source.getExternalToken());
target.setInternalToken(source.getInternalToken());
target.setQuarantine(source.getQuarantine());
target.setQuarantineTypeDetails(source.getQuarantineTypeDetails());
target.setQuarantineFrom(source.getQuarantineFrom());
target.setQuarantineTo(source.getQuarantineTo());
target.setQuarantineHelpNeeded(source.getQuarantineHelpNeeded());
target.setQuarantineOrderedVerbally(source.isQuarantineOrderedVerbally());
target.setQuarantineOrderedOfficialDocument(source.isQuarantineOrderedOfficialDocument());
target.setQuarantineOrderedVerballyDate(source.getQuarantineOrderedVerballyDate());
target.setQuarantineOrderedOfficialDocumentDate(source.getQuarantineOrderedOfficialDocumentDate());
target.setQuarantineExtended(source.isQuarantineExtended());
target.setQuarantineReduced(source.isQuarantineReduced());
target.setQuarantineHomePossible(source.getQuarantineHomePossible());
target.setQuarantineHomePossibleComment(source.getQuarantineHomePossibleComment());
target.setQuarantineHomeSupplyEnsured(source.getQuarantineHomeSupplyEnsured());
target.setQuarantineHomeSupplyEnsuredComment(source.getQuarantineHomeSupplyEnsuredComment());
target.setQuarantineOfficialOrderSent(source.isQuarantineOfficialOrderSent());
target.setQuarantineOfficialOrderSentDate(source.getQuarantineOfficialOrderSentDate());
target.setPostpartum(source.getPostpartum());
target.setTrimester(source.getTrimester());
target.setPseudonymized(source.isPseudonymized());
target.setFacilityType(source.getFacilityType());
target.setCaseIdIsm(source.getCaseIdIsm());
target.setContactTracingFirstContactType(source.getContactTracingFirstContactType());
target.setContactTracingFirstContactDate(source.getContactTracingFirstContactDate());
target.setWasInQuarantineBeforeIsolation(source.getWasInQuarantineBeforeIsolation());
target.setQuarantineReasonBeforeIsolation(source.getQuarantineReasonBeforeIsolation());
target.setQuarantineReasonBeforeIsolationDetails(source.getQuarantineReasonBeforeIsolationDetails());
target.setEndOfIsolationReason(source.getEndOfIsolationReason());
target.setEndOfIsolationReasonDetails(source.getEndOfIsolationReasonDetails());
target.setNosocomialOutbreak(source.isNosocomialOutbreak());
target.setInfectionSetting(source.getInfectionSetting());
target.setProhibitionToWork(source.getProhibitionToWork());
target.setProhibitionToWorkFrom(source.getProhibitionToWorkFrom());
target.setProhibitionToWorkUntil(source.getProhibitionToWorkUntil());
target.setReInfection(source.getReInfection());
target.setPreviousInfectionDate(source.getPreviousInfectionDate());
target.setBloodOrganOrTissueDonated(source.getBloodOrganOrTissueDonated());
if (source.getSormasToSormasOriginInfo() != null) {
target.setSormasToSormasOriginInfo(sormasToSormasOriginInfoDtoHelper.adoToDto(source.getSormasToSormasOriginInfo()));
}
target.setOwnershipHandedOver(source.isOwnershipHandedOver());
target.setNotACaseReasonNegativeTest(source.isNotACaseReasonNegativeTest());
target.setNotACaseReasonPhysicianInformation(source.isNotACaseReasonPhysicianInformation());
target.setNotACaseReasonDifferentPathogen(source.isNotACaseReasonDifferentPathogen());
target.setNotACaseReasonOther(source.isNotACaseReasonOther());
target.setNotACaseReasonDetails(source.getNotACaseReasonDetails());
target.setFollowUpStatusChangeDate(source.getFollowUpStatusChangeDate());
target.setFollowUpStatusChangeUser(UserDtoHelper.toReferenceDto(source.getFollowUpStatusChangeUser()));
if (source.getHealthConditions() != null) {
HealthConditions healthConditions = DatabaseHelper.getHealthConditionsDao().queryForId(source.getHealthConditions().getId());
target.setHealthConditions(healthConditionsDtoHelper.adoToDto(healthConditions));
} else {
target.setHealthConditions(null);
}
}
use of de.symeda.sormas.app.backend.hospitalization.Hospitalization in project SORMAS-Project by hzi-braunschweig.
the class DatabaseHelper method getAdoDaoInner.
public <ADO extends AbstractDomainObject> AbstractAdoDao<ADO> getAdoDaoInner(Class<ADO> type) {
if (!adoDaos.containsKey(type)) {
// build dao
AbstractAdoDao<ADO> dao;
Dao<ADO, Long> innerDao;
try {
innerDao = super.getDao(type);
if (type.equals(Case.class)) {
dao = (AbstractAdoDao<ADO>) new CaseDao((Dao<Case, Long>) innerDao);
} else if (type.equals(Immunization.class)) {
dao = (AbstractAdoDao<ADO>) new ImmunizationDao((Dao<Immunization, Long>) innerDao);
} else if (type.equals(Vaccination.class)) {
dao = (AbstractAdoDao<ADO>) new VaccinationDao((Dao<Vaccination, Long>) innerDao);
} else if (type.equals(Therapy.class)) {
dao = (AbstractAdoDao<ADO>) new TherapyDao((Dao<Therapy, Long>) innerDao);
} else if (type.equals(Prescription.class)) {
dao = (AbstractAdoDao<ADO>) new PrescriptionDao((Dao<Prescription, Long>) innerDao);
} else if (type.equals(Treatment.class)) {
dao = (AbstractAdoDao<ADO>) new TreatmentDao((Dao<Treatment, Long>) innerDao);
} else if (type.equals(Person.class)) {
dao = (AbstractAdoDao<ADO>) new PersonDao((Dao<Person, Long>) innerDao);
} else if (type.equals(PersonContactDetail.class)) {
dao = (AbstractAdoDao<ADO>) new PersonContactDetailDao((Dao<PersonContactDetail, Long>) innerDao);
} else if (type.equals(Location.class)) {
dao = (AbstractAdoDao<ADO>) new LocationDao((Dao<Location, Long>) innerDao);
} else if (type.equals(PointOfEntry.class)) {
dao = (AbstractAdoDao<ADO>) new PointOfEntryDao((Dao<PointOfEntry, Long>) innerDao);
} else if (type.equals(Facility.class)) {
dao = (AbstractAdoDao<ADO>) new FacilityDao((Dao<Facility, Long>) innerDao);
} else if (type.equals(Continent.class)) {
dao = (AbstractAdoDao<ADO>) new ContinentDao((Dao<Continent, Long>) innerDao);
} else if (type.equals(Subcontinent.class)) {
dao = (AbstractAdoDao<ADO>) new SubcontinentDao((Dao<Subcontinent, Long>) innerDao);
} else if (type.equals(Country.class)) {
dao = (AbstractAdoDao<ADO>) new CountryDao((Dao<Country, Long>) innerDao);
} else if (type.equals(Area.class)) {
dao = (AbstractAdoDao<ADO>) new AreaDao((Dao<Area, Long>) innerDao);
} else if (type.equals(Region.class)) {
dao = (AbstractAdoDao<ADO>) new RegionDao((Dao<Region, Long>) innerDao);
} else if (type.equals(District.class)) {
dao = (AbstractAdoDao<ADO>) new DistrictDao((Dao<District, Long>) innerDao);
} else if (type.equals(Community.class)) {
dao = (AbstractAdoDao<ADO>) new CommunityDao((Dao<Community, Long>) innerDao);
} else if (type.equals(User.class)) {
dao = (AbstractAdoDao<ADO>) new UserDao((Dao<User, Long>) innerDao);
} else if (type.equals(UserRoleConfig.class)) {
dao = (AbstractAdoDao<ADO>) new UserRoleConfigDao((Dao<UserRoleConfig, Long>) innerDao);
} else if (type.equals(DiseaseConfiguration.class)) {
dao = (AbstractAdoDao<ADO>) new DiseaseConfigurationDao((Dao<DiseaseConfiguration, Long>) innerDao);
} else if (type.equals(CustomizableEnumValue.class)) {
dao = (AbstractAdoDao<ADO>) new CustomizableEnumValueDao((Dao<CustomizableEnumValue, Long>) innerDao);
} else if (type.equals(FeatureConfiguration.class)) {
dao = (AbstractAdoDao<ADO>) new FeatureConfigurationDao((Dao<FeatureConfiguration, Long>) innerDao);
} else if (type.equals(Symptoms.class)) {
dao = (AbstractAdoDao<ADO>) new SymptomsDao((Dao<Symptoms, Long>) innerDao);
} else if (type.equals(HealthConditions.class)) {
dao = (AbstractAdoDao<ADO>) new HealthConditionsDao((Dao<HealthConditions, Long>) innerDao);
} else if (type.equals(ClinicalCourse.class)) {
dao = (AbstractAdoDao<ADO>) new ClinicalCourseDao((Dao<ClinicalCourse, Long>) innerDao);
} else if (type.equals(ClinicalVisit.class)) {
dao = (AbstractAdoDao<ADO>) new ClinicalVisitDao((Dao<ClinicalVisit, Long>) innerDao);
} else if (type.equals(MaternalHistory.class)) {
dao = (AbstractAdoDao<ADO>) new MaternalHistoryDao((Dao<MaternalHistory, Long>) innerDao);
} else if (type.equals(PortHealthInfo.class)) {
dao = (AbstractAdoDao<ADO>) new PortHealthInfoDao((Dao<PortHealthInfo, Long>) innerDao);
} else if (type.equals(Task.class)) {
dao = (AbstractAdoDao<ADO>) new TaskDao((Dao<Task, Long>) innerDao);
} else if (type.equals(Contact.class)) {
dao = (AbstractAdoDao<ADO>) new ContactDao((Dao<Contact, Long>) innerDao);
} else if (type.equals(Visit.class)) {
dao = (AbstractAdoDao<ADO>) new VisitDao((Dao<Visit, Long>) innerDao);
} else if (type.equals(Event.class)) {
dao = (AbstractAdoDao<ADO>) new EventDao((Dao<Event, Long>) innerDao);
} else if (type.equals(EventParticipant.class)) {
dao = (AbstractAdoDao<ADO>) new EventParticipantDao((Dao<EventParticipant, Long>) innerDao);
} else if (type.equals(Sample.class)) {
dao = (AbstractAdoDao<ADO>) new SampleDao((Dao<Sample, Long>) innerDao);
} else if (type.equals(PathogenTest.class)) {
dao = (AbstractAdoDao<ADO>) new PathogenTestDao((Dao<PathogenTest, Long>) innerDao);
} else if (type.equals(AdditionalTest.class)) {
dao = (AbstractAdoDao<ADO>) new AdditionalTestDao((Dao<AdditionalTest, Long>) innerDao);
} else if (type.equals(Hospitalization.class)) {
dao = (AbstractAdoDao<ADO>) new HospitalizationDao((Dao<Hospitalization, Long>) innerDao);
} else if (type.equals(PreviousHospitalization.class)) {
dao = (AbstractAdoDao<ADO>) new PreviousHospitalizationDao((Dao<PreviousHospitalization, Long>) innerDao);
} else if (type.equals(EpiData.class)) {
dao = (AbstractAdoDao<ADO>) new EpiDataDao((Dao<EpiData, Long>) innerDao);
} else if (type.equals(Exposure.class)) {
dao = (AbstractAdoDao<ADO>) new ExposureDao((Dao<Exposure, Long>) innerDao);
} else if (type.equals(ActivityAsCase.class)) {
dao = (AbstractAdoDao<ADO>) new ActivityAsCaseDao((Dao<ActivityAsCase, Long>) innerDao);
} else if (type.equals(WeeklyReport.class)) {
dao = (AbstractAdoDao<ADO>) new WeeklyReportDao((Dao<WeeklyReport, Long>) innerDao);
} else if (type.equals(WeeklyReportEntry.class)) {
dao = (AbstractAdoDao<ADO>) new WeeklyReportEntryDao((Dao<WeeklyReportEntry, Long>) innerDao);
} else if (type.equals(AggregateReport.class)) {
dao = (AbstractAdoDao<ADO>) new AggregateReportDao((Dao<AggregateReport, Long>) innerDao);
} else if (type.equals(Outbreak.class)) {
dao = (AbstractAdoDao<ADO>) new OutbreakDao((Dao<Outbreak, Long>) innerDao);
} else if (type.equals(DiseaseClassificationCriteria.class)) {
dao = (AbstractAdoDao<ADO>) new DiseaseClassificationCriteriaDao((Dao<DiseaseClassificationCriteria, Long>) innerDao);
} else if (type.equals(SormasToSormasOriginInfo.class)) {
dao = (AbstractAdoDao<ADO>) new SormasToSormasOriginInfoDao((Dao<SormasToSormasOriginInfo, Long>) innerDao);
} else if (type.equals(Campaign.class)) {
dao = (AbstractAdoDao<ADO>) new CampaignDao((Dao<Campaign, Long>) innerDao);
} else if (type.equals(CampaignFormMeta.class)) {
dao = (AbstractAdoDao<ADO>) new CampaignFormMetaDao((Dao<CampaignFormMeta, Long>) innerDao);
} else if (type.equals(CampaignFormData.class)) {
dao = (AbstractAdoDao<ADO>) new CampaignFormDataDao((Dao<CampaignFormData, Long>) innerDao);
} else {
throw new UnsupportedOperationException(type.toString());
}
adoDaos.put(type, dao);
} catch (SQLException e) {
Log.e(DatabaseHelper.class.getName(), "Can't build dao", e);
throw new RuntimeException(e);
}
}
return (AbstractAdoDao<ADO>) adoDaos.get(type);
}
Aggregations