Stream: mapping-framework
Topic: mapping engine
David Hay (Feb 23 2019 at 18:27):
Has anyone got a mapping engine (free or not) available that can execute maps in the mapping language?
Grahame Grieve (Feb 23 2019 at 21:47):
there's a java version in the reference implementation
David Hay (Feb 24 2019 at 17:32):
Is there a description of the parameters to use?
Grahame Grieve (Feb 25 2019 at 01:08):
I don't think I've documented it well. I'll add it to my todo list
David Hay (Feb 25 2019 at 01:55):
Just a simple list of the parameters would be fine - like you had in your blog when you announced it a couple of years back - it's just I got an error using those ones, so not sure what to use...
Grahame Grieve (Feb 25 2019 at 04:03):
what was the error?
Oliver Egger (Feb 25 2019 at 07:00):
@David Hay I use the following parameters to execute a transform with the java validator:
java -jar ./org.hl7.fhir.validation.cli.jar ./qrebida.1.json -ig ./map/qr2pat1.map -transform http://ahdis.ch/fhir/mappingtutorial/qr2pat1 -output ./mapres1.xml -log ./test.log
David Hay (Feb 25 2019 at 17:18):
Thanks Oliver - I'll give that a go!
Grahame Grieve (Mar 03 2019 at 22:08):
http://wiki.hl7.org/index.php?title=Using_the_FHIR_Mapping_Language
David Hay (Mar 03 2019 at 22:48):
for the version parameter, are the options STU3, R4 & R5 the correct ones?
Grahame Grieve (Mar 03 2019 at 23:53):
no. updated the doco
David Hay (Mar 04 2019 at 01:57):
do I need to specify the map file in the command line (as per the tutorial in the spec - http://hl7.org/fhir/mapping-tutorial.html)? Or will it find it if it is in the folder specified by -ig? It's just a text file - right? ie it's not an instance of StructureMap..
David Hay (Mar 04 2019 at 01:58):
Also getting errors: Content is not allowed in prolog - but not telling me which file has the issues...
Grahame Grieve (Mar 04 2019 at 01:59):
it has to be loaded from an -ig parameter
Grahame Grieve (Mar 04 2019 at 01:59):
can you give me the stack for Content is not allowed in prolog
David Hay (Mar 04 2019 at 02:01):
FHIR Validation tool Version 3.7.5-SNAPSHOT - Built 2019-02-08T17:54:37.739+11:00 - Git f5c592fbadf9
Arguments: ./patient.json -output ./myPatient.json -transform http://hl7.org/fhir/StructureMap/tutorial -version 3.0.1 -ig ./defs -log ./out.log
.. connect to tx server @ http://tx.fhir.org
.. definitions from hl7.fhir.core#3.0.1
(v3.0.1)
+ .. load IG from ./defs
[Fatal Error] :1:1: Content is not allowed in prolog.
[Fatal Error] :1:1: Content is not allowed in prolog.
Exception in thread "main" java.lang.Error: Unable to find map http://hl7.org/fhir/StructureMap/tutorial
at org.hl7.fhir.r4.validation.ValidationEngine.transform(ValidationEngine.java:955)
at org.hl7.fhir.r4.validation.ValidationEngine.transform(ValidationEngine.java:943)
at org.hl7.fhir.r4.validation.Validator.main(Validator.java:390)
David Hay (Mar 04 2019 at 02:03):
'defs' folder has the StructureDefinition for Patient (Xml) and a textfile that has the map (pretty much a copy of the one in the tutorial)
David Hay (Mar 04 2019 at 02:03):
patient.json is a Patient instance in the same folder where I invoke the mapping from...
Grahame Grieve (Mar 04 2019 at 02:05):
what's the file name of the map?
David Hay (Mar 04 2019 at 02:07):
patientmap.txt
Grahame Grieve (Mar 04 2019 at 02:09):
the tool expects *.map not *.txt. but it will be loaded anyway - it's just trying XML first
Grahame Grieve (Mar 04 2019 at 02:27):
I released a new validator - download the new one and try again - you'll get a more useful error message
David Hay (Mar 04 2019 at 02:29):
from the r4 site?
David Hay (Mar 04 2019 at 02:29):
or continuous build..
David Hay (Mar 04 2019 at 02:32):
http://build.fhir.org/validator.zip is a 404 - I'll try again in a couple of mins...
Grahame Grieve (Mar 04 2019 at 02:32):
from the link in the documentation on that wiki page
David Hay (Mar 04 2019 at 02:32):
oh Do'h!
David Hay (Mar 04 2019 at 02:45):
this is super wierd.
It seems to think the mapping file has a .txt extension - but here's the folder contents:
davids-MacBook-Pro:defs davidhay$ ls -al
total 272
drwxr-xr-x@ 5 davidhay staff 160 4 Mar 15:27 .
drwxr-xr-x@ 10 davidhay staff 320 4 Mar 15:36 ..
-rw-r--r--@ 1 davidhay staff 6148 4 Mar 14:45 .DS_Store
-rw-r--r--@ 1 davidhay staff 318 4 Mar 14:08 mappatient.map
-rw-r--r--@ 1 davidhay staff 123876 4 Mar 14:52 patientDef.xml
(I tried renaming the map file from the command line and it still thinks it's a .txt)
Error:
FHIR Validation tool Version 3.8.0-SNAPSHOT - Built 2019-02-11T12:49:16.829-05:00 - Git 7a8671008476
Arguments: ./patient.json -output ./myPatient.json -transform http://hl7.org/fhir/StructureMap/tutorial -version 3.0.1 -ig ./defs -log ./out.log
.. connect to tx server @ http://tx.fhir.org
.. definitions from hl7.fhir.core#3.0.1
(v3.0.1)
+ .. load IG from ./defs
[Fatal Error] :1:1: Content is not allowed in prolog.
Exception in thread "main" java.lang.Exception: Error parsing mappatient.txt: Unsupported format for mappatient.txt
at org.hl7.fhir.r4.validation.ValidationEngine.loadIg(ValidationEngine.java:692)
at org.hl7.fhir.r4.validation.Validator.main(Validator.java:373)
Caused by: java.lang.Exception: Unsupported format for mappatient.txt
at org.hl7.fhir.r4.validation.ValidationEngine.loadIg(ValidationEngine.java:658)
David Hay (Mar 04 2019 at 02:45):
Think I'll go and have a cup of tea...
David Hay (Mar 04 2019 at 03:32):
tried changing the definitions folder - still the same error. reads a .map file, but thinks it's a .txt file. If I specify the file name for -ig then I still get the parsing error, but don't get the prolog error...
Grahame Grieve (Mar 04 2019 at 03:53):
I don't understand how it can be confused about the file name
David Hay (Mar 04 2019 at 03:58):
me neither... but even when I change the filename - and try a different folder - and specify the name in the command line - it still comes back as .txt. Are there any other options to specify the mapping file?
Grahame Grieve (Mar 04 2019 at 04:04):
ok I see what's happening. Will issue a new version shortly
David Hay (Mar 04 2019 at 04:29):
excellent!
Grahame Grieve (Mar 04 2019 at 04:42):
ok try again
David Hay (Mar 04 2019 at 05:09):
sorry: Exception in thread "main" org.hl7.fhir.dstu3.utils.client.EFhirClientException: Error sending Http Request: Connect to tx.fhir.org:80 timed out
David Hay (Mar 04 2019 at 05:10):
Ping works OK
Grahame Grieve (Mar 04 2019 at 05:10):
its rebooting.
David Hay (Mar 04 2019 at 05:13):
Sorry: FHIR Validation tool Version 3.8.0-SNAPSHOT - Built 2019-02-11T12:49:16.829-05:00 - Git 7a8671008476
Arguments: ./patient.json -output ./myPatient.json -transform http://hl7.org/fhir/StructureMap/tutorial -version 3.0.1 -ig ./definition
.. connect to tx server @ http://tx.fhir.org
.. definitions from hl7.fhir.core#3.0.1
(v3.0.1)
+ .. load IG from ./definition
Exception in thread "main" java.lang.Exception: Error parsing mp.txt: Unsupported format for mp.txt
David Hay (Mar 04 2019 at 05:15):
still there I'm afraid:
FHIR Validation tool Version 3.8.0-SNAPSHOT - Built 2019-02-11T12:49:16.829-05:00 - Git 7a8671008476
Arguments: ./patient.json -output ./myPatient.json -transform http://hl7.org/fhir/StructureMap/tutorial -version 3.0.1 -ig ./defs
.. connect to tx server @ http://tx.fhir.org
.. definitions from hl7.fhir.core#3.0.1
(v3.0.1)
+ .. load IG from ./defs
[Fatal Error] :1:1: Content is not allowed in prolog.
Exception in thread "main" java.lang.Exception: Error parsing map.txt: Unsupported format for map.txt
at org.hl7.fhir.r4.validation.ValidationEngine.loadIg(ValidationEngine.java:692)
at org.hl7.fhir.r4.validation.Validator.main(Validator.java:373)
Caused by: java.lang.Exception: Unsupported format for map.txt
at org.hl7.fhir.r4.validation.ValidationEngine.loadIg(ValidationEngine.java:658)
David Hay (Mar 04 2019 at 05:15):
defs folder:
davids-MacBook-Pro:mapping davidhay$ cd defs
davids-MacBook-Pro:defs davidhay$ ls -al
total 272
drwxr-xr-x@ 5 davidhay staff 160 4 Mar 15:43 .
drwxr-xr-x@ 11 davidhay staff 352 4 Mar 18:07 ..
-rw-r--r--@ 1 davidhay staff 6148 4 Mar 14:45 .DS_Store
-rw-r--r--@ 1 davidhay staff 318 4 Mar 14:08 map.map
-rw-r--r--@ 1 davidhay staff 123876 4 Mar 14:52 patientDef.xml
David Hay (Mar 04 2019 at 05:17):
btw the build date on the .jar seems old...
Grahame Grieve (Mar 04 2019 at 05:18):
@James Agnew where does 3.8.0 come from? Where does the build date come from?
Grahame Grieve (Mar 04 2019 at 05:19):
it really looks like not the latest version to me
David Hay (Mar 04 2019 at 05:21):
and the file size is exactly the same...
bummer...
David Hay (Mar 06 2019 at 17:33):
Any update?
Grahame Grieve (Mar 06 2019 at 19:16):
have you tried again? I was left unsure which version you were using.
David Hay (Mar 06 2019 at 20:42):
Yep - same error (unsupported format) - doesn't seem to be recognizing the map.map file...
output from execution:
FHIR Validation tool Version 3.8.0-SNAPSHOT - Built 2019-02-11T12:49:16.829-05:00 - Git 7a8671008476
Arguments: ./patient.json -output ./myPatient.json -transform http://hl7.org/fhir/StructureMap/tutorial -version 3.0.1 -ig ./defs
.. connect to tx server @ http://tx.fhir.org
.. definitions from hl7.fhir.core#3.0.1
(v3.0.1)
+ .. load IG from ./defs
[Fatal Error] :1:1: Content is not allowed in prolog.
Exception in thread "main" java.lang.Exception: Error parsing map.txt: Unsupported format for map.txt
mapping file is map.map in defs subfolder
(Note that after you updated the file, I downloaded from the link on the documentation page in the wiki - but filesize was unchanged...)
Last updated: Apr 12 2022 at 19:14 UTC