
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.IdRenderingPolicy, ParserBase.ILinkResolver, ParserBase.ValidationPolicy -
Field Summary
FieldsFields inherited from class org.hl7.fhir.r5.elementmodel.ParserBase
canonicalFilter, context, idPolicy, linkResolver, logical, policy, showDecorations, signatureServices -
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 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, setCanonicalFilter, setIdPolicy, setLinkResolver, setLogical, setShowDecorations, setSignatureServices, setupValidation, urlTail, 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:
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
public SHCParser.JWT decodeJWT(List<org.hl7.fhir.utilities.validation.ValidationMessage> errors, String jwt) throws IOException, DataFormatException - Throws:
IOExceptionDataFormatException
-
inflate
- Throws:
IOExceptionDataFormatException
-