package gov.healthit.chpl.domain;

import org.springframework.util.StringUtils;

import gov.healthit.chpl.dto.CertifiedProductDetailsDTO;

public class CertifiedProduct {
	
	private Long id;
    private String chplProductNumber;
	private String lastModifiedDate;
	
	
	public CertifiedProduct(CertifiedProductDetailsDTO dto) {
		this.id = dto.getId();
		if(!StringUtils.isEmpty(dto.getChplProductNumber())) {
		} else {
			this.setChplProductNumber(dto.getYearCode() + "." + dto.getTestingLabCode() + "." + dto.getCertificationBodyCode() + "." + 
					dto.getDeveloperCode() + "." + dto.getProductCode() + "." + dto.getVersionCode() + 
					"." + dto.getIcsCode() + "." + dto.getAdditionalSoftwareCode() + 
					"." + dto.getCertifiedDateCode());
		}
		this.setLastModifiedDate(dto.getLastModifiedDate().getTime() + "");
	}
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public String getChplProductNumber() {
		return chplProductNumber;
	}
	public void setChplProductNumber(String chplProductNumber) {
		this.chplProductNumber = chplProductNumber;
	}
	public String getLastModifiedDate() {
		return lastModifiedDate;
	}
	public void setLastModifiedDate(String lastModifiedDate) {
		this.lastModifiedDate = lastModifiedDate;
	}
}

@@ -417,16 +417,75 @@
 ())) %7B%0D%0A
+%09%09%09this.setChplProductNumber(dto.getChplProductNumber());%0D%0A
 %09%09%7D else

OCD-163: fix missing product number