Class ChVacdParser
java.lang.Object
org.projecthusky.fhir.vacd.ch.common.service.ChVacdParser
Parser for CH-VACD documents.
-
Constructor Summary
ConstructorsConstructorDescriptionChVacdParser(@Nullable ca.uhn.fhir.context.FhirContext fhirR4Context) Constructor for the parser. -
Method Summary
Modifier and TypeMethodDescriptionprotected ca.uhn.fhir.parser.IParsergetParser(ca.uhn.fhir.rest.api.EncodingEnum encoding, @Nullable ChVacdDocumentType type) Creates a FHIR parser for the given encoding.<T extends ChVacdAbstractDocument>
Tparse(String resource, ChVacdDocumentType type) Parses the given resource as a CH-VACD document.
-
Constructor Details
-
ChVacdParser
public ChVacdParser(@Nullable ca.uhn.fhir.context.FhirContext fhirR4Context) Constructor for the parser.
-
-
Method Details
-
parse
Parses the given resource as a CH-VACD document.- Parameters:
resource- The resource to parse.type- The document type to use for parsing.- Returns:
- the parsed document.
- Throws:
InvalidVacdContentException- if the content is invalid or not a CH-VACD document.
-
getParser
protected ca.uhn.fhir.parser.IParser getParser(ca.uhn.fhir.rest.api.EncodingEnum encoding, @Nullable ChVacdDocumentType type) Creates a FHIR parser for the given encoding. If the document type is given, it'll also configure the preferred types for this document type (i.e. to use resources fromorg.projecthusky.fhir.emed.ch.common.resourceandorg.projecthusky.fhir.emed.ch.epr.resourceover HAPI's resources).- Parameters:
encoding- The encoding to use (XML, JSON, NDJSON or RDF).type- The document type ornullto disable the preferred types (not needed for serialization).- Returns:
- the created parser.
-