FHIR Chat · Contributing to HAPI - Getting Started · hapi

Stream: hapi

Topic: Contributing to HAPI - Getting Started


view this post on Zulip Kevin Mayfield (Mar 26 2019 at 06:19):

Is their a guide?

I've done the basic's at the moment. Downloaded source from git, mvn clean and in the process of mvn install.
(It's the HAPI FHIR Validation I'm looking at working on - for UK+stu3)

Is their any special config?

view this post on Zulip Kevin Mayfield (Mar 26 2019 at 06:57):

Java version (8?) maven (3.5?)

view this post on Zulip Grahame Grieve (Mar 26 2019 at 07:21):

you're better off to use the java code directly without HAPI

view this post on Zulip Kevin Mayfield (Mar 26 2019 at 07:23):

We do that at present but their are a number of bugs we want to fix

view this post on Zulip Kevin Mayfield (Mar 26 2019 at 07:23):

(and also diagnose operationOutcome error messages)

view this post on Zulip Grahame Grieve (Mar 26 2019 at 07:24):

are you running the R5 validator?

view this post on Zulip Grahame Grieve (Mar 26 2019 at 07:25):

if you mean, you're running the validator jar, and you want to fix bugs in it. then you want the hapi core code, and the fhir github code, and not the rest of FHIR

view this post on Zulip Grahame Grieve (Mar 26 2019 at 07:25):

or HAPI

view this post on Zulip Kevin Mayfield (Mar 26 2019 at 07:31):

Yep that's what I've looking at. At the moment we have a couple of classes to add in UK support in our 'argonaut' demonstrator' [https://data.developer.nhs.uk/ccri]

view this post on Zulip Grahame Grieve (Mar 26 2019 at 07:32):

hmm what do they do?

view this post on Zulip Kevin Mayfield (Mar 26 2019 at 07:34):

First bit we add UK profiles to the DefaultProfileValidationSupport

    ValidationSupportChain validationSupportChain = new ValidationSupportChain();

    validationSupportChain.addValidationSupport(new DefaultProfileValidationSupport());
    validationSupportChain.addValidationSupport(new CareConnectProfileValidationSupport

view this post on Zulip Grahame Grieve (Mar 26 2019 at 07:34):

so that bit has nothing to do with the validation.jar

view this post on Zulip Kevin Mayfield (Mar 26 2019 at 07:35):

Next issue: https://github.com/jamesagnew/hapi-fhir/issues/1235

view this post on Zulip Grahame Grieve (Mar 26 2019 at 07:36):

so the next thing: the only supported version of the validator is the latest copy - that is now R5. I don't take bug fixes for the older versions of the validator

view this post on Zulip Kevin Mayfield (Mar 26 2019 at 07:39):

Understand that and that won't validate stu3 so we should look at moving fixes to stu3.... or is their another way?

view this post on Zulip Grahame Grieve (Mar 26 2019 at 07:39):

it will validate stu3

view this post on Zulip Grahame Grieve (Mar 26 2019 at 07:39):

you just load all the R3 structure definitions into it, and tell it to validate your R3 content.

view this post on Zulip Grahame Grieve (Mar 26 2019 at 07:40):

(you do need to convert the R3 structure definitions and value sets etc to R5 using the R3/R5 converter as you load them)

view this post on Zulip Grahame Grieve (Mar 26 2019 at 07:41):

but you don't need to convert the resource you are validating - just validate the bytes directly

view this post on Zulip Kevin Mayfield (Mar 26 2019 at 07:41):

That's very welcome news

view this post on Zulip Grahame Grieve (Mar 26 2019 at 07:41):

going flying. back later

view this post on Zulip Morten Ernebjerg (Mar 26 2019 at 08:28):

Just to clarify, does one also need to explicitly transform STU3 structure defs/valsets/etc. before loading them when using the JAR validator from the command line? The current documentation says (when discussing loading IGs/profiles):

Packages must have the same underlying fhir version as that specified in the -version parameter

which sounds like one should use STU3 profiles when validating for STU3...?

view this post on Zulip Grahame Grieve (Mar 26 2019 at 21:10):

if you use the command line validator, then it does the conversion internally - if you say -version 3.0 then any resources loaded from the various packages (core + IGs) will be converted from R3 to R5

view this post on Zulip Grahame Grieve (Mar 26 2019 at 21:12):

what I said above about doing the conversion only applies if you are loading the validator java classes directly (or to be precise, if you are using org.hl7.fhir.r5.validation.InstanceValidator, not using org.hl7.fhir.r5.validation.ValidationEngine)

view this post on Zulip Morten Ernebjerg (Mar 27 2019 at 07:27):

OK, thanks for the clarification @Grahame Grieve !

view this post on Zulip Kevin Mayfield (Mar 27 2019 at 10:43):

Testing at the moment. I'm (temp) using r4 validator in HAPI but it seems to be working.
Need to see how it handles backport extensions - do they get converted?

view this post on Zulip Grahame Grieve (Mar 27 2019 at 11:48):

backport extensions?

view this post on Zulip Kevin Mayfield (Mar 27 2019 at 12:00):

backported

view this post on Zulip Grahame Grieve (Mar 27 2019 at 12:03):

no you have to define them

view this post on Zulip Kevin Mayfield (Mar 27 2019 at 12:03):

not the standard ones?

view this post on Zulip Grahame Grieve (Mar 27 2019 at 12:35):

if they're defined for STU3 then they'll be valid

view this post on Zulip Kevin Mayfield (Mar 27 2019 at 14:04):

I think this is an issue in HAPI 3.8.0-SNAPSHOT (their are others).
The Bundle CodeSystems appear to have the wrong url in
https://raw.githubusercontent.com/jamesagnew/hapi-fhir/master/hapi-fhir-validation-resources-r4/src/main/resources/org/hl7/fhir/r4/model/valueset/valuesets.xml

view this post on Zulip Kevin Mayfield (Mar 27 2019 at 14:04):

observation-category has url of <url value="http://terminology.hl7.org/CodeSystem/observation-category"></url>

view this post on Zulip Kevin Mayfield (Mar 27 2019 at 14:06):

and that matches the spec.

view this post on Zulip Kevin Mayfield (Mar 27 2019 at 14:06):

Ignore above.... I'll research a bit more. Appears to be a stu3 to r4 change

view this post on Zulip Kevin Mayfield (Mar 29 2019 at 16:03):

Should the converter also handle extensions that have changed e.g.

http://hl7.org/fhir/StructureDefinition/patient-birthPlace was in stu3 http://hl7.org/fhir/StructureDefinition/birthPlace

also

http://terminology.hl7.org/CodeSystem/v3-MaritalStatus was in stu3 http://hl7.org/fhir/v3/MaritalStatus

I may have missed off a conversion step.

view this post on Zulip Grahame Grieve (Mar 29 2019 at 19:10):

I'm not sure what you mean by changed - if you load the R3 definitions, then it should be looking for the R3 extension

view this post on Zulip Kevin Mayfield (Mar 30 2019 at 07:41):

That makes sense, will try that next.

This is the correct location for the converters https://github.com/jamesagnew/hapi-fhir/tree/master/hapi-fhir-converter
I'm using the stu3->r4 convertor at present , I've not seen support for r5 (and assumed that's a work in progress)

view this post on Zulip Kevin Mayfield (Mar 30 2019 at 09:23):

Using the stu3->r4 convertor returns
Caused by: org.hl7.fhir.exceptions.FHIRException: Unknown resource Procedure
When converting a Bundle with a Procedure.

view this post on Zulip Kevin Mayfield (Mar 30 2019 at 09:24):

at org.hl7.fhir.convertors.VersionConvertor_30_40.convertResource(VersionConvertor_30_40.java:21342) ~[hapi-fhir-converter-3.8.0-SNAPSHOT.jar:?]

view this post on Zulip Kevin Mayfield (Mar 30 2019 at 09:46):

Other than that, it's working. Just need to tweak the r4 DefaultProfileValidationSupport.class to load stu3 resources.
https://github.com/nhsconnect/careconnect-reference-implementation/blob/3.8/cc-core/src/main/java/uk/org/hl7/fhir/validation/r4/DefaultProfileValidationSupportStu3AsR4.java

view this post on Zulip Patrick Werner (Mar 30 2019 at 14:13):

@Kevin Mayfield
here is the current source of the validator and other FHIR core parts of hapi: https://github.com/hapifhir/org.hl7.fhir.core

view this post on Zulip Kevin Mayfield (Mar 31 2019 at 07:49):

Cheers. Are these outputting maven resources?

view this post on Zulip Grahame Grieve (Mar 31 2019 at 10:26):

the core code is all maven yes

view this post on Zulip Wan Chen (Apr 22 2019 at 17:49):

Hi folks, we have a DSTU2 Immunization that we would like to convert to R4. We are getting this error:
“org.hl7.fhir.exceptions.FHIRException: Unknown resource Immunization
at org.hl7.fhir.convertors.VersionConvertor_10_40.convertResource(VersionConvertor_10_40.java:12147)”
Looking at the HAPI converter code https://github.com/jamesagnew/hapi-fhir/blob/master/hapi-fhir-converter/src/main/java/org/hl7/fhir/convertors/VersionConvertor_10_40.java#L11978, the code does not support Immunizations.

Is there another FHIR Mapping Language Java implementation that does support Immunizations and the complete set of mappings? If not, should I write the code and create a pull request?

view this post on Zulip Grahame Grieve (Apr 22 2019 at 21:42):

there is nothing else. A pull request would be very welcome

view this post on Zulip Wan Chen (Apr 23 2019 at 14:30):

Thanks @Grahame Grieve!


Last updated: Apr 12 2022 at 19:14 UTC