Package org.hl7.fhir.r4b.elementmodel
Class SHCParser
- java.lang.Object
-
- org.hl7.fhir.r4b.elementmodel.ParserBase
-
- org.hl7.fhir.r4b.elementmodel.SHCParser
-
public class SHCParser extends ParserBase
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 Modifier and Type Class Description static classSHCParser.JWT-
Nested classes/interfaces inherited from class org.hl7.fhir.r4b.elementmodel.ParserBase
ParserBase.ILinkResolver, ParserBase.NamedElement, ParserBase.ValidationPolicy
-
-
Field Summary
Fields Modifier and Type Field Description static StringCURRENT_PACKAGE-
Fields inherited from class org.hl7.fhir.r4b.elementmodel.ParserBase
context, errors, linkResolver, policy, showDecorations
-
-
Constructor Summary
Constructors Constructor Description SHCParser(IWorkerContext context)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcompose(Element e, OutputStream destination, IParser.OutputStyle style, String base)SHCParser.JWTdecodeJWT(String jwt)static StringdecodeQRCode(String src)StringgetImpliedProfile()static byte[]inflate(byte[] data)List<ParserBase.NamedElement>parse(InputStream stream)-
Methods inherited from class org.hl7.fhir.r4b.elementmodel.ParserBase
getDefinition, getDefinition, getLinkResolver, isPrimitive, isShowDecorations, logError, parseSingle, setLinkResolver, setShowDecorations, setupValidation
-
-
-
-
Field Detail
-
CURRENT_PACKAGE
public static final String CURRENT_PACKAGE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SHCParser
public SHCParser(IWorkerContext context)
-
-
Method Detail
-
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
public String 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
public static String decodeQRCode(String src)
-
decodeJWT
public SHCParser.JWT decodeJWT(String jwt) throws IOException, DataFormatException
- Throws:
IOExceptionDataFormatException
-
inflate
public static final byte[] inflate(byte[] data) throws IOException, DataFormatException
- Throws:
IOExceptionDataFormatException
-
-