public Resource ParseJson(JsonReader reader) { SummaryTypeMap Map = new SummaryTypeMap(); try { FhirJsonParser FhirJsonParser = new FhirJsonParser(); return(FhirJsonParser.Parse <Resource>(reader)); } catch (Exception oExec) { throw new Bug.Common.Exceptions.FhirFatalException(System.Net.HttpStatusCode.InternalServerError, oExec.Message); } }
public string SerializeToXml(Resource resource, Bug.Common.Enums.SummaryType summaryType = Bug.Common.Enums.SummaryType.False) { SummaryTypeMap Map = new SummaryTypeMap(); try { FhirXmlSerializer FhirXmlSerializer = new FhirXmlSerializer(); return(FhirXmlSerializer.SerializeToString(resource, Map.GetForward(summaryType))); } catch (Exception oExec) { throw new Bug.Common.Exceptions.FhirFatalException(System.Net.HttpStatusCode.InternalServerError, oExec.Message); } }
public byte[] SerializeToJsonBytes(IFhirResourceR4 fhirResource, Bug.Common.Enums.SummaryType summaryType = Bug.Common.Enums.SummaryType.False) { SummaryTypeMap Map = new SummaryTypeMap(); try { FhirJsonSerializer FhirJsonSerializer = new FhirJsonSerializer(new SerializerSettings() { Pretty = false, AppendNewLine = false }); return(FhirJsonSerializer.SerializeToBytes(fhirResource.R4, Map.GetForward(summaryType))); } catch (Exception oExec) { throw new Bug.Common.Exceptions.FhirFatalException(System.Net.HttpStatusCode.InternalServerError, oExec.Message); } }