LinkEHR add archetype to template

I’m trying to create a template in LinkEHR using an archetype I have defined and some other archetypes taken from the openEHR repository, however I am struggling to work out how to include these in my template. I have tried “Export ADL for openEHR editor/ Template Designer”, using a archetype slot and just dragging and dropping but I am having no luck.

Is there something obvious I am missing?

Hello Savas,

To correctly define templates, linkEHR must be in “template mode”. This can be achieved by importing an OPT, creating a new template from the menu, or by selecting ‘using as template’ option from the local repository panel. Were you using any of these? In any case you should be able to export it to OPT or even OET. The option you mentioned would export to an ADL that can be used by the Template Designer

I am in template mode, I selected “New Template” from the menu.

I have also tried exporting to OPT and am still unable to import it into my template. The template tree screen just goes blank when I do this.

I have had a bit more luck with resolving an archetype slot when running LinkEHR in a Windows VM. Must be a problem with the Linux version.

Oh, good catch. I’ll take a look at it. See if you can send us the error log from the Linux version, it probably can tell us what’s going on.

java.io.FileNotFoundException: /home/savas/Downloads\openEHR-EHR-OBSERVATION.apgar.v2.adl (No such file or directory)
    at java.io.FileInputStream.open0(Native Method)
    at java.io.FileInputStream.open(FileInputStream.java:195)
    at java.io.FileInputStream.<init>(FileInputStream.java:138)
    at org.acode.adlparser.ADLParser.<init>(Unknown Source)
    at es.veratech.linkehr.studio.io.IO.loadADL(Unknown Source)
    at es.veratech.linkehr.studio.io.IO.loadADL(Unknown Source)
    at arbolDefinicion.views.GenericTree$17.run(GenericTree.java:1345)
    at org.eclipse.jface.action.Action.runWithEvent(Action.java:473)
    at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:565)
    at org.eclipse.jface.action.ActionContributionItem.lambda$4(ActionContributionItem.java:397)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:86)
    at org.eclipse.swt.widgets.Display.sendEvent(Display.java:5686)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1370)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4940)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:4518)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1170)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1059)
    at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:153)
    at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:667)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:597)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148)
    at linkEHR_RCP.Application.start(Application.java:23)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:656)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:592)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1498)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1471)

The file is there with read permissions for all - although that backslash is a little suspicious.

Yes, definetly is caused by that. Shouldn’t be hard to fix in any case