// Path: api/src/main/java/org/openmrs/module/hl7query/HL7Template.java
// public class HL7Template extends BaseOpenmrsMetadata implements OpenmrsMetadata {
// 	
// 	private Integer hl7TemplateId;
// 
// 	private String hl7Entity;
// 	
// 	private String language = HL7QueryService.LANGUAGE_GROOVY;
// 	
// 	private String template;
// 	
// 	/**
// 	 * @see org.openmrs.OpenmrsObject#getId()
// 	 */
// 	@Override
// 	public Integer getId() {
// 		return getHl7TemplateId();
// 	}
// 	
// 	/**
// 	 * @see org.openmrs.OpenmrsObject#setId(java.lang.Integer)
// 	 */
// 	@Override
// 	public void setId(Integer id) {
// 		setHl7TemplateId(id);
// 	}
// 	
// 	/**
// 	 * @return the hl7TemplateId
// 	 */
// 	public Integer getHl7TemplateId() {
// 		return hl7TemplateId;
// 	}
// 	
// 	/**
// 	 * @param hl7TemplateId the hl7TemplateId to set
// 	 */
// 	public void setHl7TemplateId(Integer hl7TemplateId) {
// 		this.hl7TemplateId = hl7TemplateId;
// 	}
// 		
// 	/**
// 	 * @return the hl7Entity
// 	 */
// 	public String getHl7Entity() {
// 		return hl7Entity;
// 	}
// 	
// 	/**
// 	 * @param hl7Entity the hl7Entity to set
// 	 */
// 	public void setHl7Entity(String hl7Entity) {
// 		this.hl7Entity = hl7Entity;
// 	}
// 	
// 	/**
// 	 * @return the language
// 	 */
// 	public String getLanguage() {
// 		return language;
// 	}
// 	
// 	/**
// 	 * @param language the language to set
// 	 */
// 	public void setLanguage(String language) {
// 		this.language = language;
// 	}
// 	
// 	/**
// 	 * @return the template
// 	 */
// 	public String getTemplate() {
// 		return template;
// 	}
// 	
// 	/**
// 	 * @param template the template to set
// 	 */
// 	public void setTemplate(String template) {
// 		this.template = template;
// 	}
// 	
// }
// 
// Path: api/src/main/java/org/openmrs/module/hl7query/util/HL7QueryPrivilegeConstants.java
// public class HL7QueryPrivilegeConstants {
// 	@AddOnStartup(description = "Ability to Add, Edit or Delete HL7 templates")
// 	public static final String MANAGE_HL7_TEMPLATES = "Manage HL7 Templates";
// 
// 	@AddOnStartup(description = "Ability to get, find or View HL7 templates")
// 	public static final String GET_HL7_TEMPLATES = "Get HL7 Templates";
// 	
// }


import java.util.List;
import java.util.Map;
import org.openmrs.annotation.Authorized;
import org.openmrs.api.OpenmrsService;
import org.openmrs.module.hl7query.HL7Template;
import org.openmrs.module.hl7query.util.HL7QueryPrivilegeConstants;
import org.openmrs.util.PrivilegeConstants;
import org.springframework.transaction.annotation.Transactional;
/**
 * The contents of this file are subject to the OpenMRS Public License
 * Version 1.0 (the "License"); you may not use this file except in
 * compliance with the License. You may obtain a copy of the License at
 * http://license.openmrs.org
 *
 * Software distributed under the License is distributed on an "AS IS"
 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
 * License for the specific language governing rights and limitations
 * under the License.
 *
 * Copyright (C) OpenMRS, LLC.  All Rights Reserved.
 */
package org.openmrs.module.hl7query.api;



/**
 * This service exposes module's core functionality. It is a Spring managed bean which is configured in moduleApplicationContext.xml.
 * <p>
 * It can be accessed only via Context:<br>
 * <code>
 * Context.getService(HL7QueryService.class).someMethod();
 * </code>
 * 
 * @see org.openmrs.api.context.Context
 */

@Transactional
public interface HL7QueryService extends OpenmrsService {
	
	static final String LANGUAGE_GROOVY = "groovy";

	/**
	 * Evaluates the given template against the given bindings, returning the text result (which should be XML) 
	 * 
	 * @param hl7Template
	 * @param bindings
	 * @return the result of evaluating the given template against the given bindings
	 */
	String evaluateTemplate(HL7Template hl7Template, Map<String, Object> bindings);
	
	/**
	 * Gets HL7Template by ID.
	 * 
	 * @param id
	 * @return HL7Template or null
	 * @should return template if exists
	 * @should return null if does not exist
	 */
	@Transactional(readOnly = true)
// Path: api/src/main/java/org/openmrs/module/hl7query/HL7Template.java
// public class HL7Template extends BaseOpenmrsMetadata implements OpenmrsMetadata {
// 	
// 	private Integer hl7TemplateId;
// 
// 	private String hl7Entity;
// 	
// 	private String language = HL7QueryService.LANGUAGE_GROOVY;
// 	
// 	private String template;
// 	
// 	/**
// 	 * @see org.openmrs.OpenmrsObject#getId()
// 	 */
// 	@Override
// 	public Integer getId() {
// 		return getHl7TemplateId();
// 	}
// 	
// 	/**
// 	 * @see org.openmrs.OpenmrsObject#setId(java.lang.Integer)
// 	 */
// 	@Override
// 	public void setId(Integer id) {
// 		setHl7TemplateId(id);
// 	}
// 	
// 	/**
// 	 * @return the hl7TemplateId
// 	 */
// 	public Integer getHl7TemplateId() {
// 		return hl7TemplateId;
// 	}
// 	
// 	/**
// 	 * @param hl7TemplateId the hl7TemplateId to set
// 	 */
// 	public void setHl7TemplateId(Integer hl7TemplateId) {
// 		this.hl7TemplateId = hl7TemplateId;
// 	}
// 		
// 	/**
// 	 * @return the hl7Entity
// 	 */
// 	public String getHl7Entity() {
// 		return hl7Entity;
// 	}
// 	
// 	/**
// 	 * @param hl7Entity the hl7Entity to set
// 	 */
// 	public void setHl7Entity(String hl7Entity) {
// 		this.hl7Entity = hl7Entity;
// 	}
// 	
// 	/**
// 	 * @return the language
// 	 */
// 	public String getLanguage() {
// 		return language;
// 	}
// 	
// 	/**
// 	 * @param language the language to set
// 	 */
// 	public void setLanguage(String language) {
// 		this.language = language;
// 	}
// 	
// 	/**
// 	 * @return the template
// 	 */
// 	public String getTemplate() {
// 		return template;
// 	}
// 	
// 	/**
// 	 * @param template the template to set
// 	 */
// 	public void setTemplate(String template) {
// 		this.template = template;
// 	}
// 	
// }
// 
// Path: api/src/main/java/org/openmrs/module/hl7query/util/HL7QueryPrivilegeConstants.java
// public class HL7QueryPrivilegeConstants {
// 	@AddOnStartup(description = "Ability to Add, Edit or Delete HL7 templates")
// 	public static final String MANAGE_HL7_TEMPLATES = "Manage HL7 Templates";
// 
// 	@AddOnStartup(description = "Ability to get, find or View HL7 templates")
// 	public static final String GET_HL7_TEMPLATES = "Get HL7 Templates";
// 	
// }


// Path: api/src/main/java/org/openmrs/module/hl7query/api/HL7QueryService.java
import java.util.List;
import java.util.Map;
import org.openmrs.annotation.Authorized;
import org.openmrs.api.OpenmrsService;
import org.openmrs.module.hl7query.HL7Template;
import org.openmrs.module.hl7query.util.HL7QueryPrivilegeConstants;
import org.openmrs.util.PrivilegeConstants;
import org.springframework.transaction.annotation.Transactional;

/**
 * The contents of this file are subject to the OpenMRS Public License
 * Version 1.0 (the "License"); you may not use this file except in
 * compliance with the License. You may obtain a copy of the License at
 * http://license.openmrs.org
 *
 * Software distributed under the License is distributed on an "AS IS"
 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
 * License for the specific language governing rights and limitations
 * under the License.
 *
 * Copyright (C) OpenMRS, LLC.  All Rights Reserved.
 */
package org.openmrs.module.hl7query.api;



/**
 * This service exposes module's core functionality. It is a Spring managed bean which is configured in moduleApplicationContext.xml.
 * <p>
 * It can be accessed only via Context:<br>
 * <code>
 * Context.getService(HL7QueryService.class).someMethod();
 * </code>
 * 
 * @see org.openmrs.api.context.Context
 */

@Transactional
public interface HL7QueryService extends OpenmrsService {
	
	static final String LANGUAGE_GROOVY = "groovy";

	/**
	 * Evaluates the given template against the given bindings, returning the text result (which should be XML) 
	 * 
	 * @param hl7Template
	 * @param bindings
	 * @return the result of evaluating the given template against the given bindings
	 */
	String evaluateTemplate(HL7Template hl7Template, Map<String, Object> bindings);
	
	/**
	 * Gets HL7Template by ID.
	 * 
	 * @param id
	 * @return HL7Template or null
	 * @should return template if exists
	 * @should return null if does not exist
	 */
	@Transactional(readOnly = true)
	@Authorized({HL7QueryPrivilegeConstants.GET_HL7_TEMPLATES})