@Bean(name = "myFhirContextDstu2Hl7Org") @Lazy public FhirContext fhirContextDstu2Hl7Org() { if (ourFhirContextDstu2Hl7Org == null) { ourFhirContextDstu2Hl7Org = FhirContext.forDstu2Hl7Org(); } return ourFhirContextDstu2Hl7Org; }
private static FhirContext massage(FhirContext theCtx) { if (theCtx.getVersion().getVersion() == FhirVersionEnum.DSTU2) { return FhirContext.forDstu2Hl7Org(); } else { return theCtx; } }
static FhirContext getHl7OrgDstu2Ctx(FhirContext theCtx) { if (theCtx.getVersion().getVersion() == FhirVersionEnum.DSTU2_HL7ORG) { return theCtx; } FhirContext retVal = ourHl7OrgCtx; if (retVal == null) { retVal = FhirContext.forDstu2Hl7Org(); ourHl7OrgCtx = retVal; } return retVal; }
public FhirContext newContext() { switch (this) { case DSTU2: return FhirContext.forDstu2(); case DSTU2_HL7ORG: return FhirContext.forDstu2Hl7Org(); case DSTU2_1: return FhirContext.forDstu2_1(); case DSTU3: return FhirContext.forDstu3(); case R4: return FhirContext.forR4(); } throw new IllegalStateException("Unknown version: " + this); // should not happen }
myCtx = FhirContext.forDstu2(); } else if ("HL7ORG_DSTU2".equals(fhirVersion)) { myCtx = FhirContext.forDstu2Hl7Org(); } else if ("DSTU2_1".equals(fhirVersion)) { myCtx = FhirContext.forDstu2_1();
public VersionedApiConverterInterceptor() { myVersionConvertor_30_40 = new VersionConvertor_30_40(); VersionConvertorAdvisor40 advisor40 = new NullVersionConverterAdvisor40(); myVersionConvertor_10_40 = new VersionConvertor_10_40(advisor40); VersionConvertorAdvisor30 advisor30 = new NullVersionConverterAdvisor30(); myVersionConvertor_10_30 = new VersionConvertor_10_30(advisor30); myCtxDstu2 = FhirContext.forDstu2(); myCtxDstu2Hl7Org = FhirContext.forDstu2Hl7Org(); }
new org.hl7.fhir.instance.hapi.validation.DefaultProfileValidationSupport()); if (igPack != null) { FhirContext hl7orgCtx = FhirContext.forDstu2Hl7Org(); hl7orgCtx.setParserErrorHandler(new LenientErrorHandler(false)); IgPackParserDstu2 parser = new IgPackParserDstu2(hl7orgCtx); org.hl7.fhir.instance.model.StructureDefinition convertedSd = FhirContext.forDstu2Hl7Org().newXmlParser().parseResource(org.hl7.fhir.instance.model.StructureDefinition.class, ctx.newXmlParser().encodeResourceToString(localProfileResource)); instanceValidator.setStructureDefintion(convertedSd);
@Bean(name = "myFhirContextDstu2Hl7Org") @Lazy public FhirContext fhirContextDstu2Hl7Org() { if (ourFhirContextDstu2Hl7Org == null) { ourFhirContextDstu2Hl7Org = FhirContext.forDstu2Hl7Org(); } return ourFhirContextDstu2Hl7Org; }
static FhirContext getHl7OrgDstu2Ctx(FhirContext theCtx) { if (theCtx.getVersion().getVersion() == FhirVersionEnum.DSTU2_HL7ORG) { return theCtx; } FhirContext retVal = ourHl7OrgCtx; if (retVal == null) { retVal = FhirContext.forDstu2Hl7Org(); ourHl7OrgCtx = retVal; } return retVal; }
public FhirContext newContext() { switch (this) { case DSTU2: return FhirContext.forDstu2(); case DSTU2_HL7ORG: return FhirContext.forDstu2Hl7Org(); case DSTU2_1: return FhirContext.forDstu2_1(); case DSTU3: return FhirContext.forDstu3(); case R4: return FhirContext.forR4(); } throw new IllegalStateException("Unknown version: " + this); // should not happen }
@Override public Object evaluate(Exchange exchange) { if (!returnError) { Bundle resource = FhirContext.forDstu2Hl7Org().newXmlParser() .parseResource(Bundle.class, new InputStreamReader(getClass().getResourceAsStream("/FindSubmissionSetsResponse.xml"))); // The endpoint expects a list of resources rather than a bundle return resource.getEntry().stream() .map(Bundle.BundleEntryComponent::getResource) .collect(Collectors.toList()); } else { throw new InternalErrorException("Something went wrong"); } } }
@Override public Object evaluate(Exchange exchange) { if (!returnError) { Bundle resource = FhirContext.forDstu2Hl7Org().newXmlParser() .parseResource(Bundle.class, new InputStreamReader(getClass().getResourceAsStream("/FindDocumentReferencesResponse.xml"))); // The endpoint expects a list of resources rather than a bundle return resource.getEntry().stream() .map(Bundle.BundleEntryComponent::getResource) .collect(Collectors.toList()); } else { throw new InternalErrorException("Something went wrong"); } } }
public VersionedApiConverterInterceptor() { myVersionConvertor_30_40 = new VersionConvertor_30_40(); VersionConvertorAdvisor40 advisor40 = new NullVersionConverterAdvisor40(); myVersionConvertor_10_40 = new VersionConvertor_10_40(advisor40); VersionConvertorAdvisor30 advisor30 = new NullVersionConverterAdvisor30(); myVersionConvertor_10_30 = new VersionConvertor_10_30(advisor30); myCtxDstu2 = FhirContext.forDstu2(); myCtxDstu2Hl7Org = FhirContext.forDstu2Hl7Org(); }