Giter Site home page Giter Site logo

org.hl7.fhir.core's People

Contributors

ahenket avatar alexzautke avatar balhoff avatar brianpos avatar brynrhodes avatar darthgizka avatar dependabot[bot] avatar dksharma avatar dotasek avatar gabriel0316 avatar grahamegrieve avatar hosanai avatar itaygoren avatar jamesagnew avatar jkiddo avatar lmckenzi avatar lschmierer avatar markiantorno avatar nsolooki avatar oliveregger avatar patrick-werner avatar paul-robson-validic avatar pieter-edelman-nictiz avatar rettema avatar rhausam avatar tadgh avatar tobiasgirardet avatar vadi2 avatar vassilpeytchev avatar vilaug avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

org.hl7.fhir.core's Issues

StructureMap parser sets rule name with double quotes

Parsing Rule names keeps the double quotes for the rule names which is not valid for a rule name: StructureMap/ActivityDefinition3to4:

group ActivityDefinitionDynamicValue(source src, target tgt) extends BackboneElement {
  src.path -> tgt.path;
  src as vs where vs.type.exists().not() -> tgt.expression = create('Expression') as vt then {
    vs.description -> vt.description;
    vs.language -> vt.language;
    vs.expression -> vt.expression;
  } "expression";
}

lets to a validation error after parsing:
StructureMap.group[3].rule[2].name error id value '"expression"' is not valid.

will provide a pull request / testcase

Off-by-one error in location fhirpath from validator + wrong line #'s

In the given ImplementationGuide resource, when validated as STU3:

java -jar org.hl7.fhir.validator.jar -version 3.0 'swedishnationalmedicationlist.json'

swedishnationalmedicationlist.zip

The following warnings are returned:

  Warning @ ImplementationGuide.page.page[1].format (line 199, col16) : ValueSet http://hl7.org/fhir/ValueSet/mimetypes not found
  Warning @ ImplementationGuide.page.page[2].format (line 199, col16) : ValueSet http://hl7.org/fhir/ValueSet/mimetypes not found
  Warning @ ImplementationGuide.page.page[3].format (line 199, col16) : ValueSet http://hl7.org/fhir/ValueSet/mimetypes not found
  Warning @ ImplementationGuide.page.page[4].format (line 199, col16) : ValueSet http://hl7.org/fhir/ValueSet/mimetypes not f

The page numbers are off by one - it should be page, page[1], page[2] and page[3]

The line numbers are also wrong - they're all at line 199.

This is using 3.8.7.

Remove hapi dependencies

Remove hapi dependencies

fhir core validation and cli validation are depending on:

<dependency>
    <groupId>ca.uhn.hapi.fhir</groupId>
    <artifactId>hapi-fhir-structures-r4</artifactId>
    <scope>test</scope>
</dependency>
<dependency>
    <groupId>ca.uhn.hapi.fhir</groupId>
    <artifactId>hapi-fhir-validation-resources-r4</artifactId>
    <scope>test</scope>
</dependency>

Running the tool Validator.java doesn't yield results when trying to convert from stu3 to R4

Hi,
Currently we are looking for Fhir -> Fhir convertor as well as Fhir -> Native(proprietory formats) convertors . We want to host the Fhir server and are currently in process of evaluating different options preferably in java to solve this . We did explore the experimental version of Hapi Fhir convertors .
But this option using stucturedModels and Maps ( using Fhir mapping language) looks more promising since it allows conversion using maps ( which I think can be customized but most of them are out of the box available ) .

I followed the instructions mentioned in the confluence page https://confluence.hl7.org/display/FHIR/Using+the+FHIR+Validator#UsingtheFHIRValidator-VersionConversion
While trying to convert from version 3.0 to 4.0 version it keeps giving me the attached error .
Stu3_to_R4_Conversion_Error_using_Maps.txt

The input to the file is also attached..
fhir_condition_epic_stu3_searched.txt

Also I see that while running the tool I see it tries to connect to the server http://tx.fhir.org to download the version definitions . Is this a one time thing ? I am assuming when it is actually used as a server this call happens only the first time and then cached ? Is my assumption correct ?

Any help on these topics is greatly appreciated !

Thanks..

Validator: support FHIR version in canonical URL

The FHIR spec describes at a few places the use of a FHIR version inside the canonical URL. (http://hl7.org/fhir/versioning.html#mp-version and http://hl7.org/fhir/versions.html#extensions.) This is about providing FHIR versioning inside instances when there is no wrapping envelope to carry a mime-type version parameter.

Although the spec mentioned this as last resort, it is part of the FHIR spec. Therefore, it would be nice if the validator can handle this.

A possible concern may be which FHIR version should be chosen by the validator, the FHIR version in the canonical or the version given in the context?

https://chat.fhir.org/#narrow/stream/179166-implementers/topic/Version.20specifc.20profile.20-.20validation

add Validation Support for @default slice

Currently the validator doesn't support @default slices and throws errors like:

Error @ Patient.identifier[0] (line 6, col14) : Could not match discriminator ([system]) for slice Patient.identifier:@default in profile https://fhir.example.de/StructureDefinition/Patient - the discriminator [system] does not have fixed value, binding or existence assertions

https://chat.fhir.org/#narrow/stream/179177-conformance/topic/.40default.20slice.20not.20supported.20(yet).3F

NullPointerException when code validation reports an error

The line below will trigger an NPE because s.getErrorClass() always returns null.
This is because the call to context.validateCode(...) creates the ValidationResult object with this constructor public ValidationResult(IssueSeverity severity, String message, ConceptDefinitionComponent definition) and this does not initialise the errorClass field.

The upshot of this is that the validator produces the message:
Error null validating Coding

Validator web client has wrong web port :8080 instead of default 8081

Port 8081 is used as a GUI_FRONT_END_PORT inside ValidatorGui class

Where the client specifies 8080 in the address for the validator REST endpoint

xhr.open("POST", 'http://localhost:8080/' + 'validate', true);

hence, rendering all API hits unreachable.

Is there a way to configurate the port?

problem with "empty is type" operator evaluation

This originally came from: https://chat.fhir.org/#narrow/stream/179266-fhirpath/topic/Confused.20about.20is.20operator

Let's say I have an Observation like the one below:

Observation
  id: xyz

I then run a FHIRPath expression against it

issued is instant

From my understanding of http://hl7.org/fhirpath/2018Sep/index.html#is-type-specifier, since issued is empty, then this whole expression will evaluate to an empty collection.
Is my understanding correct?
The reason I ask is when I try this with the HAPI FHIRPath engine, it results in false

Need sequence diagrams for the Validator tool

Hi,
I am trying to evaluate this tool to realize some fhir -> fhir and fhir -> native converstions. We really like this concept of being able to do this through maps written in fhir mapping langauge .
We are trying to evalute this tool in terms of its performance hence it would be great if we could get hold of some sequence digrams on the flow when the tool is run.
On running locally I see it tries to connect to server http://tx.fhir.org for some code validation. Need to understand this and the completely flow that will give us confidence in going forward with this tool for our fhir conversion.

Any help on this is greatly appreciated !

Thanks

Validation fails on nested slicing

If I create a profile on Observation where I slice .component on value/code.coding.code, add a slice 'component1' and then again slice the component1.coding on value/code, the validator fails with the following error message:

 Error @ Observation.component (line xx, col yy) : Error in discriminator at Observation.component:component1.code.coding: slicing found

See the attached example profile + instance. The issue occurs both with FHIR version 3.0.1 and 4.0.0

Test profile + instance

Fix Broken Validator Version Flag

If I call the validator with:

java -jar validator.jar -version 4.0.1 -ig ig.pack examples

It tries to detect the FHIR version from the IG name ig.pack but can't. So it uses the default with is null. The earlier detected version is overridden with null. The validator crashes.

If I however call it like this:

java -jar validator.jar -ig ig.pack -version 4.0.1 examples

The version is taken from the version flag because it comes after the detection from the IG flag.

Overwritten code display values are not recognised

In the attached zip (medicalintelligence-minimal.zip) has a ValueSet that customises the display values of a code, but the validator doesn't pick up on it:

Selection_096

Example:

{
        "resourceType": "Condition",
        "id": "F1424AC8CAAD8DA7115BC0A6ECBC53B26E220AEAA275BC07C802ED61158C9C32",
        "meta": {
          "profile": [
            "http://medicalintelligence.info/fhir/StructureDefinition/mi-condition"
          ]
        },
        "identifier": [
          {
            "system": "https://metadata.erasmusmc.nl/ids/HixDiagnose",
            "value": "0001395065"
          }
        ],
        "clinicalStatus": "active",
        "category": [
          {
            "coding": [
              {
                "system": "http://snomed.info/sct",
                "code": "282291009",
                "display": "Diagnosis"
              }
            ],
            "text": "Diagnose"
          }
        ],
        "code": {
          "coding": [
            {
              "system": "http://hl7.org/fhir/sid/icd-10-nl",
              "code": "B95-B98",
              "display": "Bacteriรซle, virale en overige infectieuze agentia"
            }
          ]
        },
        "subject": {
          "reference": "http://localhost:4080/Patient/AAB9ECC1F68F51DAC75B856CA569B07A179089C2FCCAC5D6F281B1498CEFE3D3"
        },
        "onsetPeriod": {
          "start": "2017-07-03T00:00:00+02:00"
        },
        "asserter": {
          "reference": "http://localhost:4080/Practitioner/67BBF158E5B0851F978106529C2F6F3B6BDF32F1608213DBA664BC6C517E42D2"
        }
      }

Overly zealous validation of CodeSystem.valueSet definition

The InstanceValidator imposes the following rules on the default "all codes in the system" ValueSet of a CodeSystem:

vs.hasCompose() && !vs.hasExpansion(), "CodeSystem "+url+" has a 'all system' value set of "+vsu+", but it is an expansion"
Why is no expansion allowed? We stumbled across this because we include the valueset-unclosed extension by default, and this extension goes on the expansion element.

vs.getCompose().getInclude().size() == 1, "CodeSystem "+url+" has a 'all system' value set of "+vsu+", but doesn't have a single include"
This might be a problem in case the CodeSystem is some kind of composite as is commonly seen with OWL-based terminologies. Granted a canonical "all codes" ValueSet definition should only require a single include that specifies the system URI (and possibly the version as well), but there may be other semantically equivalent definitions that convey useful information to a person.

vs.getCompose().getInclude().get(0).getSystem().equals(url), "CodeSystem "+url+" has a 'all system' value set of "+vsu+", but doesn't have a matching system ("+vs.getCompose().getInclude().get(0).getSystem()+")"
See point above.

!vs.getCompose().getInclude().get(0).hasValueSet() && !vs.getCompose().getInclude().get(0).hasConcept() && !vs.getCompose().getInclude().get(0).hasFilter(), "CodeSystem "+url+" has a 'all system' value set of "+vsu+", but the include has extra details"
Again, we ran into this because we included an explicit filter condition with the SNOMED ECL expression "*". Why should validation exclude this possibility?

Java validator doesn't find R4 package

Doesn't seem to work with R4, works ok with STU3:

FHIR Validation tool Version 3.8.11-SNAPSHOT - Built 2019-07-05T21:44:08.770Z - Git da4fc1f8602e
Arguments: -version 4.0 -ig . sample.json
  .. connect to tx server @ http://tx.fhir.org
  .. definitions from hl7.fhir.core#4.0
Exception in thread "main" org.hl7.fhir.exceptions.FHIRException: Unable to resolve version 4.0 for package hl7.fhir.core
	at org.hl7.fhir.utilities.cache.PackageCacheManager.loadPackage(PackageCacheManager.java:634)
	at org.hl7.fhir.r5.validation.ValidationEngine.resolvePackage(ValidationEngine.java:587)

R3 to R4 conversions fail saying Encounter.reasonCode is an invalid property

Edit: Added file with encounter resource that reproduces the problem
encounter.txt

When using StructureMaps to convert STU3 to R4, the conversion fails with an exception. It succeeds when using native conversion.

Command line:
java -jar org.hl7.fhir.validator.jar encounter.in.xml -version 3.0 -to-version 4.0.1 -output encounter.out.xml

org.hl7.fhir.exceptions.FHIRException: Exception executing transform tgt.reasonCode = create() as vvv on Rule "reason": Attempt to get types for an invalid property 'reasonCode' on type Encounter
at org.hl7.fhir.r5.utils.StructureMapUtilities.runTransform(StructureMapUtilities.java:1954)
at org.hl7.fhir.r5.utils.StructureMapUtilities.processTarget(StructureMapUtilities.java:1825)
at org.hl7.fhir.r5.utils.StructureMapUtilities.executeRule(StructureMapUtilities.java:1412)
at org.hl7.fhir.r5.utils.StructureMapUtilities.executeGroup(StructureMapUtilities.java:1399)
at org.hl7.fhir.r5.utils.StructureMapUtilities.transform(StructureMapUtilities.java:1361)
at org.hl7.fhir.validation.ValidationEngine.transformVersion(ValidationEngine.java:1754)
at org.hl7.fhir.validation.cli.services.ValidationService.transformVersion(ValidationService.java:157)
at org.hl7.fhir.validation.Validator.main(Validator.java:168)
Caused by: org.hl7.fhir.exceptions.FHIRException: Attempt to get types for an invalid property 'reasonCode' on type Encounter
at org.hl7.fhir.r5.model.Base.getTypesForProperty(Base.java:330)
at org.hl7.fhir.r5.elementmodel.Element.getTypesForProperty(Element.java:707)
at org.hl7.fhir.r5.utils.StructureMapUtilities.runTransform(StructureMapUtilities.java:1850)
... 7 more

The package 'hl7.fhir.xver-extensions#0.0.2' is not known to the package server ('http://packages.fhir.org')

Hi there,
I am getting the following exception when I try the following code in VM. Note : This is happening only in any remote or physical VM and not in my local system.

java -jar org.hl7.fhir.validator.jar AdvanceBloodPressure.xml -version 3.0
FHIR Validation tool Version 4.2.13-SNAPSHOT (Git# aef4404). Built 2020-04-02T11:08:19.269+11:00 (46 hours old)
Detected Java version: 1.8.0_211 from C:\Program Files\Java\jre1.8.0_211 on amd64 (64bit). 3641MB available
Arguments: AdvanceBloodPressure.xml -version 3.0
Directories: Current = C:\Users\320008062\Downloads, Package Cache = C:\Users\320008062.fhir\packages
.. FHIR Version 3.0, definitions from hl7.fhir.r3.core#3.0.2
.. connect to tx server @ http://tx.fhir.org
Installing hl7.fhir.r3.core#3.0.2 to the package cache
Fetching:.......................................................................................
Installing: ....................................................................................... done.
Installing hl7.fhir.xver-extensions#0.0.2 to the package cache
Fetching:Exception in thread "main" java.io.IOException: Error reading http://fhir.org/packages/hl7.fhir.xver-extensions/0.0.2/package.tgz: null
at org.hl7.fhir.utilities.cache.NpmPackage.readStream(NpmPackage.java:292)
at org.hl7.fhir.utilities.cache.NpmPackage.fromPackage(NpmPackage.java:283)
at org.hl7.fhir.utilities.cache.PackageCacheManager.addPackageToCache(PackageCacheManager.java:462)
at org.hl7.fhir.utilities.cache.PackageCacheManager.loadPackage(PackageCacheManager.java:613)
at org.hl7.fhir.validation.ValidationEngine.loadDefinitions(ValidationEngine.java:347)
at org.hl7.fhir.validation.ValidationEngine.loadInitialDefinitions(ValidationEngine.java:289)
at org.hl7.fhir.validation.ValidationEngine.(ValidationEngine.java:322)
at org.hl7.fhir.validation.Validator.main(Validator.java:586)
Caused by: java.lang.NullPointerException
at java.io.FilterInputStream.markSupported(Unknown Source)
at org.apache.commons.compress.compressors.gzip.GzipCompressorInputStream.(GzipCompressorInputStream.java:160)
at org.apache.commons.compress.compressors.gzip.GzipCompressorInputStream.(GzipCompressorInputStream.java:131)
at org.hl7.fhir.utilities.cache.NpmPackage.readStream(NpmPackage.java:290)
... 7 more

Is there something which I am missing?

Unrelated resources in context directory break validation

Running java -jar org.hl7.fhir.validator.jar -version 3.0 -tx "http://tx.fhir.org" -ig "mirjamstestproject" adam-everyman.json in the given zip (mirjamstestproject.zip) will fail to validate because of an irrelevant resource:

+  .. load IG from /home/vadi/Desktop/mirjamstestproject/mirjamstestproject
 ..file: ObservationDefinition-example.xmlException in thread "main" java.lang.Exception: Error parsing ObservationDefinition-example.xml: Unknown resource type ObservationDefinition

This makes it impossible to validate with the context set to a folder because all other files have to be perfect before the file in question can be validated.

Invalid resources, if they're not relevant to validation, should not have any effect on the validation process.

add -no-preferred-binding-infos option to Validator

Right now the Validator returns infos like this:

Information @ DocumentReference.type (line 7, col8) : None of the codes provided are in the value set http://hl7.org/fhir/ValueSet/c80-doc-typecodes (http://hl7.org/fhir/ValueSet/c80-doc-typecodes), and a code is recommended to come from this value set)

This is irritating to some Implementers if their profile has a required binding to a specific other VS, they are still getting this info.
As a simple workaround this option should suppress all preferred binding infos.

Validator: -proxy Flag treated as File to validate

If I run the validator CLI version 4.2.4-SNAPSHOT with a -proxy flag, it tries to open -proxy as a file:

$ java -jar validator.jar -proxy <host>:<port> -version 4.0.1 -ig <ig.pack> <files-to-validate>
FHIR Validation tool Version 4.2.4-SNAPSHOT (Git# a3d7acdf351d). Built 2020-02-28T15:17:35.66+11:00 (3 days old)
Detected Java version: 11.0.3 from /Library/Java/JavaVirtualMachines/jdk-11.0.3.jdk/Contents/Home on x86_64 (64bit). 4096MB available
Arguments: -proxy <host>:<port> -version 4.0.1 -ig <ig.pack> <files-to-validate>
Directories: Current = ..., Package Cache = ...
  .. FHIR Version 4.0, definitions from hl7.fhir.r4.core#4.0.1
  .. connect to tx server @ http://tx.fhir.org
Installing hl7.fhir.r4.core#4.0.1 to the package cache
  Fetching:....................................................................................................
  Installing: .................................................................................................... done.
Installing hl7.fhir.xver-extensions#0.0.1 to the package cache
  Fetching:
  Installing:  done.
    (v4.0.1)
+  .. load IG from <ig.pack>
  .. validate [-proxy <host>:<port>, <files-to-validate>]
Exception in thread "main" java.io.IOException: File -proxy does not exist
        at org.hl7.fhir.validation.ValidationEngine.handleSource(ValidationEngine.java:1048)
        at org.hl7.fhir.validation.ValidationEngine.handleSources(ValidationEngine.java:1023)
        at org.hl7.fhir.validation.ValidationEngine.validate(ValidationEngine.java:983)
        at org.hl7.fhir.validation.Validator.main(Validator.java:659)

I replaced the real paths with placeholders like <...>.

Validator crashes with MedicationRequest example

The latest validator crashes when presented with a standard STU3 MedicationRequest example. The crash goes away if the requester.agent.reference field is removed. Could someone shed some light on this for me, as I initially ran into this when trying to validate some real MedicationRequest data.

> java -jar org.hl7.fhir.validator.jar http://hl7.org/fhir/STU3/medicationrequest0301.json -version 3.0

FHIR Validation tool Version 4.0.22-SNAPSHOT - Built 2019-09-27T14:16:20.593+10:00 - Git fb152a24e56d
Detected Java version: 1.8.0_191 from C:\Program Files\Java\jre1.8.0_191 on amd64 (64bit). 7259MB available
Arguments: http://hl7.org/fhir/STU3/medicationrequest0301.json -version 3.0
Directories: Current = C:\temp\FHIR, Package Cache = C:\Users\XXXX\.fhir\packages
  .. connect to tx server @ http://tx.fhir.org
  .. definitions from hl7.fhir.core#3.0.1
    (v3.0.1)
  .. validate [http://hl7.org/fhir/STU3/medicationrequest0301.json]
   ..Detect format for http://hl7.org/fhir/STU3/medicationrequest0301.json
Terminology server: Check for supported code systems for http://snomed.info/sct
Exception in thread "main" java.lang.Error: Not done yet - resolve Practitioner/f007 locally (2)
        at org.hl7.fhir.r5.validation.InstanceValidator$ValidatorHostServices.resolveReference(InstanceValidator.java:269)
        at org.hl7.fhir.r5.utils.FHIRPathEngine.funcResolve(FHIRPathEngine.java:3310)
        at org.hl7.fhir.r5.utils.FHIRPathEngine.evaluateFunction(FHIRPathEngine.java:2740)
        at org.hl7.fhir.r5.utils.FHIRPathEngine.execute(FHIRPathEngine.java:1147)
        at org.hl7.fhir.r5.utils.FHIRPathEngine.execute(FHIRPathEngine.java:1161)
        at org.hl7.fhir.r5.utils.FHIRPathEngine.execute(FHIRPathEngine.java:1156)
        at org.hl7.fhir.r5.utils.FHIRPathEngine.evaluate(FHIRPathEngine.java:546)
        at org.hl7.fhir.r5.utils.FHIRPathEngine.evaluateToBoolean(FHIRPathEngine.java:614)
        at org.hl7.fhir.r5.validation.InstanceValidator.checkInvariant(InstanceValidator.java:4456)
        at org.hl7.fhir.r5.validation.InstanceValidator.checkInvariants(InstanceValidator.java:4431)
        at org.hl7.fhir.r5.validation.InstanceValidator.checkInvariants(InstanceValidator.java:4320)
        at org.hl7.fhir.r5.validation.InstanceValidator.validateElement(InstanceValidator.java:3948)
        at org.hl7.fhir.r5.validation.InstanceValidator.checkChild(InstanceValidator.java:4099)
        at org.hl7.fhir.r5.validation.InstanceValidator.validateElement(InstanceValidator.java:3971)
        at org.hl7.fhir.r5.validation.InstanceValidator.start(InstanceValidator.java:2963)
        at org.hl7.fhir.r5.validation.InstanceValidator.validateResource(InstanceValidator.java:4563)
        at org.hl7.fhir.r5.validation.InstanceValidator.validate(InstanceValidator.java:833)
        at org.hl7.fhir.r5.validation.InstanceValidator.validate(InstanceValidator.java:666)
        at org.hl7.fhir.r5.validation.ValidationEngine.validate(ValidationEngine.java:1086)
        at org.hl7.fhir.r5.validation.ValidationEngine.validate(ValidationEngine.java:1000)
        at org.hl7.fhir.r5.validation.Validator.main(Validator.java:559)

Bundle validation fails on doc with relative subject reference

If the reference in subject Composition is relative the validation fails with the following error:

ERROR: Bundle.entry[1].resource.subject.reference: Unable to resolve the target of the reference in the bundle (Composition Subject)

<Bundle xmlns="http://hl7.org/fhir">
	<id value="bundle" />
	<meta>
		<lastUpdated value="2019-05-29T15:00:54.948+02:00" />
	</meta>
	<identifier>
		<system value="urn:ietf:rfc:3986" />
		<value value="urn:uuid:8a1d50f3-3f0c-471d-954d-dca1182dbcf3" />
	</identifier>
	<type value="document" />
	<entry>
		<fullUrl value="http://acme.com/Composition/1" />
		<resource>
			<Composition>
				<id value="1" />
				<status value="final" />
				<type>
					<coding>
						<system value="http://loinc.org" />
						<code value="11488-4" />
					</coding>
				</type>
				<subject>
					<reference value="Patient/pat2" />
				</subject>
				<date value="2016-09-12T11:46:09+02:00" />
				<author>
					<reference value="Patient/pat2" />
				</author>
				<title value="testreferencesubject" />
			</Composition>
		</resource>
	</entry>
	<entry>
		<fullUrl value="http://acme.com/Patient/pat2" />
		<resource>
			<Patient>
				<id value="pat2" />
			</Patient>
		</resource>
	</entry>
</Bundle>

An absolute URL works, however it should also work with a relative URL (https://www.hl7.org/fhir/bundle.html#references), will provide a pull request.

Optional fhir package canonical crashes validator

The spec mentions that canonicals are optionals for non-IGs, but the validator bombs out without one:

$ cat package.json 
{
  "name": "swedishnationalmedicationlist",
  "version": "0.1.0",
  "description": "Put a description here",
  "dependencies": {},
  "devDependencies": null,
  "canonicals": null
}
Exception in thread "main" java.lang.NullPointerException
	at org.hl7.fhir.utilities.cache.NpmPackage.canonical(NpmPackage.java:274)
	at org.hl7.fhir.utilities.cache.PackageCacheManager.extractLocally(PackageCacheManager.java:522)
	at org.hl7.fhir.r5.validation.ValidationEngine.loadPackage(ValidationEngine.java:510)
	at org.hl7.fhir.r5.validation.ValidationEngine.loadIgSource(ValidationEngine.java:432)
	at org.hl7.fhir.r5.validation.ValidationEngine.loadIg(ValidationEngine.java:661)
	at org.hl7.fhir.r5.validation.Validator.main(Validator.java:373)

Unable to successfully run mvn install on downloaded or git cloned project

Hi,
I am trying to build the project locally both by using git clone / downloading as zip.
When I try to run mvn install I get the following error :
[INFO] Scanning for projects...
[WARNING] The POM for org.apache.felix:maven-bundle-plugin:jar:3.5.0 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[ERROR] Invalid extension descriptor for org.apache.felix:maven-bundle-plugin:3.5.0: zip END header not found
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[ERROR] Unknown packaging: bundle @ line 13, column 16
[ERROR] Unknown packaging: bundle @ line 13, column 16
[ERROR] Unknown packaging: bundle @ line 13, column 16
[ERROR] Unknown packaging: bundle @ line 13, column 16
[ERROR] Unknown packaging: bundle @ line 13, column 13
[ERROR] Unknown packaging: bundle @ line 13, column 13
[ERROR] Unknown packaging: bundle @ line 13, column 16
[ERROR] Unknown packaging: bundle @ line 13, column 16
[ERROR] Unknown packaging: bundle @ line 16, column 16
@
[ERROR] The build could not read 9 projects -> [Help 1]
[ERROR]
[ERROR] The project ca.uhn.hapi.fhir:org.hl7.fhir.utilities:5.0.6-SNAPSHOT (C:\fhir\org.hl7.fhir.core-master\org.hl7.fhir.utilities\pom.xml) has 1 error
[ERROR] Unknown packaging: bundle @ line 13, column 16
[ERROR]
[ERROR] The project ca.uhn.hapi.fhir:org.hl7.fhir.dstu2:5.0.6-SNAPSHOT (C:\fhir\org.hl7.fhir.core-master\org.hl7.fhir.dstu2\pom.xml) has 1 error
[ERROR] Unknown packaging: bundle @ line 13, column 16
[ERROR]
[ERROR] The project ca.uhn.hapi.fhir:org.hl7.fhir.dstu2016may:5.0.6-SNAPSHOT (C:\fhir\org.hl7.fhir.core-master\org.hl7.fhir.dstu2016may\pom.xml) has 1 error
[ERROR] Unknown packaging: bundle @ line 13, column 16
[ERROR]
[ERROR] The project ca.uhn.hapi.fhir:org.hl7.fhir.dstu3:5.0.6-SNAPSHOT (C:\fhir\org.hl7.fhir.core-master\org.hl7.fhir.dstu3\pom.xml) has 1 error
[ERROR] Unknown packaging: bundle @ line 13, column 16
[ERROR]
[ERROR] The project ca.uhn.hapi.fhir:org.hl7.fhir.r4:5.0.6-SNAPSHOT (C:\fhir\org.hl7.fhir.core-master\org.hl7.fhir.r4\pom.xml) has 1 error
[ERROR] Unknown packaging: bundle @ line 13, column 13
[ERROR]
[ERROR] The project ca.uhn.hapi.fhir:org.hl7.fhir.r5:5.0.6-SNAPSHOT (C:\fhir\org.hl7.fhir.core-master\org.hl7.fhir.r5\pom.xml) has 1 error
[ERROR] Unknown packaging: bundle @ line 13, column 13
[ERROR]
[ERROR] The project ca.uhn.hapi.fhir:org.hl7.fhir.convertors:5.0.6-SNAPSHOT (C:\fhir\org.hl7.fhir.core-master\org.hl7.fhir.convertors\pom.xml) has 1 error
[ERROR] Unknown packaging: bundle @ line 13, column 16
[ERROR]
[ERROR] The project ca.uhn.hapi.fhir:org.hl7.fhir.validation:5.0.6-SNAPSHOT (C:\fhir\org.hl7.fhir.core-master\org.hl7.fhir.validation\pom.xml) has 1 error
[ERROR] Unknown packaging: bundle @ line 13, column 16
[ERROR]
[ERROR] The project ca.uhn.hapi.fhir:org.hl7.fhir.report:5.0.6-SNAPSHOT (C:\fhir\org.hl7.fhir.core-master\org.hl7.fhir.report\pom.xml) has 1 error
[ERROR] Unknown packaging: bundle @ line 16, column 16
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException

Any help on this is greatly appreciated !

Thanks
Debashish

Null Pointer Errors in NarrativeGenerator.renderLeaf()

} else if (e instanceof BooleanType)
  x.addText(((BooleanType) e).getValue().toString());
else if (e instanceof CodeableConcept) {
  renderCodeableConcept((CodeableConcept) e, x, showCodeDetails);
} else if (e instanceof Coding) {
  renderCoding((Coding) e, x, showCodeDetails);
} else if (e instanceof Annotation) {
  renderAnnotation((Annotation) e, x);
} else if (e instanceof Identifier) {
  renderIdentifier((Identifier) e, x);
} else if (e instanceof org.hl7.fhir.r5.model.IntegerType) {
  x.addText(Integer.toString(((org.hl7.fhir.r5.model.IntegerType) e).getValue()));
} else if (e instanceof org.hl7.fhir.r5.model.DecimalType) {
  x.addText(((org.hl7.fhir.r5.model.DecimalType) e).getValue().toString());
} else if (e instanceof HumanName) {

Should be:
} else if (e instanceof BooleanType)
x.addText(((BooleanType) e).getValue());
else if (e instanceof CodeableConcept) {
renderCodeableConcept((CodeableConcept) e, x, showCodeDetails);
} else if (e instanceof Coding) {
renderCoding((Coding) e, x, showCodeDetails);
} else if (e instanceof Annotation) {
renderAnnotation((Annotation) e, x);
} else if (e instanceof Identifier) {
renderIdentifier((Identifier) e, x);
} else if (e instanceof org.hl7.fhir.r5.model.IntegerType) {
x.addText((org.hl7.fhir.r5.model.IntegerType) e);
} else if (e instanceof org.hl7.fhir.r5.model.DecimalType) {
x.addText((org.hl7.fhir.r5.model.DecimalType) e).getValue());
} else if (e instanceof HumanName) {

And then, to XhtmlNode, add the method:

public XhtmlNode addText(Object obj) {
return addText(obj == null ? "" : obj.toString());
}

If I could have figured out how to build and test this beast, this would have been a pull request, but for some reason, I couldn't get it to find all of the dependencies.

CDA to Fhir Error

Hi
I'm trying to use the validator to convert a CDA to Fhir bundle, but I got this error:
command
java -jar org.hl7.fhir.validator.jar d:\EHR_TESTS_ENCOID.xml -transform http://hl7.org/fhir/cda/mapping/ccdaDocumentToFhir -ig hl7.fhir.cda#4.0.1 -ig "C:\Users\paolo\Downloads\ccda-to-fhir-master - 1\ccda-to-fhir-master\mappings" -output c:\temp\bundle.xml -ig hl7.fhir.core
output

`FHIR Validation tool Version 4.2.21-SNAPSHOT (Git# 608149e). Built 2020-04-29T14:57:31.75+10:00 (4 hours old)
Detected Java version: 1.8.0_251 from C:\Program Files\Java\jre1.8.0_251 on amd64 (64bit). 1799MB available
Arguments: d:\EHR_TESTS_ENCOID.xml -transform http://hl7.org/fhir/cda/mapping/ccdaDocumentToFhir -ig hl7.fhir.cda#4.0.1 -ig "C:\Users\paolo\Downloads\ccda-to-fhir-master - 1\ccda-to-fhir-master\mappings" -output c:\temp\bundle.xml -ig hl7.fhir.core
Directories: Current = C:\Users\paolo\Downloads\ccda-to-fhir-master - 1, Package Cache = C:\Users\paolo.fhir\packages
.. FHIR Version current, definitions from hl7.fhir.r5.core#current
.. connect to tx server @ http://tx.fhir.org
(vcurrent)

  • .. load IG from hl7.fhir.cda#4.0.1
    Installing hl7.fhir.cda#4.0.1 to the package cache
    Fetching:Exception in thread "main" java.io.IOException: Error reading http://hl7.org/fhir/cda/4.0.1/package.tgz: null
    at org.hl7.fhir.utilities.cache.NpmPackage.readStream(NpmPackage.java:304)
    at org.hl7.fhir.utilities.cache.NpmPackage.fromPackage(NpmPackage.java:295)
    at org.hl7.fhir.utilities.cache.PackageCacheManager.addPackageToCache(PackageCacheManager.java:462)
    at org.hl7.fhir.utilities.cache.PackageCacheManager.loadPackage(PackageCacheManager.java:613)
    at org.hl7.fhir.validation.ValidationEngine.resolvePackage(ValidationEngine.java:632)
    at org.hl7.fhir.validation.ValidationEngine.fetchByPackage(ValidationEngine.java:626)
    at org.hl7.fhir.validation.ValidationEngine.loadIgSource(ValidationEngine.java:460)
    at org.hl7.fhir.validation.ValidationEngine.loadIg(ValidationEngine.java:724)
    at org.hl7.fhir.validation.cli.services.ValidationService.getValidator(ValidationService.java:174)
    at org.hl7.fhir.validation.Validator.main(Validator.java:165)
    Caused by: java.lang.NullPointerException
    at java.io.FilterInputStream.markSupported(Unknown Source)
    at org.apache.commons.compress.compressors.gzip.GzipCompressorInputStream.(GzipCompressorInputStream.java:160)
    at org.apache.commons.compress.compressors.gzip.GzipCompressorInputStream.(GzipCompressorInputStream.java:131)
    at org.hl7.fhir.utilities.cache.NpmPackage.readStream(NpmPackage.java:302)
    ... 9 more`

Can you point me in the right direction on how to use the tool to make the conversion?
Thank you
Paolo

Converting from R3 to R4 version using custom maps

Hi,
I am using the Validator.java to convert between the two versions R3 and R4 .
I use the following command line arguments and it works fine
c:\fhirmessages\fhir_condition_epic_stu3_searched.json -version 3.0 -to-version 4.0 -output c:\fhirmessages\fhir_condition_epic_r4_searched_output.json -do-native

Now what if the conversion doesn't support few extension parameters that were added .. Or may be the map doesn't do some of the conversions as expected . Hence I was trying to explore if we can ask the tool to use a custom Map edited by me to do the conversion instead of the default .
So I tried the command

c:\fhirmessages\fhir_condition_epic_stu3_searched.json -version 3.0 -to-version 4.0 -output c:\fhirmessages\fhir_condition_epic_r4_searched_output.json -do-native -ig C:\fhirmessages\maps

In the maps folder I downloaded the Condition.map from https://raw.githubusercontent.com/FHIR/packages/master/interversion/r4/R3toR4/Condition.map and edited the contents to change the mapping of src.assertedDate -> tgt.recordedDate; to src.assertedDate -> tgt.tempDate;

I didn't convert the assertedDate to tempDate neither did it give any error and generated the output using default map .

Is there something that I am missing here ?

Thanks

java.text.ParseException: Unparseable date: "Thu, 11 Oct, 2018 11:00:14 -0600"

Hey there,

I've compiled the validator using mvn clean install -DskipTests, and now I'm trying to transform a resource using:

java -cp C:\Users\\oehmj\IdeaProjects\org.hl7.fhir.core\org.hl7.fhir.validation.cli\target\org.hl7.fhir.validation.cli-4.1.30-SNAPSHOT.jar org.hl7.fhir.r4.validation.Validator resources/patient.fhir.json -tx n/a

but I'm getting the error:

FHIR Validation tool Version 4.1.30-SNAPSHOT (Git# 89dfaec). Built 2019-12-18T09:16:38.586+01:00 (46 mins old)
Arguments: resources/patient.fhir.json -tx n/a
.. connect to tx server @ null
.. definitions from hl7.fhir.core#4.0.1
Exception in thread "main" java.text.ParseException: Unparseable date: "Thu, 11 Oct, 2018 11:00:14 -0600"
at java.text.DateFormat.parse(DateFormat.java:366)
at org.hl7.fhir.utilities.cache.PackageCacheManager.readDate(PackageCacheManager.java:445)
at org.hl7.fhir.utilities.cache.PackageCacheManager.loadFromBuildServer(PackageCacheManager.java:431)
at org.hl7.fhir.utilities.cache.PackageCacheManager.checkBuildLoaded(PackageCacheManager.java:466)
at org.hl7.fhir.r4.validation.ValidationEngine.resolvePackage(ValidationEngine.java:571)
at org.hl7.fhir.r4.validation.ValidationEngine.fetchByPackage(ValidationEngine.java:564)
at org.hl7.fhir.r4.validation.ValidationEngine.loadIgSource(ValidationEngine.java:443)
at org.hl7.fhir.r4.validation.ValidationEngine.loadDefinitions(ValidationEngine.java:328)
at org.hl7.fhir.r4.validation.ValidationEngine.loadInitialDefinitions(ValidationEngine.java:293)
at org.hl7.fhir.r4.validation.ValidationEngine.(ValidationEngine.java:318)
at org.hl7.fhir.r4.validation.Validator.main(Validator.java:372)

To me, it seems like the tool downloads a file at https://build.fhir.org/ig/qas.json but fails to parse the contained dates correctly.

java validation shouldn't throw Exception if no connection to tx.fhir.org

Issue: the validation-cli throws an exception if the network is down and tx.fhir.org not connectable.

Expected behaviour: Meaningful error message including the -tx n/a option

Exception in thread "main" org.hl7.fhir.dstu3.utils.client.EFhirClientException: Error sending Http Request: Software caused connection abort (connect failed)
	at org.hl7.fhir.dstu3.utils.client.ClientUtils.sendRequest(ClientUtils.java:331)
	at org.hl7.fhir.dstu3.utils.client.ClientUtils.issueResourceRequest(ClientUtils.java:250)
	at org.hl7.fhir.dstu3.utils.client.ClientUtils.issueResourceRequest(ClientUtils.java:234)
	at org.hl7.fhir.dstu3.utils.client.ClientUtils.issueResourceRequest(ClientUtils.java:225)
	at org.hl7.fhir.dstu3.utils.client.ClientUtils.issueGetResourceRequest(ClientUtils.java:161)
	at org.hl7.fhir.dstu3.utils.client.FHIRToolingClient.getCapabilitiesStatementQuick(FHIRToolingClient.java:198)
	at org.hl7.fhir.convertors.TerminologyClientR3.getCapabilitiesStatementQuick(TerminologyClientR3.java:88)
	at org.hl7.fhir.r5.context.SimpleWorkerContext.connectToTSServer(SimpleWorkerContext.java:225)
	at org.hl7.fhir.r5.validation.ValidationEngine.connectToTSServer(ValidationEngine.java:749)
	at org.hl7.fhir.r5.validation.ValidationEngine.setTerminologyServer(ValidationEngine.java:357)
	at org.hl7.fhir.r5.validation.ValidationEngine.<init>(ValidationEngine.java:386)
	at org.hl7.fhir.r5.validation.Validator.main(Validator.java:474)
Caused by: java.net.ConnectException: Software caused connection abort (connect failed)
	at java.base/java.net.PlainSocketImpl.socketConnect(Native Method)
	at java.base/java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:399)
	at java.base/java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:242)
	at java.base/java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:224)
	at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:403)
	at java.base/java.net.Socket.connect(Socket.java:591)
	at org.apache.http.conn.scheme.PlainSocketFactory.connectSocket(PlainSocketFactory.java:121)
	at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:180)
	at org.apache.http.impl.conn.ManagedClientConnectionImpl.open(ManagedClientConnectionImpl.java:326)
	at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:605)
	at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:440)
	at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:835)
	at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
	at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:108)
	at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:56)
	at org.hl7.fhir.dstu3.utils.client.ClientUtils.sendRequest(ClientUtils.java:329)
	... 11 more

Validation incorrectly applies Bundle invariants when validating instance of R4 Parameters

The following execution of the java validator incorrectly applied Bundle invarients (when the Bundle.type was "collection". See attached zip.

FHIR Validation tool Version 3.8.0-SNAPSHOT - Built 2019-02-11T12:49:16.829-05:00 - Git 7a86710
Arguments: -ig test\text-binary.xml -ig test\param-profile.xml test\example-params-1.xml
.. connect to tx server @ http://tx.fhir.org
.. definitions from hl7.fhir.core#4.0.0
(v4.0.0)

  • .. load IG from test\text-binary.xml
  • .. load IG from test\param-profile.xml
    .. validate [test\example-params-1.xml]
    FAILURE validating test\example-params-1.xml: error:2 warn:0 info:0
    Error @ Parameters.parameter.resource (line 7, col19) : entry.request mandatory for batch/transaction/history, otherwise prohibited [entry.all(request.exists() = ((.type = 'batch') or (.type = 'transaction') or (.type = 'history')))]
    Error @ Parameters.parameter.resource (line 7, col19) : entry.response mandatory for batch-response/transaction-response/history, otherwise prohibited [entry.all(response.exists() = ((.type = 'batch-response') or (.type = 'transaction-response') or (.type = 'history')))]

test.zip

org.hl7.fhir.r4.model.UuidType is not annotated

The org.hl7.fhir.r4.model.UuidType is not annotated with @DatatypeDef(name = "uuid", profileOf = UriType.class). This prevents it from being used as a valid data type for R4.

For example, create a Task resource with Task.output.value set to a UuidType, then try to convert to JSON/XML. HAPI FHIR will output an error.

uuid is one of the valid data types in R4.

Date formatting should honour year/month precision

Description

The FHIR dateTime datatype allows to use incomplete dates with just a year or with a year and month. However, in narrative generation (and maybe other situations as well), these incomplete dates are rendered as full dates, defaulting to the first day of the month (if only the day is absent) or to the first day of the year (if day and month are absent).

Proposed fix

Formatting of the dateTime data type happens in the toHumanDisplay() or toHumanDisplayLocalTimezone() methods of the BaseDateTimeType class. This class does recognize the lower resolutions of year and month.

However, these methods leverage FastDateFormat of the Java platform to provide locale-aware date displays. And FastDateFormat doesn't have built-in formats for rendering dates in these lower resolutions.

One possible way to fix this is to modify the default MEDIUM format to display only what's needed (see reference). This is quite tricky of course (as always with date and time), but with a proper fallback I think it might work.

For the year-only resolution, we could define a new format as:

private static final FastDateFormat ourHumanYearFormat = FastDateFormat.getInstance(ourHumanDateFormat.getPattern().replaceAll("[^y]", ""));

This filters out anything that's not part of the year rendering, while keeping the specific year format intact for the MEDIUM format.

The year/month resolution is quite a bit trickier, as there are many ways to arrange year, month and days across locales, with a choice of punctuation marks and such. A safe approach might be to replace the entire block of day+month with just the month. This leaves the formatting in relation to the year intact. If day and month are not adjacent to each other, a fallback is provided. Example:

private static final FastDateFormat ourHumanYearMonthFormat;
static {
  String format = "yyyy, MMM"; // Fallback for when the medium format doesn't use month and day of month adjacent to each other
	
  String medium = ourHumanDateFormat.getPattern();
  Pattern pattern = Pattern.compile("(M([^\\p{Lower}\\p{Upper}]*d)|(d[^\\p{Lower}\\p{Upper}]*)M)");
  Matcher matcher = pattern.matcher(medium);
  if (matcher.matches()) {
    format = matcher.replaceAll("M");
  }
  ourHumanYearMonthFormat = FastDateFormat.getInstance(format);
};

Finally, the getHumanDisplay...() methods can be modified to:

switch (getPrecision()) {
  case YEAR:
    return ourHumanYearFormat.format(value);
  case MONTH:
    return ourHumanYearMonthFormat.format(
  case DAY:
    return ourHumanDateFormat.format(value);
  ...

IG Publisher mangles html for R4 StructureDefinition detailed definition page

The detailed definition page for a R4 profile of a Resource has lost the closing tag.
This has the bizarre effect of inserting the page footer before the table of definitions!

The generated fragment is fine and when i run Jekyll directly against the temp directory all is fine!

Curiously this only occurs for StructureDefinitions that constrain Resources.
A StructureDefinitions that constrains a DataType works just fine.
agency-fhir-ig-template.zip

FormatUtilities firstIndexOf throws ArrayIndexOutOfBoundsException

For example in org.hl7.fhir.r5.formats.FormatUtilities line 143 in method firstIndexOf will show a ArrayIndexOutOfBoundsException if char not found and input less than 1000 bytes long.

Fix: Math.max has to be replaced by Math.min.

I first wanted to create a pull request, but will better not touch the code without proper test execution.

Got the ArrayIndexOutOfBoundsException using validator JAR with a profile hosted by redirect. Problem is that ValidationEngine.loadProfileFromUrl will not follow redirects.

CDA To FHIR

I am trying to transform a CDA to XML with the Validator using the attached command, and after solve different issues previously at this moment i am in this situation, and i don't know how can i fix this issue

Any help will be welcome

Thank you

Juan Antonio

Fhir Validator is not working with Proxy Settings with username and Password

Fhir Validator is not working with Proxy Settings having username and Password.
It only supports Proxy without username Password.

I get following error when i use this command in Windows

java -jar org.hl7.fhir.validator.jar pat.xml -version 4.0.0 -Proxy=http://usr:name@proxy:port

.. FHIR Version 4.0, definitions from hl7.fhir.r4.core#4.0.1 .. connect to tx server @ http://tx.fhir.org Error connecting to build server - running without build (Connection refused: connect) Exception in thread "main" org.hl7.fhir.exceptions.FHIRException: Unable to resolve package id hl7.fhir.r4.core#4.0.1 at org.hl7.fhir.utilities.cache.PackageCacheManager.fetchTheOldWay(PackageCacheManager.java:852) at org.hl7.fhir.utilities.cache.PackageCacheManager.loadFromPackageServer(PackageCacheManager.java:397) at org.hl7.fhir.utilities.cache.PackageCacheManager.loadPackage(PackageCacheManager.java:681) at org.hl7.fhir.validation.ValidationEngine.resolvePackage(ValidationEngine.java:649) at org.hl7.fhir.validation.ValidationEngine.fetchByPackage(ValidationEngine.java:643) at org.hl7.fhir.validation.ValidationEngine.loadIgSource(ValidationEngine.java:477) at org.hl7.fhir.validation.ValidationEngine.loadCoreDefinitions(ValidationEngine.java:356) at org.hl7.fhir.validation.ValidationEngine.<init>(ValidationEngine.java:337) at org.hl7.fhir.validation.cli.services.ValidationService.getValidator(ValidationService.java:169) at org.hl7.fhir.validation.Validator.main(Validator.java:175)

Please look into this issue.

R2R3ConversionManager Error

Hi @grahamegrieve
I am trying to use R2R3ConversionManager for dstu2 to dstu3 conversion. I am getting this error -

2020-04-14/14:25:26.024/CDT DEBUG (OrgConverterTests.java:71) [t:main] loaded R2 Defs
2020-04-14/14:25:41.421/CDT DEBUG (OrgConverterTests.java:79) [t:main] loaded R3 Defs
2020-04-14/14:25:41.657/CDT DEBUG (OrgConverterTests.java:87) [t:main] loaded R2 to R3 Maps
Exception in thread "main" org.hl7.fhir.exceptions.FHIRException: Attempt to make an invalid property 'div' on type Narrative
at org.hl7.fhir.dstu3.model.Base.makeProperty(Base.java:704)
at org.hl7.fhir.dstu3.model.Element.makeProperty(Element.java:281)
at org.hl7.fhir.dstu3.model.Narrative.makeProperty(Narrative.java:349)
at org.hl7.fhir.dstu3.utils.StructureMapUtilities.processTarget(StructureMapUtilities.java:1649)
at org.hl7.fhir.dstu3.utils.StructureMapUtilities.executeRule(StructureMapUtilities.java:1262)
at org.hl7.fhir.dstu3.utils.StructureMapUtilities.executeGroup(StructureMapUtilities.java:1247)
at org.hl7.fhir.dstu3.utils.StructureMapUtilities.executeRule(StructureMapUtilities.java:1282)
at org.hl7.fhir.dstu3.utils.StructureMapUtilities.executeGroup(StructureMapUtilities.java:1247)
at org.hl7.fhir.dstu3.utils.StructureMapUtilities.executeGroup(StructureMapUtilities.java:1243)
at org.hl7.fhir.dstu3.utils.StructureMapUtilities.transform(StructureMapUtilities.java:1221)
at org.hl7.fhir.convertors.R2R3ConversionManager.convertToR3(R2R3ConversionManager.java:279)
at org.hl7.fhir.convertors.R2R3ConversionManager.convert(R2R3ConversionManager.java:253)
at com.accenture.ips.fhirsandbox.sandbox.OrgConverterTests.main(OrgConverterTests.java:119)

Any suggestion will be really helpful.
Thanks.

This element does not match any known slice & no discriminator

For slicings without a discriminator the validator produces errors like:
Error @ Bundle.entry[0] (line 23, col9) : This element does not match any known slice defined in the profile Error @ Bundle.entry[0] (line 23, col9) : This element does not match any known slice defined in the profile https://fhir.kbv.de/StructureDefinition/74_PR_VoS_Bundle_VoS_PVS and slicing is CLOSED.

Not having a discriminator isn't best practice but still valid FHIR (if the slicing description is present).

could we add a (optional) logic: if a discriminator is not present don't try to match slices?

zulip thread:
https://chat.fhir.org/#narrow/stream/179177-conformance/topic/This.20element.20does.20not.20match.20any.20known.20slice

Validator: Questionnaire error messages

When Validating Questionnaires the reason of an error should always be clear to the implementer.
Current Errors which should be improved:

  • que-2:The link ids for groups and questions must be unique within the questionnaire [descendants().linkId.isDistinct()]
    linkId should be visible
  • Error @ Questionnaire.item[10].item[0] : Unable to find target "{0}" for this question enableWhen
    probably a MessageFormatBug

ClassCastException in NpmPackage.fhirVersion when fhirVersion is null

When loading and parsing the npm package "ehelse.fhir.no.grunndata" version "2.2.2" from packages.fhir.org and subsequently reading its fhir version, the following exception is thrown from NpmPackage:

2020-05-01 20:01:10.916 [main] ERROR c.u.f.jpa.packages.IgInstallerTestR4 [LoggingRule.java:75] Exception thrown in test case [installIgForR4FromSimplifier(ca.uhn.fhir.jpa.packages.IgInstallerTestR4)]: java.lang.ClassCastException: class com.google.gson.JsonNull cannot be cast to class com.google.gson.JsonArray (com.google.gson.JsonNull and com.google.gson.JsonArray are in unnamed module of loader 'app')
java.lang.ClassCastException: class com.google.gson.JsonNull cannot be cast to class com.google.gson.JsonArray (com.google.gson.JsonNull and com.google.gson.JsonArray are in unnamed module of loader 'app')
	at com.google.gson.JsonObject.getAsJsonArray(JsonObject.java:195)
	at org.hl7.fhir.utilities.cache.NpmPackage.fhirVersion(NpmPackage.java:529)
	at ca.uhn.fhir.jpa.packages.IgInstaller.install(IgInstaller.java:151)
	at ca.uhn.fhir.jpa.packages.IgInstaller.install(IgInstaller.java:132)
	at ca.uhn.fhir.jpa.packages.IgInstallerTestR4.installIgForR4FromSimplifier(IgInstallerTestR4.java:26)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:564)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.springframework.test.context.junit4.statements.RunBeforeTestExecutionCallbacks.evaluate(RunBeforeTestExecutionCallbacks.java:74)
	at org.springframework.test.context.junit4.statements.RunAfterTestExecutionCallbacks.evaluate(RunAfterTestExecutionCallbacks.java:84)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
	at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:75)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
	at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:86)
	at ca.uhn.fhir.test.utilities.LoggingRule$1.evaluate(LoggingRule.java:72)
	at org.junit.rules.RunRules.evaluate(RunRules.java:20)
	at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:84)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:251)
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:97)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
	at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
	at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:190)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
	at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33)
	at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:230)
	at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:58)
2020-05-01 20:01:10.917 [main] INFO  c.u.f.jpa.packages.IgInstallerTestR4 [LoggingRule.java:78] Finished test case [installIgForR4FromSimplifier(ca.uhn.fhir.jpa.packages.IgInstallerTestR4)] (success=false)

Inspecting the package.json I see that

{
  "name": "ehelse.fhir.no.grunndata",
  "version": "2.2.2",
  "description": "Grunndata profiles\r\nHL7 FHIR R4\r\nhl7.fhir.no.basis 2.0.11",
  "devDependencies": null,
  "canonicals": null,
  "author": "thomiz",
  "fhirVersions": null,
  "dependencies": {
    "hl7.fhir.no.basis": "2.0.11",
    "simplifier.core.r4": "4.0.1"
  }
}

The NpmPackage should probably handle the case where "fhirVersions" is null.

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.