Commit b4b07429 authored by Marco Descher's avatar Marco Descher
Browse files

[11238] ITask#getResultEntryAsTypedList and multiple other changes

parent 40d49fcc
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -253,8 +253,8 @@ public class BillLabResultOnCreationIdentifiedRunnable implements IIdentifiedRun
	}
	
	@Override
	public Map<String, String> getDefaultRunContext(){
		Map<String, String> defaultRunContext = new HashMap<>();
	public Map<String, Serializable> getDefaultRunContext(){
		Map<String, Serializable> defaultRunContext = new HashMap<>();
		defaultRunContext.put(RunContextParameter.IDENTIFIABLE_ID,
			RunContextParameter.VALUE_MISSING_REQUIRED);
		defaultRunContext.put(Parameters.ADDCONS_SAMEDAY, Boolean.TRUE.toString());
+7 −7
Original line number Diff line number Diff line
@@ -75,12 +75,12 @@ public class HL7ImporterIIdentifiedRunnable implements IIdentifiedRunnable {
	}

	@Override
	public Map<String, String> getDefaultRunContext() {
		Map<String, String> defaultRunContext = new HashMap<>();
	public Map<String, Serializable> getDefaultRunContext() {
		Map<String, Serializable> defaultRunContext = new HashMap<>();
		defaultRunContext.put(RunContextParameter.STRING_URL, RunContextParameter.VALUE_MISSING_REQUIRED);
		defaultRunContext.put(RCP_BOOLEAN_CREATE_PATIENT_IF_NOT_EXISTS, Boolean.toString(false));
		defaultRunContext.put(RCP_BOOLEAN_CREATE_LABORATORY_IF_NOT_EXISTS, Boolean.toString(true));
		defaultRunContext.put(RCP_BOOLEAN_MOVE_FILE_AFTER_IMPORT, Boolean.toString(true));
		defaultRunContext.put(RCP_BOOLEAN_CREATE_PATIENT_IF_NOT_EXISTS, Boolean.FALSE);
		defaultRunContext.put(RCP_BOOLEAN_CREATE_LABORATORY_IF_NOT_EXISTS, Boolean.TRUE);
		defaultRunContext.put(RCP_BOOLEAN_MOVE_FILE_AFTER_IMPORT, Boolean.TRUE);
		defaultRunContext.put(RCP_STRING_IMPORTER_LABNAME, "myLab");
		return defaultRunContext;
	}
@@ -89,8 +89,8 @@ public class HL7ImporterIIdentifiedRunnable implements IIdentifiedRunnable {
	public Map<String, Serializable> run(Map<String, Serializable> context, IProgressMonitor progressMonitor,
			Logger logger) throws TaskException {

		boolean bCreateLaboratoryIfNotExists = Boolean.valueOf((String) context.get(RCP_BOOLEAN_CREATE_LABORATORY_IF_NOT_EXISTS));
		boolean bMoveFile = Boolean.valueOf((String) context.get(RCP_BOOLEAN_MOVE_FILE_AFTER_IMPORT));
		boolean bCreateLaboratoryIfNotExists = (boolean) context.get(RCP_BOOLEAN_CREATE_LABORATORY_IF_NOT_EXISTS);
		boolean bMoveFile = (boolean) context.get(RCP_BOOLEAN_MOVE_FILE_AFTER_IMPORT);
		String urlString = (String) context.get(RunContextParameter.STRING_URL);
		String labName = (String) context.get(RCP_STRING_IMPORTER_LABNAME);

+19 −2
Original line number Diff line number Diff line
@@ -46,7 +46,7 @@
      </eAnnotations>
      <eGenericType eClassifier="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EMap">
        <eTypeArguments eClassifier="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
        <eTypeArguments eClassifier="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
        <eTypeArguments eClassifier="#//Serializable"/>
      </eGenericType>
    </eStructuralFeatures>
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="triggerType" eType="#//TaskTriggerType"
@@ -78,6 +78,18 @@
    <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
      <details key="documentation" value="A running instance of an ITaskDescriptor."/>
    </eAnnotations>
    <eOperations name="getResultEntryAsTypedList">
      <eGenericType eClassifier="ecore:EClass ../../ch.elexis.core/model/types.ecore#//List">
        <eTypeArguments eTypeParameter="#//ITask/getResultEntryAsTypedList/T"/>
      </eGenericType>
      <eTypeParameters name="T"/>
      <eParameters name="key" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
      <eParameters name="clazz">
        <eGenericType eClassifier="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EJavaClass">
          <eTypeArguments eTypeParameter="#//ITask/getResultEntryAsTypedList/T"/>
        </eGenericType>
      </eParameters>
    </eOperations>
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="id" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"
        changeable="false" iD="true"/>
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="state" lowerBound="1" eType="#//TaskState"
@@ -220,8 +232,13 @@
    <eLiterals name="IN_PROGRESS" value="20"/>
    <eLiterals name="CANCELLED" value="30"/>
    <eLiterals name="ON_HOLD" value="40"/>
    <eLiterals name="FAILED" value="90"/>
    <eLiterals name="COMPLETED" value="50"/>
    <eLiterals name="COMPLETED_WARN" value="55" literal="COMPLETED_WARN">
      <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
        <details key="documentation" value="The task completed successfully, but not flawless. I.e. there were warnings somebody should consider."/>
      </eAnnotations>
    </eLiterals>
    <eLiterals name="FAILED" value="90"/>
  </eClassifiers>
  <eClassifiers xsi:type="ecore:EEnum" name="OwnerTaskNotification">
    <eLiterals name="NEVER"/>
+7 −1
Original line number Diff line number Diff line
@@ -21,8 +21,9 @@
      <genEnumLiterals ecoreEnumLiteral="model.ecore#//TaskState/IN_PROGRESS"/>
      <genEnumLiterals ecoreEnumLiteral="model.ecore#//TaskState/CANCELLED"/>
      <genEnumLiterals ecoreEnumLiteral="model.ecore#//TaskState/ON_HOLD"/>
      <genEnumLiterals ecoreEnumLiteral="model.ecore#//TaskState/FAILED"/>
      <genEnumLiterals ecoreEnumLiteral="model.ecore#//TaskState/COMPLETED"/>
      <genEnumLiterals ecoreEnumLiteral="model.ecore#//TaskState/COMPLETED_WARN"/>
      <genEnumLiterals ecoreEnumLiteral="model.ecore#//TaskState/FAILED"/>
    </genEnums>
    <genEnums typeSafeEnumCompatible="false" ecoreEnum="model.ecore#//OwnerTaskNotification">
      <genEnumLiterals ecoreEnumLiteral="model.ecore#//OwnerTaskNotification/NEVER"/>
@@ -68,6 +69,11 @@
      <genFeatures property="Readonly" createChild="false" ecoreFeature="ecore:EAttribute model.ecore#//ITask/runContext"/>
      <genFeatures property="Readonly" createChild="false" ecoreFeature="ecore:EAttribute model.ecore#//ITask/finished"/>
      <genFeatures property="Readonly" createChild="false" ecoreFeature="ecore:EAttribute model.ecore#//ITask/descriptorId"/>
      <genOperations ecoreOperation="model.ecore#//ITask/getResultEntryAsTypedList">
        <genParameters ecoreParameter="model.ecore#//ITask/getResultEntryAsTypedList/key"/>
        <genParameters ecoreParameter="model.ecore#//ITask/getResultEntryAsTypedList/clazz"/>
        <genTypeParameters ecoreTypeParameter="model.ecore#//ITask/getResultEntryAsTypedList/T"/>
      </genOperations>
    </genClasses>
    <genClasses image="false" ecoreClass="model.ecore#//ITaskService">
      <genOperations ecoreOperation="model.ecore#//ITaskService/createTaskDescriptor">
+11 −4
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@ import ch.elexis.core.model.Identifiable;
import java.io.Serializable;

import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;

import org.eclipse.core.runtime.IProgressMonitor;
@@ -129,10 +130,7 @@ public interface ITask extends Identifiable, Deleteable {
	/**
	 * Returns the value of the '<em><b>Result</b></em>' attribute.
	 * <!-- begin-user-doc -->
	 * <p>
	 * If the meaning of the '<em>Result</em>' attribute isn't clear,
	 * there really should be more of a description here...
	 * </p>
	 * Result is de-serialized out of a json string. Numeric entries are always returned as doubles.
	 * <!-- end-user-doc -->
	 * @return the value of the '<em>Result</em>' attribute.
	 * @see ch.elexis.core.tasks.model.ModelPackage#getITask_Result()
@@ -201,4 +199,13 @@ public interface ITask extends Identifiable, Deleteable {
	 */
	String getDescriptorId();

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @model type="ch.elexis.core.types.List&lt;T&gt;" many="false"
	 * @generated
	 */
	<T> List<T> getResultEntryAsTypedList(String key, Class<T> clazz);


} // ITask
Loading