Package de.gematik.bbriccs.fhir.codec
Class FhirCodec
java.lang.Object
de.gematik.bbriccs.fhir.codec.FhirCodec
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedFhirCodec(ca.uhn.fhir.context.FhirContext ctx, ValidatorFhir validator) -
Method Summary
Modifier and TypeMethodDescription<T extends org.hl7.fhir.r4.model.Resource>
T<T extends org.hl7.fhir.r4.model.Resource>
Tdecode(Class<T> expectedClass, String content, EncodingType encoding) org.hl7.fhir.r4.model.Resourceorg.hl7.fhir.r4.model.Resourcedecode(String content, EncodingType encoding) This method will decode the content to base resource without returning the concrete type of the resource.encode(org.hl7.fhir.instance.model.api.IBaseResource resource, EncodingType encoding) encode(org.hl7.fhir.instance.model.api.IBaseResource resource, EncodingType encoding, boolean prettyPrint) static FhirCodec.FhirCodecBuilderforR4()
-
Constructor Details
-
FhirCodec
-
-
Method Details
-
encode
-
encode
public String encode(org.hl7.fhir.instance.model.api.IBaseResource resource, EncodingType encoding, boolean prettyPrint) -
decode
-
decode
public <T extends org.hl7.fhir.r4.model.Resource> T decode(Class<T> expectedClass, String content, EncodingType encoding) -
decode
-
decode
This method will decode the content to base resource without returning the concrete type of the resource. Whenever the expected type of the concrete resource is known, it is recommended to use the decode-variant with type expectation- Parameters:
content- to be decoded to a FHIR-Resourceencoding- type of content- Returns:
- decoded base FHIR-Resource
-
forR4
-