/** * Constructor which uses a default context and validation support object * * @param theStorageServices The storage services (this object will be used to retrieve various resources as required by the GraphQL engine) */ public GraphQLProvider(GraphQLEngine.IGraphQLStorageServices theStorageServices) { this(FhirContext.forR4(), new DefaultProfileValidationSupport(), theStorageServices); }
@SuppressWarnings("unused") public static void creatingContext() { // START SNIPPET: creatingContext // Create a context for DSTU2 FhirContext ctxDstu2 = FhirContext.forDstu2(); // Alternately, create a context for R4 FhirContext ctxR4 = FhirContext.forR4(); // END SNIPPET: creatingContext }
public BaseStructureParser(String theVersion, String theBaseDir) { myVersion = theVersion; myBaseDir = theBaseDir; myIsRi = myVersion.equals("dstu3"); if (myVersion.equals("r4")) { myCtx = FhirContext.forR4(); } else if (myVersion.equals("dstu3")) { myCtx = FhirContext.forDstu3(); } else if (myVersion.equals("dstu2")) { myCtx = FhirContext.forDstu2(); } }
@Bean @Primary public FhirContext fhirContextR4() { FhirContext retVal = FhirContext.forR4(); // Don't strip versions in some places ParserOptions parserOptions = retVal.getParserOptions(); parserOptions.setDontStripVersionsFromReferencesAtPaths("AuditEvent.entity.what"); return retVal; }
@Bean @Primary public FhirContext fhirContextR4() { FhirContext retVal = FhirContext.forR4(); // Don't strip versions in some places ParserOptions parserOptions = retVal.getParserOptions(); parserOptions.setDontStripVersionsFromReferencesAtPaths("AuditEvent.entity.reference"); return retVal; }
break; case "r4": fhirContext = FhirContext.forR4(); packageSuffix = ".r4"; break;
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 }
public static void parseMsg() { FhirContext ctx = FhirContext.forR4();
packageSuffix = ".dstu3"; } else if ("r4".equals(version)) { fhirContext = FhirContext.forR4(); packageSuffix = ".r4"; } else {
myCtx = FhirContext.forDstu3(); } else if ("R4".equals(fhirVersion)) { myCtx = FhirContext.forR4(); } else { throw new MojoFailureException("Unknown version: " + fhirVersion);
ctxR4 = FhirContext.forR4();
public AbstractFhirAuditEvent() { this(FhirContext.forR4()); }
packageSuffix = ".dstu3"; } else if ("r4".equals(context.getVersion())) { fhirContext = FhirContext.forR4(); packageSuffix = ".r4"; } else {
try { String loincCsString = IOUtils.toString(BaseHapiTerminologySvcImpl.class.getResourceAsStream("/ca/uhn/fhir/jpa/term/loinc/loinc.xml"), Charsets.UTF_8); loincCs = FhirContext.forR4().newXmlParser().parseResource(CodeSystem.class, loincCsString); } catch (IOException e) { throw new InternalErrorException("Failed to load loinc.xml", e);
/** * Constructor which uses a default context and validation support object * * @param theStorageServices The storage services (this object will be used to retrieve various resources as required by the GraphQL engine) */ public GraphQLProvider(GraphQLEngine.IGraphQLStorageServices theStorageServices) { this(FhirContext.forR4(), new DefaultProfileValidationSupport(), theStorageServices); }
@Bean @Primary public FhirContext fhirContextR4() { FhirContext retVal = FhirContext.forR4(); // Don't strip versions in some places ParserOptions parserOptions = retVal.getParserOptions(); parserOptions.setDontStripVersionsFromReferencesAtPaths("AuditEvent.entity.what"); 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 }
public static void main(String[] theArgs) { FhirContext ctx = FhirContext.forR4(); IGenericClient client = ctx.newRestfulGenericClient("http://fhirtest.uhn.ca/baseR4"); client.registerInterceptor(new LoggingInterceptor(false));
@Test public void testFHIRExport() throws Exception { FhirContext ctx = FhirContext.forR4(); FhirValidator validator = ctx.newValidator(); validator.setValidateAgainstStandardSchema(true);
Config.set("exporter.baseDirectory", tempFolder.newFolder().toString()); FhirContext ctx = FhirContext.forR4(); IParser parser = ctx.newJsonParser().setPrettyPrint(true);