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.ValidationPolicy
-
Field Summary
Fields inherited from class org.hl7.fhir.r5.elementmodel.ParserBase
context, idPolicy, linkResolver, logical, policy, showDecorations, signatureServices
-
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 inStream) Methods inherited from class org.hl7.fhir.r5.elementmodel.ParserBase
getContext, getContextUtilities, getDefinition, getDefinition, getIdPolicy, getLinkResolver, getLogical, getPolicy, getProfileUtilities, getReferenceForElement, getSignatureServices, hasLogical, isPrimitive, isShowDecorations, logError, parseSingle, setIdPolicy, setLinkResolver, setLogical, setShowDecorations, setSignatureServices, setupValidation, wantCompose
-
Field Details
-
CURRENT_PACKAGE
- See Also:
-
-
Constructor Details
-
SHCParser
-
-
Method Details
-
parse
public List<ValidatedFragment> parse(InputStream inStream) 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
public SHCParser.JWT decodeJWT(List<org.hl7.fhir.utilities.validation.ValidationMessage> errors, String jwt) throws IOException, DataFormatException - Throws:
IOException
DataFormatException
-
inflate
- Throws:
IOException
DataFormatException
-