public OcsOrderShortVo(ims.ocrr.vo.beans.OcsOrderShortVoBean bean) { this.id = bean.getId(); this.version = bean.getVersion(); this.clinicalcontact = bean.getClinicalContact() == null ? null : new ims.core.admin.vo.ClinicalContactRefVo( new Integer(bean.getClinicalContact().getId()), bean.getClinicalContact().getVersion()); this.patient = bean.getPatient() == null ? null : bean.getPatient().buildVo(); this.orderedby = bean.getOrderedBy() == null ? null : bean.getOrderedBy().buildVo(); this.responsibleclinician = bean.getResponsibleClinician() == null ? null : bean.getResponsibleClinician().buildVo(); this.responsiblegp = bean.getResponsibleGp() == null ? null : bean.getResponsibleGp().buildVo(); this.patientlocation = bean.getPatientLocation() == null ? null : bean.getPatientLocation().buildVo(); this.patientclinic = bean.getPatientClinic() == null ? null : bean.getPatientClinic().buildVo(); this.additclinnotes = bean.getAdditClinNotes(); this.sysinfo = bean.getSysInfo() == null ? null : bean.getSysInfo().buildSystemInformation(); this.carecontext = bean.getCareContext() == null ? null : bean.getCareContext().buildVo(); this.orderinghospital = bean.getOrderingHospital() == null ? null : new ims.core.resource.place.vo.LocSiteRefVo( new Integer(bean.getOrderingHospital().getId()), bean.getOrderingHospital().getVersion()); this.outpatientdept = bean.getOutpatientDept() == null ? null : bean.getOutpatientDept().buildVo(); this.authorisationorderstatus = bean.getAuthorisationOrderStatus() == null ? null : ims.ocrr.vo.lookups.AuthorisationOrderStatus.buildLookup( bean.getAuthorisationOrderStatus()); }
public void populate(ims.vo.ValueObjectBeanMap map, ims.ocrr.vo.beans.OcsOrderVoBean bean) { this.id = bean.getId(); this.version = bean.getVersion(); this.clinicalcontact = bean.getClinicalContact() == null ? null : new ims.core.admin.vo.ClinicalContactRefVo( new Integer(bean.getClinicalContact().getId()), bean.getClinicalContact().getVersion()); this.patient = bean.getPatient() == null ? null : bean.getPatient().buildVo(map); this.orderedby = bean.getOrderedBy() == null ? null : bean.getOrderedBy().buildVo(map); this.responsibleclinician = bean.getResponsibleClinician() == null ? null : bean.getResponsibleClinician().buildVo(map); this.responsiblegp = bean.getResponsibleGp() == null ? null : bean.getResponsibleGp().buildVo(map); this.patientlocation = bean.getPatientLocation() == null ? null : bean.getPatientLocation().buildVo(map); this.patientclinic = bean.getPatientClinic() == null ? null : bean.getPatientClinic().buildVo(map); this.additclinnotes = bean.getAdditClinNotes(); this.sysinfo = bean.getSysInfo() == null ? null : bean.getSysInfo().buildSystemInformation(); this.carecontext = bean.getCareContext() == null ? null : bean.getCareContext().buildVo(map); this.orderinghospital = bean.getOrderingHospital() == null ? null : new ims.core.resource.place.vo.LocSiteRefVo( new Integer(bean.getOrderingHospital().getId()), bean.getOrderingHospital().getVersion()); this.outpatientdept = bean.getOutpatientDept() == null ? null : bean.getOutpatientDept().buildVo(map); this.authorisationorderstatus = bean.getAuthorisationOrderStatus() == null ? null : ims.ocrr.vo.lookups.AuthorisationOrderStatus.buildLookup( bean.getAuthorisationOrderStatus()); this.clinicaltrial = bean.getClinicalTrial(); this.clinicaltrialtxt = bean.getClinicalTrialTxt(); this.patmobility = bean.getPatMobility() == null ? null : ims.ocrr.vo.lookups.OrderPatMobility.buildLookup(bean.getPatMobility()); this.ordercategory = bean.getOrderCategory() == null ? null : ims.ocrr.vo.lookups.OrderCategory.buildLookup(bean.getOrderCategory()); this.specimens = ims.ocrr.vo.OrderSpecimenVoCollection.buildFromBeanCollection(bean.getSpecimens()); this.investigations = ims.ocrr.vo.OrderInvestigationVoCollection.buildFromBeanCollection( bean.getInvestigations()); this.wasprocessed = bean.getWasProcessed(); this.clinicalinfo = bean.getClinicalInfo() == null ? null : bean.getClinicalInfo().buildVo(map); this.reportto = ims.ocrr.vo.OcsReportToVoCollection.buildFromBeanCollection(bean.getReportTo()); this.summaryclinicalinformation = bean.getSummaryClinicalInformation(); this.bleepextnumber = bean.getBleepExtNumber(); }
/** * Update the ValueObject with the Domain Object. * * @param map DomainObjectMap of DomainObjects to already created ValueObjects. * @param valueObject to be updated * @param domainObject ims.ocrr.orderingresults.domain.objects.OcsOrderSession */ public static ims.ocrr.vo.OcsOrderVo insert( DomainObjectMap map, ims.ocrr.vo.OcsOrderVo valueObject, ims.ocrr.orderingresults.domain.objects.OcsOrderSession domainObject) { if (null == domainObject) { return valueObject; } if (null == map) { map = new DomainObjectMap(); } valueObject.setID_OcsOrderSession(domainObject.getId()); valueObject.setIsRIE(domainObject.getIsRIE()); // If this is a recordedInError record, and the domainObject // value isIncludeRecord has not been set, then we return null and // not the value object if (valueObject.getIsRIE() != null && valueObject.getIsRIE().booleanValue() == true && !domainObject.isIncludeRecord()) return null; // If this is not a recordedInError record, and the domainObject // value isIncludeRecord has been set, then we return null and // not the value object if ((valueObject.getIsRIE() == null || valueObject.getIsRIE().booleanValue() == false) && domainObject.isIncludeRecord()) return null; // ClinicalTrial valueObject.setClinicalTrial(domainObject.isClinicalTrial()); // ClinicalTrialTxt valueObject.setClinicalTrialTxt(domainObject.getClinicalTrialTxt()); // PatMobility ims.domain.lookups.LookupInstance instance3 = domainObject.getPatMobility(); if (null != instance3) { ims.framework.utils.ImagePath img = null; ims.framework.utils.Color color = null; img = null; if (instance3.getImage() != null) { img = new ims.framework.utils.ImagePath( instance3.getImage().getImageId(), instance3.getImage().getImagePath()); } color = instance3.getColor(); if (color != null) color.getValue(); ims.ocrr.vo.lookups.OrderPatMobility voLookup3 = new ims.ocrr.vo.lookups.OrderPatMobility( instance3.getId(), instance3.getText(), instance3.isActive(), null, img, color); ims.ocrr.vo.lookups.OrderPatMobility parentVoLookup3 = voLookup3; ims.domain.lookups.LookupInstance parent3 = instance3.getParent(); while (parent3 != null) { if (parent3.getImage() != null) { img = new ims.framework.utils.ImagePath( parent3.getImage().getImageId(), parent3.getImage().getImagePath()); } else { img = null; } color = parent3.getColor(); if (color != null) color.getValue(); parentVoLookup3.setParent( new ims.ocrr.vo.lookups.OrderPatMobility( parent3.getId(), parent3.getText(), parent3.isActive(), null, img, color)); parentVoLookup3 = parentVoLookup3.getParent(); parent3 = parent3.getParent(); } valueObject.setPatMobility(voLookup3); } // OrderCategory ims.domain.lookups.LookupInstance instance4 = domainObject.getOrderCategory(); if (null != instance4) { ims.framework.utils.ImagePath img = null; ims.framework.utils.Color color = null; img = null; if (instance4.getImage() != null) { img = new ims.framework.utils.ImagePath( instance4.getImage().getImageId(), instance4.getImage().getImagePath()); } color = instance4.getColor(); if (color != null) color.getValue(); ims.ocrr.vo.lookups.OrderCategory voLookup4 = new ims.ocrr.vo.lookups.OrderCategory( instance4.getId(), instance4.getText(), instance4.isActive(), null, img, color); ims.ocrr.vo.lookups.OrderCategory parentVoLookup4 = voLookup4; ims.domain.lookups.LookupInstance parent4 = instance4.getParent(); while (parent4 != null) { if (parent4.getImage() != null) { img = new ims.framework.utils.ImagePath( parent4.getImage().getImageId(), parent4.getImage().getImagePath()); } else { img = null; } color = parent4.getColor(); if (color != null) color.getValue(); parentVoLookup4.setParent( new ims.ocrr.vo.lookups.OrderCategory( parent4.getId(), parent4.getText(), parent4.isActive(), null, img, color)); parentVoLookup4 = parentVoLookup4.getParent(); parent4 = parent4.getParent(); } valueObject.setOrderCategory(voLookup4); } // specimens valueObject.setSpecimens( ims.ocrr.vo.domain.OrderSpecimenVoAssembler .createOrderSpecimenVoCollectionFromOrderSpecimen(map, domainObject.getSpecimens())); // Investigations valueObject.setInvestigations( ims.ocrr.vo.domain.OrderInvestigationVoAssembler .createOrderInvestigationVoCollectionFromOrderInvestigation( map, domainObject.getInvestigations())); // wasProcessed valueObject.setWasProcessed(domainObject.isWasProcessed()); // ClinicalInfo valueObject.setClinicalInfo( ims.ocrr.vo.domain.OcsQASessionVoAssembler.create(map, domainObject.getClinicalInfo())); // ReportTo valueObject.setReportTo( ims.ocrr.vo.domain.OcsReportToVoAssembler.createOcsReportToVoCollectionFromOcsReportTo( map, domainObject.getReportTo())); // SummaryClinicalInformation valueObject.setSummaryClinicalInformation(domainObject.getSummaryClinicalInformation()); // BleepExtNumber valueObject.setBleepExtNumber(domainObject.getBleepExtNumber()); // ClinicalContact if (domainObject.getClinicalContact() != null) { if (domainObject.getClinicalContact() instanceof HibernateProxy) // If the proxy is set, there is no need to lazy load, the proxy knows the // id already. { HibernateProxy p = (HibernateProxy) domainObject.getClinicalContact(); int id = Integer.parseInt(p.getHibernateLazyInitializer().getIdentifier().toString()); valueObject.setClinicalContact(new ims.core.admin.vo.ClinicalContactRefVo(id, -1)); } else { valueObject.setClinicalContact( new ims.core.admin.vo.ClinicalContactRefVo( domainObject.getClinicalContact().getId(), domainObject.getClinicalContact().getVersion())); } } // Patient valueObject.setPatient( ims.core.vo.domain.PatientShortAssembler.create(map, domainObject.getPatient())); // OrderedBy valueObject.setOrderedBy( ims.core.vo.domain.MemberOfStaffLiteVoAssembler.create(map, domainObject.getOrderedBy())); // ResponsibleClinician valueObject.setResponsibleClinician( ims.core.vo.domain.HcpLiteVoAssembler.create(map, domainObject.getResponsibleClinician())); // ResponsibleGp valueObject.setResponsibleGp( ims.core.vo.domain.GpLiteVoAssembler.create(map, domainObject.getResponsibleGp())); // PatientLocation valueObject.setPatientLocation( ims.core.vo.domain.LocationLiteVoAssembler.create(map, domainObject.getPatientLocation())); // PatientClinic valueObject.setPatientClinic( ims.core.vo.domain.ClinicLiteVoAssembler.create(map, domainObject.getPatientClinic())); // AdditClinNotes valueObject.setAdditClinNotes(domainObject.getAdditClinNotes()); // SysInfo // set system information valueObject.setSysInfo( ims.vo.domain.SystemInformationAssembler.create(domainObject.getSystemInformation())); // CareContext valueObject.setCareContext( ims.core.vo.domain.CareContextPasVoAssembler.create(map, domainObject.getCareContext())); // OrderingHospital if (domainObject.getOrderingHospital() != null) { if (domainObject.getOrderingHospital() instanceof HibernateProxy) // If the proxy is set, there is no need to lazy load, the proxy knows the // id already. { HibernateProxy p = (HibernateProxy) domainObject.getOrderingHospital(); int id = Integer.parseInt(p.getHibernateLazyInitializer().getIdentifier().toString()); valueObject.setOrderingHospital(new ims.core.resource.place.vo.LocSiteRefVo(id, -1)); } else { valueObject.setOrderingHospital( new ims.core.resource.place.vo.LocSiteRefVo( domainObject.getOrderingHospital().getId(), domainObject.getOrderingHospital().getVersion())); } } // OutpatientDept valueObject.setOutpatientDept( ims.core.vo.domain.LocationLiteVoAssembler.create(map, domainObject.getOutpatientDept())); // AuthorisationOrderStatus ims.domain.lookups.LookupInstance instance24 = domainObject.getAuthorisationOrderStatus(); if (null != instance24) { ims.framework.utils.ImagePath img = null; ims.framework.utils.Color color = null; img = null; if (instance24.getImage() != null) { img = new ims.framework.utils.ImagePath( instance24.getImage().getImageId(), instance24.getImage().getImagePath()); } color = instance24.getColor(); if (color != null) color.getValue(); ims.ocrr.vo.lookups.AuthorisationOrderStatus voLookup24 = new ims.ocrr.vo.lookups.AuthorisationOrderStatus( instance24.getId(), instance24.getText(), instance24.isActive(), null, img, color); ims.ocrr.vo.lookups.AuthorisationOrderStatus parentVoLookup24 = voLookup24; ims.domain.lookups.LookupInstance parent24 = instance24.getParent(); while (parent24 != null) { if (parent24.getImage() != null) { img = new ims.framework.utils.ImagePath( parent24.getImage().getImageId(), parent24.getImage().getImagePath()); } else { img = null; } color = parent24.getColor(); if (color != null) color.getValue(); parentVoLookup24.setParent( new ims.ocrr.vo.lookups.AuthorisationOrderStatus( parent24.getId(), parent24.getText(), parent24.isActive(), null, img, color)); parentVoLookup24 = parentVoLookup24.getParent(); parent24 = parent24.getParent(); } valueObject.setAuthorisationOrderStatus(voLookup24); } return valueObject; }