class C32DocumentLogic implements C32DocumentEntityFactory, Serializable {

	public C32DocumentEntity createDocument(String patientId, String doc) throws Exception {
		Document xmlDoc = null;
		if (doc!=null) {
			doc = doc.trim();
			if (!"".equals(doc)) {
				Builder builder = new Builder();
				xmlDoc = builder.build(new StringReader(doc));
			}
		}

		return new C32DocumentEntity(patientId, getPatientId(xmlDoc), new java.sql.Timestamp(new java.util.Date().getTime()), getFilteredDocument(xmlDoc));
	}

}