5.4.1 DocumentRetrieveRequest Element Requirements
7 min
api information oknjknjknj the documentretrieverequest is a get message that will use the following web service api endpoint information to retrieve a document through surescripts operation api endpoint description description document retrieve get \[base]/binary?documentid=\&repository id>\&homecommunityid= returns the document in binary form note as a responder you will be responsible for defining the endpoint information and url for others to retrieve documents from your system that information is returned in the documentsearchresponse from your system content types and encodings according to section 3 1 0 1 9 of the fhir® specification content types and encodings, “the formal mime type for fhir® resources is application/fhir+json or application/fhir+xml the correct mime type shall be used by clients and servers ” later in that same section, “utf 8 encoding shall be used for the mime type application/fhir this may be specified as a mime type parameter to the application/fhir mime type, but is not required” because fhir® uses utf 8 for all request and response bodies since the http specification (section 3 7 1) defines a default character encoding of iso 8859 1, requests and responses shall explicitly set the character encoding to utf 8 using the charset parameter of the mime type in the content type header requests may also specify this charset parameter in the accept header and/or use the accept charset header ” because of these requirements, requests/responses will need to include a content type in the http header below is an example content type application/fhir+json; charset=utf 8 note charset=utf 8 is not required by surescripts, but is supported if sent accept header content v the format request parameter the fhir r4 specifications state that documents should be returned based on how they were requested which could be either via bundles with base64 encoded contents within a bundle or as streamed content the accept request header field within a document retrieve request can be used to specify the media types that are acceptable for each response if "application/fhir+xml" or "application/fhir+json" is specified in a request header’s accept field, the document will be returned via fhir bundles documents (ex ccdas, plqs, binary files) that are returned to document requesters via bundles within the fhir responses need to be base64 encoded if other, ex "application/pdf" (or other binary types), the requested document will be streamed directly to the requester alternatively, the fhir® rle product also supports the use of the “ format” parameter as described in section 3 1 0 1 11 of the fhir® specification as a way for document requestors to specify their preference to receive requested documents in a format other than what is included in the http header (for situations where a requesting application can control the contents of their requests, but not the http header due to the use of 3rd party communication software or other limitations) request example with “ format” parameter https //rle surescripts net/fhir/r4/binary?documentid=ccda123\&repositoryid=urn oid 44 5555 66=urn\ oid 77 8888 99& format=application/fhir+json be sure to note that use of the “ format” parameter in the request overrides any media request types specified in a request’s message header accept field 5 4 10 documentretrieverequest example the following url and http header example would return a bundled response in the json format https //rle surescripts net/fhir/binary?documentid=2 16 840 1 113883 3 2054 2 1 128118651\&repositoryid=2 16 840 1 113883 3 2054 2 1\&homecommunityid=2 16 840 1 113883 3 2054 2 1 accept application/fhir+json accept encoding gzip,deflate connection keep alive content type application/fhir+json originator assigning authority 2 11 222 3 444444 5 666 7 2 originator home community id urn\ oid\ afrvay originator message id 3bb7cae9 e835 4844 a3ae 1c41abcea564 originator organization name abc medical software originator patient identifier 1002318246 originator user id smjo1234579 originator user name abc user originator user role code 106289002 purpose of use code treatment user agent apache httpclient/4 5 13 (java/11 0 5) x ssl client cert issuer abc cert issuer x ssl client cert subject abc cert subject 5 4 11 documentretrieveresponse element requirements documents will be returned based on how they were requested (see documentretrieverequest) which could either be via bundles with base64 encoded contents within a bundle, or as content streamed directly to the requestor in the format (without encoding) that was specified by the contenttype of the requested document the table below outlines the requirements for the bundle resource used in the documentretrieveresponse message note this guide includes data elements only where surescripts has specific requirements or further explains the field usage refer to the bundle fhir resource for a complete list of fields { "name" "", "method" "get", "url" "", "description" "get a cake by its id", "tab" "examples", "examples" { "languages" \[ { "id" "ey04usixtmhzudtrsw0cw", "language" "javascript", "code" "", "customlabel" "" } ], "selectedlanguageid" "ey04usixtmhzudtrsw0cw" }, "results" { "languages" \[ { "id" "8d1z6g18ceuvryux9oqby", "language" "200", "code" "{\n \\"name\\" \\"cake's name\\",\n}", "customlabel" "" }, { "id" "lxxzqmvbaocityawojoas", "language" "404", "code" "{\n \\"message\\" \\"ain't no cake like that \\"\n}", "customlabel" "" } ], "selectedlanguageid" "8d1z6g18ceuvryux9oqby" }, "request" { "pathparameters" \[], "queryparameters" \[], "headerparameters" \[], "bodydataparameters" \[ { "name" "resource type", "kind" "required", "type" "string", "description" "identifies this as a bundle resource ", "" "required" }, { "name" "id", "kind" "optional", "type" "string", "description" "logical identifier for the response bundle ", "" "logical identifier for the response bundle " }, { "name" "type", "kind" "required", "type" "string", "description" "indicates the purpose of this bundle – how it is intended to be used \nfixed value searchset", "" "indicates the purpose of this bundle – how it is intended to be used \nfixed value searchset" }, { "name" "entry ", "kind" "required", "type" "string", "description" "search results returned by the documentsearch operation ", "" "search results returned by the documentsearch operation " }, { "name" "resource", "kind" "optional", "type" "string", "description" "a resource that represents the data of a single raw artifact as digital content accessible in its native format a binary resource can contain any content, whether text, image, pdf, zip archive, etc \ncomments\ntypically, binary resources are used for handling content such as \n\t•\tcda documents (i e with xds)\n\t•\tpdf documents\n\t•\timages (the media resource is preferred for handling images, but not possible when the content is already binary e g xds) ", "" "a resource that represents the data of a single raw artifact as digital content accessible in its native format a binary resource can contain any content, whether text, image, pdf, zip archive, etc \ncomments\ntypically, binary resources are used for handling content such as \n\t•\tcda documents (i e with xds)\n\t•\tpdf documents\n\t•\timages (the media resource is preferred for handling images, but not possible when the content is already binary e g xds) " }, { "name" "resourcetype", "kind" "optional", "type" "string", "description" "fixed value binary", "" "fixed value binary" }, { "name" "id", "kind" "optional", "type" "string", "description" "logical identifier for the binary resource ", "" "logical identifier for the binary resource " }, { "name" "contenttype", "kind" "optional", "type" "string", "description" "mime type of the document (e g , image/jpeg, application/pdf) ", "" "mime type of the document (e g , image/jpeg, application/pdf) " }, { "name" "data ", "kind" "optional", "type" "string", "description" "base64 encoded document content ", "" "base64 encoded document content " } ], "formdataparameters" \[] }, "currentnewparameter" { "label" "body parameter", "value" "bodydataparameters" }, "hastryitout" false, "response" \[ { "name" "id", "kind" "optional", "type" "string", "description" "id of the cake retrieved" } ], "autogeneratedanchorslug" "iceps n99gyup3uj fe t", "legacyhash" "iceps n99gyup3uj fe t" } 5 4 12 documentretrieveresponse message example { "resourcetype" "bundle", "id" "f98511eb a5a2 4ecf 8ee9 c6d35bb3bb99", "type" "searchset", "entry" \[ { "resource" { "resourcetype" "binary", "id" "16dade3d e45b 4be4 889b c0ca65bc9367", "contenttype" "image/jpeg", "data" "ivborw0kggoaaaansuheugaaamqaaac0cayaaaa6sdc6…(base64 content truncated for readability)…suvork5cyii=" } } ] }