Giter Site home page Giter Site logo

Comments (7)

grahamegrieve avatar grahamegrieve commented on May 27, 2024 1

stinking Java is awful at reading dates.... Let's see if the next release (32 - 31 is already in process) fixes this :-(

from org.hl7.fhir.core.

grahamegrieve avatar grahamegrieve commented on May 27, 2024

resolved - someone else ran into the same problem and tested 33 for me.

from org.hl7.fhir.core.

JohannesOehm avatar JohannesOehm commented on May 27, 2024

Unfortunatly, this is not true for me, I compiled version 33 and still got the issue.

I did some deeper digging and after some time I discovered that the way SimpleDateFormat is parsing month and weekday names is dependending on the language setting of the system. Because my computer's language is set to German, those month and weekday names are different and the parsing fails. Adding Locale.ENGLISH to the SimpleDateFormat in org.hl7.fhir.utilities.cache.PackageCacheManager#readDate resolved this issue for me.

Now, I'm experiencing another issue: Exception in thread "main" org.hl7.fhir.exceptions.FHIRException: Unable to find the package source for 'hl7.fhir.core#4.0.1' at http://hl7.org/fhir/R4/package.tgz. Is this related or should I create another ticket for this?

from org.hl7.fhir.core.

grahamegrieve avatar grahamegrieve commented on May 27, 2024

well, thanks. Stupid Java. I updated that code and looked at every use of SimpleDateFormat.

The other issue is not related. But it would be useful if you trace the source of hl7.fhir.core... it should not be used any more

from org.hl7.fhir.core.

JohannesOehm avatar JohannesOehm commented on May 27, 2024

It is coming from org/hl7/fhir/r4/validation/Validator.java, line 256 and is the default value in case the defn parameter is not defined.

from org.hl7.fhir.core.

grahamegrieve avatar grahamegrieve commented on May 27, 2024

from org.hl7.fhir.core.

JohannesOehm avatar JohannesOehm commented on May 27, 2024

Ah okay, I thought I'd have to use the R4 version because I'm working with R4 resources. Now, with the R5 Validator class, validation finally works. Thank You!

However, what I'm actually trying to accomplish is testing the FHIR mapping language. For the moment, I copied the script from https://www.hl7.org/fhir/patient-version-maps.html and tried to invoke the validator with C:\Users\oehmj\IdeaProjects\org.hl7.fhir.core>java -cp C:\Users\\oehmj\IdeaProjects\org.hl7.fhir.core\org.hl7.fhir.validation.cli\target\org.hl7.fhir.validation.cli-4.1.36-SNAPSHOT.jar org.hl7.fhir.r5.validation.Validator patient.fhir.json -version 4.0.1 -ig C:\Use rs\oehmj\VSCodeProjects\fhir-mapping\test.map -log out.txt -transform http://hl7.org/fhir/StructureMap/Patient4to3 -output result

FHIR Validation tool Version 4.1.36-SNAPSHOT (Git# 3f25f96aca65). Built 2019-12-20T10:31:52.134+01:00 (4 hours old)
Detected Java version: 1.8.0_231 from C:\Program Files\Java\jdk1.8.0_231\jre on amd64 (64bit). 2711MB available
Arguments: patient.fhir.json -version 4.0.1 -ig C:\Users\oehmj\VSCodeProjects\fhir-mapping\test.map -log out.txt -transform http://hl7.org/fhir/StructureMap/Patient4to3 -output result
Directories: Current = C:\Users\oehmj\IdeaProjects\org.hl7.fhir.core, Package Cache = C:\Users\oehmj\.fhir\packages
  .. FHIR Version 4.0, definitions from hl7.fhir.r4.core#4.0.1
  .. connect to tx server @ http://tx.fhir.org
    (v4.0.1)
+  .. load IG from C:\Users\oehmj\VSCodeProjects\fhir-mapping\test.map
* load file: C:\Users\oehmj\VSCodeProjects\fhir-mapping\test.txt - ignored due to error:  (null - NPE)
Exception in thread "main" java.lang.Error: Unable to find map http://hl7.org/fhir/StructureMap/Patient4to3 (Known Maps = [http://hl7.org/fhir/StructureMap/supplyrequest-transform, supplyrequest-transform, http://hl7.org/fhir/StructureMap/example|0.1, http://hl7.or
g/fhir/StructureMap/example, example])
        at org.hl7.fhir.r5.validation.ValidationEngine.transform(ValidationEngine.java:1230)
        at org.hl7.fhir.r5.validation.ValidationEngine.transform(ValidationEngine.java:1220)
        at org.hl7.fhir.r5.validation.Validator.main(Validator.java:592)

The NPE mentioned in the log, which causes the validator to ignore the map file is caused by the r5....ValidationEngine#loadResourceByVersion-method creating a r4...StructureMapUtilities-Instance with null as constructur parameter for the worker-context.

I'm not sure if this is a bug or I'm just invoking the tool with the wrong command line parameters. Can You help me with this?

from org.hl7.fhir.core.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.