我剛剛開始使用FHIR和json,所以我的問題可能不會被問到。FHIR JSON在BizTalk中的XML解碼
我已經建立了一個BizTalk管道組件使用這個庫,https://github.com/ewoutkramer/fhir-net-api,基於一個例子,我發現這裏FHIR JSON的轉換爲FHIR-XML,http://soapfault.com/blog/2016/08/hl7-fhir-json-decoding-in-biztalk/
下面是從管道組件的代碼片段。這與例子幾乎相同。
//Read the json message
using (TextReader tr = new StreamReader(originalDataStream))
{
json = tr.ReadToEnd();
}
//Use FHIR-NET-API to create a FHIR resource from the json
Hl7.Fhir.Serialization.ResourceReader resourceReader = new Hl7.Fhir.Serialization.ResourceReader(FhirJsonParser.CreateFhirReader(json), ParserSettings.Default);
//Use FHIR-NET-API to serialize the resource to XML
byte[] resourceXmlBytes = Hl7.Fhir.Serialization.FhirSerializer.SerializeToXmlBytes(resourceReader.Deserialize());
管道組件能夠解碼與 { "resourceType": "ImagingStudy",
啓動任何單一的JSON FHIR消息,但我得到一個解析錯誤,對像這樣開頭的消息,
{
"resourceType" : "Bundle",
"entry" : [{
"resource" : {
"resourceType" : "ImagingStudy",
或
{
"entry": [
{
"fullUrl": "http://fhirtest.uhn.ca/baseDstu2/ImagingStudy/EXexample",
"resource": {
"resourceType": "ImagingStudy",
這裏是一個公司我已經得到了錯誤的uple,
There was a failure executing the receive pipeline: "LALALA.Imaging.Pipelines.FHIRJasonDecoderRP, LALALA.Imaging.Pipelines, Version=1.0.0.0, Culture=neutral, PublicKeyToken=19bb8b5ea64396aa" Source: "FHIRJsonDecoder" Receive Port: "RP_LA_Test_FILE" URI: "D:\Projects\LALALA.Imaging\In\*.json" Reason: Data at the root level is invalid. Line 1, position 1.
OR
Reason: At line 1, pos 1: Cannot determine type of resource to create from json input data: no member resourceType was found
對於我的解決方案的最終目標是要FHIR圖像研究的消息能夠解析捆綁成單一fhir XML消息,然後,這將是映射到HL7 ORU消息。
任何與上述問題的幫助或如何使用BizTalk實現我的最終目標的建議將不勝感激。
感謝Ewout,我能編輯我的一些樣品的「捆綁」的消息,並得到管道來解碼爲XML。我仍然不確定其他人有什麼問題,但現在我有一個可參考的實例。 – David