Java Code Examples for com.ims.query.builder.client.SeedValue

The following are top voted examples for showing how to use com.ims.query.builder.client.SeedValue. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private void addNullAssessmentSeeds(QueryBuilderClient client)
{
	client.addSeed(new SeedValue("G", "", String.class));
	client.addSeed(new SeedValue("H", "", String.class));
	client.addSeed(new SeedValue("I", "", String.class));
	client.addSeed(new SeedValue("J", "", String.class));
	client.addSeed(new SeedValue("K", "", String.class));
	client.addSeed(new SeedValue("L", "", String.class));
	client.addSeed(new SeedValue("M", "", String.class));
	client.addSeed(new SeedValue("N", "", String.class));
	client.addSeed(new SeedValue("O", "", String.class));
	client.addSeed(new SeedValue("P", "", String.class));
	client.addSeed(new SeedValue("Q", "", String.class));
	client.addSeed(new SeedValue("R", "", String.class));

	client.addSeed(new SeedValue("K1", "", String.class));
	client.addSeed(new SeedValue("K2", "", String.class));
	client.addSeed(new SeedValue("K3", "", String.class));

	client.addSeed(new SeedValue("MIS1", "", String.class));
	client.addSeed(new SeedValue("MIS2", "", String.class));
}
 
Example 2
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private boolean nonMandatorySeedNotAddedToReport(ReportSeedParsedVo seed, QueryBuilderClient client) 
{
	if(seed == null)
		return false;
	
	if(client == null)
		return false;
	
	if(client.getSeeds() == null)
		return true;
	
	for(int i=0; i<client.getSeeds().size(); i++)
	{
		if(client.getSeeds().get(i) == null)
			continue;
		
		SeedValue sValue = (SeedValue)client.getSeeds().get(i);
		
		if(seed.getName() != null && seed.getName().equals(sValue.getName()))
			return false;
	}
	
	return true;
}
 
Example 3
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private boolean checkIfMandatorySeedIsAdded(String name, ArrayList seeds) 
{
	if(name == null || name.length() == 0)
		return true;
	
	if(seeds == null || seeds.size() == 0)
		return false;
	
	for(int i=0; i<seeds.size(); i++)
	{
		if(seeds.get(i) == null)
			continue;
		
		SeedValue sValue = (SeedValue)seeds.get(i);
		
		if(sValue.getName().equals(name))
			return true;
	}
	
	return false;
}
 
Example 4
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private boolean nonMandatorySeedNotAddedToReport(ReportSeedParsedVo seed, QueryBuilderClient client) 
{
	if(seed == null)
		return false;
	
	if(client == null)
		return false;
	
	if(client.getSeeds() == null)
		return true;
	
	for(int i=0; i<client.getSeeds().size(); i++)
	{
		if(client.getSeeds().get(i) == null)
			continue;
		
		SeedValue sValue = (SeedValue)client.getSeeds().get(i);
		
		if(seed.getName() != null && seed.getName().equals(sValue.getName()))
			return false;
	}
	
	return true;
}
 
Example 5
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private boolean checkIfMandatorySeedIsAdded(String name, ArrayList seeds) 
{
	if(name == null || name.length() == 0)
		return true;
	
	if(seeds == null || seeds.size() == 0)
		return false;
	
	for(int i=0; i<seeds.size(); i++)
	{
		if(seeds.get(i) == null)
			continue;
		
		SeedValue sValue = (SeedValue)seeds.get(i);
		
		if(sValue.getName().equals(name))
			return true;
	}
	
	return false;
}
 
Example 6
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private void processPhlebotomyReport(QueryBuilderClient client,String urlReportServer, String repXml, String templXml, PhlebotomyRoundVo round) 
{			
	client.getSeeds().clear();
	client.addSeed(new SeedValue("PhlebotomyRound_id", round.getID_PhlebotomyRound(), Integer.class));
	client.addSeed(new SeedValue("Patient_id", null, Integer.class));
	
	try
	{					
		client.printReport(repXml, templXml, urlReportServer,form.qmbPrinter().getValue(), 1);
		
	} 
	catch (QueryBuilderClientException e1)
	{
		engine.showMessage("Error building the report: " + e1.toString());
		return;
	}						
	
}
 
Example 7
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private void processLabelsPrintedFromOrderReport(QueryBuilderClient client,String urlReportServer, String repXml2, String templXml2,OrderSpecimenLiteVo specimen) 
{
					
	client.getSeeds().clear();
	client.addSeed(new SeedValue("OrderSpecimen_id", specimen.getID_OrderSpecimen(), Integer.class));				
	
	try
	{					
		client.printReport(repXml2, templXml2, urlReportServer, form.qmbPrinterLabels().getValue(), 1);

	} 
	catch (QueryBuilderClientException e1)
	{
		engine.showMessage("Error building the report: " + e1.toString());
		return;
	}						
		
}
 
Example 8
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private byte[] processResultSummaryReport(QueryBuilderClient client, String urlReportServer, String repXml2, String templXml2,int inv_id,int page_start)
{
	byte[] doc = null;
	
	client.getSeeds().clear();
	client.addSeed(new SeedValue("OrderInvestigation_id",inv_id , java.lang.Integer.class));
	client.addSeed(new SeedValue("PAGE_START", page_start, java.lang.Integer.class));
	
	try
	{					
		doc = client.buildReport(repXml2, templXml2, urlReportServer, QueryBuilderClient.PDF, "", 1);

	} 
	catch (QueryBuilderClientException e1)
	{
		engine.showMessage("Error building the report: " + e1.toString());
		return null;
	}
			
	return doc;	
}
 
Example 9
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private void processPhlebotomyReport(QueryBuilderClient client,String urlReportServer, String repXml, String templXml, PhlebotomyRoundVo round) 
{			
	client.getSeeds().clear();
	client.addSeed(new SeedValue("PhlebotomyRound_id", round.getID_PhlebotomyRound(), Integer.class));
	client.addSeed(new SeedValue("Patient_id", null, Integer.class));
	
	try
	{					
		client.printReport(repXml, templXml, urlReportServer,form.qmbPrinter().getValue(), 1);
		
	} 
	catch (QueryBuilderClientException e1)
	{
		engine.showMessage("Error building the report: " + e1.toString());
		return;
	}						
	
}
 
Example 10
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private boolean nonMandatorySeedNotAddedToReport(ReportSeedParsedVo seed, QueryBuilderClient client) 
{
	if(seed == null)
		return false;
	
	if(client == null)
		return false;
	
	if(client.getSeeds() == null)
		return true;
	
	for(int i=0; i<client.getSeeds().size(); i++)
	{
		if(client.getSeeds().get(i) == null)
			continue;
		
		SeedValue sValue = (SeedValue)client.getSeeds().get(i);
		
		if(seed.getName() != null && seed.getName().equals(sValue.getName()))
			return false;
	}
	
	return true;
}
 
Example 11
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private void addNullAssessmentSeeds(QueryBuilderClient client)
{
	client.addSeed(new SeedValue("G", "", String.class));
	client.addSeed(new SeedValue("H", "", String.class));
	client.addSeed(new SeedValue("I", "", String.class));
	client.addSeed(new SeedValue("J", "", String.class));
	client.addSeed(new SeedValue("K", "", String.class));
	client.addSeed(new SeedValue("L", "", String.class));
	client.addSeed(new SeedValue("M", "", String.class));
	client.addSeed(new SeedValue("N", "", String.class));
	client.addSeed(new SeedValue("O", "", String.class));
	client.addSeed(new SeedValue("P", "", String.class));
	client.addSeed(new SeedValue("Q", "", String.class));
	client.addSeed(new SeedValue("R", "", String.class));

	client.addSeed(new SeedValue("K1", "", String.class));
	client.addSeed(new SeedValue("K2", "", String.class));
	client.addSeed(new SeedValue("K3", "", String.class));

	client.addSeed(new SeedValue("MIS1", "", String.class));
	client.addSeed(new SeedValue("MIS2", "", String.class));
}
 
Example 12
Project: openmaxims-linux   File: Logic.java   View source code 6 votes vote down vote up
private boolean nonMandatorySeedNotAddedToReport(ReportSeedParsedVo seed, QueryBuilderClient client) 
{
	if(seed == null)
		return false;
	
	if(client == null)
		return false;
	
	if(client.getSeeds() == null)
		return true;
	
	for(int i=0; i<client.getSeeds().size(); i++)
	{
		if(client.getSeeds().get(i) == null)
			continue;
		
		SeedValue sValue = (SeedValue)client.getSeeds().get(i);
		
		if(seed.getName() != null && seed.getName().equals(sValue.getName()))
			return false;
	}
	
	return true;
}
 
Example 13
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private boolean checkIfMandatorySeedIsAdded(String name, ArrayList seeds) 
{
	if(name == null || name.length() == 0)
		return true;
	
	if(seeds == null || seeds.size() == 0)
		return false;
	
	for(int i=0; i<seeds.size(); i++)
	{
		if(seeds.get(i) == null)
			continue;
		
		SeedValue sValue = (SeedValue)seeds.get(i);
		
		if(sValue.getName().equals(name))
			return true;
	}
	
	return false;
}
 
Example 14
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private void processPhlebotomyReport(QueryBuilderClient client,String urlReportServer, String repXml, String templXml, PhlebotomyRoundVo round) 
{			
	client.getSeeds().clear();
	client.addSeed(new SeedValue("PhlebotomyRound_id", round.getID_PhlebotomyRound(), Integer.class));
	client.addSeed(new SeedValue("Patient_id", null, Integer.class));
	
	try
	{					
		client.printReport(repXml, templXml, urlReportServer,form.qmbPrinter().getValue(), 1);
		
	} 
	catch (QueryBuilderClientException e1)
	{
		engine.showMessage("Error building the report: " + e1.toString());
		return;
	}						
	
}
 
Example 15
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private boolean checkIfMandatorySeedIsAdded(String name, ArrayList seeds) 
{
	if(name == null || name.length() == 0)
		return true;
	
	if(seeds == null || seeds.size() == 0)
		return false;
	
	for(int i=0; i<seeds.size(); i++)
	{
		if(seeds.get(i) == null)
			continue;
		
		SeedValue sValue = (SeedValue)seeds.get(i);
		
		if(sValue.getName().equals(name))
			return true;
	}
	
	return false;
}
 
Example 16
Project: openmaxims-linux   File: Logic.java   View source code 6 votes vote down vote up
private void addNullAssessmentSeeds(QueryBuilderClient client)
{
	client.addSeed(new SeedValue("G", "", String.class));
	client.addSeed(new SeedValue("H", "", String.class));
	client.addSeed(new SeedValue("I", "", String.class));
	client.addSeed(new SeedValue("J", "", String.class));
	client.addSeed(new SeedValue("K", "", String.class));
	client.addSeed(new SeedValue("L", "", String.class));
	client.addSeed(new SeedValue("M", "", String.class));
	client.addSeed(new SeedValue("N", "", String.class));
	client.addSeed(new SeedValue("O", "", String.class));
	client.addSeed(new SeedValue("P", "", String.class));
	client.addSeed(new SeedValue("Q", "", String.class));
	client.addSeed(new SeedValue("R", "", String.class));

	client.addSeed(new SeedValue("K1", "", String.class));
	client.addSeed(new SeedValue("K2", "", String.class));
	client.addSeed(new SeedValue("K3", "", String.class));

	client.addSeed(new SeedValue("MIS1", "", String.class));
	client.addSeed(new SeedValue("MIS2", "", String.class));
}
 
Example 17
Project: openmaxims-linux   File: Logic.java   View source code 6 votes vote down vote up
private void processLabelsPrintedFromOrderReport(QueryBuilderClient client,String urlReportServer, String repXml2, String templXml2,OrderSpecimenLiteVo specimen) 
{
					
	client.getSeeds().clear();
	client.addSeed(new SeedValue("OrderSpecimen_id", specimen.getID_OrderSpecimen(), Integer.class));				
	
	try
	{					
		client.printReport(repXml2, templXml2, urlReportServer, form.qmbPrinterLabels().getValue(), 1);

	} 
	catch (QueryBuilderClientException e1)
	{
		engine.showMessage("Error building the report: " + e1.toString());
		return;
	}						
		
}
 
Example 18
Project: openmaxims-linux   File: Logic.java   View source code 6 votes vote down vote up
private boolean checkIfMandatorySeedIsAdded(String name, ArrayList seeds) 
{
	if(name == null || name.length() == 0)
		return true;
	
	if(seeds == null || seeds.size() == 0)
		return false;
	
	for(int i=0; i<seeds.size(); i++)
	{
		if(seeds.get(i) == null)
			continue;
		
		SeedValue sValue = (SeedValue)seeds.get(i);
		
		if(sValue.getName().equals(name))
			return true;
	}
	
	return false;
}
 
Example 19
Project: openmaxims-linux   File: Logic.java   View source code 6 votes vote down vote up
private byte[] processResultSummaryReport(QueryBuilderClient client, String urlReportServer, String repXml2, String templXml2,int inv_id,int page_start)
{
	byte[] doc = null;
	
	client.getSeeds().clear();
	client.addSeed(new SeedValue("OrderInvestigation_id",inv_id , java.lang.Integer.class));
	client.addSeed(new SeedValue("PAGE_START", page_start, java.lang.Integer.class));
	
	try
	{					
		doc = client.buildReport(repXml2, templXml2, urlReportServer, QueryBuilderClient.PDF, "", 1);

	} 
	catch (QueryBuilderClientException e1)
	{
		engine.showMessage("Error building the report: " + e1.toString());
		return null;
	}
			
	return doc;	
}
 
Example 20
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private void addNullAssessmentSeeds(QueryBuilderClient client)
{
	client.addSeed(new SeedValue("G", "", String.class));
	client.addSeed(new SeedValue("H", "", String.class));
	client.addSeed(new SeedValue("I", "", String.class));
	client.addSeed(new SeedValue("J", "", String.class));
	client.addSeed(new SeedValue("K", "", String.class));
	client.addSeed(new SeedValue("L", "", String.class));
	client.addSeed(new SeedValue("M", "", String.class));
	client.addSeed(new SeedValue("N", "", String.class));
	client.addSeed(new SeedValue("O", "", String.class));
	client.addSeed(new SeedValue("P", "", String.class));
	client.addSeed(new SeedValue("Q", "", String.class));
	client.addSeed(new SeedValue("R", "", String.class));

	client.addSeed(new SeedValue("K1", "", String.class));
	client.addSeed(new SeedValue("K2", "", String.class));
	client.addSeed(new SeedValue("K3", "", String.class));

	client.addSeed(new SeedValue("MIS1", "", String.class));
	client.addSeed(new SeedValue("MIS2", "", String.class));
}
 
Example 21
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
/**
 * 
 */
private byte[] buildDocumentPDF(CorrespondenceDetailsVo voCorrespondenceDetails) throws QueryBuilderClientException
{
	Integer iDocId;
	iDocId = voCorrespondenceDetails.getID_CorrespondenceDetails();

	form.getGlobalContext().Correspondence.setDocDetailIdReportSeed(iDocId);
	// generate the document for viewing
	form.getGlobalContext().Core.setReportID(form.getGlobalContext().Correspondence.getReportTemplate().getReport().getID_ReportBo());
	form.getGlobalContext().Core.setTemplateID(form.getGlobalContext().Correspondence.getReportTemplate().getID_TemplateBo());

	String urlQueryServer = ConfigFlag.GEN.QUERY_SERVER_URL.getValue();
	String urlReportServer = ConfigFlag.GEN.REPORT_SERVER_URL.getValue();
	String[] obj = null;
	try
	{
		obj = domain.getReportAndTemplate(form.getGlobalContext().Core.getReportID(), form.getGlobalContext().Core.getTemplateID());
	}
	catch (DomainInterfaceException e)
	{
		engine.showMessage("I could not get the report and template !");
		return null;
	}

	if (obj == null || obj.length == 0)
	{
		engine.showMessage("I could not get the report and template !");
		return null;
	}

	QueryBuilderClient client = new QueryBuilderClient(urlQueryServer, engine.getSessionId());

	if (form.getGlobalContext().Correspondence.getDocDetailIdReportSeedIsNotNull())
		client.addSeed(new SeedValue("CorrespondenceDetails_id", form.getGlobalContext().Correspondence.getDocDetailIdReportSeed(), Integer.class));

	return client.buildReport(obj[0], obj[1], urlReportServer, QueryBuilderClient.FP3, "", 1);

}
 
Example 22
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
/**
 * 
 */
private byte[] buildDocumentPDF(CorrespondenceDetailsVo voCorrespondenceDetails) throws QueryBuilderClientException
{
	Integer iDocId;
	iDocId = voCorrespondenceDetails.getID_CorrespondenceDetails();

	form.getGlobalContext().Correspondence.setDocDetailIdReportSeed(iDocId);
	// generate the document for viewing
	form.getGlobalContext().Core.setReportID(form.getGlobalContext().Correspondence.getReportTemplate().getReport().getID_ReportBo());
	form.getGlobalContext().Core.setTemplateID(form.getGlobalContext().Correspondence.getReportTemplate().getID_TemplateBo());

	String urlQueryServer = ConfigFlag.GEN.QUERY_SERVER_URL.getValue();
	String urlReportServer = ConfigFlag.GEN.REPORT_SERVER_URL.getValue();
	String[] obj = null;
	try
	{
		obj = domain.getReportAndTemplate(form.getGlobalContext().Core.getReportID(), form.getGlobalContext().Core.getTemplateID());
	}
	catch (DomainInterfaceException e)
	{
		engine.showMessage("I could not get the report and template !");
		return null;
	}

	if (obj == null || obj.length == 0)
	{
		engine.showMessage("I could not get the report and template !");
		return null;
	}

	QueryBuilderClient client = new QueryBuilderClient(urlQueryServer, engine.getSessionId());

	if (form.getGlobalContext().Correspondence.getDocDetailIdReportSeedIsNotNull())
		client.addSeed(new SeedValue("CorrespondenceDetails_id", form.getGlobalContext().Correspondence.getDocDetailIdReportSeed(), Integer.class));

	return client.buildReport(obj[0], obj[1], urlReportServer, QueryBuilderClient.FP3, "", 1);

}
 
Example 23
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private String getIFrameCode() throws DomainInterfaceException
{
	StringBuffer sb = new StringBuffer(1000);
	String urlQueryServer = ConfigFlag.GEN.QUERY_SERVER_URL.getValue();
	String urlReportServer = ConfigFlag.GEN.REPORT_SERVER_URL.getValue();

	String[] obj = null;

	obj = domain.getReportAndTemplate(form.getGlobalContext().Core.getReportID(), form.getGlobalContext().Core.getTemplateID());

	if (obj == null || obj.length == 0)
	{
		engine.showMessage("I could not get the report and template !");
		return sb.toString();
	}

	QueryBuilderClient client = new QueryBuilderClient(urlQueryServer, engine.getSessionId());

	// get report seed name
	if (form.getGlobalContext().Correspondence.getDocDetailIdReportSeedIsNotNull())
		client.addSeed(new SeedValue("DocumentDetails_id", form.getGlobalContext().Correspondence.getDocDetailIdReportSeed(), Integer.class));

	String result = "";

	try
	{
		result = client.buildReportAsUrlInlineFrame(obj[0], obj[1], urlReportServer, "PDF", "", 1);
		sb.append(result);

	}
	catch (QueryBuilderClientException e1)
	{
		return e1.toString();
	}

	return sb.toString();
}
 
Example 24
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private String getIFrameCode() throws DomainInterfaceException
{
	StringBuffer sb = new StringBuffer(1000);
	String urlQueryServer = ConfigFlag.GEN.QUERY_SERVER_URL.getValue();
	String urlReportServer = ConfigFlag.GEN.REPORT_SERVER_URL.getValue();
	
	String[] obj = null;
	
	obj = domain.getReportAndTemplate(form.getGlobalContext().Core.getReportID(), form.getGlobalContext().Core.getTemplateID());

	if(obj == null || obj.length == 0)
	{
		engine.showMessage("I could not get the report and template !");
		return sb.toString();
	}
	
	QueryBuilderClient client = new QueryBuilderClient(urlQueryServer,engine.getSessionId());
			
	//get report seed name
	if (form.getGlobalContext().Correspondence.getDocDetailIdReportSeedIsNotNull())
		client.addSeed(new SeedValue("DocumentDetails_id",form.getGlobalContext().Correspondence.getDocDetailIdReportSeed(),Integer.class));
	
	String result = "";
	
	try
	{
		result = client.buildReportAsUrlInlineFrame(obj[0], obj[1], urlReportServer, "PDF", "",1);
		sb.append(result);
		
	} catch (QueryBuilderClientException e1)
	{
		return e1.toString();
	} 
	
	return sb.toString();
}
 
Example 25
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private void printReport()
{
	String urlQueryServer = ConfigFlag.GEN.QUERY_SERVER_URL.getValue();
	String urlReportServer =ConfigFlag.GEN.REPORT_SERVER_URL.getValue();

	String[] obj = null;
	try
	{
		obj = domain.getReportAndTemplate(form.getGlobalContext().Core.getReportID(), form.getGlobalContext().Core.getTemplateID());
	}
	catch (DomainInterfaceException e)
	{
		engine.showMessage("Error retrieving report template !\r\n" + e.getMessage());
		return;
	}

	if (obj == null || obj.length == 0)
	{
		engine.showMessage("I could not get the report and template !");
		return;
	}

	QueryBuilderClient client = new QueryBuilderClient(urlQueryServer, engine.getSessionId());

	client.addSeed(new SeedValue("CarePlan_id", form.getLocalContext().getCarePlan().getID_CarePlan(), Integer.class));

	String resultUrl = "";

	try
	{
		resultUrl = client.buildReportAsUrl(obj[0], obj[1], urlReportServer, QueryBuilderClient.PDF, "", 1);
	}
	catch (QueryBuilderClientException e1)
	{
		engine.showMessage("Error creating report: " + e1.getMessage());
		return;
	}

	engine.openUrl(resultUrl);
}
 
Example 26
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private void printReport()
{
	if(form.layerControl1().movement().comboAllMovements().getValue() == null)
	{
		engine.showMessage("No Movement Record Selected");
		return;
	}
	
	
	String urlQueryServer = ConfigFlag.GEN.QUERY_SERVER_URL.getValue();
	String urlReportServer = ConfigFlag.GEN.REPORT_SERVER_URL.getValue();

	String[] obj = null;
	obj = domain.getReportAndTemplate(form.getGlobalContext().Core.getReportID(), form.getGlobalContext().Core.getTemplateID());
	
	if(obj == null || obj.length == 0)
	{
		engine.showMessage("Failed to retrieve the report and template !");
		return;
	}
	
	QueryBuilderClient client = new QueryBuilderClient(urlQueryServer, engine.getSessionId());
	
	client.addSeed(new SeedValue("PatientMovementHandling_id", form.layerControl1().movement().comboAllMovements().getValue().getID_Assessment(), Integer.class));
	client.addSeed(new SeedValue("PATIDTYPE", new Integer(PatIdType.CHARTNUM.getID()), Integer.class));
	
	String resultUrl = "";
	try
	{
		resultUrl = client.buildReportAsUrl(obj[0], obj[1], urlReportServer, QueryBuilderClient.PDF, "", 1);		
	} 
	catch (QueryBuilderClientException e1)
	{
		engine.showMessage("Error creating report: " + e1.getMessage());
		return;
	}
	
	engine.openUrl(resultUrl);
}
 
Example 27
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private SeedValue getSeedByName(QueryBuilderClient client, String name)
{
	if(client == null || name == null)
		return null;
	
	for (int i = 0; i < client.getSeeds().size(); i++)
	{
		SeedValue seed = (SeedValue) client.getSeeds().get(i);
		
		if(name.equalsIgnoreCase(seed.getName()))
			return seed;
	}
	return null;
}
 
Example 28
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private boolean addValueForNonMandatorySeeds(QueryBuilderClient client, ReportSeedParsedVoCollection seeds) 
{
	if(seeds == null || seeds.size() == 0)
		return true;
	
	for(int i=0; i<seeds.size(); i++)
	{
		ReportSeedParsedVo seed = seeds.get(i);
		
		if(seed == null)
			continue;
		
		if(Boolean.TRUE.equals(seed.getCanBeNull()))
		{
			if(nonMandatorySeedNotAddedToReport(seed, client))
			{
				try 
				{
					client.addSeed(new SeedValue(seed.getName(), null, Class.forName(seed.getType())));
				} 
				catch (ClassNotFoundException e) 
				{
					e.printStackTrace();
					engine.showMessage("Error building the report: " + e.getMessage());
					return false;
				}
			}
		}
	}
	
	return true;
}
 
Example 29
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
/**
* builds and Assessment report
*/
@Deprecated
public void buildAssessmentReport(ims.vo.ValueObjectRef refVo)
{
	String urlQueryServer = ConfigFlag.GEN.QUERY_SERVER_URL.getValue();
	String urlReportServer = ConfigFlag.GEN.REPORT_SERVER_URL.getValue();
	
	String obj[] = domain.getReportAndTemplate(refVo);
	
	if(obj == null)
	{
		engine.showMessage("I could not get the report and template linked to this assessment !");
		return;
	}
	
	QueryBuilderClient client = new QueryBuilderClient(urlQueryServer, engine.getSessionId());

	client.addSeed(new SeedValue("CareContext_id", form.getGlobalContext().Core.getCurrentCareContextIsNotNull() ? form.getGlobalContext().Core.getCurrentCareContext().getID_CareContext() : null, Integer.class));
	client.addSeed(new SeedValue("ClinicalContact_id", form.getGlobalContext().Core.getCurrentClinicalContactIsNotNull() ? form.getGlobalContext().Core.getCurrentClinicalContact().getID_ClinicalContact() : null, Integer.class));
	
	String resultUrl = "";
	try
	{
		resultUrl = client.buildReportAsUrlInlineFrame(obj[0], obj[1], urlReportServer, QueryBuilderClient.HTML, "", 1);
	} 
	catch (QueryBuilderClientException e1)
	{
		engine.showMessage("Error creating report: " + e1.getMessage());
		return;
	}
	
	form.htmView().setHTML(resultUrl);
}
 
Example 30
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
public void buildAssessmentReport(PatientAssessmentRefVo patientAssessmentRef)
{
	String urlQueryServer = ConfigFlag.GEN.QUERY_SERVER_URL.getValue();
	String urlReportServer = ConfigFlag.GEN.REPORT_SERVER_URL.getValue();
	
	String obj[] = domain.getReportAndTemplate(patientAssessmentRef);
	
	if (obj == null || obj.length < 2 || obj[0] == null || obj[1] == null)
	{
		engine.showMessage("I could not get the report and template linked to this assessment !");
		return;
	}
	
	QueryBuilderClient client = new QueryBuilderClient(urlQueryServer, engine.getSessionId());

	// WDEV-13300
	// PatientAssessment reports in new version use PatientAssessment_ID, but some old versions use a combination of
	// CareContext_id and ClinicalContact_id - so we need to set all tree as seeds. Reports are ignoring the extra & unused seeds
	client.addSeed(new SeedValue("PatientAssessment_id", patientAssessmentRef.getID_PatientAssessment(), Integer.class));
	client.addSeed(new SeedValue("CareContext_id", form.getGlobalContext().Core.getCurrentCareContextIsNotNull() ? form.getGlobalContext().Core.getCurrentCareContext().getID_CareContext() : null, Integer.class));
	client.addSeed(new SeedValue("ClinicalContact_id", form.getGlobalContext().Core.getCurrentClinicalContactIsNotNull() ? form.getGlobalContext().Core.getCurrentClinicalContact().getID_ClinicalContact() : null, Integer.class));
	
	String resultUrl = "";
	try
	{
		resultUrl = client.buildReportAsUrlInlineFrame(obj[0], obj[1], urlReportServer, QueryBuilderClient.HTML, "", 1);
	} 
	catch (QueryBuilderClientException e1)
	{
		engine.showMessage("Error creating report: " + e1.getMessage());
		return;
	}
	
	form.htmView().setHTML(resultUrl);
}
 
Example 31
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private boolean addValueForNonMandatorySeeds(QueryBuilderClient client, ReportSeedParsedVoCollection seeds) 
{
	if(seeds == null || seeds.size() == 0)
		return true;
	
	for(int i=0; i<seeds.size(); i++)
	{
		ReportSeedParsedVo seed = seeds.get(i);
		
		if(seed == null)
			continue;
		
		if(Boolean.TRUE.equals(seed.getCanBeNull()))
		{
			if(nonMandatorySeedNotAddedToReport(seed, client))
			{
				try 
				{
					client.addSeed(new SeedValue(seed.getName(), null, Class.forName(seed.getType())));
				} 
				catch (ClassNotFoundException e) 
				{
					e.printStackTrace();
					engine.showMessage("Error building the report: " + e.getMessage());
					return false;
				}
			}
		}
	}
	
	return true;
}
 
Example 32
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private void open()
{

	String urlQueryServer = ConfigFlag.GEN.QUERY_SERVER_URL.getValue();
	String urlReportServer = ConfigFlag.GEN.REPORT_SERVER_URL.getValue();

	Object[] obj = domain.getSystemReportAndTemplate(new Integer(325));

	if (obj == null || obj.length < 2)
	{
		engine.showMessage("I could not get the report and template !");
		return;
	}

	if (obj[0] == null || obj[1] == null)
	{
		engine.showMessage("The report has not been deployed !");
		return;
	}

	QueryBuilderClient client = new QueryBuilderClient(urlQueryServer, engine.getSessionId());

	client.addSeed(new SeedValue("NeedsAssessment_id", form.getGlobalContext().Core.getNeedsAssessmentId(), Integer.class));

	String resultUrl = "";
	try
	{
		resultUrl = client.buildReportAsUrlInlineFrame((String) obj[0], (String) obj[1], urlReportServer, "PDF", "", 1);
	}
	catch (QueryBuilderClientException e1)
	{
		engine.showMessage("Error creating report: " + e1.getMessage());
		return;
	}

	form.htmViewer().setHTML(resultUrl);
}
 
Example 33
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
protected void onGrdAuditSelectionChanged() throws PresentationLogicException
{
	form.ctnDetails().htmDetails().setHTML("");
	String fullClassName = getFullBoName(form.grdAudit().getValue().getClassName());
	
	if(fullClassName == null)
	{
		form.ctnDetails().htmDetails().setHTML("<BR><BR><BR><CENTER><STRONG>No template was linked to '" + form.grdAudit().getValue().getClassName() + "' business object !</STRONG></CENTER>");
	}
	else
	{
		ReportTemplateVo template = domain.getLinkedTemplate(fullClassName);
		
		String urlQueryServer = ConfigFlag.GEN.QUERY_SERVER_URL.getValue();
		String urlReportServer = ConfigFlag.GEN.REPORT_SERVER_URL.getValue();

		QueryBuilderClient client = new QueryBuilderClient(urlQueryServer, engine.getSessionId());

		client.addSeed(new SeedValue("ID", form.grdAudit().getValue().getClassIdentifier(), Integer.class));
		
		String resultUrl = "";
		try
		{
			resultUrl = client.buildReportAsUrlInlineFrame(template.getReport().getReportXml(), template.getTemplateXml(), urlReportServer, QueryBuilderClient.HTML, "", 1);
		} 
		catch (QueryBuilderClientException e1)
		{
			engine.showMessage("Error creating report: " + e1.getMessage());
			return;
		}
		
		form.ctnDetails().htmDetails().setHTML(resultUrl);
	}
}
 
Example 34
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
@Override
protected void onBtnPrintResultClick() throws PresentationLogicException
{
	String urlQueryServer = ConfigFlag.GEN.QUERY_SERVER_URL.getValue();
	String urlReportServer = ConfigFlag.GEN.REPORT_SERVER_URL.getValue();

	//we need a better way to do this
	Object[] obj = domain.getSystemReportAndTemplate(new Integer(75));
	
	if(obj == null || obj.length < 2)
	{
		engine.showMessage("I could not get the report and template !");
		return;
	}
	
	if(obj[0] == null || obj[1] == null)
	{
		engine.showMessage("The report has not been deployed !");
		return;
	}
	
	QueryBuilderClient client = new QueryBuilderClient(urlQueryServer, engine.getSessionId());
	
	client.addSeed(new SeedValue("OrderInvestigation_id",  form.getLocalContext().getOrderInv().getBoId(), Integer.class));
	
	String resultUrl = "";
	try
	{
		resultUrl = client.buildReportAsUrl((String)obj[0], (String)obj[1], urlReportServer, "PDF", "", 1);
	} 
	catch (QueryBuilderClientException e1)
	{
		engine.showMessage("Error creating report: " + e1.getMessage());
		return;
	}
	
	engine.openUrl(resultUrl);
}
 
Example 35
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private String buildReport()
{
	CareContextShortVo currentCareContext = form.getGlobalContext().Core.getCurrentCareContext();
	Object[] obj = null;
	QueryBuilderClient client = new QueryBuilderClient(urlQueryServer, engine.getSessionId());
	String url = "";

	Integer reportID = 163;
	obj = domain.getSystemReportAndTemplate(reportID);
	client.addSeed(new SeedValue("CARE_CONTEXT", currentCareContext.getID_CareContext(), Integer.class));

	if (obj == null || obj.length < 2)
	{
		engine.showMessage("I could not get the report and template !");
		return "";
	}

	if (obj[0] == null || obj[1] == null)
	{
		engine.showMessage("The report has not been deployed !");
		return "";
	}

	try
	{
		url = client.buildReportAsUrl((String) obj[0], (String) obj[1], urlReportServer, "PDF", "", 1);
		if (url != null)
		{
			engine.openUrl(url);
		}
	}
	catch (QueryBuilderClientException e1)
	{
		engine.showMessage("Error creating report: " + e1.getMessage());
		return "";
	}
	return "";
}
 
Example 36
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private String buildReport()
{
	CareContextShortVo currentCareContext = form.getGlobalContext().Core.getCurrentCareContext();
	Object[] obj = null;
	QueryBuilderClient client = new QueryBuilderClient(urlQueryServer, engine.getSessionId());
	String url = "";

	Integer reportID = 247;
	obj = domain.getSystemReportAndTemplate(reportID);
	client.addSeed(new SeedValue("CARE_CONTEXT", currentCareContext.getID_CareContext(), Integer.class));

	if (obj == null || obj.length < 2)
	{
		engine.showMessage("I could not get the report and template !");
		return "";
	}

	if (obj[0] == null || obj[1] == null)
	{
		engine.showMessage("The report has not been deployed !");
		return "";
	}

	try
	{
		url = client.buildReportAsUrl((String) obj[0], (String) obj[1], urlReportServer, "PDF", "", 1);
		if (url != null)
		{
			engine.openUrl(url);
		}
	}
	catch (QueryBuilderClientException e1)
	{
		engine.showMessage("Error creating report: " + e1.getMessage());
		return "";
	}
	return "";
}
 
Example 37
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private void printReport()
{
	String urlQueryServer = ConfigFlag.GEN.QUERY_SERVER_URL.getValue();
	String urlReportServer = ConfigFlag.GEN.REPORT_SERVER_URL.getValue();

	String[] obj = null;

	obj = domain.getReportAndTemplate(form.getGlobalContext().Core.getReportID(), form.getGlobalContext().Core.getTemplateID());

	if (obj == null || obj.length == 0)
	{
		engine.showMessage("Failed to retrieve the report and template !");
		return;
	}

	QueryBuilderClient client = new QueryBuilderClient(urlQueryServer, engine.getSessionId());

	client.addSeed(new SeedValue("Discharge_id", form.getLocalContext().getDischargeToUpdate() != null ? form.getLocalContext().getDischargeToUpdate().getID_Discharge() : null, Integer.class));
	client.addSeed(new SeedValue("PATIDTYPE", new Integer(PatIdType.CHARTNUM.getID()), Integer.class));

	String resultUrl = "";
	try
	{
		resultUrl = client.buildReportAsUrl(obj[0], obj[1], urlReportServer, QueryBuilderClient.PDF, "", 1);
	}
	catch (QueryBuilderClientException e1)
	{
		engine.showMessage("Error creating report: " + e1.getMessage());
		return;
	}

	engine.openUrl(resultUrl);
}
 
Example 38
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private String buildReport()
{		
	CareContextShortVo currentCareContext = form.getGlobalContext().Core.getCurrentCareContext();
	Object[] obj = null;
	QueryBuilderClient client = new QueryBuilderClient(urlQueryServer, engine.getSessionId());
	String url = "";
	
	Integer reportID = 247;
	obj = domain.getSystemReportAndTemplate(reportID);
	client.addSeed(new SeedValue("CARE_CONTEXT",  currentCareContext.getID_CareContext(), Integer.class));
	
	if(obj == null || obj.length < 2)
	{
		engine.showMessage("I could not get the report and template !");
		return "";
	}
	
	if(obj[0] == null || obj[1] == null)
	{
		engine.showMessage("The report has not been deployed !");
		return "";
	}
			
	try
	{
		url = client.buildReportAsUrlInlineFrame((String)obj[0], (String)obj[1], urlReportServer, "PDF", "", 1);
		if (url != null)
		{
			return url;
		}
	}
	catch (QueryBuilderClientException e1)
	{
		engine.showMessage("Error creating report: " + e1.getMessage());
		return "";
	}
			
	return "";
}
 
Example 39
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private String buildReport()
{		
	CareContextShortVo currentCareContext = form.getGlobalContext().Core.getCurrentCareContext();
	Object[] obj = null;
	QueryBuilderClient client = new QueryBuilderClient(urlQueryServer, engine.getSessionId());
	String url = "";
	
	Integer reportID = 217;
	obj = domain.getSystemReportAndTemplate(reportID);
	client.addSeed(new SeedValue("CareContext_id",  currentCareContext.getID_CareContext(), Integer.class));
	
	if(obj == null || obj.length < 2)
	{
		engine.showMessage("I could not get the report and template !");
		return "";
	}
	
	if(obj[0] == null || obj[1] == null)
	{
		engine.showMessage("The report has not been deployed !");
		return "";
	}
			
	try
	{
		url = client.buildReportAsUrlInlineFrame((String)obj[0], (String)obj[1], urlReportServer, "PDF", "", 1);
		if (url != null)
		{
			return url;
		}
	}
	catch (QueryBuilderClientException e1)
	{
		engine.showMessage("Error creating report: " + e1.getMessage());
		return "";
	}
			
	return "";
}
 
Example 40
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private String buildReport()
{		
	CareContextShortVo currentCareContext = form.getGlobalContext().Core.getCurrentCareContext();
	Object[] obj = null;
	QueryBuilderClient client = new QueryBuilderClient(urlQueryServer, engine.getSessionId());
	String url = "";
	
	Integer reportID = 163;
	obj = domain.getSystemReportAndTemplate(reportID);
	client.addSeed(new SeedValue("CARE_CONTEXT",  currentCareContext.getID_CareContext(), Integer.class));
	
	if(obj == null || obj.length < 2)
	{
		engine.showMessage("I could not get the report and template !");
		return "";
	}
	
	if(obj[0] == null || obj[1] == null)
	{
		engine.showMessage("The report has not been deployed !");
		return "";
	}
			
	try
	{
		url = client.buildReportAsUrlInlineFrame((String)obj[0], (String)obj[1], urlReportServer, "PDF", "", 1);
		if (url != null)
		{
			return url;
		}
	}
	catch (QueryBuilderClientException e1)
	{
		engine.showMessage("Error creating report: " + e1.getMessage());
		return "";
	}
			
	return "";
}