/** * Copy one ValueObject to another * * @param valueObjectDest to be updated * @param valueObjectSrc to copy values from */ public static ims.clinical.vo.PatientProcedureChecklistVo copy( ims.clinical.vo.PatientProcedureChecklistVo valueObjectDest, ims.clinical.vo.PatientProcedureChecklistVo valueObjectSrc) { if (null == valueObjectSrc) { return valueObjectSrc; } valueObjectDest.setID_PatientProcedureChecklist( valueObjectSrc.getID_PatientProcedureChecklist()); valueObjectDest.setIsRIE(valueObjectSrc.getIsRIE()); // ClinicalContact valueObjectDest.setClinicalContact(valueObjectSrc.getClinicalContact()); // PresentProcedures valueObjectDest.setPresentProcedures(valueObjectSrc.getPresentProcedures()); // OtherProcedures valueObjectDest.setOtherProcedures(valueObjectSrc.getOtherProcedures()); // AuthoringInformation valueObjectDest.setAuthoringInformation(valueObjectSrc.getAuthoringInformation()); return valueObjectDest; }
public static ims.clinical.domain.objects.PatientProcedureChecklist extractPatientProcedureChecklist( ims.domain.ILightweightDomainFactory domainFactory, ims.clinical.vo.PatientProcedureChecklistVo valueObject, HashMap domMap) { if (null == valueObject) { return null; } Integer id = valueObject.getID_PatientProcedureChecklist(); ims.clinical.domain.objects.PatientProcedureChecklist domainObject = null; if (null == id) { if (domMap.get(valueObject) != null) { return (ims.clinical.domain.objects.PatientProcedureChecklist) domMap.get(valueObject); } // ims.clinical.vo.PatientProcedureChecklistVo ID_PatientProcedureChecklist field is unknown domainObject = new ims.clinical.domain.objects.PatientProcedureChecklist(); domMap.put(valueObject, domainObject); } else { String key = (valueObject.getClass().getName() + "__" + valueObject.getID_PatientProcedureChecklist()); if (domMap.get(key) != null) { return (ims.clinical.domain.objects.PatientProcedureChecklist) domMap.get(key); } domainObject = (ims.clinical.domain.objects.PatientProcedureChecklist) domainFactory.getDomainObject( ims.clinical.domain.objects.PatientProcedureChecklist.class, id); // TODO: Not sure how this should be handled. Effectively it must be a staleobject exception, // but maybe should be handled as that further up. if (domainObject == null) return null; domMap.put(key, domainObject); } domainObject.setVersion(valueObject.getVersion_PatientProcedureChecklist()); ims.core.admin.domain.objects.ClinicalContact value1 = null; if (null != valueObject.getClinicalContact()) { if (valueObject.getClinicalContact().getBoId() == null) { if (domMap.get(valueObject.getClinicalContact()) != null) { value1 = (ims.core.admin.domain.objects.ClinicalContact) domMap.get(valueObject.getClinicalContact()); } } else if (valueObject.getBoVersion() == -1) // RefVo was not modified since obtained from the Assembler, no need to update the // BO field { value1 = domainObject.getClinicalContact(); } else { value1 = (ims.core.admin.domain.objects.ClinicalContact) domainFactory.getDomainObject( ims.core.admin.domain.objects.ClinicalContact.class, valueObject.getClinicalContact().getBoId()); } } domainObject.setClinicalContact(value1); domainObject.setPresentProcedures( ims.core.vo.domain.PatientProcedureVoAssembler.extractPatientProcedureSet( domainFactory, valueObject.getPresentProcedures(), domainObject.getPresentProcedures(), domMap)); domainObject.setOtherProcedures( ims.clinical.vo.domain.PatientAbsentProcedureVoAssembler.extractPatientAbsentProcedureSet( domainFactory, valueObject.getOtherProcedures(), domainObject.getOtherProcedures(), domMap)); domainObject.setAuthoringInformation( ims.core.vo.domain.AuthoringInformationVoAssembler.extractAuthoringInformation( domainFactory, valueObject.getAuthoringInformation(), domMap)); return domainObject; }