Package org.hl7.fhir.r5.elementmodel
Class SHCParser
java.lang.Object
org.hl7.fhir.r5.elementmodel.ParserBase
org.hl7.fhir.r5.elementmodel.SHCParser
this class is actually a smart health cards validator.
It's going to parse the JWT and assume that it contains
a smart health card, which has a nested bundle in it, and
then validate the bundle.
See https://spec.smarthealth.cards/#health-cards-are-encoded-as-compact-serialization-json-web-signatures-jws
This parser dose the JWT work, and then passes the JsonObject through to the underlying JsonParser
Error locations are in the decoded payload
- Author:
- grahame
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.hl7.fhir.r5.elementmodel.ParserBase
ParserBase.ILinkResolver, ParserBase.NamedElement, ParserBase.ValidationPolicy -
Field Summary
FieldsFields inherited from class org.hl7.fhir.r5.elementmodel.ParserBase
context, errors, linkResolver, policy, showDecorations -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcompose(Element e, OutputStream destination, IParser.OutputStyle style, String base) static StringdecodeQRCode(String src) static final byte[]inflate(byte[] data) parse(InputStream stream) Methods inherited from class org.hl7.fhir.r5.elementmodel.ParserBase
getDefinition, getDefinition, getLinkResolver, isPrimitive, isShowDecorations, logError, parseSingle, setLinkResolver, setShowDecorations, setupValidation
-
Field Details
-
CURRENT_PACKAGE
- See Also:
-
-
Constructor Details
-
SHCParser
-
-
Method Details
-
parse
public List<ParserBase.NamedElement> parse(InputStream stream) throws IOException, org.hl7.fhir.exceptions.FHIRFormatError, org.hl7.fhir.exceptions.DefinitionException, org.hl7.fhir.exceptions.FHIRException - Specified by:
parsein classParserBase- Throws:
IOExceptionorg.hl7.fhir.exceptions.FHIRFormatErrororg.hl7.fhir.exceptions.DefinitionExceptionorg.hl7.fhir.exceptions.FHIRException
-
getImpliedProfile
- Overrides:
getImpliedProfilein classParserBase
-
compose
public void compose(Element e, OutputStream destination, IParser.OutputStyle style, String base) throws org.hl7.fhir.exceptions.FHIRException, IOException - Specified by:
composein classParserBase- Throws:
org.hl7.fhir.exceptions.FHIRExceptionIOException
-
decodeQRCode
-
decodeJWT
- Throws:
IOExceptionDataFormatException
-
inflate
- Throws:
IOExceptionDataFormatException
-