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 classes/interfaces inherited from class org.hl7.fhir.r5.elementmodel.ParserBase
ParserBase.IdRenderingPolicy, ParserBase.ILinkResolver, ParserBase.NamedElement, ParserBase.ValidationPolicy
-
Field Summary
Fields inherited from class org.hl7.fhir.r5.elementmodel.ParserBase
context, errors, idPolicy, linkResolver, logical, policy, showDecorations
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
compose
(Element e, OutputStream destination, IParser.OutputStyle style, String base) static String
decodeQRCode
(String src) static final byte[]
inflate
(byte[] data) parse
(InputStream stream) Methods inherited from class org.hl7.fhir.r5.elementmodel.ParserBase
getDefinition, getDefinition, getIdPolicy, getLinkResolver, getLogical, hasLogical, isPrimitive, isShowDecorations, logError, parseSingle, setIdPolicy, setLinkResolver, setLogical, setShowDecorations, setupValidation, wantCompose
-
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:
parse
in classParserBase
- Throws:
IOException
org.hl7.fhir.exceptions.FHIRFormatError
org.hl7.fhir.exceptions.DefinitionException
org.hl7.fhir.exceptions.FHIRException
-
getImpliedProfile
- Overrides:
getImpliedProfile
in classParserBase
-
compose
public void compose(Element e, OutputStream destination, IParser.OutputStyle style, String base) throws org.hl7.fhir.exceptions.FHIRException, IOException - Specified by:
compose
in classParserBase
- Throws:
org.hl7.fhir.exceptions.FHIRException
IOException
-
decodeQRCode
-
decodeJWT
- Throws:
IOException
DataFormatException
-
inflate
- Throws:
IOException
DataFormatException
-